@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,1176 @@
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 { GetDailyPerSourceAPICallsUsage200Response } from '../model/getDailyPerSourceAPICallsUsage200Response';
18
+ import { GetDailyWorkspaceAPICallsUsage200Response } from '../model/getDailyWorkspaceAPICallsUsage200Response';
19
+ import { PaginationInput } from '../model/paginationInput';
20
+ import { RequestErrorEnvelope } from '../model/requestErrorEnvelope';
21
+
22
+ import {
23
+ ObjectSerializer,
24
+ Authentication,
25
+ VoidAuth,
26
+ Interceptor,
27
+ } from '../model/models';
28
+ import {
29
+ HttpBasicAuth,
30
+ HttpBearerAuth,
31
+ ApiKeyAuth,
32
+ OAuth,
33
+ } from '../model/models';
34
+
35
+ import { HttpError, RequestFile } from './apis';
36
+
37
+ let defaultBasePath = 'https://api.segmentapis.com';
38
+
39
+ // ===============================================
40
+ // This file is autogenerated - Please do not edit
41
+ // ===============================================
42
+
43
+ export enum APICallsApiApiKeys {}
44
+
45
+ export class APICallsApi {
46
+ protected _basePath = defaultBasePath;
47
+ protected _defaultHeaders: any = {};
48
+ protected _useQuerystring: boolean = false;
49
+
50
+ protected authentications = {
51
+ default: <Authentication>new VoidAuth(),
52
+ token: new HttpBearerAuth(),
53
+ };
54
+
55
+ protected interceptors: Interceptor[] = [];
56
+
57
+ constructor(basePath?: string);
58
+ constructor(
59
+ basePathOrUsername: string,
60
+ password?: string,
61
+ basePath?: string
62
+ ) {
63
+ if (password) {
64
+ if (basePath) {
65
+ this.basePath = basePath;
66
+ }
67
+ } else {
68
+ if (basePathOrUsername) {
69
+ this.basePath = basePathOrUsername;
70
+ }
71
+ }
72
+ }
73
+
74
+ set useQuerystring(value: boolean) {
75
+ this._useQuerystring = value;
76
+ }
77
+
78
+ set basePath(basePath: string) {
79
+ this._basePath = basePath;
80
+ }
81
+
82
+ set defaultHeaders(defaultHeaders: any) {
83
+ this._defaultHeaders = defaultHeaders;
84
+ }
85
+
86
+ get defaultHeaders() {
87
+ return this._defaultHeaders;
88
+ }
89
+
90
+ get basePath() {
91
+ return this._basePath;
92
+ }
93
+
94
+ public setDefaultAuthentication(auth: Authentication) {
95
+ this.authentications.default = auth;
96
+ }
97
+
98
+ public setApiKey(key: APICallsApiApiKeys, value: string) {
99
+ (this.authentications as any)[APICallsApiApiKeys[key]].apiKey = value;
100
+ }
101
+
102
+ set accessToken(accessToken: string | (() => string)) {
103
+ this.authentications.token.accessToken = accessToken;
104
+ }
105
+
106
+ public addInterceptor(interceptor: Interceptor) {
107
+ this.interceptors.push(interceptor);
108
+ }
109
+
110
+ /**
111
+ * Provides daily cumulative per-source API call counts for a usage period.
112
+ * @summary Get Daily Per Source API Calls Usage
113
+ * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha.
114
+ * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha.
115
+ */
116
+ public async getDailyPerSourceAPICallsUsageAlpha(
117
+ period: string,
118
+ pagination: PaginationInput,
119
+ options: { headers: { [name: string]: string } } = { headers: {} }
120
+ ): Promise<{
121
+ response: http.IncomingMessage;
122
+ body: GetDailyPerSourceAPICallsUsage200Response;
123
+ }> {
124
+ const localVarPath = this.basePath + '/usage/api-calls/sources/daily';
125
+ let localVarQueryParameters: any = {};
126
+ let localVarHeaderParams: any = (<any>Object).assign(
127
+ {},
128
+ this._defaultHeaders
129
+ );
130
+ const produces = [
131
+ 'application/vnd.segment.v1alpha+json',
132
+ 'application/json',
133
+ ];
134
+ if (produces.indexOf('application/json') >= 0) {
135
+ localVarHeaderParams.Accept = produces[0];
136
+ } else {
137
+ localVarHeaderParams.Accept = 'application/json';
138
+ }
139
+ let localVarFormParams: any = {};
140
+
141
+ // verify required parameter 'period' is not null or undefined
142
+ if (period === null || period === undefined) {
143
+ throw new Error(
144
+ 'Required parameter period was null or undefined when calling getDailyPerSourceAPICallsUsageAlpha.'
145
+ );
146
+ }
147
+
148
+ // verify required parameter 'pagination' is not null or undefined
149
+ if (pagination === null || pagination === undefined) {
150
+ throw new Error(
151
+ 'Required parameter pagination was null or undefined when calling getDailyPerSourceAPICallsUsageAlpha.'
152
+ );
153
+ }
154
+
155
+ if (period !== undefined) {
156
+ localVarQueryParameters['period'] = ObjectSerializer.serialize(
157
+ period,
158
+ 'string'
159
+ );
160
+ }
161
+
162
+ if (pagination !== undefined) {
163
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
164
+ pagination,
165
+ 'PaginationInput'
166
+ );
167
+ }
168
+
169
+ (<any>Object).assign(localVarHeaderParams, options.headers);
170
+
171
+ let localVarUseFormData = false;
172
+
173
+ let localVarRequestOptions: localVarRequest.Options = {
174
+ method: 'GET',
175
+ qs: localVarQueryParameters,
176
+ headers: localVarHeaderParams,
177
+ uri: localVarPath,
178
+ useQuerystring: this._useQuerystring,
179
+ json: true,
180
+ };
181
+
182
+ let authenticationPromise = Promise.resolve();
183
+ if (this.authentications.token.accessToken) {
184
+ authenticationPromise = authenticationPromise.then(() =>
185
+ this.authentications.token.applyToRequest(
186
+ localVarRequestOptions
187
+ )
188
+ );
189
+ }
190
+ authenticationPromise = authenticationPromise.then(() =>
191
+ this.authentications.default.applyToRequest(localVarRequestOptions)
192
+ );
193
+
194
+ let interceptorPromise = authenticationPromise;
195
+ for (const interceptor of this.interceptors) {
196
+ interceptorPromise = interceptorPromise.then(() =>
197
+ interceptor(localVarRequestOptions)
198
+ );
199
+ }
200
+
201
+ return interceptorPromise.then(() => {
202
+ if (Object.keys(localVarFormParams).length) {
203
+ if (localVarUseFormData) {
204
+ (<any>localVarRequestOptions).formData = localVarFormParams;
205
+ } else {
206
+ localVarRequestOptions.form = localVarFormParams;
207
+ }
208
+ }
209
+ return new Promise<{
210
+ response: http.IncomingMessage;
211
+ body: GetDailyPerSourceAPICallsUsage200Response;
212
+ }>((resolve, reject) => {
213
+ localVarRequest(
214
+ localVarRequestOptions,
215
+ (error, response, body) => {
216
+ if (error) {
217
+ reject(error);
218
+ } else {
219
+ if (
220
+ response.statusCode &&
221
+ response.statusCode >= 200 &&
222
+ response.statusCode <= 299
223
+ ) {
224
+ body = ObjectSerializer.deserialize(
225
+ body,
226
+ 'GetDailyPerSourceAPICallsUsage200Response'
227
+ );
228
+ resolve({ response: response, body: body });
229
+ } else {
230
+ reject(
231
+ new HttpError(
232
+ response,
233
+ body,
234
+ response.statusCode
235
+ )
236
+ );
237
+ }
238
+ }
239
+ }
240
+ );
241
+ });
242
+ });
243
+ }
244
+ /**
245
+ * Provides daily cumulative per-source API call counts for a usage period.
246
+ * @summary Get Daily Per Source API Calls Usage
247
+ * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha.
248
+ * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha.
249
+ */
250
+ public async getDailyPerSourceAPICallsUsageBeta(
251
+ period: string,
252
+ pagination: PaginationInput,
253
+ options: { headers: { [name: string]: string } } = { headers: {} }
254
+ ): Promise<{
255
+ response: http.IncomingMessage;
256
+ body: GetDailyPerSourceAPICallsUsage200Response;
257
+ }> {
258
+ const localVarPath = this.basePath + '/usage/api-calls/sources/daily';
259
+ let localVarQueryParameters: any = {};
260
+ let localVarHeaderParams: any = (<any>Object).assign(
261
+ {},
262
+ this._defaultHeaders
263
+ );
264
+ const produces = [
265
+ 'application/vnd.segment.v1beta+json',
266
+ 'application/json',
267
+ ];
268
+ if (produces.indexOf('application/json') >= 0) {
269
+ localVarHeaderParams.Accept = produces[0];
270
+ } else {
271
+ localVarHeaderParams.Accept = 'application/json';
272
+ }
273
+ let localVarFormParams: any = {};
274
+
275
+ // verify required parameter 'period' is not null or undefined
276
+ if (period === null || period === undefined) {
277
+ throw new Error(
278
+ 'Required parameter period was null or undefined when calling getDailyPerSourceAPICallsUsageBeta.'
279
+ );
280
+ }
281
+
282
+ // verify required parameter 'pagination' is not null or undefined
283
+ if (pagination === null || pagination === undefined) {
284
+ throw new Error(
285
+ 'Required parameter pagination was null or undefined when calling getDailyPerSourceAPICallsUsageBeta.'
286
+ );
287
+ }
288
+
289
+ if (period !== undefined) {
290
+ localVarQueryParameters['period'] = ObjectSerializer.serialize(
291
+ period,
292
+ 'string'
293
+ );
294
+ }
295
+
296
+ if (pagination !== undefined) {
297
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
298
+ pagination,
299
+ 'PaginationInput'
300
+ );
301
+ }
302
+
303
+ (<any>Object).assign(localVarHeaderParams, options.headers);
304
+
305
+ let localVarUseFormData = false;
306
+
307
+ let localVarRequestOptions: localVarRequest.Options = {
308
+ method: 'GET',
309
+ qs: localVarQueryParameters,
310
+ headers: localVarHeaderParams,
311
+ uri: localVarPath,
312
+ useQuerystring: this._useQuerystring,
313
+ json: true,
314
+ };
315
+
316
+ let authenticationPromise = Promise.resolve();
317
+ if (this.authentications.token.accessToken) {
318
+ authenticationPromise = authenticationPromise.then(() =>
319
+ this.authentications.token.applyToRequest(
320
+ localVarRequestOptions
321
+ )
322
+ );
323
+ }
324
+ authenticationPromise = authenticationPromise.then(() =>
325
+ this.authentications.default.applyToRequest(localVarRequestOptions)
326
+ );
327
+
328
+ let interceptorPromise = authenticationPromise;
329
+ for (const interceptor of this.interceptors) {
330
+ interceptorPromise = interceptorPromise.then(() =>
331
+ interceptor(localVarRequestOptions)
332
+ );
333
+ }
334
+
335
+ return interceptorPromise.then(() => {
336
+ if (Object.keys(localVarFormParams).length) {
337
+ if (localVarUseFormData) {
338
+ (<any>localVarRequestOptions).formData = localVarFormParams;
339
+ } else {
340
+ localVarRequestOptions.form = localVarFormParams;
341
+ }
342
+ }
343
+ return new Promise<{
344
+ response: http.IncomingMessage;
345
+ body: GetDailyPerSourceAPICallsUsage200Response;
346
+ }>((resolve, reject) => {
347
+ localVarRequest(
348
+ localVarRequestOptions,
349
+ (error, response, body) => {
350
+ if (error) {
351
+ reject(error);
352
+ } else {
353
+ if (
354
+ response.statusCode &&
355
+ response.statusCode >= 200 &&
356
+ response.statusCode <= 299
357
+ ) {
358
+ body = ObjectSerializer.deserialize(
359
+ body,
360
+ 'GetDailyPerSourceAPICallsUsage200Response'
361
+ );
362
+ resolve({ response: response, body: body });
363
+ } else {
364
+ reject(
365
+ new HttpError(
366
+ response,
367
+ body,
368
+ response.statusCode
369
+ )
370
+ );
371
+ }
372
+ }
373
+ }
374
+ );
375
+ });
376
+ });
377
+ }
378
+ /**
379
+ * Provides daily cumulative per-source API call counts for a usage period.
380
+ * @summary Get Daily Per Source API Calls Usage
381
+ * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha.
382
+ * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha.
383
+ */
384
+ public async getDailyPerSourceAPICallsUsageCurrent(
385
+ period: string,
386
+ pagination: PaginationInput,
387
+ options: { headers: { [name: string]: string } } = { headers: {} }
388
+ ): Promise<{
389
+ response: http.IncomingMessage;
390
+ body: GetDailyPerSourceAPICallsUsage200Response;
391
+ }> {
392
+ const localVarPath = this.basePath + '/usage/api-calls/sources/daily';
393
+ let localVarQueryParameters: any = {};
394
+ let localVarHeaderParams: any = (<any>Object).assign(
395
+ {},
396
+ this._defaultHeaders
397
+ );
398
+ const produces = ['application/json'];
399
+ if (produces.indexOf('application/json') >= 0) {
400
+ localVarHeaderParams.Accept = produces[0];
401
+ } else {
402
+ localVarHeaderParams.Accept = 'application/json';
403
+ }
404
+ let localVarFormParams: any = {};
405
+
406
+ // verify required parameter 'period' is not null or undefined
407
+ if (period === null || period === undefined) {
408
+ throw new Error(
409
+ 'Required parameter period was null or undefined when calling getDailyPerSourceAPICallsUsageCurrent.'
410
+ );
411
+ }
412
+
413
+ // verify required parameter 'pagination' is not null or undefined
414
+ if (pagination === null || pagination === undefined) {
415
+ throw new Error(
416
+ 'Required parameter pagination was null or undefined when calling getDailyPerSourceAPICallsUsageCurrent.'
417
+ );
418
+ }
419
+
420
+ if (period !== undefined) {
421
+ localVarQueryParameters['period'] = ObjectSerializer.serialize(
422
+ period,
423
+ 'string'
424
+ );
425
+ }
426
+
427
+ if (pagination !== undefined) {
428
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
429
+ pagination,
430
+ 'PaginationInput'
431
+ );
432
+ }
433
+
434
+ (<any>Object).assign(localVarHeaderParams, options.headers);
435
+
436
+ let localVarUseFormData = false;
437
+
438
+ let localVarRequestOptions: localVarRequest.Options = {
439
+ method: 'GET',
440
+ qs: localVarQueryParameters,
441
+ headers: localVarHeaderParams,
442
+ uri: localVarPath,
443
+ useQuerystring: this._useQuerystring,
444
+ json: true,
445
+ };
446
+
447
+ let authenticationPromise = Promise.resolve();
448
+ if (this.authentications.token.accessToken) {
449
+ authenticationPromise = authenticationPromise.then(() =>
450
+ this.authentications.token.applyToRequest(
451
+ localVarRequestOptions
452
+ )
453
+ );
454
+ }
455
+ authenticationPromise = authenticationPromise.then(() =>
456
+ this.authentications.default.applyToRequest(localVarRequestOptions)
457
+ );
458
+
459
+ let interceptorPromise = authenticationPromise;
460
+ for (const interceptor of this.interceptors) {
461
+ interceptorPromise = interceptorPromise.then(() =>
462
+ interceptor(localVarRequestOptions)
463
+ );
464
+ }
465
+
466
+ return interceptorPromise.then(() => {
467
+ if (Object.keys(localVarFormParams).length) {
468
+ if (localVarUseFormData) {
469
+ (<any>localVarRequestOptions).formData = localVarFormParams;
470
+ } else {
471
+ localVarRequestOptions.form = localVarFormParams;
472
+ }
473
+ }
474
+ return new Promise<{
475
+ response: http.IncomingMessage;
476
+ body: GetDailyPerSourceAPICallsUsage200Response;
477
+ }>((resolve, reject) => {
478
+ localVarRequest(
479
+ localVarRequestOptions,
480
+ (error, response, body) => {
481
+ if (error) {
482
+ reject(error);
483
+ } else {
484
+ if (
485
+ response.statusCode &&
486
+ response.statusCode >= 200 &&
487
+ response.statusCode <= 299
488
+ ) {
489
+ body = ObjectSerializer.deserialize(
490
+ body,
491
+ 'GetDailyPerSourceAPICallsUsage200Response'
492
+ );
493
+ resolve({ response: response, body: body });
494
+ } else {
495
+ reject(
496
+ new HttpError(
497
+ response,
498
+ body,
499
+ response.statusCode
500
+ )
501
+ );
502
+ }
503
+ }
504
+ }
505
+ );
506
+ });
507
+ });
508
+ }
509
+ /**
510
+ * Provides daily cumulative per-source API call counts for a usage period.
511
+ * @summary Get Daily Per Source API Calls Usage
512
+ * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha.
513
+ * @param pagination Pagination input for per Source API calls counts. This parameter exists in alpha.
514
+ */
515
+ public async getDailyPerSourceAPICallsUsageV1(
516
+ period: string,
517
+ pagination: PaginationInput,
518
+ options: { headers: { [name: string]: string } } = { headers: {} }
519
+ ): Promise<{
520
+ response: http.IncomingMessage;
521
+ body: GetDailyPerSourceAPICallsUsage200Response;
522
+ }> {
523
+ const localVarPath = this.basePath + '/usage/api-calls/sources/daily';
524
+ let localVarQueryParameters: any = {};
525
+ let localVarHeaderParams: any = (<any>Object).assign(
526
+ {},
527
+ this._defaultHeaders
528
+ );
529
+ const produces = [
530
+ 'application/vnd.segment.v1+json',
531
+ 'application/json',
532
+ ];
533
+ if (produces.indexOf('application/json') >= 0) {
534
+ localVarHeaderParams.Accept = produces[0];
535
+ } else {
536
+ localVarHeaderParams.Accept = 'application/json';
537
+ }
538
+ let localVarFormParams: any = {};
539
+
540
+ // verify required parameter 'period' is not null or undefined
541
+ if (period === null || period === undefined) {
542
+ throw new Error(
543
+ 'Required parameter period was null or undefined when calling getDailyPerSourceAPICallsUsageV1.'
544
+ );
545
+ }
546
+
547
+ // verify required parameter 'pagination' is not null or undefined
548
+ if (pagination === null || pagination === undefined) {
549
+ throw new Error(
550
+ 'Required parameter pagination was null or undefined when calling getDailyPerSourceAPICallsUsageV1.'
551
+ );
552
+ }
553
+
554
+ if (period !== undefined) {
555
+ localVarQueryParameters['period'] = ObjectSerializer.serialize(
556
+ period,
557
+ 'string'
558
+ );
559
+ }
560
+
561
+ if (pagination !== undefined) {
562
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
563
+ pagination,
564
+ 'PaginationInput'
565
+ );
566
+ }
567
+
568
+ (<any>Object).assign(localVarHeaderParams, options.headers);
569
+
570
+ let localVarUseFormData = false;
571
+
572
+ let localVarRequestOptions: localVarRequest.Options = {
573
+ method: 'GET',
574
+ qs: localVarQueryParameters,
575
+ headers: localVarHeaderParams,
576
+ uri: localVarPath,
577
+ useQuerystring: this._useQuerystring,
578
+ json: true,
579
+ };
580
+
581
+ let authenticationPromise = Promise.resolve();
582
+ if (this.authentications.token.accessToken) {
583
+ authenticationPromise = authenticationPromise.then(() =>
584
+ this.authentications.token.applyToRequest(
585
+ localVarRequestOptions
586
+ )
587
+ );
588
+ }
589
+ authenticationPromise = authenticationPromise.then(() =>
590
+ this.authentications.default.applyToRequest(localVarRequestOptions)
591
+ );
592
+
593
+ let interceptorPromise = authenticationPromise;
594
+ for (const interceptor of this.interceptors) {
595
+ interceptorPromise = interceptorPromise.then(() =>
596
+ interceptor(localVarRequestOptions)
597
+ );
598
+ }
599
+
600
+ return interceptorPromise.then(() => {
601
+ if (Object.keys(localVarFormParams).length) {
602
+ if (localVarUseFormData) {
603
+ (<any>localVarRequestOptions).formData = localVarFormParams;
604
+ } else {
605
+ localVarRequestOptions.form = localVarFormParams;
606
+ }
607
+ }
608
+ return new Promise<{
609
+ response: http.IncomingMessage;
610
+ body: GetDailyPerSourceAPICallsUsage200Response;
611
+ }>((resolve, reject) => {
612
+ localVarRequest(
613
+ localVarRequestOptions,
614
+ (error, response, body) => {
615
+ if (error) {
616
+ reject(error);
617
+ } else {
618
+ if (
619
+ response.statusCode &&
620
+ response.statusCode >= 200 &&
621
+ response.statusCode <= 299
622
+ ) {
623
+ body = ObjectSerializer.deserialize(
624
+ body,
625
+ 'GetDailyPerSourceAPICallsUsage200Response'
626
+ );
627
+ resolve({ response: response, body: body });
628
+ } else {
629
+ reject(
630
+ new HttpError(
631
+ response,
632
+ body,
633
+ response.statusCode
634
+ )
635
+ );
636
+ }
637
+ }
638
+ }
639
+ );
640
+ });
641
+ });
642
+ }
643
+ /**
644
+ * Provides daily cumulative API call counts for a usage period.
645
+ * @summary Get Daily Workspace API Calls Usage
646
+ * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha.
647
+ * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha.
648
+ */
649
+ public async getDailyWorkspaceAPICallsUsageAlpha(
650
+ period: string,
651
+ pagination: PaginationInput,
652
+ options: { headers: { [name: string]: string } } = { headers: {} }
653
+ ): Promise<{
654
+ response: http.IncomingMessage;
655
+ body: GetDailyWorkspaceAPICallsUsage200Response;
656
+ }> {
657
+ const localVarPath = this.basePath + '/usage/api-calls/daily';
658
+ let localVarQueryParameters: any = {};
659
+ let localVarHeaderParams: any = (<any>Object).assign(
660
+ {},
661
+ this._defaultHeaders
662
+ );
663
+ const produces = [
664
+ 'application/vnd.segment.v1alpha+json',
665
+ 'application/json',
666
+ ];
667
+ if (produces.indexOf('application/json') >= 0) {
668
+ localVarHeaderParams.Accept = produces[0];
669
+ } else {
670
+ localVarHeaderParams.Accept = 'application/json';
671
+ }
672
+ let localVarFormParams: any = {};
673
+
674
+ // verify required parameter 'period' is not null or undefined
675
+ if (period === null || period === undefined) {
676
+ throw new Error(
677
+ 'Required parameter period was null or undefined when calling getDailyWorkspaceAPICallsUsageAlpha.'
678
+ );
679
+ }
680
+
681
+ // verify required parameter 'pagination' is not null or undefined
682
+ if (pagination === null || pagination === undefined) {
683
+ throw new Error(
684
+ 'Required parameter pagination was null or undefined when calling getDailyWorkspaceAPICallsUsageAlpha.'
685
+ );
686
+ }
687
+
688
+ if (period !== undefined) {
689
+ localVarQueryParameters['period'] = ObjectSerializer.serialize(
690
+ period,
691
+ 'string'
692
+ );
693
+ }
694
+
695
+ if (pagination !== undefined) {
696
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
697
+ pagination,
698
+ 'PaginationInput'
699
+ );
700
+ }
701
+
702
+ (<any>Object).assign(localVarHeaderParams, options.headers);
703
+
704
+ let localVarUseFormData = false;
705
+
706
+ let localVarRequestOptions: localVarRequest.Options = {
707
+ method: 'GET',
708
+ qs: localVarQueryParameters,
709
+ headers: localVarHeaderParams,
710
+ uri: localVarPath,
711
+ useQuerystring: this._useQuerystring,
712
+ json: true,
713
+ };
714
+
715
+ let authenticationPromise = Promise.resolve();
716
+ if (this.authentications.token.accessToken) {
717
+ authenticationPromise = authenticationPromise.then(() =>
718
+ this.authentications.token.applyToRequest(
719
+ localVarRequestOptions
720
+ )
721
+ );
722
+ }
723
+ authenticationPromise = authenticationPromise.then(() =>
724
+ this.authentications.default.applyToRequest(localVarRequestOptions)
725
+ );
726
+
727
+ let interceptorPromise = authenticationPromise;
728
+ for (const interceptor of this.interceptors) {
729
+ interceptorPromise = interceptorPromise.then(() =>
730
+ interceptor(localVarRequestOptions)
731
+ );
732
+ }
733
+
734
+ return interceptorPromise.then(() => {
735
+ if (Object.keys(localVarFormParams).length) {
736
+ if (localVarUseFormData) {
737
+ (<any>localVarRequestOptions).formData = localVarFormParams;
738
+ } else {
739
+ localVarRequestOptions.form = localVarFormParams;
740
+ }
741
+ }
742
+ return new Promise<{
743
+ response: http.IncomingMessage;
744
+ body: GetDailyWorkspaceAPICallsUsage200Response;
745
+ }>((resolve, reject) => {
746
+ localVarRequest(
747
+ localVarRequestOptions,
748
+ (error, response, body) => {
749
+ if (error) {
750
+ reject(error);
751
+ } else {
752
+ if (
753
+ response.statusCode &&
754
+ response.statusCode >= 200 &&
755
+ response.statusCode <= 299
756
+ ) {
757
+ body = ObjectSerializer.deserialize(
758
+ body,
759
+ 'GetDailyWorkspaceAPICallsUsage200Response'
760
+ );
761
+ resolve({ response: response, body: body });
762
+ } else {
763
+ reject(
764
+ new HttpError(
765
+ response,
766
+ body,
767
+ response.statusCode
768
+ )
769
+ );
770
+ }
771
+ }
772
+ }
773
+ );
774
+ });
775
+ });
776
+ }
777
+ /**
778
+ * Provides daily cumulative API call counts for a usage period.
779
+ * @summary Get Daily Workspace API Calls Usage
780
+ * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha.
781
+ * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha.
782
+ */
783
+ public async getDailyWorkspaceAPICallsUsageBeta(
784
+ period: string,
785
+ pagination: PaginationInput,
786
+ options: { headers: { [name: string]: string } } = { headers: {} }
787
+ ): Promise<{
788
+ response: http.IncomingMessage;
789
+ body: GetDailyWorkspaceAPICallsUsage200Response;
790
+ }> {
791
+ const localVarPath = this.basePath + '/usage/api-calls/daily';
792
+ let localVarQueryParameters: any = {};
793
+ let localVarHeaderParams: any = (<any>Object).assign(
794
+ {},
795
+ this._defaultHeaders
796
+ );
797
+ const produces = [
798
+ 'application/vnd.segment.v1beta+json',
799
+ 'application/json',
800
+ ];
801
+ if (produces.indexOf('application/json') >= 0) {
802
+ localVarHeaderParams.Accept = produces[0];
803
+ } else {
804
+ localVarHeaderParams.Accept = 'application/json';
805
+ }
806
+ let localVarFormParams: any = {};
807
+
808
+ // verify required parameter 'period' is not null or undefined
809
+ if (period === null || period === undefined) {
810
+ throw new Error(
811
+ 'Required parameter period was null or undefined when calling getDailyWorkspaceAPICallsUsageBeta.'
812
+ );
813
+ }
814
+
815
+ // verify required parameter 'pagination' is not null or undefined
816
+ if (pagination === null || pagination === undefined) {
817
+ throw new Error(
818
+ 'Required parameter pagination was null or undefined when calling getDailyWorkspaceAPICallsUsageBeta.'
819
+ );
820
+ }
821
+
822
+ if (period !== undefined) {
823
+ localVarQueryParameters['period'] = ObjectSerializer.serialize(
824
+ period,
825
+ 'string'
826
+ );
827
+ }
828
+
829
+ if (pagination !== undefined) {
830
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
831
+ pagination,
832
+ 'PaginationInput'
833
+ );
834
+ }
835
+
836
+ (<any>Object).assign(localVarHeaderParams, options.headers);
837
+
838
+ let localVarUseFormData = false;
839
+
840
+ let localVarRequestOptions: localVarRequest.Options = {
841
+ method: 'GET',
842
+ qs: localVarQueryParameters,
843
+ headers: localVarHeaderParams,
844
+ uri: localVarPath,
845
+ useQuerystring: this._useQuerystring,
846
+ json: true,
847
+ };
848
+
849
+ let authenticationPromise = Promise.resolve();
850
+ if (this.authentications.token.accessToken) {
851
+ authenticationPromise = authenticationPromise.then(() =>
852
+ this.authentications.token.applyToRequest(
853
+ localVarRequestOptions
854
+ )
855
+ );
856
+ }
857
+ authenticationPromise = authenticationPromise.then(() =>
858
+ this.authentications.default.applyToRequest(localVarRequestOptions)
859
+ );
860
+
861
+ let interceptorPromise = authenticationPromise;
862
+ for (const interceptor of this.interceptors) {
863
+ interceptorPromise = interceptorPromise.then(() =>
864
+ interceptor(localVarRequestOptions)
865
+ );
866
+ }
867
+
868
+ return interceptorPromise.then(() => {
869
+ if (Object.keys(localVarFormParams).length) {
870
+ if (localVarUseFormData) {
871
+ (<any>localVarRequestOptions).formData = localVarFormParams;
872
+ } else {
873
+ localVarRequestOptions.form = localVarFormParams;
874
+ }
875
+ }
876
+ return new Promise<{
877
+ response: http.IncomingMessage;
878
+ body: GetDailyWorkspaceAPICallsUsage200Response;
879
+ }>((resolve, reject) => {
880
+ localVarRequest(
881
+ localVarRequestOptions,
882
+ (error, response, body) => {
883
+ if (error) {
884
+ reject(error);
885
+ } else {
886
+ if (
887
+ response.statusCode &&
888
+ response.statusCode >= 200 &&
889
+ response.statusCode <= 299
890
+ ) {
891
+ body = ObjectSerializer.deserialize(
892
+ body,
893
+ 'GetDailyWorkspaceAPICallsUsage200Response'
894
+ );
895
+ resolve({ response: response, body: body });
896
+ } else {
897
+ reject(
898
+ new HttpError(
899
+ response,
900
+ body,
901
+ response.statusCode
902
+ )
903
+ );
904
+ }
905
+ }
906
+ }
907
+ );
908
+ });
909
+ });
910
+ }
911
+ /**
912
+ * Provides daily cumulative API call counts for a usage period.
913
+ * @summary Get Daily Workspace API Calls Usage
914
+ * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha.
915
+ * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha.
916
+ */
917
+ public async getDailyWorkspaceAPICallsUsageCurrent(
918
+ period: string,
919
+ pagination: PaginationInput,
920
+ options: { headers: { [name: string]: string } } = { headers: {} }
921
+ ): Promise<{
922
+ response: http.IncomingMessage;
923
+ body: GetDailyWorkspaceAPICallsUsage200Response;
924
+ }> {
925
+ const localVarPath = this.basePath + '/usage/api-calls/daily';
926
+ let localVarQueryParameters: any = {};
927
+ let localVarHeaderParams: any = (<any>Object).assign(
928
+ {},
929
+ this._defaultHeaders
930
+ );
931
+ const produces = ['application/json'];
932
+ if (produces.indexOf('application/json') >= 0) {
933
+ localVarHeaderParams.Accept = produces[0];
934
+ } else {
935
+ localVarHeaderParams.Accept = 'application/json';
936
+ }
937
+ let localVarFormParams: any = {};
938
+
939
+ // verify required parameter 'period' is not null or undefined
940
+ if (period === null || period === undefined) {
941
+ throw new Error(
942
+ 'Required parameter period was null or undefined when calling getDailyWorkspaceAPICallsUsageCurrent.'
943
+ );
944
+ }
945
+
946
+ // verify required parameter 'pagination' is not null or undefined
947
+ if (pagination === null || pagination === undefined) {
948
+ throw new Error(
949
+ 'Required parameter pagination was null or undefined when calling getDailyWorkspaceAPICallsUsageCurrent.'
950
+ );
951
+ }
952
+
953
+ if (period !== undefined) {
954
+ localVarQueryParameters['period'] = ObjectSerializer.serialize(
955
+ period,
956
+ 'string'
957
+ );
958
+ }
959
+
960
+ if (pagination !== undefined) {
961
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
962
+ pagination,
963
+ 'PaginationInput'
964
+ );
965
+ }
966
+
967
+ (<any>Object).assign(localVarHeaderParams, options.headers);
968
+
969
+ let localVarUseFormData = false;
970
+
971
+ let localVarRequestOptions: localVarRequest.Options = {
972
+ method: 'GET',
973
+ qs: localVarQueryParameters,
974
+ headers: localVarHeaderParams,
975
+ uri: localVarPath,
976
+ useQuerystring: this._useQuerystring,
977
+ json: true,
978
+ };
979
+
980
+ let authenticationPromise = Promise.resolve();
981
+ if (this.authentications.token.accessToken) {
982
+ authenticationPromise = authenticationPromise.then(() =>
983
+ this.authentications.token.applyToRequest(
984
+ localVarRequestOptions
985
+ )
986
+ );
987
+ }
988
+ authenticationPromise = authenticationPromise.then(() =>
989
+ this.authentications.default.applyToRequest(localVarRequestOptions)
990
+ );
991
+
992
+ let interceptorPromise = authenticationPromise;
993
+ for (const interceptor of this.interceptors) {
994
+ interceptorPromise = interceptorPromise.then(() =>
995
+ interceptor(localVarRequestOptions)
996
+ );
997
+ }
998
+
999
+ return interceptorPromise.then(() => {
1000
+ if (Object.keys(localVarFormParams).length) {
1001
+ if (localVarUseFormData) {
1002
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1003
+ } else {
1004
+ localVarRequestOptions.form = localVarFormParams;
1005
+ }
1006
+ }
1007
+ return new Promise<{
1008
+ response: http.IncomingMessage;
1009
+ body: GetDailyWorkspaceAPICallsUsage200Response;
1010
+ }>((resolve, reject) => {
1011
+ localVarRequest(
1012
+ localVarRequestOptions,
1013
+ (error, response, body) => {
1014
+ if (error) {
1015
+ reject(error);
1016
+ } else {
1017
+ if (
1018
+ response.statusCode &&
1019
+ response.statusCode >= 200 &&
1020
+ response.statusCode <= 299
1021
+ ) {
1022
+ body = ObjectSerializer.deserialize(
1023
+ body,
1024
+ 'GetDailyWorkspaceAPICallsUsage200Response'
1025
+ );
1026
+ resolve({ response: response, body: body });
1027
+ } else {
1028
+ reject(
1029
+ new HttpError(
1030
+ response,
1031
+ body,
1032
+ response.statusCode
1033
+ )
1034
+ );
1035
+ }
1036
+ }
1037
+ }
1038
+ );
1039
+ });
1040
+ });
1041
+ }
1042
+ /**
1043
+ * Provides daily cumulative API call counts for a usage period.
1044
+ * @summary Get Daily Workspace API Calls Usage
1045
+ * @param period The start of the usage month in the ISO-8601 format. This parameter exists in alpha.
1046
+ * @param pagination Pagination input for Workspace API call counts. This parameter exists in alpha.
1047
+ */
1048
+ public async getDailyWorkspaceAPICallsUsageV1(
1049
+ period: string,
1050
+ pagination: PaginationInput,
1051
+ options: { headers: { [name: string]: string } } = { headers: {} }
1052
+ ): Promise<{
1053
+ response: http.IncomingMessage;
1054
+ body: GetDailyWorkspaceAPICallsUsage200Response;
1055
+ }> {
1056
+ const localVarPath = this.basePath + '/usage/api-calls/daily';
1057
+ let localVarQueryParameters: any = {};
1058
+ let localVarHeaderParams: any = (<any>Object).assign(
1059
+ {},
1060
+ this._defaultHeaders
1061
+ );
1062
+ const produces = [
1063
+ 'application/vnd.segment.v1+json',
1064
+ 'application/json',
1065
+ ];
1066
+ if (produces.indexOf('application/json') >= 0) {
1067
+ localVarHeaderParams.Accept = produces[0];
1068
+ } else {
1069
+ localVarHeaderParams.Accept = 'application/json';
1070
+ }
1071
+ let localVarFormParams: any = {};
1072
+
1073
+ // verify required parameter 'period' is not null or undefined
1074
+ if (period === null || period === undefined) {
1075
+ throw new Error(
1076
+ 'Required parameter period was null or undefined when calling getDailyWorkspaceAPICallsUsageV1.'
1077
+ );
1078
+ }
1079
+
1080
+ // verify required parameter 'pagination' is not null or undefined
1081
+ if (pagination === null || pagination === undefined) {
1082
+ throw new Error(
1083
+ 'Required parameter pagination was null or undefined when calling getDailyWorkspaceAPICallsUsageV1.'
1084
+ );
1085
+ }
1086
+
1087
+ if (period !== undefined) {
1088
+ localVarQueryParameters['period'] = ObjectSerializer.serialize(
1089
+ period,
1090
+ 'string'
1091
+ );
1092
+ }
1093
+
1094
+ if (pagination !== undefined) {
1095
+ localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
1096
+ pagination,
1097
+ 'PaginationInput'
1098
+ );
1099
+ }
1100
+
1101
+ (<any>Object).assign(localVarHeaderParams, options.headers);
1102
+
1103
+ let localVarUseFormData = false;
1104
+
1105
+ let localVarRequestOptions: localVarRequest.Options = {
1106
+ method: 'GET',
1107
+ qs: localVarQueryParameters,
1108
+ headers: localVarHeaderParams,
1109
+ uri: localVarPath,
1110
+ useQuerystring: this._useQuerystring,
1111
+ json: true,
1112
+ };
1113
+
1114
+ let authenticationPromise = Promise.resolve();
1115
+ if (this.authentications.token.accessToken) {
1116
+ authenticationPromise = authenticationPromise.then(() =>
1117
+ this.authentications.token.applyToRequest(
1118
+ localVarRequestOptions
1119
+ )
1120
+ );
1121
+ }
1122
+ authenticationPromise = authenticationPromise.then(() =>
1123
+ this.authentications.default.applyToRequest(localVarRequestOptions)
1124
+ );
1125
+
1126
+ let interceptorPromise = authenticationPromise;
1127
+ for (const interceptor of this.interceptors) {
1128
+ interceptorPromise = interceptorPromise.then(() =>
1129
+ interceptor(localVarRequestOptions)
1130
+ );
1131
+ }
1132
+
1133
+ return interceptorPromise.then(() => {
1134
+ if (Object.keys(localVarFormParams).length) {
1135
+ if (localVarUseFormData) {
1136
+ (<any>localVarRequestOptions).formData = localVarFormParams;
1137
+ } else {
1138
+ localVarRequestOptions.form = localVarFormParams;
1139
+ }
1140
+ }
1141
+ return new Promise<{
1142
+ response: http.IncomingMessage;
1143
+ body: GetDailyWorkspaceAPICallsUsage200Response;
1144
+ }>((resolve, reject) => {
1145
+ localVarRequest(
1146
+ localVarRequestOptions,
1147
+ (error, response, body) => {
1148
+ if (error) {
1149
+ reject(error);
1150
+ } else {
1151
+ if (
1152
+ response.statusCode &&
1153
+ response.statusCode >= 200 &&
1154
+ response.statusCode <= 299
1155
+ ) {
1156
+ body = ObjectSerializer.deserialize(
1157
+ body,
1158
+ 'GetDailyWorkspaceAPICallsUsage200Response'
1159
+ );
1160
+ resolve({ response: response, body: body });
1161
+ } else {
1162
+ reject(
1163
+ new HttpError(
1164
+ response,
1165
+ body,
1166
+ response.statusCode
1167
+ )
1168
+ );
1169
+ }
1170
+ }
1171
+ }
1172
+ );
1173
+ });
1174
+ });
1175
+ }
1176
+ }