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