@segment/public-api-sdk-typescript 1.0.1 → 1.0.2-b1

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 (509) hide show
  1. package/README.md +1 -1
  2. package/api/aPICallsApi.ts +1176 -0
  3. package/api/apis.ts +178 -0
  4. package/api/auditTrailApi.ts +714 -0
  5. package/api/catalogApi.ts +2916 -0
  6. package/api/deletionAndSuppressionApi.ts +4298 -0
  7. package/api/destinationFiltersApi.ts +3262 -0
  8. package/api/destinationsApi.ts +3494 -0
  9. package/api/edgeFunctionsApi.ts +593 -0
  10. package/api/eventsApi.ts +922 -0
  11. package/api/functionsApi.ts +3036 -0
  12. package/api/iAMGroupsApi.ts +6204 -0
  13. package/api/iAMRolesApi.ts +566 -0
  14. package/api/iAMUsersApi.ts +4486 -0
  15. package/api/labelsApi.ts +1488 -0
  16. package/api/monthlyTrackedUsersApi.ts +1178 -0
  17. package/api/selectiveSyncApi.ts +3321 -0
  18. package/api/sourcesApi.ts +5602 -0
  19. package/api/spacesApi.ts +489 -0
  20. package/api/testingApi.ts +568 -0
  21. package/api/trackingPlansApi.ts +6238 -0
  22. package/api/transformationsApi.ts +1316 -0
  23. package/api/warehousesApi.ts +5004 -0
  24. package/api/workspacesApi.ts +513 -0
  25. package/api.ts +3 -0
  26. package/dist/model/contact.d.ts +17 -0
  27. package/dist/model/contact.js +36 -0
  28. package/dist/model/contact.js.map +1 -0
  29. package/dist/model/destinationMetadata.d.ts +3 -0
  30. package/dist/model/destinationMetadata.js +10 -0
  31. package/dist/model/destinationMetadata.js.map +1 -1
  32. package/dist/model/destinationMetadataV1.d.ts +3 -0
  33. package/dist/model/destinationMetadataV1.js +10 -0
  34. package/dist/model/destinationMetadataV1.js.map +1 -1
  35. package/dist/model/metadata.d.ts +3 -0
  36. package/dist/model/metadata.js +10 -0
  37. package/dist/model/metadata.js.map +1 -1
  38. package/dist/model/models.d.ts +1 -0
  39. package/dist/model/models.js +3 -0
  40. package/dist/model/models.js.map +1 -1
  41. package/jest.config.js +10 -0
  42. package/model/aPICallSnapshotV1.ts +50 -0
  43. package/model/accessPermissionV1.ts +60 -0
  44. package/model/addConnectionFromSourceToWarehouse200Response.ts +36 -0
  45. package/model/addConnectionFromSourceToWarehouseV1Output.ts +48 -0
  46. package/model/addLabelsToSource200Response.ts +36 -0
  47. package/model/addLabelsToSource200Response1.ts +36 -0
  48. package/model/addLabelsToSourceAlphaInput.ts +42 -0
  49. package/model/addLabelsToSourceAlphaOutput.ts +42 -0
  50. package/model/addLabelsToSourceV1Input.ts +42 -0
  51. package/model/addLabelsToSourceV1Output.ts +42 -0
  52. package/model/addPermissionsToUser200Response.ts +36 -0
  53. package/model/addPermissionsToUserGroup200Response.ts +36 -0
  54. package/model/addPermissionsToUserGroupV1Input.ts +42 -0
  55. package/model/addPermissionsToUserGroupV1Output.ts +42 -0
  56. package/model/addPermissionsToUserV1Input.ts +42 -0
  57. package/model/addPermissionsToUserV1Output.ts +42 -0
  58. package/model/addSourceToTrackingPlan200Response.ts +36 -0
  59. package/model/addSourceToTrackingPlanV1Input.ts +41 -0
  60. package/model/addSourceToTrackingPlanV1Output.ts +47 -0
  61. package/model/addUsersToUserGroup200Response.ts +36 -0
  62. package/model/addUsersToUserGroupV1Input.ts +41 -0
  63. package/model/addUsersToUserGroupV1Output.ts +39 -0
  64. package/model/advancedWarehouseSyncScheduleV1Input.ts +51 -0
  65. package/model/advancedWarehouseSyncScheduleV1Output.ts +51 -0
  66. package/model/allowedLabelBeta.ts +59 -0
  67. package/model/auditEventV1.ts +95 -0
  68. package/model/batchQueryMessagingSubscriptionsForSpace200Response.ts +36 -0
  69. package/model/batchQueryMessagingSubscriptionsForSpaceAlphaInput.ts +42 -0
  70. package/model/batchQueryMessagingSubscriptionsForSpaceAlphaOutput.ts +69 -0
  71. package/model/breakdownBeta.ts +50 -0
  72. package/model/commonSourceSettingsV1.ts +68 -0
  73. package/model/contact.ts +68 -0
  74. package/model/createCloudSourceRegulation200Response.ts +36 -0
  75. package/model/createCloudSourceRegulationV1Input.ts +82 -0
  76. package/model/createCloudSourceRegulationV1Output.ts +41 -0
  77. package/model/createDestination200Response.ts +36 -0
  78. package/model/createDestinationSubscription200Response.ts +36 -0
  79. package/model/createDestinationSubscriptionAlphaInput.ts +77 -0
  80. package/model/createDestinationSubscriptionAlphaOutput.ts +39 -0
  81. package/model/createDestinationV1Input.ts +77 -0
  82. package/model/createDestinationV1Output.ts +39 -0
  83. package/model/createEdgeFunctions200Response.ts +36 -0
  84. package/model/createEdgeFunctionsAlphaInput.ts +41 -0
  85. package/model/createEdgeFunctionsAlphaOutput.ts +39 -0
  86. package/model/createFilterForDestination200Response.ts +36 -0
  87. package/model/createFilterForDestinationV1Input.ts +87 -0
  88. package/model/createFilterForDestinationV1Output.ts +39 -0
  89. package/model/createFunction200Response.ts +36 -0
  90. package/model/createFunctionDeployment200Response.ts +36 -0
  91. package/model/createFunctionDeploymentV1Output.ts +39 -0
  92. package/model/createFunctionV1Input.ts +94 -0
  93. package/model/createFunctionV1Output.ts +39 -0
  94. package/model/createInvites200Response.ts +36 -0
  95. package/model/createInvitesV1Input.ts +42 -0
  96. package/model/createInvitesV1Output.ts +41 -0
  97. package/model/createLabel200Response.ts +36 -0
  98. package/model/createLabel200Response1.ts +36 -0
  99. package/model/createLabelAlphaInput.ts +39 -0
  100. package/model/createLabelAlphaOutput.ts +42 -0
  101. package/model/createLabelV1Input.ts +39 -0
  102. package/model/createLabelV1Output.ts +39 -0
  103. package/model/createSource200Response.ts +36 -0
  104. package/model/createSource200Response1.ts +36 -0
  105. package/model/createSourceAlphaInput.ts +77 -0
  106. package/model/createSourceAlphaOutput.ts +39 -0
  107. package/model/createSourceRegulation200Response.ts +36 -0
  108. package/model/createSourceRegulationV1Input.ts +73 -0
  109. package/model/createSourceRegulationV1Output.ts +41 -0
  110. package/model/createSourceV1Input.ts +68 -0
  111. package/model/createSourceV1Output.ts +39 -0
  112. package/model/createTrackingPlan200Response.ts +36 -0
  113. package/model/createTrackingPlanV1Input.ts +68 -0
  114. package/model/createTrackingPlanV1Output.ts +39 -0
  115. package/model/createTransformation200Response.ts +36 -0
  116. package/model/createTransformationBetaInput.ts +96 -0
  117. package/model/createTransformationBetaOutput.ts +39 -0
  118. package/model/createUserGroup200Response.ts +36 -0
  119. package/model/createUserGroupV1Input.ts +41 -0
  120. package/model/createUserGroupV1Output.ts +39 -0
  121. package/model/createValidationInWarehouse200Response.ts +36 -0
  122. package/model/createValidationInWarehouseV1Input.ts +50 -0
  123. package/model/createValidationInWarehouseV1Output.ts +48 -0
  124. package/model/createWarehouse200Response.ts +36 -0
  125. package/model/createWarehouseV1Input.ts +68 -0
  126. package/model/createWarehouseV1Output.ts +39 -0
  127. package/model/createWorkspaceRegulation200Response.ts +36 -0
  128. package/model/createWorkspaceRegulationV1Input.ts +74 -0
  129. package/model/createWorkspaceRegulationV1Output.ts +41 -0
  130. package/model/deleteDestination200Response.ts +36 -0
  131. package/model/deleteDestinationV1Output.ts +47 -0
  132. package/model/deleteFunction200Response.ts +36 -0
  133. package/model/deleteFunctionV1Output.ts +47 -0
  134. package/model/deleteInvites200Response.ts +36 -0
  135. package/model/deleteInvitesV1Output.ts +47 -0
  136. package/model/deleteLabel200Response.ts +36 -0
  137. package/model/deleteLabel200Response1.ts +36 -0
  138. package/model/deleteLabelAlphaOutput.ts +47 -0
  139. package/model/deleteLabelV1Output.ts +47 -0
  140. package/model/deleteRegulation200Response.ts +36 -0
  141. package/model/deleteRegulationV1Output.ts +47 -0
  142. package/model/deleteSource200Response.ts +36 -0
  143. package/model/deleteSource200Response1.ts +36 -0
  144. package/model/deleteSourceAlphaOutput.ts +47 -0
  145. package/model/deleteSourceV1Output.ts +47 -0
  146. package/model/deleteTrackingPlan200Response.ts +36 -0
  147. package/model/deleteTrackingPlanV1Output.ts +47 -0
  148. package/model/deleteTransformation200Response.ts +36 -0
  149. package/model/deleteTransformationBetaOutput.ts +47 -0
  150. package/model/deleteUserGroup200Response.ts +36 -0
  151. package/model/deleteUserGroupV1Output.ts +47 -0
  152. package/model/deleteUsers200Response.ts +36 -0
  153. package/model/deleteUsersV1Output.ts +47 -0
  154. package/model/deleteWarehouse200Response.ts +36 -0
  155. package/model/deleteWarehouseV1Output.ts +47 -0
  156. package/model/deliveryMetricsSummary.ts +60 -0
  157. package/model/deliveryMetricsSummaryBeta.ts +60 -0
  158. package/model/destination.ts +84 -0
  159. package/model/destination1.ts +84 -0
  160. package/model/destination2.ts +84 -0
  161. package/model/destinationFilterActionV1.ts +77 -0
  162. package/model/destinationFilterV1.ts +123 -0
  163. package/model/destinationMetadata.ts +203 -0
  164. package/model/destinationMetadataActionFieldV1.ts +163 -0
  165. package/model/destinationMetadataActionV1.ts +113 -0
  166. package/model/destinationMetadataComponentV1.ts +72 -0
  167. package/model/destinationMetadataFeaturesV1.ts +93 -0
  168. package/model/destinationMetadataMethodsV1.ts +77 -0
  169. package/model/destinationMetadataPlatformsV1.ts +59 -0
  170. package/model/destinationMetadataSubscriptionPresetV1.ts +68 -0
  171. package/model/destinationMetadataV1.ts +203 -0
  172. package/model/destinationStatusV1.ts +74 -0
  173. package/model/destinationSubscription.ts +104 -0
  174. package/model/destinationSubscriptionUpdateInput.ts +68 -0
  175. package/model/destinationV1.ts +84 -0
  176. package/model/disableEdgeFunctions200Response.ts +36 -0
  177. package/model/disableEdgeFunctionsAlphaOutput.ts +39 -0
  178. package/model/echo200Response.ts +36 -0
  179. package/model/echo200Response1.ts +36 -0
  180. package/model/echoAlphaOutput.ts +66 -0
  181. package/model/echoV1Output.ts +66 -0
  182. package/model/edgeFunctions.ts +86 -0
  183. package/model/edgeFunctions1.ts +86 -0
  184. package/model/edgeFunctionsAlpha.ts +86 -0
  185. package/model/eventSourceV1.ts +59 -0
  186. package/model/filter.ts +51 -0
  187. package/model/filter1.ts +123 -0
  188. package/model/filter2.ts +123 -0
  189. package/model/filter3.ts +123 -0
  190. package/model/function.ts +166 -0
  191. package/model/function1.ts +166 -0
  192. package/model/function2.ts +166 -0
  193. package/model/functionDeployment.ts +44 -0
  194. package/model/functionSettingV1.ts +92 -0
  195. package/model/functionV1.ts +166 -0
  196. package/model/generateUploadURLForEdgeFunctions200Response.ts +36 -0
  197. package/model/generateUploadURLForEdgeFunctionsAlphaOutput.ts +41 -0
  198. package/model/getAdvancedSyncScheduleFromWarehouse200Response.ts +36 -0
  199. package/model/getAdvancedSyncScheduleFromWarehouseV1Output.ts +48 -0
  200. package/model/getConnectionStateFromWarehouse200Response.ts +36 -0
  201. package/model/getConnectionStateFromWarehouseV1Output.ts +48 -0
  202. package/model/getDailyPerSourceAPICallsUsage200Response.ts +36 -0
  203. package/model/getDailyPerSourceAPICallsUsageV1Output.ts +49 -0
  204. package/model/getDailyPerSourceMTUUsage200Response.ts +36 -0
  205. package/model/getDailyPerSourceMTUUsageV1Output.ts +49 -0
  206. package/model/getDailyWorkspaceAPICallsUsage200Response.ts +36 -0
  207. package/model/getDailyWorkspaceAPICallsUsageV1Output.ts +49 -0
  208. package/model/getDailyWorkspaceMTUUsage200Response.ts +36 -0
  209. package/model/getDailyWorkspaceMTUUsageV1Output.ts +49 -0
  210. package/model/getDestination200Response.ts +36 -0
  211. package/model/getDestinationMetadata200Response.ts +36 -0
  212. package/model/getDestinationMetadataV1Output.ts +39 -0
  213. package/model/getDestinationV1Output.ts +39 -0
  214. package/model/getDestinationsCatalog200Response.ts +36 -0
  215. package/model/getDestinationsCatalogV1Output.ts +49 -0
  216. package/model/getEventsVolumeFromWorkspace200Response.ts +36 -0
  217. package/model/getEventsVolumeFromWorkspaceV1Output.ts +49 -0
  218. package/model/getFilterInDestination200Response.ts +36 -0
  219. package/model/getFilterInDestinationV1Output.ts +39 -0
  220. package/model/getFunction200Response.ts +36 -0
  221. package/model/getFunctionV1Output.ts +39 -0
  222. package/model/getLatestFromEdgeFunctions200Response.ts +36 -0
  223. package/model/getLatestFromEdgeFunctionsAlphaOutput.ts +39 -0
  224. package/model/getMessagingSubscriptionFailureResponse.ts +57 -0
  225. package/model/getMessagingSubscriptionSuccessResponse.ts +68 -0
  226. package/model/getRegulation200Response.ts +36 -0
  227. package/model/getRegulationV1Output.ts +39 -0
  228. package/model/getSource200Response.ts +36 -0
  229. package/model/getSource200Response1.ts +36 -0
  230. package/model/getSourceAlphaOutput.ts +39 -0
  231. package/model/getSourceMetadata200Response.ts +36 -0
  232. package/model/getSourceMetadataV1Output.ts +39 -0
  233. package/model/getSourceV1Output.ts +39 -0
  234. package/model/getSourcesCatalog200Response.ts +36 -0
  235. package/model/getSourcesCatalogV1Output.ts +49 -0
  236. package/model/getSpace200Response.ts +36 -0
  237. package/model/getSpaceAlphaOutput.ts +39 -0
  238. package/model/getSubscriptionFromDestination200Response.ts +36 -0
  239. package/model/getSubscriptionFromDestinationAlphaOutput.ts +39 -0
  240. package/model/getSubscriptionRequest.ts +54 -0
  241. package/model/getTrackingPlan200Response.ts +36 -0
  242. package/model/getTrackingPlanV1Output.ts +39 -0
  243. package/model/getTransformation200Response.ts +36 -0
  244. package/model/getTransformationBetaOutput.ts +39 -0
  245. package/model/getUser200Response.ts +36 -0
  246. package/model/getUserGroup200Response.ts +36 -0
  247. package/model/getUserGroupV1Output.ts +39 -0
  248. package/model/getUserV1Output.ts +39 -0
  249. package/model/getWarehouse200Response.ts +36 -0
  250. package/model/getWarehouseMetadata200Response.ts +36 -0
  251. package/model/getWarehouseMetadataV1Output.ts +39 -0
  252. package/model/getWarehouseV1Output.ts +39 -0
  253. package/model/getWarehousesCatalog200Response.ts +36 -0
  254. package/model/getWarehousesCatalogV1Output.ts +49 -0
  255. package/model/getWorkspace200Response.ts +36 -0
  256. package/model/getWorkspaceV1Output.ts +39 -0
  257. package/model/group.ts +67 -0
  258. package/model/groupSourceSettingsV1.ts +64 -0
  259. package/model/identify.ts +67 -0
  260. package/model/identifySourceSettingsV1.ts +64 -0
  261. package/model/input.ts +68 -0
  262. package/model/integrationOptionBeta.ts +86 -0
  263. package/model/invitePermissionV1.ts +61 -0
  264. package/model/inviteV1.ts +51 -0
  265. package/model/label.ts +59 -0
  266. package/model/label1.ts +59 -0
  267. package/model/label2.ts +59 -0
  268. package/model/labelAlpha.ts +59 -0
  269. package/model/labelV1.ts +59 -0
  270. package/model/listAuditEvents200Response.ts +36 -0
  271. package/model/listAuditEventsV1Output.ts +49 -0
  272. package/model/listConnectedDestinationsFromSource200Response.ts +36 -0
  273. package/model/listConnectedDestinationsFromSource200Response1.ts +36 -0
  274. package/model/listConnectedDestinationsFromSourceAlphaOutput.ts +49 -0
  275. package/model/listConnectedDestinationsFromSourceV1Output.ts +49 -0
  276. package/model/listConnectedSourcesFromWarehouse200Response.ts +36 -0
  277. package/model/listConnectedSourcesFromWarehouseV1Output.ts +49 -0
  278. package/model/listConnectedWarehousesFromSource200Response.ts +36 -0
  279. package/model/listConnectedWarehousesFromSource200Response1.ts +36 -0
  280. package/model/listConnectedWarehousesFromSourceAlphaOutput.ts +49 -0
  281. package/model/listConnectedWarehousesFromSourceV1Output.ts +49 -0
  282. package/model/listDeliveryMetricsSummaryFromDestination200Response.ts +36 -0
  283. package/model/listDeliveryMetricsSummaryFromDestinationBetaOutput.ts +39 -0
  284. package/model/listDestinations200Response.ts +36 -0
  285. package/model/listDestinationsV1Output.ts +49 -0
  286. package/model/listFiltersFromDestination200Response.ts +36 -0
  287. package/model/listFiltersFromDestinationV1Output.ts +49 -0
  288. package/model/listFunctionItemV1.ts +111 -0
  289. package/model/listFunctions200Response.ts +36 -0
  290. package/model/listFunctionsV1Output.ts +49 -0
  291. package/model/listInvites200Response.ts +36 -0
  292. package/model/listInvitesFromUserGroup200Response.ts +36 -0
  293. package/model/listInvitesFromUserGroupV1Output.ts +48 -0
  294. package/model/listInvitesV1Output.ts +48 -0
  295. package/model/listLabels200Response.ts +36 -0
  296. package/model/listLabels200Response1.ts +36 -0
  297. package/model/listLabelsAlphaOutput.ts +42 -0
  298. package/model/listLabelsV1Output.ts +42 -0
  299. package/model/listRegulationsFromSource200Response.ts +36 -0
  300. package/model/listRegulationsFromSourceV1Output.ts +42 -0
  301. package/model/listRoles200Response.ts +36 -0
  302. package/model/listRolesV1Output.ts +49 -0
  303. package/model/listRulesFromTrackingPlan200Response.ts +36 -0
  304. package/model/listRulesFromTrackingPlanV1Output.ts +49 -0
  305. package/model/listSchemaSettingsInSource200Response.ts +36 -0
  306. package/model/listSchemaSettingsInSourceV1Output.ts +48 -0
  307. package/model/listSelectiveSyncsFromWarehouseAndSource200Response.ts +36 -0
  308. package/model/listSelectiveSyncsFromWarehouseAndSourceV1Output.ts +49 -0
  309. package/model/listSources200Response.ts +36 -0
  310. package/model/listSources200Response1.ts +36 -0
  311. package/model/listSourcesAlphaOutput.ts +49 -0
  312. package/model/listSourcesFromTrackingPlan200Response.ts +36 -0
  313. package/model/listSourcesFromTrackingPlanV1Output.ts +49 -0
  314. package/model/listSourcesV1Output.ts +49 -0
  315. package/model/listSubscriptionsFromDestination200Response.ts +36 -0
  316. package/model/listSubscriptionsFromDestinationAlphaOutput.ts +49 -0
  317. package/model/listSuppressions200Response.ts +36 -0
  318. package/model/listSuppressionsV1Output.ts +49 -0
  319. package/model/listSyncsFromWarehouse200Response.ts +36 -0
  320. package/model/listSyncsFromWarehouseAndSource200Response.ts +36 -0
  321. package/model/listSyncsFromWarehouseAndSourceV1Output.ts +49 -0
  322. package/model/listSyncsFromWarehouseV1Output.ts +49 -0
  323. package/model/listTrackingPlans200Response.ts +36 -0
  324. package/model/listTrackingPlansV1Output.ts +49 -0
  325. package/model/listTransformations200Response.ts +36 -0
  326. package/model/listTransformationsBetaOutput.ts +49 -0
  327. package/model/listUserGroups200Response.ts +36 -0
  328. package/model/listUserGroupsFromUser200Response.ts +36 -0
  329. package/model/listUserGroupsFromUserV1Output.ts +49 -0
  330. package/model/listUserGroupsV1Output.ts +49 -0
  331. package/model/listUsers200Response.ts +36 -0
  332. package/model/listUsersFromUserGroup200Response.ts +36 -0
  333. package/model/listUsersFromUserGroupV1Output.ts +49 -0
  334. package/model/listUsersV1Output.ts +49 -0
  335. package/model/listWarehouses200Response.ts +36 -0
  336. package/model/listWarehousesV1Output.ts +49 -0
  337. package/model/listWorkspaceRegulations200Response.ts +36 -0
  338. package/model/listWorkspaceRegulationsV1Output.ts +49 -0
  339. package/model/logos.ts +59 -0
  340. package/model/logos1.ts +59 -0
  341. package/model/logos2.ts +59 -0
  342. package/model/logosBeta.ts +59 -0
  343. package/model/messageSubscriptionResponse.ts +78 -0
  344. package/model/messageSubscriptionResponseError.ts +47 -0
  345. package/model/messagesSubscriptionRequest.ts +68 -0
  346. package/model/metadata.ts +203 -0
  347. package/model/metadata1.ts +103 -0
  348. package/model/metadata2.ts +85 -0
  349. package/model/metricBeta.ts +60 -0
  350. package/model/minimalUserGroupV1.ts +50 -0
  351. package/model/minimalUserV1.ts +59 -0
  352. package/model/models.ts +1838 -0
  353. package/model/mtuSnapshotV1.ts +95 -0
  354. package/model/pagination.ts +68 -0
  355. package/model/paginationInput.ts +50 -0
  356. package/model/paginationOutput.ts +68 -0
  357. package/model/permissionInputV1.ts +51 -0
  358. package/model/permissionResourceV1.ts +70 -0
  359. package/model/permissionV1.ts +70 -0
  360. package/model/previewDestinationFilter200Response.ts +36 -0
  361. package/model/previewDestinationFilterV1.ts +51 -0
  362. package/model/previewDestinationFilterV1Input.ts +48 -0
  363. package/model/previewDestinationFilterV1Output.ts +50 -0
  364. package/model/propertyRenameBeta.ts +47 -0
  365. package/model/regulation.ts +99 -0
  366. package/model/regulationListEntryV1.ts +77 -0
  367. package/model/removeFilterFromDestination200Response.ts +36 -0
  368. package/model/removeFilterFromDestinationV1Output.ts +47 -0
  369. package/model/removeRuleV1.ts +61 -0
  370. package/model/removeRulesFromTrackingPlan200Response.ts +36 -0
  371. package/model/removeRulesFromTrackingPlanV1Output.ts +47 -0
  372. package/model/removeSourceConnectionFromWarehouse200Response.ts +36 -0
  373. package/model/removeSourceConnectionFromWarehouseV1Output.ts +47 -0
  374. package/model/removeSourceFromTrackingPlan200Response.ts +36 -0
  375. package/model/removeSourceFromTrackingPlanV1Output.ts +47 -0
  376. package/model/removeSubscriptionFromDestination200Response.ts +36 -0
  377. package/model/removeSubscriptionFromDestinationAlphaOutput.ts +47 -0
  378. package/model/removeUsersFromUserGroup200Response.ts +36 -0
  379. package/model/removeUsersFromUserGroupV1Output.ts +47 -0
  380. package/model/replaceAdvancedSyncScheduleForWarehouse200Response.ts +36 -0
  381. package/model/replaceAdvancedSyncScheduleForWarehouseV1Input.ts +48 -0
  382. package/model/replaceAdvancedSyncScheduleForWarehouseV1Output.ts +48 -0
  383. package/model/replaceLabelsInSource200Response.ts +36 -0
  384. package/model/replaceLabelsInSource200Response1.ts +36 -0
  385. package/model/replaceLabelsInSourceAlphaInput.ts +42 -0
  386. package/model/replaceLabelsInSourceAlphaOutput.ts +42 -0
  387. package/model/replaceLabelsInSourceV1Input.ts +42 -0
  388. package/model/replaceLabelsInSourceV1Output.ts +42 -0
  389. package/model/replaceMessagingSubscriptionsInSpaces200Response.ts +36 -0
  390. package/model/replaceMessagingSubscriptionsInSpacesAlphaInput.ts +42 -0
  391. package/model/replaceMessagingSubscriptionsInSpacesAlphaOutput.ts +58 -0
  392. package/model/replacePermissionsForUser200Response.ts +36 -0
  393. package/model/replacePermissionsForUserGroup200Response.ts +36 -0
  394. package/model/replacePermissionsForUserGroupV1Input.ts +42 -0
  395. package/model/replacePermissionsForUserGroupV1Output.ts +42 -0
  396. package/model/replacePermissionsForUserV1Input.ts +42 -0
  397. package/model/replacePermissionsForUserV1Output.ts +42 -0
  398. package/model/replaceRulesInTrackingPlan200Response.ts +36 -0
  399. package/model/replaceRulesInTrackingPlanV1Input.ts +42 -0
  400. package/model/replaceRulesInTrackingPlanV1Output.ts +47 -0
  401. package/model/replaceUsersInUserGroup200Response.ts +36 -0
  402. package/model/replaceUsersInUserGroupV1Input.ts +41 -0
  403. package/model/replaceUsersInUserGroupV1Output.ts +39 -0
  404. package/model/requestError.ts +77 -0
  405. package/model/requestErrorEnvelope.ts +39 -0
  406. package/model/resourceV1.ts +60 -0
  407. package/model/roleV1.ts +59 -0
  408. package/model/ruleV1.ts +106 -0
  409. package/model/schedule.ts +51 -0
  410. package/model/schedule1.ts +51 -0
  411. package/model/schedule2.ts +51 -0
  412. package/model/settings.ts +71 -0
  413. package/model/settings1.ts +71 -0
  414. package/model/source.ts +59 -0
  415. package/model/source1.ts +112 -0
  416. package/model/source2.ts +112 -0
  417. package/model/source3.ts +112 -0
  418. package/model/source4.ts +112 -0
  419. package/model/source5.ts +112 -0
  420. package/model/source6.ts +112 -0
  421. package/model/sourceAPICallSnapshotV1.ts +59 -0
  422. package/model/sourceAlpha.ts +112 -0
  423. package/model/sourceEventVolumeDatapointV1.ts +50 -0
  424. package/model/sourceEventVolumeV1.ts +76 -0
  425. package/model/sourceMetadata.ts +103 -0
  426. package/model/sourceMetadataV1.ts +103 -0
  427. package/model/sourceSettingsOutputV1.ts +71 -0
  428. package/model/sourceV1.ts +112 -0
  429. package/model/space.ts +50 -0
  430. package/model/streamStatusV1.ts +45 -0
  431. package/model/subscription.ts +104 -0
  432. package/model/supportedFeatures.ts +93 -0
  433. package/model/supportedMethods.ts +77 -0
  434. package/model/supportedPlatforms.ts +59 -0
  435. package/model/suppressedInner.ts +41 -0
  436. package/model/syncNoticeV1.ts +59 -0
  437. package/model/syncV1.ts +105 -0
  438. package/model/track.ts +85 -0
  439. package/model/trackSourceSettingsV1.ts +82 -0
  440. package/model/trackingPlan.ts +104 -0
  441. package/model/trackingPlan1.ts +104 -0
  442. package/model/trackingPlanV1.ts +104 -0
  443. package/model/transformation.ts +105 -0
  444. package/model/transformation1.ts +105 -0
  445. package/model/transformation2.ts +105 -0
  446. package/model/transformationBeta.ts +105 -0
  447. package/model/updateDestination200Response.ts +36 -0
  448. package/model/updateDestinationV1Input.ts +59 -0
  449. package/model/updateDestinationV1Output.ts +39 -0
  450. package/model/updateFilterForDestination200Response.ts +36 -0
  451. package/model/updateFilterForDestinationV1Input.ts +78 -0
  452. package/model/updateFilterForDestinationV1Output.ts +39 -0
  453. package/model/updateFunction200Response.ts +36 -0
  454. package/model/updateFunctionV1Input.ts +78 -0
  455. package/model/updateFunctionV1Output.ts +39 -0
  456. package/model/updateRulesInTrackingPlan200Response.ts +36 -0
  457. package/model/updateRulesInTrackingPlanV1Input.ts +42 -0
  458. package/model/updateRulesInTrackingPlanV1Output.ts +47 -0
  459. package/model/updateSchemaSettingsInSource200Response.ts +36 -0
  460. package/model/updateSchemaSettingsInSourceV1Input.ts +71 -0
  461. package/model/updateSchemaSettingsInSourceV1Output.ts +48 -0
  462. package/model/updateSelectiveSyncForWarehouse200Response.ts +36 -0
  463. package/model/updateSelectiveSyncForWarehouseV1Input.ts +42 -0
  464. package/model/updateSelectiveSyncForWarehouseV1Output.ts +57 -0
  465. package/model/updateSource200Response.ts +36 -0
  466. package/model/updateSource200Response1.ts +36 -0
  467. package/model/updateSourceAlphaInput.ts +68 -0
  468. package/model/updateSourceAlphaOutput.ts +39 -0
  469. package/model/updateSourceV1Input.ts +68 -0
  470. package/model/updateSourceV1Output.ts +39 -0
  471. package/model/updateSubscriptionForDestination200Response.ts +36 -0
  472. package/model/updateSubscriptionForDestinationAlphaInput.ts +39 -0
  473. package/model/updateSubscriptionForDestinationAlphaOutput.ts +39 -0
  474. package/model/updateTrackingPlan200Response.ts +36 -0
  475. package/model/updateTrackingPlanV1Input.ts +50 -0
  476. package/model/updateTrackingPlanV1Output.ts +47 -0
  477. package/model/updateTransformation200Response.ts +36 -0
  478. package/model/updateTransformationBetaInput.ts +96 -0
  479. package/model/updateTransformationBetaOutput.ts +39 -0
  480. package/model/updateUserGroup200Response.ts +36 -0
  481. package/model/updateUserGroupV1Input.ts +41 -0
  482. package/model/updateUserGroupV1Output.ts +39 -0
  483. package/model/updateWarehouse200Response.ts +36 -0
  484. package/model/updateWarehouseV1Input.ts +59 -0
  485. package/model/updateWarehouseV1Output.ts +39 -0
  486. package/model/upsertRuleV1.ts +112 -0
  487. package/model/user.ts +69 -0
  488. package/model/userGroup.ts +69 -0
  489. package/model/userGroup1.ts +69 -0
  490. package/model/userGroup2.ts +69 -0
  491. package/model/userGroup3.ts +69 -0
  492. package/model/userGroupV1.ts +69 -0
  493. package/model/userV1.ts +69 -0
  494. package/model/usersPerSourceSnapshotV1.ts +104 -0
  495. package/model/warehouse.ts +75 -0
  496. package/model/warehouse1.ts +75 -0
  497. package/model/warehouse2.ts +75 -0
  498. package/model/warehouseAdvancedSyncV1.ts +50 -0
  499. package/model/warehouseMetadata.ts +85 -0
  500. package/model/warehouseMetadataV1.ts +85 -0
  501. package/model/warehouseSelectiveSyncItemV1.ts +68 -0
  502. package/model/warehouseSyncOverrideV1.ts +68 -0
  503. package/model/warehouseV1.ts +75 -0
  504. package/model/workspace.ts +59 -0
  505. package/model/workspaceV1.ts +59 -0
  506. package/package.json +1 -2
  507. package/tests/__snapshots__/smoke.test.ts.snap +889 -0
  508. package/tests/smoke.test.ts +267 -0
  509. package/tsconfig.json +20 -0
@@ -0,0 +1,3321 @@
1
+ /**
2
+ * Segment Public API
3
+ * The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API.
4
+ *
5
+ * The version of the OpenAPI document: 32.0.2
6
+ * Contact: friends@segment.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+
13
+ import localVarRequest from 'request';
14
+ import http from 'http';
15
+
16
+ /* tslint:disable:no-unused-locals */
17
+ import { GetAdvancedSyncScheduleFromWarehouse200Response } from '../model/getAdvancedSyncScheduleFromWarehouse200Response';
18
+ import { ListSelectiveSyncsFromWarehouseAndSource200Response } from '../model/listSelectiveSyncsFromWarehouseAndSource200Response';
19
+ import { ListSyncsFromWarehouse200Response } from '../model/listSyncsFromWarehouse200Response';
20
+ import { ListSyncsFromWarehouseAndSource200Response } from '../model/listSyncsFromWarehouseAndSource200Response';
21
+ import { PaginationInput } from '../model/paginationInput';
22
+ import { ReplaceAdvancedSyncScheduleForWarehouse200Response } from '../model/replaceAdvancedSyncScheduleForWarehouse200Response';
23
+ import { ReplaceAdvancedSyncScheduleForWarehouseV1Input } from '../model/replaceAdvancedSyncScheduleForWarehouseV1Input';
24
+ import { RequestErrorEnvelope } from '../model/requestErrorEnvelope';
25
+ import { UpdateSelectiveSyncForWarehouse200Response } from '../model/updateSelectiveSyncForWarehouse200Response';
26
+ import { UpdateSelectiveSyncForWarehouseV1Input } from '../model/updateSelectiveSyncForWarehouseV1Input';
27
+
28
+ import {
29
+ ObjectSerializer,
30
+ Authentication,
31
+ VoidAuth,
32
+ Interceptor,
33
+ } from '../model/models';
34
+ import {
35
+ HttpBasicAuth,
36
+ HttpBearerAuth,
37
+ ApiKeyAuth,
38
+ OAuth,
39
+ } from '../model/models';
40
+
41
+ import { HttpError, RequestFile } from './apis';
42
+
43
+ let defaultBasePath = 'https://api.segmentapis.com';
44
+
45
+ // ===============================================
46
+ // This file is autogenerated - Please do not edit
47
+ // ===============================================
48
+
49
+ export enum SelectiveSyncApiApiKeys {}
50
+
51
+ export class SelectiveSyncApi {
52
+ protected _basePath = defaultBasePath;
53
+ protected _defaultHeaders: any = {};
54
+ protected _useQuerystring: boolean = false;
55
+
56
+ protected authentications = {
57
+ default: <Authentication>new VoidAuth(),
58
+ token: new HttpBearerAuth(),
59
+ };
60
+
61
+ protected interceptors: Interceptor[] = [];
62
+
63
+ constructor(basePath?: string);
64
+ constructor(
65
+ basePathOrUsername: string,
66
+ password?: string,
67
+ basePath?: string
68
+ ) {
69
+ if (password) {
70
+ if (basePath) {
71
+ this.basePath = basePath;
72
+ }
73
+ } else {
74
+ if (basePathOrUsername) {
75
+ this.basePath = basePathOrUsername;
76
+ }
77
+ }
78
+ }
79
+
80
+ set useQuerystring(value: boolean) {
81
+ this._useQuerystring = value;
82
+ }
83
+
84
+ set basePath(basePath: string) {
85
+ this._basePath = basePath;
86
+ }
87
+
88
+ set defaultHeaders(defaultHeaders: any) {
89
+ this._defaultHeaders = defaultHeaders;
90
+ }
91
+
92
+ get defaultHeaders() {
93
+ return this._defaultHeaders;
94
+ }
95
+
96
+ get basePath() {
97
+ return this._basePath;
98
+ }
99
+
100
+ public setDefaultAuthentication(auth: Authentication) {
101
+ this.authentications.default = auth;
102
+ }
103
+
104
+ public setApiKey(key: SelectiveSyncApiApiKeys, value: string) {
105
+ (this.authentications as any)[SelectiveSyncApiApiKeys[key]].apiKey =
106
+ value;
107
+ }
108
+
109
+ set accessToken(accessToken: string | (() => string)) {
110
+ this.authentications.token.accessToken = accessToken;
111
+ }
112
+
113
+ public addInterceptor(interceptor: Interceptor) {
114
+ this.interceptors.push(interceptor);
115
+ }
116
+
117
+ /**
118
+ * Returns the advanced sync schedule for a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
119
+ * @summary Get Advanced Sync Schedule from Warehouse
120
+ * @param warehouseId
121
+ */
122
+ public async getAdvancedSyncScheduleFromWarehouseAlpha(
123
+ warehouseId: string,
124
+ options: { headers: { [name: string]: string } } = { headers: {} }
125
+ ): Promise<{
126
+ response: http.IncomingMessage;
127
+ body: GetAdvancedSyncScheduleFromWarehouse200Response;
128
+ }> {
129
+ const localVarPath =
130
+ this.basePath +
131
+ '/warehouses/{warehouseId}/advanced-sync-schedule'.replace(
132
+ '{' + 'warehouseId' + '}',
133
+ encodeURIComponent(String(warehouseId))
134
+ );
135
+ let localVarQueryParameters: any = {};
136
+ let localVarHeaderParams: any = (<any>Object).assign(
137
+ {},
138
+ this._defaultHeaders
139
+ );
140
+ const produces = [
141
+ 'application/vnd.segment.v1alpha+json',
142
+ 'application/json',
143
+ ];
144
+ if (produces.indexOf('application/json') >= 0) {
145
+ localVarHeaderParams.Accept = produces[0];
146
+ } else {
147
+ localVarHeaderParams.Accept = 'application/json';
148
+ }
149
+ let localVarFormParams: any = {};
150
+
151
+ // verify required parameter 'warehouseId' is not null or undefined
152
+ if (warehouseId === null || warehouseId === undefined) {
153
+ throw new Error(
154
+ 'Required parameter warehouseId was null or undefined when calling getAdvancedSyncScheduleFromWarehouseAlpha.'
155
+ );
156
+ }
157
+
158
+ (<any>Object).assign(localVarHeaderParams, options.headers);
159
+
160
+ let localVarUseFormData = false;
161
+
162
+ let localVarRequestOptions: localVarRequest.Options = {
163
+ method: 'GET',
164
+ qs: localVarQueryParameters,
165
+ headers: localVarHeaderParams,
166
+ uri: localVarPath,
167
+ useQuerystring: this._useQuerystring,
168
+ json: true,
169
+ };
170
+
171
+ let authenticationPromise = Promise.resolve();
172
+ if (this.authentications.token.accessToken) {
173
+ authenticationPromise = authenticationPromise.then(() =>
174
+ this.authentications.token.applyToRequest(
175
+ localVarRequestOptions
176
+ )
177
+ );
178
+ }
179
+ authenticationPromise = authenticationPromise.then(() =>
180
+ this.authentications.default.applyToRequest(localVarRequestOptions)
181
+ );
182
+
183
+ let interceptorPromise = authenticationPromise;
184
+ for (const interceptor of this.interceptors) {
185
+ interceptorPromise = interceptorPromise.then(() =>
186
+ interceptor(localVarRequestOptions)
187
+ );
188
+ }
189
+
190
+ return interceptorPromise.then(() => {
191
+ if (Object.keys(localVarFormParams).length) {
192
+ if (localVarUseFormData) {
193
+ (<any>localVarRequestOptions).formData = localVarFormParams;
194
+ } else {
195
+ localVarRequestOptions.form = localVarFormParams;
196
+ }
197
+ }
198
+ return new Promise<{
199
+ response: http.IncomingMessage;
200
+ body: GetAdvancedSyncScheduleFromWarehouse200Response;
201
+ }>((resolve, reject) => {
202
+ localVarRequest(
203
+ localVarRequestOptions,
204
+ (error, response, body) => {
205
+ if (error) {
206
+ reject(error);
207
+ } else {
208
+ if (
209
+ response.statusCode &&
210
+ response.statusCode >= 200 &&
211
+ response.statusCode <= 299
212
+ ) {
213
+ body = ObjectSerializer.deserialize(
214
+ body,
215
+ 'GetAdvancedSyncScheduleFromWarehouse200Response'
216
+ );
217
+ resolve({ response: response, body: body });
218
+ } else {
219
+ reject(
220
+ new HttpError(
221
+ response,
222
+ body,
223
+ response.statusCode
224
+ )
225
+ );
226
+ }
227
+ }
228
+ }
229
+ );
230
+ });
231
+ });
232
+ }
233
+ /**
234
+ * Returns the advanced sync schedule for a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
235
+ * @summary Get Advanced Sync Schedule from Warehouse
236
+ * @param warehouseId
237
+ */
238
+ public async getAdvancedSyncScheduleFromWarehouseBeta(
239
+ warehouseId: string,
240
+ options: { headers: { [name: string]: string } } = { headers: {} }
241
+ ): Promise<{
242
+ response: http.IncomingMessage;
243
+ body: GetAdvancedSyncScheduleFromWarehouse200Response;
244
+ }> {
245
+ const localVarPath =
246
+ this.basePath +
247
+ '/warehouses/{warehouseId}/advanced-sync-schedule'.replace(
248
+ '{' + 'warehouseId' + '}',
249
+ encodeURIComponent(String(warehouseId))
250
+ );
251
+ let localVarQueryParameters: any = {};
252
+ let localVarHeaderParams: any = (<any>Object).assign(
253
+ {},
254
+ this._defaultHeaders
255
+ );
256
+ const produces = [
257
+ 'application/vnd.segment.v1beta+json',
258
+ 'application/json',
259
+ ];
260
+ if (produces.indexOf('application/json') >= 0) {
261
+ localVarHeaderParams.Accept = produces[0];
262
+ } else {
263
+ localVarHeaderParams.Accept = 'application/json';
264
+ }
265
+ let localVarFormParams: any = {};
266
+
267
+ // verify required parameter 'warehouseId' is not null or undefined
268
+ if (warehouseId === null || warehouseId === undefined) {
269
+ throw new Error(
270
+ 'Required parameter warehouseId was null or undefined when calling getAdvancedSyncScheduleFromWarehouseBeta.'
271
+ );
272
+ }
273
+
274
+ (<any>Object).assign(localVarHeaderParams, options.headers);
275
+
276
+ let localVarUseFormData = false;
277
+
278
+ let localVarRequestOptions: localVarRequest.Options = {
279
+ method: 'GET',
280
+ qs: localVarQueryParameters,
281
+ headers: localVarHeaderParams,
282
+ uri: localVarPath,
283
+ useQuerystring: this._useQuerystring,
284
+ json: true,
285
+ };
286
+
287
+ let authenticationPromise = Promise.resolve();
288
+ if (this.authentications.token.accessToken) {
289
+ authenticationPromise = authenticationPromise.then(() =>
290
+ this.authentications.token.applyToRequest(
291
+ localVarRequestOptions
292
+ )
293
+ );
294
+ }
295
+ authenticationPromise = authenticationPromise.then(() =>
296
+ this.authentications.default.applyToRequest(localVarRequestOptions)
297
+ );
298
+
299
+ let interceptorPromise = authenticationPromise;
300
+ for (const interceptor of this.interceptors) {
301
+ interceptorPromise = interceptorPromise.then(() =>
302
+ interceptor(localVarRequestOptions)
303
+ );
304
+ }
305
+
306
+ return interceptorPromise.then(() => {
307
+ if (Object.keys(localVarFormParams).length) {
308
+ if (localVarUseFormData) {
309
+ (<any>localVarRequestOptions).formData = localVarFormParams;
310
+ } else {
311
+ localVarRequestOptions.form = localVarFormParams;
312
+ }
313
+ }
314
+ return new Promise<{
315
+ response: http.IncomingMessage;
316
+ body: GetAdvancedSyncScheduleFromWarehouse200Response;
317
+ }>((resolve, reject) => {
318
+ localVarRequest(
319
+ localVarRequestOptions,
320
+ (error, response, body) => {
321
+ if (error) {
322
+ reject(error);
323
+ } else {
324
+ if (
325
+ response.statusCode &&
326
+ response.statusCode >= 200 &&
327
+ response.statusCode <= 299
328
+ ) {
329
+ body = ObjectSerializer.deserialize(
330
+ body,
331
+ 'GetAdvancedSyncScheduleFromWarehouse200Response'
332
+ );
333
+ resolve({ response: response, body: body });
334
+ } else {
335
+ reject(
336
+ new HttpError(
337
+ response,
338
+ body,
339
+ response.statusCode
340
+ )
341
+ );
342
+ }
343
+ }
344
+ }
345
+ );
346
+ });
347
+ });
348
+ }
349
+ /**
350
+ * Returns the advanced sync schedule for a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
351
+ * @summary Get Advanced Sync Schedule from Warehouse
352
+ * @param warehouseId
353
+ */
354
+ public async getAdvancedSyncScheduleFromWarehouseCurrent(
355
+ warehouseId: string,
356
+ options: { headers: { [name: string]: string } } = { headers: {} }
357
+ ): Promise<{
358
+ response: http.IncomingMessage;
359
+ body: GetAdvancedSyncScheduleFromWarehouse200Response;
360
+ }> {
361
+ const localVarPath =
362
+ this.basePath +
363
+ '/warehouses/{warehouseId}/advanced-sync-schedule'.replace(
364
+ '{' + 'warehouseId' + '}',
365
+ encodeURIComponent(String(warehouseId))
366
+ );
367
+ let localVarQueryParameters: any = {};
368
+ let localVarHeaderParams: any = (<any>Object).assign(
369
+ {},
370
+ this._defaultHeaders
371
+ );
372
+ const produces = ['application/json'];
373
+ if (produces.indexOf('application/json') >= 0) {
374
+ localVarHeaderParams.Accept = produces[0];
375
+ } else {
376
+ localVarHeaderParams.Accept = 'application/json';
377
+ }
378
+ let localVarFormParams: any = {};
379
+
380
+ // verify required parameter 'warehouseId' is not null or undefined
381
+ if (warehouseId === null || warehouseId === undefined) {
382
+ throw new Error(
383
+ 'Required parameter warehouseId was null or undefined when calling getAdvancedSyncScheduleFromWarehouseCurrent.'
384
+ );
385
+ }
386
+
387
+ (<any>Object).assign(localVarHeaderParams, options.headers);
388
+
389
+ let localVarUseFormData = false;
390
+
391
+ let localVarRequestOptions: localVarRequest.Options = {
392
+ method: 'GET',
393
+ qs: localVarQueryParameters,
394
+ headers: localVarHeaderParams,
395
+ uri: localVarPath,
396
+ useQuerystring: this._useQuerystring,
397
+ json: true,
398
+ };
399
+
400
+ let authenticationPromise = Promise.resolve();
401
+ if (this.authentications.token.accessToken) {
402
+ authenticationPromise = authenticationPromise.then(() =>
403
+ this.authentications.token.applyToRequest(
404
+ localVarRequestOptions
405
+ )
406
+ );
407
+ }
408
+ authenticationPromise = authenticationPromise.then(() =>
409
+ this.authentications.default.applyToRequest(localVarRequestOptions)
410
+ );
411
+
412
+ let interceptorPromise = authenticationPromise;
413
+ for (const interceptor of this.interceptors) {
414
+ interceptorPromise = interceptorPromise.then(() =>
415
+ interceptor(localVarRequestOptions)
416
+ );
417
+ }
418
+
419
+ return interceptorPromise.then(() => {
420
+ if (Object.keys(localVarFormParams).length) {
421
+ if (localVarUseFormData) {
422
+ (<any>localVarRequestOptions).formData = localVarFormParams;
423
+ } else {
424
+ localVarRequestOptions.form = localVarFormParams;
425
+ }
426
+ }
427
+ return new Promise<{
428
+ response: http.IncomingMessage;
429
+ body: GetAdvancedSyncScheduleFromWarehouse200Response;
430
+ }>((resolve, reject) => {
431
+ localVarRequest(
432
+ localVarRequestOptions,
433
+ (error, response, body) => {
434
+ if (error) {
435
+ reject(error);
436
+ } else {
437
+ if (
438
+ response.statusCode &&
439
+ response.statusCode >= 200 &&
440
+ response.statusCode <= 299
441
+ ) {
442
+ body = ObjectSerializer.deserialize(
443
+ body,
444
+ 'GetAdvancedSyncScheduleFromWarehouse200Response'
445
+ );
446
+ resolve({ response: response, body: body });
447
+ } else {
448
+ reject(
449
+ new HttpError(
450
+ response,
451
+ body,
452
+ response.statusCode
453
+ )
454
+ );
455
+ }
456
+ }
457
+ }
458
+ );
459
+ });
460
+ });
461
+ }
462
+ /**
463
+ * Returns the advanced sync schedule for a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
464
+ * @summary Get Advanced Sync Schedule from Warehouse
465
+ * @param warehouseId
466
+ */
467
+ public async getAdvancedSyncScheduleFromWarehouseV1(
468
+ warehouseId: string,
469
+ options: { headers: { [name: string]: string } } = { headers: {} }
470
+ ): Promise<{
471
+ response: http.IncomingMessage;
472
+ body: GetAdvancedSyncScheduleFromWarehouse200Response;
473
+ }> {
474
+ const localVarPath =
475
+ this.basePath +
476
+ '/warehouses/{warehouseId}/advanced-sync-schedule'.replace(
477
+ '{' + 'warehouseId' + '}',
478
+ encodeURIComponent(String(warehouseId))
479
+ );
480
+ let localVarQueryParameters: any = {};
481
+ let localVarHeaderParams: any = (<any>Object).assign(
482
+ {},
483
+ this._defaultHeaders
484
+ );
485
+ const produces = [
486
+ 'application/vnd.segment.v1+json',
487
+ 'application/json',
488
+ ];
489
+ if (produces.indexOf('application/json') >= 0) {
490
+ localVarHeaderParams.Accept = produces[0];
491
+ } else {
492
+ localVarHeaderParams.Accept = 'application/json';
493
+ }
494
+ let localVarFormParams: any = {};
495
+
496
+ // verify required parameter 'warehouseId' is not null or undefined
497
+ if (warehouseId === null || warehouseId === undefined) {
498
+ throw new Error(
499
+ 'Required parameter warehouseId was null or undefined when calling getAdvancedSyncScheduleFromWarehouseV1.'
500
+ );
501
+ }
502
+
503
+ (<any>Object).assign(localVarHeaderParams, options.headers);
504
+
505
+ let localVarUseFormData = false;
506
+
507
+ let localVarRequestOptions: localVarRequest.Options = {
508
+ method: 'GET',
509
+ qs: localVarQueryParameters,
510
+ headers: localVarHeaderParams,
511
+ uri: localVarPath,
512
+ useQuerystring: this._useQuerystring,
513
+ json: true,
514
+ };
515
+
516
+ let authenticationPromise = Promise.resolve();
517
+ if (this.authentications.token.accessToken) {
518
+ authenticationPromise = authenticationPromise.then(() =>
519
+ this.authentications.token.applyToRequest(
520
+ localVarRequestOptions
521
+ )
522
+ );
523
+ }
524
+ authenticationPromise = authenticationPromise.then(() =>
525
+ this.authentications.default.applyToRequest(localVarRequestOptions)
526
+ );
527
+
528
+ let interceptorPromise = authenticationPromise;
529
+ for (const interceptor of this.interceptors) {
530
+ interceptorPromise = interceptorPromise.then(() =>
531
+ interceptor(localVarRequestOptions)
532
+ );
533
+ }
534
+
535
+ return interceptorPromise.then(() => {
536
+ if (Object.keys(localVarFormParams).length) {
537
+ if (localVarUseFormData) {
538
+ (<any>localVarRequestOptions).formData = localVarFormParams;
539
+ } else {
540
+ localVarRequestOptions.form = localVarFormParams;
541
+ }
542
+ }
543
+ return new Promise<{
544
+ response: http.IncomingMessage;
545
+ body: GetAdvancedSyncScheduleFromWarehouse200Response;
546
+ }>((resolve, reject) => {
547
+ localVarRequest(
548
+ localVarRequestOptions,
549
+ (error, response, body) => {
550
+ if (error) {
551
+ reject(error);
552
+ } else {
553
+ if (
554
+ response.statusCode &&
555
+ response.statusCode >= 200 &&
556
+ response.statusCode <= 299
557
+ ) {
558
+ body = ObjectSerializer.deserialize(
559
+ body,
560
+ 'GetAdvancedSyncScheduleFromWarehouse200Response'
561
+ );
562
+ resolve({ response: response, body: body });
563
+ } else {
564
+ reject(
565
+ new HttpError(
566
+ response,
567
+ body,
568
+ response.statusCode
569
+ )
570
+ );
571
+ }
572
+ }
573
+ }
574
+ );
575
+ });
576
+ });
577
+ }
578
+ /**
579
+ * Returns the schema for a Warehouse, including Sources, Collections, and Properties. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
580
+ * @summary List Selective Syncs from Warehouse And Source
581
+ * @param warehouseId
582
+ * @param sourceId
583
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
584
+ */
585
+ public async listSelectiveSyncsFromWarehouseAndSourceAlpha(
586
+ warehouseId: string,
587
+ sourceId: string,
588
+ pagination: PaginationInput,
589
+ options: { headers: { [name: string]: string } } = { headers: {} }
590
+ ): Promise<{
591
+ response: http.IncomingMessage;
592
+ body: ListSelectiveSyncsFromWarehouseAndSource200Response;
593
+ }> {
594
+ const localVarPath =
595
+ this.basePath +
596
+ '/warehouses/{warehouseId}/connected-sources/{sourceId}/selective-syncs'
597
+ .replace(
598
+ '{' + 'warehouseId' + '}',
599
+ encodeURIComponent(String(warehouseId))
600
+ )
601
+ .replace(
602
+ '{' + 'sourceId' + '}',
603
+ encodeURIComponent(String(sourceId))
604
+ );
605
+ let localVarQueryParameters: any = {};
606
+ let localVarHeaderParams: any = (<any>Object).assign(
607
+ {},
608
+ this._defaultHeaders
609
+ );
610
+ const produces = [
611
+ 'application/vnd.segment.v1alpha+json',
612
+ 'application/json',
613
+ ];
614
+ if (produces.indexOf('application/json') >= 0) {
615
+ localVarHeaderParams.Accept = produces[0];
616
+ } else {
617
+ localVarHeaderParams.Accept = 'application/json';
618
+ }
619
+ let localVarFormParams: any = {};
620
+
621
+ // verify required parameter 'warehouseId' is not null or undefined
622
+ if (warehouseId === null || warehouseId === undefined) {
623
+ throw new Error(
624
+ 'Required parameter warehouseId was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceAlpha.'
625
+ );
626
+ }
627
+
628
+ // verify required parameter 'sourceId' is not null or undefined
629
+ if (sourceId === null || sourceId === undefined) {
630
+ throw new Error(
631
+ 'Required parameter sourceId was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceAlpha.'
632
+ );
633
+ }
634
+
635
+ // verify required parameter 'pagination' is not null or undefined
636
+ if (pagination === null || pagination === undefined) {
637
+ throw new Error(
638
+ 'Required parameter pagination was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceAlpha.'
639
+ );
640
+ }
641
+
642
+ if (pagination !== undefined) {
643
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
644
+ pagination,
645
+ 'PaginationInput'
646
+ );
647
+ }
648
+
649
+ (<any>Object).assign(localVarHeaderParams, options.headers);
650
+
651
+ let localVarUseFormData = false;
652
+
653
+ let localVarRequestOptions: localVarRequest.Options = {
654
+ method: 'GET',
655
+ qs: localVarQueryParameters,
656
+ headers: localVarHeaderParams,
657
+ uri: localVarPath,
658
+ useQuerystring: this._useQuerystring,
659
+ json: true,
660
+ };
661
+
662
+ let authenticationPromise = Promise.resolve();
663
+ if (this.authentications.token.accessToken) {
664
+ authenticationPromise = authenticationPromise.then(() =>
665
+ this.authentications.token.applyToRequest(
666
+ localVarRequestOptions
667
+ )
668
+ );
669
+ }
670
+ authenticationPromise = authenticationPromise.then(() =>
671
+ this.authentications.default.applyToRequest(localVarRequestOptions)
672
+ );
673
+
674
+ let interceptorPromise = authenticationPromise;
675
+ for (const interceptor of this.interceptors) {
676
+ interceptorPromise = interceptorPromise.then(() =>
677
+ interceptor(localVarRequestOptions)
678
+ );
679
+ }
680
+
681
+ return interceptorPromise.then(() => {
682
+ if (Object.keys(localVarFormParams).length) {
683
+ if (localVarUseFormData) {
684
+ (<any>localVarRequestOptions).formData = localVarFormParams;
685
+ } else {
686
+ localVarRequestOptions.form = localVarFormParams;
687
+ }
688
+ }
689
+ return new Promise<{
690
+ response: http.IncomingMessage;
691
+ body: ListSelectiveSyncsFromWarehouseAndSource200Response;
692
+ }>((resolve, reject) => {
693
+ localVarRequest(
694
+ localVarRequestOptions,
695
+ (error, response, body) => {
696
+ if (error) {
697
+ reject(error);
698
+ } else {
699
+ if (
700
+ response.statusCode &&
701
+ response.statusCode >= 200 &&
702
+ response.statusCode <= 299
703
+ ) {
704
+ body = ObjectSerializer.deserialize(
705
+ body,
706
+ 'ListSelectiveSyncsFromWarehouseAndSource200Response'
707
+ );
708
+ resolve({ response: response, body: body });
709
+ } else {
710
+ reject(
711
+ new HttpError(
712
+ response,
713
+ body,
714
+ response.statusCode
715
+ )
716
+ );
717
+ }
718
+ }
719
+ }
720
+ );
721
+ });
722
+ });
723
+ }
724
+ /**
725
+ * Returns the schema for a Warehouse, including Sources, Collections, and Properties. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
726
+ * @summary List Selective Syncs from Warehouse And Source
727
+ * @param warehouseId
728
+ * @param sourceId
729
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
730
+ */
731
+ public async listSelectiveSyncsFromWarehouseAndSourceBeta(
732
+ warehouseId: string,
733
+ sourceId: string,
734
+ pagination: PaginationInput,
735
+ options: { headers: { [name: string]: string } } = { headers: {} }
736
+ ): Promise<{
737
+ response: http.IncomingMessage;
738
+ body: ListSelectiveSyncsFromWarehouseAndSource200Response;
739
+ }> {
740
+ const localVarPath =
741
+ this.basePath +
742
+ '/warehouses/{warehouseId}/connected-sources/{sourceId}/selective-syncs'
743
+ .replace(
744
+ '{' + 'warehouseId' + '}',
745
+ encodeURIComponent(String(warehouseId))
746
+ )
747
+ .replace(
748
+ '{' + 'sourceId' + '}',
749
+ encodeURIComponent(String(sourceId))
750
+ );
751
+ let localVarQueryParameters: any = {};
752
+ let localVarHeaderParams: any = (<any>Object).assign(
753
+ {},
754
+ this._defaultHeaders
755
+ );
756
+ const produces = [
757
+ 'application/vnd.segment.v1beta+json',
758
+ 'application/json',
759
+ ];
760
+ if (produces.indexOf('application/json') >= 0) {
761
+ localVarHeaderParams.Accept = produces[0];
762
+ } else {
763
+ localVarHeaderParams.Accept = 'application/json';
764
+ }
765
+ let localVarFormParams: any = {};
766
+
767
+ // verify required parameter 'warehouseId' is not null or undefined
768
+ if (warehouseId === null || warehouseId === undefined) {
769
+ throw new Error(
770
+ 'Required parameter warehouseId was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceBeta.'
771
+ );
772
+ }
773
+
774
+ // verify required parameter 'sourceId' is not null or undefined
775
+ if (sourceId === null || sourceId === undefined) {
776
+ throw new Error(
777
+ 'Required parameter sourceId was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceBeta.'
778
+ );
779
+ }
780
+
781
+ // verify required parameter 'pagination' is not null or undefined
782
+ if (pagination === null || pagination === undefined) {
783
+ throw new Error(
784
+ 'Required parameter pagination was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceBeta.'
785
+ );
786
+ }
787
+
788
+ if (pagination !== undefined) {
789
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
790
+ pagination,
791
+ 'PaginationInput'
792
+ );
793
+ }
794
+
795
+ (<any>Object).assign(localVarHeaderParams, options.headers);
796
+
797
+ let localVarUseFormData = false;
798
+
799
+ let localVarRequestOptions: localVarRequest.Options = {
800
+ method: 'GET',
801
+ qs: localVarQueryParameters,
802
+ headers: localVarHeaderParams,
803
+ uri: localVarPath,
804
+ useQuerystring: this._useQuerystring,
805
+ json: true,
806
+ };
807
+
808
+ let authenticationPromise = Promise.resolve();
809
+ if (this.authentications.token.accessToken) {
810
+ authenticationPromise = authenticationPromise.then(() =>
811
+ this.authentications.token.applyToRequest(
812
+ localVarRequestOptions
813
+ )
814
+ );
815
+ }
816
+ authenticationPromise = authenticationPromise.then(() =>
817
+ this.authentications.default.applyToRequest(localVarRequestOptions)
818
+ );
819
+
820
+ let interceptorPromise = authenticationPromise;
821
+ for (const interceptor of this.interceptors) {
822
+ interceptorPromise = interceptorPromise.then(() =>
823
+ interceptor(localVarRequestOptions)
824
+ );
825
+ }
826
+
827
+ return interceptorPromise.then(() => {
828
+ if (Object.keys(localVarFormParams).length) {
829
+ if (localVarUseFormData) {
830
+ (<any>localVarRequestOptions).formData = localVarFormParams;
831
+ } else {
832
+ localVarRequestOptions.form = localVarFormParams;
833
+ }
834
+ }
835
+ return new Promise<{
836
+ response: http.IncomingMessage;
837
+ body: ListSelectiveSyncsFromWarehouseAndSource200Response;
838
+ }>((resolve, reject) => {
839
+ localVarRequest(
840
+ localVarRequestOptions,
841
+ (error, response, body) => {
842
+ if (error) {
843
+ reject(error);
844
+ } else {
845
+ if (
846
+ response.statusCode &&
847
+ response.statusCode >= 200 &&
848
+ response.statusCode <= 299
849
+ ) {
850
+ body = ObjectSerializer.deserialize(
851
+ body,
852
+ 'ListSelectiveSyncsFromWarehouseAndSource200Response'
853
+ );
854
+ resolve({ response: response, body: body });
855
+ } else {
856
+ reject(
857
+ new HttpError(
858
+ response,
859
+ body,
860
+ response.statusCode
861
+ )
862
+ );
863
+ }
864
+ }
865
+ }
866
+ );
867
+ });
868
+ });
869
+ }
870
+ /**
871
+ * Returns the schema for a Warehouse, including Sources, Collections, and Properties. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
872
+ * @summary List Selective Syncs from Warehouse And Source
873
+ * @param warehouseId
874
+ * @param sourceId
875
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
876
+ */
877
+ public async listSelectiveSyncsFromWarehouseAndSourceCurrent(
878
+ warehouseId: string,
879
+ sourceId: string,
880
+ pagination: PaginationInput,
881
+ options: { headers: { [name: string]: string } } = { headers: {} }
882
+ ): Promise<{
883
+ response: http.IncomingMessage;
884
+ body: ListSelectiveSyncsFromWarehouseAndSource200Response;
885
+ }> {
886
+ const localVarPath =
887
+ this.basePath +
888
+ '/warehouses/{warehouseId}/connected-sources/{sourceId}/selective-syncs'
889
+ .replace(
890
+ '{' + 'warehouseId' + '}',
891
+ encodeURIComponent(String(warehouseId))
892
+ )
893
+ .replace(
894
+ '{' + 'sourceId' + '}',
895
+ encodeURIComponent(String(sourceId))
896
+ );
897
+ let localVarQueryParameters: any = {};
898
+ let localVarHeaderParams: any = (<any>Object).assign(
899
+ {},
900
+ this._defaultHeaders
901
+ );
902
+ const produces = ['application/json'];
903
+ if (produces.indexOf('application/json') >= 0) {
904
+ localVarHeaderParams.Accept = produces[0];
905
+ } else {
906
+ localVarHeaderParams.Accept = 'application/json';
907
+ }
908
+ let localVarFormParams: any = {};
909
+
910
+ // verify required parameter 'warehouseId' is not null or undefined
911
+ if (warehouseId === null || warehouseId === undefined) {
912
+ throw new Error(
913
+ 'Required parameter warehouseId was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceCurrent.'
914
+ );
915
+ }
916
+
917
+ // verify required parameter 'sourceId' is not null or undefined
918
+ if (sourceId === null || sourceId === undefined) {
919
+ throw new Error(
920
+ 'Required parameter sourceId was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceCurrent.'
921
+ );
922
+ }
923
+
924
+ // verify required parameter 'pagination' is not null or undefined
925
+ if (pagination === null || pagination === undefined) {
926
+ throw new Error(
927
+ 'Required parameter pagination was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceCurrent.'
928
+ );
929
+ }
930
+
931
+ if (pagination !== undefined) {
932
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
933
+ pagination,
934
+ 'PaginationInput'
935
+ );
936
+ }
937
+
938
+ (<any>Object).assign(localVarHeaderParams, options.headers);
939
+
940
+ let localVarUseFormData = false;
941
+
942
+ let localVarRequestOptions: localVarRequest.Options = {
943
+ method: 'GET',
944
+ qs: localVarQueryParameters,
945
+ headers: localVarHeaderParams,
946
+ uri: localVarPath,
947
+ useQuerystring: this._useQuerystring,
948
+ json: true,
949
+ };
950
+
951
+ let authenticationPromise = Promise.resolve();
952
+ if (this.authentications.token.accessToken) {
953
+ authenticationPromise = authenticationPromise.then(() =>
954
+ this.authentications.token.applyToRequest(
955
+ localVarRequestOptions
956
+ )
957
+ );
958
+ }
959
+ authenticationPromise = authenticationPromise.then(() =>
960
+ this.authentications.default.applyToRequest(localVarRequestOptions)
961
+ );
962
+
963
+ let interceptorPromise = authenticationPromise;
964
+ for (const interceptor of this.interceptors) {
965
+ interceptorPromise = interceptorPromise.then(() =>
966
+ interceptor(localVarRequestOptions)
967
+ );
968
+ }
969
+
970
+ return interceptorPromise.then(() => {
971
+ if (Object.keys(localVarFormParams).length) {
972
+ if (localVarUseFormData) {
973
+ (<any>localVarRequestOptions).formData = localVarFormParams;
974
+ } else {
975
+ localVarRequestOptions.form = localVarFormParams;
976
+ }
977
+ }
978
+ return new Promise<{
979
+ response: http.IncomingMessage;
980
+ body: ListSelectiveSyncsFromWarehouseAndSource200Response;
981
+ }>((resolve, reject) => {
982
+ localVarRequest(
983
+ localVarRequestOptions,
984
+ (error, response, body) => {
985
+ if (error) {
986
+ reject(error);
987
+ } else {
988
+ if (
989
+ response.statusCode &&
990
+ response.statusCode >= 200 &&
991
+ response.statusCode <= 299
992
+ ) {
993
+ body = ObjectSerializer.deserialize(
994
+ body,
995
+ 'ListSelectiveSyncsFromWarehouseAndSource200Response'
996
+ );
997
+ resolve({ response: response, body: body });
998
+ } else {
999
+ reject(
1000
+ new HttpError(
1001
+ response,
1002
+ body,
1003
+ response.statusCode
1004
+ )
1005
+ );
1006
+ }
1007
+ }
1008
+ }
1009
+ );
1010
+ });
1011
+ });
1012
+ }
1013
+ /**
1014
+ * Returns the schema for a Warehouse, including Sources, Collections, and Properties. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
1015
+ * @summary List Selective Syncs from Warehouse And Source
1016
+ * @param warehouseId
1017
+ * @param sourceId
1018
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1019
+ */
1020
+ public async listSelectiveSyncsFromWarehouseAndSourceV1(
1021
+ warehouseId: string,
1022
+ sourceId: string,
1023
+ pagination: PaginationInput,
1024
+ options: { headers: { [name: string]: string } } = { headers: {} }
1025
+ ): Promise<{
1026
+ response: http.IncomingMessage;
1027
+ body: ListSelectiveSyncsFromWarehouseAndSource200Response;
1028
+ }> {
1029
+ const localVarPath =
1030
+ this.basePath +
1031
+ '/warehouses/{warehouseId}/connected-sources/{sourceId}/selective-syncs'
1032
+ .replace(
1033
+ '{' + 'warehouseId' + '}',
1034
+ encodeURIComponent(String(warehouseId))
1035
+ )
1036
+ .replace(
1037
+ '{' + 'sourceId' + '}',
1038
+ encodeURIComponent(String(sourceId))
1039
+ );
1040
+ let localVarQueryParameters: any = {};
1041
+ let localVarHeaderParams: any = (<any>Object).assign(
1042
+ {},
1043
+ this._defaultHeaders
1044
+ );
1045
+ const produces = [
1046
+ 'application/vnd.segment.v1+json',
1047
+ 'application/json',
1048
+ ];
1049
+ if (produces.indexOf('application/json') >= 0) {
1050
+ localVarHeaderParams.Accept = produces[0];
1051
+ } else {
1052
+ localVarHeaderParams.Accept = 'application/json';
1053
+ }
1054
+ let localVarFormParams: any = {};
1055
+
1056
+ // verify required parameter 'warehouseId' is not null or undefined
1057
+ if (warehouseId === null || warehouseId === undefined) {
1058
+ throw new Error(
1059
+ 'Required parameter warehouseId was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceV1.'
1060
+ );
1061
+ }
1062
+
1063
+ // verify required parameter 'sourceId' is not null or undefined
1064
+ if (sourceId === null || sourceId === undefined) {
1065
+ throw new Error(
1066
+ 'Required parameter sourceId was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceV1.'
1067
+ );
1068
+ }
1069
+
1070
+ // verify required parameter 'pagination' is not null or undefined
1071
+ if (pagination === null || pagination === undefined) {
1072
+ throw new Error(
1073
+ 'Required parameter pagination was null or undefined when calling listSelectiveSyncsFromWarehouseAndSourceV1.'
1074
+ );
1075
+ }
1076
+
1077
+ if (pagination !== undefined) {
1078
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1079
+ pagination,
1080
+ 'PaginationInput'
1081
+ );
1082
+ }
1083
+
1084
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1085
+
1086
+ let localVarUseFormData = false;
1087
+
1088
+ let localVarRequestOptions: localVarRequest.Options = {
1089
+ method: 'GET',
1090
+ qs: localVarQueryParameters,
1091
+ headers: localVarHeaderParams,
1092
+ uri: localVarPath,
1093
+ useQuerystring: this._useQuerystring,
1094
+ json: true,
1095
+ };
1096
+
1097
+ let authenticationPromise = Promise.resolve();
1098
+ if (this.authentications.token.accessToken) {
1099
+ authenticationPromise = authenticationPromise.then(() =>
1100
+ this.authentications.token.applyToRequest(
1101
+ localVarRequestOptions
1102
+ )
1103
+ );
1104
+ }
1105
+ authenticationPromise = authenticationPromise.then(() =>
1106
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1107
+ );
1108
+
1109
+ let interceptorPromise = authenticationPromise;
1110
+ for (const interceptor of this.interceptors) {
1111
+ interceptorPromise = interceptorPromise.then(() =>
1112
+ interceptor(localVarRequestOptions)
1113
+ );
1114
+ }
1115
+
1116
+ return interceptorPromise.then(() => {
1117
+ if (Object.keys(localVarFormParams).length) {
1118
+ if (localVarUseFormData) {
1119
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1120
+ } else {
1121
+ localVarRequestOptions.form = localVarFormParams;
1122
+ }
1123
+ }
1124
+ return new Promise<{
1125
+ response: http.IncomingMessage;
1126
+ body: ListSelectiveSyncsFromWarehouseAndSource200Response;
1127
+ }>((resolve, reject) => {
1128
+ localVarRequest(
1129
+ localVarRequestOptions,
1130
+ (error, response, body) => {
1131
+ if (error) {
1132
+ reject(error);
1133
+ } else {
1134
+ if (
1135
+ response.statusCode &&
1136
+ response.statusCode >= 200 &&
1137
+ response.statusCode <= 299
1138
+ ) {
1139
+ body = ObjectSerializer.deserialize(
1140
+ body,
1141
+ 'ListSelectiveSyncsFromWarehouseAndSource200Response'
1142
+ );
1143
+ resolve({ response: response, body: body });
1144
+ } else {
1145
+ reject(
1146
+ new HttpError(
1147
+ response,
1148
+ body,
1149
+ response.statusCode
1150
+ )
1151
+ );
1152
+ }
1153
+ }
1154
+ }
1155
+ );
1156
+ });
1157
+ });
1158
+ }
1159
+ /**
1160
+ * Returns the overview of syncs for every Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
1161
+ * @summary List Syncs from Warehouse
1162
+ * @param warehouseId
1163
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1164
+ */
1165
+ public async listSyncsFromWarehouseAlpha(
1166
+ warehouseId: string,
1167
+ pagination: PaginationInput,
1168
+ options: { headers: { [name: string]: string } } = { headers: {} }
1169
+ ): Promise<{
1170
+ response: http.IncomingMessage;
1171
+ body: ListSyncsFromWarehouse200Response;
1172
+ }> {
1173
+ const localVarPath =
1174
+ this.basePath +
1175
+ '/warehouses/{warehouseId}/syncs'.replace(
1176
+ '{' + 'warehouseId' + '}',
1177
+ encodeURIComponent(String(warehouseId))
1178
+ );
1179
+ let localVarQueryParameters: any = {};
1180
+ let localVarHeaderParams: any = (<any>Object).assign(
1181
+ {},
1182
+ this._defaultHeaders
1183
+ );
1184
+ const produces = [
1185
+ 'application/vnd.segment.v1alpha+json',
1186
+ 'application/json',
1187
+ ];
1188
+ if (produces.indexOf('application/json') >= 0) {
1189
+ localVarHeaderParams.Accept = produces[0];
1190
+ } else {
1191
+ localVarHeaderParams.Accept = 'application/json';
1192
+ }
1193
+ let localVarFormParams: any = {};
1194
+
1195
+ // verify required parameter 'warehouseId' is not null or undefined
1196
+ if (warehouseId === null || warehouseId === undefined) {
1197
+ throw new Error(
1198
+ 'Required parameter warehouseId was null or undefined when calling listSyncsFromWarehouseAlpha.'
1199
+ );
1200
+ }
1201
+
1202
+ // verify required parameter 'pagination' is not null or undefined
1203
+ if (pagination === null || pagination === undefined) {
1204
+ throw new Error(
1205
+ 'Required parameter pagination was null or undefined when calling listSyncsFromWarehouseAlpha.'
1206
+ );
1207
+ }
1208
+
1209
+ if (pagination !== undefined) {
1210
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1211
+ pagination,
1212
+ 'PaginationInput'
1213
+ );
1214
+ }
1215
+
1216
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1217
+
1218
+ let localVarUseFormData = false;
1219
+
1220
+ let localVarRequestOptions: localVarRequest.Options = {
1221
+ method: 'GET',
1222
+ qs: localVarQueryParameters,
1223
+ headers: localVarHeaderParams,
1224
+ uri: localVarPath,
1225
+ useQuerystring: this._useQuerystring,
1226
+ json: true,
1227
+ };
1228
+
1229
+ let authenticationPromise = Promise.resolve();
1230
+ if (this.authentications.token.accessToken) {
1231
+ authenticationPromise = authenticationPromise.then(() =>
1232
+ this.authentications.token.applyToRequest(
1233
+ localVarRequestOptions
1234
+ )
1235
+ );
1236
+ }
1237
+ authenticationPromise = authenticationPromise.then(() =>
1238
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1239
+ );
1240
+
1241
+ let interceptorPromise = authenticationPromise;
1242
+ for (const interceptor of this.interceptors) {
1243
+ interceptorPromise = interceptorPromise.then(() =>
1244
+ interceptor(localVarRequestOptions)
1245
+ );
1246
+ }
1247
+
1248
+ return interceptorPromise.then(() => {
1249
+ if (Object.keys(localVarFormParams).length) {
1250
+ if (localVarUseFormData) {
1251
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1252
+ } else {
1253
+ localVarRequestOptions.form = localVarFormParams;
1254
+ }
1255
+ }
1256
+ return new Promise<{
1257
+ response: http.IncomingMessage;
1258
+ body: ListSyncsFromWarehouse200Response;
1259
+ }>((resolve, reject) => {
1260
+ localVarRequest(
1261
+ localVarRequestOptions,
1262
+ (error, response, body) => {
1263
+ if (error) {
1264
+ reject(error);
1265
+ } else {
1266
+ if (
1267
+ response.statusCode &&
1268
+ response.statusCode >= 200 &&
1269
+ response.statusCode <= 299
1270
+ ) {
1271
+ body = ObjectSerializer.deserialize(
1272
+ body,
1273
+ 'ListSyncsFromWarehouse200Response'
1274
+ );
1275
+ resolve({ response: response, body: body });
1276
+ } else {
1277
+ reject(
1278
+ new HttpError(
1279
+ response,
1280
+ body,
1281
+ response.statusCode
1282
+ )
1283
+ );
1284
+ }
1285
+ }
1286
+ }
1287
+ );
1288
+ });
1289
+ });
1290
+ }
1291
+ /**
1292
+ * Returns the overview of syncs for a Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
1293
+ * @summary List Syncs from Warehouse And Source
1294
+ * @param warehouseId
1295
+ * @param sourceId
1296
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1297
+ */
1298
+ public async listSyncsFromWarehouseAndSourceAlpha(
1299
+ warehouseId: string,
1300
+ sourceId: string,
1301
+ pagination: PaginationInput,
1302
+ options: { headers: { [name: string]: string } } = { headers: {} }
1303
+ ): Promise<{
1304
+ response: http.IncomingMessage;
1305
+ body: ListSyncsFromWarehouseAndSource200Response;
1306
+ }> {
1307
+ const localVarPath =
1308
+ this.basePath +
1309
+ '/warehouses/{warehouseId}/connected-sources/{sourceId}/syncs'
1310
+ .replace(
1311
+ '{' + 'warehouseId' + '}',
1312
+ encodeURIComponent(String(warehouseId))
1313
+ )
1314
+ .replace(
1315
+ '{' + 'sourceId' + '}',
1316
+ encodeURIComponent(String(sourceId))
1317
+ );
1318
+ let localVarQueryParameters: any = {};
1319
+ let localVarHeaderParams: any = (<any>Object).assign(
1320
+ {},
1321
+ this._defaultHeaders
1322
+ );
1323
+ const produces = [
1324
+ 'application/vnd.segment.v1alpha+json',
1325
+ 'application/json',
1326
+ ];
1327
+ if (produces.indexOf('application/json') >= 0) {
1328
+ localVarHeaderParams.Accept = produces[0];
1329
+ } else {
1330
+ localVarHeaderParams.Accept = 'application/json';
1331
+ }
1332
+ let localVarFormParams: any = {};
1333
+
1334
+ // verify required parameter 'warehouseId' is not null or undefined
1335
+ if (warehouseId === null || warehouseId === undefined) {
1336
+ throw new Error(
1337
+ 'Required parameter warehouseId was null or undefined when calling listSyncsFromWarehouseAndSourceAlpha.'
1338
+ );
1339
+ }
1340
+
1341
+ // verify required parameter 'sourceId' is not null or undefined
1342
+ if (sourceId === null || sourceId === undefined) {
1343
+ throw new Error(
1344
+ 'Required parameter sourceId was null or undefined when calling listSyncsFromWarehouseAndSourceAlpha.'
1345
+ );
1346
+ }
1347
+
1348
+ // verify required parameter 'pagination' is not null or undefined
1349
+ if (pagination === null || pagination === undefined) {
1350
+ throw new Error(
1351
+ 'Required parameter pagination was null or undefined when calling listSyncsFromWarehouseAndSourceAlpha.'
1352
+ );
1353
+ }
1354
+
1355
+ if (pagination !== undefined) {
1356
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1357
+ pagination,
1358
+ 'PaginationInput'
1359
+ );
1360
+ }
1361
+
1362
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1363
+
1364
+ let localVarUseFormData = false;
1365
+
1366
+ let localVarRequestOptions: localVarRequest.Options = {
1367
+ method: 'GET',
1368
+ qs: localVarQueryParameters,
1369
+ headers: localVarHeaderParams,
1370
+ uri: localVarPath,
1371
+ useQuerystring: this._useQuerystring,
1372
+ json: true,
1373
+ };
1374
+
1375
+ let authenticationPromise = Promise.resolve();
1376
+ if (this.authentications.token.accessToken) {
1377
+ authenticationPromise = authenticationPromise.then(() =>
1378
+ this.authentications.token.applyToRequest(
1379
+ localVarRequestOptions
1380
+ )
1381
+ );
1382
+ }
1383
+ authenticationPromise = authenticationPromise.then(() =>
1384
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1385
+ );
1386
+
1387
+ let interceptorPromise = authenticationPromise;
1388
+ for (const interceptor of this.interceptors) {
1389
+ interceptorPromise = interceptorPromise.then(() =>
1390
+ interceptor(localVarRequestOptions)
1391
+ );
1392
+ }
1393
+
1394
+ return interceptorPromise.then(() => {
1395
+ if (Object.keys(localVarFormParams).length) {
1396
+ if (localVarUseFormData) {
1397
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1398
+ } else {
1399
+ localVarRequestOptions.form = localVarFormParams;
1400
+ }
1401
+ }
1402
+ return new Promise<{
1403
+ response: http.IncomingMessage;
1404
+ body: ListSyncsFromWarehouseAndSource200Response;
1405
+ }>((resolve, reject) => {
1406
+ localVarRequest(
1407
+ localVarRequestOptions,
1408
+ (error, response, body) => {
1409
+ if (error) {
1410
+ reject(error);
1411
+ } else {
1412
+ if (
1413
+ response.statusCode &&
1414
+ response.statusCode >= 200 &&
1415
+ response.statusCode <= 299
1416
+ ) {
1417
+ body = ObjectSerializer.deserialize(
1418
+ body,
1419
+ 'ListSyncsFromWarehouseAndSource200Response'
1420
+ );
1421
+ resolve({ response: response, body: body });
1422
+ } else {
1423
+ reject(
1424
+ new HttpError(
1425
+ response,
1426
+ body,
1427
+ response.statusCode
1428
+ )
1429
+ );
1430
+ }
1431
+ }
1432
+ }
1433
+ );
1434
+ });
1435
+ });
1436
+ }
1437
+ /**
1438
+ * Returns the overview of syncs for a Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
1439
+ * @summary List Syncs from Warehouse And Source
1440
+ * @param warehouseId
1441
+ * @param sourceId
1442
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1443
+ */
1444
+ public async listSyncsFromWarehouseAndSourceBeta(
1445
+ warehouseId: string,
1446
+ sourceId: string,
1447
+ pagination: PaginationInput,
1448
+ options: { headers: { [name: string]: string } } = { headers: {} }
1449
+ ): Promise<{
1450
+ response: http.IncomingMessage;
1451
+ body: ListSyncsFromWarehouseAndSource200Response;
1452
+ }> {
1453
+ const localVarPath =
1454
+ this.basePath +
1455
+ '/warehouses/{warehouseId}/connected-sources/{sourceId}/syncs'
1456
+ .replace(
1457
+ '{' + 'warehouseId' + '}',
1458
+ encodeURIComponent(String(warehouseId))
1459
+ )
1460
+ .replace(
1461
+ '{' + 'sourceId' + '}',
1462
+ encodeURIComponent(String(sourceId))
1463
+ );
1464
+ let localVarQueryParameters: any = {};
1465
+ let localVarHeaderParams: any = (<any>Object).assign(
1466
+ {},
1467
+ this._defaultHeaders
1468
+ );
1469
+ const produces = [
1470
+ 'application/vnd.segment.v1beta+json',
1471
+ 'application/json',
1472
+ ];
1473
+ if (produces.indexOf('application/json') >= 0) {
1474
+ localVarHeaderParams.Accept = produces[0];
1475
+ } else {
1476
+ localVarHeaderParams.Accept = 'application/json';
1477
+ }
1478
+ let localVarFormParams: any = {};
1479
+
1480
+ // verify required parameter 'warehouseId' is not null or undefined
1481
+ if (warehouseId === null || warehouseId === undefined) {
1482
+ throw new Error(
1483
+ 'Required parameter warehouseId was null or undefined when calling listSyncsFromWarehouseAndSourceBeta.'
1484
+ );
1485
+ }
1486
+
1487
+ // verify required parameter 'sourceId' is not null or undefined
1488
+ if (sourceId === null || sourceId === undefined) {
1489
+ throw new Error(
1490
+ 'Required parameter sourceId was null or undefined when calling listSyncsFromWarehouseAndSourceBeta.'
1491
+ );
1492
+ }
1493
+
1494
+ // verify required parameter 'pagination' is not null or undefined
1495
+ if (pagination === null || pagination === undefined) {
1496
+ throw new Error(
1497
+ 'Required parameter pagination was null or undefined when calling listSyncsFromWarehouseAndSourceBeta.'
1498
+ );
1499
+ }
1500
+
1501
+ if (pagination !== undefined) {
1502
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1503
+ pagination,
1504
+ 'PaginationInput'
1505
+ );
1506
+ }
1507
+
1508
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1509
+
1510
+ let localVarUseFormData = false;
1511
+
1512
+ let localVarRequestOptions: localVarRequest.Options = {
1513
+ method: 'GET',
1514
+ qs: localVarQueryParameters,
1515
+ headers: localVarHeaderParams,
1516
+ uri: localVarPath,
1517
+ useQuerystring: this._useQuerystring,
1518
+ json: true,
1519
+ };
1520
+
1521
+ let authenticationPromise = Promise.resolve();
1522
+ if (this.authentications.token.accessToken) {
1523
+ authenticationPromise = authenticationPromise.then(() =>
1524
+ this.authentications.token.applyToRequest(
1525
+ localVarRequestOptions
1526
+ )
1527
+ );
1528
+ }
1529
+ authenticationPromise = authenticationPromise.then(() =>
1530
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1531
+ );
1532
+
1533
+ let interceptorPromise = authenticationPromise;
1534
+ for (const interceptor of this.interceptors) {
1535
+ interceptorPromise = interceptorPromise.then(() =>
1536
+ interceptor(localVarRequestOptions)
1537
+ );
1538
+ }
1539
+
1540
+ return interceptorPromise.then(() => {
1541
+ if (Object.keys(localVarFormParams).length) {
1542
+ if (localVarUseFormData) {
1543
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1544
+ } else {
1545
+ localVarRequestOptions.form = localVarFormParams;
1546
+ }
1547
+ }
1548
+ return new Promise<{
1549
+ response: http.IncomingMessage;
1550
+ body: ListSyncsFromWarehouseAndSource200Response;
1551
+ }>((resolve, reject) => {
1552
+ localVarRequest(
1553
+ localVarRequestOptions,
1554
+ (error, response, body) => {
1555
+ if (error) {
1556
+ reject(error);
1557
+ } else {
1558
+ if (
1559
+ response.statusCode &&
1560
+ response.statusCode >= 200 &&
1561
+ response.statusCode <= 299
1562
+ ) {
1563
+ body = ObjectSerializer.deserialize(
1564
+ body,
1565
+ 'ListSyncsFromWarehouseAndSource200Response'
1566
+ );
1567
+ resolve({ response: response, body: body });
1568
+ } else {
1569
+ reject(
1570
+ new HttpError(
1571
+ response,
1572
+ body,
1573
+ response.statusCode
1574
+ )
1575
+ );
1576
+ }
1577
+ }
1578
+ }
1579
+ );
1580
+ });
1581
+ });
1582
+ }
1583
+ /**
1584
+ * Returns the overview of syncs for a Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
1585
+ * @summary List Syncs from Warehouse And Source
1586
+ * @param warehouseId
1587
+ * @param sourceId
1588
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1589
+ */
1590
+ public async listSyncsFromWarehouseAndSourceCurrent(
1591
+ warehouseId: string,
1592
+ sourceId: string,
1593
+ pagination: PaginationInput,
1594
+ options: { headers: { [name: string]: string } } = { headers: {} }
1595
+ ): Promise<{
1596
+ response: http.IncomingMessage;
1597
+ body: ListSyncsFromWarehouseAndSource200Response;
1598
+ }> {
1599
+ const localVarPath =
1600
+ this.basePath +
1601
+ '/warehouses/{warehouseId}/connected-sources/{sourceId}/syncs'
1602
+ .replace(
1603
+ '{' + 'warehouseId' + '}',
1604
+ encodeURIComponent(String(warehouseId))
1605
+ )
1606
+ .replace(
1607
+ '{' + 'sourceId' + '}',
1608
+ encodeURIComponent(String(sourceId))
1609
+ );
1610
+ let localVarQueryParameters: any = {};
1611
+ let localVarHeaderParams: any = (<any>Object).assign(
1612
+ {},
1613
+ this._defaultHeaders
1614
+ );
1615
+ const produces = ['application/json'];
1616
+ if (produces.indexOf('application/json') >= 0) {
1617
+ localVarHeaderParams.Accept = produces[0];
1618
+ } else {
1619
+ localVarHeaderParams.Accept = 'application/json';
1620
+ }
1621
+ let localVarFormParams: any = {};
1622
+
1623
+ // verify required parameter 'warehouseId' is not null or undefined
1624
+ if (warehouseId === null || warehouseId === undefined) {
1625
+ throw new Error(
1626
+ 'Required parameter warehouseId was null or undefined when calling listSyncsFromWarehouseAndSourceCurrent.'
1627
+ );
1628
+ }
1629
+
1630
+ // verify required parameter 'sourceId' is not null or undefined
1631
+ if (sourceId === null || sourceId === undefined) {
1632
+ throw new Error(
1633
+ 'Required parameter sourceId was null or undefined when calling listSyncsFromWarehouseAndSourceCurrent.'
1634
+ );
1635
+ }
1636
+
1637
+ // verify required parameter 'pagination' is not null or undefined
1638
+ if (pagination === null || pagination === undefined) {
1639
+ throw new Error(
1640
+ 'Required parameter pagination was null or undefined when calling listSyncsFromWarehouseAndSourceCurrent.'
1641
+ );
1642
+ }
1643
+
1644
+ if (pagination !== undefined) {
1645
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1646
+ pagination,
1647
+ 'PaginationInput'
1648
+ );
1649
+ }
1650
+
1651
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1652
+
1653
+ let localVarUseFormData = false;
1654
+
1655
+ let localVarRequestOptions: localVarRequest.Options = {
1656
+ method: 'GET',
1657
+ qs: localVarQueryParameters,
1658
+ headers: localVarHeaderParams,
1659
+ uri: localVarPath,
1660
+ useQuerystring: this._useQuerystring,
1661
+ json: true,
1662
+ };
1663
+
1664
+ let authenticationPromise = Promise.resolve();
1665
+ if (this.authentications.token.accessToken) {
1666
+ authenticationPromise = authenticationPromise.then(() =>
1667
+ this.authentications.token.applyToRequest(
1668
+ localVarRequestOptions
1669
+ )
1670
+ );
1671
+ }
1672
+ authenticationPromise = authenticationPromise.then(() =>
1673
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1674
+ );
1675
+
1676
+ let interceptorPromise = authenticationPromise;
1677
+ for (const interceptor of this.interceptors) {
1678
+ interceptorPromise = interceptorPromise.then(() =>
1679
+ interceptor(localVarRequestOptions)
1680
+ );
1681
+ }
1682
+
1683
+ return interceptorPromise.then(() => {
1684
+ if (Object.keys(localVarFormParams).length) {
1685
+ if (localVarUseFormData) {
1686
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1687
+ } else {
1688
+ localVarRequestOptions.form = localVarFormParams;
1689
+ }
1690
+ }
1691
+ return new Promise<{
1692
+ response: http.IncomingMessage;
1693
+ body: ListSyncsFromWarehouseAndSource200Response;
1694
+ }>((resolve, reject) => {
1695
+ localVarRequest(
1696
+ localVarRequestOptions,
1697
+ (error, response, body) => {
1698
+ if (error) {
1699
+ reject(error);
1700
+ } else {
1701
+ if (
1702
+ response.statusCode &&
1703
+ response.statusCode >= 200 &&
1704
+ response.statusCode <= 299
1705
+ ) {
1706
+ body = ObjectSerializer.deserialize(
1707
+ body,
1708
+ 'ListSyncsFromWarehouseAndSource200Response'
1709
+ );
1710
+ resolve({ response: response, body: body });
1711
+ } else {
1712
+ reject(
1713
+ new HttpError(
1714
+ response,
1715
+ body,
1716
+ response.statusCode
1717
+ )
1718
+ );
1719
+ }
1720
+ }
1721
+ }
1722
+ );
1723
+ });
1724
+ });
1725
+ }
1726
+ /**
1727
+ * Returns the overview of syncs for a Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
1728
+ * @summary List Syncs from Warehouse And Source
1729
+ * @param warehouseId
1730
+ * @param sourceId
1731
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1732
+ */
1733
+ public async listSyncsFromWarehouseAndSourceV1(
1734
+ warehouseId: string,
1735
+ sourceId: string,
1736
+ pagination: PaginationInput,
1737
+ options: { headers: { [name: string]: string } } = { headers: {} }
1738
+ ): Promise<{
1739
+ response: http.IncomingMessage;
1740
+ body: ListSyncsFromWarehouseAndSource200Response;
1741
+ }> {
1742
+ const localVarPath =
1743
+ this.basePath +
1744
+ '/warehouses/{warehouseId}/connected-sources/{sourceId}/syncs'
1745
+ .replace(
1746
+ '{' + 'warehouseId' + '}',
1747
+ encodeURIComponent(String(warehouseId))
1748
+ )
1749
+ .replace(
1750
+ '{' + 'sourceId' + '}',
1751
+ encodeURIComponent(String(sourceId))
1752
+ );
1753
+ let localVarQueryParameters: any = {};
1754
+ let localVarHeaderParams: any = (<any>Object).assign(
1755
+ {},
1756
+ this._defaultHeaders
1757
+ );
1758
+ const produces = [
1759
+ 'application/vnd.segment.v1+json',
1760
+ 'application/json',
1761
+ ];
1762
+ if (produces.indexOf('application/json') >= 0) {
1763
+ localVarHeaderParams.Accept = produces[0];
1764
+ } else {
1765
+ localVarHeaderParams.Accept = 'application/json';
1766
+ }
1767
+ let localVarFormParams: any = {};
1768
+
1769
+ // verify required parameter 'warehouseId' is not null or undefined
1770
+ if (warehouseId === null || warehouseId === undefined) {
1771
+ throw new Error(
1772
+ 'Required parameter warehouseId was null or undefined when calling listSyncsFromWarehouseAndSourceV1.'
1773
+ );
1774
+ }
1775
+
1776
+ // verify required parameter 'sourceId' is not null or undefined
1777
+ if (sourceId === null || sourceId === undefined) {
1778
+ throw new Error(
1779
+ 'Required parameter sourceId was null or undefined when calling listSyncsFromWarehouseAndSourceV1.'
1780
+ );
1781
+ }
1782
+
1783
+ // verify required parameter 'pagination' is not null or undefined
1784
+ if (pagination === null || pagination === undefined) {
1785
+ throw new Error(
1786
+ 'Required parameter pagination was null or undefined when calling listSyncsFromWarehouseAndSourceV1.'
1787
+ );
1788
+ }
1789
+
1790
+ if (pagination !== undefined) {
1791
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1792
+ pagination,
1793
+ 'PaginationInput'
1794
+ );
1795
+ }
1796
+
1797
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1798
+
1799
+ let localVarUseFormData = false;
1800
+
1801
+ let localVarRequestOptions: localVarRequest.Options = {
1802
+ method: 'GET',
1803
+ qs: localVarQueryParameters,
1804
+ headers: localVarHeaderParams,
1805
+ uri: localVarPath,
1806
+ useQuerystring: this._useQuerystring,
1807
+ json: true,
1808
+ };
1809
+
1810
+ let authenticationPromise = Promise.resolve();
1811
+ if (this.authentications.token.accessToken) {
1812
+ authenticationPromise = authenticationPromise.then(() =>
1813
+ this.authentications.token.applyToRequest(
1814
+ localVarRequestOptions
1815
+ )
1816
+ );
1817
+ }
1818
+ authenticationPromise = authenticationPromise.then(() =>
1819
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1820
+ );
1821
+
1822
+ let interceptorPromise = authenticationPromise;
1823
+ for (const interceptor of this.interceptors) {
1824
+ interceptorPromise = interceptorPromise.then(() =>
1825
+ interceptor(localVarRequestOptions)
1826
+ );
1827
+ }
1828
+
1829
+ return interceptorPromise.then(() => {
1830
+ if (Object.keys(localVarFormParams).length) {
1831
+ if (localVarUseFormData) {
1832
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1833
+ } else {
1834
+ localVarRequestOptions.form = localVarFormParams;
1835
+ }
1836
+ }
1837
+ return new Promise<{
1838
+ response: http.IncomingMessage;
1839
+ body: ListSyncsFromWarehouseAndSource200Response;
1840
+ }>((resolve, reject) => {
1841
+ localVarRequest(
1842
+ localVarRequestOptions,
1843
+ (error, response, body) => {
1844
+ if (error) {
1845
+ reject(error);
1846
+ } else {
1847
+ if (
1848
+ response.statusCode &&
1849
+ response.statusCode >= 200 &&
1850
+ response.statusCode <= 299
1851
+ ) {
1852
+ body = ObjectSerializer.deserialize(
1853
+ body,
1854
+ 'ListSyncsFromWarehouseAndSource200Response'
1855
+ );
1856
+ resolve({ response: response, body: body });
1857
+ } else {
1858
+ reject(
1859
+ new HttpError(
1860
+ response,
1861
+ body,
1862
+ response.statusCode
1863
+ )
1864
+ );
1865
+ }
1866
+ }
1867
+ }
1868
+ );
1869
+ });
1870
+ });
1871
+ }
1872
+ /**
1873
+ * Returns the overview of syncs for every Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
1874
+ * @summary List Syncs from Warehouse
1875
+ * @param warehouseId
1876
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1877
+ */
1878
+ public async listSyncsFromWarehouseBeta(
1879
+ warehouseId: string,
1880
+ pagination: PaginationInput,
1881
+ options: { headers: { [name: string]: string } } = { headers: {} }
1882
+ ): Promise<{
1883
+ response: http.IncomingMessage;
1884
+ body: ListSyncsFromWarehouse200Response;
1885
+ }> {
1886
+ const localVarPath =
1887
+ this.basePath +
1888
+ '/warehouses/{warehouseId}/syncs'.replace(
1889
+ '{' + 'warehouseId' + '}',
1890
+ encodeURIComponent(String(warehouseId))
1891
+ );
1892
+ let localVarQueryParameters: any = {};
1893
+ let localVarHeaderParams: any = (<any>Object).assign(
1894
+ {},
1895
+ this._defaultHeaders
1896
+ );
1897
+ const produces = [
1898
+ 'application/vnd.segment.v1beta+json',
1899
+ 'application/json',
1900
+ ];
1901
+ if (produces.indexOf('application/json') >= 0) {
1902
+ localVarHeaderParams.Accept = produces[0];
1903
+ } else {
1904
+ localVarHeaderParams.Accept = 'application/json';
1905
+ }
1906
+ let localVarFormParams: any = {};
1907
+
1908
+ // verify required parameter 'warehouseId' is not null or undefined
1909
+ if (warehouseId === null || warehouseId === undefined) {
1910
+ throw new Error(
1911
+ 'Required parameter warehouseId was null or undefined when calling listSyncsFromWarehouseBeta.'
1912
+ );
1913
+ }
1914
+
1915
+ // verify required parameter 'pagination' is not null or undefined
1916
+ if (pagination === null || pagination === undefined) {
1917
+ throw new Error(
1918
+ 'Required parameter pagination was null or undefined when calling listSyncsFromWarehouseBeta.'
1919
+ );
1920
+ }
1921
+
1922
+ if (pagination !== undefined) {
1923
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1924
+ pagination,
1925
+ 'PaginationInput'
1926
+ );
1927
+ }
1928
+
1929
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1930
+
1931
+ let localVarUseFormData = false;
1932
+
1933
+ let localVarRequestOptions: localVarRequest.Options = {
1934
+ method: 'GET',
1935
+ qs: localVarQueryParameters,
1936
+ headers: localVarHeaderParams,
1937
+ uri: localVarPath,
1938
+ useQuerystring: this._useQuerystring,
1939
+ json: true,
1940
+ };
1941
+
1942
+ let authenticationPromise = Promise.resolve();
1943
+ if (this.authentications.token.accessToken) {
1944
+ authenticationPromise = authenticationPromise.then(() =>
1945
+ this.authentications.token.applyToRequest(
1946
+ localVarRequestOptions
1947
+ )
1948
+ );
1949
+ }
1950
+ authenticationPromise = authenticationPromise.then(() =>
1951
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1952
+ );
1953
+
1954
+ let interceptorPromise = authenticationPromise;
1955
+ for (const interceptor of this.interceptors) {
1956
+ interceptorPromise = interceptorPromise.then(() =>
1957
+ interceptor(localVarRequestOptions)
1958
+ );
1959
+ }
1960
+
1961
+ return interceptorPromise.then(() => {
1962
+ if (Object.keys(localVarFormParams).length) {
1963
+ if (localVarUseFormData) {
1964
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1965
+ } else {
1966
+ localVarRequestOptions.form = localVarFormParams;
1967
+ }
1968
+ }
1969
+ return new Promise<{
1970
+ response: http.IncomingMessage;
1971
+ body: ListSyncsFromWarehouse200Response;
1972
+ }>((resolve, reject) => {
1973
+ localVarRequest(
1974
+ localVarRequestOptions,
1975
+ (error, response, body) => {
1976
+ if (error) {
1977
+ reject(error);
1978
+ } else {
1979
+ if (
1980
+ response.statusCode &&
1981
+ response.statusCode >= 200 &&
1982
+ response.statusCode <= 299
1983
+ ) {
1984
+ body = ObjectSerializer.deserialize(
1985
+ body,
1986
+ 'ListSyncsFromWarehouse200Response'
1987
+ );
1988
+ resolve({ response: response, body: body });
1989
+ } else {
1990
+ reject(
1991
+ new HttpError(
1992
+ response,
1993
+ body,
1994
+ response.statusCode
1995
+ )
1996
+ );
1997
+ }
1998
+ }
1999
+ }
2000
+ );
2001
+ });
2002
+ });
2003
+ }
2004
+ /**
2005
+ * Returns the overview of syncs for every Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
2006
+ * @summary List Syncs from Warehouse
2007
+ * @param warehouseId
2008
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
2009
+ */
2010
+ public async listSyncsFromWarehouseCurrent(
2011
+ warehouseId: string,
2012
+ pagination: PaginationInput,
2013
+ options: { headers: { [name: string]: string } } = { headers: {} }
2014
+ ): Promise<{
2015
+ response: http.IncomingMessage;
2016
+ body: ListSyncsFromWarehouse200Response;
2017
+ }> {
2018
+ const localVarPath =
2019
+ this.basePath +
2020
+ '/warehouses/{warehouseId}/syncs'.replace(
2021
+ '{' + 'warehouseId' + '}',
2022
+ encodeURIComponent(String(warehouseId))
2023
+ );
2024
+ let localVarQueryParameters: any = {};
2025
+ let localVarHeaderParams: any = (<any>Object).assign(
2026
+ {},
2027
+ this._defaultHeaders
2028
+ );
2029
+ const produces = ['application/json'];
2030
+ if (produces.indexOf('application/json') >= 0) {
2031
+ localVarHeaderParams.Accept = produces[0];
2032
+ } else {
2033
+ localVarHeaderParams.Accept = 'application/json';
2034
+ }
2035
+ let localVarFormParams: any = {};
2036
+
2037
+ // verify required parameter 'warehouseId' is not null or undefined
2038
+ if (warehouseId === null || warehouseId === undefined) {
2039
+ throw new Error(
2040
+ 'Required parameter warehouseId was null or undefined when calling listSyncsFromWarehouseCurrent.'
2041
+ );
2042
+ }
2043
+
2044
+ // verify required parameter 'pagination' is not null or undefined
2045
+ if (pagination === null || pagination === undefined) {
2046
+ throw new Error(
2047
+ 'Required parameter pagination was null or undefined when calling listSyncsFromWarehouseCurrent.'
2048
+ );
2049
+ }
2050
+
2051
+ if (pagination !== undefined) {
2052
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
2053
+ pagination,
2054
+ 'PaginationInput'
2055
+ );
2056
+ }
2057
+
2058
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2059
+
2060
+ let localVarUseFormData = false;
2061
+
2062
+ let localVarRequestOptions: localVarRequest.Options = {
2063
+ method: 'GET',
2064
+ qs: localVarQueryParameters,
2065
+ headers: localVarHeaderParams,
2066
+ uri: localVarPath,
2067
+ useQuerystring: this._useQuerystring,
2068
+ json: true,
2069
+ };
2070
+
2071
+ let authenticationPromise = Promise.resolve();
2072
+ if (this.authentications.token.accessToken) {
2073
+ authenticationPromise = authenticationPromise.then(() =>
2074
+ this.authentications.token.applyToRequest(
2075
+ localVarRequestOptions
2076
+ )
2077
+ );
2078
+ }
2079
+ authenticationPromise = authenticationPromise.then(() =>
2080
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2081
+ );
2082
+
2083
+ let interceptorPromise = authenticationPromise;
2084
+ for (const interceptor of this.interceptors) {
2085
+ interceptorPromise = interceptorPromise.then(() =>
2086
+ interceptor(localVarRequestOptions)
2087
+ );
2088
+ }
2089
+
2090
+ return interceptorPromise.then(() => {
2091
+ if (Object.keys(localVarFormParams).length) {
2092
+ if (localVarUseFormData) {
2093
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2094
+ } else {
2095
+ localVarRequestOptions.form = localVarFormParams;
2096
+ }
2097
+ }
2098
+ return new Promise<{
2099
+ response: http.IncomingMessage;
2100
+ body: ListSyncsFromWarehouse200Response;
2101
+ }>((resolve, reject) => {
2102
+ localVarRequest(
2103
+ localVarRequestOptions,
2104
+ (error, response, body) => {
2105
+ if (error) {
2106
+ reject(error);
2107
+ } else {
2108
+ if (
2109
+ response.statusCode &&
2110
+ response.statusCode >= 200 &&
2111
+ response.statusCode <= 299
2112
+ ) {
2113
+ body = ObjectSerializer.deserialize(
2114
+ body,
2115
+ 'ListSyncsFromWarehouse200Response'
2116
+ );
2117
+ resolve({ response: response, body: body });
2118
+ } else {
2119
+ reject(
2120
+ new HttpError(
2121
+ response,
2122
+ body,
2123
+ response.statusCode
2124
+ )
2125
+ );
2126
+ }
2127
+ }
2128
+ }
2129
+ );
2130
+ });
2131
+ });
2132
+ }
2133
+ /**
2134
+ * Returns the overview of syncs for every Source connected to a Warehouse. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
2135
+ * @summary List Syncs from Warehouse
2136
+ * @param warehouseId
2137
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
2138
+ */
2139
+ public async listSyncsFromWarehouseV1(
2140
+ warehouseId: string,
2141
+ pagination: PaginationInput,
2142
+ options: { headers: { [name: string]: string } } = { headers: {} }
2143
+ ): Promise<{
2144
+ response: http.IncomingMessage;
2145
+ body: ListSyncsFromWarehouse200Response;
2146
+ }> {
2147
+ const localVarPath =
2148
+ this.basePath +
2149
+ '/warehouses/{warehouseId}/syncs'.replace(
2150
+ '{' + 'warehouseId' + '}',
2151
+ encodeURIComponent(String(warehouseId))
2152
+ );
2153
+ let localVarQueryParameters: any = {};
2154
+ let localVarHeaderParams: any = (<any>Object).assign(
2155
+ {},
2156
+ this._defaultHeaders
2157
+ );
2158
+ const produces = [
2159
+ 'application/vnd.segment.v1+json',
2160
+ 'application/json',
2161
+ ];
2162
+ if (produces.indexOf('application/json') >= 0) {
2163
+ localVarHeaderParams.Accept = produces[0];
2164
+ } else {
2165
+ localVarHeaderParams.Accept = 'application/json';
2166
+ }
2167
+ let localVarFormParams: any = {};
2168
+
2169
+ // verify required parameter 'warehouseId' is not null or undefined
2170
+ if (warehouseId === null || warehouseId === undefined) {
2171
+ throw new Error(
2172
+ 'Required parameter warehouseId was null or undefined when calling listSyncsFromWarehouseV1.'
2173
+ );
2174
+ }
2175
+
2176
+ // verify required parameter 'pagination' is not null or undefined
2177
+ if (pagination === null || pagination === undefined) {
2178
+ throw new Error(
2179
+ 'Required parameter pagination was null or undefined when calling listSyncsFromWarehouseV1.'
2180
+ );
2181
+ }
2182
+
2183
+ if (pagination !== undefined) {
2184
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
2185
+ pagination,
2186
+ 'PaginationInput'
2187
+ );
2188
+ }
2189
+
2190
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2191
+
2192
+ let localVarUseFormData = false;
2193
+
2194
+ let localVarRequestOptions: localVarRequest.Options = {
2195
+ method: 'GET',
2196
+ qs: localVarQueryParameters,
2197
+ headers: localVarHeaderParams,
2198
+ uri: localVarPath,
2199
+ useQuerystring: this._useQuerystring,
2200
+ json: true,
2201
+ };
2202
+
2203
+ let authenticationPromise = Promise.resolve();
2204
+ if (this.authentications.token.accessToken) {
2205
+ authenticationPromise = authenticationPromise.then(() =>
2206
+ this.authentications.token.applyToRequest(
2207
+ localVarRequestOptions
2208
+ )
2209
+ );
2210
+ }
2211
+ authenticationPromise = authenticationPromise.then(() =>
2212
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2213
+ );
2214
+
2215
+ let interceptorPromise = authenticationPromise;
2216
+ for (const interceptor of this.interceptors) {
2217
+ interceptorPromise = interceptorPromise.then(() =>
2218
+ interceptor(localVarRequestOptions)
2219
+ );
2220
+ }
2221
+
2222
+ return interceptorPromise.then(() => {
2223
+ if (Object.keys(localVarFormParams).length) {
2224
+ if (localVarUseFormData) {
2225
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2226
+ } else {
2227
+ localVarRequestOptions.form = localVarFormParams;
2228
+ }
2229
+ }
2230
+ return new Promise<{
2231
+ response: http.IncomingMessage;
2232
+ body: ListSyncsFromWarehouse200Response;
2233
+ }>((resolve, reject) => {
2234
+ localVarRequest(
2235
+ localVarRequestOptions,
2236
+ (error, response, body) => {
2237
+ if (error) {
2238
+ reject(error);
2239
+ } else {
2240
+ if (
2241
+ response.statusCode &&
2242
+ response.statusCode >= 200 &&
2243
+ response.statusCode <= 299
2244
+ ) {
2245
+ body = ObjectSerializer.deserialize(
2246
+ body,
2247
+ 'ListSyncsFromWarehouse200Response'
2248
+ );
2249
+ resolve({ response: response, body: body });
2250
+ } else {
2251
+ reject(
2252
+ new HttpError(
2253
+ response,
2254
+ body,
2255
+ response.statusCode
2256
+ )
2257
+ );
2258
+ }
2259
+ }
2260
+ }
2261
+ );
2262
+ });
2263
+ });
2264
+ }
2265
+ /**
2266
+ * Updates the advanced sync schedule for a Warehouse, replacing the sync schedule with a new schedule. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
2267
+ * @summary Replace Advanced Sync Schedule for Warehouse
2268
+ * @param warehouseId
2269
+ * @param ReplaceAdvancedSyncScheduleForWarehouseV1Input
2270
+ */
2271
+ public async replaceAdvancedSyncScheduleForWarehouseAlpha(
2272
+ warehouseId: string,
2273
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input: ReplaceAdvancedSyncScheduleForWarehouseV1Input,
2274
+ options: { headers: { [name: string]: string } } = { headers: {} }
2275
+ ): Promise<{
2276
+ response: http.IncomingMessage;
2277
+ body: ReplaceAdvancedSyncScheduleForWarehouse200Response;
2278
+ }> {
2279
+ const localVarPath =
2280
+ this.basePath +
2281
+ '/warehouses/{warehouseId}/advanced-sync-schedule'.replace(
2282
+ '{' + 'warehouseId' + '}',
2283
+ encodeURIComponent(String(warehouseId))
2284
+ );
2285
+ let localVarQueryParameters: any = {};
2286
+ let localVarHeaderParams: any = (<any>Object).assign(
2287
+ {},
2288
+ this._defaultHeaders
2289
+ );
2290
+ const produces = [
2291
+ 'application/vnd.segment.v1alpha+json',
2292
+ 'application/json',
2293
+ ];
2294
+ if (produces.indexOf('application/json') >= 0) {
2295
+ localVarHeaderParams.Accept = produces[0];
2296
+ } else {
2297
+ localVarHeaderParams.Accept = 'application/json';
2298
+ }
2299
+ let localVarFormParams: any = {};
2300
+
2301
+ // verify required parameter 'warehouseId' is not null or undefined
2302
+ if (warehouseId === null || warehouseId === undefined) {
2303
+ throw new Error(
2304
+ 'Required parameter warehouseId was null or undefined when calling replaceAdvancedSyncScheduleForWarehouseAlpha.'
2305
+ );
2306
+ }
2307
+
2308
+ // verify required parameter 'ReplaceAdvancedSyncScheduleForWarehouseV1Input' is not null or undefined
2309
+ if (
2310
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input === null ||
2311
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input === undefined
2312
+ ) {
2313
+ throw new Error(
2314
+ 'Required parameter ReplaceAdvancedSyncScheduleForWarehouseV1Input was null or undefined when calling replaceAdvancedSyncScheduleForWarehouseAlpha.'
2315
+ );
2316
+ }
2317
+
2318
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2319
+
2320
+ let localVarUseFormData = false;
2321
+
2322
+ let localVarRequestOptions: localVarRequest.Options = {
2323
+ method: 'PUT',
2324
+ qs: localVarQueryParameters,
2325
+ headers: localVarHeaderParams,
2326
+ uri: localVarPath,
2327
+ useQuerystring: this._useQuerystring,
2328
+ json: true,
2329
+ body: ObjectSerializer.serialize(
2330
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input,
2331
+ 'ReplaceAdvancedSyncScheduleForWarehouseV1Input'
2332
+ ),
2333
+ };
2334
+
2335
+ let authenticationPromise = Promise.resolve();
2336
+ if (this.authentications.token.accessToken) {
2337
+ authenticationPromise = authenticationPromise.then(() =>
2338
+ this.authentications.token.applyToRequest(
2339
+ localVarRequestOptions
2340
+ )
2341
+ );
2342
+ }
2343
+ authenticationPromise = authenticationPromise.then(() =>
2344
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2345
+ );
2346
+
2347
+ let interceptorPromise = authenticationPromise;
2348
+ for (const interceptor of this.interceptors) {
2349
+ interceptorPromise = interceptorPromise.then(() =>
2350
+ interceptor(localVarRequestOptions)
2351
+ );
2352
+ }
2353
+
2354
+ return interceptorPromise.then(() => {
2355
+ if (Object.keys(localVarFormParams).length) {
2356
+ if (localVarUseFormData) {
2357
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2358
+ } else {
2359
+ localVarRequestOptions.form = localVarFormParams;
2360
+ }
2361
+ }
2362
+ return new Promise<{
2363
+ response: http.IncomingMessage;
2364
+ body: ReplaceAdvancedSyncScheduleForWarehouse200Response;
2365
+ }>((resolve, reject) => {
2366
+ localVarRequest(
2367
+ localVarRequestOptions,
2368
+ (error, response, body) => {
2369
+ if (error) {
2370
+ reject(error);
2371
+ } else {
2372
+ if (
2373
+ response.statusCode &&
2374
+ response.statusCode >= 200 &&
2375
+ response.statusCode <= 299
2376
+ ) {
2377
+ body = ObjectSerializer.deserialize(
2378
+ body,
2379
+ 'ReplaceAdvancedSyncScheduleForWarehouse200Response'
2380
+ );
2381
+ resolve({ response: response, body: body });
2382
+ } else {
2383
+ reject(
2384
+ new HttpError(
2385
+ response,
2386
+ body,
2387
+ response.statusCode
2388
+ )
2389
+ );
2390
+ }
2391
+ }
2392
+ }
2393
+ );
2394
+ });
2395
+ });
2396
+ }
2397
+ /**
2398
+ * Updates the advanced sync schedule for a Warehouse, replacing the sync schedule with a new schedule. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
2399
+ * @summary Replace Advanced Sync Schedule for Warehouse
2400
+ * @param warehouseId
2401
+ * @param ReplaceAdvancedSyncScheduleForWarehouseV1Input
2402
+ */
2403
+ public async replaceAdvancedSyncScheduleForWarehouseBeta(
2404
+ warehouseId: string,
2405
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input: ReplaceAdvancedSyncScheduleForWarehouseV1Input,
2406
+ options: { headers: { [name: string]: string } } = { headers: {} }
2407
+ ): Promise<{
2408
+ response: http.IncomingMessage;
2409
+ body: ReplaceAdvancedSyncScheduleForWarehouse200Response;
2410
+ }> {
2411
+ const localVarPath =
2412
+ this.basePath +
2413
+ '/warehouses/{warehouseId}/advanced-sync-schedule'.replace(
2414
+ '{' + 'warehouseId' + '}',
2415
+ encodeURIComponent(String(warehouseId))
2416
+ );
2417
+ let localVarQueryParameters: any = {};
2418
+ let localVarHeaderParams: any = (<any>Object).assign(
2419
+ {},
2420
+ this._defaultHeaders
2421
+ );
2422
+ const produces = [
2423
+ 'application/vnd.segment.v1beta+json',
2424
+ 'application/json',
2425
+ ];
2426
+ if (produces.indexOf('application/json') >= 0) {
2427
+ localVarHeaderParams.Accept = produces[0];
2428
+ } else {
2429
+ localVarHeaderParams.Accept = 'application/json';
2430
+ }
2431
+ let localVarFormParams: any = {};
2432
+
2433
+ // verify required parameter 'warehouseId' is not null or undefined
2434
+ if (warehouseId === null || warehouseId === undefined) {
2435
+ throw new Error(
2436
+ 'Required parameter warehouseId was null or undefined when calling replaceAdvancedSyncScheduleForWarehouseBeta.'
2437
+ );
2438
+ }
2439
+
2440
+ // verify required parameter 'ReplaceAdvancedSyncScheduleForWarehouseV1Input' is not null or undefined
2441
+ if (
2442
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input === null ||
2443
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input === undefined
2444
+ ) {
2445
+ throw new Error(
2446
+ 'Required parameter ReplaceAdvancedSyncScheduleForWarehouseV1Input was null or undefined when calling replaceAdvancedSyncScheduleForWarehouseBeta.'
2447
+ );
2448
+ }
2449
+
2450
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2451
+
2452
+ let localVarUseFormData = false;
2453
+
2454
+ let localVarRequestOptions: localVarRequest.Options = {
2455
+ method: 'PUT',
2456
+ qs: localVarQueryParameters,
2457
+ headers: localVarHeaderParams,
2458
+ uri: localVarPath,
2459
+ useQuerystring: this._useQuerystring,
2460
+ json: true,
2461
+ body: ObjectSerializer.serialize(
2462
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input,
2463
+ 'ReplaceAdvancedSyncScheduleForWarehouseV1Input'
2464
+ ),
2465
+ };
2466
+
2467
+ let authenticationPromise = Promise.resolve();
2468
+ if (this.authentications.token.accessToken) {
2469
+ authenticationPromise = authenticationPromise.then(() =>
2470
+ this.authentications.token.applyToRequest(
2471
+ localVarRequestOptions
2472
+ )
2473
+ );
2474
+ }
2475
+ authenticationPromise = authenticationPromise.then(() =>
2476
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2477
+ );
2478
+
2479
+ let interceptorPromise = authenticationPromise;
2480
+ for (const interceptor of this.interceptors) {
2481
+ interceptorPromise = interceptorPromise.then(() =>
2482
+ interceptor(localVarRequestOptions)
2483
+ );
2484
+ }
2485
+
2486
+ return interceptorPromise.then(() => {
2487
+ if (Object.keys(localVarFormParams).length) {
2488
+ if (localVarUseFormData) {
2489
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2490
+ } else {
2491
+ localVarRequestOptions.form = localVarFormParams;
2492
+ }
2493
+ }
2494
+ return new Promise<{
2495
+ response: http.IncomingMessage;
2496
+ body: ReplaceAdvancedSyncScheduleForWarehouse200Response;
2497
+ }>((resolve, reject) => {
2498
+ localVarRequest(
2499
+ localVarRequestOptions,
2500
+ (error, response, body) => {
2501
+ if (error) {
2502
+ reject(error);
2503
+ } else {
2504
+ if (
2505
+ response.statusCode &&
2506
+ response.statusCode >= 200 &&
2507
+ response.statusCode <= 299
2508
+ ) {
2509
+ body = ObjectSerializer.deserialize(
2510
+ body,
2511
+ 'ReplaceAdvancedSyncScheduleForWarehouse200Response'
2512
+ );
2513
+ resolve({ response: response, body: body });
2514
+ } else {
2515
+ reject(
2516
+ new HttpError(
2517
+ response,
2518
+ body,
2519
+ response.statusCode
2520
+ )
2521
+ );
2522
+ }
2523
+ }
2524
+ }
2525
+ );
2526
+ });
2527
+ });
2528
+ }
2529
+ /**
2530
+ * Updates the advanced sync schedule for a Warehouse, replacing the sync schedule with a new schedule. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
2531
+ * @summary Replace Advanced Sync Schedule for Warehouse
2532
+ * @param warehouseId
2533
+ * @param ReplaceAdvancedSyncScheduleForWarehouseV1Input
2534
+ */
2535
+ public async replaceAdvancedSyncScheduleForWarehouseCurrent(
2536
+ warehouseId: string,
2537
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input: ReplaceAdvancedSyncScheduleForWarehouseV1Input,
2538
+ options: { headers: { [name: string]: string } } = { headers: {} }
2539
+ ): Promise<{
2540
+ response: http.IncomingMessage;
2541
+ body: ReplaceAdvancedSyncScheduleForWarehouse200Response;
2542
+ }> {
2543
+ const localVarPath =
2544
+ this.basePath +
2545
+ '/warehouses/{warehouseId}/advanced-sync-schedule'.replace(
2546
+ '{' + 'warehouseId' + '}',
2547
+ encodeURIComponent(String(warehouseId))
2548
+ );
2549
+ let localVarQueryParameters: any = {};
2550
+ let localVarHeaderParams: any = (<any>Object).assign(
2551
+ {},
2552
+ this._defaultHeaders
2553
+ );
2554
+ const produces = [
2555
+ 'application/vnd.segment.v1+json',
2556
+ 'application/json',
2557
+ ];
2558
+ if (produces.indexOf('application/json') >= 0) {
2559
+ localVarHeaderParams.Accept = produces[0];
2560
+ } else {
2561
+ localVarHeaderParams.Accept = 'application/json';
2562
+ }
2563
+ let localVarFormParams: any = {};
2564
+
2565
+ // verify required parameter 'warehouseId' is not null or undefined
2566
+ if (warehouseId === null || warehouseId === undefined) {
2567
+ throw new Error(
2568
+ 'Required parameter warehouseId was null or undefined when calling replaceAdvancedSyncScheduleForWarehouseCurrent.'
2569
+ );
2570
+ }
2571
+
2572
+ // verify required parameter 'ReplaceAdvancedSyncScheduleForWarehouseV1Input' is not null or undefined
2573
+ if (
2574
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input === null ||
2575
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input === undefined
2576
+ ) {
2577
+ throw new Error(
2578
+ 'Required parameter ReplaceAdvancedSyncScheduleForWarehouseV1Input was null or undefined when calling replaceAdvancedSyncScheduleForWarehouseCurrent.'
2579
+ );
2580
+ }
2581
+
2582
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2583
+
2584
+ let localVarUseFormData = false;
2585
+
2586
+ let localVarRequestOptions: localVarRequest.Options = {
2587
+ method: 'PUT',
2588
+ qs: localVarQueryParameters,
2589
+ headers: localVarHeaderParams,
2590
+ uri: localVarPath,
2591
+ useQuerystring: this._useQuerystring,
2592
+ json: true,
2593
+ body: ObjectSerializer.serialize(
2594
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input,
2595
+ 'ReplaceAdvancedSyncScheduleForWarehouseV1Input'
2596
+ ),
2597
+ };
2598
+
2599
+ let authenticationPromise = Promise.resolve();
2600
+ if (this.authentications.token.accessToken) {
2601
+ authenticationPromise = authenticationPromise.then(() =>
2602
+ this.authentications.token.applyToRequest(
2603
+ localVarRequestOptions
2604
+ )
2605
+ );
2606
+ }
2607
+ authenticationPromise = authenticationPromise.then(() =>
2608
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2609
+ );
2610
+
2611
+ let interceptorPromise = authenticationPromise;
2612
+ for (const interceptor of this.interceptors) {
2613
+ interceptorPromise = interceptorPromise.then(() =>
2614
+ interceptor(localVarRequestOptions)
2615
+ );
2616
+ }
2617
+
2618
+ return interceptorPromise.then(() => {
2619
+ if (Object.keys(localVarFormParams).length) {
2620
+ if (localVarUseFormData) {
2621
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2622
+ } else {
2623
+ localVarRequestOptions.form = localVarFormParams;
2624
+ }
2625
+ }
2626
+ return new Promise<{
2627
+ response: http.IncomingMessage;
2628
+ body: ReplaceAdvancedSyncScheduleForWarehouse200Response;
2629
+ }>((resolve, reject) => {
2630
+ localVarRequest(
2631
+ localVarRequestOptions,
2632
+ (error, response, body) => {
2633
+ if (error) {
2634
+ reject(error);
2635
+ } else {
2636
+ if (
2637
+ response.statusCode &&
2638
+ response.statusCode >= 200 &&
2639
+ response.statusCode <= 299
2640
+ ) {
2641
+ body = ObjectSerializer.deserialize(
2642
+ body,
2643
+ 'ReplaceAdvancedSyncScheduleForWarehouse200Response'
2644
+ );
2645
+ resolve({ response: response, body: body });
2646
+ } else {
2647
+ reject(
2648
+ new HttpError(
2649
+ response,
2650
+ body,
2651
+ response.statusCode
2652
+ )
2653
+ );
2654
+ }
2655
+ }
2656
+ }
2657
+ );
2658
+ });
2659
+ });
2660
+ }
2661
+ /**
2662
+ * Updates the advanced sync schedule for a Warehouse, replacing the sync schedule with a new schedule. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
2663
+ * @summary Replace Advanced Sync Schedule for Warehouse
2664
+ * @param warehouseId
2665
+ * @param ReplaceAdvancedSyncScheduleForWarehouseV1Input
2666
+ */
2667
+ public async replaceAdvancedSyncScheduleForWarehouseV1(
2668
+ warehouseId: string,
2669
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input: ReplaceAdvancedSyncScheduleForWarehouseV1Input,
2670
+ options: { headers: { [name: string]: string } } = { headers: {} }
2671
+ ): Promise<{
2672
+ response: http.IncomingMessage;
2673
+ body: ReplaceAdvancedSyncScheduleForWarehouse200Response;
2674
+ }> {
2675
+ const localVarPath =
2676
+ this.basePath +
2677
+ '/warehouses/{warehouseId}/advanced-sync-schedule'.replace(
2678
+ '{' + 'warehouseId' + '}',
2679
+ encodeURIComponent(String(warehouseId))
2680
+ );
2681
+ let localVarQueryParameters: any = {};
2682
+ let localVarHeaderParams: any = (<any>Object).assign(
2683
+ {},
2684
+ this._defaultHeaders
2685
+ );
2686
+ const produces = [
2687
+ 'application/vnd.segment.v1+json',
2688
+ 'application/json',
2689
+ ];
2690
+ if (produces.indexOf('application/json') >= 0) {
2691
+ localVarHeaderParams.Accept = produces[0];
2692
+ } else {
2693
+ localVarHeaderParams.Accept = 'application/json';
2694
+ }
2695
+ let localVarFormParams: any = {};
2696
+
2697
+ // verify required parameter 'warehouseId' is not null or undefined
2698
+ if (warehouseId === null || warehouseId === undefined) {
2699
+ throw new Error(
2700
+ 'Required parameter warehouseId was null or undefined when calling replaceAdvancedSyncScheduleForWarehouseV1.'
2701
+ );
2702
+ }
2703
+
2704
+ // verify required parameter 'ReplaceAdvancedSyncScheduleForWarehouseV1Input' is not null or undefined
2705
+ if (
2706
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input === null ||
2707
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input === undefined
2708
+ ) {
2709
+ throw new Error(
2710
+ 'Required parameter ReplaceAdvancedSyncScheduleForWarehouseV1Input was null or undefined when calling replaceAdvancedSyncScheduleForWarehouseV1.'
2711
+ );
2712
+ }
2713
+
2714
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2715
+
2716
+ let localVarUseFormData = false;
2717
+
2718
+ let localVarRequestOptions: localVarRequest.Options = {
2719
+ method: 'PUT',
2720
+ qs: localVarQueryParameters,
2721
+ headers: localVarHeaderParams,
2722
+ uri: localVarPath,
2723
+ useQuerystring: this._useQuerystring,
2724
+ json: true,
2725
+ body: ObjectSerializer.serialize(
2726
+ ReplaceAdvancedSyncScheduleForWarehouseV1Input,
2727
+ 'ReplaceAdvancedSyncScheduleForWarehouseV1Input'
2728
+ ),
2729
+ };
2730
+
2731
+ let authenticationPromise = Promise.resolve();
2732
+ if (this.authentications.token.accessToken) {
2733
+ authenticationPromise = authenticationPromise.then(() =>
2734
+ this.authentications.token.applyToRequest(
2735
+ localVarRequestOptions
2736
+ )
2737
+ );
2738
+ }
2739
+ authenticationPromise = authenticationPromise.then(() =>
2740
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2741
+ );
2742
+
2743
+ let interceptorPromise = authenticationPromise;
2744
+ for (const interceptor of this.interceptors) {
2745
+ interceptorPromise = interceptorPromise.then(() =>
2746
+ interceptor(localVarRequestOptions)
2747
+ );
2748
+ }
2749
+
2750
+ return interceptorPromise.then(() => {
2751
+ if (Object.keys(localVarFormParams).length) {
2752
+ if (localVarUseFormData) {
2753
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2754
+ } else {
2755
+ localVarRequestOptions.form = localVarFormParams;
2756
+ }
2757
+ }
2758
+ return new Promise<{
2759
+ response: http.IncomingMessage;
2760
+ body: ReplaceAdvancedSyncScheduleForWarehouse200Response;
2761
+ }>((resolve, reject) => {
2762
+ localVarRequest(
2763
+ localVarRequestOptions,
2764
+ (error, response, body) => {
2765
+ if (error) {
2766
+ reject(error);
2767
+ } else {
2768
+ if (
2769
+ response.statusCode &&
2770
+ response.statusCode >= 200 &&
2771
+ response.statusCode <= 299
2772
+ ) {
2773
+ body = ObjectSerializer.deserialize(
2774
+ body,
2775
+ 'ReplaceAdvancedSyncScheduleForWarehouse200Response'
2776
+ );
2777
+ resolve({ response: response, body: body });
2778
+ } else {
2779
+ reject(
2780
+ new HttpError(
2781
+ response,
2782
+ body,
2783
+ response.statusCode
2784
+ )
2785
+ );
2786
+ }
2787
+ }
2788
+ }
2789
+ );
2790
+ });
2791
+ });
2792
+ }
2793
+ /**
2794
+ * Configures the schema for a Warehouse, including Sources, Collections, and Properties. When called, this endpoint may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
2795
+ * @summary Update Selective Sync for Warehouse
2796
+ * @param warehouseId
2797
+ * @param UpdateSelectiveSyncForWarehouseV1Input
2798
+ */
2799
+ public async updateSelectiveSyncForWarehouseAlpha(
2800
+ warehouseId: string,
2801
+ UpdateSelectiveSyncForWarehouseV1Input: UpdateSelectiveSyncForWarehouseV1Input,
2802
+ options: { headers: { [name: string]: string } } = { headers: {} }
2803
+ ): Promise<{
2804
+ response: http.IncomingMessage;
2805
+ body: UpdateSelectiveSyncForWarehouse200Response;
2806
+ }> {
2807
+ const localVarPath =
2808
+ this.basePath +
2809
+ '/warehouses/{warehouseId}/selective-sync'.replace(
2810
+ '{' + 'warehouseId' + '}',
2811
+ encodeURIComponent(String(warehouseId))
2812
+ );
2813
+ let localVarQueryParameters: any = {};
2814
+ let localVarHeaderParams: any = (<any>Object).assign(
2815
+ {},
2816
+ this._defaultHeaders
2817
+ );
2818
+ const produces = [
2819
+ 'application/vnd.segment.v1alpha+json',
2820
+ 'application/json',
2821
+ ];
2822
+ if (produces.indexOf('application/json') >= 0) {
2823
+ localVarHeaderParams.Accept = produces[0];
2824
+ } else {
2825
+ localVarHeaderParams.Accept = 'application/json';
2826
+ }
2827
+ let localVarFormParams: any = {};
2828
+
2829
+ // verify required parameter 'warehouseId' is not null or undefined
2830
+ if (warehouseId === null || warehouseId === undefined) {
2831
+ throw new Error(
2832
+ 'Required parameter warehouseId was null or undefined when calling updateSelectiveSyncForWarehouseAlpha.'
2833
+ );
2834
+ }
2835
+
2836
+ // verify required parameter 'UpdateSelectiveSyncForWarehouseV1Input' is not null or undefined
2837
+ if (
2838
+ UpdateSelectiveSyncForWarehouseV1Input === null ||
2839
+ UpdateSelectiveSyncForWarehouseV1Input === undefined
2840
+ ) {
2841
+ throw new Error(
2842
+ 'Required parameter UpdateSelectiveSyncForWarehouseV1Input was null or undefined when calling updateSelectiveSyncForWarehouseAlpha.'
2843
+ );
2844
+ }
2845
+
2846
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2847
+
2848
+ let localVarUseFormData = false;
2849
+
2850
+ let localVarRequestOptions: localVarRequest.Options = {
2851
+ method: 'PATCH',
2852
+ qs: localVarQueryParameters,
2853
+ headers: localVarHeaderParams,
2854
+ uri: localVarPath,
2855
+ useQuerystring: this._useQuerystring,
2856
+ json: true,
2857
+ body: ObjectSerializer.serialize(
2858
+ UpdateSelectiveSyncForWarehouseV1Input,
2859
+ 'UpdateSelectiveSyncForWarehouseV1Input'
2860
+ ),
2861
+ };
2862
+
2863
+ let authenticationPromise = Promise.resolve();
2864
+ if (this.authentications.token.accessToken) {
2865
+ authenticationPromise = authenticationPromise.then(() =>
2866
+ this.authentications.token.applyToRequest(
2867
+ localVarRequestOptions
2868
+ )
2869
+ );
2870
+ }
2871
+ authenticationPromise = authenticationPromise.then(() =>
2872
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2873
+ );
2874
+
2875
+ let interceptorPromise = authenticationPromise;
2876
+ for (const interceptor of this.interceptors) {
2877
+ interceptorPromise = interceptorPromise.then(() =>
2878
+ interceptor(localVarRequestOptions)
2879
+ );
2880
+ }
2881
+
2882
+ return interceptorPromise.then(() => {
2883
+ if (Object.keys(localVarFormParams).length) {
2884
+ if (localVarUseFormData) {
2885
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2886
+ } else {
2887
+ localVarRequestOptions.form = localVarFormParams;
2888
+ }
2889
+ }
2890
+ return new Promise<{
2891
+ response: http.IncomingMessage;
2892
+ body: UpdateSelectiveSyncForWarehouse200Response;
2893
+ }>((resolve, reject) => {
2894
+ localVarRequest(
2895
+ localVarRequestOptions,
2896
+ (error, response, body) => {
2897
+ if (error) {
2898
+ reject(error);
2899
+ } else {
2900
+ if (
2901
+ response.statusCode &&
2902
+ response.statusCode >= 200 &&
2903
+ response.statusCode <= 299
2904
+ ) {
2905
+ body = ObjectSerializer.deserialize(
2906
+ body,
2907
+ 'UpdateSelectiveSyncForWarehouse200Response'
2908
+ );
2909
+ resolve({ response: response, body: body });
2910
+ } else {
2911
+ reject(
2912
+ new HttpError(
2913
+ response,
2914
+ body,
2915
+ response.statusCode
2916
+ )
2917
+ );
2918
+ }
2919
+ }
2920
+ }
2921
+ );
2922
+ });
2923
+ });
2924
+ }
2925
+ /**
2926
+ * Configures the schema for a Warehouse, including Sources, Collections, and Properties. When called, this endpoint may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
2927
+ * @summary Update Selective Sync for Warehouse
2928
+ * @param warehouseId
2929
+ * @param UpdateSelectiveSyncForWarehouseV1Input
2930
+ */
2931
+ public async updateSelectiveSyncForWarehouseBeta(
2932
+ warehouseId: string,
2933
+ UpdateSelectiveSyncForWarehouseV1Input: UpdateSelectiveSyncForWarehouseV1Input,
2934
+ options: { headers: { [name: string]: string } } = { headers: {} }
2935
+ ): Promise<{
2936
+ response: http.IncomingMessage;
2937
+ body: UpdateSelectiveSyncForWarehouse200Response;
2938
+ }> {
2939
+ const localVarPath =
2940
+ this.basePath +
2941
+ '/warehouses/{warehouseId}/selective-sync'.replace(
2942
+ '{' + 'warehouseId' + '}',
2943
+ encodeURIComponent(String(warehouseId))
2944
+ );
2945
+ let localVarQueryParameters: any = {};
2946
+ let localVarHeaderParams: any = (<any>Object).assign(
2947
+ {},
2948
+ this._defaultHeaders
2949
+ );
2950
+ const produces = [
2951
+ 'application/vnd.segment.v1beta+json',
2952
+ 'application/json',
2953
+ ];
2954
+ if (produces.indexOf('application/json') >= 0) {
2955
+ localVarHeaderParams.Accept = produces[0];
2956
+ } else {
2957
+ localVarHeaderParams.Accept = 'application/json';
2958
+ }
2959
+ let localVarFormParams: any = {};
2960
+
2961
+ // verify required parameter 'warehouseId' is not null or undefined
2962
+ if (warehouseId === null || warehouseId === undefined) {
2963
+ throw new Error(
2964
+ 'Required parameter warehouseId was null or undefined when calling updateSelectiveSyncForWarehouseBeta.'
2965
+ );
2966
+ }
2967
+
2968
+ // verify required parameter 'UpdateSelectiveSyncForWarehouseV1Input' is not null or undefined
2969
+ if (
2970
+ UpdateSelectiveSyncForWarehouseV1Input === null ||
2971
+ UpdateSelectiveSyncForWarehouseV1Input === undefined
2972
+ ) {
2973
+ throw new Error(
2974
+ 'Required parameter UpdateSelectiveSyncForWarehouseV1Input was null or undefined when calling updateSelectiveSyncForWarehouseBeta.'
2975
+ );
2976
+ }
2977
+
2978
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2979
+
2980
+ let localVarUseFormData = false;
2981
+
2982
+ let localVarRequestOptions: localVarRequest.Options = {
2983
+ method: 'PATCH',
2984
+ qs: localVarQueryParameters,
2985
+ headers: localVarHeaderParams,
2986
+ uri: localVarPath,
2987
+ useQuerystring: this._useQuerystring,
2988
+ json: true,
2989
+ body: ObjectSerializer.serialize(
2990
+ UpdateSelectiveSyncForWarehouseV1Input,
2991
+ 'UpdateSelectiveSyncForWarehouseV1Input'
2992
+ ),
2993
+ };
2994
+
2995
+ let authenticationPromise = Promise.resolve();
2996
+ if (this.authentications.token.accessToken) {
2997
+ authenticationPromise = authenticationPromise.then(() =>
2998
+ this.authentications.token.applyToRequest(
2999
+ localVarRequestOptions
3000
+ )
3001
+ );
3002
+ }
3003
+ authenticationPromise = authenticationPromise.then(() =>
3004
+ this.authentications.default.applyToRequest(localVarRequestOptions)
3005
+ );
3006
+
3007
+ let interceptorPromise = authenticationPromise;
3008
+ for (const interceptor of this.interceptors) {
3009
+ interceptorPromise = interceptorPromise.then(() =>
3010
+ interceptor(localVarRequestOptions)
3011
+ );
3012
+ }
3013
+
3014
+ return interceptorPromise.then(() => {
3015
+ if (Object.keys(localVarFormParams).length) {
3016
+ if (localVarUseFormData) {
3017
+ (<any>localVarRequestOptions).formData = localVarFormParams;
3018
+ } else {
3019
+ localVarRequestOptions.form = localVarFormParams;
3020
+ }
3021
+ }
3022
+ return new Promise<{
3023
+ response: http.IncomingMessage;
3024
+ body: UpdateSelectiveSyncForWarehouse200Response;
3025
+ }>((resolve, reject) => {
3026
+ localVarRequest(
3027
+ localVarRequestOptions,
3028
+ (error, response, body) => {
3029
+ if (error) {
3030
+ reject(error);
3031
+ } else {
3032
+ if (
3033
+ response.statusCode &&
3034
+ response.statusCode >= 200 &&
3035
+ response.statusCode <= 299
3036
+ ) {
3037
+ body = ObjectSerializer.deserialize(
3038
+ body,
3039
+ 'UpdateSelectiveSyncForWarehouse200Response'
3040
+ );
3041
+ resolve({ response: response, body: body });
3042
+ } else {
3043
+ reject(
3044
+ new HttpError(
3045
+ response,
3046
+ body,
3047
+ response.statusCode
3048
+ )
3049
+ );
3050
+ }
3051
+ }
3052
+ }
3053
+ );
3054
+ });
3055
+ });
3056
+ }
3057
+ /**
3058
+ * Configures the schema for a Warehouse, including Sources, Collections, and Properties. When called, this endpoint may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
3059
+ * @summary Update Selective Sync for Warehouse
3060
+ * @param warehouseId
3061
+ * @param UpdateSelectiveSyncForWarehouseV1Input
3062
+ */
3063
+ public async updateSelectiveSyncForWarehouseCurrent(
3064
+ warehouseId: string,
3065
+ UpdateSelectiveSyncForWarehouseV1Input: UpdateSelectiveSyncForWarehouseV1Input,
3066
+ options: { headers: { [name: string]: string } } = { headers: {} }
3067
+ ): Promise<{
3068
+ response: http.IncomingMessage;
3069
+ body: UpdateSelectiveSyncForWarehouse200Response;
3070
+ }> {
3071
+ const localVarPath =
3072
+ this.basePath +
3073
+ '/warehouses/{warehouseId}/selective-sync'.replace(
3074
+ '{' + 'warehouseId' + '}',
3075
+ encodeURIComponent(String(warehouseId))
3076
+ );
3077
+ let localVarQueryParameters: any = {};
3078
+ let localVarHeaderParams: any = (<any>Object).assign(
3079
+ {},
3080
+ this._defaultHeaders
3081
+ );
3082
+ const produces = [
3083
+ 'application/vnd.segment.v1+json',
3084
+ 'application/json',
3085
+ ];
3086
+ if (produces.indexOf('application/json') >= 0) {
3087
+ localVarHeaderParams.Accept = produces[0];
3088
+ } else {
3089
+ localVarHeaderParams.Accept = 'application/json';
3090
+ }
3091
+ let localVarFormParams: any = {};
3092
+
3093
+ // verify required parameter 'warehouseId' is not null or undefined
3094
+ if (warehouseId === null || warehouseId === undefined) {
3095
+ throw new Error(
3096
+ 'Required parameter warehouseId was null or undefined when calling updateSelectiveSyncForWarehouseCurrent.'
3097
+ );
3098
+ }
3099
+
3100
+ // verify required parameter 'UpdateSelectiveSyncForWarehouseV1Input' is not null or undefined
3101
+ if (
3102
+ UpdateSelectiveSyncForWarehouseV1Input === null ||
3103
+ UpdateSelectiveSyncForWarehouseV1Input === undefined
3104
+ ) {
3105
+ throw new Error(
3106
+ 'Required parameter UpdateSelectiveSyncForWarehouseV1Input was null or undefined when calling updateSelectiveSyncForWarehouseCurrent.'
3107
+ );
3108
+ }
3109
+
3110
+ (<any>Object).assign(localVarHeaderParams, options.headers);
3111
+
3112
+ let localVarUseFormData = false;
3113
+
3114
+ let localVarRequestOptions: localVarRequest.Options = {
3115
+ method: 'PATCH',
3116
+ qs: localVarQueryParameters,
3117
+ headers: localVarHeaderParams,
3118
+ uri: localVarPath,
3119
+ useQuerystring: this._useQuerystring,
3120
+ json: true,
3121
+ body: ObjectSerializer.serialize(
3122
+ UpdateSelectiveSyncForWarehouseV1Input,
3123
+ 'UpdateSelectiveSyncForWarehouseV1Input'
3124
+ ),
3125
+ };
3126
+
3127
+ let authenticationPromise = Promise.resolve();
3128
+ if (this.authentications.token.accessToken) {
3129
+ authenticationPromise = authenticationPromise.then(() =>
3130
+ this.authentications.token.applyToRequest(
3131
+ localVarRequestOptions
3132
+ )
3133
+ );
3134
+ }
3135
+ authenticationPromise = authenticationPromise.then(() =>
3136
+ this.authentications.default.applyToRequest(localVarRequestOptions)
3137
+ );
3138
+
3139
+ let interceptorPromise = authenticationPromise;
3140
+ for (const interceptor of this.interceptors) {
3141
+ interceptorPromise = interceptorPromise.then(() =>
3142
+ interceptor(localVarRequestOptions)
3143
+ );
3144
+ }
3145
+
3146
+ return interceptorPromise.then(() => {
3147
+ if (Object.keys(localVarFormParams).length) {
3148
+ if (localVarUseFormData) {
3149
+ (<any>localVarRequestOptions).formData = localVarFormParams;
3150
+ } else {
3151
+ localVarRequestOptions.form = localVarFormParams;
3152
+ }
3153
+ }
3154
+ return new Promise<{
3155
+ response: http.IncomingMessage;
3156
+ body: UpdateSelectiveSyncForWarehouse200Response;
3157
+ }>((resolve, reject) => {
3158
+ localVarRequest(
3159
+ localVarRequestOptions,
3160
+ (error, response, body) => {
3161
+ if (error) {
3162
+ reject(error);
3163
+ } else {
3164
+ if (
3165
+ response.statusCode &&
3166
+ response.statusCode >= 200 &&
3167
+ response.statusCode <= 299
3168
+ ) {
3169
+ body = ObjectSerializer.deserialize(
3170
+ body,
3171
+ 'UpdateSelectiveSyncForWarehouse200Response'
3172
+ );
3173
+ resolve({ response: response, body: body });
3174
+ } else {
3175
+ reject(
3176
+ new HttpError(
3177
+ response,
3178
+ body,
3179
+ response.statusCode
3180
+ )
3181
+ );
3182
+ }
3183
+ }
3184
+ }
3185
+ );
3186
+ });
3187
+ });
3188
+ }
3189
+ /**
3190
+ * Configures the schema for a Warehouse, including Sources, Collections, and Properties. When called, this endpoint may generate the `Storage Destination Modified` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 2 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
3191
+ * @summary Update Selective Sync for Warehouse
3192
+ * @param warehouseId
3193
+ * @param UpdateSelectiveSyncForWarehouseV1Input
3194
+ */
3195
+ public async updateSelectiveSyncForWarehouseV1(
3196
+ warehouseId: string,
3197
+ UpdateSelectiveSyncForWarehouseV1Input: UpdateSelectiveSyncForWarehouseV1Input,
3198
+ options: { headers: { [name: string]: string } } = { headers: {} }
3199
+ ): Promise<{
3200
+ response: http.IncomingMessage;
3201
+ body: UpdateSelectiveSyncForWarehouse200Response;
3202
+ }> {
3203
+ const localVarPath =
3204
+ this.basePath +
3205
+ '/warehouses/{warehouseId}/selective-sync'.replace(
3206
+ '{' + 'warehouseId' + '}',
3207
+ encodeURIComponent(String(warehouseId))
3208
+ );
3209
+ let localVarQueryParameters: any = {};
3210
+ let localVarHeaderParams: any = (<any>Object).assign(
3211
+ {},
3212
+ this._defaultHeaders
3213
+ );
3214
+ const produces = [
3215
+ 'application/vnd.segment.v1+json',
3216
+ 'application/json',
3217
+ ];
3218
+ if (produces.indexOf('application/json') >= 0) {
3219
+ localVarHeaderParams.Accept = produces[0];
3220
+ } else {
3221
+ localVarHeaderParams.Accept = 'application/json';
3222
+ }
3223
+ let localVarFormParams: any = {};
3224
+
3225
+ // verify required parameter 'warehouseId' is not null or undefined
3226
+ if (warehouseId === null || warehouseId === undefined) {
3227
+ throw new Error(
3228
+ 'Required parameter warehouseId was null or undefined when calling updateSelectiveSyncForWarehouseV1.'
3229
+ );
3230
+ }
3231
+
3232
+ // verify required parameter 'UpdateSelectiveSyncForWarehouseV1Input' is not null or undefined
3233
+ if (
3234
+ UpdateSelectiveSyncForWarehouseV1Input === null ||
3235
+ UpdateSelectiveSyncForWarehouseV1Input === undefined
3236
+ ) {
3237
+ throw new Error(
3238
+ 'Required parameter UpdateSelectiveSyncForWarehouseV1Input was null or undefined when calling updateSelectiveSyncForWarehouseV1.'
3239
+ );
3240
+ }
3241
+
3242
+ (<any>Object).assign(localVarHeaderParams, options.headers);
3243
+
3244
+ let localVarUseFormData = false;
3245
+
3246
+ let localVarRequestOptions: localVarRequest.Options = {
3247
+ method: 'PATCH',
3248
+ qs: localVarQueryParameters,
3249
+ headers: localVarHeaderParams,
3250
+ uri: localVarPath,
3251
+ useQuerystring: this._useQuerystring,
3252
+ json: true,
3253
+ body: ObjectSerializer.serialize(
3254
+ UpdateSelectiveSyncForWarehouseV1Input,
3255
+ 'UpdateSelectiveSyncForWarehouseV1Input'
3256
+ ),
3257
+ };
3258
+
3259
+ let authenticationPromise = Promise.resolve();
3260
+ if (this.authentications.token.accessToken) {
3261
+ authenticationPromise = authenticationPromise.then(() =>
3262
+ this.authentications.token.applyToRequest(
3263
+ localVarRequestOptions
3264
+ )
3265
+ );
3266
+ }
3267
+ authenticationPromise = authenticationPromise.then(() =>
3268
+ this.authentications.default.applyToRequest(localVarRequestOptions)
3269
+ );
3270
+
3271
+ let interceptorPromise = authenticationPromise;
3272
+ for (const interceptor of this.interceptors) {
3273
+ interceptorPromise = interceptorPromise.then(() =>
3274
+ interceptor(localVarRequestOptions)
3275
+ );
3276
+ }
3277
+
3278
+ return interceptorPromise.then(() => {
3279
+ if (Object.keys(localVarFormParams).length) {
3280
+ if (localVarUseFormData) {
3281
+ (<any>localVarRequestOptions).formData = localVarFormParams;
3282
+ } else {
3283
+ localVarRequestOptions.form = localVarFormParams;
3284
+ }
3285
+ }
3286
+ return new Promise<{
3287
+ response: http.IncomingMessage;
3288
+ body: UpdateSelectiveSyncForWarehouse200Response;
3289
+ }>((resolve, reject) => {
3290
+ localVarRequest(
3291
+ localVarRequestOptions,
3292
+ (error, response, body) => {
3293
+ if (error) {
3294
+ reject(error);
3295
+ } else {
3296
+ if (
3297
+ response.statusCode &&
3298
+ response.statusCode >= 200 &&
3299
+ response.statusCode <= 299
3300
+ ) {
3301
+ body = ObjectSerializer.deserialize(
3302
+ body,
3303
+ 'UpdateSelectiveSyncForWarehouse200Response'
3304
+ );
3305
+ resolve({ response: response, body: body });
3306
+ } else {
3307
+ reject(
3308
+ new HttpError(
3309
+ response,
3310
+ body,
3311
+ response.statusCode
3312
+ )
3313
+ );
3314
+ }
3315
+ }
3316
+ }
3317
+ );
3318
+ });
3319
+ });
3320
+ }
3321
+ }