UNPKG

projectmanager-sdk

Version:

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

57 lines 1.83 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 TaskMetadataClient { client; /** * Internal constructor for this client library */ constructor(client) { this.client = client; } /** * Adds a metadata to a task * * @param taskId Task ID * @param isSystem If metadata is for system or customer, isSystem = true is only of ProjectManager * @param isOverride If false we merge with the keys * @param body The metadata */ addMetadata(taskId, body, isSystem, isOverride) { const url = `/api/data/tasks/${taskId}/metadata`; const options = { params: { 'isSystem': isSystem, 'isOverride': isOverride, }, }; return this.client.request("put", url, options, body); } /** * Get tasks by project ID and foreign key ID * * @param foreignKey Foreign Key ID * @param projectId Project ID * @param isSystem If metadata is for system or customer, isSystem = true is only of ProjectManager */ taskMetadataSearch(projectId, foreignKey, isSystem) { const url = `/api/data/projects/${projectId}/tasks/metadata`; const options = { params: { 'foreignKey': foreignKey, 'isSystem': isSystem, }, }; return this.client.request("get", url, options, null); } } //# sourceMappingURL=TaskMetadataClient.js.map