UNPKG

projectmanager-sdk

Version:

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

111 lines 5.17 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 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); } /** * Sets or replaces the value of a ProjectField for a specific Project within your Workspace. * This updates the stored value (e.g. "High", "123", "2025-01-15") for that project–field combination, * not the field definition itself. Use UpdateProjectField or UpdateProjectFieldOptions to change * the field's name or dropdown options. * * 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 to set this field value * @param fieldId The unique identifier or short ID of the ProjectField * @param body The new value for this ProjectField on the specified Project */ 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