pipedrive 22.2.0 → 22.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. package/README.md +75 -0
  2. package/dist/api/ProjectTemplatesApi.js +258 -0
  3. package/dist/api/ProjectsApi.js +846 -0
  4. package/dist/api/TasksApi.js +328 -0
  5. package/dist/index.js +371 -0
  6. package/dist/model/AddProjectResponse201.js +96 -0
  7. package/dist/model/AddTaskResponse201.js +96 -0
  8. package/dist/model/DeleteProject.js +88 -0
  9. package/dist/model/DeleteProjectData.js +78 -0
  10. package/dist/model/DeleteProjectResponse200.js +96 -0
  11. package/dist/model/DeleteTask.js +88 -0
  12. package/dist/model/DeleteTaskData.js +78 -0
  13. package/dist/model/DeleteTaskResponse200.js +96 -0
  14. package/dist/model/FilterType.js +1 -0
  15. package/dist/model/FullProjectObject.js +324 -0
  16. package/dist/model/FullTaskObject.js +250 -0
  17. package/dist/model/GetProjectBoardResponse200.js +96 -0
  18. package/dist/model/GetProjectBoardsResponse200.js +96 -0
  19. package/dist/model/GetProjectGroupsResponse200.js +96 -0
  20. package/dist/model/GetProjectPhaseResponse200.js +96 -0
  21. package/dist/model/GetProjectPhasesResponse200.js +96 -0
  22. package/dist/model/GetProjectPlanResponse200.js +96 -0
  23. package/dist/model/GetProjectResponse200.js +96 -0
  24. package/dist/model/GetProjectTemplateResponse200.js +96 -0
  25. package/dist/model/GetProjectTemplatesResponse200.js +97 -0
  26. package/dist/model/GetProjectsResponse200.js +97 -0
  27. package/dist/model/GetTaskResponse200.js +96 -0
  28. package/dist/model/GetTasksResponse200.js +97 -0
  29. package/dist/model/ProjectBoardObject.js +118 -0
  30. package/dist/model/ProjectGroupsObject.js +98 -0
  31. package/dist/model/ProjectId.js +78 -0
  32. package/dist/model/ProjectMandatoryObjectFragment.js +98 -0
  33. package/dist/model/ProjectNotChangeableObjectFragment.js +108 -0
  34. package/dist/model/ProjectObjectFragment.js +158 -0
  35. package/dist/model/ProjectPhaseObject.js +128 -0
  36. package/dist/model/ProjectPlanItemObject.js +108 -0
  37. package/dist/model/ProjectPostObject.js +286 -0
  38. package/dist/model/ProjectPostObjectAllOf.js +78 -0
  39. package/dist/model/ProjectPutObject.js +259 -0
  40. package/dist/model/ProjectPutPlanItemBodyObject.js +88 -0
  41. package/dist/model/ProjectResponseObject.js +334 -0
  42. package/dist/model/RequiredPostProjectParameters.js +105 -0
  43. package/dist/model/RequiredPostTaskParameters.js +93 -0
  44. package/dist/model/TaskId.js +78 -0
  45. package/dist/model/TaskMandatoryObjectFragment.js +88 -0
  46. package/dist/model/TaskNotChangeableObjectFragment.js +108 -0
  47. package/dist/model/TaskObjectFragment.js +119 -0
  48. package/dist/model/TaskPostObject.js +190 -0
  49. package/dist/model/TaskPutObject.js +185 -0
  50. package/dist/model/TaskResponseObject.js +260 -0
  51. package/dist/model/TemplateObject.js +138 -0
  52. package/dist/model/TemplateResponseObject.js +179 -0
  53. package/dist/model/UpdateProjectResponse200.js +96 -0
  54. package/dist/model/UpdateTaskResponse200.js +96 -0
  55. package/dist/model/UpdatedActivityPlanItem200.js +96 -0
  56. package/dist/model/UpdatedTaskPlanItem200.js +96 -0
  57. package/package.json +1 -1
@@ -0,0 +1,846 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
+ var _ApiClient = _interopRequireDefault(require("../ApiClient"));
12
+ var _AddProjectResponse = _interopRequireDefault(require("../model/AddProjectResponse201"));
13
+ var _DeleteProjectResponse = _interopRequireDefault(require("../model/DeleteProjectResponse200"));
14
+ var _GetActivitiesCollectionResponse = _interopRequireDefault(require("../model/GetActivitiesCollectionResponse200"));
15
+ var _GetProjectBoardsResponse = _interopRequireDefault(require("../model/GetProjectBoardsResponse200"));
16
+ var _GetProjectGroupsResponse = _interopRequireDefault(require("../model/GetProjectGroupsResponse200"));
17
+ var _GetProjectPhasesResponse = _interopRequireDefault(require("../model/GetProjectPhasesResponse200"));
18
+ var _GetProjectPlanResponse = _interopRequireDefault(require("../model/GetProjectPlanResponse200"));
19
+ var _GetProjectResponse = _interopRequireDefault(require("../model/GetProjectResponse200"));
20
+ var _GetProjectsResponse = _interopRequireDefault(require("../model/GetProjectsResponse200"));
21
+ var _GetTasksResponse = _interopRequireDefault(require("../model/GetTasksResponse200"));
22
+ var _ProjectPostObject = _interopRequireDefault(require("../model/ProjectPostObject"));
23
+ var _ProjectPutObject = _interopRequireDefault(require("../model/ProjectPutObject"));
24
+ var _ProjectPutPlanItemBodyObject = _interopRequireDefault(require("../model/ProjectPutPlanItemBodyObject"));
25
+ var _UpdateProjectResponse = _interopRequireDefault(require("../model/UpdateProjectResponse200"));
26
+ var _UpdatedActivityPlanItem = _interopRequireDefault(require("../model/UpdatedActivityPlanItem200"));
27
+ var _UpdatedTaskPlanItem = _interopRequireDefault(require("../model/UpdatedTaskPlanItem200"));
28
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
29
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
30
+ /**
31
+ * Projects service.
32
+ * @module api/ProjectsApi
33
+ * @version 1.0.0
34
+ */
35
+ var ProjectsApi = /*#__PURE__*/function () {
36
+ /**
37
+ * Constructs a new ProjectsApi.
38
+ * @alias module:api/ProjectsApi
39
+ * @class
40
+ * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
41
+ * default to {@link module:ApiClient#instance} if unspecified.
42
+ */
43
+ function ProjectsApi(apiClient) {
44
+ (0, _classCallCheck2["default"])(this, ProjectsApi);
45
+ this.apiClient = apiClient;
46
+ }
47
+
48
+ /**
49
+ * Add a project
50
+ * Adds a new project. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys.
51
+ * @param {Object} opts Optional parameters
52
+ * @param {module:model/ProjectPostObject} opts.projectPostObject
53
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/AddProjectResponse201} and HTTP response
54
+ */
55
+ (0, _createClass2["default"])(ProjectsApi, [{
56
+ key: "addProjectWithHttpInfo",
57
+ value: function addProjectWithHttpInfo(opts) {
58
+ opts = opts || {};
59
+ var postBody = opts['projectPostObject'];
60
+ var pathParams = {};
61
+ var queryParams = {};
62
+ var headerParams = {};
63
+ var formParams = {};
64
+ var formParamArray = [];
65
+ var contentTypes = ['application/json'];
66
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
67
+ var isJSON = contentTypes.includes('application/json');
68
+ if (isJSON) {
69
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
70
+ } else if (isURLEncoded) {
71
+ for (var key in opts) {
72
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
73
+ formParams[key] = opts[key];
74
+ }
75
+ }
76
+ }
77
+ var authNames = ['api_key', 'oauth2'];
78
+ var accepts = ['application/json'];
79
+ var returnType = _AddProjectResponse["default"];
80
+ return this.apiClient.callApi('/projects', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
81
+ }
82
+
83
+ /**
84
+ * Add a project
85
+ * Adds a new project. Note that you can supply additional custom fields along with the request that are not described here. These custom fields are different for each Pipedrive account and can be recognized by long hashes as keys.
86
+ * @param {Object} opts Optional parameters
87
+ * @param {module:model/ProjectPostObject} opts.projectPostObject
88
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/AddProjectResponse201}
89
+ */
90
+ }, {
91
+ key: "addProject",
92
+ value: function addProject(opts) {
93
+ return this.addProjectWithHttpInfo(opts).then(function (response_and_data) {
94
+ return response_and_data;
95
+ });
96
+ }
97
+
98
+ /**
99
+ * Archive a project
100
+ * Archives a project.
101
+ * @param {Number} id The ID of the project
102
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UpdateProjectResponse200} and HTTP response
103
+ */
104
+ }, {
105
+ key: "archiveProjectWithHttpInfo",
106
+ value: function archiveProjectWithHttpInfo(id) {
107
+ var opts = {};
108
+ var postBody = null;
109
+
110
+ // verify the required parameter 'id' is set
111
+ if (id === undefined || id === null) {
112
+ throw new Error("Missing the required parameter 'id' when calling archiveProject");
113
+ }
114
+ var pathParams = {
115
+ 'id': id
116
+ };
117
+ var queryParams = {};
118
+ var headerParams = {};
119
+ var formParams = {};
120
+ var formParamArray = [];
121
+ var contentTypes = [];
122
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
123
+ var isJSON = contentTypes.includes('application/json');
124
+ if (isJSON) {
125
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
126
+ } else if (isURLEncoded) {
127
+ for (var key in opts) {
128
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
129
+ formParams[key] = opts[key];
130
+ }
131
+ }
132
+ }
133
+ var authNames = ['api_key', 'oauth2'];
134
+ var accepts = ['application/json'];
135
+ var returnType = _UpdateProjectResponse["default"];
136
+ return this.apiClient.callApi('/projects/{id}/archive', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
137
+ }
138
+
139
+ /**
140
+ * Archive a project
141
+ * Archives a project.
142
+ * @param {Number} id The ID of the project
143
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UpdateProjectResponse200}
144
+ */
145
+ }, {
146
+ key: "archiveProject",
147
+ value: function archiveProject(id) {
148
+ return this.archiveProjectWithHttpInfo(id).then(function (response_and_data) {
149
+ return response_and_data;
150
+ });
151
+ }
152
+
153
+ /**
154
+ * Delete a project
155
+ * Marks a project as deleted.
156
+ * @param {Number} id The ID of the project
157
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/DeleteProjectResponse200} and HTTP response
158
+ */
159
+ }, {
160
+ key: "deleteProjectWithHttpInfo",
161
+ value: function deleteProjectWithHttpInfo(id) {
162
+ var opts = {};
163
+ var postBody = null;
164
+
165
+ // verify the required parameter 'id' is set
166
+ if (id === undefined || id === null) {
167
+ throw new Error("Missing the required parameter 'id' when calling deleteProject");
168
+ }
169
+ var pathParams = {
170
+ 'id': id
171
+ };
172
+ var queryParams = {};
173
+ var headerParams = {};
174
+ var formParams = {};
175
+ var formParamArray = [];
176
+ var contentTypes = [];
177
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
178
+ var isJSON = contentTypes.includes('application/json');
179
+ if (isJSON) {
180
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
181
+ } else if (isURLEncoded) {
182
+ for (var key in opts) {
183
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
184
+ formParams[key] = opts[key];
185
+ }
186
+ }
187
+ }
188
+ var authNames = ['api_key', 'oauth2'];
189
+ var accepts = ['application/json'];
190
+ var returnType = _DeleteProjectResponse["default"];
191
+ return this.apiClient.callApi('/projects/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
192
+ }
193
+
194
+ /**
195
+ * Delete a project
196
+ * Marks a project as deleted.
197
+ * @param {Number} id The ID of the project
198
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/DeleteProjectResponse200}
199
+ */
200
+ }, {
201
+ key: "deleteProject",
202
+ value: function deleteProject(id) {
203
+ return this.deleteProjectWithHttpInfo(id).then(function (response_and_data) {
204
+ return response_and_data;
205
+ });
206
+ }
207
+
208
+ /**
209
+ * Get details of a project
210
+ * Returns the details of a specific project. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of project fields.
211
+ * @param {Number} id The ID of the project
212
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetProjectResponse200} and HTTP response
213
+ */
214
+ }, {
215
+ key: "getProjectWithHttpInfo",
216
+ value: function getProjectWithHttpInfo(id) {
217
+ var opts = {};
218
+ var postBody = null;
219
+
220
+ // verify the required parameter 'id' is set
221
+ if (id === undefined || id === null) {
222
+ throw new Error("Missing the required parameter 'id' when calling getProject");
223
+ }
224
+ var pathParams = {
225
+ 'id': id
226
+ };
227
+ var queryParams = {};
228
+ var headerParams = {};
229
+ var formParams = {};
230
+ var formParamArray = [];
231
+ var contentTypes = [];
232
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
233
+ var isJSON = contentTypes.includes('application/json');
234
+ if (isJSON) {
235
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
236
+ } else if (isURLEncoded) {
237
+ for (var key in opts) {
238
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
239
+ formParams[key] = opts[key];
240
+ }
241
+ }
242
+ }
243
+ var authNames = ['api_key', 'oauth2'];
244
+ var accepts = ['application/json'];
245
+ var returnType = _GetProjectResponse["default"];
246
+ return this.apiClient.callApi('/projects/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
247
+ }
248
+
249
+ /**
250
+ * Get details of a project
251
+ * Returns the details of a specific project. Also note that custom fields appear as long hashes in the resulting data. These hashes can be mapped against the `key` value of project fields.
252
+ * @param {Number} id The ID of the project
253
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetProjectResponse200}
254
+ */
255
+ }, {
256
+ key: "getProject",
257
+ value: function getProject(id) {
258
+ return this.getProjectWithHttpInfo(id).then(function (response_and_data) {
259
+ return response_and_data;
260
+ });
261
+ }
262
+
263
+ /**
264
+ * Returns project activities
265
+ * Returns activities linked to a specific project.
266
+ * @param {Number} id The ID of the project
267
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetActivitiesCollectionResponse200} and HTTP response
268
+ */
269
+ }, {
270
+ key: "getProjectActivitiesWithHttpInfo",
271
+ value: function getProjectActivitiesWithHttpInfo(id) {
272
+ var opts = {};
273
+ var postBody = null;
274
+
275
+ // verify the required parameter 'id' is set
276
+ if (id === undefined || id === null) {
277
+ throw new Error("Missing the required parameter 'id' when calling getProjectActivities");
278
+ }
279
+ var pathParams = {
280
+ 'id': id
281
+ };
282
+ var queryParams = {};
283
+ var headerParams = {};
284
+ var formParams = {};
285
+ var formParamArray = [];
286
+ var contentTypes = [];
287
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
288
+ var isJSON = contentTypes.includes('application/json');
289
+ if (isJSON) {
290
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
291
+ } else if (isURLEncoded) {
292
+ for (var key in opts) {
293
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
294
+ formParams[key] = opts[key];
295
+ }
296
+ }
297
+ }
298
+ var authNames = ['api_key', 'oauth2'];
299
+ var accepts = ['application/json'];
300
+ var returnType = _GetActivitiesCollectionResponse["default"];
301
+ return this.apiClient.callApi('/projects/{id}/activities', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
302
+ }
303
+
304
+ /**
305
+ * Returns project activities
306
+ * Returns activities linked to a specific project.
307
+ * @param {Number} id The ID of the project
308
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetActivitiesCollectionResponse200}
309
+ */
310
+ }, {
311
+ key: "getProjectActivities",
312
+ value: function getProjectActivities(id) {
313
+ return this.getProjectActivitiesWithHttpInfo(id).then(function (response_and_data) {
314
+ return response_and_data;
315
+ });
316
+ }
317
+
318
+ /**
319
+ * Returns project groups
320
+ * Returns all active groups under a specific project.
321
+ * @param {Number} id The ID of the project
322
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetProjectGroupsResponse200} and HTTP response
323
+ */
324
+ }, {
325
+ key: "getProjectGroupsWithHttpInfo",
326
+ value: function getProjectGroupsWithHttpInfo(id) {
327
+ var opts = {};
328
+ var postBody = null;
329
+
330
+ // verify the required parameter 'id' is set
331
+ if (id === undefined || id === null) {
332
+ throw new Error("Missing the required parameter 'id' when calling getProjectGroups");
333
+ }
334
+ var pathParams = {
335
+ 'id': id
336
+ };
337
+ var queryParams = {};
338
+ var headerParams = {};
339
+ var formParams = {};
340
+ var formParamArray = [];
341
+ var contentTypes = [];
342
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
343
+ var isJSON = contentTypes.includes('application/json');
344
+ if (isJSON) {
345
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
346
+ } else if (isURLEncoded) {
347
+ for (var key in opts) {
348
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
349
+ formParams[key] = opts[key];
350
+ }
351
+ }
352
+ }
353
+ var authNames = ['api_key', 'oauth2'];
354
+ var accepts = ['application/json'];
355
+ var returnType = _GetProjectGroupsResponse["default"];
356
+ return this.apiClient.callApi('/projects/{id}/groups', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
357
+ }
358
+
359
+ /**
360
+ * Returns project groups
361
+ * Returns all active groups under a specific project.
362
+ * @param {Number} id The ID of the project
363
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetProjectGroupsResponse200}
364
+ */
365
+ }, {
366
+ key: "getProjectGroups",
367
+ value: function getProjectGroups(id) {
368
+ return this.getProjectGroupsWithHttpInfo(id).then(function (response_and_data) {
369
+ return response_and_data;
370
+ });
371
+ }
372
+
373
+ /**
374
+ * Returns project plan
375
+ * Returns information about items in a project plan. Items consists of tasks and activities and are linked to specific project phase and group.
376
+ * @param {Number} id The ID of the project
377
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetProjectPlanResponse200} and HTTP response
378
+ */
379
+ }, {
380
+ key: "getProjectPlanWithHttpInfo",
381
+ value: function getProjectPlanWithHttpInfo(id) {
382
+ var opts = {};
383
+ var postBody = null;
384
+
385
+ // verify the required parameter 'id' is set
386
+ if (id === undefined || id === null) {
387
+ throw new Error("Missing the required parameter 'id' when calling getProjectPlan");
388
+ }
389
+ var pathParams = {
390
+ 'id': id
391
+ };
392
+ var queryParams = {};
393
+ var headerParams = {};
394
+ var formParams = {};
395
+ var formParamArray = [];
396
+ var contentTypes = [];
397
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
398
+ var isJSON = contentTypes.includes('application/json');
399
+ if (isJSON) {
400
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
401
+ } else if (isURLEncoded) {
402
+ for (var key in opts) {
403
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
404
+ formParams[key] = opts[key];
405
+ }
406
+ }
407
+ }
408
+ var authNames = ['api_key', 'oauth2'];
409
+ var accepts = ['application/json'];
410
+ var returnType = _GetProjectPlanResponse["default"];
411
+ return this.apiClient.callApi('/projects/{id}/plan', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
412
+ }
413
+
414
+ /**
415
+ * Returns project plan
416
+ * Returns information about items in a project plan. Items consists of tasks and activities and are linked to specific project phase and group.
417
+ * @param {Number} id The ID of the project
418
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetProjectPlanResponse200}
419
+ */
420
+ }, {
421
+ key: "getProjectPlan",
422
+ value: function getProjectPlan(id) {
423
+ return this.getProjectPlanWithHttpInfo(id).then(function (response_and_data) {
424
+ return response_and_data;
425
+ });
426
+ }
427
+
428
+ /**
429
+ * Returns project tasks
430
+ * Returns tasks linked to a specific project.
431
+ * @param {Number} id The ID of the project
432
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetTasksResponse200} and HTTP response
433
+ */
434
+ }, {
435
+ key: "getProjectTasksWithHttpInfo",
436
+ value: function getProjectTasksWithHttpInfo(id) {
437
+ var opts = {};
438
+ var postBody = null;
439
+
440
+ // verify the required parameter 'id' is set
441
+ if (id === undefined || id === null) {
442
+ throw new Error("Missing the required parameter 'id' when calling getProjectTasks");
443
+ }
444
+ var pathParams = {
445
+ 'id': id
446
+ };
447
+ var queryParams = {};
448
+ var headerParams = {};
449
+ var formParams = {};
450
+ var formParamArray = [];
451
+ var contentTypes = [];
452
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
453
+ var isJSON = contentTypes.includes('application/json');
454
+ if (isJSON) {
455
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
456
+ } else if (isURLEncoded) {
457
+ for (var key in opts) {
458
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
459
+ formParams[key] = opts[key];
460
+ }
461
+ }
462
+ }
463
+ var authNames = ['api_key', 'oauth2'];
464
+ var accepts = ['application/json'];
465
+ var returnType = _GetTasksResponse["default"];
466
+ return this.apiClient.callApi('/projects/{id}/tasks', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
467
+ }
468
+
469
+ /**
470
+ * Returns project tasks
471
+ * Returns tasks linked to a specific project.
472
+ * @param {Number} id The ID of the project
473
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetTasksResponse200}
474
+ */
475
+ }, {
476
+ key: "getProjectTasks",
477
+ value: function getProjectTasks(id) {
478
+ return this.getProjectTasksWithHttpInfo(id).then(function (response_and_data) {
479
+ return response_and_data;
480
+ });
481
+ }
482
+
483
+ /**
484
+ * Get all projects
485
+ * Returns all projects. This is a cursor-paginated endpoint. For more information, please refer to our documentation on <a href=\"https://pipedrive.readme.io/docs/core-api-concepts-pagination\" target=\"_blank\" rel=\"noopener noreferrer\">pagination</a>.
486
+ * @param {Object} opts Optional parameters
487
+ * @param {String} opts.cursor For pagination, the marker (an opaque string value) representing the first item on the next page
488
+ * @param {Number} opts.limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned.
489
+ * @param {Number} opts.filterId The ID of the filter to use
490
+ * @param {String} opts.status If supplied, includes only projects with the specified statuses. Possible values are `open`, `completed`, `canceled` and `deleted`. By default `deleted` projects are not returned.
491
+ * @param {Number} opts.phaseId If supplied, only projects in specified phase are returned
492
+ * @param {Boolean} opts.includeArchived If supplied with `true` then archived projects are also included in the response. By default only not archived projects are returned.
493
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetProjectsResponse200} and HTTP response
494
+ */
495
+ }, {
496
+ key: "getProjectsWithHttpInfo",
497
+ value: function getProjectsWithHttpInfo(opts) {
498
+ opts = opts || {};
499
+ var postBody = null;
500
+ var pathParams = {};
501
+ var queryParams = {
502
+ 'cursor': opts['cursor'] === undefined ? opts['cursor'] : opts['cursor'],
503
+ 'limit': opts['limit'] === undefined ? opts['limit'] : opts['limit'],
504
+ 'filter_id': opts['filter_id'] === undefined ? opts['filterId'] : opts['filter_id'],
505
+ 'status': opts['status'] === undefined ? opts['status'] : opts['status'],
506
+ 'phase_id': opts['phase_id'] === undefined ? opts['phaseId'] : opts['phase_id'],
507
+ 'include_archived': opts['include_archived'] === undefined ? opts['includeArchived'] : opts['include_archived']
508
+ };
509
+ var headerParams = {};
510
+ var formParams = {};
511
+ var formParamArray = [];
512
+ var contentTypes = [];
513
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
514
+ var isJSON = contentTypes.includes('application/json');
515
+ if (isJSON) {
516
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
517
+ } else if (isURLEncoded) {
518
+ for (var key in opts) {
519
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
520
+ formParams[key] = opts[key];
521
+ }
522
+ }
523
+ }
524
+ var authNames = ['api_key', 'oauth2'];
525
+ var accepts = ['application/json'];
526
+ var returnType = _GetProjectsResponse["default"];
527
+ return this.apiClient.callApi('/projects', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
528
+ }
529
+
530
+ /**
531
+ * Get all projects
532
+ * Returns all projects. This is a cursor-paginated endpoint. For more information, please refer to our documentation on <a href=\"https://pipedrive.readme.io/docs/core-api-concepts-pagination\" target=\"_blank\" rel=\"noopener noreferrer\">pagination</a>.
533
+ * @param {Object} opts Optional parameters
534
+ * @param {String} opts.cursor For pagination, the marker (an opaque string value) representing the first item on the next page
535
+ * @param {Number} opts.limit For pagination, the limit of entries to be returned. If not provided, 100 items will be returned.
536
+ * @param {Number} opts.filterId The ID of the filter to use
537
+ * @param {String} opts.status If supplied, includes only projects with the specified statuses. Possible values are `open`, `completed`, `canceled` and `deleted`. By default `deleted` projects are not returned.
538
+ * @param {Number} opts.phaseId If supplied, only projects in specified phase are returned
539
+ * @param {Boolean} opts.includeArchived If supplied with `true` then archived projects are also included in the response. By default only not archived projects are returned.
540
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetProjectsResponse200}
541
+ */
542
+ }, {
543
+ key: "getProjects",
544
+ value: function getProjects(opts) {
545
+ return this.getProjectsWithHttpInfo(opts).then(function (response_and_data) {
546
+ return response_and_data;
547
+ });
548
+ }
549
+
550
+ /**
551
+ * Get all project boards
552
+ * Returns all projects boards that are not deleted.
553
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetProjectBoardsResponse200} and HTTP response
554
+ */
555
+ }, {
556
+ key: "getProjectsBoardsWithHttpInfo",
557
+ value: function getProjectsBoardsWithHttpInfo() {
558
+ var opts = {};
559
+ var postBody = null;
560
+ var pathParams = {};
561
+ var queryParams = {};
562
+ var headerParams = {};
563
+ var formParams = {};
564
+ var formParamArray = [];
565
+ var contentTypes = [];
566
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
567
+ var isJSON = contentTypes.includes('application/json');
568
+ if (isJSON) {
569
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
570
+ } else if (isURLEncoded) {
571
+ for (var key in opts) {
572
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
573
+ formParams[key] = opts[key];
574
+ }
575
+ }
576
+ }
577
+ var authNames = ['api_key', 'oauth2'];
578
+ var accepts = ['application/json'];
579
+ var returnType = _GetProjectBoardsResponse["default"];
580
+ return this.apiClient.callApi('/projects/boards', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
581
+ }
582
+
583
+ /**
584
+ * Get all project boards
585
+ * Returns all projects boards that are not deleted.
586
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetProjectBoardsResponse200}
587
+ */
588
+ }, {
589
+ key: "getProjectsBoards",
590
+ value: function getProjectsBoards() {
591
+ return this.getProjectsBoardsWithHttpInfo().then(function (response_and_data) {
592
+ return response_and_data;
593
+ });
594
+ }
595
+
596
+ /**
597
+ * Get project phases
598
+ * Returns all active project phases under a specific board.
599
+ * @param {Number} boardId ID of the board for which phases are requested
600
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GetProjectPhasesResponse200} and HTTP response
601
+ */
602
+ }, {
603
+ key: "getProjectsPhasesWithHttpInfo",
604
+ value: function getProjectsPhasesWithHttpInfo(boardId) {
605
+ var opts = {};
606
+ var postBody = null;
607
+
608
+ // verify the required parameter 'boardId' is set
609
+ if (boardId === undefined || boardId === null) {
610
+ throw new Error("Missing the required parameter 'boardId' when calling getProjectsPhases");
611
+ }
612
+ var pathParams = {};
613
+ var queryParams = {
614
+ 'board_id': boardId
615
+ };
616
+ var headerParams = {};
617
+ var formParams = {};
618
+ var formParamArray = [];
619
+ var contentTypes = [];
620
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
621
+ var isJSON = contentTypes.includes('application/json');
622
+ if (isJSON) {
623
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
624
+ } else if (isURLEncoded) {
625
+ for (var key in opts) {
626
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
627
+ formParams[key] = opts[key];
628
+ }
629
+ }
630
+ }
631
+ var authNames = ['api_key', 'oauth2'];
632
+ var accepts = ['application/json'];
633
+ var returnType = _GetProjectPhasesResponse["default"];
634
+ return this.apiClient.callApi('/projects/phases', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
635
+ }
636
+
637
+ /**
638
+ * Get project phases
639
+ * Returns all active project phases under a specific board.
640
+ * @param {Number} boardId ID of the board for which phases are requested
641
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GetProjectPhasesResponse200}
642
+ */
643
+ }, {
644
+ key: "getProjectsPhases",
645
+ value: function getProjectsPhases(boardId) {
646
+ return this.getProjectsPhasesWithHttpInfo(boardId).then(function (response_and_data) {
647
+ return response_and_data;
648
+ });
649
+ }
650
+
651
+ /**
652
+ * Update activity in project plan
653
+ * Updates an activity phase or group in a project.
654
+ * @param {Number} id The ID of the project
655
+ * @param {Number} activityId The ID of the activity
656
+ * @param {Object} opts Optional parameters
657
+ * @param {module:model/ProjectPutPlanItemBodyObject} opts.projectPutPlanItemBodyObject
658
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UpdatedActivityPlanItem200} and HTTP response
659
+ */
660
+ }, {
661
+ key: "putProjectPlanActivityWithHttpInfo",
662
+ value: function putProjectPlanActivityWithHttpInfo(id, activityId, opts) {
663
+ opts = opts || {};
664
+ var postBody = opts['projectPutPlanItemBodyObject'];
665
+
666
+ // verify the required parameter 'id' is set
667
+ if (id === undefined || id === null) {
668
+ throw new Error("Missing the required parameter 'id' when calling putProjectPlanActivity");
669
+ }
670
+
671
+ // verify the required parameter 'activityId' is set
672
+ if (activityId === undefined || activityId === null) {
673
+ throw new Error("Missing the required parameter 'activityId' when calling putProjectPlanActivity");
674
+ }
675
+ var pathParams = {
676
+ 'id': id,
677
+ 'activityId': activityId
678
+ };
679
+ var queryParams = {};
680
+ var headerParams = {};
681
+ var formParams = {};
682
+ var formParamArray = [];
683
+ var contentTypes = ['application/json'];
684
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
685
+ var isJSON = contentTypes.includes('application/json');
686
+ if (isJSON) {
687
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
688
+ } else if (isURLEncoded) {
689
+ for (var key in opts) {
690
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
691
+ formParams[key] = opts[key];
692
+ }
693
+ }
694
+ }
695
+ var authNames = ['api_key', 'oauth2'];
696
+ var accepts = ['application/json'];
697
+ var returnType = _UpdatedActivityPlanItem["default"];
698
+ return this.apiClient.callApi('/projects/{id}/plan/activities/{activityId}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
699
+ }
700
+
701
+ /**
702
+ * Update activity in project plan
703
+ * Updates an activity phase or group in a project.
704
+ * @param {Number} id The ID of the project
705
+ * @param {Number} activityId The ID of the activity
706
+ * @param {Object} opts Optional parameters
707
+ * @param {module:model/ProjectPutPlanItemBodyObject} opts.projectPutPlanItemBodyObject
708
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UpdatedActivityPlanItem200}
709
+ */
710
+ }, {
711
+ key: "putProjectPlanActivity",
712
+ value: function putProjectPlanActivity(id, activityId, opts) {
713
+ return this.putProjectPlanActivityWithHttpInfo(id, activityId, opts).then(function (response_and_data) {
714
+ return response_and_data;
715
+ });
716
+ }
717
+
718
+ /**
719
+ * Update task in project plan
720
+ * Updates a task phase or group in a project.
721
+ * @param {Number} id The ID of the project
722
+ * @param {Number} taskId The ID of the task
723
+ * @param {Object} opts Optional parameters
724
+ * @param {module:model/ProjectPutPlanItemBodyObject} opts.projectPutPlanItemBodyObject
725
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UpdatedTaskPlanItem200} and HTTP response
726
+ */
727
+ }, {
728
+ key: "putProjectPlanTaskWithHttpInfo",
729
+ value: function putProjectPlanTaskWithHttpInfo(id, taskId, opts) {
730
+ opts = opts || {};
731
+ var postBody = opts['projectPutPlanItemBodyObject'];
732
+
733
+ // verify the required parameter 'id' is set
734
+ if (id === undefined || id === null) {
735
+ throw new Error("Missing the required parameter 'id' when calling putProjectPlanTask");
736
+ }
737
+
738
+ // verify the required parameter 'taskId' is set
739
+ if (taskId === undefined || taskId === null) {
740
+ throw new Error("Missing the required parameter 'taskId' when calling putProjectPlanTask");
741
+ }
742
+ var pathParams = {
743
+ 'id': id,
744
+ 'taskId': taskId
745
+ };
746
+ var queryParams = {};
747
+ var headerParams = {};
748
+ var formParams = {};
749
+ var formParamArray = [];
750
+ var contentTypes = ['application/json'];
751
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
752
+ var isJSON = contentTypes.includes('application/json');
753
+ if (isJSON) {
754
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
755
+ } else if (isURLEncoded) {
756
+ for (var key in opts) {
757
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
758
+ formParams[key] = opts[key];
759
+ }
760
+ }
761
+ }
762
+ var authNames = ['api_key', 'oauth2'];
763
+ var accepts = ['application/json'];
764
+ var returnType = _UpdatedTaskPlanItem["default"];
765
+ return this.apiClient.callApi('/projects/{id}/plan/tasks/{taskId}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
766
+ }
767
+
768
+ /**
769
+ * Update task in project plan
770
+ * Updates a task phase or group in a project.
771
+ * @param {Number} id The ID of the project
772
+ * @param {Number} taskId The ID of the task
773
+ * @param {Object} opts Optional parameters
774
+ * @param {module:model/ProjectPutPlanItemBodyObject} opts.projectPutPlanItemBodyObject
775
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UpdatedTaskPlanItem200}
776
+ */
777
+ }, {
778
+ key: "putProjectPlanTask",
779
+ value: function putProjectPlanTask(id, taskId, opts) {
780
+ return this.putProjectPlanTaskWithHttpInfo(id, taskId, opts).then(function (response_and_data) {
781
+ return response_and_data;
782
+ });
783
+ }
784
+
785
+ /**
786
+ * Update a project
787
+ * Updates a project.
788
+ * @param {Number} id The ID of the project
789
+ * @param {Object} opts Optional parameters
790
+ * @param {module:model/ProjectPutObject} opts.projectPutObject
791
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UpdateProjectResponse200} and HTTP response
792
+ */
793
+ }, {
794
+ key: "updateProjectWithHttpInfo",
795
+ value: function updateProjectWithHttpInfo(id, opts) {
796
+ opts = opts || {};
797
+ var postBody = opts['projectPutObject'];
798
+
799
+ // verify the required parameter 'id' is set
800
+ if (id === undefined || id === null) {
801
+ throw new Error("Missing the required parameter 'id' when calling updateProject");
802
+ }
803
+ var pathParams = {
804
+ 'id': id
805
+ };
806
+ var queryParams = {};
807
+ var headerParams = {};
808
+ var formParams = {};
809
+ var formParamArray = [];
810
+ var contentTypes = ['application/json'];
811
+ var isURLEncoded = contentTypes.includes('application/x-www-form-urlencoded');
812
+ var isJSON = contentTypes.includes('application/json');
813
+ if (isJSON) {
814
+ postBody = _objectSpread(_objectSpread({}, postBody), opts);
815
+ } else if (isURLEncoded) {
816
+ for (var key in opts) {
817
+ if (opts.hasOwnProperty(key) && !formParamArray.includes(key)) {
818
+ formParams[key] = opts[key];
819
+ }
820
+ }
821
+ }
822
+ var authNames = ['api_key', 'oauth2'];
823
+ var accepts = ['application/json'];
824
+ var returnType = _UpdateProjectResponse["default"];
825
+ return this.apiClient.callApi('/projects/{id}', 'PUT', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
826
+ }
827
+
828
+ /**
829
+ * Update a project
830
+ * Updates a project.
831
+ * @param {Number} id The ID of the project
832
+ * @param {Object} opts Optional parameters
833
+ * @param {module:model/ProjectPutObject} opts.projectPutObject
834
+ * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UpdateProjectResponse200}
835
+ */
836
+ }, {
837
+ key: "updateProject",
838
+ value: function updateProject(id, opts) {
839
+ return this.updateProjectWithHttpInfo(id, opts).then(function (response_and_data) {
840
+ return response_and_data;
841
+ });
842
+ }
843
+ }]);
844
+ return ProjectsApi;
845
+ }();
846
+ exports["default"] = ProjectsApi;