@segment/public-api-sdk-typescript 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/api/aPICallsApi.ts +1176 -0
- package/api/apis.ts +178 -0
- package/api/auditTrailApi.ts +714 -0
- package/api/catalogApi.ts +2916 -0
- package/api/deletionAndSuppressionApi.ts +4298 -0
- package/api/destinationFiltersApi.ts +3262 -0
- package/api/destinationsApi.ts +3494 -0
- package/api/edgeFunctionsApi.ts +593 -0
- package/api/eventsApi.ts +922 -0
- package/api/functionsApi.ts +3036 -0
- package/api/iAMGroupsApi.ts +6204 -0
- package/api/iAMRolesApi.ts +566 -0
- package/api/iAMUsersApi.ts +4486 -0
- package/api/labelsApi.ts +1488 -0
- package/api/monthlyTrackedUsersApi.ts +1178 -0
- package/api/selectiveSyncApi.ts +3321 -0
- package/api/sourcesApi.ts +5602 -0
- package/api/spacesApi.ts +489 -0
- package/api/testingApi.ts +568 -0
- package/api/trackingPlansApi.ts +6238 -0
- package/api/transformationsApi.ts +1316 -0
- package/api/warehousesApi.ts +5004 -0
- package/api/workspacesApi.ts +513 -0
- package/api.ts +3 -0
- package/dist/model/contact.d.ts +17 -0
- package/dist/model/contact.js +36 -0
- package/dist/model/contact.js.map +1 -0
- package/dist/model/destinationMetadata.d.ts +3 -0
- package/dist/model/destinationMetadata.js +10 -0
- package/dist/model/destinationMetadata.js.map +1 -1
- package/dist/model/destinationMetadataV1.d.ts +3 -0
- package/dist/model/destinationMetadataV1.js +10 -0
- package/dist/model/destinationMetadataV1.js.map +1 -1
- package/dist/model/metadata.d.ts +3 -0
- package/dist/model/metadata.js +10 -0
- package/dist/model/metadata.js.map +1 -1
- package/dist/model/models.d.ts +1 -0
- package/dist/model/models.js +3 -0
- package/dist/model/models.js.map +1 -1
- package/jest.config.js +10 -0
- package/model/aPICallSnapshotV1.ts +50 -0
- package/model/accessPermissionV1.ts +60 -0
- package/model/addConnectionFromSourceToWarehouse200Response.ts +36 -0
- package/model/addConnectionFromSourceToWarehouseV1Output.ts +48 -0
- package/model/addLabelsToSource200Response.ts +36 -0
- package/model/addLabelsToSource200Response1.ts +36 -0
- package/model/addLabelsToSourceAlphaInput.ts +42 -0
- package/model/addLabelsToSourceAlphaOutput.ts +42 -0
- package/model/addLabelsToSourceV1Input.ts +42 -0
- package/model/addLabelsToSourceV1Output.ts +42 -0
- package/model/addPermissionsToUser200Response.ts +36 -0
- package/model/addPermissionsToUserGroup200Response.ts +36 -0
- package/model/addPermissionsToUserGroupV1Input.ts +42 -0
- package/model/addPermissionsToUserGroupV1Output.ts +42 -0
- package/model/addPermissionsToUserV1Input.ts +42 -0
- package/model/addPermissionsToUserV1Output.ts +42 -0
- package/model/addSourceToTrackingPlan200Response.ts +36 -0
- package/model/addSourceToTrackingPlanV1Input.ts +41 -0
- package/model/addSourceToTrackingPlanV1Output.ts +47 -0
- package/model/addUsersToUserGroup200Response.ts +36 -0
- package/model/addUsersToUserGroupV1Input.ts +41 -0
- package/model/addUsersToUserGroupV1Output.ts +39 -0
- package/model/advancedWarehouseSyncScheduleV1Input.ts +51 -0
- package/model/advancedWarehouseSyncScheduleV1Output.ts +51 -0
- package/model/allowedLabelBeta.ts +59 -0
- package/model/auditEventV1.ts +95 -0
- package/model/batchQueryMessagingSubscriptionsForSpace200Response.ts +36 -0
- package/model/batchQueryMessagingSubscriptionsForSpaceAlphaInput.ts +42 -0
- package/model/batchQueryMessagingSubscriptionsForSpaceAlphaOutput.ts +69 -0
- package/model/breakdownBeta.ts +50 -0
- package/model/commonSourceSettingsV1.ts +68 -0
- package/model/contact.ts +68 -0
- package/model/createCloudSourceRegulation200Response.ts +36 -0
- package/model/createCloudSourceRegulationV1Input.ts +82 -0
- package/model/createCloudSourceRegulationV1Output.ts +41 -0
- package/model/createDestination200Response.ts +36 -0
- package/model/createDestinationSubscription200Response.ts +36 -0
- package/model/createDestinationSubscriptionAlphaInput.ts +77 -0
- package/model/createDestinationSubscriptionAlphaOutput.ts +39 -0
- package/model/createDestinationV1Input.ts +77 -0
- package/model/createDestinationV1Output.ts +39 -0
- package/model/createEdgeFunctions200Response.ts +36 -0
- package/model/createEdgeFunctionsAlphaInput.ts +41 -0
- package/model/createEdgeFunctionsAlphaOutput.ts +39 -0
- package/model/createFilterForDestination200Response.ts +36 -0
- package/model/createFilterForDestinationV1Input.ts +87 -0
- package/model/createFilterForDestinationV1Output.ts +39 -0
- package/model/createFunction200Response.ts +36 -0
- package/model/createFunctionDeployment200Response.ts +36 -0
- package/model/createFunctionDeploymentV1Output.ts +39 -0
- package/model/createFunctionV1Input.ts +94 -0
- package/model/createFunctionV1Output.ts +39 -0
- package/model/createInvites200Response.ts +36 -0
- package/model/createInvitesV1Input.ts +42 -0
- package/model/createInvitesV1Output.ts +41 -0
- package/model/createLabel200Response.ts +36 -0
- package/model/createLabel200Response1.ts +36 -0
- package/model/createLabelAlphaInput.ts +39 -0
- package/model/createLabelAlphaOutput.ts +42 -0
- package/model/createLabelV1Input.ts +39 -0
- package/model/createLabelV1Output.ts +39 -0
- package/model/createSource200Response.ts +36 -0
- package/model/createSource200Response1.ts +36 -0
- package/model/createSourceAlphaInput.ts +77 -0
- package/model/createSourceAlphaOutput.ts +39 -0
- package/model/createSourceRegulation200Response.ts +36 -0
- package/model/createSourceRegulationV1Input.ts +73 -0
- package/model/createSourceRegulationV1Output.ts +41 -0
- package/model/createSourceV1Input.ts +68 -0
- package/model/createSourceV1Output.ts +39 -0
- package/model/createTrackingPlan200Response.ts +36 -0
- package/model/createTrackingPlanV1Input.ts +68 -0
- package/model/createTrackingPlanV1Output.ts +39 -0
- package/model/createTransformation200Response.ts +36 -0
- package/model/createTransformationBetaInput.ts +96 -0
- package/model/createTransformationBetaOutput.ts +39 -0
- package/model/createUserGroup200Response.ts +36 -0
- package/model/createUserGroupV1Input.ts +41 -0
- package/model/createUserGroupV1Output.ts +39 -0
- package/model/createValidationInWarehouse200Response.ts +36 -0
- package/model/createValidationInWarehouseV1Input.ts +50 -0
- package/model/createValidationInWarehouseV1Output.ts +48 -0
- package/model/createWarehouse200Response.ts +36 -0
- package/model/createWarehouseV1Input.ts +68 -0
- package/model/createWarehouseV1Output.ts +39 -0
- package/model/createWorkspaceRegulation200Response.ts +36 -0
- package/model/createWorkspaceRegulationV1Input.ts +74 -0
- package/model/createWorkspaceRegulationV1Output.ts +41 -0
- package/model/deleteDestination200Response.ts +36 -0
- package/model/deleteDestinationV1Output.ts +47 -0
- package/model/deleteFunction200Response.ts +36 -0
- package/model/deleteFunctionV1Output.ts +47 -0
- package/model/deleteInvites200Response.ts +36 -0
- package/model/deleteInvitesV1Output.ts +47 -0
- package/model/deleteLabel200Response.ts +36 -0
- package/model/deleteLabel200Response1.ts +36 -0
- package/model/deleteLabelAlphaOutput.ts +47 -0
- package/model/deleteLabelV1Output.ts +47 -0
- package/model/deleteRegulation200Response.ts +36 -0
- package/model/deleteRegulationV1Output.ts +47 -0
- package/model/deleteSource200Response.ts +36 -0
- package/model/deleteSource200Response1.ts +36 -0
- package/model/deleteSourceAlphaOutput.ts +47 -0
- package/model/deleteSourceV1Output.ts +47 -0
- package/model/deleteTrackingPlan200Response.ts +36 -0
- package/model/deleteTrackingPlanV1Output.ts +47 -0
- package/model/deleteTransformation200Response.ts +36 -0
- package/model/deleteTransformationBetaOutput.ts +47 -0
- package/model/deleteUserGroup200Response.ts +36 -0
- package/model/deleteUserGroupV1Output.ts +47 -0
- package/model/deleteUsers200Response.ts +36 -0
- package/model/deleteUsersV1Output.ts +47 -0
- package/model/deleteWarehouse200Response.ts +36 -0
- package/model/deleteWarehouseV1Output.ts +47 -0
- package/model/deliveryMetricsSummary.ts +60 -0
- package/model/deliveryMetricsSummaryBeta.ts +60 -0
- package/model/destination.ts +84 -0
- package/model/destination1.ts +84 -0
- package/model/destination2.ts +84 -0
- package/model/destinationFilterActionV1.ts +77 -0
- package/model/destinationFilterV1.ts +123 -0
- package/model/destinationMetadata.ts +203 -0
- package/model/destinationMetadataActionFieldV1.ts +163 -0
- package/model/destinationMetadataActionV1.ts +113 -0
- package/model/destinationMetadataComponentV1.ts +72 -0
- package/model/destinationMetadataFeaturesV1.ts +93 -0
- package/model/destinationMetadataMethodsV1.ts +77 -0
- package/model/destinationMetadataPlatformsV1.ts +59 -0
- package/model/destinationMetadataSubscriptionPresetV1.ts +68 -0
- package/model/destinationMetadataV1.ts +203 -0
- package/model/destinationStatusV1.ts +74 -0
- package/model/destinationSubscription.ts +104 -0
- package/model/destinationSubscriptionUpdateInput.ts +68 -0
- package/model/destinationV1.ts +84 -0
- package/model/disableEdgeFunctions200Response.ts +36 -0
- package/model/disableEdgeFunctionsAlphaOutput.ts +39 -0
- package/model/echo200Response.ts +36 -0
- package/model/echo200Response1.ts +36 -0
- package/model/echoAlphaOutput.ts +66 -0
- package/model/echoV1Output.ts +66 -0
- package/model/edgeFunctions.ts +86 -0
- package/model/edgeFunctions1.ts +86 -0
- package/model/edgeFunctionsAlpha.ts +86 -0
- package/model/eventSourceV1.ts +59 -0
- package/model/filter.ts +51 -0
- package/model/filter1.ts +123 -0
- package/model/filter2.ts +123 -0
- package/model/filter3.ts +123 -0
- package/model/function.ts +166 -0
- package/model/function1.ts +166 -0
- package/model/function2.ts +166 -0
- package/model/functionDeployment.ts +44 -0
- package/model/functionSettingV1.ts +92 -0
- package/model/functionV1.ts +166 -0
- package/model/generateUploadURLForEdgeFunctions200Response.ts +36 -0
- package/model/generateUploadURLForEdgeFunctionsAlphaOutput.ts +41 -0
- package/model/getAdvancedSyncScheduleFromWarehouse200Response.ts +36 -0
- package/model/getAdvancedSyncScheduleFromWarehouseV1Output.ts +48 -0
- package/model/getConnectionStateFromWarehouse200Response.ts +36 -0
- package/model/getConnectionStateFromWarehouseV1Output.ts +48 -0
- package/model/getDailyPerSourceAPICallsUsage200Response.ts +36 -0
- package/model/getDailyPerSourceAPICallsUsageV1Output.ts +49 -0
- package/model/getDailyPerSourceMTUUsage200Response.ts +36 -0
- package/model/getDailyPerSourceMTUUsageV1Output.ts +49 -0
- package/model/getDailyWorkspaceAPICallsUsage200Response.ts +36 -0
- package/model/getDailyWorkspaceAPICallsUsageV1Output.ts +49 -0
- package/model/getDailyWorkspaceMTUUsage200Response.ts +36 -0
- package/model/getDailyWorkspaceMTUUsageV1Output.ts +49 -0
- package/model/getDestination200Response.ts +36 -0
- package/model/getDestinationMetadata200Response.ts +36 -0
- package/model/getDestinationMetadataV1Output.ts +39 -0
- package/model/getDestinationV1Output.ts +39 -0
- package/model/getDestinationsCatalog200Response.ts +36 -0
- package/model/getDestinationsCatalogV1Output.ts +49 -0
- package/model/getEventsVolumeFromWorkspace200Response.ts +36 -0
- package/model/getEventsVolumeFromWorkspaceV1Output.ts +49 -0
- package/model/getFilterInDestination200Response.ts +36 -0
- package/model/getFilterInDestinationV1Output.ts +39 -0
- package/model/getFunction200Response.ts +36 -0
- package/model/getFunctionV1Output.ts +39 -0
- package/model/getLatestFromEdgeFunctions200Response.ts +36 -0
- package/model/getLatestFromEdgeFunctionsAlphaOutput.ts +39 -0
- package/model/getMessagingSubscriptionFailureResponse.ts +57 -0
- package/model/getMessagingSubscriptionSuccessResponse.ts +68 -0
- package/model/getRegulation200Response.ts +36 -0
- package/model/getRegulationV1Output.ts +39 -0
- package/model/getSource200Response.ts +36 -0
- package/model/getSource200Response1.ts +36 -0
- package/model/getSourceAlphaOutput.ts +39 -0
- package/model/getSourceMetadata200Response.ts +36 -0
- package/model/getSourceMetadataV1Output.ts +39 -0
- package/model/getSourceV1Output.ts +39 -0
- package/model/getSourcesCatalog200Response.ts +36 -0
- package/model/getSourcesCatalogV1Output.ts +49 -0
- package/model/getSpace200Response.ts +36 -0
- package/model/getSpaceAlphaOutput.ts +39 -0
- package/model/getSubscriptionFromDestination200Response.ts +36 -0
- package/model/getSubscriptionFromDestinationAlphaOutput.ts +39 -0
- package/model/getSubscriptionRequest.ts +54 -0
- package/model/getTrackingPlan200Response.ts +36 -0
- package/model/getTrackingPlanV1Output.ts +39 -0
- package/model/getTransformation200Response.ts +36 -0
- package/model/getTransformationBetaOutput.ts +39 -0
- package/model/getUser200Response.ts +36 -0
- package/model/getUserGroup200Response.ts +36 -0
- package/model/getUserGroupV1Output.ts +39 -0
- package/model/getUserV1Output.ts +39 -0
- package/model/getWarehouse200Response.ts +36 -0
- package/model/getWarehouseMetadata200Response.ts +36 -0
- package/model/getWarehouseMetadataV1Output.ts +39 -0
- package/model/getWarehouseV1Output.ts +39 -0
- package/model/getWarehousesCatalog200Response.ts +36 -0
- package/model/getWarehousesCatalogV1Output.ts +49 -0
- package/model/getWorkspace200Response.ts +36 -0
- package/model/getWorkspaceV1Output.ts +39 -0
- package/model/group.ts +67 -0
- package/model/groupSourceSettingsV1.ts +64 -0
- package/model/identify.ts +67 -0
- package/model/identifySourceSettingsV1.ts +64 -0
- package/model/input.ts +68 -0
- package/model/integrationOptionBeta.ts +86 -0
- package/model/invitePermissionV1.ts +61 -0
- package/model/inviteV1.ts +51 -0
- package/model/label.ts +59 -0
- package/model/label1.ts +59 -0
- package/model/label2.ts +59 -0
- package/model/labelAlpha.ts +59 -0
- package/model/labelV1.ts +59 -0
- package/model/listAuditEvents200Response.ts +36 -0
- package/model/listAuditEventsV1Output.ts +49 -0
- package/model/listConnectedDestinationsFromSource200Response.ts +36 -0
- package/model/listConnectedDestinationsFromSource200Response1.ts +36 -0
- package/model/listConnectedDestinationsFromSourceAlphaOutput.ts +49 -0
- package/model/listConnectedDestinationsFromSourceV1Output.ts +49 -0
- package/model/listConnectedSourcesFromWarehouse200Response.ts +36 -0
- package/model/listConnectedSourcesFromWarehouseV1Output.ts +49 -0
- package/model/listConnectedWarehousesFromSource200Response.ts +36 -0
- package/model/listConnectedWarehousesFromSource200Response1.ts +36 -0
- package/model/listConnectedWarehousesFromSourceAlphaOutput.ts +49 -0
- package/model/listConnectedWarehousesFromSourceV1Output.ts +49 -0
- package/model/listDeliveryMetricsSummaryFromDestination200Response.ts +36 -0
- package/model/listDeliveryMetricsSummaryFromDestinationBetaOutput.ts +39 -0
- package/model/listDestinations200Response.ts +36 -0
- package/model/listDestinationsV1Output.ts +49 -0
- package/model/listFiltersFromDestination200Response.ts +36 -0
- package/model/listFiltersFromDestinationV1Output.ts +49 -0
- package/model/listFunctionItemV1.ts +111 -0
- package/model/listFunctions200Response.ts +36 -0
- package/model/listFunctionsV1Output.ts +49 -0
- package/model/listInvites200Response.ts +36 -0
- package/model/listInvitesFromUserGroup200Response.ts +36 -0
- package/model/listInvitesFromUserGroupV1Output.ts +48 -0
- package/model/listInvitesV1Output.ts +48 -0
- package/model/listLabels200Response.ts +36 -0
- package/model/listLabels200Response1.ts +36 -0
- package/model/listLabelsAlphaOutput.ts +42 -0
- package/model/listLabelsV1Output.ts +42 -0
- package/model/listRegulationsFromSource200Response.ts +36 -0
- package/model/listRegulationsFromSourceV1Output.ts +42 -0
- package/model/listRoles200Response.ts +36 -0
- package/model/listRolesV1Output.ts +49 -0
- package/model/listRulesFromTrackingPlan200Response.ts +36 -0
- package/model/listRulesFromTrackingPlanV1Output.ts +49 -0
- package/model/listSchemaSettingsInSource200Response.ts +36 -0
- package/model/listSchemaSettingsInSourceV1Output.ts +48 -0
- package/model/listSelectiveSyncsFromWarehouseAndSource200Response.ts +36 -0
- package/model/listSelectiveSyncsFromWarehouseAndSourceV1Output.ts +49 -0
- package/model/listSources200Response.ts +36 -0
- package/model/listSources200Response1.ts +36 -0
- package/model/listSourcesAlphaOutput.ts +49 -0
- package/model/listSourcesFromTrackingPlan200Response.ts +36 -0
- package/model/listSourcesFromTrackingPlanV1Output.ts +49 -0
- package/model/listSourcesV1Output.ts +49 -0
- package/model/listSubscriptionsFromDestination200Response.ts +36 -0
- package/model/listSubscriptionsFromDestinationAlphaOutput.ts +49 -0
- package/model/listSuppressions200Response.ts +36 -0
- package/model/listSuppressionsV1Output.ts +49 -0
- package/model/listSyncsFromWarehouse200Response.ts +36 -0
- package/model/listSyncsFromWarehouseAndSource200Response.ts +36 -0
- package/model/listSyncsFromWarehouseAndSourceV1Output.ts +49 -0
- package/model/listSyncsFromWarehouseV1Output.ts +49 -0
- package/model/listTrackingPlans200Response.ts +36 -0
- package/model/listTrackingPlansV1Output.ts +49 -0
- package/model/listTransformations200Response.ts +36 -0
- package/model/listTransformationsBetaOutput.ts +49 -0
- package/model/listUserGroups200Response.ts +36 -0
- package/model/listUserGroupsFromUser200Response.ts +36 -0
- package/model/listUserGroupsFromUserV1Output.ts +49 -0
- package/model/listUserGroupsV1Output.ts +49 -0
- package/model/listUsers200Response.ts +36 -0
- package/model/listUsersFromUserGroup200Response.ts +36 -0
- package/model/listUsersFromUserGroupV1Output.ts +49 -0
- package/model/listUsersV1Output.ts +49 -0
- package/model/listWarehouses200Response.ts +36 -0
- package/model/listWarehousesV1Output.ts +49 -0
- package/model/listWorkspaceRegulations200Response.ts +36 -0
- package/model/listWorkspaceRegulationsV1Output.ts +49 -0
- package/model/logos.ts +59 -0
- package/model/logos1.ts +59 -0
- package/model/logos2.ts +59 -0
- package/model/logosBeta.ts +59 -0
- package/model/messageSubscriptionResponse.ts +78 -0
- package/model/messageSubscriptionResponseError.ts +47 -0
- package/model/messagesSubscriptionRequest.ts +68 -0
- package/model/metadata.ts +203 -0
- package/model/metadata1.ts +103 -0
- package/model/metadata2.ts +85 -0
- package/model/metricBeta.ts +60 -0
- package/model/minimalUserGroupV1.ts +50 -0
- package/model/minimalUserV1.ts +59 -0
- package/model/models.ts +1838 -0
- package/model/mtuSnapshotV1.ts +95 -0
- package/model/pagination.ts +68 -0
- package/model/paginationInput.ts +50 -0
- package/model/paginationOutput.ts +68 -0
- package/model/permissionInputV1.ts +51 -0
- package/model/permissionResourceV1.ts +70 -0
- package/model/permissionV1.ts +70 -0
- package/model/previewDestinationFilter200Response.ts +36 -0
- package/model/previewDestinationFilterV1.ts +51 -0
- package/model/previewDestinationFilterV1Input.ts +48 -0
- package/model/previewDestinationFilterV1Output.ts +50 -0
- package/model/propertyRenameBeta.ts +47 -0
- package/model/regulation.ts +99 -0
- package/model/regulationListEntryV1.ts +77 -0
- package/model/removeFilterFromDestination200Response.ts +36 -0
- package/model/removeFilterFromDestinationV1Output.ts +47 -0
- package/model/removeRuleV1.ts +61 -0
- package/model/removeRulesFromTrackingPlan200Response.ts +36 -0
- package/model/removeRulesFromTrackingPlanV1Output.ts +47 -0
- package/model/removeSourceConnectionFromWarehouse200Response.ts +36 -0
- package/model/removeSourceConnectionFromWarehouseV1Output.ts +47 -0
- package/model/removeSourceFromTrackingPlan200Response.ts +36 -0
- package/model/removeSourceFromTrackingPlanV1Output.ts +47 -0
- package/model/removeSubscriptionFromDestination200Response.ts +36 -0
- package/model/removeSubscriptionFromDestinationAlphaOutput.ts +47 -0
- package/model/removeUsersFromUserGroup200Response.ts +36 -0
- package/model/removeUsersFromUserGroupV1Output.ts +47 -0
- package/model/replaceAdvancedSyncScheduleForWarehouse200Response.ts +36 -0
- package/model/replaceAdvancedSyncScheduleForWarehouseV1Input.ts +48 -0
- package/model/replaceAdvancedSyncScheduleForWarehouseV1Output.ts +48 -0
- package/model/replaceLabelsInSource200Response.ts +36 -0
- package/model/replaceLabelsInSource200Response1.ts +36 -0
- package/model/replaceLabelsInSourceAlphaInput.ts +42 -0
- package/model/replaceLabelsInSourceAlphaOutput.ts +42 -0
- package/model/replaceLabelsInSourceV1Input.ts +42 -0
- package/model/replaceLabelsInSourceV1Output.ts +42 -0
- package/model/replaceMessagingSubscriptionsInSpaces200Response.ts +36 -0
- package/model/replaceMessagingSubscriptionsInSpacesAlphaInput.ts +42 -0
- package/model/replaceMessagingSubscriptionsInSpacesAlphaOutput.ts +58 -0
- package/model/replacePermissionsForUser200Response.ts +36 -0
- package/model/replacePermissionsForUserGroup200Response.ts +36 -0
- package/model/replacePermissionsForUserGroupV1Input.ts +42 -0
- package/model/replacePermissionsForUserGroupV1Output.ts +42 -0
- package/model/replacePermissionsForUserV1Input.ts +42 -0
- package/model/replacePermissionsForUserV1Output.ts +42 -0
- package/model/replaceRulesInTrackingPlan200Response.ts +36 -0
- package/model/replaceRulesInTrackingPlanV1Input.ts +42 -0
- package/model/replaceRulesInTrackingPlanV1Output.ts +47 -0
- package/model/replaceUsersInUserGroup200Response.ts +36 -0
- package/model/replaceUsersInUserGroupV1Input.ts +41 -0
- package/model/replaceUsersInUserGroupV1Output.ts +39 -0
- package/model/requestError.ts +77 -0
- package/model/requestErrorEnvelope.ts +39 -0
- package/model/resourceV1.ts +60 -0
- package/model/roleV1.ts +59 -0
- package/model/ruleV1.ts +106 -0
- package/model/schedule.ts +51 -0
- package/model/schedule1.ts +51 -0
- package/model/schedule2.ts +51 -0
- package/model/settings.ts +71 -0
- package/model/settings1.ts +71 -0
- package/model/source.ts +59 -0
- package/model/source1.ts +112 -0
- package/model/source2.ts +112 -0
- package/model/source3.ts +112 -0
- package/model/source4.ts +112 -0
- package/model/source5.ts +112 -0
- package/model/source6.ts +112 -0
- package/model/sourceAPICallSnapshotV1.ts +59 -0
- package/model/sourceAlpha.ts +112 -0
- package/model/sourceEventVolumeDatapointV1.ts +50 -0
- package/model/sourceEventVolumeV1.ts +76 -0
- package/model/sourceMetadata.ts +103 -0
- package/model/sourceMetadataV1.ts +103 -0
- package/model/sourceSettingsOutputV1.ts +71 -0
- package/model/sourceV1.ts +112 -0
- package/model/space.ts +50 -0
- package/model/streamStatusV1.ts +45 -0
- package/model/subscription.ts +104 -0
- package/model/supportedFeatures.ts +93 -0
- package/model/supportedMethods.ts +77 -0
- package/model/supportedPlatforms.ts +59 -0
- package/model/suppressedInner.ts +41 -0
- package/model/syncNoticeV1.ts +59 -0
- package/model/syncV1.ts +105 -0
- package/model/track.ts +85 -0
- package/model/trackSourceSettingsV1.ts +82 -0
- package/model/trackingPlan.ts +104 -0
- package/model/trackingPlan1.ts +104 -0
- package/model/trackingPlanV1.ts +104 -0
- package/model/transformation.ts +105 -0
- package/model/transformation1.ts +105 -0
- package/model/transformation2.ts +105 -0
- package/model/transformationBeta.ts +105 -0
- package/model/updateDestination200Response.ts +36 -0
- package/model/updateDestinationV1Input.ts +59 -0
- package/model/updateDestinationV1Output.ts +39 -0
- package/model/updateFilterForDestination200Response.ts +36 -0
- package/model/updateFilterForDestinationV1Input.ts +78 -0
- package/model/updateFilterForDestinationV1Output.ts +39 -0
- package/model/updateFunction200Response.ts +36 -0
- package/model/updateFunctionV1Input.ts +78 -0
- package/model/updateFunctionV1Output.ts +39 -0
- package/model/updateRulesInTrackingPlan200Response.ts +36 -0
- package/model/updateRulesInTrackingPlanV1Input.ts +42 -0
- package/model/updateRulesInTrackingPlanV1Output.ts +47 -0
- package/model/updateSchemaSettingsInSource200Response.ts +36 -0
- package/model/updateSchemaSettingsInSourceV1Input.ts +71 -0
- package/model/updateSchemaSettingsInSourceV1Output.ts +48 -0
- package/model/updateSelectiveSyncForWarehouse200Response.ts +36 -0
- package/model/updateSelectiveSyncForWarehouseV1Input.ts +42 -0
- package/model/updateSelectiveSyncForWarehouseV1Output.ts +57 -0
- package/model/updateSource200Response.ts +36 -0
- package/model/updateSource200Response1.ts +36 -0
- package/model/updateSourceAlphaInput.ts +68 -0
- package/model/updateSourceAlphaOutput.ts +39 -0
- package/model/updateSourceV1Input.ts +68 -0
- package/model/updateSourceV1Output.ts +39 -0
- package/model/updateSubscriptionForDestination200Response.ts +36 -0
- package/model/updateSubscriptionForDestinationAlphaInput.ts +39 -0
- package/model/updateSubscriptionForDestinationAlphaOutput.ts +39 -0
- package/model/updateTrackingPlan200Response.ts +36 -0
- package/model/updateTrackingPlanV1Input.ts +50 -0
- package/model/updateTrackingPlanV1Output.ts +47 -0
- package/model/updateTransformation200Response.ts +36 -0
- package/model/updateTransformationBetaInput.ts +96 -0
- package/model/updateTransformationBetaOutput.ts +39 -0
- package/model/updateUserGroup200Response.ts +36 -0
- package/model/updateUserGroupV1Input.ts +41 -0
- package/model/updateUserGroupV1Output.ts +39 -0
- package/model/updateWarehouse200Response.ts +36 -0
- package/model/updateWarehouseV1Input.ts +59 -0
- package/model/updateWarehouseV1Output.ts +39 -0
- package/model/upsertRuleV1.ts +112 -0
- package/model/user.ts +69 -0
- package/model/userGroup.ts +69 -0
- package/model/userGroup1.ts +69 -0
- package/model/userGroup2.ts +69 -0
- package/model/userGroup3.ts +69 -0
- package/model/userGroupV1.ts +69 -0
- package/model/userV1.ts +69 -0
- package/model/usersPerSourceSnapshotV1.ts +104 -0
- package/model/warehouse.ts +75 -0
- package/model/warehouse1.ts +75 -0
- package/model/warehouse2.ts +75 -0
- package/model/warehouseAdvancedSyncV1.ts +50 -0
- package/model/warehouseMetadata.ts +85 -0
- package/model/warehouseMetadataV1.ts +85 -0
- package/model/warehouseSelectiveSyncItemV1.ts +68 -0
- package/model/warehouseSyncOverrideV1.ts +68 -0
- package/model/warehouseV1.ts +75 -0
- package/model/workspace.ts +59 -0
- package/model/workspaceV1.ts +59 -0
- package/package.json +1 -2
- package/tests/__snapshots__/smoke.test.ts.snap +889 -0
- package/tests/smoke.test.ts +267 -0
- package/tsconfig.json +20 -0
package/api/labelsApi.ts
ADDED
|
@@ -0,0 +1,1488 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Segment Public API
|
|
3
|
+
* The Segment Public API helps you manage your Segment Workspaces and its resources. You can use the API to perform CRUD (create, read, update, delete) operations at no extra charge. This includes working with resources such as Sources, Destinations, Warehouses, Tracking Plans, and the Segment Destinations and Sources Catalogs. All CRUD endpoints in the API follow REST conventions and use standard HTTP methods. Different URL endpoints represent different resources in a Workspace. See the next sections for more information on how to use the Segment Public API.
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 32.0.2
|
|
6
|
+
* Contact: friends@segment.com
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import localVarRequest from 'request';
|
|
14
|
+
import http from 'http';
|
|
15
|
+
|
|
16
|
+
/* tslint:disable:no-unused-locals */
|
|
17
|
+
import { CreateLabel200Response } from '../model/createLabel200Response';
|
|
18
|
+
import { CreateLabel200Response1 } from '../model/createLabel200Response1';
|
|
19
|
+
import { CreateLabelAlphaInput } from '../model/createLabelAlphaInput';
|
|
20
|
+
import { CreateLabelV1Input } from '../model/createLabelV1Input';
|
|
21
|
+
import { DeleteLabel200Response } from '../model/deleteLabel200Response';
|
|
22
|
+
import { DeleteLabel200Response1 } from '../model/deleteLabel200Response1';
|
|
23
|
+
import { ListLabels200Response } from '../model/listLabels200Response';
|
|
24
|
+
import { ListLabels200Response1 } from '../model/listLabels200Response1';
|
|
25
|
+
import { RequestErrorEnvelope } from '../model/requestErrorEnvelope';
|
|
26
|
+
|
|
27
|
+
import {
|
|
28
|
+
ObjectSerializer,
|
|
29
|
+
Authentication,
|
|
30
|
+
VoidAuth,
|
|
31
|
+
Interceptor,
|
|
32
|
+
} from '../model/models';
|
|
33
|
+
import {
|
|
34
|
+
HttpBasicAuth,
|
|
35
|
+
HttpBearerAuth,
|
|
36
|
+
ApiKeyAuth,
|
|
37
|
+
OAuth,
|
|
38
|
+
} from '../model/models';
|
|
39
|
+
|
|
40
|
+
import { HttpError, RequestFile } from './apis';
|
|
41
|
+
|
|
42
|
+
let defaultBasePath = 'https://api.segmentapis.com';
|
|
43
|
+
|
|
44
|
+
// ===============================================
|
|
45
|
+
// This file is autogenerated - Please do not edit
|
|
46
|
+
// ===============================================
|
|
47
|
+
|
|
48
|
+
export enum LabelsApiApiKeys {}
|
|
49
|
+
|
|
50
|
+
export class LabelsApi {
|
|
51
|
+
protected _basePath = defaultBasePath;
|
|
52
|
+
protected _defaultHeaders: any = {};
|
|
53
|
+
protected _useQuerystring: boolean = false;
|
|
54
|
+
|
|
55
|
+
protected authentications = {
|
|
56
|
+
default: <Authentication>new VoidAuth(),
|
|
57
|
+
token: new HttpBearerAuth(),
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
protected interceptors: Interceptor[] = [];
|
|
61
|
+
|
|
62
|
+
constructor(basePath?: string);
|
|
63
|
+
constructor(
|
|
64
|
+
basePathOrUsername: string,
|
|
65
|
+
password?: string,
|
|
66
|
+
basePath?: string
|
|
67
|
+
) {
|
|
68
|
+
if (password) {
|
|
69
|
+
if (basePath) {
|
|
70
|
+
this.basePath = basePath;
|
|
71
|
+
}
|
|
72
|
+
} else {
|
|
73
|
+
if (basePathOrUsername) {
|
|
74
|
+
this.basePath = basePathOrUsername;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
set useQuerystring(value: boolean) {
|
|
80
|
+
this._useQuerystring = value;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
set basePath(basePath: string) {
|
|
84
|
+
this._basePath = basePath;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
88
|
+
this._defaultHeaders = defaultHeaders;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get defaultHeaders() {
|
|
92
|
+
return this._defaultHeaders;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
get basePath() {
|
|
96
|
+
return this._basePath;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
100
|
+
this.authentications.default = auth;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public setApiKey(key: LabelsApiApiKeys, value: string) {
|
|
104
|
+
(this.authentications as any)[LabelsApiApiKeys[key]].apiKey = value;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
108
|
+
this.authentications.token.accessToken = accessToken;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
112
|
+
this.interceptors.push(interceptor);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Creates a new label. When called, this endpoint may generate the `Label Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
|
|
117
|
+
* @summary Create Label
|
|
118
|
+
* @param CreateLabelAlphaInput
|
|
119
|
+
*/
|
|
120
|
+
public async createLabelAlpha(
|
|
121
|
+
CreateLabelAlphaInput: CreateLabelAlphaInput,
|
|
122
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
123
|
+
): Promise<{
|
|
124
|
+
response: http.IncomingMessage;
|
|
125
|
+
body: CreateLabel200Response;
|
|
126
|
+
}> {
|
|
127
|
+
const localVarPath = this.basePath + '/labels';
|
|
128
|
+
let localVarQueryParameters: any = {};
|
|
129
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
130
|
+
{},
|
|
131
|
+
this._defaultHeaders
|
|
132
|
+
);
|
|
133
|
+
const produces = [
|
|
134
|
+
'application/vnd.segment.v1alpha+json',
|
|
135
|
+
'application/json',
|
|
136
|
+
];
|
|
137
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
138
|
+
localVarHeaderParams.Accept = produces[0];
|
|
139
|
+
} else {
|
|
140
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
141
|
+
}
|
|
142
|
+
let localVarFormParams: any = {};
|
|
143
|
+
|
|
144
|
+
// verify required parameter 'CreateLabelAlphaInput' is not null or undefined
|
|
145
|
+
if (
|
|
146
|
+
CreateLabelAlphaInput === null ||
|
|
147
|
+
CreateLabelAlphaInput === undefined
|
|
148
|
+
) {
|
|
149
|
+
throw new Error(
|
|
150
|
+
'Required parameter CreateLabelAlphaInput was null or undefined when calling createLabelAlpha.'
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
155
|
+
|
|
156
|
+
let localVarUseFormData = false;
|
|
157
|
+
|
|
158
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
159
|
+
method: 'POST',
|
|
160
|
+
qs: localVarQueryParameters,
|
|
161
|
+
headers: localVarHeaderParams,
|
|
162
|
+
uri: localVarPath,
|
|
163
|
+
useQuerystring: this._useQuerystring,
|
|
164
|
+
json: true,
|
|
165
|
+
body: ObjectSerializer.serialize(
|
|
166
|
+
CreateLabelAlphaInput,
|
|
167
|
+
'CreateLabelAlphaInput'
|
|
168
|
+
),
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
let authenticationPromise = Promise.resolve();
|
|
172
|
+
if (this.authentications.token.accessToken) {
|
|
173
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
174
|
+
this.authentications.token.applyToRequest(
|
|
175
|
+
localVarRequestOptions
|
|
176
|
+
)
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
180
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
let interceptorPromise = authenticationPromise;
|
|
184
|
+
for (const interceptor of this.interceptors) {
|
|
185
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
186
|
+
interceptor(localVarRequestOptions)
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return interceptorPromise.then(() => {
|
|
191
|
+
if (Object.keys(localVarFormParams).length) {
|
|
192
|
+
if (localVarUseFormData) {
|
|
193
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
194
|
+
} else {
|
|
195
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return new Promise<{
|
|
199
|
+
response: http.IncomingMessage;
|
|
200
|
+
body: CreateLabel200Response;
|
|
201
|
+
}>((resolve, reject) => {
|
|
202
|
+
localVarRequest(
|
|
203
|
+
localVarRequestOptions,
|
|
204
|
+
(error, response, body) => {
|
|
205
|
+
if (error) {
|
|
206
|
+
reject(error);
|
|
207
|
+
} else {
|
|
208
|
+
if (
|
|
209
|
+
response.statusCode &&
|
|
210
|
+
response.statusCode >= 200 &&
|
|
211
|
+
response.statusCode <= 299
|
|
212
|
+
) {
|
|
213
|
+
body = ObjectSerializer.deserialize(
|
|
214
|
+
body,
|
|
215
|
+
'CreateLabel200Response'
|
|
216
|
+
);
|
|
217
|
+
resolve({ response: response, body: body });
|
|
218
|
+
} else {
|
|
219
|
+
reject(
|
|
220
|
+
new HttpError(
|
|
221
|
+
response,
|
|
222
|
+
body,
|
|
223
|
+
response.statusCode
|
|
224
|
+
)
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Creates a new label. When called, this endpoint may generate the `Label Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
|
|
235
|
+
* @summary Create Label
|
|
236
|
+
* @param CreateLabelV1Input
|
|
237
|
+
*/
|
|
238
|
+
public async createLabelBeta(
|
|
239
|
+
CreateLabelV1Input: CreateLabelV1Input,
|
|
240
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
241
|
+
): Promise<{
|
|
242
|
+
response: http.IncomingMessage;
|
|
243
|
+
body: CreateLabel200Response1;
|
|
244
|
+
}> {
|
|
245
|
+
const localVarPath = this.basePath + '/labels';
|
|
246
|
+
let localVarQueryParameters: any = {};
|
|
247
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
248
|
+
{},
|
|
249
|
+
this._defaultHeaders
|
|
250
|
+
);
|
|
251
|
+
const produces = [
|
|
252
|
+
'application/vnd.segment.v1beta+json',
|
|
253
|
+
'application/json',
|
|
254
|
+
];
|
|
255
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
256
|
+
localVarHeaderParams.Accept = produces[0];
|
|
257
|
+
} else {
|
|
258
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
259
|
+
}
|
|
260
|
+
let localVarFormParams: any = {};
|
|
261
|
+
|
|
262
|
+
// verify required parameter 'CreateLabelV1Input' is not null or undefined
|
|
263
|
+
if (CreateLabelV1Input === null || CreateLabelV1Input === undefined) {
|
|
264
|
+
throw new Error(
|
|
265
|
+
'Required parameter CreateLabelV1Input was null or undefined when calling createLabelBeta.'
|
|
266
|
+
);
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
270
|
+
|
|
271
|
+
let localVarUseFormData = false;
|
|
272
|
+
|
|
273
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
274
|
+
method: 'POST',
|
|
275
|
+
qs: localVarQueryParameters,
|
|
276
|
+
headers: localVarHeaderParams,
|
|
277
|
+
uri: localVarPath,
|
|
278
|
+
useQuerystring: this._useQuerystring,
|
|
279
|
+
json: true,
|
|
280
|
+
body: ObjectSerializer.serialize(
|
|
281
|
+
CreateLabelV1Input,
|
|
282
|
+
'CreateLabelV1Input'
|
|
283
|
+
),
|
|
284
|
+
};
|
|
285
|
+
|
|
286
|
+
let authenticationPromise = Promise.resolve();
|
|
287
|
+
if (this.authentications.token.accessToken) {
|
|
288
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
289
|
+
this.authentications.token.applyToRequest(
|
|
290
|
+
localVarRequestOptions
|
|
291
|
+
)
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
295
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
296
|
+
);
|
|
297
|
+
|
|
298
|
+
let interceptorPromise = authenticationPromise;
|
|
299
|
+
for (const interceptor of this.interceptors) {
|
|
300
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
301
|
+
interceptor(localVarRequestOptions)
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return interceptorPromise.then(() => {
|
|
306
|
+
if (Object.keys(localVarFormParams).length) {
|
|
307
|
+
if (localVarUseFormData) {
|
|
308
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
309
|
+
} else {
|
|
310
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return new Promise<{
|
|
314
|
+
response: http.IncomingMessage;
|
|
315
|
+
body: CreateLabel200Response1;
|
|
316
|
+
}>((resolve, reject) => {
|
|
317
|
+
localVarRequest(
|
|
318
|
+
localVarRequestOptions,
|
|
319
|
+
(error, response, body) => {
|
|
320
|
+
if (error) {
|
|
321
|
+
reject(error);
|
|
322
|
+
} else {
|
|
323
|
+
if (
|
|
324
|
+
response.statusCode &&
|
|
325
|
+
response.statusCode >= 200 &&
|
|
326
|
+
response.statusCode <= 299
|
|
327
|
+
) {
|
|
328
|
+
body = ObjectSerializer.deserialize(
|
|
329
|
+
body,
|
|
330
|
+
'CreateLabel200Response1'
|
|
331
|
+
);
|
|
332
|
+
resolve({ response: response, body: body });
|
|
333
|
+
} else {
|
|
334
|
+
reject(
|
|
335
|
+
new HttpError(
|
|
336
|
+
response,
|
|
337
|
+
body,
|
|
338
|
+
response.statusCode
|
|
339
|
+
)
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
);
|
|
345
|
+
});
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Creates a new label. When called, this endpoint may generate the `Label Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
|
|
350
|
+
* @summary Create Label
|
|
351
|
+
* @param CreateLabelV1Input
|
|
352
|
+
*/
|
|
353
|
+
public async createLabelCurrent(
|
|
354
|
+
CreateLabelV1Input: CreateLabelV1Input,
|
|
355
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
356
|
+
): Promise<{
|
|
357
|
+
response: http.IncomingMessage;
|
|
358
|
+
body: CreateLabel200Response1;
|
|
359
|
+
}> {
|
|
360
|
+
const localVarPath = this.basePath + '/labels';
|
|
361
|
+
let localVarQueryParameters: any = {};
|
|
362
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
363
|
+
{},
|
|
364
|
+
this._defaultHeaders
|
|
365
|
+
);
|
|
366
|
+
const produces = [
|
|
367
|
+
'application/vnd.segment.v1+json',
|
|
368
|
+
'application/json',
|
|
369
|
+
];
|
|
370
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
371
|
+
localVarHeaderParams.Accept = produces[0];
|
|
372
|
+
} else {
|
|
373
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
374
|
+
}
|
|
375
|
+
let localVarFormParams: any = {};
|
|
376
|
+
|
|
377
|
+
// verify required parameter 'CreateLabelV1Input' is not null or undefined
|
|
378
|
+
if (CreateLabelV1Input === null || CreateLabelV1Input === undefined) {
|
|
379
|
+
throw new Error(
|
|
380
|
+
'Required parameter CreateLabelV1Input was null or undefined when calling createLabelCurrent.'
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
385
|
+
|
|
386
|
+
let localVarUseFormData = false;
|
|
387
|
+
|
|
388
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
389
|
+
method: 'POST',
|
|
390
|
+
qs: localVarQueryParameters,
|
|
391
|
+
headers: localVarHeaderParams,
|
|
392
|
+
uri: localVarPath,
|
|
393
|
+
useQuerystring: this._useQuerystring,
|
|
394
|
+
json: true,
|
|
395
|
+
body: ObjectSerializer.serialize(
|
|
396
|
+
CreateLabelV1Input,
|
|
397
|
+
'CreateLabelV1Input'
|
|
398
|
+
),
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
let authenticationPromise = Promise.resolve();
|
|
402
|
+
if (this.authentications.token.accessToken) {
|
|
403
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
404
|
+
this.authentications.token.applyToRequest(
|
|
405
|
+
localVarRequestOptions
|
|
406
|
+
)
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
410
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
411
|
+
);
|
|
412
|
+
|
|
413
|
+
let interceptorPromise = authenticationPromise;
|
|
414
|
+
for (const interceptor of this.interceptors) {
|
|
415
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
416
|
+
interceptor(localVarRequestOptions)
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
return interceptorPromise.then(() => {
|
|
421
|
+
if (Object.keys(localVarFormParams).length) {
|
|
422
|
+
if (localVarUseFormData) {
|
|
423
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
424
|
+
} else {
|
|
425
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
return new Promise<{
|
|
429
|
+
response: http.IncomingMessage;
|
|
430
|
+
body: CreateLabel200Response1;
|
|
431
|
+
}>((resolve, reject) => {
|
|
432
|
+
localVarRequest(
|
|
433
|
+
localVarRequestOptions,
|
|
434
|
+
(error, response, body) => {
|
|
435
|
+
if (error) {
|
|
436
|
+
reject(error);
|
|
437
|
+
} else {
|
|
438
|
+
if (
|
|
439
|
+
response.statusCode &&
|
|
440
|
+
response.statusCode >= 200 &&
|
|
441
|
+
response.statusCode <= 299
|
|
442
|
+
) {
|
|
443
|
+
body = ObjectSerializer.deserialize(
|
|
444
|
+
body,
|
|
445
|
+
'CreateLabel200Response1'
|
|
446
|
+
);
|
|
447
|
+
resolve({ response: response, body: body });
|
|
448
|
+
} else {
|
|
449
|
+
reject(
|
|
450
|
+
new HttpError(
|
|
451
|
+
response,
|
|
452
|
+
body,
|
|
453
|
+
response.statusCode
|
|
454
|
+
)
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
);
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Creates a new label. When called, this endpoint may generate the `Label Created` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
|
|
465
|
+
* @summary Create Label
|
|
466
|
+
* @param CreateLabelV1Input
|
|
467
|
+
*/
|
|
468
|
+
public async createLabelV1(
|
|
469
|
+
CreateLabelV1Input: CreateLabelV1Input,
|
|
470
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
471
|
+
): Promise<{
|
|
472
|
+
response: http.IncomingMessage;
|
|
473
|
+
body: CreateLabel200Response1;
|
|
474
|
+
}> {
|
|
475
|
+
const localVarPath = this.basePath + '/labels';
|
|
476
|
+
let localVarQueryParameters: any = {};
|
|
477
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
478
|
+
{},
|
|
479
|
+
this._defaultHeaders
|
|
480
|
+
);
|
|
481
|
+
const produces = [
|
|
482
|
+
'application/vnd.segment.v1+json',
|
|
483
|
+
'application/json',
|
|
484
|
+
];
|
|
485
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
486
|
+
localVarHeaderParams.Accept = produces[0];
|
|
487
|
+
} else {
|
|
488
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
489
|
+
}
|
|
490
|
+
let localVarFormParams: any = {};
|
|
491
|
+
|
|
492
|
+
// verify required parameter 'CreateLabelV1Input' is not null or undefined
|
|
493
|
+
if (CreateLabelV1Input === null || CreateLabelV1Input === undefined) {
|
|
494
|
+
throw new Error(
|
|
495
|
+
'Required parameter CreateLabelV1Input was null or undefined when calling createLabelV1.'
|
|
496
|
+
);
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
500
|
+
|
|
501
|
+
let localVarUseFormData = false;
|
|
502
|
+
|
|
503
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
504
|
+
method: 'POST',
|
|
505
|
+
qs: localVarQueryParameters,
|
|
506
|
+
headers: localVarHeaderParams,
|
|
507
|
+
uri: localVarPath,
|
|
508
|
+
useQuerystring: this._useQuerystring,
|
|
509
|
+
json: true,
|
|
510
|
+
body: ObjectSerializer.serialize(
|
|
511
|
+
CreateLabelV1Input,
|
|
512
|
+
'CreateLabelV1Input'
|
|
513
|
+
),
|
|
514
|
+
};
|
|
515
|
+
|
|
516
|
+
let authenticationPromise = Promise.resolve();
|
|
517
|
+
if (this.authentications.token.accessToken) {
|
|
518
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
519
|
+
this.authentications.token.applyToRequest(
|
|
520
|
+
localVarRequestOptions
|
|
521
|
+
)
|
|
522
|
+
);
|
|
523
|
+
}
|
|
524
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
525
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
526
|
+
);
|
|
527
|
+
|
|
528
|
+
let interceptorPromise = authenticationPromise;
|
|
529
|
+
for (const interceptor of this.interceptors) {
|
|
530
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
531
|
+
interceptor(localVarRequestOptions)
|
|
532
|
+
);
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
return interceptorPromise.then(() => {
|
|
536
|
+
if (Object.keys(localVarFormParams).length) {
|
|
537
|
+
if (localVarUseFormData) {
|
|
538
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
539
|
+
} else {
|
|
540
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return new Promise<{
|
|
544
|
+
response: http.IncomingMessage;
|
|
545
|
+
body: CreateLabel200Response1;
|
|
546
|
+
}>((resolve, reject) => {
|
|
547
|
+
localVarRequest(
|
|
548
|
+
localVarRequestOptions,
|
|
549
|
+
(error, response, body) => {
|
|
550
|
+
if (error) {
|
|
551
|
+
reject(error);
|
|
552
|
+
} else {
|
|
553
|
+
if (
|
|
554
|
+
response.statusCode &&
|
|
555
|
+
response.statusCode >= 200 &&
|
|
556
|
+
response.statusCode <= 299
|
|
557
|
+
) {
|
|
558
|
+
body = ObjectSerializer.deserialize(
|
|
559
|
+
body,
|
|
560
|
+
'CreateLabel200Response1'
|
|
561
|
+
);
|
|
562
|
+
resolve({ response: response, body: body });
|
|
563
|
+
} else {
|
|
564
|
+
reject(
|
|
565
|
+
new HttpError(
|
|
566
|
+
response,
|
|
567
|
+
body,
|
|
568
|
+
response.statusCode
|
|
569
|
+
)
|
|
570
|
+
);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
);
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
/**
|
|
579
|
+
* Deletes a label. When called, this endpoint may generate the `Label Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
|
|
580
|
+
* @summary Delete Label
|
|
581
|
+
* @param key
|
|
582
|
+
* @param value
|
|
583
|
+
*/
|
|
584
|
+
public async deleteLabelAlpha(
|
|
585
|
+
key: string,
|
|
586
|
+
value: string,
|
|
587
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
588
|
+
): Promise<{
|
|
589
|
+
response: http.IncomingMessage;
|
|
590
|
+
body: DeleteLabel200Response;
|
|
591
|
+
}> {
|
|
592
|
+
const localVarPath =
|
|
593
|
+
this.basePath +
|
|
594
|
+
'/labels/{key}/{value}'
|
|
595
|
+
.replace('{' + 'key' + '}', encodeURIComponent(String(key)))
|
|
596
|
+
.replace(
|
|
597
|
+
'{' + 'value' + '}',
|
|
598
|
+
encodeURIComponent(String(value))
|
|
599
|
+
);
|
|
600
|
+
let localVarQueryParameters: any = {};
|
|
601
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
602
|
+
{},
|
|
603
|
+
this._defaultHeaders
|
|
604
|
+
);
|
|
605
|
+
const produces = [
|
|
606
|
+
'application/vnd.segment.v1alpha+json',
|
|
607
|
+
'application/json',
|
|
608
|
+
];
|
|
609
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
610
|
+
localVarHeaderParams.Accept = produces[0];
|
|
611
|
+
} else {
|
|
612
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
613
|
+
}
|
|
614
|
+
let localVarFormParams: any = {};
|
|
615
|
+
|
|
616
|
+
// verify required parameter 'key' is not null or undefined
|
|
617
|
+
if (key === null || key === undefined) {
|
|
618
|
+
throw new Error(
|
|
619
|
+
'Required parameter key was null or undefined when calling deleteLabelAlpha.'
|
|
620
|
+
);
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
// verify required parameter 'value' is not null or undefined
|
|
624
|
+
if (value === null || value === undefined) {
|
|
625
|
+
throw new Error(
|
|
626
|
+
'Required parameter value was null or undefined when calling deleteLabelAlpha.'
|
|
627
|
+
);
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
631
|
+
|
|
632
|
+
let localVarUseFormData = false;
|
|
633
|
+
|
|
634
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
635
|
+
method: 'DELETE',
|
|
636
|
+
qs: localVarQueryParameters,
|
|
637
|
+
headers: localVarHeaderParams,
|
|
638
|
+
uri: localVarPath,
|
|
639
|
+
useQuerystring: this._useQuerystring,
|
|
640
|
+
json: true,
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
let authenticationPromise = Promise.resolve();
|
|
644
|
+
if (this.authentications.token.accessToken) {
|
|
645
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
646
|
+
this.authentications.token.applyToRequest(
|
|
647
|
+
localVarRequestOptions
|
|
648
|
+
)
|
|
649
|
+
);
|
|
650
|
+
}
|
|
651
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
652
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
653
|
+
);
|
|
654
|
+
|
|
655
|
+
let interceptorPromise = authenticationPromise;
|
|
656
|
+
for (const interceptor of this.interceptors) {
|
|
657
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
658
|
+
interceptor(localVarRequestOptions)
|
|
659
|
+
);
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
return interceptorPromise.then(() => {
|
|
663
|
+
if (Object.keys(localVarFormParams).length) {
|
|
664
|
+
if (localVarUseFormData) {
|
|
665
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
666
|
+
} else {
|
|
667
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
return new Promise<{
|
|
671
|
+
response: http.IncomingMessage;
|
|
672
|
+
body: DeleteLabel200Response;
|
|
673
|
+
}>((resolve, reject) => {
|
|
674
|
+
localVarRequest(
|
|
675
|
+
localVarRequestOptions,
|
|
676
|
+
(error, response, body) => {
|
|
677
|
+
if (error) {
|
|
678
|
+
reject(error);
|
|
679
|
+
} else {
|
|
680
|
+
if (
|
|
681
|
+
response.statusCode &&
|
|
682
|
+
response.statusCode >= 200 &&
|
|
683
|
+
response.statusCode <= 299
|
|
684
|
+
) {
|
|
685
|
+
body = ObjectSerializer.deserialize(
|
|
686
|
+
body,
|
|
687
|
+
'DeleteLabel200Response'
|
|
688
|
+
);
|
|
689
|
+
resolve({ response: response, body: body });
|
|
690
|
+
} else {
|
|
691
|
+
reject(
|
|
692
|
+
new HttpError(
|
|
693
|
+
response,
|
|
694
|
+
body,
|
|
695
|
+
response.statusCode
|
|
696
|
+
)
|
|
697
|
+
);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
);
|
|
702
|
+
});
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
/**
|
|
706
|
+
* Deletes a label. When called, this endpoint may generate the `Label Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
|
|
707
|
+
* @summary Delete Label
|
|
708
|
+
* @param key
|
|
709
|
+
* @param value
|
|
710
|
+
*/
|
|
711
|
+
public async deleteLabelBeta(
|
|
712
|
+
key: string,
|
|
713
|
+
value: string,
|
|
714
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
715
|
+
): Promise<{
|
|
716
|
+
response: http.IncomingMessage;
|
|
717
|
+
body: DeleteLabel200Response1;
|
|
718
|
+
}> {
|
|
719
|
+
const localVarPath =
|
|
720
|
+
this.basePath +
|
|
721
|
+
'/labels/{key}/{value}'
|
|
722
|
+
.replace('{' + 'key' + '}', encodeURIComponent(String(key)))
|
|
723
|
+
.replace(
|
|
724
|
+
'{' + 'value' + '}',
|
|
725
|
+
encodeURIComponent(String(value))
|
|
726
|
+
);
|
|
727
|
+
let localVarQueryParameters: any = {};
|
|
728
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
729
|
+
{},
|
|
730
|
+
this._defaultHeaders
|
|
731
|
+
);
|
|
732
|
+
const produces = [
|
|
733
|
+
'application/vnd.segment.v1beta+json',
|
|
734
|
+
'application/json',
|
|
735
|
+
];
|
|
736
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
737
|
+
localVarHeaderParams.Accept = produces[0];
|
|
738
|
+
} else {
|
|
739
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
740
|
+
}
|
|
741
|
+
let localVarFormParams: any = {};
|
|
742
|
+
|
|
743
|
+
// verify required parameter 'key' is not null or undefined
|
|
744
|
+
if (key === null || key === undefined) {
|
|
745
|
+
throw new Error(
|
|
746
|
+
'Required parameter key was null or undefined when calling deleteLabelBeta.'
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
// verify required parameter 'value' is not null or undefined
|
|
751
|
+
if (value === null || value === undefined) {
|
|
752
|
+
throw new Error(
|
|
753
|
+
'Required parameter value was null or undefined when calling deleteLabelBeta.'
|
|
754
|
+
);
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
758
|
+
|
|
759
|
+
let localVarUseFormData = false;
|
|
760
|
+
|
|
761
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
762
|
+
method: 'DELETE',
|
|
763
|
+
qs: localVarQueryParameters,
|
|
764
|
+
headers: localVarHeaderParams,
|
|
765
|
+
uri: localVarPath,
|
|
766
|
+
useQuerystring: this._useQuerystring,
|
|
767
|
+
json: true,
|
|
768
|
+
};
|
|
769
|
+
|
|
770
|
+
let authenticationPromise = Promise.resolve();
|
|
771
|
+
if (this.authentications.token.accessToken) {
|
|
772
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
773
|
+
this.authentications.token.applyToRequest(
|
|
774
|
+
localVarRequestOptions
|
|
775
|
+
)
|
|
776
|
+
);
|
|
777
|
+
}
|
|
778
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
779
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
780
|
+
);
|
|
781
|
+
|
|
782
|
+
let interceptorPromise = authenticationPromise;
|
|
783
|
+
for (const interceptor of this.interceptors) {
|
|
784
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
785
|
+
interceptor(localVarRequestOptions)
|
|
786
|
+
);
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
return interceptorPromise.then(() => {
|
|
790
|
+
if (Object.keys(localVarFormParams).length) {
|
|
791
|
+
if (localVarUseFormData) {
|
|
792
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
793
|
+
} else {
|
|
794
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
return new Promise<{
|
|
798
|
+
response: http.IncomingMessage;
|
|
799
|
+
body: DeleteLabel200Response1;
|
|
800
|
+
}>((resolve, reject) => {
|
|
801
|
+
localVarRequest(
|
|
802
|
+
localVarRequestOptions,
|
|
803
|
+
(error, response, body) => {
|
|
804
|
+
if (error) {
|
|
805
|
+
reject(error);
|
|
806
|
+
} else {
|
|
807
|
+
if (
|
|
808
|
+
response.statusCode &&
|
|
809
|
+
response.statusCode >= 200 &&
|
|
810
|
+
response.statusCode <= 299
|
|
811
|
+
) {
|
|
812
|
+
body = ObjectSerializer.deserialize(
|
|
813
|
+
body,
|
|
814
|
+
'DeleteLabel200Response1'
|
|
815
|
+
);
|
|
816
|
+
resolve({ response: response, body: body });
|
|
817
|
+
} else {
|
|
818
|
+
reject(
|
|
819
|
+
new HttpError(
|
|
820
|
+
response,
|
|
821
|
+
body,
|
|
822
|
+
response.statusCode
|
|
823
|
+
)
|
|
824
|
+
);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
);
|
|
829
|
+
});
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Deletes a label. When called, this endpoint may generate the `Label Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
|
|
834
|
+
* @summary Delete Label
|
|
835
|
+
* @param key
|
|
836
|
+
* @param value
|
|
837
|
+
*/
|
|
838
|
+
public async deleteLabelCurrent(
|
|
839
|
+
key: string,
|
|
840
|
+
value: string,
|
|
841
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
842
|
+
): Promise<{
|
|
843
|
+
response: http.IncomingMessage;
|
|
844
|
+
body: DeleteLabel200Response1;
|
|
845
|
+
}> {
|
|
846
|
+
const localVarPath =
|
|
847
|
+
this.basePath +
|
|
848
|
+
'/labels/{key}/{value}'
|
|
849
|
+
.replace('{' + 'key' + '}', encodeURIComponent(String(key)))
|
|
850
|
+
.replace(
|
|
851
|
+
'{' + 'value' + '}',
|
|
852
|
+
encodeURIComponent(String(value))
|
|
853
|
+
);
|
|
854
|
+
let localVarQueryParameters: any = {};
|
|
855
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
856
|
+
{},
|
|
857
|
+
this._defaultHeaders
|
|
858
|
+
);
|
|
859
|
+
const produces = ['application/json'];
|
|
860
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
861
|
+
localVarHeaderParams.Accept = produces[0];
|
|
862
|
+
} else {
|
|
863
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
864
|
+
}
|
|
865
|
+
let localVarFormParams: any = {};
|
|
866
|
+
|
|
867
|
+
// verify required parameter 'key' is not null or undefined
|
|
868
|
+
if (key === null || key === undefined) {
|
|
869
|
+
throw new Error(
|
|
870
|
+
'Required parameter key was null or undefined when calling deleteLabelCurrent.'
|
|
871
|
+
);
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
// verify required parameter 'value' is not null or undefined
|
|
875
|
+
if (value === null || value === undefined) {
|
|
876
|
+
throw new Error(
|
|
877
|
+
'Required parameter value was null or undefined when calling deleteLabelCurrent.'
|
|
878
|
+
);
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
882
|
+
|
|
883
|
+
let localVarUseFormData = false;
|
|
884
|
+
|
|
885
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
886
|
+
method: 'DELETE',
|
|
887
|
+
qs: localVarQueryParameters,
|
|
888
|
+
headers: localVarHeaderParams,
|
|
889
|
+
uri: localVarPath,
|
|
890
|
+
useQuerystring: this._useQuerystring,
|
|
891
|
+
json: true,
|
|
892
|
+
};
|
|
893
|
+
|
|
894
|
+
let authenticationPromise = Promise.resolve();
|
|
895
|
+
if (this.authentications.token.accessToken) {
|
|
896
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
897
|
+
this.authentications.token.applyToRequest(
|
|
898
|
+
localVarRequestOptions
|
|
899
|
+
)
|
|
900
|
+
);
|
|
901
|
+
}
|
|
902
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
903
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
904
|
+
);
|
|
905
|
+
|
|
906
|
+
let interceptorPromise = authenticationPromise;
|
|
907
|
+
for (const interceptor of this.interceptors) {
|
|
908
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
909
|
+
interceptor(localVarRequestOptions)
|
|
910
|
+
);
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
return interceptorPromise.then(() => {
|
|
914
|
+
if (Object.keys(localVarFormParams).length) {
|
|
915
|
+
if (localVarUseFormData) {
|
|
916
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
917
|
+
} else {
|
|
918
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
919
|
+
}
|
|
920
|
+
}
|
|
921
|
+
return new Promise<{
|
|
922
|
+
response: http.IncomingMessage;
|
|
923
|
+
body: DeleteLabel200Response1;
|
|
924
|
+
}>((resolve, reject) => {
|
|
925
|
+
localVarRequest(
|
|
926
|
+
localVarRequestOptions,
|
|
927
|
+
(error, response, body) => {
|
|
928
|
+
if (error) {
|
|
929
|
+
reject(error);
|
|
930
|
+
} else {
|
|
931
|
+
if (
|
|
932
|
+
response.statusCode &&
|
|
933
|
+
response.statusCode >= 200 &&
|
|
934
|
+
response.statusCode <= 299
|
|
935
|
+
) {
|
|
936
|
+
body = ObjectSerializer.deserialize(
|
|
937
|
+
body,
|
|
938
|
+
'DeleteLabel200Response1'
|
|
939
|
+
);
|
|
940
|
+
resolve({ response: response, body: body });
|
|
941
|
+
} else {
|
|
942
|
+
reject(
|
|
943
|
+
new HttpError(
|
|
944
|
+
response,
|
|
945
|
+
body,
|
|
946
|
+
response.statusCode
|
|
947
|
+
)
|
|
948
|
+
);
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
);
|
|
953
|
+
});
|
|
954
|
+
});
|
|
955
|
+
}
|
|
956
|
+
/**
|
|
957
|
+
* Deletes a label. When called, this endpoint may generate the `Label Deleted` [Audit Trail](/tag/Audit-Trail) event. The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information.
|
|
958
|
+
* @summary Delete Label
|
|
959
|
+
* @param key
|
|
960
|
+
* @param value
|
|
961
|
+
*/
|
|
962
|
+
public async deleteLabelV1(
|
|
963
|
+
key: string,
|
|
964
|
+
value: string,
|
|
965
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
966
|
+
): Promise<{
|
|
967
|
+
response: http.IncomingMessage;
|
|
968
|
+
body: DeleteLabel200Response1;
|
|
969
|
+
}> {
|
|
970
|
+
const localVarPath =
|
|
971
|
+
this.basePath +
|
|
972
|
+
'/labels/{key}/{value}'
|
|
973
|
+
.replace('{' + 'key' + '}', encodeURIComponent(String(key)))
|
|
974
|
+
.replace(
|
|
975
|
+
'{' + 'value' + '}',
|
|
976
|
+
encodeURIComponent(String(value))
|
|
977
|
+
);
|
|
978
|
+
let localVarQueryParameters: any = {};
|
|
979
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
980
|
+
{},
|
|
981
|
+
this._defaultHeaders
|
|
982
|
+
);
|
|
983
|
+
const produces = [
|
|
984
|
+
'application/vnd.segment.v1+json',
|
|
985
|
+
'application/json',
|
|
986
|
+
];
|
|
987
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
988
|
+
localVarHeaderParams.Accept = produces[0];
|
|
989
|
+
} else {
|
|
990
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
991
|
+
}
|
|
992
|
+
let localVarFormParams: any = {};
|
|
993
|
+
|
|
994
|
+
// verify required parameter 'key' is not null or undefined
|
|
995
|
+
if (key === null || key === undefined) {
|
|
996
|
+
throw new Error(
|
|
997
|
+
'Required parameter key was null or undefined when calling deleteLabelV1.'
|
|
998
|
+
);
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
// verify required parameter 'value' is not null or undefined
|
|
1002
|
+
if (value === null || value === undefined) {
|
|
1003
|
+
throw new Error(
|
|
1004
|
+
'Required parameter value was null or undefined when calling deleteLabelV1.'
|
|
1005
|
+
);
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1009
|
+
|
|
1010
|
+
let localVarUseFormData = false;
|
|
1011
|
+
|
|
1012
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1013
|
+
method: 'DELETE',
|
|
1014
|
+
qs: localVarQueryParameters,
|
|
1015
|
+
headers: localVarHeaderParams,
|
|
1016
|
+
uri: localVarPath,
|
|
1017
|
+
useQuerystring: this._useQuerystring,
|
|
1018
|
+
json: true,
|
|
1019
|
+
};
|
|
1020
|
+
|
|
1021
|
+
let authenticationPromise = Promise.resolve();
|
|
1022
|
+
if (this.authentications.token.accessToken) {
|
|
1023
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1024
|
+
this.authentications.token.applyToRequest(
|
|
1025
|
+
localVarRequestOptions
|
|
1026
|
+
)
|
|
1027
|
+
);
|
|
1028
|
+
}
|
|
1029
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1030
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1031
|
+
);
|
|
1032
|
+
|
|
1033
|
+
let interceptorPromise = authenticationPromise;
|
|
1034
|
+
for (const interceptor of this.interceptors) {
|
|
1035
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1036
|
+
interceptor(localVarRequestOptions)
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
return interceptorPromise.then(() => {
|
|
1041
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1042
|
+
if (localVarUseFormData) {
|
|
1043
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1044
|
+
} else {
|
|
1045
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
return new Promise<{
|
|
1049
|
+
response: http.IncomingMessage;
|
|
1050
|
+
body: DeleteLabel200Response1;
|
|
1051
|
+
}>((resolve, reject) => {
|
|
1052
|
+
localVarRequest(
|
|
1053
|
+
localVarRequestOptions,
|
|
1054
|
+
(error, response, body) => {
|
|
1055
|
+
if (error) {
|
|
1056
|
+
reject(error);
|
|
1057
|
+
} else {
|
|
1058
|
+
if (
|
|
1059
|
+
response.statusCode &&
|
|
1060
|
+
response.statusCode >= 200 &&
|
|
1061
|
+
response.statusCode <= 299
|
|
1062
|
+
) {
|
|
1063
|
+
body = ObjectSerializer.deserialize(
|
|
1064
|
+
body,
|
|
1065
|
+
'DeleteLabel200Response1'
|
|
1066
|
+
);
|
|
1067
|
+
resolve({ response: response, body: body });
|
|
1068
|
+
} else {
|
|
1069
|
+
reject(
|
|
1070
|
+
new HttpError(
|
|
1071
|
+
response,
|
|
1072
|
+
body,
|
|
1073
|
+
response.statusCode
|
|
1074
|
+
)
|
|
1075
|
+
);
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
);
|
|
1080
|
+
});
|
|
1081
|
+
});
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* Returns a list of all available labels.
|
|
1085
|
+
* @summary List Labels
|
|
1086
|
+
*/
|
|
1087
|
+
public async listLabelsAlpha(
|
|
1088
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1089
|
+
): Promise<{
|
|
1090
|
+
response: http.IncomingMessage;
|
|
1091
|
+
body: ListLabels200Response;
|
|
1092
|
+
}> {
|
|
1093
|
+
const localVarPath = this.basePath + '/labels';
|
|
1094
|
+
let localVarQueryParameters: any = {};
|
|
1095
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1096
|
+
{},
|
|
1097
|
+
this._defaultHeaders
|
|
1098
|
+
);
|
|
1099
|
+
const produces = [
|
|
1100
|
+
'application/vnd.segment.v1alpha+json',
|
|
1101
|
+
'application/json',
|
|
1102
|
+
];
|
|
1103
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1104
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1105
|
+
} else {
|
|
1106
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1107
|
+
}
|
|
1108
|
+
let localVarFormParams: any = {};
|
|
1109
|
+
|
|
1110
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1111
|
+
|
|
1112
|
+
let localVarUseFormData = false;
|
|
1113
|
+
|
|
1114
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1115
|
+
method: 'GET',
|
|
1116
|
+
qs: localVarQueryParameters,
|
|
1117
|
+
headers: localVarHeaderParams,
|
|
1118
|
+
uri: localVarPath,
|
|
1119
|
+
useQuerystring: this._useQuerystring,
|
|
1120
|
+
json: true,
|
|
1121
|
+
};
|
|
1122
|
+
|
|
1123
|
+
let authenticationPromise = Promise.resolve();
|
|
1124
|
+
if (this.authentications.token.accessToken) {
|
|
1125
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1126
|
+
this.authentications.token.applyToRequest(
|
|
1127
|
+
localVarRequestOptions
|
|
1128
|
+
)
|
|
1129
|
+
);
|
|
1130
|
+
}
|
|
1131
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1132
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1133
|
+
);
|
|
1134
|
+
|
|
1135
|
+
let interceptorPromise = authenticationPromise;
|
|
1136
|
+
for (const interceptor of this.interceptors) {
|
|
1137
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1138
|
+
interceptor(localVarRequestOptions)
|
|
1139
|
+
);
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
return interceptorPromise.then(() => {
|
|
1143
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1144
|
+
if (localVarUseFormData) {
|
|
1145
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1146
|
+
} else {
|
|
1147
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
return new Promise<{
|
|
1151
|
+
response: http.IncomingMessage;
|
|
1152
|
+
body: ListLabels200Response;
|
|
1153
|
+
}>((resolve, reject) => {
|
|
1154
|
+
localVarRequest(
|
|
1155
|
+
localVarRequestOptions,
|
|
1156
|
+
(error, response, body) => {
|
|
1157
|
+
if (error) {
|
|
1158
|
+
reject(error);
|
|
1159
|
+
} else {
|
|
1160
|
+
if (
|
|
1161
|
+
response.statusCode &&
|
|
1162
|
+
response.statusCode >= 200 &&
|
|
1163
|
+
response.statusCode <= 299
|
|
1164
|
+
) {
|
|
1165
|
+
body = ObjectSerializer.deserialize(
|
|
1166
|
+
body,
|
|
1167
|
+
'ListLabels200Response'
|
|
1168
|
+
);
|
|
1169
|
+
resolve({ response: response, body: body });
|
|
1170
|
+
} else {
|
|
1171
|
+
reject(
|
|
1172
|
+
new HttpError(
|
|
1173
|
+
response,
|
|
1174
|
+
body,
|
|
1175
|
+
response.statusCode
|
|
1176
|
+
)
|
|
1177
|
+
);
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
}
|
|
1181
|
+
);
|
|
1182
|
+
});
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
/**
|
|
1186
|
+
* Returns a list of all available labels.
|
|
1187
|
+
* @summary List Labels
|
|
1188
|
+
*/
|
|
1189
|
+
public async listLabelsBeta(
|
|
1190
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1191
|
+
): Promise<{
|
|
1192
|
+
response: http.IncomingMessage;
|
|
1193
|
+
body: ListLabels200Response1;
|
|
1194
|
+
}> {
|
|
1195
|
+
const localVarPath = this.basePath + '/labels';
|
|
1196
|
+
let localVarQueryParameters: any = {};
|
|
1197
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1198
|
+
{},
|
|
1199
|
+
this._defaultHeaders
|
|
1200
|
+
);
|
|
1201
|
+
const produces = [
|
|
1202
|
+
'application/vnd.segment.v1beta+json',
|
|
1203
|
+
'application/json',
|
|
1204
|
+
];
|
|
1205
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1206
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1207
|
+
} else {
|
|
1208
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1209
|
+
}
|
|
1210
|
+
let localVarFormParams: any = {};
|
|
1211
|
+
|
|
1212
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1213
|
+
|
|
1214
|
+
let localVarUseFormData = false;
|
|
1215
|
+
|
|
1216
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1217
|
+
method: 'GET',
|
|
1218
|
+
qs: localVarQueryParameters,
|
|
1219
|
+
headers: localVarHeaderParams,
|
|
1220
|
+
uri: localVarPath,
|
|
1221
|
+
useQuerystring: this._useQuerystring,
|
|
1222
|
+
json: true,
|
|
1223
|
+
};
|
|
1224
|
+
|
|
1225
|
+
let authenticationPromise = Promise.resolve();
|
|
1226
|
+
if (this.authentications.token.accessToken) {
|
|
1227
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1228
|
+
this.authentications.token.applyToRequest(
|
|
1229
|
+
localVarRequestOptions
|
|
1230
|
+
)
|
|
1231
|
+
);
|
|
1232
|
+
}
|
|
1233
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1234
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1235
|
+
);
|
|
1236
|
+
|
|
1237
|
+
let interceptorPromise = authenticationPromise;
|
|
1238
|
+
for (const interceptor of this.interceptors) {
|
|
1239
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1240
|
+
interceptor(localVarRequestOptions)
|
|
1241
|
+
);
|
|
1242
|
+
}
|
|
1243
|
+
|
|
1244
|
+
return interceptorPromise.then(() => {
|
|
1245
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1246
|
+
if (localVarUseFormData) {
|
|
1247
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1248
|
+
} else {
|
|
1249
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
return new Promise<{
|
|
1253
|
+
response: http.IncomingMessage;
|
|
1254
|
+
body: ListLabels200Response1;
|
|
1255
|
+
}>((resolve, reject) => {
|
|
1256
|
+
localVarRequest(
|
|
1257
|
+
localVarRequestOptions,
|
|
1258
|
+
(error, response, body) => {
|
|
1259
|
+
if (error) {
|
|
1260
|
+
reject(error);
|
|
1261
|
+
} else {
|
|
1262
|
+
if (
|
|
1263
|
+
response.statusCode &&
|
|
1264
|
+
response.statusCode >= 200 &&
|
|
1265
|
+
response.statusCode <= 299
|
|
1266
|
+
) {
|
|
1267
|
+
body = ObjectSerializer.deserialize(
|
|
1268
|
+
body,
|
|
1269
|
+
'ListLabels200Response1'
|
|
1270
|
+
);
|
|
1271
|
+
resolve({ response: response, body: body });
|
|
1272
|
+
} else {
|
|
1273
|
+
reject(
|
|
1274
|
+
new HttpError(
|
|
1275
|
+
response,
|
|
1276
|
+
body,
|
|
1277
|
+
response.statusCode
|
|
1278
|
+
)
|
|
1279
|
+
);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
);
|
|
1284
|
+
});
|
|
1285
|
+
});
|
|
1286
|
+
}
|
|
1287
|
+
/**
|
|
1288
|
+
* Returns a list of all available labels.
|
|
1289
|
+
* @summary List Labels
|
|
1290
|
+
*/
|
|
1291
|
+
public async listLabelsCurrent(
|
|
1292
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1293
|
+
): Promise<{
|
|
1294
|
+
response: http.IncomingMessage;
|
|
1295
|
+
body: ListLabels200Response1;
|
|
1296
|
+
}> {
|
|
1297
|
+
const localVarPath = this.basePath + '/labels';
|
|
1298
|
+
let localVarQueryParameters: any = {};
|
|
1299
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1300
|
+
{},
|
|
1301
|
+
this._defaultHeaders
|
|
1302
|
+
);
|
|
1303
|
+
const produces = ['application/json'];
|
|
1304
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1305
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1306
|
+
} else {
|
|
1307
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1308
|
+
}
|
|
1309
|
+
let localVarFormParams: any = {};
|
|
1310
|
+
|
|
1311
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1312
|
+
|
|
1313
|
+
let localVarUseFormData = false;
|
|
1314
|
+
|
|
1315
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1316
|
+
method: 'GET',
|
|
1317
|
+
qs: localVarQueryParameters,
|
|
1318
|
+
headers: localVarHeaderParams,
|
|
1319
|
+
uri: localVarPath,
|
|
1320
|
+
useQuerystring: this._useQuerystring,
|
|
1321
|
+
json: true,
|
|
1322
|
+
};
|
|
1323
|
+
|
|
1324
|
+
let authenticationPromise = Promise.resolve();
|
|
1325
|
+
if (this.authentications.token.accessToken) {
|
|
1326
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1327
|
+
this.authentications.token.applyToRequest(
|
|
1328
|
+
localVarRequestOptions
|
|
1329
|
+
)
|
|
1330
|
+
);
|
|
1331
|
+
}
|
|
1332
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1333
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1334
|
+
);
|
|
1335
|
+
|
|
1336
|
+
let interceptorPromise = authenticationPromise;
|
|
1337
|
+
for (const interceptor of this.interceptors) {
|
|
1338
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1339
|
+
interceptor(localVarRequestOptions)
|
|
1340
|
+
);
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
return interceptorPromise.then(() => {
|
|
1344
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1345
|
+
if (localVarUseFormData) {
|
|
1346
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1347
|
+
} else {
|
|
1348
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1349
|
+
}
|
|
1350
|
+
}
|
|
1351
|
+
return new Promise<{
|
|
1352
|
+
response: http.IncomingMessage;
|
|
1353
|
+
body: ListLabels200Response1;
|
|
1354
|
+
}>((resolve, reject) => {
|
|
1355
|
+
localVarRequest(
|
|
1356
|
+
localVarRequestOptions,
|
|
1357
|
+
(error, response, body) => {
|
|
1358
|
+
if (error) {
|
|
1359
|
+
reject(error);
|
|
1360
|
+
} else {
|
|
1361
|
+
if (
|
|
1362
|
+
response.statusCode &&
|
|
1363
|
+
response.statusCode >= 200 &&
|
|
1364
|
+
response.statusCode <= 299
|
|
1365
|
+
) {
|
|
1366
|
+
body = ObjectSerializer.deserialize(
|
|
1367
|
+
body,
|
|
1368
|
+
'ListLabels200Response1'
|
|
1369
|
+
);
|
|
1370
|
+
resolve({ response: response, body: body });
|
|
1371
|
+
} else {
|
|
1372
|
+
reject(
|
|
1373
|
+
new HttpError(
|
|
1374
|
+
response,
|
|
1375
|
+
body,
|
|
1376
|
+
response.statusCode
|
|
1377
|
+
)
|
|
1378
|
+
);
|
|
1379
|
+
}
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
);
|
|
1383
|
+
});
|
|
1384
|
+
});
|
|
1385
|
+
}
|
|
1386
|
+
/**
|
|
1387
|
+
* Returns a list of all available labels.
|
|
1388
|
+
* @summary List Labels
|
|
1389
|
+
*/
|
|
1390
|
+
public async listLabelsV1(
|
|
1391
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1392
|
+
): Promise<{
|
|
1393
|
+
response: http.IncomingMessage;
|
|
1394
|
+
body: ListLabels200Response1;
|
|
1395
|
+
}> {
|
|
1396
|
+
const localVarPath = this.basePath + '/labels';
|
|
1397
|
+
let localVarQueryParameters: any = {};
|
|
1398
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1399
|
+
{},
|
|
1400
|
+
this._defaultHeaders
|
|
1401
|
+
);
|
|
1402
|
+
const produces = [
|
|
1403
|
+
'application/vnd.segment.v1+json',
|
|
1404
|
+
'application/json',
|
|
1405
|
+
];
|
|
1406
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1407
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1408
|
+
} else {
|
|
1409
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1410
|
+
}
|
|
1411
|
+
let localVarFormParams: any = {};
|
|
1412
|
+
|
|
1413
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1414
|
+
|
|
1415
|
+
let localVarUseFormData = false;
|
|
1416
|
+
|
|
1417
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1418
|
+
method: 'GET',
|
|
1419
|
+
qs: localVarQueryParameters,
|
|
1420
|
+
headers: localVarHeaderParams,
|
|
1421
|
+
uri: localVarPath,
|
|
1422
|
+
useQuerystring: this._useQuerystring,
|
|
1423
|
+
json: true,
|
|
1424
|
+
};
|
|
1425
|
+
|
|
1426
|
+
let authenticationPromise = Promise.resolve();
|
|
1427
|
+
if (this.authentications.token.accessToken) {
|
|
1428
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1429
|
+
this.authentications.token.applyToRequest(
|
|
1430
|
+
localVarRequestOptions
|
|
1431
|
+
)
|
|
1432
|
+
);
|
|
1433
|
+
}
|
|
1434
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1435
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1436
|
+
);
|
|
1437
|
+
|
|
1438
|
+
let interceptorPromise = authenticationPromise;
|
|
1439
|
+
for (const interceptor of this.interceptors) {
|
|
1440
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1441
|
+
interceptor(localVarRequestOptions)
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
return interceptorPromise.then(() => {
|
|
1446
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1447
|
+
if (localVarUseFormData) {
|
|
1448
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1449
|
+
} else {
|
|
1450
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1451
|
+
}
|
|
1452
|
+
}
|
|
1453
|
+
return new Promise<{
|
|
1454
|
+
response: http.IncomingMessage;
|
|
1455
|
+
body: ListLabels200Response1;
|
|
1456
|
+
}>((resolve, reject) => {
|
|
1457
|
+
localVarRequest(
|
|
1458
|
+
localVarRequestOptions,
|
|
1459
|
+
(error, response, body) => {
|
|
1460
|
+
if (error) {
|
|
1461
|
+
reject(error);
|
|
1462
|
+
} else {
|
|
1463
|
+
if (
|
|
1464
|
+
response.statusCode &&
|
|
1465
|
+
response.statusCode >= 200 &&
|
|
1466
|
+
response.statusCode <= 299
|
|
1467
|
+
) {
|
|
1468
|
+
body = ObjectSerializer.deserialize(
|
|
1469
|
+
body,
|
|
1470
|
+
'ListLabels200Response1'
|
|
1471
|
+
);
|
|
1472
|
+
resolve({ response: response, body: body });
|
|
1473
|
+
} else {
|
|
1474
|
+
reject(
|
|
1475
|
+
new HttpError(
|
|
1476
|
+
response,
|
|
1477
|
+
body,
|
|
1478
|
+
response.statusCode
|
|
1479
|
+
)
|
|
1480
|
+
);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
);
|
|
1485
|
+
});
|
|
1486
|
+
});
|
|
1487
|
+
}
|
|
1488
|
+
}
|