/**
* Copyright 2014 Upwork
*
* Licensed under the Upwork's API Terms of Use;
* you may not use this file except in compliance with the Terms.
* You may obtain a copy of the Terms at
*
* https://developers.upwork.com/api-tos.html
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.Upwork.api.Routers;
import java.util.HashMap;
import com.Upwork.ClassPreamble;
import com.Upwork.api.OAuthClient;
import org.json.JSONException;
import org.json.JSONObject;
@ClassPreamble (
author = "Maksym Novozhylov <mnovozhilov@upwork.com>",
date = "6/3/2014",
currentRevision = 1,
lastModified = "6/3/2014",
lastModifiedBy = "Maksym Novozhylov",
reviewers = {"Yiota Tsakiri"}
)
public final class Teams {
final static String ENTRY_POINT = "api";
private OAuthClient oClient = null;
public Teams(OAuthClient client) {
oClient = client;
oClient.setEntryPoint(ENTRY_POINT);
}
/**
* Get Team Rooms
*
* @throws JSONException If error occurred
* @return {@link JSONObject}
*/
public JSONObject getList() throws JSONException {
return oClient.get("/team/v2/teamrooms");
}
/**
* Get specific team or company
*
* @param team Teamroom or company ID
* @param params (Optional) Parameters
* @throws JSONException If error occurred
* @return {@link JSONObject}
*/
public JSONObject getSpecific(String team, HashMap<String, String> params) throws JSONException {
return oClient.get("/team/v2/teamrooms/" + team, params);
}
}