projectmanager-sdk
Version:
Software development kit for the ProjectManager.com API. for TypeScript
108 lines • 4.9 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 ProjectFieldClient {
client;
/**
* Internal constructor for this client library
*/
constructor(client) {
this.client = client;
}
/**
* Retrieves all ProjectFields defined within your Workspace.
*
* A ProjectField is a custom field defined within your Workspace. You can define ProjectFields
* for any integration purpose that is important to your business. Each ProjectField has a data
* type as well as options in how it is handled. ProjectFields can be edited for each Project
* within your Workspace.
*
*/
retrieveProjectFields() {
const url = `/api/data/projects/fields`;
return this.client.request("get", url, null, null);
}
/**
* Creates a new ProjectField within your Workspace.
*
* A ProjectField is a custom field defined within your Workspace. You can define ProjectFields
* for any integration purpose that is important to your business. Each ProjectField has a data
* type as well as options in how it is handled. ProjectFields can be edited for each Project
* within your Workspace.
*
* @param body Information about the ProjectField to create
*/
createProjectField(body) {
const url = `/api/data/projects/fields`;
return this.client.request("post", url, null, body);
}
/**
* Deletes an existing ProjectField within your Workspace.
*
* A ProjectField is a custom field defined within your Workspace. You can define ProjectFields
* for any integration purpose that is important to your business. Each ProjectField has a data
* type as well as options in how it is handled. ProjectFields can be edited for each Project
* within your Workspace.
*
* @param fieldId The unique identifier or short ID of this ProjectField
*/
deleteProjectField(fieldId) {
const url = `/api/data/projects/fields/${fieldId}`;
return this.client.request("delete", url, null, null);
}
/**
* Replaces the current value of a ProjectField for a specific Project within your Workspace.
*
* A ProjectField is a custom field defined within your Workspace. You can define ProjectFields
* for any integration purpose that is important to your business. Each ProjectField has a data
* type as well as options in how it is handled. ProjectFields can be edited for each Project
* within your Workspace.
*
* @param projectId The unique identifier of the Project that contains this ProjectField
* @param fieldId The unique identifier or short ID of this ProjectField
* @param body The new information for this ProjectField
*/
updateProjectFieldValue(projectId, fieldId, body) {
const url = `/api/data/projects/${projectId}/fields/${fieldId}`;
return this.client.request("put", url, null, body);
}
/**
* Retrieves the current ProjectField value for a particular Project and ProjectField.
*
* A ProjectField is a custom field defined within your Workspace. You can define ProjectFields
* for any integration purpose that is important to your business. Each ProjectField has a data
* type as well as options in how it is handled. ProjectFields can be edited for each Project
* within your Workspace.
*
* @param projectId The unique identifier of the Project of the value to retrieve
* @param fieldId The unique identifier or short ID of the ProjectField of the value to retrieve
*/
retrieveProjectFieldValue(projectId, fieldId) {
const url = `/api/data/projects/${projectId}/fields/${fieldId}`;
return this.client.request("get", url, null, null);
}
/**
* Retrieves all ProjectField values for a particular Project.
*
* A ProjectField is a custom field defined within your Workspace. You can define ProjectFields
* for any integration purpose that is important to your business. Each ProjectField has a data
* type as well as options in how it is handled. ProjectFields can be edited for each Project
* within your Workspace.
*
* @param projectId The unique identifier of the Project for which we want ProjectField values
*/
retrieveAllProjectFieldValues(projectId) {
const url = `/api/data/projects/${projectId}/fields`;
return this.client.request("get", url, null, null);
}
}
//# sourceMappingURL=ProjectFieldClient.js.map