pipedrive 24.1.1 → 25.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/dist/esm/versions/v1/api/deals-api.d.ts +3 -3
  2. package/dist/esm/versions/v1/api/deals-api.js +2 -2
  3. package/dist/esm/versions/v1/api/organizations-api.d.ts +3 -3
  4. package/dist/esm/versions/v1/api/organizations-api.js +2 -2
  5. package/dist/esm/versions/v1/api/persons-api.d.ts +3 -3
  6. package/dist/esm/versions/v1/api/persons-api.js +2 -2
  7. package/dist/esm/versions/v1/api/subscriptions-api.d.ts +36 -36
  8. package/dist/esm/versions/v1/api/subscriptions-api.js +36 -36
  9. package/dist/esm/versions/v1/api/webhooks-api.d.ts +4 -4
  10. package/dist/esm/versions/v1/api/webhooks-api.js +4 -4
  11. package/dist/esm/versions/v1/models/add-webhook-request.d.ts +5 -6
  12. package/dist/esm/versions/v1/models/add-webhook-request.js +4 -5
  13. package/dist/esm/versions/v1/models/additional-data.d.ts +38 -0
  14. package/dist/esm/versions/v1/models/additional-data.js +14 -0
  15. package/dist/esm/versions/v1/models/get-notes-response-additional-data.d.ts +3 -3
  16. package/dist/esm/versions/v1/models/index.d.ts +1 -1
  17. package/dist/esm/versions/v1/models/index.js +1 -1
  18. package/dist/esm/versions/v1/models/user-access.d.ts +3 -2
  19. package/dist/esm/versions/v1/models/user-access.js +4 -3
  20. package/dist/esm/versions/v1/models/user-access1.d.ts +3 -2
  21. package/dist/esm/versions/v1/models/user-access1.js +4 -3
  22. package/dist/esm/versions/v2/api/activities-api.d.ts +34 -2
  23. package/dist/esm/versions/v2/api/activities-api.js +25 -5
  24. package/dist/esm/versions/v2/api/beta-api.d.ts +160 -2424
  25. package/dist/esm/versions/v2/api/beta-api.js +169 -2788
  26. package/dist/esm/versions/v2/api/deals-api.d.ts +491 -0
  27. package/dist/esm/versions/v2/api/deals-api.js +613 -0
  28. package/dist/esm/versions/v2/api/organizations-api.d.ts +237 -0
  29. package/dist/esm/versions/v2/api/organizations-api.js +301 -0
  30. package/dist/esm/versions/v2/api/persons-api.d.ts +237 -0
  31. package/dist/esm/versions/v2/api/persons-api.js +301 -0
  32. package/dist/esm/versions/v2/api/products-api.d.ts +237 -0
  33. package/dist/esm/versions/v2/api/products-api.js +301 -0
  34. package/dist/esm/versions/v2/api/users-api.d.ts +103 -0
  35. package/dist/esm/versions/v2/api/users-api.js +140 -0
  36. package/dist/esm/versions/v2/api.d.ts +1 -0
  37. package/dist/esm/versions/v2/api.js +1 -0
  38. package/dist/esm/versions/v2/models/add-ainstallment-response.d.ts +29 -0
  39. package/dist/esm/versions/v2/models/add-ainstallment-response.js +14 -0
  40. package/dist/esm/versions/v2/models/add-deal-follower-request.d.ts +23 -0
  41. package/dist/esm/versions/v2/models/add-deal-follower-request.js +14 -0
  42. package/dist/esm/versions/v2/models/add-follower-response-all-of.d.ts +24 -0
  43. package/dist/esm/versions/v2/models/add-follower-response-all-of.js +14 -0
  44. package/dist/esm/versions/v2/models/add-follower-response.d.ts +18 -0
  45. package/dist/esm/versions/v2/models/add-follower-response.js +14 -0
  46. package/dist/esm/versions/v2/models/add-installment-request-body.d.ts +33 -0
  47. package/dist/esm/versions/v2/models/add-installment-request-body.js +14 -0
  48. package/dist/esm/versions/v2/models/delete-follower-response-data.d.ts +23 -0
  49. package/dist/esm/versions/v2/models/delete-follower-response-data.js +14 -0
  50. package/dist/esm/versions/v2/models/delete-follower-response.d.ts +29 -0
  51. package/dist/esm/versions/v2/models/delete-follower-response.js +14 -0
  52. package/dist/esm/versions/v2/models/delete-installment-response-data.d.ts +23 -0
  53. package/dist/esm/versions/v2/models/delete-installment-response-data.js +14 -0
  54. package/dist/esm/versions/v2/models/delete-installment-response.d.ts +29 -0
  55. package/dist/esm/versions/v2/models/delete-installment-response.js +14 -0
  56. package/dist/esm/versions/v2/models/follower-changelog-item.d.ts +38 -0
  57. package/dist/esm/versions/v2/models/follower-changelog-item.js +14 -0
  58. package/dist/esm/versions/v2/models/follower-item.d.ts +28 -0
  59. package/dist/esm/versions/v2/models/follower-item.js +14 -0
  60. package/dist/esm/versions/v2/models/follower-item1.d.ts +28 -0
  61. package/dist/esm/versions/v2/models/follower-item1.js +14 -0
  62. package/dist/esm/versions/v2/models/get-activities-response-all-of-additional-data.d.ts +23 -0
  63. package/dist/esm/versions/v2/models/get-activities-response-all-of-additional-data.js +14 -0
  64. package/dist/esm/versions/v2/models/get-activities-response-all-of.d.ts +6 -0
  65. package/dist/esm/versions/v2/models/get-deals-response-all-of.d.ts +6 -0
  66. package/dist/esm/versions/v2/models/get-follower-changelogs-response-all-of.d.ts +30 -0
  67. package/dist/esm/versions/v2/models/get-follower-changelogs-response-all-of.js +14 -0
  68. package/dist/esm/versions/v2/models/get-follower-changelogs-response.d.ts +18 -0
  69. package/dist/esm/versions/v2/models/get-follower-changelogs-response.js +14 -0
  70. package/dist/esm/versions/v2/models/get-followers-response-all-of.d.ts +30 -0
  71. package/dist/esm/versions/v2/models/get-followers-response-all-of.js +14 -0
  72. package/dist/esm/versions/v2/models/get-followers-response.d.ts +18 -0
  73. package/dist/esm/versions/v2/models/get-followers-response.js +14 -0
  74. package/dist/esm/versions/v2/models/get-installments-response-data-inner.d.ts +43 -0
  75. package/dist/esm/versions/v2/models/get-installments-response-data-inner.js +14 -0
  76. package/dist/esm/versions/v2/models/get-installments-response.d.ts +29 -0
  77. package/dist/esm/versions/v2/models/get-installments-response.js +14 -0
  78. package/dist/esm/versions/v2/models/get-organizations-response-all-of.d.ts +6 -0
  79. package/dist/esm/versions/v2/models/get-persons-response-all-of.d.ts +6 -0
  80. package/dist/esm/versions/v2/models/get-pipelines-response-all-of.d.ts +6 -0
  81. package/dist/esm/versions/v2/models/get-stages-response.d.ts +6 -0
  82. package/dist/esm/versions/v2/models/index.d.ts +21 -0
  83. package/dist/esm/versions/v2/models/index.js +21 -0
  84. package/dist/esm/versions/v2/models/update-installment-request-body.d.ts +33 -0
  85. package/dist/esm/versions/v2/models/update-installment-request-body.js +14 -0
  86. package/dist/esm/versions/v2/models/update-installment-response.d.ts +29 -0
  87. package/dist/esm/versions/v2/models/update-installment-response.js +14 -0
  88. package/dist/versions/v1/api/deals-api.d.ts +3 -3
  89. package/dist/versions/v1/api/deals-api.js +2 -2
  90. package/dist/versions/v1/api/organizations-api.d.ts +3 -3
  91. package/dist/versions/v1/api/organizations-api.js +2 -2
  92. package/dist/versions/v1/api/persons-api.d.ts +3 -3
  93. package/dist/versions/v1/api/persons-api.js +2 -2
  94. package/dist/versions/v1/api/subscriptions-api.d.ts +36 -36
  95. package/dist/versions/v1/api/subscriptions-api.js +36 -36
  96. package/dist/versions/v1/api/webhooks-api.d.ts +4 -4
  97. package/dist/versions/v1/api/webhooks-api.js +4 -4
  98. package/dist/versions/v1/models/add-webhook-request.d.ts +5 -6
  99. package/dist/versions/v1/models/add-webhook-request.js +4 -5
  100. package/dist/versions/v1/models/additional-data.d.ts +38 -0
  101. package/dist/versions/v1/models/additional-data.js +15 -0
  102. package/dist/versions/v1/models/get-notes-response-additional-data.d.ts +3 -3
  103. package/dist/versions/v1/models/index.d.ts +1 -1
  104. package/dist/versions/v1/models/index.js +1 -1
  105. package/dist/versions/v1/models/user-access.d.ts +3 -2
  106. package/dist/versions/v1/models/user-access.js +4 -3
  107. package/dist/versions/v1/models/user-access1.d.ts +3 -2
  108. package/dist/versions/v1/models/user-access1.js +4 -3
  109. package/dist/versions/v2/api/activities-api.d.ts +34 -2
  110. package/dist/versions/v2/api/activities-api.js +25 -5
  111. package/dist/versions/v2/api/beta-api.d.ts +160 -2424
  112. package/dist/versions/v2/api/beta-api.js +171 -2790
  113. package/dist/versions/v2/api/deals-api.d.ts +491 -0
  114. package/dist/versions/v2/api/deals-api.js +613 -0
  115. package/dist/versions/v2/api/organizations-api.d.ts +237 -0
  116. package/dist/versions/v2/api/organizations-api.js +301 -0
  117. package/dist/versions/v2/api/persons-api.d.ts +237 -0
  118. package/dist/versions/v2/api/persons-api.js +301 -0
  119. package/dist/versions/v2/api/products-api.d.ts +237 -0
  120. package/dist/versions/v2/api/products-api.js +301 -0
  121. package/dist/versions/v2/api/users-api.d.ts +103 -0
  122. package/dist/versions/v2/api/users-api.js +150 -0
  123. package/dist/versions/v2/api.d.ts +1 -0
  124. package/dist/versions/v2/api.js +1 -0
  125. package/dist/versions/v2/models/add-ainstallment-response.d.ts +29 -0
  126. package/dist/versions/v2/models/add-ainstallment-response.js +15 -0
  127. package/dist/versions/v2/models/add-deal-follower-request.d.ts +23 -0
  128. package/dist/versions/v2/models/add-deal-follower-request.js +15 -0
  129. package/dist/versions/v2/models/add-follower-response-all-of.d.ts +24 -0
  130. package/dist/versions/v2/models/add-follower-response-all-of.js +15 -0
  131. package/dist/versions/v2/models/add-follower-response.d.ts +18 -0
  132. package/dist/versions/v2/models/add-follower-response.js +15 -0
  133. package/dist/versions/v2/models/add-installment-request-body.d.ts +33 -0
  134. package/dist/versions/v2/models/add-installment-request-body.js +15 -0
  135. package/dist/versions/v2/models/delete-follower-response-data.d.ts +23 -0
  136. package/dist/versions/v2/models/delete-follower-response-data.js +15 -0
  137. package/dist/versions/v2/models/delete-follower-response.d.ts +29 -0
  138. package/dist/versions/v2/models/delete-follower-response.js +15 -0
  139. package/dist/versions/v2/models/delete-installment-response-data.d.ts +23 -0
  140. package/dist/versions/v2/models/delete-installment-response-data.js +15 -0
  141. package/dist/versions/v2/models/delete-installment-response.d.ts +29 -0
  142. package/dist/versions/v2/models/delete-installment-response.js +15 -0
  143. package/dist/versions/v2/models/follower-changelog-item.d.ts +38 -0
  144. package/dist/versions/v2/models/follower-changelog-item.js +15 -0
  145. package/dist/versions/v2/models/follower-item.d.ts +28 -0
  146. package/dist/versions/v2/models/follower-item.js +15 -0
  147. package/dist/versions/v2/models/follower-item1.d.ts +28 -0
  148. package/dist/versions/v2/models/follower-item1.js +15 -0
  149. package/dist/versions/v2/models/get-activities-response-all-of-additional-data.d.ts +23 -0
  150. package/dist/versions/v2/models/get-activities-response-all-of-additional-data.js +15 -0
  151. package/dist/versions/v2/models/get-activities-response-all-of.d.ts +6 -0
  152. package/dist/versions/v2/models/get-deals-response-all-of.d.ts +6 -0
  153. package/dist/versions/v2/models/get-follower-changelogs-response-all-of.d.ts +30 -0
  154. package/dist/versions/v2/models/get-follower-changelogs-response-all-of.js +15 -0
  155. package/dist/versions/v2/models/get-follower-changelogs-response.d.ts +18 -0
  156. package/dist/versions/v2/models/get-follower-changelogs-response.js +15 -0
  157. package/dist/versions/v2/models/get-followers-response-all-of.d.ts +30 -0
  158. package/dist/versions/v2/models/get-followers-response-all-of.js +15 -0
  159. package/dist/versions/v2/models/get-followers-response.d.ts +18 -0
  160. package/dist/versions/v2/models/get-followers-response.js +15 -0
  161. package/dist/versions/v2/models/get-installments-response-data-inner.d.ts +43 -0
  162. package/dist/versions/v2/models/get-installments-response-data-inner.js +15 -0
  163. package/dist/versions/v2/models/get-installments-response.d.ts +29 -0
  164. package/dist/versions/v2/models/get-installments-response.js +15 -0
  165. package/dist/versions/v2/models/get-organizations-response-all-of.d.ts +6 -0
  166. package/dist/versions/v2/models/get-persons-response-all-of.d.ts +6 -0
  167. package/dist/versions/v2/models/get-pipelines-response-all-of.d.ts +6 -0
  168. package/dist/versions/v2/models/get-stages-response.d.ts +6 -0
  169. package/dist/versions/v2/models/index.d.ts +21 -0
  170. package/dist/versions/v2/models/index.js +21 -0
  171. package/dist/versions/v2/models/update-installment-request-body.d.ts +33 -0
  172. package/dist/versions/v2/models/update-installment-request-body.js +15 -0
  173. package/dist/versions/v2/models/update-installment-response.d.ts +29 -0
  174. package/dist/versions/v2/models/update-installment-response.js +15 -0
  175. package/package.json +1 -1
@@ -39,83 +39,107 @@ const base_1 = require("../base");
39
39
  const BetaApiAxiosParamCreator = function (configuration) {
40
40
  return {
41
41
  /**
42
- * Adds a new activity.
43
- * @summary Add a new activity
44
- * @param {AddActivityRequest} [AddActivityRequest]
42
+ * Removes an installment from a deal. Only available in Advanced and above plans.
43
+ * @summary Delete an installment from a deal
44
+ * @param {number} id The ID of the deal
45
+ * @param {number} installment_id The ID of the installment
45
46
 
46
47
  * @throws {RequiredError}
47
48
  */
48
- addActivity: (AddActivityRequest) => __awaiter(this, void 0, void 0, function* () {
49
- const localVarPath = `/activities`;
49
+ deleteInstallment: (id, installment_id) => __awaiter(this, void 0, void 0, function* () {
50
+ // verify required parameter 'id' is not null or undefined
51
+ (0, common_1.assertParamExists)('deleteInstallment', 'id', id);
52
+ // verify required parameter 'installment_id' is not null or undefined
53
+ (0, common_1.assertParamExists)('deleteInstallment', 'installment_id', installment_id);
54
+ const localVarPath = `/deals/{id}/installments/{installment_id}`
55
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
56
+ .replace(`{${"installment_id"}}`, encodeURIComponent(String(installment_id)));
50
57
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
51
58
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
52
59
  let baseOptions;
53
60
  if (configuration) {
54
61
  baseOptions = configuration.baseOptions;
55
62
  }
56
- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
63
+ const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
57
64
  const localVarHeaderParameter = {};
58
65
  const localVarQueryParameter = {};
59
66
  // authentication api_key required
60
67
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
61
68
  // authentication oauth2 required
62
69
  // oauth required
63
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["activities:full"], configuration);
64
- localVarHeaderParameter['Content-Type'] = 'application/json';
70
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
65
71
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
66
72
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
67
73
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
68
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddActivityRequest, localVarRequestOptions, configuration);
69
74
  return {
70
75
  url: (0, common_1.toPathString)(localVarUrlObj),
71
76
  options: localVarRequestOptions,
72
77
  };
73
78
  }),
74
79
  /**
75
- * Adds a new deal.
76
- * @summary Add a new deal
77
- * @param {AddDealRequest} [AddDealRequest]
80
+ * Lists installments attached to a list of deals. Only available in Advanced and above plans.
81
+ * @summary List installments added to a list of deals
82
+ * @param {Array<number>} deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided.
83
+ * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
84
+ * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
85
+ * @param {'id' | 'billing_date' | 'deal_id'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;billing_date&#x60;, &#x60;deal_id&#x60;.
86
+ * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
78
87
 
79
88
  * @throws {RequiredError}
80
89
  */
81
- addDeal: (AddDealRequest) => __awaiter(this, void 0, void 0, function* () {
82
- const localVarPath = `/deals`;
90
+ getInstallments: (deal_ids, cursor, limit, sort_by, sort_direction) => __awaiter(this, void 0, void 0, function* () {
91
+ // verify required parameter 'deal_ids' is not null or undefined
92
+ (0, common_1.assertParamExists)('getInstallments', 'deal_ids', deal_ids);
93
+ const localVarPath = `/deals/installments`;
83
94
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
84
95
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
85
96
  let baseOptions;
86
97
  if (configuration) {
87
98
  baseOptions = configuration.baseOptions;
88
99
  }
89
- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
100
+ const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
90
101
  const localVarHeaderParameter = {};
91
102
  const localVarQueryParameter = {};
92
103
  // authentication api_key required
93
104
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
94
105
  // authentication oauth2 required
95
106
  // oauth required
96
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
97
- localVarHeaderParameter['Content-Type'] = 'application/json';
107
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
108
+ if (deal_ids) {
109
+ localVarQueryParameter['deal_ids'] = deal_ids;
110
+ }
111
+ if (cursor !== undefined) {
112
+ localVarQueryParameter['cursor'] = cursor;
113
+ }
114
+ if (limit !== undefined) {
115
+ localVarQueryParameter['limit'] = limit;
116
+ }
117
+ if (sort_by !== undefined) {
118
+ localVarQueryParameter['sort_by'] = sort_by;
119
+ }
120
+ if (sort_direction !== undefined) {
121
+ localVarQueryParameter['sort_direction'] = sort_direction;
122
+ }
98
123
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
99
124
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
100
125
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
101
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddDealRequest, localVarRequestOptions, configuration);
102
126
  return {
103
127
  url: (0, common_1.toPathString)(localVarUrlObj),
104
128
  options: localVarRequestOptions,
105
129
  };
106
130
  }),
107
131
  /**
108
- * Adds a product to a deal, creating a new item called a deal-product.
109
- * @summary Add a product to a deal
132
+ * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
133
+ * @summary Add an installment to a deal
110
134
  * @param {number} id The ID of the deal
111
- * @param {AddDealProductRequest} [AddDealProductRequest]
135
+ * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody]
112
136
 
113
137
  * @throws {RequiredError}
114
138
  */
115
- addDealProduct: (id, AddDealProductRequest) => __awaiter(this, void 0, void 0, function* () {
139
+ postInstallment: (id, AddInstallmentRequestBody) => __awaiter(this, void 0, void 0, function* () {
116
140
  // verify required parameter 'id' is not null or undefined
117
- (0, common_1.assertParamExists)('addDealProduct', 'id', id);
118
- const localVarPath = `/deals/{id}/products`
141
+ (0, common_1.assertParamExists)('postInstallment', 'id', id);
142
+ const localVarPath = `/deals/{id}/installments`
119
143
  .replace(`{${"id"}}`, encodeURIComponent(String(id)));
120
144
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
121
145
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
@@ -130,2479 +154,177 @@ const BetaApiAxiosParamCreator = function (configuration) {
130
154
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
131
155
  // authentication oauth2 required
132
156
  // oauth required
133
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:full", "deals:full"], configuration);
157
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
134
158
  localVarHeaderParameter['Content-Type'] = 'application/json';
135
159
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
136
160
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
137
161
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
138
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddDealProductRequest, localVarRequestOptions, configuration);
162
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddInstallmentRequestBody, localVarRequestOptions, configuration);
139
163
  return {
140
164
  url: (0, common_1.toPathString)(localVarUrlObj),
141
165
  options: localVarRequestOptions,
142
166
  };
143
167
  }),
144
168
  /**
145
- * Adds a new organization.
146
- * @summary Add a new organization
147
- * @param {AddOrganizationRequest} [AddOrganizationRequest]
169
+ * Edits an installment added to a deal. Only available in Advanced and above plans.
170
+ * @summary Update an installment added to a deal
171
+ * @param {number} id The ID of the deal
172
+ * @param {number} installment_id The ID of the installment
173
+ * @param {UpdateInstallmentRequestBody} [UpdateInstallmentRequestBody]
148
174
 
149
175
  * @throws {RequiredError}
150
176
  */
151
- addOrganization: (AddOrganizationRequest) => __awaiter(this, void 0, void 0, function* () {
152
- const localVarPath = `/organizations`;
177
+ updateInstallment: (id, installment_id, UpdateInstallmentRequestBody) => __awaiter(this, void 0, void 0, function* () {
178
+ // verify required parameter 'id' is not null or undefined
179
+ (0, common_1.assertParamExists)('updateInstallment', 'id', id);
180
+ // verify required parameter 'installment_id' is not null or undefined
181
+ (0, common_1.assertParamExists)('updateInstallment', 'installment_id', installment_id);
182
+ const localVarPath = `/deals/{id}/installments/{installment_id}`
183
+ .replace(`{${"id"}}`, encodeURIComponent(String(id)))
184
+ .replace(`{${"installment_id"}}`, encodeURIComponent(String(installment_id)));
153
185
  // use dummy base URL string because the URL constructor only accepts absolute URLs.
154
186
  const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
155
187
  let baseOptions;
156
188
  if (configuration) {
157
189
  baseOptions = configuration.baseOptions;
158
190
  }
159
- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
191
+ const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
160
192
  const localVarHeaderParameter = {};
161
193
  const localVarQueryParameter = {};
162
194
  // authentication api_key required
163
195
  yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
164
196
  // authentication oauth2 required
165
197
  // oauth required
166
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
198
+ yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
167
199
  localVarHeaderParameter['Content-Type'] = 'application/json';
168
200
  (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
169
201
  let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
170
202
  localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
171
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddOrganizationRequest, localVarRequestOptions, configuration);
203
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateInstallmentRequestBody, localVarRequestOptions, configuration);
172
204
  return {
173
205
  url: (0, common_1.toPathString)(localVarUrlObj),
174
206
  options: localVarRequestOptions,
175
207
  };
176
208
  }),
209
+ };
210
+ };
211
+ exports.BetaApiAxiosParamCreator = BetaApiAxiosParamCreator;
212
+ /**
213
+ * BetaApi - functional programming interface
214
+ * @export
215
+ */
216
+ const BetaApiFp = function (configuration) {
217
+ const localVarAxiosParamCreator = (0, exports.BetaApiAxiosParamCreator)(configuration);
218
+ return {
177
219
  /**
178
- * Adds a new person.
179
- * @summary Add a new person
180
- * @param {AddPersonRequest} [AddPersonRequest]
220
+ * Removes an installment from a deal. Only available in Advanced and above plans.
221
+ * @summary Delete an installment from a deal
222
+ * @param {number} id The ID of the deal
223
+ * @param {number} installment_id The ID of the installment
181
224
 
182
225
  * @throws {RequiredError}
183
226
  */
184
- addPerson: (AddPersonRequest) => __awaiter(this, void 0, void 0, function* () {
185
- const localVarPath = `/persons`;
186
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
187
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
188
- let baseOptions;
189
- if (configuration) {
190
- baseOptions = configuration.baseOptions;
191
- }
192
- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
193
- const localVarHeaderParameter = {};
194
- const localVarQueryParameter = {};
195
- // authentication api_key required
196
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
197
- // authentication oauth2 required
198
- // oauth required
199
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
200
- localVarHeaderParameter['Content-Type'] = 'application/json';
201
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
202
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
203
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
204
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddPersonRequest, localVarRequestOptions, configuration);
205
- return {
206
- url: (0, common_1.toPathString)(localVarUrlObj),
207
- options: localVarRequestOptions,
208
- };
209
- }),
227
+ deleteInstallment(id, installment_id) {
228
+ return __awaiter(this, void 0, void 0, function* () {
229
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteInstallment(id, installment_id);
230
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
231
+ });
232
+ },
210
233
  /**
211
- * Marks an activity as deleted. After 30 days, the activity will be permanently deleted.
212
- * @summary Delete an activity
213
- * @param {number} id The ID of the activity
234
+ * Lists installments attached to a list of deals. Only available in Advanced and above plans.
235
+ * @summary List installments added to a list of deals
236
+ * @param {Array<number>} deal_ids An array of integers with the IDs of the deals for which the attached installments will be returned. A maximum of 100 deal IDs can be provided.
237
+ * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
238
+ * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
239
+ * @param {'id' | 'billing_date' | 'deal_id'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;billing_date&#x60;, &#x60;deal_id&#x60;.
240
+ * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
214
241
 
215
242
  * @throws {RequiredError}
216
243
  */
217
- deleteActivity: (id) => __awaiter(this, void 0, void 0, function* () {
218
- // verify required parameter 'id' is not null or undefined
219
- (0, common_1.assertParamExists)('deleteActivity', 'id', id);
220
- const localVarPath = `/activities/{id}`
221
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
222
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
223
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
224
- let baseOptions;
225
- if (configuration) {
226
- baseOptions = configuration.baseOptions;
227
- }
228
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
229
- const localVarHeaderParameter = {};
230
- const localVarQueryParameter = {};
231
- // authentication api_key required
232
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
233
- // authentication oauth2 required
234
- // oauth required
235
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["activities:full"], configuration);
236
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
237
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
238
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
239
- return {
240
- url: (0, common_1.toPathString)(localVarUrlObj),
241
- options: localVarRequestOptions,
242
- };
243
- }),
244
+ getInstallments(deal_ids, cursor, limit, sort_by, sort_direction) {
245
+ return __awaiter(this, void 0, void 0, function* () {
246
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.getInstallments(deal_ids, cursor, limit, sort_by, sort_direction);
247
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
248
+ });
249
+ },
244
250
  /**
245
- * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
246
- * @summary Delete a discount from a deal
251
+ * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
252
+ * @summary Add an installment to a deal
247
253
  * @param {number} id The ID of the deal
248
- * @param {number} discount_id The ID of the discount
254
+ * @param {AddInstallmentRequestBody} [AddInstallmentRequestBody]
249
255
 
250
256
  * @throws {RequiredError}
251
257
  */
252
- deleteAdditionalDiscount: (id, discount_id) => __awaiter(this, void 0, void 0, function* () {
253
- // verify required parameter 'id' is not null or undefined
254
- (0, common_1.assertParamExists)('deleteAdditionalDiscount', 'id', id);
255
- // verify required parameter 'discount_id' is not null or undefined
256
- (0, common_1.assertParamExists)('deleteAdditionalDiscount', 'discount_id', discount_id);
257
- const localVarPath = `/deals/{id}/discounts/{discount_id}`
258
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
259
- .replace(`{${"discount_id"}}`, encodeURIComponent(String(discount_id)));
260
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
261
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
262
- let baseOptions;
263
- if (configuration) {
264
- baseOptions = configuration.baseOptions;
265
- }
266
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
267
- const localVarHeaderParameter = {};
268
- const localVarQueryParameter = {};
269
- // authentication api_key required
270
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
271
- // authentication oauth2 required
272
- // oauth required
273
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
274
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
275
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
276
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
277
- return {
278
- url: (0, common_1.toPathString)(localVarUrlObj),
279
- options: localVarRequestOptions,
280
- };
281
- }),
258
+ postInstallment(id, AddInstallmentRequestBody) {
259
+ return __awaiter(this, void 0, void 0, function* () {
260
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.postInstallment(id, AddInstallmentRequestBody);
261
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
262
+ });
263
+ },
282
264
  /**
283
- * Marks a deal as deleted. After 30 days, the deal will be permanently deleted.
284
- * @summary Delete a deal
265
+ * Edits an installment added to a deal. Only available in Advanced and above plans.
266
+ * @summary Update an installment added to a deal
285
267
  * @param {number} id The ID of the deal
268
+ * @param {number} installment_id The ID of the installment
269
+ * @param {UpdateInstallmentRequestBody} [UpdateInstallmentRequestBody]
286
270
 
287
271
  * @throws {RequiredError}
288
272
  */
289
- deleteDeal: (id) => __awaiter(this, void 0, void 0, function* () {
290
- // verify required parameter 'id' is not null or undefined
291
- (0, common_1.assertParamExists)('deleteDeal', 'id', id);
292
- const localVarPath = `/deals/{id}`
293
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
294
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
295
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
296
- let baseOptions;
297
- if (configuration) {
298
- baseOptions = configuration.baseOptions;
299
- }
300
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
301
- const localVarHeaderParameter = {};
302
- const localVarQueryParameter = {};
303
- // authentication api_key required
304
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
305
- // authentication oauth2 required
306
- // oauth required
307
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
308
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
309
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
310
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
311
- return {
312
- url: (0, common_1.toPathString)(localVarUrlObj),
313
- options: localVarRequestOptions,
314
- };
315
- }),
273
+ updateInstallment(id, installment_id, UpdateInstallmentRequestBody) {
274
+ return __awaiter(this, void 0, void 0, function* () {
275
+ const localVarAxiosArgs = yield localVarAxiosParamCreator.updateInstallment(id, installment_id, UpdateInstallmentRequestBody);
276
+ return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
277
+ });
278
+ },
279
+ };
280
+ };
281
+ exports.BetaApiFp = BetaApiFp;
282
+ /**
283
+ * BetaApi - factory interface
284
+ * @export
285
+ */
286
+ const BetaApiFactory = function (configuration, basePath, axios) {
287
+ const localVarFp = (0, exports.BetaApiFp)(configuration);
288
+ return {
316
289
  /**
317
- * Deletes a product attachment from a deal, using the `product_attachment_id`.
318
- * @summary Delete an attached product from a deal
319
- * @param {number} id The ID of the deal
320
- * @param {number} product_attachment_id The product attachment ID
290
+ * Removes an installment from a deal. Only available in Advanced and above plans.
291
+ * @summary Delete an installment from a deal
292
+ * @param {BetaApiDeleteInstallmentRequest} requestParameters Request parameters.
321
293
 
322
294
  * @throws {RequiredError}
323
295
  */
324
- deleteDealProduct: (id, product_attachment_id) => __awaiter(this, void 0, void 0, function* () {
325
- // verify required parameter 'id' is not null or undefined
326
- (0, common_1.assertParamExists)('deleteDealProduct', 'id', id);
327
- // verify required parameter 'product_attachment_id' is not null or undefined
328
- (0, common_1.assertParamExists)('deleteDealProduct', 'product_attachment_id', product_attachment_id);
329
- const localVarPath = `/deals/{id}/products/{product_attachment_id}`
330
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
331
- .replace(`{${"product_attachment_id"}}`, encodeURIComponent(String(product_attachment_id)));
332
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
333
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
334
- let baseOptions;
335
- if (configuration) {
336
- baseOptions = configuration.baseOptions;
337
- }
338
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
339
- const localVarHeaderParameter = {};
340
- const localVarQueryParameter = {};
341
- // authentication api_key required
342
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
343
- // authentication oauth2 required
344
- // oauth required
345
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full", "products:full"], configuration);
346
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
347
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
348
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
349
- return {
350
- url: (0, common_1.toPathString)(localVarUrlObj),
351
- options: localVarRequestOptions,
352
- };
353
- }),
296
+ deleteInstallment(requestParameters) {
297
+ return localVarFp.deleteInstallment(requestParameters.id, requestParameters.installment_id).then((request) => request(axios, basePath));
298
+ },
354
299
  /**
355
- * Marks a organization as deleted. After 30 days, the organization will be permanently deleted.
356
- * @summary Delete a organization
357
- * @param {number} id The ID of the organization
300
+ * Lists installments attached to a list of deals. Only available in Advanced and above plans.
301
+ * @summary List installments added to a list of deals
302
+ * @param {BetaApiGetInstallmentsRequest} requestParameters Request parameters.
358
303
 
359
304
  * @throws {RequiredError}
360
305
  */
361
- deleteOrganization: (id) => __awaiter(this, void 0, void 0, function* () {
362
- // verify required parameter 'id' is not null or undefined
363
- (0, common_1.assertParamExists)('deleteOrganization', 'id', id);
364
- const localVarPath = `/organizations/{id}`
365
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
366
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
367
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
368
- let baseOptions;
369
- if (configuration) {
370
- baseOptions = configuration.baseOptions;
371
- }
372
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
373
- const localVarHeaderParameter = {};
374
- const localVarQueryParameter = {};
375
- // authentication api_key required
376
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
377
- // authentication oauth2 required
378
- // oauth required
379
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
380
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
381
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
382
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
383
- return {
384
- url: (0, common_1.toPathString)(localVarUrlObj),
385
- options: localVarRequestOptions,
386
- };
387
- }),
306
+ getInstallments(requestParameters) {
307
+ return localVarFp.getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(axios, basePath));
308
+ },
388
309
  /**
389
- * Marks a person as deleted. After 30 days, the person will be permanently deleted.
390
- * @summary Delete a person
391
- * @param {number} id The ID of the person
310
+ * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
311
+ * @summary Add an installment to a deal
312
+ * @param {BetaApiPostInstallmentRequest} requestParameters Request parameters.
392
313
 
393
314
  * @throws {RequiredError}
394
315
  */
395
- deletePerson: (id) => __awaiter(this, void 0, void 0, function* () {
396
- // verify required parameter 'id' is not null or undefined
397
- (0, common_1.assertParamExists)('deletePerson', 'id', id);
398
- const localVarPath = `/persons/{id}`
399
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
400
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
401
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
402
- let baseOptions;
403
- if (configuration) {
404
- baseOptions = configuration.baseOptions;
405
- }
406
- const localVarRequestOptions = Object.assign({ method: 'DELETE' }, baseOptions);
407
- const localVarHeaderParameter = {};
408
- const localVarQueryParameter = {};
409
- // authentication api_key required
410
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
411
- // authentication oauth2 required
412
- // oauth required
413
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
414
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
415
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
416
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
417
- return {
418
- url: (0, common_1.toPathString)(localVarUrlObj),
419
- options: localVarRequestOptions,
420
- };
421
- }),
316
+ postInstallment(requestParameters) {
317
+ return localVarFp.postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody).then((request) => request(axios, basePath));
318
+ },
422
319
  /**
423
- * Returns data about all activities.
424
- * @summary Get all activities
425
- * @param {number} [filter_id] If supplied, only activities matching the specified filter are returned
426
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
427
- * @param {number} [owner_id] If supplied, only activities owned by the specified user are returned. If filter_id is provided, this is ignored.
428
- * @param {string} [updated_since] If set, only activities with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
429
- * @param {string} [updated_until] If set, only activities with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
430
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
431
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
432
- * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include
433
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
434
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
320
+ * Edits an installment added to a deal. Only available in Advanced and above plans.
321
+ * @summary Update an installment added to a deal
322
+ * @param {BetaApiUpdateInstallmentRequest} requestParameters Request parameters.
435
323
 
436
324
  * @throws {RequiredError}
437
325
  */
438
- getActivities: (filter_id, ids, owner_id, updated_since, updated_until, sort_by, sort_direction, include_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
439
- const localVarPath = `/activities`;
440
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
441
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
442
- let baseOptions;
443
- if (configuration) {
444
- baseOptions = configuration.baseOptions;
445
- }
446
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
447
- const localVarHeaderParameter = {};
448
- const localVarQueryParameter = {};
449
- // authentication api_key required
450
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
451
- // authentication oauth2 required
452
- // oauth required
453
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["activities:read", "activities:full"], configuration);
454
- if (filter_id !== undefined) {
455
- localVarQueryParameter['filter_id'] = filter_id;
456
- }
457
- if (ids !== undefined) {
458
- localVarQueryParameter['ids'] = ids;
459
- }
460
- if (owner_id !== undefined) {
461
- localVarQueryParameter['owner_id'] = owner_id;
462
- }
463
- if (updated_since !== undefined) {
464
- localVarQueryParameter['updated_since'] = updated_since;
465
- }
466
- if (updated_until !== undefined) {
467
- localVarQueryParameter['updated_until'] = updated_until;
468
- }
469
- if (sort_by !== undefined) {
470
- localVarQueryParameter['sort_by'] = sort_by;
471
- }
472
- if (sort_direction !== undefined) {
473
- localVarQueryParameter['sort_direction'] = sort_direction;
474
- }
475
- if (include_fields !== undefined) {
476
- localVarQueryParameter['include_fields'] = include_fields;
477
- }
478
- if (limit !== undefined) {
479
- localVarQueryParameter['limit'] = limit;
480
- }
481
- if (cursor !== undefined) {
482
- localVarQueryParameter['cursor'] = cursor;
483
- }
484
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
485
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
486
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
487
- return {
488
- url: (0, common_1.toPathString)(localVarUrlObj),
489
- options: localVarRequestOptions,
490
- };
491
- }),
492
- /**
493
- * Returns the details of a specific activity.
494
- * @summary Get details of an activity
495
- * @param {number} id The ID of the activity
496
- * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include
497
-
498
- * @throws {RequiredError}
499
- */
500
- getActivity: (id, include_fields) => __awaiter(this, void 0, void 0, function* () {
501
- // verify required parameter 'id' is not null or undefined
502
- (0, common_1.assertParamExists)('getActivity', 'id', id);
503
- const localVarPath = `/activities/{id}`
504
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
505
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
506
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
507
- let baseOptions;
508
- if (configuration) {
509
- baseOptions = configuration.baseOptions;
510
- }
511
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
512
- const localVarHeaderParameter = {};
513
- const localVarQueryParameter = {};
514
- // authentication api_key required
515
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
516
- // authentication oauth2 required
517
- // oauth required
518
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["activities:read", "activities:full"], configuration);
519
- if (include_fields !== undefined) {
520
- localVarQueryParameter['include_fields'] = include_fields;
521
- }
522
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
523
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
524
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
525
- return {
526
- url: (0, common_1.toPathString)(localVarUrlObj),
527
- options: localVarRequestOptions,
528
- };
529
- }),
530
- /**
531
- * Lists discounts attached to a deal.
532
- * @summary List discounts added to a deal
533
- * @param {number} id The ID of the deal
534
-
535
- * @throws {RequiredError}
536
- */
537
- getAdditionalDiscounts: (id) => __awaiter(this, void 0, void 0, function* () {
538
- // verify required parameter 'id' is not null or undefined
539
- (0, common_1.assertParamExists)('getAdditionalDiscounts', 'id', id);
540
- const localVarPath = `/deals/{id}/discounts`
541
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
542
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
543
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
544
- let baseOptions;
545
- if (configuration) {
546
- baseOptions = configuration.baseOptions;
547
- }
548
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
549
- const localVarHeaderParameter = {};
550
- const localVarQueryParameter = {};
551
- // authentication api_key required
552
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
553
- // authentication oauth2 required
554
- // oauth required
555
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
556
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
557
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
558
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
559
- return {
560
- url: (0, common_1.toPathString)(localVarUrlObj),
561
- options: localVarRequestOptions,
562
- };
563
- }),
564
- /**
565
- * Returns the details of a specific deal.
566
- * @summary Get details of a deal
567
- * @param {number} id The ID of the deal
568
- * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include
569
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
570
-
571
- * @throws {RequiredError}
572
- */
573
- getDeal: (id, include_fields, custom_fields) => __awaiter(this, void 0, void 0, function* () {
574
- // verify required parameter 'id' is not null or undefined
575
- (0, common_1.assertParamExists)('getDeal', 'id', id);
576
- const localVarPath = `/deals/{id}`
577
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
578
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
579
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
580
- let baseOptions;
581
- if (configuration) {
582
- baseOptions = configuration.baseOptions;
583
- }
584
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
585
- const localVarHeaderParameter = {};
586
- const localVarQueryParameter = {};
587
- // authentication api_key required
588
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
589
- // authentication oauth2 required
590
- // oauth required
591
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
592
- if (include_fields !== undefined) {
593
- localVarQueryParameter['include_fields'] = include_fields;
594
- }
595
- if (custom_fields !== undefined) {
596
- localVarQueryParameter['custom_fields'] = custom_fields;
597
- }
598
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
599
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
600
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
601
- return {
602
- url: (0, common_1.toPathString)(localVarUrlObj),
603
- options: localVarRequestOptions,
604
- };
605
- }),
606
- /**
607
- * Lists products attached to a deal.
608
- * @summary List products attached to a deal
609
- * @param {number} id The ID of the deal
610
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
611
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
612
- * @param {'id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;add_time&#x60;, &#x60;update_time&#x60;.
613
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
614
-
615
- * @throws {RequiredError}
616
- */
617
- getDealProducts: (id, cursor, limit, sort_by, sort_direction) => __awaiter(this, void 0, void 0, function* () {
618
- // verify required parameter 'id' is not null or undefined
619
- (0, common_1.assertParamExists)('getDealProducts', 'id', id);
620
- const localVarPath = `/deals/{id}/products`
621
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
622
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
623
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
624
- let baseOptions;
625
- if (configuration) {
626
- baseOptions = configuration.baseOptions;
627
- }
628
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
629
- const localVarHeaderParameter = {};
630
- const localVarQueryParameter = {};
631
- // authentication api_key required
632
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
633
- // authentication oauth2 required
634
- // oauth required
635
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:read", "products:full", "deals:read", "deals:full"], configuration);
636
- if (cursor !== undefined) {
637
- localVarQueryParameter['cursor'] = cursor;
638
- }
639
- if (limit !== undefined) {
640
- localVarQueryParameter['limit'] = limit;
641
- }
642
- if (sort_by !== undefined) {
643
- localVarQueryParameter['sort_by'] = sort_by;
644
- }
645
- if (sort_direction !== undefined) {
646
- localVarQueryParameter['sort_direction'] = sort_direction;
647
- }
648
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
649
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
650
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
651
- return {
652
- url: (0, common_1.toPathString)(localVarUrlObj),
653
- options: localVarRequestOptions,
654
- };
655
- }),
656
- /**
657
- * Returns data about all deals.
658
- * @summary Get all deals
659
- * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned
660
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
661
- * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored.
662
- * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored.
663
- * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored.
664
- * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored.
665
- * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored.
666
- * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored.
667
- * @param {string} [updated_since] If set, only deals with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
668
- * @param {string} [updated_until] If set, only deals with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
669
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
670
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
671
- * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include
672
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
673
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
674
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
675
-
676
- * @throws {RequiredError}
677
- */
678
- getDeals: (filter_id, ids, owner_id, person_id, org_id, pipeline_id, stage_id, status, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
679
- const localVarPath = `/deals`;
680
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
681
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
682
- let baseOptions;
683
- if (configuration) {
684
- baseOptions = configuration.baseOptions;
685
- }
686
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
687
- const localVarHeaderParameter = {};
688
- const localVarQueryParameter = {};
689
- // authentication api_key required
690
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
691
- // authentication oauth2 required
692
- // oauth required
693
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
694
- if (filter_id !== undefined) {
695
- localVarQueryParameter['filter_id'] = filter_id;
696
- }
697
- if (ids !== undefined) {
698
- localVarQueryParameter['ids'] = ids;
699
- }
700
- if (owner_id !== undefined) {
701
- localVarQueryParameter['owner_id'] = owner_id;
702
- }
703
- if (person_id !== undefined) {
704
- localVarQueryParameter['person_id'] = person_id;
705
- }
706
- if (org_id !== undefined) {
707
- localVarQueryParameter['org_id'] = org_id;
708
- }
709
- if (pipeline_id !== undefined) {
710
- localVarQueryParameter['pipeline_id'] = pipeline_id;
711
- }
712
- if (stage_id !== undefined) {
713
- localVarQueryParameter['stage_id'] = stage_id;
714
- }
715
- if (status !== undefined) {
716
- localVarQueryParameter['status'] = status;
717
- }
718
- if (updated_since !== undefined) {
719
- localVarQueryParameter['updated_since'] = updated_since;
720
- }
721
- if (updated_until !== undefined) {
722
- localVarQueryParameter['updated_until'] = updated_until;
723
- }
724
- if (sort_by !== undefined) {
725
- localVarQueryParameter['sort_by'] = sort_by;
726
- }
727
- if (sort_direction !== undefined) {
728
- localVarQueryParameter['sort_direction'] = sort_direction;
729
- }
730
- if (include_fields !== undefined) {
731
- localVarQueryParameter['include_fields'] = include_fields;
732
- }
733
- if (custom_fields !== undefined) {
734
- localVarQueryParameter['custom_fields'] = custom_fields;
735
- }
736
- if (limit !== undefined) {
737
- localVarQueryParameter['limit'] = limit;
738
- }
739
- if (cursor !== undefined) {
740
- localVarQueryParameter['cursor'] = cursor;
741
- }
742
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
743
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
744
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
745
- return {
746
- url: (0, common_1.toPathString)(localVarUrlObj),
747
- options: localVarRequestOptions,
748
- };
749
- }),
750
- /**
751
- * Returns data about products attached to deals
752
- * @summary Get deal products of several deals
753
- * @param {Array<number>} deal_ids An array of integers with the IDs of the deals for which the attached products will be returned. A maximum of 100 deal IDs can be provided.
754
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
755
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
756
- * @param {'id' | 'deal_id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;deal_id&#x60;, &#x60;add_time&#x60;, &#x60;update_time&#x60;.
757
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
758
-
759
- * @throws {RequiredError}
760
- */
761
- getDealsProducts: (deal_ids, cursor, limit, sort_by, sort_direction) => __awaiter(this, void 0, void 0, function* () {
762
- // verify required parameter 'deal_ids' is not null or undefined
763
- (0, common_1.assertParamExists)('getDealsProducts', 'deal_ids', deal_ids);
764
- const localVarPath = `/deals/products`;
765
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
766
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
767
- let baseOptions;
768
- if (configuration) {
769
- baseOptions = configuration.baseOptions;
770
- }
771
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
772
- const localVarHeaderParameter = {};
773
- const localVarQueryParameter = {};
774
- // authentication api_key required
775
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
776
- // authentication oauth2 required
777
- // oauth required
778
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:read", "products:full", "deals:read", "deals:full"], configuration);
779
- if (deal_ids) {
780
- localVarQueryParameter['deal_ids'] = deal_ids;
781
- }
782
- if (cursor !== undefined) {
783
- localVarQueryParameter['cursor'] = cursor;
784
- }
785
- if (limit !== undefined) {
786
- localVarQueryParameter['limit'] = limit;
787
- }
788
- if (sort_by !== undefined) {
789
- localVarQueryParameter['sort_by'] = sort_by;
790
- }
791
- if (sort_direction !== undefined) {
792
- localVarQueryParameter['sort_direction'] = sort_direction;
793
- }
794
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
795
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
796
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
797
- return {
798
- url: (0, common_1.toPathString)(localVarUrlObj),
799
- options: localVarRequestOptions,
800
- };
801
- }),
802
- /**
803
- * Returns the details of a specific organization.
804
- * @summary Get details of a organization
805
- * @param {number} id The ID of the organization
806
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include
807
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
808
-
809
- * @throws {RequiredError}
810
- */
811
- getOrganization: (id, include_fields, custom_fields) => __awaiter(this, void 0, void 0, function* () {
812
- // verify required parameter 'id' is not null or undefined
813
- (0, common_1.assertParamExists)('getOrganization', 'id', id);
814
- const localVarPath = `/organizations/{id}`
815
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
816
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
817
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
818
- let baseOptions;
819
- if (configuration) {
820
- baseOptions = configuration.baseOptions;
821
- }
822
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
823
- const localVarHeaderParameter = {};
824
- const localVarQueryParameter = {};
825
- // authentication api_key required
826
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
827
- // authentication oauth2 required
828
- // oauth required
829
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration);
830
- if (include_fields !== undefined) {
831
- localVarQueryParameter['include_fields'] = include_fields;
832
- }
833
- if (custom_fields !== undefined) {
834
- localVarQueryParameter['custom_fields'] = custom_fields;
835
- }
836
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
837
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
838
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
839
- return {
840
- url: (0, common_1.toPathString)(localVarUrlObj),
841
- options: localVarRequestOptions,
842
- };
843
- }),
844
- /**
845
- * Returns data about all organizations.
846
- * @summary Get all organizations
847
- * @param {number} [filter_id] If supplied, only organizations matching the specified filter are returned
848
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
849
- * @param {number} [owner_id] If supplied, only organization owned by the specified user are returned. If filter_id is provided, this is ignored.
850
- * @param {string} [updated_since] If set, only organizations with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
851
- * @param {string} [updated_until] If set, only organizations with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
852
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
853
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
854
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include
855
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
856
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
857
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
858
-
859
- * @throws {RequiredError}
860
- */
861
- getOrganizations: (filter_id, ids, owner_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
862
- const localVarPath = `/organizations`;
863
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
864
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
865
- let baseOptions;
866
- if (configuration) {
867
- baseOptions = configuration.baseOptions;
868
- }
869
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
870
- const localVarHeaderParameter = {};
871
- const localVarQueryParameter = {};
872
- // authentication api_key required
873
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
874
- // authentication oauth2 required
875
- // oauth required
876
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration);
877
- if (filter_id !== undefined) {
878
- localVarQueryParameter['filter_id'] = filter_id;
879
- }
880
- if (ids !== undefined) {
881
- localVarQueryParameter['ids'] = ids;
882
- }
883
- if (owner_id !== undefined) {
884
- localVarQueryParameter['owner_id'] = owner_id;
885
- }
886
- if (updated_since !== undefined) {
887
- localVarQueryParameter['updated_since'] = updated_since;
888
- }
889
- if (updated_until !== undefined) {
890
- localVarQueryParameter['updated_until'] = updated_until;
891
- }
892
- if (sort_by !== undefined) {
893
- localVarQueryParameter['sort_by'] = sort_by;
894
- }
895
- if (sort_direction !== undefined) {
896
- localVarQueryParameter['sort_direction'] = sort_direction;
897
- }
898
- if (include_fields !== undefined) {
899
- localVarQueryParameter['include_fields'] = include_fields;
900
- }
901
- if (custom_fields !== undefined) {
902
- localVarQueryParameter['custom_fields'] = custom_fields;
903
- }
904
- if (limit !== undefined) {
905
- localVarQueryParameter['limit'] = limit;
906
- }
907
- if (cursor !== undefined) {
908
- localVarQueryParameter['cursor'] = cursor;
909
- }
910
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
911
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
912
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
913
- return {
914
- url: (0, common_1.toPathString)(localVarUrlObj),
915
- options: localVarRequestOptions,
916
- };
917
- }),
918
- /**
919
- * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
920
- * @summary Get details of a person
921
- * @param {number} id The ID of the person
922
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. &#x60;marketing_status&#x60; and &#x60;doi_status&#x60; can only be included if the company has marketing app enabled.
923
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
924
-
925
- * @throws {RequiredError}
926
- */
927
- getPerson: (id, include_fields, custom_fields) => __awaiter(this, void 0, void 0, function* () {
928
- // verify required parameter 'id' is not null or undefined
929
- (0, common_1.assertParamExists)('getPerson', 'id', id);
930
- const localVarPath = `/persons/{id}`
931
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
932
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
933
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
934
- let baseOptions;
935
- if (configuration) {
936
- baseOptions = configuration.baseOptions;
937
- }
938
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
939
- const localVarHeaderParameter = {};
940
- const localVarQueryParameter = {};
941
- // authentication api_key required
942
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
943
- // authentication oauth2 required
944
- // oauth required
945
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration);
946
- if (include_fields !== undefined) {
947
- localVarQueryParameter['include_fields'] = include_fields;
948
- }
949
- if (custom_fields !== undefined) {
950
- localVarQueryParameter['custom_fields'] = custom_fields;
951
- }
952
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
953
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
954
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
955
- return {
956
- url: (0, common_1.toPathString)(localVarUrlObj),
957
- options: localVarRequestOptions,
958
- };
959
- }),
960
- /**
961
- * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
962
- * @summary Get all persons
963
- * @param {number} [filter_id] If supplied, only persons matching the specified filter are returned
964
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
965
- * @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored.
966
- * @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored.
967
- * @param {string} [updated_since] If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
968
- * @param {string} [updated_until] If set, only persons with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
969
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
970
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
971
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. &#x60;marketing_status&#x60; and &#x60;doi_status&#x60; can only be included if the company has marketing app enabled.
972
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
973
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
974
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
975
-
976
- * @throws {RequiredError}
977
- */
978
- getPersons: (filter_id, ids, owner_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
979
- const localVarPath = `/persons`;
980
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
981
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
982
- let baseOptions;
983
- if (configuration) {
984
- baseOptions = configuration.baseOptions;
985
- }
986
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
987
- const localVarHeaderParameter = {};
988
- const localVarQueryParameter = {};
989
- // authentication api_key required
990
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
991
- // authentication oauth2 required
992
- // oauth required
993
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full"], configuration);
994
- if (filter_id !== undefined) {
995
- localVarQueryParameter['filter_id'] = filter_id;
996
- }
997
- if (ids !== undefined) {
998
- localVarQueryParameter['ids'] = ids;
999
- }
1000
- if (owner_id !== undefined) {
1001
- localVarQueryParameter['owner_id'] = owner_id;
1002
- }
1003
- if (org_id !== undefined) {
1004
- localVarQueryParameter['org_id'] = org_id;
1005
- }
1006
- if (updated_since !== undefined) {
1007
- localVarQueryParameter['updated_since'] = updated_since;
1008
- }
1009
- if (updated_until !== undefined) {
1010
- localVarQueryParameter['updated_until'] = updated_until;
1011
- }
1012
- if (sort_by !== undefined) {
1013
- localVarQueryParameter['sort_by'] = sort_by;
1014
- }
1015
- if (sort_direction !== undefined) {
1016
- localVarQueryParameter['sort_direction'] = sort_direction;
1017
- }
1018
- if (include_fields !== undefined) {
1019
- localVarQueryParameter['include_fields'] = include_fields;
1020
- }
1021
- if (custom_fields !== undefined) {
1022
- localVarQueryParameter['custom_fields'] = custom_fields;
1023
- }
1024
- if (limit !== undefined) {
1025
- localVarQueryParameter['limit'] = limit;
1026
- }
1027
- if (cursor !== undefined) {
1028
- localVarQueryParameter['cursor'] = cursor;
1029
- }
1030
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1031
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1032
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1033
- return {
1034
- url: (0, common_1.toPathString)(localVarUrlObj),
1035
- options: localVarRequestOptions,
1036
- };
1037
- }),
1038
- /**
1039
- * Adds a discount to a deal changing, the deal value if the deal has one-time products attached.
1040
- * @summary Add a discount to a deal
1041
- * @param {number} id The ID of the deal
1042
- * @param {AddAdditionalDiscountRequestBody} [AddAdditionalDiscountRequestBody]
1043
-
1044
- * @throws {RequiredError}
1045
- */
1046
- postAdditionalDiscount: (id, AddAdditionalDiscountRequestBody) => __awaiter(this, void 0, void 0, function* () {
1047
- // verify required parameter 'id' is not null or undefined
1048
- (0, common_1.assertParamExists)('postAdditionalDiscount', 'id', id);
1049
- const localVarPath = `/deals/{id}/discounts`
1050
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1051
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1052
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1053
- let baseOptions;
1054
- if (configuration) {
1055
- baseOptions = configuration.baseOptions;
1056
- }
1057
- const localVarRequestOptions = Object.assign({ method: 'POST' }, baseOptions);
1058
- const localVarHeaderParameter = {};
1059
- const localVarQueryParameter = {};
1060
- // authentication api_key required
1061
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1062
- // authentication oauth2 required
1063
- // oauth required
1064
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
1065
- localVarHeaderParameter['Content-Type'] = 'application/json';
1066
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1067
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1068
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1069
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddAdditionalDiscountRequestBody, localVarRequestOptions, configuration);
1070
- return {
1071
- url: (0, common_1.toPathString)(localVarUrlObj),
1072
- options: localVarRequestOptions,
1073
- };
1074
- }),
1075
- /**
1076
- * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID.
1077
- * @summary Search deals
1078
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
1079
- * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
1080
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
1081
- * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000.
1082
- * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000.
1083
- * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open &#x3D; Open, won &#x3D; Won, lost &#x3D; Lost. The upper limit of found deals associated with the status is 2000.
1084
- * @param {'deal.cc_email'} [include_fields] Supports including optional fields in the results which are not provided by default
1085
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1086
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1087
-
1088
- * @throws {RequiredError}
1089
- */
1090
- searchDeals: (term, fields, exact_match, person_id, organization_id, status, include_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1091
- // verify required parameter 'term' is not null or undefined
1092
- (0, common_1.assertParamExists)('searchDeals', 'term', term);
1093
- const localVarPath = `/deals/search`;
1094
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1095
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1096
- let baseOptions;
1097
- if (configuration) {
1098
- baseOptions = configuration.baseOptions;
1099
- }
1100
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1101
- const localVarHeaderParameter = {};
1102
- const localVarQueryParameter = {};
1103
- // authentication api_key required
1104
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1105
- // authentication oauth2 required
1106
- // oauth required
1107
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full", "search:read"], configuration);
1108
- if (term !== undefined) {
1109
- localVarQueryParameter['term'] = term;
1110
- }
1111
- if (fields !== undefined) {
1112
- localVarQueryParameter['fields'] = fields;
1113
- }
1114
- if (exact_match !== undefined) {
1115
- localVarQueryParameter['exact_match'] = exact_match;
1116
- }
1117
- if (person_id !== undefined) {
1118
- localVarQueryParameter['person_id'] = person_id;
1119
- }
1120
- if (organization_id !== undefined) {
1121
- localVarQueryParameter['organization_id'] = organization_id;
1122
- }
1123
- if (status !== undefined) {
1124
- localVarQueryParameter['status'] = status;
1125
- }
1126
- if (include_fields !== undefined) {
1127
- localVarQueryParameter['include_fields'] = include_fields;
1128
- }
1129
- if (limit !== undefined) {
1130
- localVarQueryParameter['limit'] = limit;
1131
- }
1132
- if (cursor !== undefined) {
1133
- localVarQueryParameter['cursor'] = cursor;
1134
- }
1135
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1136
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1137
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1138
- return {
1139
- url: (0, common_1.toPathString)(localVarUrlObj),
1140
- options: localVarRequestOptions,
1141
- };
1142
- }),
1143
- /**
1144
- * Performs a search from your choice of item types and fields.
1145
- * @summary Perform a search from multiple item types
1146
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
1147
- * @param {'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all.
1148
- * @param {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:&lt;br&gt; &lt;table&gt; &lt;tr&gt;&lt;th&gt;&lt;b&gt;Item type&lt;/b&gt;&lt;/th&gt;&lt;th&gt;&lt;b&gt;Field&lt;/b&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Deal&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;title&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Person&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;email&#x60;, &#x60;name&#x60;, &#x60;notes&#x60;, &#x60;phone&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Organization&lt;/td&gt;&lt;td&gt;&#x60;address&#x60;, &#x60;custom_fields&#x60;, &#x60;name&#x60;, &#x60;notes&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Product&lt;/td&gt;&lt;td&gt;&#x60;code&#x60;, &#x60;custom_fields&#x60;, &#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Lead&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;email&#x60;, &#x60;organization_name&#x60;, &#x60;person_name&#x60;, &#x60;phone&#x60;, &#x60;title&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;File&lt;/td&gt;&lt;td&gt;&#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Mail attachment&lt;/td&gt;&lt;td&gt;&#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Project&lt;/td&gt;&lt;td&gt; &#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;title&#x60;, &#x60;description&#x60; &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;br&gt; Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.&lt;br/&gt; When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use &#x60;search_for_related_items&#x60;.
1149
- * @param {boolean} [search_for_related_items] When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization
1150
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
1151
- * @param {'deal.cc_email' | 'person.picture' | 'product.price'} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default.
1152
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1153
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1154
-
1155
- * @throws {RequiredError}
1156
- */
1157
- searchItem: (term, item_types, fields, search_for_related_items, exact_match, include_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1158
- // verify required parameter 'term' is not null or undefined
1159
- (0, common_1.assertParamExists)('searchItem', 'term', term);
1160
- const localVarPath = `/itemSearch`;
1161
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1162
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1163
- let baseOptions;
1164
- if (configuration) {
1165
- baseOptions = configuration.baseOptions;
1166
- }
1167
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1168
- const localVarHeaderParameter = {};
1169
- const localVarQueryParameter = {};
1170
- // authentication api_key required
1171
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1172
- // authentication oauth2 required
1173
- // oauth required
1174
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["search:read"], configuration);
1175
- if (term !== undefined) {
1176
- localVarQueryParameter['term'] = term;
1177
- }
1178
- if (item_types !== undefined) {
1179
- localVarQueryParameter['item_types'] = item_types;
1180
- }
1181
- if (fields !== undefined) {
1182
- localVarQueryParameter['fields'] = fields;
1183
- }
1184
- if (search_for_related_items !== undefined) {
1185
- localVarQueryParameter['search_for_related_items'] = search_for_related_items;
1186
- }
1187
- if (exact_match !== undefined) {
1188
- localVarQueryParameter['exact_match'] = exact_match;
1189
- }
1190
- if (include_fields !== undefined) {
1191
- localVarQueryParameter['include_fields'] = include_fields;
1192
- }
1193
- if (limit !== undefined) {
1194
- localVarQueryParameter['limit'] = limit;
1195
- }
1196
- if (cursor !== undefined) {
1197
- localVarQueryParameter['cursor'] = cursor;
1198
- }
1199
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1200
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1201
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1202
- return {
1203
- url: (0, common_1.toPathString)(localVarUrlObj),
1204
- options: localVarRequestOptions,
1205
- };
1206
- }),
1207
- /**
1208
- * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products).
1209
- * @summary Perform a search using a specific field from an item type
1210
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if &#x60;match&#x60; is &#x60;exact&#x60;). Please note that the search term has to be URL encoded.
1211
- * @param {'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project'} entity_type The type of the field to perform the search from
1212
- * @param {string} field The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields\&#39; API GET methods (dealFields, personFields, etc.). Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
1213
- * @param {'exact' | 'beginning' | 'middle'} [match] The type of match used against the term. The search &lt;b&gt;is&lt;/b&gt; case sensitive.&lt;br/&gt;&lt;br/&gt; E.g. in case of searching for a value &#x60;monkey&#x60;, &lt;ul&gt; &lt;li&gt;with &#x60;exact&#x60; match, you will only find it if term is &#x60;monkey&#x60;&lt;/li&gt; &lt;li&gt;with &#x60;beginning&#x60; match, you will only find it if the term matches the beginning or the whole string, e.g. &#x60;monk&#x60; and &#x60;monkey&#x60;&lt;/li&gt; &lt;li&gt;with &#x60;middle&#x60; match, you will find the it if the term matches any substring of the value, e.g. &#x60;onk&#x60; and &#x60;ke&#x60;&lt;/li&gt; &lt;/ul&gt;.
1214
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1215
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1216
-
1217
- * @throws {RequiredError}
1218
- */
1219
- searchItemByField: (term, entity_type, field, match, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1220
- // verify required parameter 'term' is not null or undefined
1221
- (0, common_1.assertParamExists)('searchItemByField', 'term', term);
1222
- // verify required parameter 'entity_type' is not null or undefined
1223
- (0, common_1.assertParamExists)('searchItemByField', 'entity_type', entity_type);
1224
- // verify required parameter 'field' is not null or undefined
1225
- (0, common_1.assertParamExists)('searchItemByField', 'field', field);
1226
- const localVarPath = `/itemSearch/field`;
1227
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1228
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1229
- let baseOptions;
1230
- if (configuration) {
1231
- baseOptions = configuration.baseOptions;
1232
- }
1233
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1234
- const localVarHeaderParameter = {};
1235
- const localVarQueryParameter = {};
1236
- // authentication api_key required
1237
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1238
- // authentication oauth2 required
1239
- // oauth required
1240
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["search:read"], configuration);
1241
- if (term !== undefined) {
1242
- localVarQueryParameter['term'] = term;
1243
- }
1244
- if (entity_type !== undefined) {
1245
- localVarQueryParameter['entity_type'] = entity_type;
1246
- }
1247
- if (match !== undefined) {
1248
- localVarQueryParameter['match'] = match;
1249
- }
1250
- if (field !== undefined) {
1251
- localVarQueryParameter['field'] = field;
1252
- }
1253
- if (limit !== undefined) {
1254
- localVarQueryParameter['limit'] = limit;
1255
- }
1256
- if (cursor !== undefined) {
1257
- localVarQueryParameter['cursor'] = cursor;
1258
- }
1259
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1260
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1261
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1262
- return {
1263
- url: (0, common_1.toPathString)(localVarUrlObj),
1264
- options: localVarRequestOptions,
1265
- };
1266
- }),
1267
- /**
1268
- * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
1269
- * @summary Search leads
1270
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
1271
- * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them.
1272
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
1273
- * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000.
1274
- * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000.
1275
- * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default
1276
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1277
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1278
-
1279
- * @throws {RequiredError}
1280
- */
1281
- searchLeads: (term, fields, exact_match, person_id, organization_id, include_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1282
- // verify required parameter 'term' is not null or undefined
1283
- (0, common_1.assertParamExists)('searchLeads', 'term', term);
1284
- const localVarPath = `/leads/search`;
1285
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1286
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1287
- let baseOptions;
1288
- if (configuration) {
1289
- baseOptions = configuration.baseOptions;
1290
- }
1291
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1292
- const localVarHeaderParameter = {};
1293
- const localVarQueryParameter = {};
1294
- // authentication api_key required
1295
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1296
- // authentication oauth2 required
1297
- // oauth required
1298
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["leads:read", "leads:full", "search:read"], configuration);
1299
- if (term !== undefined) {
1300
- localVarQueryParameter['term'] = term;
1301
- }
1302
- if (fields !== undefined) {
1303
- localVarQueryParameter['fields'] = fields;
1304
- }
1305
- if (exact_match !== undefined) {
1306
- localVarQueryParameter['exact_match'] = exact_match;
1307
- }
1308
- if (person_id !== undefined) {
1309
- localVarQueryParameter['person_id'] = person_id;
1310
- }
1311
- if (organization_id !== undefined) {
1312
- localVarQueryParameter['organization_id'] = organization_id;
1313
- }
1314
- if (include_fields !== undefined) {
1315
- localVarQueryParameter['include_fields'] = include_fields;
1316
- }
1317
- if (limit !== undefined) {
1318
- localVarQueryParameter['limit'] = limit;
1319
- }
1320
- if (cursor !== undefined) {
1321
- localVarQueryParameter['cursor'] = cursor;
1322
- }
1323
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1324
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1325
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1326
- return {
1327
- url: (0, common_1.toPathString)(localVarUrlObj),
1328
- options: localVarRequestOptions,
1329
- };
1330
- }),
1331
- /**
1332
- * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope.
1333
- * @summary Search organizations
1334
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
1335
- * @param {'address' | 'custom_fields' | 'notes' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
1336
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
1337
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1338
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1339
-
1340
- * @throws {RequiredError}
1341
- */
1342
- searchOrganization: (term, fields, exact_match, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1343
- // verify required parameter 'term' is not null or undefined
1344
- (0, common_1.assertParamExists)('searchOrganization', 'term', term);
1345
- const localVarPath = `/organizations/search`;
1346
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1347
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1348
- let baseOptions;
1349
- if (configuration) {
1350
- baseOptions = configuration.baseOptions;
1351
- }
1352
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1353
- const localVarHeaderParameter = {};
1354
- const localVarQueryParameter = {};
1355
- // authentication api_key required
1356
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1357
- // authentication oauth2 required
1358
- // oauth required
1359
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full", "search:read"], configuration);
1360
- if (term !== undefined) {
1361
- localVarQueryParameter['term'] = term;
1362
- }
1363
- if (fields !== undefined) {
1364
- localVarQueryParameter['fields'] = fields;
1365
- }
1366
- if (exact_match !== undefined) {
1367
- localVarQueryParameter['exact_match'] = exact_match;
1368
- }
1369
- if (limit !== undefined) {
1370
- localVarQueryParameter['limit'] = limit;
1371
- }
1372
- if (cursor !== undefined) {
1373
- localVarQueryParameter['cursor'] = cursor;
1374
- }
1375
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1376
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1377
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1378
- return {
1379
- url: (0, common_1.toPathString)(localVarUrlObj),
1380
- options: localVarRequestOptions,
1381
- };
1382
- }),
1383
- /**
1384
- * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found persons can be filtered by organization ID.
1385
- * @summary Search persons
1386
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
1387
- * @param {'custom_fields' | 'email' | 'notes' | 'phone' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
1388
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
1389
- * @param {number} [organization_id] Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000.
1390
- * @param {'person.picture'} [include_fields] Supports including optional fields in the results which are not provided by default
1391
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1392
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1393
-
1394
- * @throws {RequiredError}
1395
- */
1396
- searchPersons: (term, fields, exact_match, organization_id, include_fields, limit, cursor) => __awaiter(this, void 0, void 0, function* () {
1397
- // verify required parameter 'term' is not null or undefined
1398
- (0, common_1.assertParamExists)('searchPersons', 'term', term);
1399
- const localVarPath = `/persons/search`;
1400
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1401
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1402
- let baseOptions;
1403
- if (configuration) {
1404
- baseOptions = configuration.baseOptions;
1405
- }
1406
- const localVarRequestOptions = Object.assign({ method: 'GET' }, baseOptions);
1407
- const localVarHeaderParameter = {};
1408
- const localVarQueryParameter = {};
1409
- // authentication api_key required
1410
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1411
- // authentication oauth2 required
1412
- // oauth required
1413
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:read", "contacts:full", "search:read"], configuration);
1414
- if (term !== undefined) {
1415
- localVarQueryParameter['term'] = term;
1416
- }
1417
- if (fields !== undefined) {
1418
- localVarQueryParameter['fields'] = fields;
1419
- }
1420
- if (exact_match !== undefined) {
1421
- localVarQueryParameter['exact_match'] = exact_match;
1422
- }
1423
- if (organization_id !== undefined) {
1424
- localVarQueryParameter['organization_id'] = organization_id;
1425
- }
1426
- if (include_fields !== undefined) {
1427
- localVarQueryParameter['include_fields'] = include_fields;
1428
- }
1429
- if (limit !== undefined) {
1430
- localVarQueryParameter['limit'] = limit;
1431
- }
1432
- if (cursor !== undefined) {
1433
- localVarQueryParameter['cursor'] = cursor;
1434
- }
1435
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1436
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1437
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1438
- return {
1439
- url: (0, common_1.toPathString)(localVarUrlObj),
1440
- options: localVarRequestOptions,
1441
- };
1442
- }),
1443
- /**
1444
- * Updates the properties of an activity.
1445
- * @summary Update an activity
1446
- * @param {number} id The ID of the activity
1447
- * @param {AddActivityRequest} [AddActivityRequest]
1448
-
1449
- * @throws {RequiredError}
1450
- */
1451
- updateActivity: (id, AddActivityRequest) => __awaiter(this, void 0, void 0, function* () {
1452
- // verify required parameter 'id' is not null or undefined
1453
- (0, common_1.assertParamExists)('updateActivity', 'id', id);
1454
- const localVarPath = `/activities/{id}`
1455
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1456
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1457
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1458
- let baseOptions;
1459
- if (configuration) {
1460
- baseOptions = configuration.baseOptions;
1461
- }
1462
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1463
- const localVarHeaderParameter = {};
1464
- const localVarQueryParameter = {};
1465
- // authentication api_key required
1466
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1467
- // authentication oauth2 required
1468
- // oauth required
1469
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["activities:full"], configuration);
1470
- localVarHeaderParameter['Content-Type'] = 'application/json';
1471
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1472
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1473
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1474
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(AddActivityRequest, localVarRequestOptions, configuration);
1475
- return {
1476
- url: (0, common_1.toPathString)(localVarUrlObj),
1477
- options: localVarRequestOptions,
1478
- };
1479
- }),
1480
- /**
1481
- * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached.
1482
- * @summary Update a discount added to a deal
1483
- * @param {number} id The ID of the deal
1484
- * @param {number} discount_id The ID of the discount
1485
- * @param {UpdateAdditionalDiscountRequestBody} [UpdateAdditionalDiscountRequestBody]
1486
-
1487
- * @throws {RequiredError}
1488
- */
1489
- updateAdditionalDiscount: (id, discount_id, UpdateAdditionalDiscountRequestBody) => __awaiter(this, void 0, void 0, function* () {
1490
- // verify required parameter 'id' is not null or undefined
1491
- (0, common_1.assertParamExists)('updateAdditionalDiscount', 'id', id);
1492
- // verify required parameter 'discount_id' is not null or undefined
1493
- (0, common_1.assertParamExists)('updateAdditionalDiscount', 'discount_id', discount_id);
1494
- const localVarPath = `/deals/{id}/discounts/{discount_id}`
1495
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
1496
- .replace(`{${"discount_id"}}`, encodeURIComponent(String(discount_id)));
1497
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1498
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1499
- let baseOptions;
1500
- if (configuration) {
1501
- baseOptions = configuration.baseOptions;
1502
- }
1503
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1504
- const localVarHeaderParameter = {};
1505
- const localVarQueryParameter = {};
1506
- // authentication api_key required
1507
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1508
- // authentication oauth2 required
1509
- // oauth required
1510
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:read", "deals:full"], configuration);
1511
- localVarHeaderParameter['Content-Type'] = 'application/json';
1512
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1513
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1514
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1515
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateAdditionalDiscountRequestBody, localVarRequestOptions, configuration);
1516
- return {
1517
- url: (0, common_1.toPathString)(localVarUrlObj),
1518
- options: localVarRequestOptions,
1519
- };
1520
- }),
1521
- /**
1522
- * Updates the properties of a deal.
1523
- * @summary Update a deal
1524
- * @param {number} id The ID of the deal
1525
- * @param {UpdateDealRequest} [UpdateDealRequest]
1526
-
1527
- * @throws {RequiredError}
1528
- */
1529
- updateDeal: (id, UpdateDealRequest) => __awaiter(this, void 0, void 0, function* () {
1530
- // verify required parameter 'id' is not null or undefined
1531
- (0, common_1.assertParamExists)('updateDeal', 'id', id);
1532
- const localVarPath = `/deals/{id}`
1533
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1534
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1535
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1536
- let baseOptions;
1537
- if (configuration) {
1538
- baseOptions = configuration.baseOptions;
1539
- }
1540
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1541
- const localVarHeaderParameter = {};
1542
- const localVarQueryParameter = {};
1543
- // authentication api_key required
1544
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1545
- // authentication oauth2 required
1546
- // oauth required
1547
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["deals:full"], configuration);
1548
- localVarHeaderParameter['Content-Type'] = 'application/json';
1549
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1550
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1551
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1552
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateDealRequest, localVarRequestOptions, configuration);
1553
- return {
1554
- url: (0, common_1.toPathString)(localVarUrlObj),
1555
- options: localVarRequestOptions,
1556
- };
1557
- }),
1558
- /**
1559
- * Updates the details of the product that has been attached to a deal.
1560
- * @summary Update the product attached to a deal
1561
- * @param {number} id The ID of the deal
1562
- * @param {number} product_attachment_id The ID of the deal-product (the ID of the product attached to the deal)
1563
- * @param {UpdateDealProductRequest} [UpdateDealProductRequest]
1564
-
1565
- * @throws {RequiredError}
1566
- */
1567
- updateDealProduct: (id, product_attachment_id, UpdateDealProductRequest) => __awaiter(this, void 0, void 0, function* () {
1568
- // verify required parameter 'id' is not null or undefined
1569
- (0, common_1.assertParamExists)('updateDealProduct', 'id', id);
1570
- // verify required parameter 'product_attachment_id' is not null or undefined
1571
- (0, common_1.assertParamExists)('updateDealProduct', 'product_attachment_id', product_attachment_id);
1572
- const localVarPath = `/deals/{id}/products/{product_attachment_id}`
1573
- .replace(`{${"id"}}`, encodeURIComponent(String(id)))
1574
- .replace(`{${"product_attachment_id"}}`, encodeURIComponent(String(product_attachment_id)));
1575
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1576
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1577
- let baseOptions;
1578
- if (configuration) {
1579
- baseOptions = configuration.baseOptions;
1580
- }
1581
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1582
- const localVarHeaderParameter = {};
1583
- const localVarQueryParameter = {};
1584
- // authentication api_key required
1585
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1586
- // authentication oauth2 required
1587
- // oauth required
1588
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["products:full", "deals:full"], configuration);
1589
- localVarHeaderParameter['Content-Type'] = 'application/json';
1590
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1591
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1592
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1593
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateDealProductRequest, localVarRequestOptions, configuration);
1594
- return {
1595
- url: (0, common_1.toPathString)(localVarUrlObj),
1596
- options: localVarRequestOptions,
1597
- };
1598
- }),
1599
- /**
1600
- * Updates the properties of a organization.
1601
- * @summary Update a organization
1602
- * @param {number} id The ID of the organization
1603
- * @param {UpdateOrganizationRequest} [UpdateOrganizationRequest]
1604
-
1605
- * @throws {RequiredError}
1606
- */
1607
- updateOrganization: (id, UpdateOrganizationRequest) => __awaiter(this, void 0, void 0, function* () {
1608
- // verify required parameter 'id' is not null or undefined
1609
- (0, common_1.assertParamExists)('updateOrganization', 'id', id);
1610
- const localVarPath = `/organizations/{id}`
1611
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1612
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1613
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1614
- let baseOptions;
1615
- if (configuration) {
1616
- baseOptions = configuration.baseOptions;
1617
- }
1618
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1619
- const localVarHeaderParameter = {};
1620
- const localVarQueryParameter = {};
1621
- // authentication api_key required
1622
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1623
- // authentication oauth2 required
1624
- // oauth required
1625
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
1626
- localVarHeaderParameter['Content-Type'] = 'application/json';
1627
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1628
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1629
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1630
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdateOrganizationRequest, localVarRequestOptions, configuration);
1631
- return {
1632
- url: (0, common_1.toPathString)(localVarUrlObj),
1633
- options: localVarRequestOptions,
1634
- };
1635
- }),
1636
- /**
1637
- * Updates the properties of a person.
1638
- * @summary Update a person
1639
- * @param {number} id The ID of the person
1640
- * @param {UpdatePersonRequest} [UpdatePersonRequest]
1641
-
1642
- * @throws {RequiredError}
1643
- */
1644
- updatePerson: (id, UpdatePersonRequest) => __awaiter(this, void 0, void 0, function* () {
1645
- // verify required parameter 'id' is not null or undefined
1646
- (0, common_1.assertParamExists)('updatePerson', 'id', id);
1647
- const localVarPath = `/persons/{id}`
1648
- .replace(`{${"id"}}`, encodeURIComponent(String(id)));
1649
- // use dummy base URL string because the URL constructor only accepts absolute URLs.
1650
- const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
1651
- let baseOptions;
1652
- if (configuration) {
1653
- baseOptions = configuration.baseOptions;
1654
- }
1655
- const localVarRequestOptions = Object.assign({ method: 'PATCH' }, baseOptions);
1656
- const localVarHeaderParameter = {};
1657
- const localVarQueryParameter = {};
1658
- // authentication api_key required
1659
- yield (0, common_1.setApiKeyToObject)(localVarQueryParameter, "api_token", configuration);
1660
- // authentication oauth2 required
1661
- // oauth required
1662
- yield (0, common_1.setOAuthToObject)(localVarHeaderParameter, "oauth2", ["contacts:full"], configuration);
1663
- localVarHeaderParameter['Content-Type'] = 'application/json';
1664
- (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
1665
- let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
1666
- localVarRequestOptions.headers = Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions);
1667
- localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(UpdatePersonRequest, localVarRequestOptions, configuration);
1668
- return {
1669
- url: (0, common_1.toPathString)(localVarUrlObj),
1670
- options: localVarRequestOptions,
1671
- };
1672
- }),
1673
- };
1674
- };
1675
- exports.BetaApiAxiosParamCreator = BetaApiAxiosParamCreator;
1676
- /**
1677
- * BetaApi - functional programming interface
1678
- * @export
1679
- */
1680
- const BetaApiFp = function (configuration) {
1681
- const localVarAxiosParamCreator = (0, exports.BetaApiAxiosParamCreator)(configuration);
1682
- return {
1683
- /**
1684
- * Adds a new activity.
1685
- * @summary Add a new activity
1686
- * @param {AddActivityRequest} [AddActivityRequest]
1687
-
1688
- * @throws {RequiredError}
1689
- */
1690
- addActivity(AddActivityRequest) {
1691
- return __awaiter(this, void 0, void 0, function* () {
1692
- const localVarAxiosArgs = yield localVarAxiosParamCreator.addActivity(AddActivityRequest);
1693
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1694
- });
1695
- },
1696
- /**
1697
- * Adds a new deal.
1698
- * @summary Add a new deal
1699
- * @param {AddDealRequest} [AddDealRequest]
1700
-
1701
- * @throws {RequiredError}
1702
- */
1703
- addDeal(AddDealRequest) {
1704
- return __awaiter(this, void 0, void 0, function* () {
1705
- const localVarAxiosArgs = yield localVarAxiosParamCreator.addDeal(AddDealRequest);
1706
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1707
- });
1708
- },
1709
- /**
1710
- * Adds a product to a deal, creating a new item called a deal-product.
1711
- * @summary Add a product to a deal
1712
- * @param {number} id The ID of the deal
1713
- * @param {AddDealProductRequest} [AddDealProductRequest]
1714
-
1715
- * @throws {RequiredError}
1716
- */
1717
- addDealProduct(id, AddDealProductRequest) {
1718
- return __awaiter(this, void 0, void 0, function* () {
1719
- const localVarAxiosArgs = yield localVarAxiosParamCreator.addDealProduct(id, AddDealProductRequest);
1720
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1721
- });
1722
- },
1723
- /**
1724
- * Adds a new organization.
1725
- * @summary Add a new organization
1726
- * @param {AddOrganizationRequest} [AddOrganizationRequest]
1727
-
1728
- * @throws {RequiredError}
1729
- */
1730
- addOrganization(AddOrganizationRequest) {
1731
- return __awaiter(this, void 0, void 0, function* () {
1732
- const localVarAxiosArgs = yield localVarAxiosParamCreator.addOrganization(AddOrganizationRequest);
1733
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1734
- });
1735
- },
1736
- /**
1737
- * Adds a new person.
1738
- * @summary Add a new person
1739
- * @param {AddPersonRequest} [AddPersonRequest]
1740
-
1741
- * @throws {RequiredError}
1742
- */
1743
- addPerson(AddPersonRequest) {
1744
- return __awaiter(this, void 0, void 0, function* () {
1745
- const localVarAxiosArgs = yield localVarAxiosParamCreator.addPerson(AddPersonRequest);
1746
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1747
- });
1748
- },
1749
- /**
1750
- * Marks an activity as deleted. After 30 days, the activity will be permanently deleted.
1751
- * @summary Delete an activity
1752
- * @param {number} id The ID of the activity
1753
-
1754
- * @throws {RequiredError}
1755
- */
1756
- deleteActivity(id) {
1757
- return __awaiter(this, void 0, void 0, function* () {
1758
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteActivity(id);
1759
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1760
- });
1761
- },
1762
- /**
1763
- * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
1764
- * @summary Delete a discount from a deal
1765
- * @param {number} id The ID of the deal
1766
- * @param {number} discount_id The ID of the discount
1767
-
1768
- * @throws {RequiredError}
1769
- */
1770
- deleteAdditionalDiscount(id, discount_id) {
1771
- return __awaiter(this, void 0, void 0, function* () {
1772
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteAdditionalDiscount(id, discount_id);
1773
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1774
- });
1775
- },
1776
- /**
1777
- * Marks a deal as deleted. After 30 days, the deal will be permanently deleted.
1778
- * @summary Delete a deal
1779
- * @param {number} id The ID of the deal
1780
-
1781
- * @throws {RequiredError}
1782
- */
1783
- deleteDeal(id) {
1784
- return __awaiter(this, void 0, void 0, function* () {
1785
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteDeal(id);
1786
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1787
- });
1788
- },
1789
- /**
1790
- * Deletes a product attachment from a deal, using the `product_attachment_id`.
1791
- * @summary Delete an attached product from a deal
1792
- * @param {number} id The ID of the deal
1793
- * @param {number} product_attachment_id The product attachment ID
1794
-
1795
- * @throws {RequiredError}
1796
- */
1797
- deleteDealProduct(id, product_attachment_id) {
1798
- return __awaiter(this, void 0, void 0, function* () {
1799
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteDealProduct(id, product_attachment_id);
1800
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1801
- });
1802
- },
1803
- /**
1804
- * Marks a organization as deleted. After 30 days, the organization will be permanently deleted.
1805
- * @summary Delete a organization
1806
- * @param {number} id The ID of the organization
1807
-
1808
- * @throws {RequiredError}
1809
- */
1810
- deleteOrganization(id) {
1811
- return __awaiter(this, void 0, void 0, function* () {
1812
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deleteOrganization(id);
1813
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1814
- });
1815
- },
1816
- /**
1817
- * Marks a person as deleted. After 30 days, the person will be permanently deleted.
1818
- * @summary Delete a person
1819
- * @param {number} id The ID of the person
1820
-
1821
- * @throws {RequiredError}
1822
- */
1823
- deletePerson(id) {
1824
- return __awaiter(this, void 0, void 0, function* () {
1825
- const localVarAxiosArgs = yield localVarAxiosParamCreator.deletePerson(id);
1826
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1827
- });
1828
- },
1829
- /**
1830
- * Returns data about all activities.
1831
- * @summary Get all activities
1832
- * @param {number} [filter_id] If supplied, only activities matching the specified filter are returned
1833
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
1834
- * @param {number} [owner_id] If supplied, only activities owned by the specified user are returned. If filter_id is provided, this is ignored.
1835
- * @param {string} [updated_since] If set, only activities with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
1836
- * @param {string} [updated_until] If set, only activities with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
1837
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
1838
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
1839
- * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include
1840
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1841
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1842
-
1843
- * @throws {RequiredError}
1844
- */
1845
- getActivities(filter_id, ids, owner_id, updated_since, updated_until, sort_by, sort_direction, include_fields, limit, cursor) {
1846
- return __awaiter(this, void 0, void 0, function* () {
1847
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getActivities(filter_id, ids, owner_id, updated_since, updated_until, sort_by, sort_direction, include_fields, limit, cursor);
1848
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1849
- });
1850
- },
1851
- /**
1852
- * Returns the details of a specific activity.
1853
- * @summary Get details of an activity
1854
- * @param {number} id The ID of the activity
1855
- * @param {'attendees'} [include_fields] Optional comma separated string array of additional fields to include
1856
-
1857
- * @throws {RequiredError}
1858
- */
1859
- getActivity(id, include_fields) {
1860
- return __awaiter(this, void 0, void 0, function* () {
1861
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getActivity(id, include_fields);
1862
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1863
- });
1864
- },
1865
- /**
1866
- * Lists discounts attached to a deal.
1867
- * @summary List discounts added to a deal
1868
- * @param {number} id The ID of the deal
1869
-
1870
- * @throws {RequiredError}
1871
- */
1872
- getAdditionalDiscounts(id) {
1873
- return __awaiter(this, void 0, void 0, function* () {
1874
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getAdditionalDiscounts(id);
1875
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1876
- });
1877
- },
1878
- /**
1879
- * Returns the details of a specific deal.
1880
- * @summary Get details of a deal
1881
- * @param {number} id The ID of the deal
1882
- * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include
1883
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
1884
-
1885
- * @throws {RequiredError}
1886
- */
1887
- getDeal(id, include_fields, custom_fields) {
1888
- return __awaiter(this, void 0, void 0, function* () {
1889
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getDeal(id, include_fields, custom_fields);
1890
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1891
- });
1892
- },
1893
- /**
1894
- * Lists products attached to a deal.
1895
- * @summary List products attached to a deal
1896
- * @param {number} id The ID of the deal
1897
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1898
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1899
- * @param {'id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;add_time&#x60;, &#x60;update_time&#x60;.
1900
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
1901
-
1902
- * @throws {RequiredError}
1903
- */
1904
- getDealProducts(id, cursor, limit, sort_by, sort_direction) {
1905
- return __awaiter(this, void 0, void 0, function* () {
1906
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getDealProducts(id, cursor, limit, sort_by, sort_direction);
1907
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1908
- });
1909
- },
1910
- /**
1911
- * Returns data about all deals.
1912
- * @summary Get all deals
1913
- * @param {number} [filter_id] If supplied, only deals matching the specified filter are returned
1914
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
1915
- * @param {number} [owner_id] If supplied, only deals owned by the specified user are returned. If filter_id is provided, this is ignored.
1916
- * @param {number} [person_id] If supplied, only deals linked to the specified person are returned. If filter_id is provided, this is ignored.
1917
- * @param {number} [org_id] If supplied, only deals linked to the specified organization are returned. If filter_id is provided, this is ignored.
1918
- * @param {number} [pipeline_id] If supplied, only deals in the specified pipeline are returned. If filter_id is provided, this is ignored.
1919
- * @param {number} [stage_id] If supplied, only deals in the specified stage are returned. If filter_id is provided, this is ignored.
1920
- * @param {'open' | 'won' | 'lost' | 'deleted'} [status] Only fetch deals with a specific status. If omitted, all not deleted deals are returned. If set to deleted, deals that have been deleted up to 30 days ago will be included. Multiple statuses can be included as a comma separated array. If filter_id is provided, this is ignored.
1921
- * @param {string} [updated_since] If set, only deals with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
1922
- * @param {string} [updated_until] If set, only deals with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
1923
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
1924
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
1925
- * @param {'next_activity_id' | 'last_activity_id' | 'first_won_time' | 'products_count' | 'files_count' | 'notes_count' | 'followers_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'participants_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time'} [include_fields] Optional comma separated string array of additional fields to include
1926
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
1927
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1928
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1929
-
1930
- * @throws {RequiredError}
1931
- */
1932
- getDeals(filter_id, ids, owner_id, person_id, org_id, pipeline_id, stage_id, status, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) {
1933
- return __awaiter(this, void 0, void 0, function* () {
1934
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getDeals(filter_id, ids, owner_id, person_id, org_id, pipeline_id, stage_id, status, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor);
1935
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1936
- });
1937
- },
1938
- /**
1939
- * Returns data about products attached to deals
1940
- * @summary Get deal products of several deals
1941
- * @param {Array<number>} deal_ids An array of integers with the IDs of the deals for which the attached products will be returned. A maximum of 100 deal IDs can be provided.
1942
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1943
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1944
- * @param {'id' | 'deal_id' | 'add_time' | 'update_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;deal_id&#x60;, &#x60;add_time&#x60;, &#x60;update_time&#x60;.
1945
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
1946
-
1947
- * @throws {RequiredError}
1948
- */
1949
- getDealsProducts(deal_ids, cursor, limit, sort_by, sort_direction) {
1950
- return __awaiter(this, void 0, void 0, function* () {
1951
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getDealsProducts(deal_ids, cursor, limit, sort_by, sort_direction);
1952
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1953
- });
1954
- },
1955
- /**
1956
- * Returns the details of a specific organization.
1957
- * @summary Get details of a organization
1958
- * @param {number} id The ID of the organization
1959
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include
1960
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
1961
-
1962
- * @throws {RequiredError}
1963
- */
1964
- getOrganization(id, include_fields, custom_fields) {
1965
- return __awaiter(this, void 0, void 0, function* () {
1966
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrganization(id, include_fields, custom_fields);
1967
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1968
- });
1969
- },
1970
- /**
1971
- * Returns data about all organizations.
1972
- * @summary Get all organizations
1973
- * @param {number} [filter_id] If supplied, only organizations matching the specified filter are returned
1974
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
1975
- * @param {number} [owner_id] If supplied, only organization owned by the specified user are returned. If filter_id is provided, this is ignored.
1976
- * @param {string} [updated_since] If set, only organizations with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
1977
- * @param {string} [updated_until] If set, only organizations with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
1978
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
1979
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
1980
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'email_messages_count' | 'people_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count'} [include_fields] Optional comma separated string array of additional fields to include
1981
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
1982
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
1983
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
1984
-
1985
- * @throws {RequiredError}
1986
- */
1987
- getOrganizations(filter_id, ids, owner_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) {
1988
- return __awaiter(this, void 0, void 0, function* () {
1989
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getOrganizations(filter_id, ids, owner_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor);
1990
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
1991
- });
1992
- },
1993
- /**
1994
- * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
1995
- * @summary Get details of a person
1996
- * @param {number} id The ID of the person
1997
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. &#x60;marketing_status&#x60; and &#x60;doi_status&#x60; can only be included if the company has marketing app enabled.
1998
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
1999
-
2000
- * @throws {RequiredError}
2001
- */
2002
- getPerson(id, include_fields, custom_fields) {
2003
- return __awaiter(this, void 0, void 0, function* () {
2004
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getPerson(id, include_fields, custom_fields);
2005
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2006
- });
2007
- },
2008
- /**
2009
- * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
2010
- * @summary Get all persons
2011
- * @param {number} [filter_id] If supplied, only persons matching the specified filter are returned
2012
- * @param {string} [ids] Optional comma separated string array of up to 100 entity ids to fetch. If filter_id is provided, this is ignored. If any of the requested entities do not exist or are not visible, they are not included in the response.
2013
- * @param {number} [owner_id] If supplied, only persons owned by the specified user are returned. If filter_id is provided, this is ignored.
2014
- * @param {number} [org_id] If supplied, only persons linked to the specified organization are returned. If filter_id is provided, this is ignored.
2015
- * @param {string} [updated_since] If set, only persons with an &#x60;update_time&#x60; later than or equal to this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
2016
- * @param {string} [updated_until] If set, only persons with an &#x60;update_time&#x60; earlier than this time are returned. In RFC3339 format, e.g. 2025-01-01T10:20:00Z.
2017
- * @param {'id' | 'update_time' | 'add_time'} [sort_by] The field to sort by. Supported fields: &#x60;id&#x60;, &#x60;update_time&#x60;, &#x60;add_time&#x60;.
2018
- * @param {'asc' | 'desc'} [sort_direction] The sorting direction. Supported values: &#x60;asc&#x60;, &#x60;desc&#x60;.
2019
- * @param {'next_activity_id' | 'last_activity_id' | 'open_deals_count' | 'related_open_deals_count' | 'closed_deals_count' | 'related_closed_deals_count' | 'participant_open_deals_count' | 'participant_closed_deals_count' | 'email_messages_count' | 'activities_count' | 'done_activities_count' | 'undone_activities_count' | 'files_count' | 'notes_count' | 'followers_count' | 'won_deals_count' | 'related_won_deals_count' | 'lost_deals_count' | 'related_lost_deals_count' | 'last_incoming_mail_time' | 'last_outgoing_mail_time' | 'marketing_status' | 'doi_status'} [include_fields] Optional comma separated string array of additional fields to include. &#x60;marketing_status&#x60; and &#x60;doi_status&#x60; can only be included if the company has marketing app enabled.
2020
- * @param {string} [custom_fields] Optional comma separated string array of custom fields keys to include. If you are only interested in a particular set of custom fields, please use this parameter for faster results and smaller response.&lt;br/&gt;A maximum of 15 keys is allowed.
2021
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2022
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2023
-
2024
- * @throws {RequiredError}
2025
- */
2026
- getPersons(filter_id, ids, owner_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor) {
2027
- return __awaiter(this, void 0, void 0, function* () {
2028
- const localVarAxiosArgs = yield localVarAxiosParamCreator.getPersons(filter_id, ids, owner_id, org_id, updated_since, updated_until, sort_by, sort_direction, include_fields, custom_fields, limit, cursor);
2029
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2030
- });
2031
- },
2032
- /**
2033
- * Adds a discount to a deal changing, the deal value if the deal has one-time products attached.
2034
- * @summary Add a discount to a deal
2035
- * @param {number} id The ID of the deal
2036
- * @param {AddAdditionalDiscountRequestBody} [AddAdditionalDiscountRequestBody]
2037
-
2038
- * @throws {RequiredError}
2039
- */
2040
- postAdditionalDiscount(id, AddAdditionalDiscountRequestBody) {
2041
- return __awaiter(this, void 0, void 0, function* () {
2042
- const localVarAxiosArgs = yield localVarAxiosParamCreator.postAdditionalDiscount(id, AddAdditionalDiscountRequestBody);
2043
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2044
- });
2045
- },
2046
- /**
2047
- * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID.
2048
- * @summary Search deals
2049
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
2050
- * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
2051
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
2052
- * @param {number} [person_id] Will filter deals by the provided person ID. The upper limit of found deals associated with the person is 2000.
2053
- * @param {number} [organization_id] Will filter deals by the provided organization ID. The upper limit of found deals associated with the organization is 2000.
2054
- * @param {'open' | 'won' | 'lost'} [status] Will filter deals by the provided specific status. open &#x3D; Open, won &#x3D; Won, lost &#x3D; Lost. The upper limit of found deals associated with the status is 2000.
2055
- * @param {'deal.cc_email'} [include_fields] Supports including optional fields in the results which are not provided by default
2056
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2057
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2058
-
2059
- * @throws {RequiredError}
2060
- */
2061
- searchDeals(term, fields, exact_match, person_id, organization_id, status, include_fields, limit, cursor) {
2062
- return __awaiter(this, void 0, void 0, function* () {
2063
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchDeals(term, fields, exact_match, person_id, organization_id, status, include_fields, limit, cursor);
2064
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2065
- });
2066
- },
2067
- /**
2068
- * Performs a search from your choice of item types and fields.
2069
- * @summary Perform a search from multiple item types
2070
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
2071
- * @param {'deal' | 'person' | 'organization' | 'product' | 'lead' | 'file' | 'mail_attachment' | 'project'} [item_types] A comma-separated string array. The type of items to perform the search from. Defaults to all.
2072
- * @param {'address' | 'code' | 'custom_fields' | 'email' | 'name' | 'notes' | 'organization_name' | 'person_name' | 'phone' | 'title' | 'description'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all. Relevant for each item type are:&lt;br&gt; &lt;table&gt; &lt;tr&gt;&lt;th&gt;&lt;b&gt;Item type&lt;/b&gt;&lt;/th&gt;&lt;th&gt;&lt;b&gt;Field&lt;/b&gt;&lt;/th&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Deal&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;title&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Person&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;email&#x60;, &#x60;name&#x60;, &#x60;notes&#x60;, &#x60;phone&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Organization&lt;/td&gt;&lt;td&gt;&#x60;address&#x60;, &#x60;custom_fields&#x60;, &#x60;name&#x60;, &#x60;notes&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Product&lt;/td&gt;&lt;td&gt;&#x60;code&#x60;, &#x60;custom_fields&#x60;, &#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Lead&lt;/td&gt;&lt;td&gt;&#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;email&#x60;, &#x60;organization_name&#x60;, &#x60;person_name&#x60;, &#x60;phone&#x60;, &#x60;title&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;File&lt;/td&gt;&lt;td&gt;&#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Mail attachment&lt;/td&gt;&lt;td&gt;&#x60;name&#x60;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td&gt;Project&lt;/td&gt;&lt;td&gt; &#x60;custom_fields&#x60;, &#x60;notes&#x60;, &#x60;title&#x60;, &#x60;description&#x60; &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;br&gt; Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.&lt;br/&gt; When searching for leads, the email, organization_name, person_name, and phone fields will return results only for leads not linked to contacts. For searching leads by person or organization values, please use &#x60;search_for_related_items&#x60;.
2073
- * @param {boolean} [search_for_related_items] When enabled, the response will include up to 100 newest related leads and 100 newest related deals for each found person and organization and up to 100 newest related persons for each found organization
2074
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
2075
- * @param {'deal.cc_email' | 'person.picture' | 'product.price'} [include_fields] A comma-separated string array. Supports including optional fields in the results which are not provided by default.
2076
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2077
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2078
-
2079
- * @throws {RequiredError}
2080
- */
2081
- searchItem(term, item_types, fields, search_for_related_items, exact_match, include_fields, limit, cursor) {
2082
- return __awaiter(this, void 0, void 0, function* () {
2083
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchItem(term, item_types, fields, search_for_related_items, exact_match, include_fields, limit, cursor);
2084
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2085
- });
2086
- },
2087
- /**
2088
- * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products).
2089
- * @summary Perform a search using a specific field from an item type
2090
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if &#x60;match&#x60; is &#x60;exact&#x60;). Please note that the search term has to be URL encoded.
2091
- * @param {'deal' | 'lead' | 'person' | 'organization' | 'product' | 'project'} entity_type The type of the field to perform the search from
2092
- * @param {string} field The key of the field to search from. The field key can be obtained by fetching the list of the fields using any of the fields\&#39; API GET methods (dealFields, personFields, etc.). Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
2093
- * @param {'exact' | 'beginning' | 'middle'} [match] The type of match used against the term. The search &lt;b&gt;is&lt;/b&gt; case sensitive.&lt;br/&gt;&lt;br/&gt; E.g. in case of searching for a value &#x60;monkey&#x60;, &lt;ul&gt; &lt;li&gt;with &#x60;exact&#x60; match, you will only find it if term is &#x60;monkey&#x60;&lt;/li&gt; &lt;li&gt;with &#x60;beginning&#x60; match, you will only find it if the term matches the beginning or the whole string, e.g. &#x60;monk&#x60; and &#x60;monkey&#x60;&lt;/li&gt; &lt;li&gt;with &#x60;middle&#x60; match, you will find the it if the term matches any substring of the value, e.g. &#x60;onk&#x60; and &#x60;ke&#x60;&lt;/li&gt; &lt;/ul&gt;.
2094
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2095
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2096
-
2097
- * @throws {RequiredError}
2098
- */
2099
- searchItemByField(term, entity_type, field, match, limit, cursor) {
2100
- return __awaiter(this, void 0, void 0, function* () {
2101
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchItemByField(term, entity_type, field, match, limit, cursor);
2102
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2103
- });
2104
- },
2105
- /**
2106
- * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
2107
- * @summary Search leads
2108
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
2109
- * @param {'custom_fields' | 'notes' | 'title'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them.
2110
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
2111
- * @param {number} [person_id] Will filter leads by the provided person ID. The upper limit of found leads associated with the person is 2000.
2112
- * @param {number} [organization_id] Will filter leads by the provided organization ID. The upper limit of found leads associated with the organization is 2000.
2113
- * @param {'lead.was_seen'} [include_fields] Supports including optional fields in the results which are not provided by default
2114
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2115
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2116
-
2117
- * @throws {RequiredError}
2118
- */
2119
- searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, limit, cursor) {
2120
- return __awaiter(this, void 0, void 0, function* () {
2121
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchLeads(term, fields, exact_match, person_id, organization_id, include_fields, limit, cursor);
2122
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2123
- });
2124
- },
2125
- /**
2126
- * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope.
2127
- * @summary Search organizations
2128
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
2129
- * @param {'address' | 'custom_fields' | 'notes' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
2130
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
2131
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2132
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2133
-
2134
- * @throws {RequiredError}
2135
- */
2136
- searchOrganization(term, fields, exact_match, limit, cursor) {
2137
- return __awaiter(this, void 0, void 0, function* () {
2138
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchOrganization(term, fields, exact_match, limit, cursor);
2139
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2140
- });
2141
- },
2142
- /**
2143
- * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found persons can be filtered by organization ID.
2144
- * @summary Search persons
2145
- * @param {string} term The search term to look for. Minimum 2 characters (or 1 if using &#x60;exact_match&#x60;). Please note that the search term has to be URL encoded.
2146
- * @param {'custom_fields' | 'email' | 'notes' | 'phone' | 'name'} [fields] A comma-separated string array. The fields to perform the search from. Defaults to all of them. Only the following custom field types are searchable: &#x60;address&#x60;, &#x60;varchar&#x60;, &#x60;text&#x60;, &#x60;varchar_auto&#x60;, &#x60;double&#x60;, &#x60;monetary&#x60; and &#x60;phone&#x60;. Read more about searching by custom fields &lt;a href&#x3D;\&quot;https://support.pipedrive.com/en/article/search-finding-what-you-need#searching-by-custom-fields\&quot; target&#x3D;\&quot;_blank\&quot; rel&#x3D;\&quot;noopener noreferrer\&quot;&gt;here&lt;/a&gt;.
2147
- * @param {boolean} [exact_match] When enabled, only full exact matches against the given term are returned. It is &lt;b&gt;not&lt;/b&gt; case sensitive.
2148
- * @param {number} [organization_id] Will filter persons by the provided organization ID. The upper limit of found persons associated with the organization is 2000.
2149
- * @param {'person.picture'} [include_fields] Supports including optional fields in the results which are not provided by default
2150
- * @param {number} [limit] For pagination, the limit of entries to be returned. If not provided, 100 items will be returned. Please note that a maximum value of 500 is allowed.
2151
- * @param {string} [cursor] For pagination, the marker (an opaque string value) representing the first item on the next page
2152
-
2153
- * @throws {RequiredError}
2154
- */
2155
- searchPersons(term, fields, exact_match, organization_id, include_fields, limit, cursor) {
2156
- return __awaiter(this, void 0, void 0, function* () {
2157
- const localVarAxiosArgs = yield localVarAxiosParamCreator.searchPersons(term, fields, exact_match, organization_id, include_fields, limit, cursor);
2158
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2159
- });
2160
- },
2161
- /**
2162
- * Updates the properties of an activity.
2163
- * @summary Update an activity
2164
- * @param {number} id The ID of the activity
2165
- * @param {AddActivityRequest} [AddActivityRequest]
2166
-
2167
- * @throws {RequiredError}
2168
- */
2169
- updateActivity(id, AddActivityRequest) {
2170
- return __awaiter(this, void 0, void 0, function* () {
2171
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateActivity(id, AddActivityRequest);
2172
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2173
- });
2174
- },
2175
- /**
2176
- * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached.
2177
- * @summary Update a discount added to a deal
2178
- * @param {number} id The ID of the deal
2179
- * @param {number} discount_id The ID of the discount
2180
- * @param {UpdateAdditionalDiscountRequestBody} [UpdateAdditionalDiscountRequestBody]
2181
-
2182
- * @throws {RequiredError}
2183
- */
2184
- updateAdditionalDiscount(id, discount_id, UpdateAdditionalDiscountRequestBody) {
2185
- return __awaiter(this, void 0, void 0, function* () {
2186
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateAdditionalDiscount(id, discount_id, UpdateAdditionalDiscountRequestBody);
2187
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2188
- });
2189
- },
2190
- /**
2191
- * Updates the properties of a deal.
2192
- * @summary Update a deal
2193
- * @param {number} id The ID of the deal
2194
- * @param {UpdateDealRequest} [UpdateDealRequest]
2195
-
2196
- * @throws {RequiredError}
2197
- */
2198
- updateDeal(id, UpdateDealRequest) {
2199
- return __awaiter(this, void 0, void 0, function* () {
2200
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateDeal(id, UpdateDealRequest);
2201
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2202
- });
2203
- },
2204
- /**
2205
- * Updates the details of the product that has been attached to a deal.
2206
- * @summary Update the product attached to a deal
2207
- * @param {number} id The ID of the deal
2208
- * @param {number} product_attachment_id The ID of the deal-product (the ID of the product attached to the deal)
2209
- * @param {UpdateDealProductRequest} [UpdateDealProductRequest]
2210
-
2211
- * @throws {RequiredError}
2212
- */
2213
- updateDealProduct(id, product_attachment_id, UpdateDealProductRequest) {
2214
- return __awaiter(this, void 0, void 0, function* () {
2215
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateDealProduct(id, product_attachment_id, UpdateDealProductRequest);
2216
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2217
- });
2218
- },
2219
- /**
2220
- * Updates the properties of a organization.
2221
- * @summary Update a organization
2222
- * @param {number} id The ID of the organization
2223
- * @param {UpdateOrganizationRequest} [UpdateOrganizationRequest]
2224
-
2225
- * @throws {RequiredError}
2226
- */
2227
- updateOrganization(id, UpdateOrganizationRequest) {
2228
- return __awaiter(this, void 0, void 0, function* () {
2229
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updateOrganization(id, UpdateOrganizationRequest);
2230
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2231
- });
2232
- },
2233
- /**
2234
- * Updates the properties of a person.
2235
- * @summary Update a person
2236
- * @param {number} id The ID of the person
2237
- * @param {UpdatePersonRequest} [UpdatePersonRequest]
2238
-
2239
- * @throws {RequiredError}
2240
- */
2241
- updatePerson(id, UpdatePersonRequest) {
2242
- return __awaiter(this, void 0, void 0, function* () {
2243
- const localVarAxiosArgs = yield localVarAxiosParamCreator.updatePerson(id, UpdatePersonRequest);
2244
- return (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration);
2245
- });
2246
- },
2247
- };
2248
- };
2249
- exports.BetaApiFp = BetaApiFp;
2250
- /**
2251
- * BetaApi - factory interface
2252
- * @export
2253
- */
2254
- const BetaApiFactory = function (configuration, basePath, axios) {
2255
- const localVarFp = (0, exports.BetaApiFp)(configuration);
2256
- return {
2257
- /**
2258
- * Adds a new activity.
2259
- * @summary Add a new activity
2260
- * @param {BetaApiAddActivityRequest} requestParameters Request parameters.
2261
-
2262
- * @throws {RequiredError}
2263
- */
2264
- addActivity(requestParameters = {}) {
2265
- return localVarFp.addActivity(requestParameters.AddActivityRequest).then((request) => request(axios, basePath));
2266
- },
2267
- /**
2268
- * Adds a new deal.
2269
- * @summary Add a new deal
2270
- * @param {BetaApiAddDealRequest} requestParameters Request parameters.
2271
-
2272
- * @throws {RequiredError}
2273
- */
2274
- addDeal(requestParameters = {}) {
2275
- return localVarFp.addDeal(requestParameters.AddDealRequest).then((request) => request(axios, basePath));
2276
- },
2277
- /**
2278
- * Adds a product to a deal, creating a new item called a deal-product.
2279
- * @summary Add a product to a deal
2280
- * @param {BetaApiAddDealProductRequest} requestParameters Request parameters.
2281
-
2282
- * @throws {RequiredError}
2283
- */
2284
- addDealProduct(requestParameters) {
2285
- return localVarFp.addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest).then((request) => request(axios, basePath));
2286
- },
2287
- /**
2288
- * Adds a new organization.
2289
- * @summary Add a new organization
2290
- * @param {BetaApiAddOrganizationRequest} requestParameters Request parameters.
2291
-
2292
- * @throws {RequiredError}
2293
- */
2294
- addOrganization(requestParameters = {}) {
2295
- return localVarFp.addOrganization(requestParameters.AddOrganizationRequest).then((request) => request(axios, basePath));
2296
- },
2297
- /**
2298
- * Adds a new person.
2299
- * @summary Add a new person
2300
- * @param {BetaApiAddPersonRequest} requestParameters Request parameters.
2301
-
2302
- * @throws {RequiredError}
2303
- */
2304
- addPerson(requestParameters = {}) {
2305
- return localVarFp.addPerson(requestParameters.AddPersonRequest).then((request) => request(axios, basePath));
2306
- },
2307
- /**
2308
- * Marks an activity as deleted. After 30 days, the activity will be permanently deleted.
2309
- * @summary Delete an activity
2310
- * @param {BetaApiDeleteActivityRequest} requestParameters Request parameters.
2311
-
2312
- * @throws {RequiredError}
2313
- */
2314
- deleteActivity(requestParameters) {
2315
- return localVarFp.deleteActivity(requestParameters.id).then((request) => request(axios, basePath));
2316
- },
2317
- /**
2318
- * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
2319
- * @summary Delete a discount from a deal
2320
- * @param {BetaApiDeleteAdditionalDiscountRequest} requestParameters Request parameters.
2321
-
2322
- * @throws {RequiredError}
2323
- */
2324
- deleteAdditionalDiscount(requestParameters) {
2325
- return localVarFp.deleteAdditionalDiscount(requestParameters.id, requestParameters.discount_id).then((request) => request(axios, basePath));
2326
- },
2327
- /**
2328
- * Marks a deal as deleted. After 30 days, the deal will be permanently deleted.
2329
- * @summary Delete a deal
2330
- * @param {BetaApiDeleteDealRequest} requestParameters Request parameters.
2331
-
2332
- * @throws {RequiredError}
2333
- */
2334
- deleteDeal(requestParameters) {
2335
- return localVarFp.deleteDeal(requestParameters.id).then((request) => request(axios, basePath));
2336
- },
2337
- /**
2338
- * Deletes a product attachment from a deal, using the `product_attachment_id`.
2339
- * @summary Delete an attached product from a deal
2340
- * @param {BetaApiDeleteDealProductRequest} requestParameters Request parameters.
2341
-
2342
- * @throws {RequiredError}
2343
- */
2344
- deleteDealProduct(requestParameters) {
2345
- return localVarFp.deleteDealProduct(requestParameters.id, requestParameters.product_attachment_id).then((request) => request(axios, basePath));
2346
- },
2347
- /**
2348
- * Marks a organization as deleted. After 30 days, the organization will be permanently deleted.
2349
- * @summary Delete a organization
2350
- * @param {BetaApiDeleteOrganizationRequest} requestParameters Request parameters.
2351
-
2352
- * @throws {RequiredError}
2353
- */
2354
- deleteOrganization(requestParameters) {
2355
- return localVarFp.deleteOrganization(requestParameters.id).then((request) => request(axios, basePath));
2356
- },
2357
- /**
2358
- * Marks a person as deleted. After 30 days, the person will be permanently deleted.
2359
- * @summary Delete a person
2360
- * @param {BetaApiDeletePersonRequest} requestParameters Request parameters.
2361
-
2362
- * @throws {RequiredError}
2363
- */
2364
- deletePerson(requestParameters) {
2365
- return localVarFp.deletePerson(requestParameters.id).then((request) => request(axios, basePath));
2366
- },
2367
- /**
2368
- * Returns data about all activities.
2369
- * @summary Get all activities
2370
- * @param {BetaApiGetActivitiesRequest} requestParameters Request parameters.
2371
-
2372
- * @throws {RequiredError}
2373
- */
2374
- getActivities(requestParameters = {}) {
2375
- return localVarFp.getActivities(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2376
- },
2377
- /**
2378
- * Returns the details of a specific activity.
2379
- * @summary Get details of an activity
2380
- * @param {BetaApiGetActivityRequest} requestParameters Request parameters.
2381
-
2382
- * @throws {RequiredError}
2383
- */
2384
- getActivity(requestParameters) {
2385
- return localVarFp.getActivity(requestParameters.id, requestParameters.include_fields).then((request) => request(axios, basePath));
2386
- },
2387
- /**
2388
- * Lists discounts attached to a deal.
2389
- * @summary List discounts added to a deal
2390
- * @param {BetaApiGetAdditionalDiscountsRequest} requestParameters Request parameters.
2391
-
2392
- * @throws {RequiredError}
2393
- */
2394
- getAdditionalDiscounts(requestParameters) {
2395
- return localVarFp.getAdditionalDiscounts(requestParameters.id).then((request) => request(axios, basePath));
2396
- },
2397
- /**
2398
- * Returns the details of a specific deal.
2399
- * @summary Get details of a deal
2400
- * @param {BetaApiGetDealRequest} requestParameters Request parameters.
2401
-
2402
- * @throws {RequiredError}
2403
- */
2404
- getDeal(requestParameters) {
2405
- return localVarFp.getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(axios, basePath));
2406
- },
2407
- /**
2408
- * Lists products attached to a deal.
2409
- * @summary List products attached to a deal
2410
- * @param {BetaApiGetDealProductsRequest} requestParameters Request parameters.
2411
-
2412
- * @throws {RequiredError}
2413
- */
2414
- getDealProducts(requestParameters) {
2415
- return localVarFp.getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(axios, basePath));
2416
- },
2417
- /**
2418
- * Returns data about all deals.
2419
- * @summary Get all deals
2420
- * @param {BetaApiGetDealsRequest} requestParameters Request parameters.
2421
-
2422
- * @throws {RequiredError}
2423
- */
2424
- getDeals(requestParameters = {}) {
2425
- return localVarFp.getDeals(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.person_id, requestParameters.org_id, requestParameters.pipeline_id, requestParameters.stage_id, requestParameters.status, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2426
- },
2427
- /**
2428
- * Returns data about products attached to deals
2429
- * @summary Get deal products of several deals
2430
- * @param {BetaApiGetDealsProductsRequest} requestParameters Request parameters.
2431
-
2432
- * @throws {RequiredError}
2433
- */
2434
- getDealsProducts(requestParameters) {
2435
- return localVarFp.getDealsProducts(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(axios, basePath));
2436
- },
2437
- /**
2438
- * Returns the details of a specific organization.
2439
- * @summary Get details of a organization
2440
- * @param {BetaApiGetOrganizationRequest} requestParameters Request parameters.
2441
-
2442
- * @throws {RequiredError}
2443
- */
2444
- getOrganization(requestParameters) {
2445
- return localVarFp.getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(axios, basePath));
2446
- },
2447
- /**
2448
- * Returns data about all organizations.
2449
- * @summary Get all organizations
2450
- * @param {BetaApiGetOrganizationsRequest} requestParameters Request parameters.
2451
-
2452
- * @throws {RequiredError}
2453
- */
2454
- getOrganizations(requestParameters = {}) {
2455
- return localVarFp.getOrganizations(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2456
- },
2457
- /**
2458
- * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
2459
- * @summary Get details of a person
2460
- * @param {BetaApiGetPersonRequest} requestParameters Request parameters.
2461
-
2462
- * @throws {RequiredError}
2463
- */
2464
- getPerson(requestParameters) {
2465
- return localVarFp.getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(axios, basePath));
2466
- },
2467
- /**
2468
- * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
2469
- * @summary Get all persons
2470
- * @param {BetaApiGetPersonsRequest} requestParameters Request parameters.
2471
-
2472
- * @throws {RequiredError}
2473
- */
2474
- getPersons(requestParameters = {}) {
2475
- return localVarFp.getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2476
- },
2477
- /**
2478
- * Adds a discount to a deal changing, the deal value if the deal has one-time products attached.
2479
- * @summary Add a discount to a deal
2480
- * @param {BetaApiPostAdditionalDiscountRequest} requestParameters Request parameters.
2481
-
2482
- * @throws {RequiredError}
2483
- */
2484
- postAdditionalDiscount(requestParameters) {
2485
- return localVarFp.postAdditionalDiscount(requestParameters.id, requestParameters.AddAdditionalDiscountRequestBody).then((request) => request(axios, basePath));
2486
- },
2487
- /**
2488
- * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID.
2489
- * @summary Search deals
2490
- * @param {BetaApiSearchDealsRequest} requestParameters Request parameters.
2491
-
2492
- * @throws {RequiredError}
2493
- */
2494
- searchDeals(requestParameters) {
2495
- return localVarFp.searchDeals(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.status, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2496
- },
2497
- /**
2498
- * Performs a search from your choice of item types and fields.
2499
- * @summary Perform a search from multiple item types
2500
- * @param {BetaApiSearchItemRequest} requestParameters Request parameters.
2501
-
2502
- * @throws {RequiredError}
2503
- */
2504
- searchItem(requestParameters) {
2505
- return localVarFp.searchItem(requestParameters.term, requestParameters.item_types, requestParameters.fields, requestParameters.search_for_related_items, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2506
- },
2507
- /**
2508
- * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products).
2509
- * @summary Perform a search using a specific field from an item type
2510
- * @param {BetaApiSearchItemByFieldRequest} requestParameters Request parameters.
2511
-
2512
- * @throws {RequiredError}
2513
- */
2514
- searchItemByField(requestParameters) {
2515
- return localVarFp.searchItemByField(requestParameters.term, requestParameters.entity_type, requestParameters.field, requestParameters.match, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2516
- },
2517
- /**
2518
- * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
2519
- * @summary Search leads
2520
- * @param {BetaApiSearchLeadsRequest} requestParameters Request parameters.
2521
-
2522
- * @throws {RequiredError}
2523
- */
2524
- searchLeads(requestParameters) {
2525
- return localVarFp.searchLeads(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2526
- },
2527
- /**
2528
- * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope.
2529
- * @summary Search organizations
2530
- * @param {BetaApiSearchOrganizationRequest} requestParameters Request parameters.
2531
-
2532
- * @throws {RequiredError}
2533
- */
2534
- searchOrganization(requestParameters) {
2535
- return localVarFp.searchOrganization(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2536
- },
2537
- /**
2538
- * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found persons can be filtered by organization ID.
2539
- * @summary Search persons
2540
- * @param {BetaApiSearchPersonsRequest} requestParameters Request parameters.
2541
-
2542
- * @throws {RequiredError}
2543
- */
2544
- searchPersons(requestParameters) {
2545
- return localVarFp.searchPersons(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(axios, basePath));
2546
- },
2547
- /**
2548
- * Updates the properties of an activity.
2549
- * @summary Update an activity
2550
- * @param {BetaApiUpdateActivityRequest} requestParameters Request parameters.
2551
-
2552
- * @throws {RequiredError}
2553
- */
2554
- updateActivity(requestParameters) {
2555
- return localVarFp.updateActivity(requestParameters.id, requestParameters.AddActivityRequest).then((request) => request(axios, basePath));
2556
- },
2557
- /**
2558
- * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached.
2559
- * @summary Update a discount added to a deal
2560
- * @param {BetaApiUpdateAdditionalDiscountRequest} requestParameters Request parameters.
2561
-
2562
- * @throws {RequiredError}
2563
- */
2564
- updateAdditionalDiscount(requestParameters) {
2565
- return localVarFp.updateAdditionalDiscount(requestParameters.id, requestParameters.discount_id, requestParameters.UpdateAdditionalDiscountRequestBody).then((request) => request(axios, basePath));
2566
- },
2567
- /**
2568
- * Updates the properties of a deal.
2569
- * @summary Update a deal
2570
- * @param {BetaApiUpdateDealRequest} requestParameters Request parameters.
2571
-
2572
- * @throws {RequiredError}
2573
- */
2574
- updateDeal(requestParameters) {
2575
- return localVarFp.updateDeal(requestParameters.id, requestParameters.UpdateDealRequest).then((request) => request(axios, basePath));
2576
- },
2577
- /**
2578
- * Updates the details of the product that has been attached to a deal.
2579
- * @summary Update the product attached to a deal
2580
- * @param {BetaApiUpdateDealProductRequest} requestParameters Request parameters.
2581
-
2582
- * @throws {RequiredError}
2583
- */
2584
- updateDealProduct(requestParameters) {
2585
- return localVarFp.updateDealProduct(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest).then((request) => request(axios, basePath));
2586
- },
2587
- /**
2588
- * Updates the properties of a organization.
2589
- * @summary Update a organization
2590
- * @param {BetaApiUpdateOrganizationRequest} requestParameters Request parameters.
2591
-
2592
- * @throws {RequiredError}
2593
- */
2594
- updateOrganization(requestParameters) {
2595
- return localVarFp.updateOrganization(requestParameters.id, requestParameters.UpdateOrganizationRequest).then((request) => request(axios, basePath));
2596
- },
2597
- /**
2598
- * Updates the properties of a person.
2599
- * @summary Update a person
2600
- * @param {BetaApiUpdatePersonRequest} requestParameters Request parameters.
2601
-
2602
- * @throws {RequiredError}
2603
- */
2604
- updatePerson(requestParameters) {
2605
- return localVarFp.updatePerson(requestParameters.id, requestParameters.UpdatePersonRequest).then((request) => request(axios, basePath));
326
+ updateInstallment(requestParameters) {
327
+ return localVarFp.updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody).then((request) => request(axios, basePath));
2606
328
  },
2607
329
  };
2608
330
  };
@@ -2615,389 +337,48 @@ exports.BetaApiFactory = BetaApiFactory;
2615
337
  */
2616
338
  class BetaApi extends base_1.BaseAPI {
2617
339
  /**
2618
- * Adds a new activity.
2619
- * @summary Add a new activity
2620
- * @param {BetaApiAddActivityRequest} requestParameters Request parameters.
2621
-
2622
- * @throws {RequiredError}
2623
- * @memberof BetaApi
2624
- */
2625
- addActivity(requestParameters = {}) {
2626
- return (0, exports.BetaApiFp)(this.configuration).addActivity(requestParameters.AddActivityRequest).then((request) => request(this.axios, this.basePath));
2627
- }
2628
- /**
2629
- * Adds a new deal.
2630
- * @summary Add a new deal
2631
- * @param {BetaApiAddDealRequest} requestParameters Request parameters.
2632
-
2633
- * @throws {RequiredError}
2634
- * @memberof BetaApi
2635
- */
2636
- addDeal(requestParameters = {}) {
2637
- return (0, exports.BetaApiFp)(this.configuration).addDeal(requestParameters.AddDealRequest).then((request) => request(this.axios, this.basePath));
2638
- }
2639
- /**
2640
- * Adds a product to a deal, creating a new item called a deal-product.
2641
- * @summary Add a product to a deal
2642
- * @param {BetaApiAddDealProductRequest} requestParameters Request parameters.
2643
-
2644
- * @throws {RequiredError}
2645
- * @memberof BetaApi
2646
- */
2647
- addDealProduct(requestParameters) {
2648
- return (0, exports.BetaApiFp)(this.configuration).addDealProduct(requestParameters.id, requestParameters.AddDealProductRequest).then((request) => request(this.axios, this.basePath));
2649
- }
2650
- /**
2651
- * Adds a new organization.
2652
- * @summary Add a new organization
2653
- * @param {BetaApiAddOrganizationRequest} requestParameters Request parameters.
2654
-
2655
- * @throws {RequiredError}
2656
- * @memberof BetaApi
2657
- */
2658
- addOrganization(requestParameters = {}) {
2659
- return (0, exports.BetaApiFp)(this.configuration).addOrganization(requestParameters.AddOrganizationRequest).then((request) => request(this.axios, this.basePath));
2660
- }
2661
- /**
2662
- * Adds a new person.
2663
- * @summary Add a new person
2664
- * @param {BetaApiAddPersonRequest} requestParameters Request parameters.
2665
-
2666
- * @throws {RequiredError}
2667
- * @memberof BetaApi
2668
- */
2669
- addPerson(requestParameters = {}) {
2670
- return (0, exports.BetaApiFp)(this.configuration).addPerson(requestParameters.AddPersonRequest).then((request) => request(this.axios, this.basePath));
2671
- }
2672
- /**
2673
- * Marks an activity as deleted. After 30 days, the activity will be permanently deleted.
2674
- * @summary Delete an activity
2675
- * @param {BetaApiDeleteActivityRequest} requestParameters Request parameters.
2676
-
2677
- * @throws {RequiredError}
2678
- * @memberof BetaApi
2679
- */
2680
- deleteActivity(requestParameters) {
2681
- return (0, exports.BetaApiFp)(this.configuration).deleteActivity(requestParameters.id).then((request) => request(this.axios, this.basePath));
2682
- }
2683
- /**
2684
- * Removes a discount from a deal, changing the deal value if the deal has one-time products attached.
2685
- * @summary Delete a discount from a deal
2686
- * @param {BetaApiDeleteAdditionalDiscountRequest} requestParameters Request parameters.
2687
-
2688
- * @throws {RequiredError}
2689
- * @memberof BetaApi
2690
- */
2691
- deleteAdditionalDiscount(requestParameters) {
2692
- return (0, exports.BetaApiFp)(this.configuration).deleteAdditionalDiscount(requestParameters.id, requestParameters.discount_id).then((request) => request(this.axios, this.basePath));
2693
- }
2694
- /**
2695
- * Marks a deal as deleted. After 30 days, the deal will be permanently deleted.
2696
- * @summary Delete a deal
2697
- * @param {BetaApiDeleteDealRequest} requestParameters Request parameters.
2698
-
2699
- * @throws {RequiredError}
2700
- * @memberof BetaApi
2701
- */
2702
- deleteDeal(requestParameters) {
2703
- return (0, exports.BetaApiFp)(this.configuration).deleteDeal(requestParameters.id).then((request) => request(this.axios, this.basePath));
2704
- }
2705
- /**
2706
- * Deletes a product attachment from a deal, using the `product_attachment_id`.
2707
- * @summary Delete an attached product from a deal
2708
- * @param {BetaApiDeleteDealProductRequest} requestParameters Request parameters.
2709
-
2710
- * @throws {RequiredError}
2711
- * @memberof BetaApi
2712
- */
2713
- deleteDealProduct(requestParameters) {
2714
- return (0, exports.BetaApiFp)(this.configuration).deleteDealProduct(requestParameters.id, requestParameters.product_attachment_id).then((request) => request(this.axios, this.basePath));
2715
- }
2716
- /**
2717
- * Marks a organization as deleted. After 30 days, the organization will be permanently deleted.
2718
- * @summary Delete a organization
2719
- * @param {BetaApiDeleteOrganizationRequest} requestParameters Request parameters.
2720
-
2721
- * @throws {RequiredError}
2722
- * @memberof BetaApi
2723
- */
2724
- deleteOrganization(requestParameters) {
2725
- return (0, exports.BetaApiFp)(this.configuration).deleteOrganization(requestParameters.id).then((request) => request(this.axios, this.basePath));
2726
- }
2727
- /**
2728
- * Marks a person as deleted. After 30 days, the person will be permanently deleted.
2729
- * @summary Delete a person
2730
- * @param {BetaApiDeletePersonRequest} requestParameters Request parameters.
2731
-
2732
- * @throws {RequiredError}
2733
- * @memberof BetaApi
2734
- */
2735
- deletePerson(requestParameters) {
2736
- return (0, exports.BetaApiFp)(this.configuration).deletePerson(requestParameters.id).then((request) => request(this.axios, this.basePath));
2737
- }
2738
- /**
2739
- * Returns data about all activities.
2740
- * @summary Get all activities
2741
- * @param {BetaApiGetActivitiesRequest} requestParameters Request parameters.
2742
-
2743
- * @throws {RequiredError}
2744
- * @memberof BetaApi
2745
- */
2746
- getActivities(requestParameters = {}) {
2747
- return (0, exports.BetaApiFp)(this.configuration).getActivities(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
2748
- }
2749
- /**
2750
- * Returns the details of a specific activity.
2751
- * @summary Get details of an activity
2752
- * @param {BetaApiGetActivityRequest} requestParameters Request parameters.
2753
-
2754
- * @throws {RequiredError}
2755
- * @memberof BetaApi
2756
- */
2757
- getActivity(requestParameters) {
2758
- return (0, exports.BetaApiFp)(this.configuration).getActivity(requestParameters.id, requestParameters.include_fields).then((request) => request(this.axios, this.basePath));
2759
- }
2760
- /**
2761
- * Lists discounts attached to a deal.
2762
- * @summary List discounts added to a deal
2763
- * @param {BetaApiGetAdditionalDiscountsRequest} requestParameters Request parameters.
2764
-
2765
- * @throws {RequiredError}
2766
- * @memberof BetaApi
2767
- */
2768
- getAdditionalDiscounts(requestParameters) {
2769
- return (0, exports.BetaApiFp)(this.configuration).getAdditionalDiscounts(requestParameters.id).then((request) => request(this.axios, this.basePath));
2770
- }
2771
- /**
2772
- * Returns the details of a specific deal.
2773
- * @summary Get details of a deal
2774
- * @param {BetaApiGetDealRequest} requestParameters Request parameters.
2775
-
2776
- * @throws {RequiredError}
2777
- * @memberof BetaApi
2778
- */
2779
- getDeal(requestParameters) {
2780
- return (0, exports.BetaApiFp)(this.configuration).getDeal(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(this.axios, this.basePath));
2781
- }
2782
- /**
2783
- * Lists products attached to a deal.
2784
- * @summary List products attached to a deal
2785
- * @param {BetaApiGetDealProductsRequest} requestParameters Request parameters.
2786
-
2787
- * @throws {RequiredError}
2788
- * @memberof BetaApi
2789
- */
2790
- getDealProducts(requestParameters) {
2791
- return (0, exports.BetaApiFp)(this.configuration).getDealProducts(requestParameters.id, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(this.axios, this.basePath));
2792
- }
2793
- /**
2794
- * Returns data about all deals.
2795
- * @summary Get all deals
2796
- * @param {BetaApiGetDealsRequest} requestParameters Request parameters.
2797
-
2798
- * @throws {RequiredError}
2799
- * @memberof BetaApi
2800
- */
2801
- getDeals(requestParameters = {}) {
2802
- return (0, exports.BetaApiFp)(this.configuration).getDeals(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.person_id, requestParameters.org_id, requestParameters.pipeline_id, requestParameters.stage_id, requestParameters.status, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
2803
- }
2804
- /**
2805
- * Returns data about products attached to deals
2806
- * @summary Get deal products of several deals
2807
- * @param {BetaApiGetDealsProductsRequest} requestParameters Request parameters.
2808
-
2809
- * @throws {RequiredError}
2810
- * @memberof BetaApi
2811
- */
2812
- getDealsProducts(requestParameters) {
2813
- return (0, exports.BetaApiFp)(this.configuration).getDealsProducts(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(this.axios, this.basePath));
2814
- }
2815
- /**
2816
- * Returns the details of a specific organization.
2817
- * @summary Get details of a organization
2818
- * @param {BetaApiGetOrganizationRequest} requestParameters Request parameters.
2819
-
2820
- * @throws {RequiredError}
2821
- * @memberof BetaApi
2822
- */
2823
- getOrganization(requestParameters) {
2824
- return (0, exports.BetaApiFp)(this.configuration).getOrganization(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(this.axios, this.basePath));
2825
- }
2826
- /**
2827
- * Returns data about all organizations.
2828
- * @summary Get all organizations
2829
- * @param {BetaApiGetOrganizationsRequest} requestParameters Request parameters.
2830
-
2831
- * @throws {RequiredError}
2832
- * @memberof BetaApi
2833
- */
2834
- getOrganizations(requestParameters = {}) {
2835
- return (0, exports.BetaApiFp)(this.configuration).getOrganizations(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
2836
- }
2837
- /**
2838
- * Returns the details of a specific person. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
2839
- * @summary Get details of a person
2840
- * @param {BetaApiGetPersonRequest} requestParameters Request parameters.
2841
-
2842
- * @throws {RequiredError}
2843
- * @memberof BetaApi
2844
- */
2845
- getPerson(requestParameters) {
2846
- return (0, exports.BetaApiFp)(this.configuration).getPerson(requestParameters.id, requestParameters.include_fields, requestParameters.custom_fields).then((request) => request(this.axios, this.basePath));
2847
- }
2848
- /**
2849
- * Returns data about all persons. Fields `ims`, `postal_address`, `notes`, `birthday`, and `job_title` are only included if contact sync is enabled for the company.
2850
- * @summary Get all persons
2851
- * @param {BetaApiGetPersonsRequest} requestParameters Request parameters.
2852
-
2853
- * @throws {RequiredError}
2854
- * @memberof BetaApi
2855
- */
2856
- getPersons(requestParameters = {}) {
2857
- return (0, exports.BetaApiFp)(this.configuration).getPersons(requestParameters.filter_id, requestParameters.ids, requestParameters.owner_id, requestParameters.org_id, requestParameters.updated_since, requestParameters.updated_until, requestParameters.sort_by, requestParameters.sort_direction, requestParameters.include_fields, requestParameters.custom_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
2858
- }
2859
- /**
2860
- * Adds a discount to a deal changing, the deal value if the deal has one-time products attached.
2861
- * @summary Add a discount to a deal
2862
- * @param {BetaApiPostAdditionalDiscountRequest} requestParameters Request parameters.
2863
-
2864
- * @throws {RequiredError}
2865
- * @memberof BetaApi
2866
- */
2867
- postAdditionalDiscount(requestParameters) {
2868
- return (0, exports.BetaApiFp)(this.configuration).postAdditionalDiscount(requestParameters.id, requestParameters.AddAdditionalDiscountRequestBody).then((request) => request(this.axios, this.basePath));
2869
- }
2870
- /**
2871
- * Searches all deals by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found deals can be filtered by the person ID and the organization ID.
2872
- * @summary Search deals
2873
- * @param {BetaApiSearchDealsRequest} requestParameters Request parameters.
2874
-
2875
- * @throws {RequiredError}
2876
- * @memberof BetaApi
2877
- */
2878
- searchDeals(requestParameters) {
2879
- return (0, exports.BetaApiFp)(this.configuration).searchDeals(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.status, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
2880
- }
2881
- /**
2882
- * Performs a search from your choice of item types and fields.
2883
- * @summary Perform a search from multiple item types
2884
- * @param {BetaApiSearchItemRequest} requestParameters Request parameters.
2885
-
2886
- * @throws {RequiredError}
2887
- * @memberof BetaApi
2888
- */
2889
- searchItem(requestParameters) {
2890
- return (0, exports.BetaApiFp)(this.configuration).searchItem(requestParameters.term, requestParameters.item_types, requestParameters.fields, requestParameters.search_for_related_items, requestParameters.exact_match, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
2891
- }
2892
- /**
2893
- * Performs a search from the values of a specific field. Results can either be the distinct values of the field (useful for searching autocomplete field values), or the IDs of actual items (deals, leads, persons, organizations or products).
2894
- * @summary Perform a search using a specific field from an item type
2895
- * @param {BetaApiSearchItemByFieldRequest} requestParameters Request parameters.
2896
-
2897
- * @throws {RequiredError}
2898
- * @memberof BetaApi
2899
- */
2900
- searchItemByField(requestParameters) {
2901
- return (0, exports.BetaApiFp)(this.configuration).searchItemByField(requestParameters.term, requestParameters.entity_type, requestParameters.field, requestParameters.match, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
2902
- }
2903
- /**
2904
- * Searches all leads by title, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found leads can be filtered by the person ID and the organization ID.
2905
- * @summary Search leads
2906
- * @param {BetaApiSearchLeadsRequest} requestParameters Request parameters.
2907
-
2908
- * @throws {RequiredError}
2909
- * @memberof BetaApi
2910
- */
2911
- searchLeads(requestParameters) {
2912
- return (0, exports.BetaApiFp)(this.configuration).searchLeads(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.person_id, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
2913
- }
2914
- /**
2915
- * Searches all organizations by name, address, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope.
2916
- * @summary Search organizations
2917
- * @param {BetaApiSearchOrganizationRequest} requestParameters Request parameters.
2918
-
2919
- * @throws {RequiredError}
2920
- * @memberof BetaApi
2921
- */
2922
- searchOrganization(requestParameters) {
2923
- return (0, exports.BetaApiFp)(this.configuration).searchOrganization(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
2924
- }
2925
- /**
2926
- * Searches all persons by name, email, phone, notes and/or custom fields. This endpoint is a wrapper of <a href=\"https://developers.pipedrive.com/docs/api/v1/ItemSearch#searchItem\">/v1/itemSearch</a> with a narrower OAuth scope. Found persons can be filtered by organization ID.
2927
- * @summary Search persons
2928
- * @param {BetaApiSearchPersonsRequest} requestParameters Request parameters.
2929
-
2930
- * @throws {RequiredError}
2931
- * @memberof BetaApi
2932
- */
2933
- searchPersons(requestParameters) {
2934
- return (0, exports.BetaApiFp)(this.configuration).searchPersons(requestParameters.term, requestParameters.fields, requestParameters.exact_match, requestParameters.organization_id, requestParameters.include_fields, requestParameters.limit, requestParameters.cursor).then((request) => request(this.axios, this.basePath));
2935
- }
2936
- /**
2937
- * Updates the properties of an activity.
2938
- * @summary Update an activity
2939
- * @param {BetaApiUpdateActivityRequest} requestParameters Request parameters.
2940
-
2941
- * @throws {RequiredError}
2942
- * @memberof BetaApi
2943
- */
2944
- updateActivity(requestParameters) {
2945
- return (0, exports.BetaApiFp)(this.configuration).updateActivity(requestParameters.id, requestParameters.AddActivityRequest).then((request) => request(this.axios, this.basePath));
2946
- }
2947
- /**
2948
- * Edits a discount added to a deal, changing the deal value if the deal has one-time products attached.
2949
- * @summary Update a discount added to a deal
2950
- * @param {BetaApiUpdateAdditionalDiscountRequest} requestParameters Request parameters.
2951
-
2952
- * @throws {RequiredError}
2953
- * @memberof BetaApi
2954
- */
2955
- updateAdditionalDiscount(requestParameters) {
2956
- return (0, exports.BetaApiFp)(this.configuration).updateAdditionalDiscount(requestParameters.id, requestParameters.discount_id, requestParameters.UpdateAdditionalDiscountRequestBody).then((request) => request(this.axios, this.basePath));
2957
- }
2958
- /**
2959
- * Updates the properties of a deal.
2960
- * @summary Update a deal
2961
- * @param {BetaApiUpdateDealRequest} requestParameters Request parameters.
340
+ * Removes an installment from a deal. Only available in Advanced and above plans.
341
+ * @summary Delete an installment from a deal
342
+ * @param {BetaApiDeleteInstallmentRequest} requestParameters Request parameters.
2962
343
 
2963
344
  * @throws {RequiredError}
2964
345
  * @memberof BetaApi
2965
346
  */
2966
- updateDeal(requestParameters) {
2967
- return (0, exports.BetaApiFp)(this.configuration).updateDeal(requestParameters.id, requestParameters.UpdateDealRequest).then((request) => request(this.axios, this.basePath));
347
+ deleteInstallment(requestParameters) {
348
+ return (0, exports.BetaApiFp)(this.configuration).deleteInstallment(requestParameters.id, requestParameters.installment_id).then((request) => request(this.axios, this.basePath));
2968
349
  }
2969
350
  /**
2970
- * Updates the details of the product that has been attached to a deal.
2971
- * @summary Update the product attached to a deal
2972
- * @param {BetaApiUpdateDealProductRequest} requestParameters Request parameters.
351
+ * Lists installments attached to a list of deals. Only available in Advanced and above plans.
352
+ * @summary List installments added to a list of deals
353
+ * @param {BetaApiGetInstallmentsRequest} requestParameters Request parameters.
2973
354
 
2974
355
  * @throws {RequiredError}
2975
356
  * @memberof BetaApi
2976
357
  */
2977
- updateDealProduct(requestParameters) {
2978
- return (0, exports.BetaApiFp)(this.configuration).updateDealProduct(requestParameters.id, requestParameters.product_attachment_id, requestParameters.UpdateDealProductRequest).then((request) => request(this.axios, this.basePath));
358
+ getInstallments(requestParameters) {
359
+ return (0, exports.BetaApiFp)(this.configuration).getInstallments(requestParameters.deal_ids, requestParameters.cursor, requestParameters.limit, requestParameters.sort_by, requestParameters.sort_direction).then((request) => request(this.axios, this.basePath));
2979
360
  }
2980
361
  /**
2981
- * Updates the properties of a organization.
2982
- * @summary Update a organization
2983
- * @param {BetaApiUpdateOrganizationRequest} requestParameters Request parameters.
362
+ * Adds an installment to a deal. An installment can only be added if the deal includes at least one one-time product. If the deal contains at least one recurring product, adding installments is not allowed. Only available in Advanced and above plans.
363
+ * @summary Add an installment to a deal
364
+ * @param {BetaApiPostInstallmentRequest} requestParameters Request parameters.
2984
365
 
2985
366
  * @throws {RequiredError}
2986
367
  * @memberof BetaApi
2987
368
  */
2988
- updateOrganization(requestParameters) {
2989
- return (0, exports.BetaApiFp)(this.configuration).updateOrganization(requestParameters.id, requestParameters.UpdateOrganizationRequest).then((request) => request(this.axios, this.basePath));
369
+ postInstallment(requestParameters) {
370
+ return (0, exports.BetaApiFp)(this.configuration).postInstallment(requestParameters.id, requestParameters.AddInstallmentRequestBody).then((request) => request(this.axios, this.basePath));
2990
371
  }
2991
372
  /**
2992
- * Updates the properties of a person.
2993
- * @summary Update a person
2994
- * @param {BetaApiUpdatePersonRequest} requestParameters Request parameters.
373
+ * Edits an installment added to a deal. Only available in Advanced and above plans.
374
+ * @summary Update an installment added to a deal
375
+ * @param {BetaApiUpdateInstallmentRequest} requestParameters Request parameters.
2995
376
 
2996
377
  * @throws {RequiredError}
2997
378
  * @memberof BetaApi
2998
379
  */
2999
- updatePerson(requestParameters) {
3000
- return (0, exports.BetaApiFp)(this.configuration).updatePerson(requestParameters.id, requestParameters.UpdatePersonRequest).then((request) => request(this.axios, this.basePath));
380
+ updateInstallment(requestParameters) {
381
+ return (0, exports.BetaApiFp)(this.configuration).updateInstallment(requestParameters.id, requestParameters.installment_id, requestParameters.UpdateInstallmentRequestBody).then((request) => request(this.axios, this.basePath));
3001
382
  }
3002
383
  }
3003
384
  exports.BetaApi = BetaApi;