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

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,2916 @@
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 { GetDestinationMetadata200Response } from '../model/getDestinationMetadata200Response';
18
+ import { GetDestinationsCatalog200Response } from '../model/getDestinationsCatalog200Response';
19
+ import { GetSourceMetadata200Response } from '../model/getSourceMetadata200Response';
20
+ import { GetSourcesCatalog200Response } from '../model/getSourcesCatalog200Response';
21
+ import { GetWarehouseMetadata200Response } from '../model/getWarehouseMetadata200Response';
22
+ import { GetWarehousesCatalog200Response } from '../model/getWarehousesCatalog200Response';
23
+ import { PaginationInput } from '../model/paginationInput';
24
+ import { RequestErrorEnvelope } from '../model/requestErrorEnvelope';
25
+
26
+ import {
27
+ ObjectSerializer,
28
+ Authentication,
29
+ VoidAuth,
30
+ Interceptor,
31
+ } from '../model/models';
32
+ import {
33
+ HttpBasicAuth,
34
+ HttpBearerAuth,
35
+ ApiKeyAuth,
36
+ OAuth,
37
+ } from '../model/models';
38
+
39
+ import { HttpError, RequestFile } from './apis';
40
+
41
+ let defaultBasePath = 'https://api.segmentapis.com';
42
+
43
+ // ===============================================
44
+ // This file is autogenerated - Please do not edit
45
+ // ===============================================
46
+
47
+ export enum CatalogApiApiKeys {}
48
+
49
+ export class CatalogApi {
50
+ protected _basePath = defaultBasePath;
51
+ protected _defaultHeaders: any = {};
52
+ protected _useQuerystring: boolean = false;
53
+
54
+ protected authentications = {
55
+ default: <Authentication>new VoidAuth(),
56
+ token: new HttpBearerAuth(),
57
+ };
58
+
59
+ protected interceptors: Interceptor[] = [];
60
+
61
+ constructor(basePath?: string);
62
+ constructor(
63
+ basePathOrUsername: string,
64
+ password?: string,
65
+ basePath?: string
66
+ ) {
67
+ if (password) {
68
+ if (basePath) {
69
+ this.basePath = basePath;
70
+ }
71
+ } else {
72
+ if (basePathOrUsername) {
73
+ this.basePath = basePathOrUsername;
74
+ }
75
+ }
76
+ }
77
+
78
+ set useQuerystring(value: boolean) {
79
+ this._useQuerystring = value;
80
+ }
81
+
82
+ set basePath(basePath: string) {
83
+ this._basePath = basePath;
84
+ }
85
+
86
+ set defaultHeaders(defaultHeaders: any) {
87
+ this._defaultHeaders = defaultHeaders;
88
+ }
89
+
90
+ get defaultHeaders() {
91
+ return this._defaultHeaders;
92
+ }
93
+
94
+ get basePath() {
95
+ return this._basePath;
96
+ }
97
+
98
+ public setDefaultAuthentication(auth: Authentication) {
99
+ this.authentications.default = auth;
100
+ }
101
+
102
+ public setApiKey(key: CatalogApiApiKeys, value: string) {
103
+ (this.authentications as any)[CatalogApiApiKeys[key]].apiKey = value;
104
+ }
105
+
106
+ set accessToken(accessToken: string | (() => string)) {
107
+ this.authentications.token.accessToken = accessToken;
108
+ }
109
+
110
+ public addInterceptor(interceptor: Interceptor) {
111
+ this.interceptors.push(interceptor);
112
+ }
113
+
114
+ /**
115
+ * Returns a Destination catalog item by its id.
116
+ * @summary Get Destination Metadata
117
+ * @param destinationMetadataId
118
+ */
119
+ public async getDestinationMetadataAlpha(
120
+ destinationMetadataId: string,
121
+ options: { headers: { [name: string]: string } } = { headers: {} }
122
+ ): Promise<{
123
+ response: http.IncomingMessage;
124
+ body: GetDestinationMetadata200Response;
125
+ }> {
126
+ const localVarPath =
127
+ this.basePath +
128
+ '/catalog/destinations/{destinationMetadataId}'.replace(
129
+ '{' + 'destinationMetadataId' + '}',
130
+ encodeURIComponent(String(destinationMetadataId))
131
+ );
132
+ let localVarQueryParameters: any = {};
133
+ let localVarHeaderParams: any = (<any>Object).assign(
134
+ {},
135
+ this._defaultHeaders
136
+ );
137
+ const produces = [
138
+ 'application/vnd.segment.v1alpha+json',
139
+ 'application/json',
140
+ ];
141
+ if (produces.indexOf('application/json') >= 0) {
142
+ localVarHeaderParams.Accept = produces[0];
143
+ } else {
144
+ localVarHeaderParams.Accept = 'application/json';
145
+ }
146
+ let localVarFormParams: any = {};
147
+
148
+ // verify required parameter 'destinationMetadataId' is not null or undefined
149
+ if (
150
+ destinationMetadataId === null ||
151
+ destinationMetadataId === undefined
152
+ ) {
153
+ throw new Error(
154
+ 'Required parameter destinationMetadataId was null or undefined when calling getDestinationMetadataAlpha.'
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: GetDestinationMetadata200Response;
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
+ 'GetDestinationMetadata200Response'
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 a Destination catalog item by its id.
235
+ * @summary Get Destination Metadata
236
+ * @param destinationMetadataId
237
+ */
238
+ public async getDestinationMetadataBeta(
239
+ destinationMetadataId: string,
240
+ options: { headers: { [name: string]: string } } = { headers: {} }
241
+ ): Promise<{
242
+ response: http.IncomingMessage;
243
+ body: GetDestinationMetadata200Response;
244
+ }> {
245
+ const localVarPath =
246
+ this.basePath +
247
+ '/catalog/destinations/{destinationMetadataId}'.replace(
248
+ '{' + 'destinationMetadataId' + '}',
249
+ encodeURIComponent(String(destinationMetadataId))
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 'destinationMetadataId' is not null or undefined
268
+ if (
269
+ destinationMetadataId === null ||
270
+ destinationMetadataId === undefined
271
+ ) {
272
+ throw new Error(
273
+ 'Required parameter destinationMetadataId was null or undefined when calling getDestinationMetadataBeta.'
274
+ );
275
+ }
276
+
277
+ (<any>Object).assign(localVarHeaderParams, options.headers);
278
+
279
+ let localVarUseFormData = false;
280
+
281
+ let localVarRequestOptions: localVarRequest.Options = {
282
+ method: 'GET',
283
+ qs: localVarQueryParameters,
284
+ headers: localVarHeaderParams,
285
+ uri: localVarPath,
286
+ useQuerystring: this._useQuerystring,
287
+ json: true,
288
+ };
289
+
290
+ let authenticationPromise = Promise.resolve();
291
+ if (this.authentications.token.accessToken) {
292
+ authenticationPromise = authenticationPromise.then(() =>
293
+ this.authentications.token.applyToRequest(
294
+ localVarRequestOptions
295
+ )
296
+ );
297
+ }
298
+ authenticationPromise = authenticationPromise.then(() =>
299
+ this.authentications.default.applyToRequest(localVarRequestOptions)
300
+ );
301
+
302
+ let interceptorPromise = authenticationPromise;
303
+ for (const interceptor of this.interceptors) {
304
+ interceptorPromise = interceptorPromise.then(() =>
305
+ interceptor(localVarRequestOptions)
306
+ );
307
+ }
308
+
309
+ return interceptorPromise.then(() => {
310
+ if (Object.keys(localVarFormParams).length) {
311
+ if (localVarUseFormData) {
312
+ (<any>localVarRequestOptions).formData = localVarFormParams;
313
+ } else {
314
+ localVarRequestOptions.form = localVarFormParams;
315
+ }
316
+ }
317
+ return new Promise<{
318
+ response: http.IncomingMessage;
319
+ body: GetDestinationMetadata200Response;
320
+ }>((resolve, reject) => {
321
+ localVarRequest(
322
+ localVarRequestOptions,
323
+ (error, response, body) => {
324
+ if (error) {
325
+ reject(error);
326
+ } else {
327
+ if (
328
+ response.statusCode &&
329
+ response.statusCode >= 200 &&
330
+ response.statusCode <= 299
331
+ ) {
332
+ body = ObjectSerializer.deserialize(
333
+ body,
334
+ 'GetDestinationMetadata200Response'
335
+ );
336
+ resolve({ response: response, body: body });
337
+ } else {
338
+ reject(
339
+ new HttpError(
340
+ response,
341
+ body,
342
+ response.statusCode
343
+ )
344
+ );
345
+ }
346
+ }
347
+ }
348
+ );
349
+ });
350
+ });
351
+ }
352
+ /**
353
+ * Returns a Destination catalog item by its id.
354
+ * @summary Get Destination Metadata
355
+ * @param destinationMetadataId
356
+ */
357
+ public async getDestinationMetadataCurrent(
358
+ destinationMetadataId: string,
359
+ options: { headers: { [name: string]: string } } = { headers: {} }
360
+ ): Promise<{
361
+ response: http.IncomingMessage;
362
+ body: GetDestinationMetadata200Response;
363
+ }> {
364
+ const localVarPath =
365
+ this.basePath +
366
+ '/catalog/destinations/{destinationMetadataId}'.replace(
367
+ '{' + 'destinationMetadataId' + '}',
368
+ encodeURIComponent(String(destinationMetadataId))
369
+ );
370
+ let localVarQueryParameters: any = {};
371
+ let localVarHeaderParams: any = (<any>Object).assign(
372
+ {},
373
+ this._defaultHeaders
374
+ );
375
+ const produces = ['application/json'];
376
+ if (produces.indexOf('application/json') >= 0) {
377
+ localVarHeaderParams.Accept = produces[0];
378
+ } else {
379
+ localVarHeaderParams.Accept = 'application/json';
380
+ }
381
+ let localVarFormParams: any = {};
382
+
383
+ // verify required parameter 'destinationMetadataId' is not null or undefined
384
+ if (
385
+ destinationMetadataId === null ||
386
+ destinationMetadataId === undefined
387
+ ) {
388
+ throw new Error(
389
+ 'Required parameter destinationMetadataId was null or undefined when calling getDestinationMetadataCurrent.'
390
+ );
391
+ }
392
+
393
+ (<any>Object).assign(localVarHeaderParams, options.headers);
394
+
395
+ let localVarUseFormData = false;
396
+
397
+ let localVarRequestOptions: localVarRequest.Options = {
398
+ method: 'GET',
399
+ qs: localVarQueryParameters,
400
+ headers: localVarHeaderParams,
401
+ uri: localVarPath,
402
+ useQuerystring: this._useQuerystring,
403
+ json: true,
404
+ };
405
+
406
+ let authenticationPromise = Promise.resolve();
407
+ if (this.authentications.token.accessToken) {
408
+ authenticationPromise = authenticationPromise.then(() =>
409
+ this.authentications.token.applyToRequest(
410
+ localVarRequestOptions
411
+ )
412
+ );
413
+ }
414
+ authenticationPromise = authenticationPromise.then(() =>
415
+ this.authentications.default.applyToRequest(localVarRequestOptions)
416
+ );
417
+
418
+ let interceptorPromise = authenticationPromise;
419
+ for (const interceptor of this.interceptors) {
420
+ interceptorPromise = interceptorPromise.then(() =>
421
+ interceptor(localVarRequestOptions)
422
+ );
423
+ }
424
+
425
+ return interceptorPromise.then(() => {
426
+ if (Object.keys(localVarFormParams).length) {
427
+ if (localVarUseFormData) {
428
+ (<any>localVarRequestOptions).formData = localVarFormParams;
429
+ } else {
430
+ localVarRequestOptions.form = localVarFormParams;
431
+ }
432
+ }
433
+ return new Promise<{
434
+ response: http.IncomingMessage;
435
+ body: GetDestinationMetadata200Response;
436
+ }>((resolve, reject) => {
437
+ localVarRequest(
438
+ localVarRequestOptions,
439
+ (error, response, body) => {
440
+ if (error) {
441
+ reject(error);
442
+ } else {
443
+ if (
444
+ response.statusCode &&
445
+ response.statusCode >= 200 &&
446
+ response.statusCode <= 299
447
+ ) {
448
+ body = ObjectSerializer.deserialize(
449
+ body,
450
+ 'GetDestinationMetadata200Response'
451
+ );
452
+ resolve({ response: response, body: body });
453
+ } else {
454
+ reject(
455
+ new HttpError(
456
+ response,
457
+ body,
458
+ response.statusCode
459
+ )
460
+ );
461
+ }
462
+ }
463
+ }
464
+ );
465
+ });
466
+ });
467
+ }
468
+ /**
469
+ * Returns a Destination catalog item by its id.
470
+ * @summary Get Destination Metadata
471
+ * @param destinationMetadataId
472
+ */
473
+ public async getDestinationMetadataV1(
474
+ destinationMetadataId: string,
475
+ options: { headers: { [name: string]: string } } = { headers: {} }
476
+ ): Promise<{
477
+ response: http.IncomingMessage;
478
+ body: GetDestinationMetadata200Response;
479
+ }> {
480
+ const localVarPath =
481
+ this.basePath +
482
+ '/catalog/destinations/{destinationMetadataId}'.replace(
483
+ '{' + 'destinationMetadataId' + '}',
484
+ encodeURIComponent(String(destinationMetadataId))
485
+ );
486
+ let localVarQueryParameters: any = {};
487
+ let localVarHeaderParams: any = (<any>Object).assign(
488
+ {},
489
+ this._defaultHeaders
490
+ );
491
+ const produces = [
492
+ 'application/vnd.segment.v1+json',
493
+ 'application/json',
494
+ ];
495
+ if (produces.indexOf('application/json') >= 0) {
496
+ localVarHeaderParams.Accept = produces[0];
497
+ } else {
498
+ localVarHeaderParams.Accept = 'application/json';
499
+ }
500
+ let localVarFormParams: any = {};
501
+
502
+ // verify required parameter 'destinationMetadataId' is not null or undefined
503
+ if (
504
+ destinationMetadataId === null ||
505
+ destinationMetadataId === undefined
506
+ ) {
507
+ throw new Error(
508
+ 'Required parameter destinationMetadataId was null or undefined when calling getDestinationMetadataV1.'
509
+ );
510
+ }
511
+
512
+ (<any>Object).assign(localVarHeaderParams, options.headers);
513
+
514
+ let localVarUseFormData = false;
515
+
516
+ let localVarRequestOptions: localVarRequest.Options = {
517
+ method: 'GET',
518
+ qs: localVarQueryParameters,
519
+ headers: localVarHeaderParams,
520
+ uri: localVarPath,
521
+ useQuerystring: this._useQuerystring,
522
+ json: true,
523
+ };
524
+
525
+ let authenticationPromise = Promise.resolve();
526
+ if (this.authentications.token.accessToken) {
527
+ authenticationPromise = authenticationPromise.then(() =>
528
+ this.authentications.token.applyToRequest(
529
+ localVarRequestOptions
530
+ )
531
+ );
532
+ }
533
+ authenticationPromise = authenticationPromise.then(() =>
534
+ this.authentications.default.applyToRequest(localVarRequestOptions)
535
+ );
536
+
537
+ let interceptorPromise = authenticationPromise;
538
+ for (const interceptor of this.interceptors) {
539
+ interceptorPromise = interceptorPromise.then(() =>
540
+ interceptor(localVarRequestOptions)
541
+ );
542
+ }
543
+
544
+ return interceptorPromise.then(() => {
545
+ if (Object.keys(localVarFormParams).length) {
546
+ if (localVarUseFormData) {
547
+ (<any>localVarRequestOptions).formData = localVarFormParams;
548
+ } else {
549
+ localVarRequestOptions.form = localVarFormParams;
550
+ }
551
+ }
552
+ return new Promise<{
553
+ response: http.IncomingMessage;
554
+ body: GetDestinationMetadata200Response;
555
+ }>((resolve, reject) => {
556
+ localVarRequest(
557
+ localVarRequestOptions,
558
+ (error, response, body) => {
559
+ if (error) {
560
+ reject(error);
561
+ } else {
562
+ if (
563
+ response.statusCode &&
564
+ response.statusCode >= 200 &&
565
+ response.statusCode <= 299
566
+ ) {
567
+ body = ObjectSerializer.deserialize(
568
+ body,
569
+ 'GetDestinationMetadata200Response'
570
+ );
571
+ resolve({ response: response, body: body });
572
+ } else {
573
+ reject(
574
+ new HttpError(
575
+ response,
576
+ body,
577
+ response.statusCode
578
+ )
579
+ );
580
+ }
581
+ }
582
+ }
583
+ );
584
+ });
585
+ });
586
+ }
587
+ /**
588
+ * Returns a list of all available Destinations in the Segment catalog.
589
+ * @summary Get Destinations Catalog
590
+ * @param pagination Required pagination parameters used to filter the Destinations catalog. This parameter exists in alpha.
591
+ */
592
+ public async getDestinationsCatalogAlpha(
593
+ pagination: PaginationInput,
594
+ options: { headers: { [name: string]: string } } = { headers: {} }
595
+ ): Promise<{
596
+ response: http.IncomingMessage;
597
+ body: GetDestinationsCatalog200Response;
598
+ }> {
599
+ const localVarPath = this.basePath + '/catalog/destinations';
600
+ let localVarQueryParameters: any = {};
601
+ let localVarHeaderParams: any = (<any>Object).assign(
602
+ {},
603
+ this._defaultHeaders
604
+ );
605
+ const produces = [
606
+ 'application/vnd.segment.v1alpha+json',
607
+ 'application/json',
608
+ ];
609
+ if (produces.indexOf('application/json') >= 0) {
610
+ localVarHeaderParams.Accept = produces[0];
611
+ } else {
612
+ localVarHeaderParams.Accept = 'application/json';
613
+ }
614
+ let localVarFormParams: any = {};
615
+
616
+ // verify required parameter 'pagination' is not null or undefined
617
+ if (pagination === null || pagination === undefined) {
618
+ throw new Error(
619
+ 'Required parameter pagination was null or undefined when calling getDestinationsCatalogAlpha.'
620
+ );
621
+ }
622
+
623
+ if (pagination !== undefined) {
624
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
625
+ pagination,
626
+ 'PaginationInput'
627
+ );
628
+ }
629
+
630
+ (<any>Object).assign(localVarHeaderParams, options.headers);
631
+
632
+ let localVarUseFormData = false;
633
+
634
+ let localVarRequestOptions: localVarRequest.Options = {
635
+ method: 'GET',
636
+ qs: localVarQueryParameters,
637
+ headers: localVarHeaderParams,
638
+ uri: localVarPath,
639
+ useQuerystring: this._useQuerystring,
640
+ json: true,
641
+ };
642
+
643
+ let authenticationPromise = Promise.resolve();
644
+ if (this.authentications.token.accessToken) {
645
+ authenticationPromise = authenticationPromise.then(() =>
646
+ this.authentications.token.applyToRequest(
647
+ localVarRequestOptions
648
+ )
649
+ );
650
+ }
651
+ authenticationPromise = authenticationPromise.then(() =>
652
+ this.authentications.default.applyToRequest(localVarRequestOptions)
653
+ );
654
+
655
+ let interceptorPromise = authenticationPromise;
656
+ for (const interceptor of this.interceptors) {
657
+ interceptorPromise = interceptorPromise.then(() =>
658
+ interceptor(localVarRequestOptions)
659
+ );
660
+ }
661
+
662
+ return interceptorPromise.then(() => {
663
+ if (Object.keys(localVarFormParams).length) {
664
+ if (localVarUseFormData) {
665
+ (<any>localVarRequestOptions).formData = localVarFormParams;
666
+ } else {
667
+ localVarRequestOptions.form = localVarFormParams;
668
+ }
669
+ }
670
+ return new Promise<{
671
+ response: http.IncomingMessage;
672
+ body: GetDestinationsCatalog200Response;
673
+ }>((resolve, reject) => {
674
+ localVarRequest(
675
+ localVarRequestOptions,
676
+ (error, response, body) => {
677
+ if (error) {
678
+ reject(error);
679
+ } else {
680
+ if (
681
+ response.statusCode &&
682
+ response.statusCode >= 200 &&
683
+ response.statusCode <= 299
684
+ ) {
685
+ body = ObjectSerializer.deserialize(
686
+ body,
687
+ 'GetDestinationsCatalog200Response'
688
+ );
689
+ resolve({ response: response, body: body });
690
+ } else {
691
+ reject(
692
+ new HttpError(
693
+ response,
694
+ body,
695
+ response.statusCode
696
+ )
697
+ );
698
+ }
699
+ }
700
+ }
701
+ );
702
+ });
703
+ });
704
+ }
705
+ /**
706
+ * Returns a list of all available Destinations in the Segment catalog.
707
+ * @summary Get Destinations Catalog
708
+ * @param pagination Required pagination parameters used to filter the Destinations catalog. This parameter exists in alpha.
709
+ */
710
+ public async getDestinationsCatalogBeta(
711
+ pagination: PaginationInput,
712
+ options: { headers: { [name: string]: string } } = { headers: {} }
713
+ ): Promise<{
714
+ response: http.IncomingMessage;
715
+ body: GetDestinationsCatalog200Response;
716
+ }> {
717
+ const localVarPath = this.basePath + '/catalog/destinations';
718
+ let localVarQueryParameters: any = {};
719
+ let localVarHeaderParams: any = (<any>Object).assign(
720
+ {},
721
+ this._defaultHeaders
722
+ );
723
+ const produces = [
724
+ 'application/vnd.segment.v1beta+json',
725
+ 'application/json',
726
+ ];
727
+ if (produces.indexOf('application/json') >= 0) {
728
+ localVarHeaderParams.Accept = produces[0];
729
+ } else {
730
+ localVarHeaderParams.Accept = 'application/json';
731
+ }
732
+ let localVarFormParams: any = {};
733
+
734
+ // verify required parameter 'pagination' is not null or undefined
735
+ if (pagination === null || pagination === undefined) {
736
+ throw new Error(
737
+ 'Required parameter pagination was null or undefined when calling getDestinationsCatalogBeta.'
738
+ );
739
+ }
740
+
741
+ if (pagination !== undefined) {
742
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
743
+ pagination,
744
+ 'PaginationInput'
745
+ );
746
+ }
747
+
748
+ (<any>Object).assign(localVarHeaderParams, options.headers);
749
+
750
+ let localVarUseFormData = false;
751
+
752
+ let localVarRequestOptions: localVarRequest.Options = {
753
+ method: 'GET',
754
+ qs: localVarQueryParameters,
755
+ headers: localVarHeaderParams,
756
+ uri: localVarPath,
757
+ useQuerystring: this._useQuerystring,
758
+ json: true,
759
+ };
760
+
761
+ let authenticationPromise = Promise.resolve();
762
+ if (this.authentications.token.accessToken) {
763
+ authenticationPromise = authenticationPromise.then(() =>
764
+ this.authentications.token.applyToRequest(
765
+ localVarRequestOptions
766
+ )
767
+ );
768
+ }
769
+ authenticationPromise = authenticationPromise.then(() =>
770
+ this.authentications.default.applyToRequest(localVarRequestOptions)
771
+ );
772
+
773
+ let interceptorPromise = authenticationPromise;
774
+ for (const interceptor of this.interceptors) {
775
+ interceptorPromise = interceptorPromise.then(() =>
776
+ interceptor(localVarRequestOptions)
777
+ );
778
+ }
779
+
780
+ return interceptorPromise.then(() => {
781
+ if (Object.keys(localVarFormParams).length) {
782
+ if (localVarUseFormData) {
783
+ (<any>localVarRequestOptions).formData = localVarFormParams;
784
+ } else {
785
+ localVarRequestOptions.form = localVarFormParams;
786
+ }
787
+ }
788
+ return new Promise<{
789
+ response: http.IncomingMessage;
790
+ body: GetDestinationsCatalog200Response;
791
+ }>((resolve, reject) => {
792
+ localVarRequest(
793
+ localVarRequestOptions,
794
+ (error, response, body) => {
795
+ if (error) {
796
+ reject(error);
797
+ } else {
798
+ if (
799
+ response.statusCode &&
800
+ response.statusCode >= 200 &&
801
+ response.statusCode <= 299
802
+ ) {
803
+ body = ObjectSerializer.deserialize(
804
+ body,
805
+ 'GetDestinationsCatalog200Response'
806
+ );
807
+ resolve({ response: response, body: body });
808
+ } else {
809
+ reject(
810
+ new HttpError(
811
+ response,
812
+ body,
813
+ response.statusCode
814
+ )
815
+ );
816
+ }
817
+ }
818
+ }
819
+ );
820
+ });
821
+ });
822
+ }
823
+ /**
824
+ * Returns a list of all available Destinations in the Segment catalog.
825
+ * @summary Get Destinations Catalog
826
+ * @param pagination Required pagination parameters used to filter the Destinations catalog. This parameter exists in alpha.
827
+ */
828
+ public async getDestinationsCatalogCurrent(
829
+ pagination: PaginationInput,
830
+ options: { headers: { [name: string]: string } } = { headers: {} }
831
+ ): Promise<{
832
+ response: http.IncomingMessage;
833
+ body: GetDestinationsCatalog200Response;
834
+ }> {
835
+ const localVarPath = this.basePath + '/catalog/destinations';
836
+ let localVarQueryParameters: any = {};
837
+ let localVarHeaderParams: any = (<any>Object).assign(
838
+ {},
839
+ this._defaultHeaders
840
+ );
841
+ const produces = ['application/json'];
842
+ if (produces.indexOf('application/json') >= 0) {
843
+ localVarHeaderParams.Accept = produces[0];
844
+ } else {
845
+ localVarHeaderParams.Accept = 'application/json';
846
+ }
847
+ let localVarFormParams: any = {};
848
+
849
+ // verify required parameter 'pagination' is not null or undefined
850
+ if (pagination === null || pagination === undefined) {
851
+ throw new Error(
852
+ 'Required parameter pagination was null or undefined when calling getDestinationsCatalogCurrent.'
853
+ );
854
+ }
855
+
856
+ if (pagination !== undefined) {
857
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
858
+ pagination,
859
+ 'PaginationInput'
860
+ );
861
+ }
862
+
863
+ (<any>Object).assign(localVarHeaderParams, options.headers);
864
+
865
+ let localVarUseFormData = false;
866
+
867
+ let localVarRequestOptions: localVarRequest.Options = {
868
+ method: 'GET',
869
+ qs: localVarQueryParameters,
870
+ headers: localVarHeaderParams,
871
+ uri: localVarPath,
872
+ useQuerystring: this._useQuerystring,
873
+ json: true,
874
+ };
875
+
876
+ let authenticationPromise = Promise.resolve();
877
+ if (this.authentications.token.accessToken) {
878
+ authenticationPromise = authenticationPromise.then(() =>
879
+ this.authentications.token.applyToRequest(
880
+ localVarRequestOptions
881
+ )
882
+ );
883
+ }
884
+ authenticationPromise = authenticationPromise.then(() =>
885
+ this.authentications.default.applyToRequest(localVarRequestOptions)
886
+ );
887
+
888
+ let interceptorPromise = authenticationPromise;
889
+ for (const interceptor of this.interceptors) {
890
+ interceptorPromise = interceptorPromise.then(() =>
891
+ interceptor(localVarRequestOptions)
892
+ );
893
+ }
894
+
895
+ return interceptorPromise.then(() => {
896
+ if (Object.keys(localVarFormParams).length) {
897
+ if (localVarUseFormData) {
898
+ (<any>localVarRequestOptions).formData = localVarFormParams;
899
+ } else {
900
+ localVarRequestOptions.form = localVarFormParams;
901
+ }
902
+ }
903
+ return new Promise<{
904
+ response: http.IncomingMessage;
905
+ body: GetDestinationsCatalog200Response;
906
+ }>((resolve, reject) => {
907
+ localVarRequest(
908
+ localVarRequestOptions,
909
+ (error, response, body) => {
910
+ if (error) {
911
+ reject(error);
912
+ } else {
913
+ if (
914
+ response.statusCode &&
915
+ response.statusCode >= 200 &&
916
+ response.statusCode <= 299
917
+ ) {
918
+ body = ObjectSerializer.deserialize(
919
+ body,
920
+ 'GetDestinationsCatalog200Response'
921
+ );
922
+ resolve({ response: response, body: body });
923
+ } else {
924
+ reject(
925
+ new HttpError(
926
+ response,
927
+ body,
928
+ response.statusCode
929
+ )
930
+ );
931
+ }
932
+ }
933
+ }
934
+ );
935
+ });
936
+ });
937
+ }
938
+ /**
939
+ * Returns a list of all available Destinations in the Segment catalog.
940
+ * @summary Get Destinations Catalog
941
+ * @param pagination Required pagination parameters used to filter the Destinations catalog. This parameter exists in alpha.
942
+ */
943
+ public async getDestinationsCatalogV1(
944
+ pagination: PaginationInput,
945
+ options: { headers: { [name: string]: string } } = { headers: {} }
946
+ ): Promise<{
947
+ response: http.IncomingMessage;
948
+ body: GetDestinationsCatalog200Response;
949
+ }> {
950
+ const localVarPath = this.basePath + '/catalog/destinations';
951
+ let localVarQueryParameters: any = {};
952
+ let localVarHeaderParams: any = (<any>Object).assign(
953
+ {},
954
+ this._defaultHeaders
955
+ );
956
+ const produces = [
957
+ 'application/vnd.segment.v1+json',
958
+ 'application/json',
959
+ ];
960
+ if (produces.indexOf('application/json') >= 0) {
961
+ localVarHeaderParams.Accept = produces[0];
962
+ } else {
963
+ localVarHeaderParams.Accept = 'application/json';
964
+ }
965
+ let localVarFormParams: any = {};
966
+
967
+ // verify required parameter 'pagination' is not null or undefined
968
+ if (pagination === null || pagination === undefined) {
969
+ throw new Error(
970
+ 'Required parameter pagination was null or undefined when calling getDestinationsCatalogV1.'
971
+ );
972
+ }
973
+
974
+ if (pagination !== undefined) {
975
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
976
+ pagination,
977
+ 'PaginationInput'
978
+ );
979
+ }
980
+
981
+ (<any>Object).assign(localVarHeaderParams, options.headers);
982
+
983
+ let localVarUseFormData = false;
984
+
985
+ let localVarRequestOptions: localVarRequest.Options = {
986
+ method: 'GET',
987
+ qs: localVarQueryParameters,
988
+ headers: localVarHeaderParams,
989
+ uri: localVarPath,
990
+ useQuerystring: this._useQuerystring,
991
+ json: true,
992
+ };
993
+
994
+ let authenticationPromise = Promise.resolve();
995
+ if (this.authentications.token.accessToken) {
996
+ authenticationPromise = authenticationPromise.then(() =>
997
+ this.authentications.token.applyToRequest(
998
+ localVarRequestOptions
999
+ )
1000
+ );
1001
+ }
1002
+ authenticationPromise = authenticationPromise.then(() =>
1003
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1004
+ );
1005
+
1006
+ let interceptorPromise = authenticationPromise;
1007
+ for (const interceptor of this.interceptors) {
1008
+ interceptorPromise = interceptorPromise.then(() =>
1009
+ interceptor(localVarRequestOptions)
1010
+ );
1011
+ }
1012
+
1013
+ return interceptorPromise.then(() => {
1014
+ if (Object.keys(localVarFormParams).length) {
1015
+ if (localVarUseFormData) {
1016
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1017
+ } else {
1018
+ localVarRequestOptions.form = localVarFormParams;
1019
+ }
1020
+ }
1021
+ return new Promise<{
1022
+ response: http.IncomingMessage;
1023
+ body: GetDestinationsCatalog200Response;
1024
+ }>((resolve, reject) => {
1025
+ localVarRequest(
1026
+ localVarRequestOptions,
1027
+ (error, response, body) => {
1028
+ if (error) {
1029
+ reject(error);
1030
+ } else {
1031
+ if (
1032
+ response.statusCode &&
1033
+ response.statusCode >= 200 &&
1034
+ response.statusCode <= 299
1035
+ ) {
1036
+ body = ObjectSerializer.deserialize(
1037
+ body,
1038
+ 'GetDestinationsCatalog200Response'
1039
+ );
1040
+ resolve({ response: response, body: body });
1041
+ } else {
1042
+ reject(
1043
+ new HttpError(
1044
+ response,
1045
+ body,
1046
+ response.statusCode
1047
+ )
1048
+ );
1049
+ }
1050
+ }
1051
+ }
1052
+ );
1053
+ });
1054
+ });
1055
+ }
1056
+ /**
1057
+ * Returns a Source catalog item by its id.
1058
+ * @summary Get Source Metadata
1059
+ * @param sourceMetadataId
1060
+ */
1061
+ public async getSourceMetadataAlpha(
1062
+ sourceMetadataId: string,
1063
+ options: { headers: { [name: string]: string } } = { headers: {} }
1064
+ ): Promise<{
1065
+ response: http.IncomingMessage;
1066
+ body: GetSourceMetadata200Response;
1067
+ }> {
1068
+ const localVarPath =
1069
+ this.basePath +
1070
+ '/catalog/sources/{sourceMetadataId}'.replace(
1071
+ '{' + 'sourceMetadataId' + '}',
1072
+ encodeURIComponent(String(sourceMetadataId))
1073
+ );
1074
+ let localVarQueryParameters: any = {};
1075
+ let localVarHeaderParams: any = (<any>Object).assign(
1076
+ {},
1077
+ this._defaultHeaders
1078
+ );
1079
+ const produces = [
1080
+ 'application/vnd.segment.v1alpha+json',
1081
+ 'application/json',
1082
+ ];
1083
+ if (produces.indexOf('application/json') >= 0) {
1084
+ localVarHeaderParams.Accept = produces[0];
1085
+ } else {
1086
+ localVarHeaderParams.Accept = 'application/json';
1087
+ }
1088
+ let localVarFormParams: any = {};
1089
+
1090
+ // verify required parameter 'sourceMetadataId' is not null or undefined
1091
+ if (sourceMetadataId === null || sourceMetadataId === undefined) {
1092
+ throw new Error(
1093
+ 'Required parameter sourceMetadataId was null or undefined when calling getSourceMetadataAlpha.'
1094
+ );
1095
+ }
1096
+
1097
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1098
+
1099
+ let localVarUseFormData = false;
1100
+
1101
+ let localVarRequestOptions: localVarRequest.Options = {
1102
+ method: 'GET',
1103
+ qs: localVarQueryParameters,
1104
+ headers: localVarHeaderParams,
1105
+ uri: localVarPath,
1106
+ useQuerystring: this._useQuerystring,
1107
+ json: true,
1108
+ };
1109
+
1110
+ let authenticationPromise = Promise.resolve();
1111
+ if (this.authentications.token.accessToken) {
1112
+ authenticationPromise = authenticationPromise.then(() =>
1113
+ this.authentications.token.applyToRequest(
1114
+ localVarRequestOptions
1115
+ )
1116
+ );
1117
+ }
1118
+ authenticationPromise = authenticationPromise.then(() =>
1119
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1120
+ );
1121
+
1122
+ let interceptorPromise = authenticationPromise;
1123
+ for (const interceptor of this.interceptors) {
1124
+ interceptorPromise = interceptorPromise.then(() =>
1125
+ interceptor(localVarRequestOptions)
1126
+ );
1127
+ }
1128
+
1129
+ return interceptorPromise.then(() => {
1130
+ if (Object.keys(localVarFormParams).length) {
1131
+ if (localVarUseFormData) {
1132
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1133
+ } else {
1134
+ localVarRequestOptions.form = localVarFormParams;
1135
+ }
1136
+ }
1137
+ return new Promise<{
1138
+ response: http.IncomingMessage;
1139
+ body: GetSourceMetadata200Response;
1140
+ }>((resolve, reject) => {
1141
+ localVarRequest(
1142
+ localVarRequestOptions,
1143
+ (error, response, body) => {
1144
+ if (error) {
1145
+ reject(error);
1146
+ } else {
1147
+ if (
1148
+ response.statusCode &&
1149
+ response.statusCode >= 200 &&
1150
+ response.statusCode <= 299
1151
+ ) {
1152
+ body = ObjectSerializer.deserialize(
1153
+ body,
1154
+ 'GetSourceMetadata200Response'
1155
+ );
1156
+ resolve({ response: response, body: body });
1157
+ } else {
1158
+ reject(
1159
+ new HttpError(
1160
+ response,
1161
+ body,
1162
+ response.statusCode
1163
+ )
1164
+ );
1165
+ }
1166
+ }
1167
+ }
1168
+ );
1169
+ });
1170
+ });
1171
+ }
1172
+ /**
1173
+ * Returns a Source catalog item by its id.
1174
+ * @summary Get Source Metadata
1175
+ * @param sourceMetadataId
1176
+ */
1177
+ public async getSourceMetadataBeta(
1178
+ sourceMetadataId: string,
1179
+ options: { headers: { [name: string]: string } } = { headers: {} }
1180
+ ): Promise<{
1181
+ response: http.IncomingMessage;
1182
+ body: GetSourceMetadata200Response;
1183
+ }> {
1184
+ const localVarPath =
1185
+ this.basePath +
1186
+ '/catalog/sources/{sourceMetadataId}'.replace(
1187
+ '{' + 'sourceMetadataId' + '}',
1188
+ encodeURIComponent(String(sourceMetadataId))
1189
+ );
1190
+ let localVarQueryParameters: any = {};
1191
+ let localVarHeaderParams: any = (<any>Object).assign(
1192
+ {},
1193
+ this._defaultHeaders
1194
+ );
1195
+ const produces = [
1196
+ 'application/vnd.segment.v1beta+json',
1197
+ 'application/json',
1198
+ ];
1199
+ if (produces.indexOf('application/json') >= 0) {
1200
+ localVarHeaderParams.Accept = produces[0];
1201
+ } else {
1202
+ localVarHeaderParams.Accept = 'application/json';
1203
+ }
1204
+ let localVarFormParams: any = {};
1205
+
1206
+ // verify required parameter 'sourceMetadataId' is not null or undefined
1207
+ if (sourceMetadataId === null || sourceMetadataId === undefined) {
1208
+ throw new Error(
1209
+ 'Required parameter sourceMetadataId was null or undefined when calling getSourceMetadataBeta.'
1210
+ );
1211
+ }
1212
+
1213
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1214
+
1215
+ let localVarUseFormData = false;
1216
+
1217
+ let localVarRequestOptions: localVarRequest.Options = {
1218
+ method: 'GET',
1219
+ qs: localVarQueryParameters,
1220
+ headers: localVarHeaderParams,
1221
+ uri: localVarPath,
1222
+ useQuerystring: this._useQuerystring,
1223
+ json: true,
1224
+ };
1225
+
1226
+ let authenticationPromise = Promise.resolve();
1227
+ if (this.authentications.token.accessToken) {
1228
+ authenticationPromise = authenticationPromise.then(() =>
1229
+ this.authentications.token.applyToRequest(
1230
+ localVarRequestOptions
1231
+ )
1232
+ );
1233
+ }
1234
+ authenticationPromise = authenticationPromise.then(() =>
1235
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1236
+ );
1237
+
1238
+ let interceptorPromise = authenticationPromise;
1239
+ for (const interceptor of this.interceptors) {
1240
+ interceptorPromise = interceptorPromise.then(() =>
1241
+ interceptor(localVarRequestOptions)
1242
+ );
1243
+ }
1244
+
1245
+ return interceptorPromise.then(() => {
1246
+ if (Object.keys(localVarFormParams).length) {
1247
+ if (localVarUseFormData) {
1248
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1249
+ } else {
1250
+ localVarRequestOptions.form = localVarFormParams;
1251
+ }
1252
+ }
1253
+ return new Promise<{
1254
+ response: http.IncomingMessage;
1255
+ body: GetSourceMetadata200Response;
1256
+ }>((resolve, reject) => {
1257
+ localVarRequest(
1258
+ localVarRequestOptions,
1259
+ (error, response, body) => {
1260
+ if (error) {
1261
+ reject(error);
1262
+ } else {
1263
+ if (
1264
+ response.statusCode &&
1265
+ response.statusCode >= 200 &&
1266
+ response.statusCode <= 299
1267
+ ) {
1268
+ body = ObjectSerializer.deserialize(
1269
+ body,
1270
+ 'GetSourceMetadata200Response'
1271
+ );
1272
+ resolve({ response: response, body: body });
1273
+ } else {
1274
+ reject(
1275
+ new HttpError(
1276
+ response,
1277
+ body,
1278
+ response.statusCode
1279
+ )
1280
+ );
1281
+ }
1282
+ }
1283
+ }
1284
+ );
1285
+ });
1286
+ });
1287
+ }
1288
+ /**
1289
+ * Returns a Source catalog item by its id.
1290
+ * @summary Get Source Metadata
1291
+ * @param sourceMetadataId
1292
+ */
1293
+ public async getSourceMetadataCurrent(
1294
+ sourceMetadataId: string,
1295
+ options: { headers: { [name: string]: string } } = { headers: {} }
1296
+ ): Promise<{
1297
+ response: http.IncomingMessage;
1298
+ body: GetSourceMetadata200Response;
1299
+ }> {
1300
+ const localVarPath =
1301
+ this.basePath +
1302
+ '/catalog/sources/{sourceMetadataId}'.replace(
1303
+ '{' + 'sourceMetadataId' + '}',
1304
+ encodeURIComponent(String(sourceMetadataId))
1305
+ );
1306
+ let localVarQueryParameters: any = {};
1307
+ let localVarHeaderParams: any = (<any>Object).assign(
1308
+ {},
1309
+ this._defaultHeaders
1310
+ );
1311
+ const produces = ['application/json'];
1312
+ if (produces.indexOf('application/json') >= 0) {
1313
+ localVarHeaderParams.Accept = produces[0];
1314
+ } else {
1315
+ localVarHeaderParams.Accept = 'application/json';
1316
+ }
1317
+ let localVarFormParams: any = {};
1318
+
1319
+ // verify required parameter 'sourceMetadataId' is not null or undefined
1320
+ if (sourceMetadataId === null || sourceMetadataId === undefined) {
1321
+ throw new Error(
1322
+ 'Required parameter sourceMetadataId was null or undefined when calling getSourceMetadataCurrent.'
1323
+ );
1324
+ }
1325
+
1326
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1327
+
1328
+ let localVarUseFormData = false;
1329
+
1330
+ let localVarRequestOptions: localVarRequest.Options = {
1331
+ method: 'GET',
1332
+ qs: localVarQueryParameters,
1333
+ headers: localVarHeaderParams,
1334
+ uri: localVarPath,
1335
+ useQuerystring: this._useQuerystring,
1336
+ json: true,
1337
+ };
1338
+
1339
+ let authenticationPromise = Promise.resolve();
1340
+ if (this.authentications.token.accessToken) {
1341
+ authenticationPromise = authenticationPromise.then(() =>
1342
+ this.authentications.token.applyToRequest(
1343
+ localVarRequestOptions
1344
+ )
1345
+ );
1346
+ }
1347
+ authenticationPromise = authenticationPromise.then(() =>
1348
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1349
+ );
1350
+
1351
+ let interceptorPromise = authenticationPromise;
1352
+ for (const interceptor of this.interceptors) {
1353
+ interceptorPromise = interceptorPromise.then(() =>
1354
+ interceptor(localVarRequestOptions)
1355
+ );
1356
+ }
1357
+
1358
+ return interceptorPromise.then(() => {
1359
+ if (Object.keys(localVarFormParams).length) {
1360
+ if (localVarUseFormData) {
1361
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1362
+ } else {
1363
+ localVarRequestOptions.form = localVarFormParams;
1364
+ }
1365
+ }
1366
+ return new Promise<{
1367
+ response: http.IncomingMessage;
1368
+ body: GetSourceMetadata200Response;
1369
+ }>((resolve, reject) => {
1370
+ localVarRequest(
1371
+ localVarRequestOptions,
1372
+ (error, response, body) => {
1373
+ if (error) {
1374
+ reject(error);
1375
+ } else {
1376
+ if (
1377
+ response.statusCode &&
1378
+ response.statusCode >= 200 &&
1379
+ response.statusCode <= 299
1380
+ ) {
1381
+ body = ObjectSerializer.deserialize(
1382
+ body,
1383
+ 'GetSourceMetadata200Response'
1384
+ );
1385
+ resolve({ response: response, body: body });
1386
+ } else {
1387
+ reject(
1388
+ new HttpError(
1389
+ response,
1390
+ body,
1391
+ response.statusCode
1392
+ )
1393
+ );
1394
+ }
1395
+ }
1396
+ }
1397
+ );
1398
+ });
1399
+ });
1400
+ }
1401
+ /**
1402
+ * Returns a Source catalog item by its id.
1403
+ * @summary Get Source Metadata
1404
+ * @param sourceMetadataId
1405
+ */
1406
+ public async getSourceMetadataV1(
1407
+ sourceMetadataId: string,
1408
+ options: { headers: { [name: string]: string } } = { headers: {} }
1409
+ ): Promise<{
1410
+ response: http.IncomingMessage;
1411
+ body: GetSourceMetadata200Response;
1412
+ }> {
1413
+ const localVarPath =
1414
+ this.basePath +
1415
+ '/catalog/sources/{sourceMetadataId}'.replace(
1416
+ '{' + 'sourceMetadataId' + '}',
1417
+ encodeURIComponent(String(sourceMetadataId))
1418
+ );
1419
+ let localVarQueryParameters: any = {};
1420
+ let localVarHeaderParams: any = (<any>Object).assign(
1421
+ {},
1422
+ this._defaultHeaders
1423
+ );
1424
+ const produces = [
1425
+ 'application/vnd.segment.v1+json',
1426
+ 'application/json',
1427
+ ];
1428
+ if (produces.indexOf('application/json') >= 0) {
1429
+ localVarHeaderParams.Accept = produces[0];
1430
+ } else {
1431
+ localVarHeaderParams.Accept = 'application/json';
1432
+ }
1433
+ let localVarFormParams: any = {};
1434
+
1435
+ // verify required parameter 'sourceMetadataId' is not null or undefined
1436
+ if (sourceMetadataId === null || sourceMetadataId === undefined) {
1437
+ throw new Error(
1438
+ 'Required parameter sourceMetadataId was null or undefined when calling getSourceMetadataV1.'
1439
+ );
1440
+ }
1441
+
1442
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1443
+
1444
+ let localVarUseFormData = false;
1445
+
1446
+ let localVarRequestOptions: localVarRequest.Options = {
1447
+ method: 'GET',
1448
+ qs: localVarQueryParameters,
1449
+ headers: localVarHeaderParams,
1450
+ uri: localVarPath,
1451
+ useQuerystring: this._useQuerystring,
1452
+ json: true,
1453
+ };
1454
+
1455
+ let authenticationPromise = Promise.resolve();
1456
+ if (this.authentications.token.accessToken) {
1457
+ authenticationPromise = authenticationPromise.then(() =>
1458
+ this.authentications.token.applyToRequest(
1459
+ localVarRequestOptions
1460
+ )
1461
+ );
1462
+ }
1463
+ authenticationPromise = authenticationPromise.then(() =>
1464
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1465
+ );
1466
+
1467
+ let interceptorPromise = authenticationPromise;
1468
+ for (const interceptor of this.interceptors) {
1469
+ interceptorPromise = interceptorPromise.then(() =>
1470
+ interceptor(localVarRequestOptions)
1471
+ );
1472
+ }
1473
+
1474
+ return interceptorPromise.then(() => {
1475
+ if (Object.keys(localVarFormParams).length) {
1476
+ if (localVarUseFormData) {
1477
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1478
+ } else {
1479
+ localVarRequestOptions.form = localVarFormParams;
1480
+ }
1481
+ }
1482
+ return new Promise<{
1483
+ response: http.IncomingMessage;
1484
+ body: GetSourceMetadata200Response;
1485
+ }>((resolve, reject) => {
1486
+ localVarRequest(
1487
+ localVarRequestOptions,
1488
+ (error, response, body) => {
1489
+ if (error) {
1490
+ reject(error);
1491
+ } else {
1492
+ if (
1493
+ response.statusCode &&
1494
+ response.statusCode >= 200 &&
1495
+ response.statusCode <= 299
1496
+ ) {
1497
+ body = ObjectSerializer.deserialize(
1498
+ body,
1499
+ 'GetSourceMetadata200Response'
1500
+ );
1501
+ resolve({ response: response, body: body });
1502
+ } else {
1503
+ reject(
1504
+ new HttpError(
1505
+ response,
1506
+ body,
1507
+ response.statusCode
1508
+ )
1509
+ );
1510
+ }
1511
+ }
1512
+ }
1513
+ );
1514
+ });
1515
+ });
1516
+ }
1517
+ /**
1518
+ * Returns a list of all available Sources in the Segment catalog.
1519
+ * @summary Get Sources Catalog
1520
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1521
+ */
1522
+ public async getSourcesCatalogAlpha(
1523
+ pagination: PaginationInput,
1524
+ options: { headers: { [name: string]: string } } = { headers: {} }
1525
+ ): Promise<{
1526
+ response: http.IncomingMessage;
1527
+ body: GetSourcesCatalog200Response;
1528
+ }> {
1529
+ const localVarPath = this.basePath + '/catalog/sources';
1530
+ let localVarQueryParameters: any = {};
1531
+ let localVarHeaderParams: any = (<any>Object).assign(
1532
+ {},
1533
+ this._defaultHeaders
1534
+ );
1535
+ const produces = [
1536
+ 'application/vnd.segment.v1alpha+json',
1537
+ 'application/json',
1538
+ ];
1539
+ if (produces.indexOf('application/json') >= 0) {
1540
+ localVarHeaderParams.Accept = produces[0];
1541
+ } else {
1542
+ localVarHeaderParams.Accept = 'application/json';
1543
+ }
1544
+ let localVarFormParams: any = {};
1545
+
1546
+ // verify required parameter 'pagination' is not null or undefined
1547
+ if (pagination === null || pagination === undefined) {
1548
+ throw new Error(
1549
+ 'Required parameter pagination was null or undefined when calling getSourcesCatalogAlpha.'
1550
+ );
1551
+ }
1552
+
1553
+ if (pagination !== undefined) {
1554
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1555
+ pagination,
1556
+ 'PaginationInput'
1557
+ );
1558
+ }
1559
+
1560
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1561
+
1562
+ let localVarUseFormData = false;
1563
+
1564
+ let localVarRequestOptions: localVarRequest.Options = {
1565
+ method: 'GET',
1566
+ qs: localVarQueryParameters,
1567
+ headers: localVarHeaderParams,
1568
+ uri: localVarPath,
1569
+ useQuerystring: this._useQuerystring,
1570
+ json: true,
1571
+ };
1572
+
1573
+ let authenticationPromise = Promise.resolve();
1574
+ if (this.authentications.token.accessToken) {
1575
+ authenticationPromise = authenticationPromise.then(() =>
1576
+ this.authentications.token.applyToRequest(
1577
+ localVarRequestOptions
1578
+ )
1579
+ );
1580
+ }
1581
+ authenticationPromise = authenticationPromise.then(() =>
1582
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1583
+ );
1584
+
1585
+ let interceptorPromise = authenticationPromise;
1586
+ for (const interceptor of this.interceptors) {
1587
+ interceptorPromise = interceptorPromise.then(() =>
1588
+ interceptor(localVarRequestOptions)
1589
+ );
1590
+ }
1591
+
1592
+ return interceptorPromise.then(() => {
1593
+ if (Object.keys(localVarFormParams).length) {
1594
+ if (localVarUseFormData) {
1595
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1596
+ } else {
1597
+ localVarRequestOptions.form = localVarFormParams;
1598
+ }
1599
+ }
1600
+ return new Promise<{
1601
+ response: http.IncomingMessage;
1602
+ body: GetSourcesCatalog200Response;
1603
+ }>((resolve, reject) => {
1604
+ localVarRequest(
1605
+ localVarRequestOptions,
1606
+ (error, response, body) => {
1607
+ if (error) {
1608
+ reject(error);
1609
+ } else {
1610
+ if (
1611
+ response.statusCode &&
1612
+ response.statusCode >= 200 &&
1613
+ response.statusCode <= 299
1614
+ ) {
1615
+ body = ObjectSerializer.deserialize(
1616
+ body,
1617
+ 'GetSourcesCatalog200Response'
1618
+ );
1619
+ resolve({ response: response, body: body });
1620
+ } else {
1621
+ reject(
1622
+ new HttpError(
1623
+ response,
1624
+ body,
1625
+ response.statusCode
1626
+ )
1627
+ );
1628
+ }
1629
+ }
1630
+ }
1631
+ );
1632
+ });
1633
+ });
1634
+ }
1635
+ /**
1636
+ * Returns a list of all available Sources in the Segment catalog.
1637
+ * @summary Get Sources Catalog
1638
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1639
+ */
1640
+ public async getSourcesCatalogBeta(
1641
+ pagination: PaginationInput,
1642
+ options: { headers: { [name: string]: string } } = { headers: {} }
1643
+ ): Promise<{
1644
+ response: http.IncomingMessage;
1645
+ body: GetSourcesCatalog200Response;
1646
+ }> {
1647
+ const localVarPath = this.basePath + '/catalog/sources';
1648
+ let localVarQueryParameters: any = {};
1649
+ let localVarHeaderParams: any = (<any>Object).assign(
1650
+ {},
1651
+ this._defaultHeaders
1652
+ );
1653
+ const produces = [
1654
+ 'application/vnd.segment.v1beta+json',
1655
+ 'application/json',
1656
+ ];
1657
+ if (produces.indexOf('application/json') >= 0) {
1658
+ localVarHeaderParams.Accept = produces[0];
1659
+ } else {
1660
+ localVarHeaderParams.Accept = 'application/json';
1661
+ }
1662
+ let localVarFormParams: any = {};
1663
+
1664
+ // verify required parameter 'pagination' is not null or undefined
1665
+ if (pagination === null || pagination === undefined) {
1666
+ throw new Error(
1667
+ 'Required parameter pagination was null or undefined when calling getSourcesCatalogBeta.'
1668
+ );
1669
+ }
1670
+
1671
+ if (pagination !== undefined) {
1672
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1673
+ pagination,
1674
+ 'PaginationInput'
1675
+ );
1676
+ }
1677
+
1678
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1679
+
1680
+ let localVarUseFormData = false;
1681
+
1682
+ let localVarRequestOptions: localVarRequest.Options = {
1683
+ method: 'GET',
1684
+ qs: localVarQueryParameters,
1685
+ headers: localVarHeaderParams,
1686
+ uri: localVarPath,
1687
+ useQuerystring: this._useQuerystring,
1688
+ json: true,
1689
+ };
1690
+
1691
+ let authenticationPromise = Promise.resolve();
1692
+ if (this.authentications.token.accessToken) {
1693
+ authenticationPromise = authenticationPromise.then(() =>
1694
+ this.authentications.token.applyToRequest(
1695
+ localVarRequestOptions
1696
+ )
1697
+ );
1698
+ }
1699
+ authenticationPromise = authenticationPromise.then(() =>
1700
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1701
+ );
1702
+
1703
+ let interceptorPromise = authenticationPromise;
1704
+ for (const interceptor of this.interceptors) {
1705
+ interceptorPromise = interceptorPromise.then(() =>
1706
+ interceptor(localVarRequestOptions)
1707
+ );
1708
+ }
1709
+
1710
+ return interceptorPromise.then(() => {
1711
+ if (Object.keys(localVarFormParams).length) {
1712
+ if (localVarUseFormData) {
1713
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1714
+ } else {
1715
+ localVarRequestOptions.form = localVarFormParams;
1716
+ }
1717
+ }
1718
+ return new Promise<{
1719
+ response: http.IncomingMessage;
1720
+ body: GetSourcesCatalog200Response;
1721
+ }>((resolve, reject) => {
1722
+ localVarRequest(
1723
+ localVarRequestOptions,
1724
+ (error, response, body) => {
1725
+ if (error) {
1726
+ reject(error);
1727
+ } else {
1728
+ if (
1729
+ response.statusCode &&
1730
+ response.statusCode >= 200 &&
1731
+ response.statusCode <= 299
1732
+ ) {
1733
+ body = ObjectSerializer.deserialize(
1734
+ body,
1735
+ 'GetSourcesCatalog200Response'
1736
+ );
1737
+ resolve({ response: response, body: body });
1738
+ } else {
1739
+ reject(
1740
+ new HttpError(
1741
+ response,
1742
+ body,
1743
+ response.statusCode
1744
+ )
1745
+ );
1746
+ }
1747
+ }
1748
+ }
1749
+ );
1750
+ });
1751
+ });
1752
+ }
1753
+ /**
1754
+ * Returns a list of all available Sources in the Segment catalog.
1755
+ * @summary Get Sources Catalog
1756
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1757
+ */
1758
+ public async getSourcesCatalogCurrent(
1759
+ pagination: PaginationInput,
1760
+ options: { headers: { [name: string]: string } } = { headers: {} }
1761
+ ): Promise<{
1762
+ response: http.IncomingMessage;
1763
+ body: GetSourcesCatalog200Response;
1764
+ }> {
1765
+ const localVarPath = this.basePath + '/catalog/sources';
1766
+ let localVarQueryParameters: any = {};
1767
+ let localVarHeaderParams: any = (<any>Object).assign(
1768
+ {},
1769
+ this._defaultHeaders
1770
+ );
1771
+ const produces = ['application/json'];
1772
+ if (produces.indexOf('application/json') >= 0) {
1773
+ localVarHeaderParams.Accept = produces[0];
1774
+ } else {
1775
+ localVarHeaderParams.Accept = 'application/json';
1776
+ }
1777
+ let localVarFormParams: any = {};
1778
+
1779
+ // verify required parameter 'pagination' is not null or undefined
1780
+ if (pagination === null || pagination === undefined) {
1781
+ throw new Error(
1782
+ 'Required parameter pagination was null or undefined when calling getSourcesCatalogCurrent.'
1783
+ );
1784
+ }
1785
+
1786
+ if (pagination !== undefined) {
1787
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1788
+ pagination,
1789
+ 'PaginationInput'
1790
+ );
1791
+ }
1792
+
1793
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1794
+
1795
+ let localVarUseFormData = false;
1796
+
1797
+ let localVarRequestOptions: localVarRequest.Options = {
1798
+ method: 'GET',
1799
+ qs: localVarQueryParameters,
1800
+ headers: localVarHeaderParams,
1801
+ uri: localVarPath,
1802
+ useQuerystring: this._useQuerystring,
1803
+ json: true,
1804
+ };
1805
+
1806
+ let authenticationPromise = Promise.resolve();
1807
+ if (this.authentications.token.accessToken) {
1808
+ authenticationPromise = authenticationPromise.then(() =>
1809
+ this.authentications.token.applyToRequest(
1810
+ localVarRequestOptions
1811
+ )
1812
+ );
1813
+ }
1814
+ authenticationPromise = authenticationPromise.then(() =>
1815
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1816
+ );
1817
+
1818
+ let interceptorPromise = authenticationPromise;
1819
+ for (const interceptor of this.interceptors) {
1820
+ interceptorPromise = interceptorPromise.then(() =>
1821
+ interceptor(localVarRequestOptions)
1822
+ );
1823
+ }
1824
+
1825
+ return interceptorPromise.then(() => {
1826
+ if (Object.keys(localVarFormParams).length) {
1827
+ if (localVarUseFormData) {
1828
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1829
+ } else {
1830
+ localVarRequestOptions.form = localVarFormParams;
1831
+ }
1832
+ }
1833
+ return new Promise<{
1834
+ response: http.IncomingMessage;
1835
+ body: GetSourcesCatalog200Response;
1836
+ }>((resolve, reject) => {
1837
+ localVarRequest(
1838
+ localVarRequestOptions,
1839
+ (error, response, body) => {
1840
+ if (error) {
1841
+ reject(error);
1842
+ } else {
1843
+ if (
1844
+ response.statusCode &&
1845
+ response.statusCode >= 200 &&
1846
+ response.statusCode <= 299
1847
+ ) {
1848
+ body = ObjectSerializer.deserialize(
1849
+ body,
1850
+ 'GetSourcesCatalog200Response'
1851
+ );
1852
+ resolve({ response: response, body: body });
1853
+ } else {
1854
+ reject(
1855
+ new HttpError(
1856
+ response,
1857
+ body,
1858
+ response.statusCode
1859
+ )
1860
+ );
1861
+ }
1862
+ }
1863
+ }
1864
+ );
1865
+ });
1866
+ });
1867
+ }
1868
+ /**
1869
+ * Returns a list of all available Sources in the Segment catalog.
1870
+ * @summary Get Sources Catalog
1871
+ * @param pagination Defines the pagination parameters. This parameter exists in alpha.
1872
+ */
1873
+ public async getSourcesCatalogV1(
1874
+ pagination: PaginationInput,
1875
+ options: { headers: { [name: string]: string } } = { headers: {} }
1876
+ ): Promise<{
1877
+ response: http.IncomingMessage;
1878
+ body: GetSourcesCatalog200Response;
1879
+ }> {
1880
+ const localVarPath = this.basePath + '/catalog/sources';
1881
+ let localVarQueryParameters: any = {};
1882
+ let localVarHeaderParams: any = (<any>Object).assign(
1883
+ {},
1884
+ this._defaultHeaders
1885
+ );
1886
+ const produces = [
1887
+ 'application/vnd.segment.v1+json',
1888
+ 'application/json',
1889
+ ];
1890
+ if (produces.indexOf('application/json') >= 0) {
1891
+ localVarHeaderParams.Accept = produces[0];
1892
+ } else {
1893
+ localVarHeaderParams.Accept = 'application/json';
1894
+ }
1895
+ let localVarFormParams: any = {};
1896
+
1897
+ // verify required parameter 'pagination' is not null or undefined
1898
+ if (pagination === null || pagination === undefined) {
1899
+ throw new Error(
1900
+ 'Required parameter pagination was null or undefined when calling getSourcesCatalogV1.'
1901
+ );
1902
+ }
1903
+
1904
+ if (pagination !== undefined) {
1905
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1906
+ pagination,
1907
+ 'PaginationInput'
1908
+ );
1909
+ }
1910
+
1911
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1912
+
1913
+ let localVarUseFormData = false;
1914
+
1915
+ let localVarRequestOptions: localVarRequest.Options = {
1916
+ method: 'GET',
1917
+ qs: localVarQueryParameters,
1918
+ headers: localVarHeaderParams,
1919
+ uri: localVarPath,
1920
+ useQuerystring: this._useQuerystring,
1921
+ json: true,
1922
+ };
1923
+
1924
+ let authenticationPromise = Promise.resolve();
1925
+ if (this.authentications.token.accessToken) {
1926
+ authenticationPromise = authenticationPromise.then(() =>
1927
+ this.authentications.token.applyToRequest(
1928
+ localVarRequestOptions
1929
+ )
1930
+ );
1931
+ }
1932
+ authenticationPromise = authenticationPromise.then(() =>
1933
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1934
+ );
1935
+
1936
+ let interceptorPromise = authenticationPromise;
1937
+ for (const interceptor of this.interceptors) {
1938
+ interceptorPromise = interceptorPromise.then(() =>
1939
+ interceptor(localVarRequestOptions)
1940
+ );
1941
+ }
1942
+
1943
+ return interceptorPromise.then(() => {
1944
+ if (Object.keys(localVarFormParams).length) {
1945
+ if (localVarUseFormData) {
1946
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1947
+ } else {
1948
+ localVarRequestOptions.form = localVarFormParams;
1949
+ }
1950
+ }
1951
+ return new Promise<{
1952
+ response: http.IncomingMessage;
1953
+ body: GetSourcesCatalog200Response;
1954
+ }>((resolve, reject) => {
1955
+ localVarRequest(
1956
+ localVarRequestOptions,
1957
+ (error, response, body) => {
1958
+ if (error) {
1959
+ reject(error);
1960
+ } else {
1961
+ if (
1962
+ response.statusCode &&
1963
+ response.statusCode >= 200 &&
1964
+ response.statusCode <= 299
1965
+ ) {
1966
+ body = ObjectSerializer.deserialize(
1967
+ body,
1968
+ 'GetSourcesCatalog200Response'
1969
+ );
1970
+ resolve({ response: response, body: body });
1971
+ } else {
1972
+ reject(
1973
+ new HttpError(
1974
+ response,
1975
+ body,
1976
+ response.statusCode
1977
+ )
1978
+ );
1979
+ }
1980
+ }
1981
+ }
1982
+ );
1983
+ });
1984
+ });
1985
+ }
1986
+ /**
1987
+ * Returns a Warehouse catalog item by its id.
1988
+ * @summary Get Warehouse Metadata
1989
+ * @param warehouseMetadataId
1990
+ */
1991
+ public async getWarehouseMetadataAlpha(
1992
+ warehouseMetadataId: string,
1993
+ options: { headers: { [name: string]: string } } = { headers: {} }
1994
+ ): Promise<{
1995
+ response: http.IncomingMessage;
1996
+ body: GetWarehouseMetadata200Response;
1997
+ }> {
1998
+ const localVarPath =
1999
+ this.basePath +
2000
+ '/catalog/warehouses/{warehouseMetadataId}'.replace(
2001
+ '{' + 'warehouseMetadataId' + '}',
2002
+ encodeURIComponent(String(warehouseMetadataId))
2003
+ );
2004
+ let localVarQueryParameters: any = {};
2005
+ let localVarHeaderParams: any = (<any>Object).assign(
2006
+ {},
2007
+ this._defaultHeaders
2008
+ );
2009
+ const produces = [
2010
+ 'application/vnd.segment.v1alpha+json',
2011
+ 'application/json',
2012
+ ];
2013
+ if (produces.indexOf('application/json') >= 0) {
2014
+ localVarHeaderParams.Accept = produces[0];
2015
+ } else {
2016
+ localVarHeaderParams.Accept = 'application/json';
2017
+ }
2018
+ let localVarFormParams: any = {};
2019
+
2020
+ // verify required parameter 'warehouseMetadataId' is not null or undefined
2021
+ if (warehouseMetadataId === null || warehouseMetadataId === undefined) {
2022
+ throw new Error(
2023
+ 'Required parameter warehouseMetadataId was null or undefined when calling getWarehouseMetadataAlpha.'
2024
+ );
2025
+ }
2026
+
2027
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2028
+
2029
+ let localVarUseFormData = false;
2030
+
2031
+ let localVarRequestOptions: localVarRequest.Options = {
2032
+ method: 'GET',
2033
+ qs: localVarQueryParameters,
2034
+ headers: localVarHeaderParams,
2035
+ uri: localVarPath,
2036
+ useQuerystring: this._useQuerystring,
2037
+ json: true,
2038
+ };
2039
+
2040
+ let authenticationPromise = Promise.resolve();
2041
+ if (this.authentications.token.accessToken) {
2042
+ authenticationPromise = authenticationPromise.then(() =>
2043
+ this.authentications.token.applyToRequest(
2044
+ localVarRequestOptions
2045
+ )
2046
+ );
2047
+ }
2048
+ authenticationPromise = authenticationPromise.then(() =>
2049
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2050
+ );
2051
+
2052
+ let interceptorPromise = authenticationPromise;
2053
+ for (const interceptor of this.interceptors) {
2054
+ interceptorPromise = interceptorPromise.then(() =>
2055
+ interceptor(localVarRequestOptions)
2056
+ );
2057
+ }
2058
+
2059
+ return interceptorPromise.then(() => {
2060
+ if (Object.keys(localVarFormParams).length) {
2061
+ if (localVarUseFormData) {
2062
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2063
+ } else {
2064
+ localVarRequestOptions.form = localVarFormParams;
2065
+ }
2066
+ }
2067
+ return new Promise<{
2068
+ response: http.IncomingMessage;
2069
+ body: GetWarehouseMetadata200Response;
2070
+ }>((resolve, reject) => {
2071
+ localVarRequest(
2072
+ localVarRequestOptions,
2073
+ (error, response, body) => {
2074
+ if (error) {
2075
+ reject(error);
2076
+ } else {
2077
+ if (
2078
+ response.statusCode &&
2079
+ response.statusCode >= 200 &&
2080
+ response.statusCode <= 299
2081
+ ) {
2082
+ body = ObjectSerializer.deserialize(
2083
+ body,
2084
+ 'GetWarehouseMetadata200Response'
2085
+ );
2086
+ resolve({ response: response, body: body });
2087
+ } else {
2088
+ reject(
2089
+ new HttpError(
2090
+ response,
2091
+ body,
2092
+ response.statusCode
2093
+ )
2094
+ );
2095
+ }
2096
+ }
2097
+ }
2098
+ );
2099
+ });
2100
+ });
2101
+ }
2102
+ /**
2103
+ * Returns a Warehouse catalog item by its id.
2104
+ * @summary Get Warehouse Metadata
2105
+ * @param warehouseMetadataId
2106
+ */
2107
+ public async getWarehouseMetadataBeta(
2108
+ warehouseMetadataId: string,
2109
+ options: { headers: { [name: string]: string } } = { headers: {} }
2110
+ ): Promise<{
2111
+ response: http.IncomingMessage;
2112
+ body: GetWarehouseMetadata200Response;
2113
+ }> {
2114
+ const localVarPath =
2115
+ this.basePath +
2116
+ '/catalog/warehouses/{warehouseMetadataId}'.replace(
2117
+ '{' + 'warehouseMetadataId' + '}',
2118
+ encodeURIComponent(String(warehouseMetadataId))
2119
+ );
2120
+ let localVarQueryParameters: any = {};
2121
+ let localVarHeaderParams: any = (<any>Object).assign(
2122
+ {},
2123
+ this._defaultHeaders
2124
+ );
2125
+ const produces = [
2126
+ 'application/vnd.segment.v1beta+json',
2127
+ 'application/json',
2128
+ ];
2129
+ if (produces.indexOf('application/json') >= 0) {
2130
+ localVarHeaderParams.Accept = produces[0];
2131
+ } else {
2132
+ localVarHeaderParams.Accept = 'application/json';
2133
+ }
2134
+ let localVarFormParams: any = {};
2135
+
2136
+ // verify required parameter 'warehouseMetadataId' is not null or undefined
2137
+ if (warehouseMetadataId === null || warehouseMetadataId === undefined) {
2138
+ throw new Error(
2139
+ 'Required parameter warehouseMetadataId was null or undefined when calling getWarehouseMetadataBeta.'
2140
+ );
2141
+ }
2142
+
2143
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2144
+
2145
+ let localVarUseFormData = false;
2146
+
2147
+ let localVarRequestOptions: localVarRequest.Options = {
2148
+ method: 'GET',
2149
+ qs: localVarQueryParameters,
2150
+ headers: localVarHeaderParams,
2151
+ uri: localVarPath,
2152
+ useQuerystring: this._useQuerystring,
2153
+ json: true,
2154
+ };
2155
+
2156
+ let authenticationPromise = Promise.resolve();
2157
+ if (this.authentications.token.accessToken) {
2158
+ authenticationPromise = authenticationPromise.then(() =>
2159
+ this.authentications.token.applyToRequest(
2160
+ localVarRequestOptions
2161
+ )
2162
+ );
2163
+ }
2164
+ authenticationPromise = authenticationPromise.then(() =>
2165
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2166
+ );
2167
+
2168
+ let interceptorPromise = authenticationPromise;
2169
+ for (const interceptor of this.interceptors) {
2170
+ interceptorPromise = interceptorPromise.then(() =>
2171
+ interceptor(localVarRequestOptions)
2172
+ );
2173
+ }
2174
+
2175
+ return interceptorPromise.then(() => {
2176
+ if (Object.keys(localVarFormParams).length) {
2177
+ if (localVarUseFormData) {
2178
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2179
+ } else {
2180
+ localVarRequestOptions.form = localVarFormParams;
2181
+ }
2182
+ }
2183
+ return new Promise<{
2184
+ response: http.IncomingMessage;
2185
+ body: GetWarehouseMetadata200Response;
2186
+ }>((resolve, reject) => {
2187
+ localVarRequest(
2188
+ localVarRequestOptions,
2189
+ (error, response, body) => {
2190
+ if (error) {
2191
+ reject(error);
2192
+ } else {
2193
+ if (
2194
+ response.statusCode &&
2195
+ response.statusCode >= 200 &&
2196
+ response.statusCode <= 299
2197
+ ) {
2198
+ body = ObjectSerializer.deserialize(
2199
+ body,
2200
+ 'GetWarehouseMetadata200Response'
2201
+ );
2202
+ resolve({ response: response, body: body });
2203
+ } else {
2204
+ reject(
2205
+ new HttpError(
2206
+ response,
2207
+ body,
2208
+ response.statusCode
2209
+ )
2210
+ );
2211
+ }
2212
+ }
2213
+ }
2214
+ );
2215
+ });
2216
+ });
2217
+ }
2218
+ /**
2219
+ * Returns a Warehouse catalog item by its id.
2220
+ * @summary Get Warehouse Metadata
2221
+ * @param warehouseMetadataId
2222
+ */
2223
+ public async getWarehouseMetadataCurrent(
2224
+ warehouseMetadataId: string,
2225
+ options: { headers: { [name: string]: string } } = { headers: {} }
2226
+ ): Promise<{
2227
+ response: http.IncomingMessage;
2228
+ body: GetWarehouseMetadata200Response;
2229
+ }> {
2230
+ const localVarPath =
2231
+ this.basePath +
2232
+ '/catalog/warehouses/{warehouseMetadataId}'.replace(
2233
+ '{' + 'warehouseMetadataId' + '}',
2234
+ encodeURIComponent(String(warehouseMetadataId))
2235
+ );
2236
+ let localVarQueryParameters: any = {};
2237
+ let localVarHeaderParams: any = (<any>Object).assign(
2238
+ {},
2239
+ this._defaultHeaders
2240
+ );
2241
+ const produces = ['application/json'];
2242
+ if (produces.indexOf('application/json') >= 0) {
2243
+ localVarHeaderParams.Accept = produces[0];
2244
+ } else {
2245
+ localVarHeaderParams.Accept = 'application/json';
2246
+ }
2247
+ let localVarFormParams: any = {};
2248
+
2249
+ // verify required parameter 'warehouseMetadataId' is not null or undefined
2250
+ if (warehouseMetadataId === null || warehouseMetadataId === undefined) {
2251
+ throw new Error(
2252
+ 'Required parameter warehouseMetadataId was null or undefined when calling getWarehouseMetadataCurrent.'
2253
+ );
2254
+ }
2255
+
2256
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2257
+
2258
+ let localVarUseFormData = false;
2259
+
2260
+ let localVarRequestOptions: localVarRequest.Options = {
2261
+ method: 'GET',
2262
+ qs: localVarQueryParameters,
2263
+ headers: localVarHeaderParams,
2264
+ uri: localVarPath,
2265
+ useQuerystring: this._useQuerystring,
2266
+ json: true,
2267
+ };
2268
+
2269
+ let authenticationPromise = Promise.resolve();
2270
+ if (this.authentications.token.accessToken) {
2271
+ authenticationPromise = authenticationPromise.then(() =>
2272
+ this.authentications.token.applyToRequest(
2273
+ localVarRequestOptions
2274
+ )
2275
+ );
2276
+ }
2277
+ authenticationPromise = authenticationPromise.then(() =>
2278
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2279
+ );
2280
+
2281
+ let interceptorPromise = authenticationPromise;
2282
+ for (const interceptor of this.interceptors) {
2283
+ interceptorPromise = interceptorPromise.then(() =>
2284
+ interceptor(localVarRequestOptions)
2285
+ );
2286
+ }
2287
+
2288
+ return interceptorPromise.then(() => {
2289
+ if (Object.keys(localVarFormParams).length) {
2290
+ if (localVarUseFormData) {
2291
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2292
+ } else {
2293
+ localVarRequestOptions.form = localVarFormParams;
2294
+ }
2295
+ }
2296
+ return new Promise<{
2297
+ response: http.IncomingMessage;
2298
+ body: GetWarehouseMetadata200Response;
2299
+ }>((resolve, reject) => {
2300
+ localVarRequest(
2301
+ localVarRequestOptions,
2302
+ (error, response, body) => {
2303
+ if (error) {
2304
+ reject(error);
2305
+ } else {
2306
+ if (
2307
+ response.statusCode &&
2308
+ response.statusCode >= 200 &&
2309
+ response.statusCode <= 299
2310
+ ) {
2311
+ body = ObjectSerializer.deserialize(
2312
+ body,
2313
+ 'GetWarehouseMetadata200Response'
2314
+ );
2315
+ resolve({ response: response, body: body });
2316
+ } else {
2317
+ reject(
2318
+ new HttpError(
2319
+ response,
2320
+ body,
2321
+ response.statusCode
2322
+ )
2323
+ );
2324
+ }
2325
+ }
2326
+ }
2327
+ );
2328
+ });
2329
+ });
2330
+ }
2331
+ /**
2332
+ * Returns a Warehouse catalog item by its id.
2333
+ * @summary Get Warehouse Metadata
2334
+ * @param warehouseMetadataId
2335
+ */
2336
+ public async getWarehouseMetadataV1(
2337
+ warehouseMetadataId: string,
2338
+ options: { headers: { [name: string]: string } } = { headers: {} }
2339
+ ): Promise<{
2340
+ response: http.IncomingMessage;
2341
+ body: GetWarehouseMetadata200Response;
2342
+ }> {
2343
+ const localVarPath =
2344
+ this.basePath +
2345
+ '/catalog/warehouses/{warehouseMetadataId}'.replace(
2346
+ '{' + 'warehouseMetadataId' + '}',
2347
+ encodeURIComponent(String(warehouseMetadataId))
2348
+ );
2349
+ let localVarQueryParameters: any = {};
2350
+ let localVarHeaderParams: any = (<any>Object).assign(
2351
+ {},
2352
+ this._defaultHeaders
2353
+ );
2354
+ const produces = [
2355
+ 'application/vnd.segment.v1+json',
2356
+ 'application/json',
2357
+ ];
2358
+ if (produces.indexOf('application/json') >= 0) {
2359
+ localVarHeaderParams.Accept = produces[0];
2360
+ } else {
2361
+ localVarHeaderParams.Accept = 'application/json';
2362
+ }
2363
+ let localVarFormParams: any = {};
2364
+
2365
+ // verify required parameter 'warehouseMetadataId' is not null or undefined
2366
+ if (warehouseMetadataId === null || warehouseMetadataId === undefined) {
2367
+ throw new Error(
2368
+ 'Required parameter warehouseMetadataId was null or undefined when calling getWarehouseMetadataV1.'
2369
+ );
2370
+ }
2371
+
2372
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2373
+
2374
+ let localVarUseFormData = false;
2375
+
2376
+ let localVarRequestOptions: localVarRequest.Options = {
2377
+ method: 'GET',
2378
+ qs: localVarQueryParameters,
2379
+ headers: localVarHeaderParams,
2380
+ uri: localVarPath,
2381
+ useQuerystring: this._useQuerystring,
2382
+ json: true,
2383
+ };
2384
+
2385
+ let authenticationPromise = Promise.resolve();
2386
+ if (this.authentications.token.accessToken) {
2387
+ authenticationPromise = authenticationPromise.then(() =>
2388
+ this.authentications.token.applyToRequest(
2389
+ localVarRequestOptions
2390
+ )
2391
+ );
2392
+ }
2393
+ authenticationPromise = authenticationPromise.then(() =>
2394
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2395
+ );
2396
+
2397
+ let interceptorPromise = authenticationPromise;
2398
+ for (const interceptor of this.interceptors) {
2399
+ interceptorPromise = interceptorPromise.then(() =>
2400
+ interceptor(localVarRequestOptions)
2401
+ );
2402
+ }
2403
+
2404
+ return interceptorPromise.then(() => {
2405
+ if (Object.keys(localVarFormParams).length) {
2406
+ if (localVarUseFormData) {
2407
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2408
+ } else {
2409
+ localVarRequestOptions.form = localVarFormParams;
2410
+ }
2411
+ }
2412
+ return new Promise<{
2413
+ response: http.IncomingMessage;
2414
+ body: GetWarehouseMetadata200Response;
2415
+ }>((resolve, reject) => {
2416
+ localVarRequest(
2417
+ localVarRequestOptions,
2418
+ (error, response, body) => {
2419
+ if (error) {
2420
+ reject(error);
2421
+ } else {
2422
+ if (
2423
+ response.statusCode &&
2424
+ response.statusCode >= 200 &&
2425
+ response.statusCode <= 299
2426
+ ) {
2427
+ body = ObjectSerializer.deserialize(
2428
+ body,
2429
+ 'GetWarehouseMetadata200Response'
2430
+ );
2431
+ resolve({ response: response, body: body });
2432
+ } else {
2433
+ reject(
2434
+ new HttpError(
2435
+ response,
2436
+ body,
2437
+ response.statusCode
2438
+ )
2439
+ );
2440
+ }
2441
+ }
2442
+ }
2443
+ );
2444
+ });
2445
+ });
2446
+ }
2447
+ /**
2448
+ * Returns a list of all available Warehouses in the Segment catalog.
2449
+ * @summary Get Warehouses Catalog
2450
+ * @param pagination Required pagination params used to filter the Warehouses catalog. This parameter exists in alpha.
2451
+ */
2452
+ public async getWarehousesCatalogAlpha(
2453
+ pagination: PaginationInput,
2454
+ options: { headers: { [name: string]: string } } = { headers: {} }
2455
+ ): Promise<{
2456
+ response: http.IncomingMessage;
2457
+ body: GetWarehousesCatalog200Response;
2458
+ }> {
2459
+ const localVarPath = this.basePath + '/catalog/warehouses';
2460
+ let localVarQueryParameters: any = {};
2461
+ let localVarHeaderParams: any = (<any>Object).assign(
2462
+ {},
2463
+ this._defaultHeaders
2464
+ );
2465
+ const produces = [
2466
+ 'application/vnd.segment.v1alpha+json',
2467
+ 'application/json',
2468
+ ];
2469
+ if (produces.indexOf('application/json') >= 0) {
2470
+ localVarHeaderParams.Accept = produces[0];
2471
+ } else {
2472
+ localVarHeaderParams.Accept = 'application/json';
2473
+ }
2474
+ let localVarFormParams: any = {};
2475
+
2476
+ // verify required parameter 'pagination' is not null or undefined
2477
+ if (pagination === null || pagination === undefined) {
2478
+ throw new Error(
2479
+ 'Required parameter pagination was null or undefined when calling getWarehousesCatalogAlpha.'
2480
+ );
2481
+ }
2482
+
2483
+ if (pagination !== undefined) {
2484
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
2485
+ pagination,
2486
+ 'PaginationInput'
2487
+ );
2488
+ }
2489
+
2490
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2491
+
2492
+ let localVarUseFormData = false;
2493
+
2494
+ let localVarRequestOptions: localVarRequest.Options = {
2495
+ method: 'GET',
2496
+ qs: localVarQueryParameters,
2497
+ headers: localVarHeaderParams,
2498
+ uri: localVarPath,
2499
+ useQuerystring: this._useQuerystring,
2500
+ json: true,
2501
+ };
2502
+
2503
+ let authenticationPromise = Promise.resolve();
2504
+ if (this.authentications.token.accessToken) {
2505
+ authenticationPromise = authenticationPromise.then(() =>
2506
+ this.authentications.token.applyToRequest(
2507
+ localVarRequestOptions
2508
+ )
2509
+ );
2510
+ }
2511
+ authenticationPromise = authenticationPromise.then(() =>
2512
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2513
+ );
2514
+
2515
+ let interceptorPromise = authenticationPromise;
2516
+ for (const interceptor of this.interceptors) {
2517
+ interceptorPromise = interceptorPromise.then(() =>
2518
+ interceptor(localVarRequestOptions)
2519
+ );
2520
+ }
2521
+
2522
+ return interceptorPromise.then(() => {
2523
+ if (Object.keys(localVarFormParams).length) {
2524
+ if (localVarUseFormData) {
2525
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2526
+ } else {
2527
+ localVarRequestOptions.form = localVarFormParams;
2528
+ }
2529
+ }
2530
+ return new Promise<{
2531
+ response: http.IncomingMessage;
2532
+ body: GetWarehousesCatalog200Response;
2533
+ }>((resolve, reject) => {
2534
+ localVarRequest(
2535
+ localVarRequestOptions,
2536
+ (error, response, body) => {
2537
+ if (error) {
2538
+ reject(error);
2539
+ } else {
2540
+ if (
2541
+ response.statusCode &&
2542
+ response.statusCode >= 200 &&
2543
+ response.statusCode <= 299
2544
+ ) {
2545
+ body = ObjectSerializer.deserialize(
2546
+ body,
2547
+ 'GetWarehousesCatalog200Response'
2548
+ );
2549
+ resolve({ response: response, body: body });
2550
+ } else {
2551
+ reject(
2552
+ new HttpError(
2553
+ response,
2554
+ body,
2555
+ response.statusCode
2556
+ )
2557
+ );
2558
+ }
2559
+ }
2560
+ }
2561
+ );
2562
+ });
2563
+ });
2564
+ }
2565
+ /**
2566
+ * Returns a list of all available Warehouses in the Segment catalog.
2567
+ * @summary Get Warehouses Catalog
2568
+ * @param pagination Required pagination params used to filter the Warehouses catalog. This parameter exists in alpha.
2569
+ */
2570
+ public async getWarehousesCatalogBeta(
2571
+ pagination: PaginationInput,
2572
+ options: { headers: { [name: string]: string } } = { headers: {} }
2573
+ ): Promise<{
2574
+ response: http.IncomingMessage;
2575
+ body: GetWarehousesCatalog200Response;
2576
+ }> {
2577
+ const localVarPath = this.basePath + '/catalog/warehouses';
2578
+ let localVarQueryParameters: any = {};
2579
+ let localVarHeaderParams: any = (<any>Object).assign(
2580
+ {},
2581
+ this._defaultHeaders
2582
+ );
2583
+ const produces = [
2584
+ 'application/vnd.segment.v1beta+json',
2585
+ 'application/json',
2586
+ ];
2587
+ if (produces.indexOf('application/json') >= 0) {
2588
+ localVarHeaderParams.Accept = produces[0];
2589
+ } else {
2590
+ localVarHeaderParams.Accept = 'application/json';
2591
+ }
2592
+ let localVarFormParams: any = {};
2593
+
2594
+ // verify required parameter 'pagination' is not null or undefined
2595
+ if (pagination === null || pagination === undefined) {
2596
+ throw new Error(
2597
+ 'Required parameter pagination was null or undefined when calling getWarehousesCatalogBeta.'
2598
+ );
2599
+ }
2600
+
2601
+ if (pagination !== undefined) {
2602
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
2603
+ pagination,
2604
+ 'PaginationInput'
2605
+ );
2606
+ }
2607
+
2608
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2609
+
2610
+ let localVarUseFormData = false;
2611
+
2612
+ let localVarRequestOptions: localVarRequest.Options = {
2613
+ method: 'GET',
2614
+ qs: localVarQueryParameters,
2615
+ headers: localVarHeaderParams,
2616
+ uri: localVarPath,
2617
+ useQuerystring: this._useQuerystring,
2618
+ json: true,
2619
+ };
2620
+
2621
+ let authenticationPromise = Promise.resolve();
2622
+ if (this.authentications.token.accessToken) {
2623
+ authenticationPromise = authenticationPromise.then(() =>
2624
+ this.authentications.token.applyToRequest(
2625
+ localVarRequestOptions
2626
+ )
2627
+ );
2628
+ }
2629
+ authenticationPromise = authenticationPromise.then(() =>
2630
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2631
+ );
2632
+
2633
+ let interceptorPromise = authenticationPromise;
2634
+ for (const interceptor of this.interceptors) {
2635
+ interceptorPromise = interceptorPromise.then(() =>
2636
+ interceptor(localVarRequestOptions)
2637
+ );
2638
+ }
2639
+
2640
+ return interceptorPromise.then(() => {
2641
+ if (Object.keys(localVarFormParams).length) {
2642
+ if (localVarUseFormData) {
2643
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2644
+ } else {
2645
+ localVarRequestOptions.form = localVarFormParams;
2646
+ }
2647
+ }
2648
+ return new Promise<{
2649
+ response: http.IncomingMessage;
2650
+ body: GetWarehousesCatalog200Response;
2651
+ }>((resolve, reject) => {
2652
+ localVarRequest(
2653
+ localVarRequestOptions,
2654
+ (error, response, body) => {
2655
+ if (error) {
2656
+ reject(error);
2657
+ } else {
2658
+ if (
2659
+ response.statusCode &&
2660
+ response.statusCode >= 200 &&
2661
+ response.statusCode <= 299
2662
+ ) {
2663
+ body = ObjectSerializer.deserialize(
2664
+ body,
2665
+ 'GetWarehousesCatalog200Response'
2666
+ );
2667
+ resolve({ response: response, body: body });
2668
+ } else {
2669
+ reject(
2670
+ new HttpError(
2671
+ response,
2672
+ body,
2673
+ response.statusCode
2674
+ )
2675
+ );
2676
+ }
2677
+ }
2678
+ }
2679
+ );
2680
+ });
2681
+ });
2682
+ }
2683
+ /**
2684
+ * Returns a list of all available Warehouses in the Segment catalog.
2685
+ * @summary Get Warehouses Catalog
2686
+ * @param pagination Required pagination params used to filter the Warehouses catalog. This parameter exists in alpha.
2687
+ */
2688
+ public async getWarehousesCatalogCurrent(
2689
+ pagination: PaginationInput,
2690
+ options: { headers: { [name: string]: string } } = { headers: {} }
2691
+ ): Promise<{
2692
+ response: http.IncomingMessage;
2693
+ body: GetWarehousesCatalog200Response;
2694
+ }> {
2695
+ const localVarPath = this.basePath + '/catalog/warehouses';
2696
+ let localVarQueryParameters: any = {};
2697
+ let localVarHeaderParams: any = (<any>Object).assign(
2698
+ {},
2699
+ this._defaultHeaders
2700
+ );
2701
+ const produces = ['application/json'];
2702
+ if (produces.indexOf('application/json') >= 0) {
2703
+ localVarHeaderParams.Accept = produces[0];
2704
+ } else {
2705
+ localVarHeaderParams.Accept = 'application/json';
2706
+ }
2707
+ let localVarFormParams: any = {};
2708
+
2709
+ // verify required parameter 'pagination' is not null or undefined
2710
+ if (pagination === null || pagination === undefined) {
2711
+ throw new Error(
2712
+ 'Required parameter pagination was null or undefined when calling getWarehousesCatalogCurrent.'
2713
+ );
2714
+ }
2715
+
2716
+ if (pagination !== undefined) {
2717
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
2718
+ pagination,
2719
+ 'PaginationInput'
2720
+ );
2721
+ }
2722
+
2723
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2724
+
2725
+ let localVarUseFormData = false;
2726
+
2727
+ let localVarRequestOptions: localVarRequest.Options = {
2728
+ method: 'GET',
2729
+ qs: localVarQueryParameters,
2730
+ headers: localVarHeaderParams,
2731
+ uri: localVarPath,
2732
+ useQuerystring: this._useQuerystring,
2733
+ json: true,
2734
+ };
2735
+
2736
+ let authenticationPromise = Promise.resolve();
2737
+ if (this.authentications.token.accessToken) {
2738
+ authenticationPromise = authenticationPromise.then(() =>
2739
+ this.authentications.token.applyToRequest(
2740
+ localVarRequestOptions
2741
+ )
2742
+ );
2743
+ }
2744
+ authenticationPromise = authenticationPromise.then(() =>
2745
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2746
+ );
2747
+
2748
+ let interceptorPromise = authenticationPromise;
2749
+ for (const interceptor of this.interceptors) {
2750
+ interceptorPromise = interceptorPromise.then(() =>
2751
+ interceptor(localVarRequestOptions)
2752
+ );
2753
+ }
2754
+
2755
+ return interceptorPromise.then(() => {
2756
+ if (Object.keys(localVarFormParams).length) {
2757
+ if (localVarUseFormData) {
2758
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2759
+ } else {
2760
+ localVarRequestOptions.form = localVarFormParams;
2761
+ }
2762
+ }
2763
+ return new Promise<{
2764
+ response: http.IncomingMessage;
2765
+ body: GetWarehousesCatalog200Response;
2766
+ }>((resolve, reject) => {
2767
+ localVarRequest(
2768
+ localVarRequestOptions,
2769
+ (error, response, body) => {
2770
+ if (error) {
2771
+ reject(error);
2772
+ } else {
2773
+ if (
2774
+ response.statusCode &&
2775
+ response.statusCode >= 200 &&
2776
+ response.statusCode <= 299
2777
+ ) {
2778
+ body = ObjectSerializer.deserialize(
2779
+ body,
2780
+ 'GetWarehousesCatalog200Response'
2781
+ );
2782
+ resolve({ response: response, body: body });
2783
+ } else {
2784
+ reject(
2785
+ new HttpError(
2786
+ response,
2787
+ body,
2788
+ response.statusCode
2789
+ )
2790
+ );
2791
+ }
2792
+ }
2793
+ }
2794
+ );
2795
+ });
2796
+ });
2797
+ }
2798
+ /**
2799
+ * Returns a list of all available Warehouses in the Segment catalog.
2800
+ * @summary Get Warehouses Catalog
2801
+ * @param pagination Required pagination params used to filter the Warehouses catalog. This parameter exists in alpha.
2802
+ */
2803
+ public async getWarehousesCatalogV1(
2804
+ pagination: PaginationInput,
2805
+ options: { headers: { [name: string]: string } } = { headers: {} }
2806
+ ): Promise<{
2807
+ response: http.IncomingMessage;
2808
+ body: GetWarehousesCatalog200Response;
2809
+ }> {
2810
+ const localVarPath = this.basePath + '/catalog/warehouses';
2811
+ let localVarQueryParameters: any = {};
2812
+ let localVarHeaderParams: any = (<any>Object).assign(
2813
+ {},
2814
+ this._defaultHeaders
2815
+ );
2816
+ const produces = [
2817
+ 'application/vnd.segment.v1+json',
2818
+ 'application/json',
2819
+ ];
2820
+ if (produces.indexOf('application/json') >= 0) {
2821
+ localVarHeaderParams.Accept = produces[0];
2822
+ } else {
2823
+ localVarHeaderParams.Accept = 'application/json';
2824
+ }
2825
+ let localVarFormParams: any = {};
2826
+
2827
+ // verify required parameter 'pagination' is not null or undefined
2828
+ if (pagination === null || pagination === undefined) {
2829
+ throw new Error(
2830
+ 'Required parameter pagination was null or undefined when calling getWarehousesCatalogV1.'
2831
+ );
2832
+ }
2833
+
2834
+ if (pagination !== undefined) {
2835
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
2836
+ pagination,
2837
+ 'PaginationInput'
2838
+ );
2839
+ }
2840
+
2841
+ (<any>Object).assign(localVarHeaderParams, options.headers);
2842
+
2843
+ let localVarUseFormData = false;
2844
+
2845
+ let localVarRequestOptions: localVarRequest.Options = {
2846
+ method: 'GET',
2847
+ qs: localVarQueryParameters,
2848
+ headers: localVarHeaderParams,
2849
+ uri: localVarPath,
2850
+ useQuerystring: this._useQuerystring,
2851
+ json: true,
2852
+ };
2853
+
2854
+ let authenticationPromise = Promise.resolve();
2855
+ if (this.authentications.token.accessToken) {
2856
+ authenticationPromise = authenticationPromise.then(() =>
2857
+ this.authentications.token.applyToRequest(
2858
+ localVarRequestOptions
2859
+ )
2860
+ );
2861
+ }
2862
+ authenticationPromise = authenticationPromise.then(() =>
2863
+ this.authentications.default.applyToRequest(localVarRequestOptions)
2864
+ );
2865
+
2866
+ let interceptorPromise = authenticationPromise;
2867
+ for (const interceptor of this.interceptors) {
2868
+ interceptorPromise = interceptorPromise.then(() =>
2869
+ interceptor(localVarRequestOptions)
2870
+ );
2871
+ }
2872
+
2873
+ return interceptorPromise.then(() => {
2874
+ if (Object.keys(localVarFormParams).length) {
2875
+ if (localVarUseFormData) {
2876
+ (<any>localVarRequestOptions).formData = localVarFormParams;
2877
+ } else {
2878
+ localVarRequestOptions.form = localVarFormParams;
2879
+ }
2880
+ }
2881
+ return new Promise<{
2882
+ response: http.IncomingMessage;
2883
+ body: GetWarehousesCatalog200Response;
2884
+ }>((resolve, reject) => {
2885
+ localVarRequest(
2886
+ localVarRequestOptions,
2887
+ (error, response, body) => {
2888
+ if (error) {
2889
+ reject(error);
2890
+ } else {
2891
+ if (
2892
+ response.statusCode &&
2893
+ response.statusCode >= 200 &&
2894
+ response.statusCode <= 299
2895
+ ) {
2896
+ body = ObjectSerializer.deserialize(
2897
+ body,
2898
+ 'GetWarehousesCatalog200Response'
2899
+ );
2900
+ resolve({ response: response, body: body });
2901
+ } else {
2902
+ reject(
2903
+ new HttpError(
2904
+ response,
2905
+ body,
2906
+ response.statusCode
2907
+ )
2908
+ );
2909
+ }
2910
+ }
2911
+ }
2912
+ );
2913
+ });
2914
+ });
2915
+ }
2916
+ }