UNPKG

projectmanager-sdk

Version:

Software development kit for the ProjectManager.com API. for TypeScript

76 lines 2.72 kB
/** * ProjectManager API for TypeScript * * (c) ProjectManager.com, Inc. * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. * * @author ProjectManager.com <support@projectmanager.com> * @copyright ProjectManager.com, Inc. * @link https://github.com/projectmgr/projectmanager-sdk-typescript */ export class ResourceTeamClient { client; /** * Internal constructor for this client library */ constructor(client) { this.client = client; } /** * Retrieves all ResourceTeams defined within your Workspace that match an [OData formatted query](https://www.odata.org/). * * A ResourceTeam is a grouping of Resources that allows you to keep track of assignments * in a manner consistent with your business needs. You can assign Resources to be members * of zero, one, or many ResourceTeams. * * @param top The number of records to return * @param skip Skips the given number of records and then returns $top records * @param filter Filter the expression according to oData queries * @param orderby Order collection by this field. * @param expand Include related data in the response */ retrieveResourceTeams(top, skip, filter, orderby, expand) { const url = `/api/data/resources/teams`; const options = { params: { '$top': top, '$skip': skip, '$filter': filter, '$orderby': orderby, '$expand': expand, }, }; return this.client.request("get", url, options, null); } /** * Create a Resource Team. * * @param body The name of the team to create. */ createResourceTeam(body) { const url = `/api/data/resources/teams`; return this.client.request("post", url, null, body); } /** * The endpoint is used to delete a resource team. Users assigned to this team will no longer be assigned thereafter. * * @param resourceTeamId The Id of the team to be removed. */ deleteResourceTeam(resourceTeamId) { const url = `/api/data/resources/teams/${resourceTeamId}`; return this.client.request("delete", url, null, null); } /** * Update a Resource Team. * * @param teamresourceId The id of the resource team * @param body The name of the team to Update. */ updateResourceTeam(teamresourceId, body) { const url = `/api/data/resources/teams/${teamresourceId}`; return this.client.request("put", url, null, body); } } //# sourceMappingURL=ResourceTeamClient.js.map