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

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