projectmanager-sdk
Version:
Software development kit for the ProjectManager.com API. for TypeScript
62 lines • 2.06 kB
JavaScript
/**
* 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 ProjectCustomerClient {
client;
/**
* Internal constructor for this client library
*/
constructor(client) {
this.client = client;
}
/**
* Retrieves all ProjectCustomers defined within your Workspace.
*
* A ProjectCustomer is a code used to identify customers associated with your Projects. Each
* ProjectCustomer has a name and a unique identifier. ProjectCustomers are defined per
* Workspace and are shared among Projects.
*
*/
retrieveProjectCustomers() {
const url = `/api/data/projects/customers`;
return this.client.request("get", url, null, null);
}
/**
* Create a project customer
*
* @param body The data to create the customer
*/
createProjectCustomer(body) {
const url = `/api/data/projects/customers`;
return this.client.request("post", url, null, body);
}
/**
* Updates a project customer
*
* @param customerId The id of the customer to update
* @param body The data to update
*/
updateProjectCustomer(customerId, body) {
const url = `/api/data/projects/customers/${customerId}`;
return this.client.request("put", url, null, body);
}
/**
* Delete a project customer. They will also be removed from any projects they were assigned too.
*
* @param customerId The id of the customer to remove
*/
deleteProjectCustomer(customerId) {
const url = `/api/data/projects/customers/${customerId}`;
return this.client.request("delete", url, null, null);
}
}
//# sourceMappingURL=ProjectCustomerClient.js.map