@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
|
@@ -0,0 +1,4298 @@
|
|
|
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 { CreateCloudSourceRegulation200Response } from '../model/createCloudSourceRegulation200Response';
|
|
18
|
+
import { CreateCloudSourceRegulationV1Input } from '../model/createCloudSourceRegulationV1Input';
|
|
19
|
+
import { CreateSourceRegulation200Response } from '../model/createSourceRegulation200Response';
|
|
20
|
+
import { CreateSourceRegulationV1Input } from '../model/createSourceRegulationV1Input';
|
|
21
|
+
import { CreateWorkspaceRegulation200Response } from '../model/createWorkspaceRegulation200Response';
|
|
22
|
+
import { CreateWorkspaceRegulationV1Input } from '../model/createWorkspaceRegulationV1Input';
|
|
23
|
+
import { DeleteRegulation200Response } from '../model/deleteRegulation200Response';
|
|
24
|
+
import { GetRegulation200Response } from '../model/getRegulation200Response';
|
|
25
|
+
import { ListRegulationsFromSource200Response } from '../model/listRegulationsFromSource200Response';
|
|
26
|
+
import { ListSuppressions200Response } from '../model/listSuppressions200Response';
|
|
27
|
+
import { ListWorkspaceRegulations200Response } from '../model/listWorkspaceRegulations200Response';
|
|
28
|
+
import { PaginationInput } from '../model/paginationInput';
|
|
29
|
+
import { RequestErrorEnvelope } from '../model/requestErrorEnvelope';
|
|
30
|
+
|
|
31
|
+
import {
|
|
32
|
+
ObjectSerializer,
|
|
33
|
+
Authentication,
|
|
34
|
+
VoidAuth,
|
|
35
|
+
Interceptor,
|
|
36
|
+
} from '../model/models';
|
|
37
|
+
import {
|
|
38
|
+
HttpBasicAuth,
|
|
39
|
+
HttpBearerAuth,
|
|
40
|
+
ApiKeyAuth,
|
|
41
|
+
OAuth,
|
|
42
|
+
} from '../model/models';
|
|
43
|
+
|
|
44
|
+
import { HttpError, RequestFile } from './apis';
|
|
45
|
+
|
|
46
|
+
let defaultBasePath = 'https://api.segmentapis.com';
|
|
47
|
+
|
|
48
|
+
// ===============================================
|
|
49
|
+
// This file is autogenerated - Please do not edit
|
|
50
|
+
// ===============================================
|
|
51
|
+
|
|
52
|
+
export enum DeletionAndSuppressionApiApiKeys {}
|
|
53
|
+
|
|
54
|
+
export class DeletionAndSuppressionApi {
|
|
55
|
+
protected _basePath = defaultBasePath;
|
|
56
|
+
protected _defaultHeaders: any = {};
|
|
57
|
+
protected _useQuerystring: boolean = false;
|
|
58
|
+
|
|
59
|
+
protected authentications = {
|
|
60
|
+
default: <Authentication>new VoidAuth(),
|
|
61
|
+
token: new HttpBearerAuth(),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
protected interceptors: Interceptor[] = [];
|
|
65
|
+
|
|
66
|
+
constructor(basePath?: string);
|
|
67
|
+
constructor(
|
|
68
|
+
basePathOrUsername: string,
|
|
69
|
+
password?: string,
|
|
70
|
+
basePath?: string
|
|
71
|
+
) {
|
|
72
|
+
if (password) {
|
|
73
|
+
if (basePath) {
|
|
74
|
+
this.basePath = basePath;
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
if (basePathOrUsername) {
|
|
78
|
+
this.basePath = basePathOrUsername;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
set useQuerystring(value: boolean) {
|
|
84
|
+
this._useQuerystring = value;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
set basePath(basePath: string) {
|
|
88
|
+
this._basePath = basePath;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
set defaultHeaders(defaultHeaders: any) {
|
|
92
|
+
this._defaultHeaders = defaultHeaders;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
get defaultHeaders() {
|
|
96
|
+
return this._defaultHeaders;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
get basePath() {
|
|
100
|
+
return this._basePath;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public setDefaultAuthentication(auth: Authentication) {
|
|
104
|
+
this.authentications.default = auth;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public setApiKey(key: DeletionAndSuppressionApiApiKeys, value: string) {
|
|
108
|
+
(this.authentications as any)[
|
|
109
|
+
DeletionAndSuppressionApiApiKeys[key]
|
|
110
|
+
].apiKey = value;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
set accessToken(accessToken: string | (() => string)) {
|
|
114
|
+
this.authentications.token.accessToken = accessToken;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public addInterceptor(interceptor: Interceptor) {
|
|
118
|
+
this.interceptors.push(interceptor);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Creates a Source-scoped regulation. Config API omitted fields: - `attributes`, - `userAgent`
|
|
123
|
+
* @summary Create Cloud Source Regulation
|
|
124
|
+
* @param sourceId
|
|
125
|
+
* @param CreateCloudSourceRegulationV1Input
|
|
126
|
+
*/
|
|
127
|
+
public async createCloudSourceRegulationAlpha(
|
|
128
|
+
sourceId: string,
|
|
129
|
+
CreateCloudSourceRegulationV1Input: CreateCloudSourceRegulationV1Input,
|
|
130
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
131
|
+
): Promise<{
|
|
132
|
+
response: http.IncomingMessage;
|
|
133
|
+
body: CreateCloudSourceRegulation200Response;
|
|
134
|
+
}> {
|
|
135
|
+
const localVarPath =
|
|
136
|
+
this.basePath +
|
|
137
|
+
'/regulations/cloudsources/{sourceId}'.replace(
|
|
138
|
+
'{' + 'sourceId' + '}',
|
|
139
|
+
encodeURIComponent(String(sourceId))
|
|
140
|
+
);
|
|
141
|
+
let localVarQueryParameters: any = {};
|
|
142
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
143
|
+
{},
|
|
144
|
+
this._defaultHeaders
|
|
145
|
+
);
|
|
146
|
+
const produces = [
|
|
147
|
+
'application/vnd.segment.v1alpha+json',
|
|
148
|
+
'application/json',
|
|
149
|
+
];
|
|
150
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
151
|
+
localVarHeaderParams.Accept = produces[0];
|
|
152
|
+
} else {
|
|
153
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
154
|
+
}
|
|
155
|
+
let localVarFormParams: any = {};
|
|
156
|
+
|
|
157
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
158
|
+
if (sourceId === null || sourceId === undefined) {
|
|
159
|
+
throw new Error(
|
|
160
|
+
'Required parameter sourceId was null or undefined when calling createCloudSourceRegulationAlpha.'
|
|
161
|
+
);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// verify required parameter 'CreateCloudSourceRegulationV1Input' is not null or undefined
|
|
165
|
+
if (
|
|
166
|
+
CreateCloudSourceRegulationV1Input === null ||
|
|
167
|
+
CreateCloudSourceRegulationV1Input === undefined
|
|
168
|
+
) {
|
|
169
|
+
throw new Error(
|
|
170
|
+
'Required parameter CreateCloudSourceRegulationV1Input was null or undefined when calling createCloudSourceRegulationAlpha.'
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
175
|
+
|
|
176
|
+
let localVarUseFormData = false;
|
|
177
|
+
|
|
178
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
179
|
+
method: 'POST',
|
|
180
|
+
qs: localVarQueryParameters,
|
|
181
|
+
headers: localVarHeaderParams,
|
|
182
|
+
uri: localVarPath,
|
|
183
|
+
useQuerystring: this._useQuerystring,
|
|
184
|
+
json: true,
|
|
185
|
+
body: ObjectSerializer.serialize(
|
|
186
|
+
CreateCloudSourceRegulationV1Input,
|
|
187
|
+
'CreateCloudSourceRegulationV1Input'
|
|
188
|
+
),
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
let authenticationPromise = Promise.resolve();
|
|
192
|
+
if (this.authentications.token.accessToken) {
|
|
193
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
194
|
+
this.authentications.token.applyToRequest(
|
|
195
|
+
localVarRequestOptions
|
|
196
|
+
)
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
200
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
201
|
+
);
|
|
202
|
+
|
|
203
|
+
let interceptorPromise = authenticationPromise;
|
|
204
|
+
for (const interceptor of this.interceptors) {
|
|
205
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
206
|
+
interceptor(localVarRequestOptions)
|
|
207
|
+
);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return interceptorPromise.then(() => {
|
|
211
|
+
if (Object.keys(localVarFormParams).length) {
|
|
212
|
+
if (localVarUseFormData) {
|
|
213
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
214
|
+
} else {
|
|
215
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return new Promise<{
|
|
219
|
+
response: http.IncomingMessage;
|
|
220
|
+
body: CreateCloudSourceRegulation200Response;
|
|
221
|
+
}>((resolve, reject) => {
|
|
222
|
+
localVarRequest(
|
|
223
|
+
localVarRequestOptions,
|
|
224
|
+
(error, response, body) => {
|
|
225
|
+
if (error) {
|
|
226
|
+
reject(error);
|
|
227
|
+
} else {
|
|
228
|
+
if (
|
|
229
|
+
response.statusCode &&
|
|
230
|
+
response.statusCode >= 200 &&
|
|
231
|
+
response.statusCode <= 299
|
|
232
|
+
) {
|
|
233
|
+
body = ObjectSerializer.deserialize(
|
|
234
|
+
body,
|
|
235
|
+
'CreateCloudSourceRegulation200Response'
|
|
236
|
+
);
|
|
237
|
+
resolve({ response: response, body: body });
|
|
238
|
+
} else {
|
|
239
|
+
reject(
|
|
240
|
+
new HttpError(
|
|
241
|
+
response,
|
|
242
|
+
body,
|
|
243
|
+
response.statusCode
|
|
244
|
+
)
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
);
|
|
250
|
+
});
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Creates a Source-scoped regulation. Config API omitted fields: - `attributes`, - `userAgent`
|
|
255
|
+
* @summary Create Cloud Source Regulation
|
|
256
|
+
* @param sourceId
|
|
257
|
+
* @param CreateCloudSourceRegulationV1Input
|
|
258
|
+
*/
|
|
259
|
+
public async createCloudSourceRegulationBeta(
|
|
260
|
+
sourceId: string,
|
|
261
|
+
CreateCloudSourceRegulationV1Input: CreateCloudSourceRegulationV1Input,
|
|
262
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
263
|
+
): Promise<{
|
|
264
|
+
response: http.IncomingMessage;
|
|
265
|
+
body: CreateCloudSourceRegulation200Response;
|
|
266
|
+
}> {
|
|
267
|
+
const localVarPath =
|
|
268
|
+
this.basePath +
|
|
269
|
+
'/regulations/cloudsources/{sourceId}'.replace(
|
|
270
|
+
'{' + 'sourceId' + '}',
|
|
271
|
+
encodeURIComponent(String(sourceId))
|
|
272
|
+
);
|
|
273
|
+
let localVarQueryParameters: any = {};
|
|
274
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
275
|
+
{},
|
|
276
|
+
this._defaultHeaders
|
|
277
|
+
);
|
|
278
|
+
const produces = [
|
|
279
|
+
'application/vnd.segment.v1beta+json',
|
|
280
|
+
'application/json',
|
|
281
|
+
];
|
|
282
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
283
|
+
localVarHeaderParams.Accept = produces[0];
|
|
284
|
+
} else {
|
|
285
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
286
|
+
}
|
|
287
|
+
let localVarFormParams: any = {};
|
|
288
|
+
|
|
289
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
290
|
+
if (sourceId === null || sourceId === undefined) {
|
|
291
|
+
throw new Error(
|
|
292
|
+
'Required parameter sourceId was null or undefined when calling createCloudSourceRegulationBeta.'
|
|
293
|
+
);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
// verify required parameter 'CreateCloudSourceRegulationV1Input' is not null or undefined
|
|
297
|
+
if (
|
|
298
|
+
CreateCloudSourceRegulationV1Input === null ||
|
|
299
|
+
CreateCloudSourceRegulationV1Input === undefined
|
|
300
|
+
) {
|
|
301
|
+
throw new Error(
|
|
302
|
+
'Required parameter CreateCloudSourceRegulationV1Input was null or undefined when calling createCloudSourceRegulationBeta.'
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
307
|
+
|
|
308
|
+
let localVarUseFormData = false;
|
|
309
|
+
|
|
310
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
311
|
+
method: 'POST',
|
|
312
|
+
qs: localVarQueryParameters,
|
|
313
|
+
headers: localVarHeaderParams,
|
|
314
|
+
uri: localVarPath,
|
|
315
|
+
useQuerystring: this._useQuerystring,
|
|
316
|
+
json: true,
|
|
317
|
+
body: ObjectSerializer.serialize(
|
|
318
|
+
CreateCloudSourceRegulationV1Input,
|
|
319
|
+
'CreateCloudSourceRegulationV1Input'
|
|
320
|
+
),
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
let authenticationPromise = Promise.resolve();
|
|
324
|
+
if (this.authentications.token.accessToken) {
|
|
325
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
326
|
+
this.authentications.token.applyToRequest(
|
|
327
|
+
localVarRequestOptions
|
|
328
|
+
)
|
|
329
|
+
);
|
|
330
|
+
}
|
|
331
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
332
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
333
|
+
);
|
|
334
|
+
|
|
335
|
+
let interceptorPromise = authenticationPromise;
|
|
336
|
+
for (const interceptor of this.interceptors) {
|
|
337
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
338
|
+
interceptor(localVarRequestOptions)
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return interceptorPromise.then(() => {
|
|
343
|
+
if (Object.keys(localVarFormParams).length) {
|
|
344
|
+
if (localVarUseFormData) {
|
|
345
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
346
|
+
} else {
|
|
347
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return new Promise<{
|
|
351
|
+
response: http.IncomingMessage;
|
|
352
|
+
body: CreateCloudSourceRegulation200Response;
|
|
353
|
+
}>((resolve, reject) => {
|
|
354
|
+
localVarRequest(
|
|
355
|
+
localVarRequestOptions,
|
|
356
|
+
(error, response, body) => {
|
|
357
|
+
if (error) {
|
|
358
|
+
reject(error);
|
|
359
|
+
} else {
|
|
360
|
+
if (
|
|
361
|
+
response.statusCode &&
|
|
362
|
+
response.statusCode >= 200 &&
|
|
363
|
+
response.statusCode <= 299
|
|
364
|
+
) {
|
|
365
|
+
body = ObjectSerializer.deserialize(
|
|
366
|
+
body,
|
|
367
|
+
'CreateCloudSourceRegulation200Response'
|
|
368
|
+
);
|
|
369
|
+
resolve({ response: response, body: body });
|
|
370
|
+
} else {
|
|
371
|
+
reject(
|
|
372
|
+
new HttpError(
|
|
373
|
+
response,
|
|
374
|
+
body,
|
|
375
|
+
response.statusCode
|
|
376
|
+
)
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
);
|
|
382
|
+
});
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Creates a Source-scoped regulation. Config API omitted fields: - `attributes`, - `userAgent`
|
|
387
|
+
* @summary Create Cloud Source Regulation
|
|
388
|
+
* @param sourceId
|
|
389
|
+
* @param CreateCloudSourceRegulationV1Input
|
|
390
|
+
*/
|
|
391
|
+
public async createCloudSourceRegulationCurrent(
|
|
392
|
+
sourceId: string,
|
|
393
|
+
CreateCloudSourceRegulationV1Input: CreateCloudSourceRegulationV1Input,
|
|
394
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
395
|
+
): Promise<{
|
|
396
|
+
response: http.IncomingMessage;
|
|
397
|
+
body: CreateCloudSourceRegulation200Response;
|
|
398
|
+
}> {
|
|
399
|
+
const localVarPath =
|
|
400
|
+
this.basePath +
|
|
401
|
+
'/regulations/cloudsources/{sourceId}'.replace(
|
|
402
|
+
'{' + 'sourceId' + '}',
|
|
403
|
+
encodeURIComponent(String(sourceId))
|
|
404
|
+
);
|
|
405
|
+
let localVarQueryParameters: any = {};
|
|
406
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
407
|
+
{},
|
|
408
|
+
this._defaultHeaders
|
|
409
|
+
);
|
|
410
|
+
const produces = [
|
|
411
|
+
'application/vnd.segment.v1+json',
|
|
412
|
+
'application/json',
|
|
413
|
+
];
|
|
414
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
415
|
+
localVarHeaderParams.Accept = produces[0];
|
|
416
|
+
} else {
|
|
417
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
418
|
+
}
|
|
419
|
+
let localVarFormParams: any = {};
|
|
420
|
+
|
|
421
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
422
|
+
if (sourceId === null || sourceId === undefined) {
|
|
423
|
+
throw new Error(
|
|
424
|
+
'Required parameter sourceId was null or undefined when calling createCloudSourceRegulationCurrent.'
|
|
425
|
+
);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// verify required parameter 'CreateCloudSourceRegulationV1Input' is not null or undefined
|
|
429
|
+
if (
|
|
430
|
+
CreateCloudSourceRegulationV1Input === null ||
|
|
431
|
+
CreateCloudSourceRegulationV1Input === undefined
|
|
432
|
+
) {
|
|
433
|
+
throw new Error(
|
|
434
|
+
'Required parameter CreateCloudSourceRegulationV1Input was null or undefined when calling createCloudSourceRegulationCurrent.'
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
439
|
+
|
|
440
|
+
let localVarUseFormData = false;
|
|
441
|
+
|
|
442
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
443
|
+
method: 'POST',
|
|
444
|
+
qs: localVarQueryParameters,
|
|
445
|
+
headers: localVarHeaderParams,
|
|
446
|
+
uri: localVarPath,
|
|
447
|
+
useQuerystring: this._useQuerystring,
|
|
448
|
+
json: true,
|
|
449
|
+
body: ObjectSerializer.serialize(
|
|
450
|
+
CreateCloudSourceRegulationV1Input,
|
|
451
|
+
'CreateCloudSourceRegulationV1Input'
|
|
452
|
+
),
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
let authenticationPromise = Promise.resolve();
|
|
456
|
+
if (this.authentications.token.accessToken) {
|
|
457
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
458
|
+
this.authentications.token.applyToRequest(
|
|
459
|
+
localVarRequestOptions
|
|
460
|
+
)
|
|
461
|
+
);
|
|
462
|
+
}
|
|
463
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
464
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
465
|
+
);
|
|
466
|
+
|
|
467
|
+
let interceptorPromise = authenticationPromise;
|
|
468
|
+
for (const interceptor of this.interceptors) {
|
|
469
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
470
|
+
interceptor(localVarRequestOptions)
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
return interceptorPromise.then(() => {
|
|
475
|
+
if (Object.keys(localVarFormParams).length) {
|
|
476
|
+
if (localVarUseFormData) {
|
|
477
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
478
|
+
} else {
|
|
479
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return new Promise<{
|
|
483
|
+
response: http.IncomingMessage;
|
|
484
|
+
body: CreateCloudSourceRegulation200Response;
|
|
485
|
+
}>((resolve, reject) => {
|
|
486
|
+
localVarRequest(
|
|
487
|
+
localVarRequestOptions,
|
|
488
|
+
(error, response, body) => {
|
|
489
|
+
if (error) {
|
|
490
|
+
reject(error);
|
|
491
|
+
} else {
|
|
492
|
+
if (
|
|
493
|
+
response.statusCode &&
|
|
494
|
+
response.statusCode >= 200 &&
|
|
495
|
+
response.statusCode <= 299
|
|
496
|
+
) {
|
|
497
|
+
body = ObjectSerializer.deserialize(
|
|
498
|
+
body,
|
|
499
|
+
'CreateCloudSourceRegulation200Response'
|
|
500
|
+
);
|
|
501
|
+
resolve({ response: response, body: body });
|
|
502
|
+
} else {
|
|
503
|
+
reject(
|
|
504
|
+
new HttpError(
|
|
505
|
+
response,
|
|
506
|
+
body,
|
|
507
|
+
response.statusCode
|
|
508
|
+
)
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
);
|
|
514
|
+
});
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Creates a Source-scoped regulation. Config API omitted fields: - `attributes`, - `userAgent`
|
|
519
|
+
* @summary Create Cloud Source Regulation
|
|
520
|
+
* @param sourceId
|
|
521
|
+
* @param CreateCloudSourceRegulationV1Input
|
|
522
|
+
*/
|
|
523
|
+
public async createCloudSourceRegulationV1(
|
|
524
|
+
sourceId: string,
|
|
525
|
+
CreateCloudSourceRegulationV1Input: CreateCloudSourceRegulationV1Input,
|
|
526
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
527
|
+
): Promise<{
|
|
528
|
+
response: http.IncomingMessage;
|
|
529
|
+
body: CreateCloudSourceRegulation200Response;
|
|
530
|
+
}> {
|
|
531
|
+
const localVarPath =
|
|
532
|
+
this.basePath +
|
|
533
|
+
'/regulations/cloudsources/{sourceId}'.replace(
|
|
534
|
+
'{' + 'sourceId' + '}',
|
|
535
|
+
encodeURIComponent(String(sourceId))
|
|
536
|
+
);
|
|
537
|
+
let localVarQueryParameters: any = {};
|
|
538
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
539
|
+
{},
|
|
540
|
+
this._defaultHeaders
|
|
541
|
+
);
|
|
542
|
+
const produces = [
|
|
543
|
+
'application/vnd.segment.v1+json',
|
|
544
|
+
'application/json',
|
|
545
|
+
];
|
|
546
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
547
|
+
localVarHeaderParams.Accept = produces[0];
|
|
548
|
+
} else {
|
|
549
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
550
|
+
}
|
|
551
|
+
let localVarFormParams: any = {};
|
|
552
|
+
|
|
553
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
554
|
+
if (sourceId === null || sourceId === undefined) {
|
|
555
|
+
throw new Error(
|
|
556
|
+
'Required parameter sourceId was null or undefined when calling createCloudSourceRegulationV1.'
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
// verify required parameter 'CreateCloudSourceRegulationV1Input' is not null or undefined
|
|
561
|
+
if (
|
|
562
|
+
CreateCloudSourceRegulationV1Input === null ||
|
|
563
|
+
CreateCloudSourceRegulationV1Input === undefined
|
|
564
|
+
) {
|
|
565
|
+
throw new Error(
|
|
566
|
+
'Required parameter CreateCloudSourceRegulationV1Input was null or undefined when calling createCloudSourceRegulationV1.'
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
571
|
+
|
|
572
|
+
let localVarUseFormData = false;
|
|
573
|
+
|
|
574
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
575
|
+
method: 'POST',
|
|
576
|
+
qs: localVarQueryParameters,
|
|
577
|
+
headers: localVarHeaderParams,
|
|
578
|
+
uri: localVarPath,
|
|
579
|
+
useQuerystring: this._useQuerystring,
|
|
580
|
+
json: true,
|
|
581
|
+
body: ObjectSerializer.serialize(
|
|
582
|
+
CreateCloudSourceRegulationV1Input,
|
|
583
|
+
'CreateCloudSourceRegulationV1Input'
|
|
584
|
+
),
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
let authenticationPromise = Promise.resolve();
|
|
588
|
+
if (this.authentications.token.accessToken) {
|
|
589
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
590
|
+
this.authentications.token.applyToRequest(
|
|
591
|
+
localVarRequestOptions
|
|
592
|
+
)
|
|
593
|
+
);
|
|
594
|
+
}
|
|
595
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
596
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
597
|
+
);
|
|
598
|
+
|
|
599
|
+
let interceptorPromise = authenticationPromise;
|
|
600
|
+
for (const interceptor of this.interceptors) {
|
|
601
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
602
|
+
interceptor(localVarRequestOptions)
|
|
603
|
+
);
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
return interceptorPromise.then(() => {
|
|
607
|
+
if (Object.keys(localVarFormParams).length) {
|
|
608
|
+
if (localVarUseFormData) {
|
|
609
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
610
|
+
} else {
|
|
611
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
return new Promise<{
|
|
615
|
+
response: http.IncomingMessage;
|
|
616
|
+
body: CreateCloudSourceRegulation200Response;
|
|
617
|
+
}>((resolve, reject) => {
|
|
618
|
+
localVarRequest(
|
|
619
|
+
localVarRequestOptions,
|
|
620
|
+
(error, response, body) => {
|
|
621
|
+
if (error) {
|
|
622
|
+
reject(error);
|
|
623
|
+
} else {
|
|
624
|
+
if (
|
|
625
|
+
response.statusCode &&
|
|
626
|
+
response.statusCode >= 200 &&
|
|
627
|
+
response.statusCode <= 299
|
|
628
|
+
) {
|
|
629
|
+
body = ObjectSerializer.deserialize(
|
|
630
|
+
body,
|
|
631
|
+
'CreateCloudSourceRegulation200Response'
|
|
632
|
+
);
|
|
633
|
+
resolve({ response: response, body: body });
|
|
634
|
+
} else {
|
|
635
|
+
reject(
|
|
636
|
+
new HttpError(
|
|
637
|
+
response,
|
|
638
|
+
body,
|
|
639
|
+
response.statusCode
|
|
640
|
+
)
|
|
641
|
+
);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
);
|
|
646
|
+
});
|
|
647
|
+
});
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Creates a Source-scoped regulation. When called, this endpoint may generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent`
|
|
651
|
+
* @summary Create Source Regulation
|
|
652
|
+
* @param sourceId
|
|
653
|
+
* @param CreateSourceRegulationV1Input
|
|
654
|
+
*/
|
|
655
|
+
public async createSourceRegulationAlpha(
|
|
656
|
+
sourceId: string,
|
|
657
|
+
CreateSourceRegulationV1Input: CreateSourceRegulationV1Input,
|
|
658
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
659
|
+
): Promise<{
|
|
660
|
+
response: http.IncomingMessage;
|
|
661
|
+
body: CreateSourceRegulation200Response;
|
|
662
|
+
}> {
|
|
663
|
+
const localVarPath =
|
|
664
|
+
this.basePath +
|
|
665
|
+
'/regulations/sources/{sourceId}'.replace(
|
|
666
|
+
'{' + 'sourceId' + '}',
|
|
667
|
+
encodeURIComponent(String(sourceId))
|
|
668
|
+
);
|
|
669
|
+
let localVarQueryParameters: any = {};
|
|
670
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
671
|
+
{},
|
|
672
|
+
this._defaultHeaders
|
|
673
|
+
);
|
|
674
|
+
const produces = [
|
|
675
|
+
'application/vnd.segment.v1alpha+json',
|
|
676
|
+
'application/json',
|
|
677
|
+
];
|
|
678
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
679
|
+
localVarHeaderParams.Accept = produces[0];
|
|
680
|
+
} else {
|
|
681
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
682
|
+
}
|
|
683
|
+
let localVarFormParams: any = {};
|
|
684
|
+
|
|
685
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
686
|
+
if (sourceId === null || sourceId === undefined) {
|
|
687
|
+
throw new Error(
|
|
688
|
+
'Required parameter sourceId was null or undefined when calling createSourceRegulationAlpha.'
|
|
689
|
+
);
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// verify required parameter 'CreateSourceRegulationV1Input' is not null or undefined
|
|
693
|
+
if (
|
|
694
|
+
CreateSourceRegulationV1Input === null ||
|
|
695
|
+
CreateSourceRegulationV1Input === undefined
|
|
696
|
+
) {
|
|
697
|
+
throw new Error(
|
|
698
|
+
'Required parameter CreateSourceRegulationV1Input was null or undefined when calling createSourceRegulationAlpha.'
|
|
699
|
+
);
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
703
|
+
|
|
704
|
+
let localVarUseFormData = false;
|
|
705
|
+
|
|
706
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
707
|
+
method: 'POST',
|
|
708
|
+
qs: localVarQueryParameters,
|
|
709
|
+
headers: localVarHeaderParams,
|
|
710
|
+
uri: localVarPath,
|
|
711
|
+
useQuerystring: this._useQuerystring,
|
|
712
|
+
json: true,
|
|
713
|
+
body: ObjectSerializer.serialize(
|
|
714
|
+
CreateSourceRegulationV1Input,
|
|
715
|
+
'CreateSourceRegulationV1Input'
|
|
716
|
+
),
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
let authenticationPromise = Promise.resolve();
|
|
720
|
+
if (this.authentications.token.accessToken) {
|
|
721
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
722
|
+
this.authentications.token.applyToRequest(
|
|
723
|
+
localVarRequestOptions
|
|
724
|
+
)
|
|
725
|
+
);
|
|
726
|
+
}
|
|
727
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
728
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
729
|
+
);
|
|
730
|
+
|
|
731
|
+
let interceptorPromise = authenticationPromise;
|
|
732
|
+
for (const interceptor of this.interceptors) {
|
|
733
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
734
|
+
interceptor(localVarRequestOptions)
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
return interceptorPromise.then(() => {
|
|
739
|
+
if (Object.keys(localVarFormParams).length) {
|
|
740
|
+
if (localVarUseFormData) {
|
|
741
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
742
|
+
} else {
|
|
743
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
return new Promise<{
|
|
747
|
+
response: http.IncomingMessage;
|
|
748
|
+
body: CreateSourceRegulation200Response;
|
|
749
|
+
}>((resolve, reject) => {
|
|
750
|
+
localVarRequest(
|
|
751
|
+
localVarRequestOptions,
|
|
752
|
+
(error, response, body) => {
|
|
753
|
+
if (error) {
|
|
754
|
+
reject(error);
|
|
755
|
+
} else {
|
|
756
|
+
if (
|
|
757
|
+
response.statusCode &&
|
|
758
|
+
response.statusCode >= 200 &&
|
|
759
|
+
response.statusCode <= 299
|
|
760
|
+
) {
|
|
761
|
+
body = ObjectSerializer.deserialize(
|
|
762
|
+
body,
|
|
763
|
+
'CreateSourceRegulation200Response'
|
|
764
|
+
);
|
|
765
|
+
resolve({ response: response, body: body });
|
|
766
|
+
} else {
|
|
767
|
+
reject(
|
|
768
|
+
new HttpError(
|
|
769
|
+
response,
|
|
770
|
+
body,
|
|
771
|
+
response.statusCode
|
|
772
|
+
)
|
|
773
|
+
);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
);
|
|
778
|
+
});
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* Creates a Source-scoped regulation. When called, this endpoint may generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent`
|
|
783
|
+
* @summary Create Source Regulation
|
|
784
|
+
* @param sourceId
|
|
785
|
+
* @param CreateSourceRegulationV1Input
|
|
786
|
+
*/
|
|
787
|
+
public async createSourceRegulationBeta(
|
|
788
|
+
sourceId: string,
|
|
789
|
+
CreateSourceRegulationV1Input: CreateSourceRegulationV1Input,
|
|
790
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
791
|
+
): Promise<{
|
|
792
|
+
response: http.IncomingMessage;
|
|
793
|
+
body: CreateSourceRegulation200Response;
|
|
794
|
+
}> {
|
|
795
|
+
const localVarPath =
|
|
796
|
+
this.basePath +
|
|
797
|
+
'/regulations/sources/{sourceId}'.replace(
|
|
798
|
+
'{' + 'sourceId' + '}',
|
|
799
|
+
encodeURIComponent(String(sourceId))
|
|
800
|
+
);
|
|
801
|
+
let localVarQueryParameters: any = {};
|
|
802
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
803
|
+
{},
|
|
804
|
+
this._defaultHeaders
|
|
805
|
+
);
|
|
806
|
+
const produces = [
|
|
807
|
+
'application/vnd.segment.v1beta+json',
|
|
808
|
+
'application/json',
|
|
809
|
+
];
|
|
810
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
811
|
+
localVarHeaderParams.Accept = produces[0];
|
|
812
|
+
} else {
|
|
813
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
814
|
+
}
|
|
815
|
+
let localVarFormParams: any = {};
|
|
816
|
+
|
|
817
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
818
|
+
if (sourceId === null || sourceId === undefined) {
|
|
819
|
+
throw new Error(
|
|
820
|
+
'Required parameter sourceId was null or undefined when calling createSourceRegulationBeta.'
|
|
821
|
+
);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
// verify required parameter 'CreateSourceRegulationV1Input' is not null or undefined
|
|
825
|
+
if (
|
|
826
|
+
CreateSourceRegulationV1Input === null ||
|
|
827
|
+
CreateSourceRegulationV1Input === undefined
|
|
828
|
+
) {
|
|
829
|
+
throw new Error(
|
|
830
|
+
'Required parameter CreateSourceRegulationV1Input was null or undefined when calling createSourceRegulationBeta.'
|
|
831
|
+
);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
835
|
+
|
|
836
|
+
let localVarUseFormData = false;
|
|
837
|
+
|
|
838
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
839
|
+
method: 'POST',
|
|
840
|
+
qs: localVarQueryParameters,
|
|
841
|
+
headers: localVarHeaderParams,
|
|
842
|
+
uri: localVarPath,
|
|
843
|
+
useQuerystring: this._useQuerystring,
|
|
844
|
+
json: true,
|
|
845
|
+
body: ObjectSerializer.serialize(
|
|
846
|
+
CreateSourceRegulationV1Input,
|
|
847
|
+
'CreateSourceRegulationV1Input'
|
|
848
|
+
),
|
|
849
|
+
};
|
|
850
|
+
|
|
851
|
+
let authenticationPromise = Promise.resolve();
|
|
852
|
+
if (this.authentications.token.accessToken) {
|
|
853
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
854
|
+
this.authentications.token.applyToRequest(
|
|
855
|
+
localVarRequestOptions
|
|
856
|
+
)
|
|
857
|
+
);
|
|
858
|
+
}
|
|
859
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
860
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
861
|
+
);
|
|
862
|
+
|
|
863
|
+
let interceptorPromise = authenticationPromise;
|
|
864
|
+
for (const interceptor of this.interceptors) {
|
|
865
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
866
|
+
interceptor(localVarRequestOptions)
|
|
867
|
+
);
|
|
868
|
+
}
|
|
869
|
+
|
|
870
|
+
return interceptorPromise.then(() => {
|
|
871
|
+
if (Object.keys(localVarFormParams).length) {
|
|
872
|
+
if (localVarUseFormData) {
|
|
873
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
874
|
+
} else {
|
|
875
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
return new Promise<{
|
|
879
|
+
response: http.IncomingMessage;
|
|
880
|
+
body: CreateSourceRegulation200Response;
|
|
881
|
+
}>((resolve, reject) => {
|
|
882
|
+
localVarRequest(
|
|
883
|
+
localVarRequestOptions,
|
|
884
|
+
(error, response, body) => {
|
|
885
|
+
if (error) {
|
|
886
|
+
reject(error);
|
|
887
|
+
} else {
|
|
888
|
+
if (
|
|
889
|
+
response.statusCode &&
|
|
890
|
+
response.statusCode >= 200 &&
|
|
891
|
+
response.statusCode <= 299
|
|
892
|
+
) {
|
|
893
|
+
body = ObjectSerializer.deserialize(
|
|
894
|
+
body,
|
|
895
|
+
'CreateSourceRegulation200Response'
|
|
896
|
+
);
|
|
897
|
+
resolve({ response: response, body: body });
|
|
898
|
+
} else {
|
|
899
|
+
reject(
|
|
900
|
+
new HttpError(
|
|
901
|
+
response,
|
|
902
|
+
body,
|
|
903
|
+
response.statusCode
|
|
904
|
+
)
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
);
|
|
910
|
+
});
|
|
911
|
+
});
|
|
912
|
+
}
|
|
913
|
+
/**
|
|
914
|
+
* Creates a Source-scoped regulation. When called, this endpoint may generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent`
|
|
915
|
+
* @summary Create Source Regulation
|
|
916
|
+
* @param sourceId
|
|
917
|
+
* @param CreateSourceRegulationV1Input
|
|
918
|
+
*/
|
|
919
|
+
public async createSourceRegulationCurrent(
|
|
920
|
+
sourceId: string,
|
|
921
|
+
CreateSourceRegulationV1Input: CreateSourceRegulationV1Input,
|
|
922
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
923
|
+
): Promise<{
|
|
924
|
+
response: http.IncomingMessage;
|
|
925
|
+
body: CreateSourceRegulation200Response;
|
|
926
|
+
}> {
|
|
927
|
+
const localVarPath =
|
|
928
|
+
this.basePath +
|
|
929
|
+
'/regulations/sources/{sourceId}'.replace(
|
|
930
|
+
'{' + 'sourceId' + '}',
|
|
931
|
+
encodeURIComponent(String(sourceId))
|
|
932
|
+
);
|
|
933
|
+
let localVarQueryParameters: any = {};
|
|
934
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
935
|
+
{},
|
|
936
|
+
this._defaultHeaders
|
|
937
|
+
);
|
|
938
|
+
const produces = [
|
|
939
|
+
'application/vnd.segment.v1+json',
|
|
940
|
+
'application/json',
|
|
941
|
+
];
|
|
942
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
943
|
+
localVarHeaderParams.Accept = produces[0];
|
|
944
|
+
} else {
|
|
945
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
946
|
+
}
|
|
947
|
+
let localVarFormParams: any = {};
|
|
948
|
+
|
|
949
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
950
|
+
if (sourceId === null || sourceId === undefined) {
|
|
951
|
+
throw new Error(
|
|
952
|
+
'Required parameter sourceId was null or undefined when calling createSourceRegulationCurrent.'
|
|
953
|
+
);
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
// verify required parameter 'CreateSourceRegulationV1Input' is not null or undefined
|
|
957
|
+
if (
|
|
958
|
+
CreateSourceRegulationV1Input === null ||
|
|
959
|
+
CreateSourceRegulationV1Input === undefined
|
|
960
|
+
) {
|
|
961
|
+
throw new Error(
|
|
962
|
+
'Required parameter CreateSourceRegulationV1Input was null or undefined when calling createSourceRegulationCurrent.'
|
|
963
|
+
);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
967
|
+
|
|
968
|
+
let localVarUseFormData = false;
|
|
969
|
+
|
|
970
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
971
|
+
method: 'POST',
|
|
972
|
+
qs: localVarQueryParameters,
|
|
973
|
+
headers: localVarHeaderParams,
|
|
974
|
+
uri: localVarPath,
|
|
975
|
+
useQuerystring: this._useQuerystring,
|
|
976
|
+
json: true,
|
|
977
|
+
body: ObjectSerializer.serialize(
|
|
978
|
+
CreateSourceRegulationV1Input,
|
|
979
|
+
'CreateSourceRegulationV1Input'
|
|
980
|
+
),
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
let authenticationPromise = Promise.resolve();
|
|
984
|
+
if (this.authentications.token.accessToken) {
|
|
985
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
986
|
+
this.authentications.token.applyToRequest(
|
|
987
|
+
localVarRequestOptions
|
|
988
|
+
)
|
|
989
|
+
);
|
|
990
|
+
}
|
|
991
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
992
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
993
|
+
);
|
|
994
|
+
|
|
995
|
+
let interceptorPromise = authenticationPromise;
|
|
996
|
+
for (const interceptor of this.interceptors) {
|
|
997
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
998
|
+
interceptor(localVarRequestOptions)
|
|
999
|
+
);
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
return interceptorPromise.then(() => {
|
|
1003
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1004
|
+
if (localVarUseFormData) {
|
|
1005
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1006
|
+
} else {
|
|
1007
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
return new Promise<{
|
|
1011
|
+
response: http.IncomingMessage;
|
|
1012
|
+
body: CreateSourceRegulation200Response;
|
|
1013
|
+
}>((resolve, reject) => {
|
|
1014
|
+
localVarRequest(
|
|
1015
|
+
localVarRequestOptions,
|
|
1016
|
+
(error, response, body) => {
|
|
1017
|
+
if (error) {
|
|
1018
|
+
reject(error);
|
|
1019
|
+
} else {
|
|
1020
|
+
if (
|
|
1021
|
+
response.statusCode &&
|
|
1022
|
+
response.statusCode >= 200 &&
|
|
1023
|
+
response.statusCode <= 299
|
|
1024
|
+
) {
|
|
1025
|
+
body = ObjectSerializer.deserialize(
|
|
1026
|
+
body,
|
|
1027
|
+
'CreateSourceRegulation200Response'
|
|
1028
|
+
);
|
|
1029
|
+
resolve({ response: response, body: body });
|
|
1030
|
+
} else {
|
|
1031
|
+
reject(
|
|
1032
|
+
new HttpError(
|
|
1033
|
+
response,
|
|
1034
|
+
body,
|
|
1035
|
+
response.statusCode
|
|
1036
|
+
)
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
);
|
|
1042
|
+
});
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Creates a Source-scoped regulation. When called, this endpoint may generate the `Source Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent`
|
|
1047
|
+
* @summary Create Source Regulation
|
|
1048
|
+
* @param sourceId
|
|
1049
|
+
* @param CreateSourceRegulationV1Input
|
|
1050
|
+
*/
|
|
1051
|
+
public async createSourceRegulationV1(
|
|
1052
|
+
sourceId: string,
|
|
1053
|
+
CreateSourceRegulationV1Input: CreateSourceRegulationV1Input,
|
|
1054
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1055
|
+
): Promise<{
|
|
1056
|
+
response: http.IncomingMessage;
|
|
1057
|
+
body: CreateSourceRegulation200Response;
|
|
1058
|
+
}> {
|
|
1059
|
+
const localVarPath =
|
|
1060
|
+
this.basePath +
|
|
1061
|
+
'/regulations/sources/{sourceId}'.replace(
|
|
1062
|
+
'{' + 'sourceId' + '}',
|
|
1063
|
+
encodeURIComponent(String(sourceId))
|
|
1064
|
+
);
|
|
1065
|
+
let localVarQueryParameters: any = {};
|
|
1066
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1067
|
+
{},
|
|
1068
|
+
this._defaultHeaders
|
|
1069
|
+
);
|
|
1070
|
+
const produces = [
|
|
1071
|
+
'application/vnd.segment.v1+json',
|
|
1072
|
+
'application/json',
|
|
1073
|
+
];
|
|
1074
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1075
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1076
|
+
} else {
|
|
1077
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1078
|
+
}
|
|
1079
|
+
let localVarFormParams: any = {};
|
|
1080
|
+
|
|
1081
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
1082
|
+
if (sourceId === null || sourceId === undefined) {
|
|
1083
|
+
throw new Error(
|
|
1084
|
+
'Required parameter sourceId was null or undefined when calling createSourceRegulationV1.'
|
|
1085
|
+
);
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
// verify required parameter 'CreateSourceRegulationV1Input' is not null or undefined
|
|
1089
|
+
if (
|
|
1090
|
+
CreateSourceRegulationV1Input === null ||
|
|
1091
|
+
CreateSourceRegulationV1Input === undefined
|
|
1092
|
+
) {
|
|
1093
|
+
throw new Error(
|
|
1094
|
+
'Required parameter CreateSourceRegulationV1Input was null or undefined when calling createSourceRegulationV1.'
|
|
1095
|
+
);
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1099
|
+
|
|
1100
|
+
let localVarUseFormData = false;
|
|
1101
|
+
|
|
1102
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1103
|
+
method: 'POST',
|
|
1104
|
+
qs: localVarQueryParameters,
|
|
1105
|
+
headers: localVarHeaderParams,
|
|
1106
|
+
uri: localVarPath,
|
|
1107
|
+
useQuerystring: this._useQuerystring,
|
|
1108
|
+
json: true,
|
|
1109
|
+
body: ObjectSerializer.serialize(
|
|
1110
|
+
CreateSourceRegulationV1Input,
|
|
1111
|
+
'CreateSourceRegulationV1Input'
|
|
1112
|
+
),
|
|
1113
|
+
};
|
|
1114
|
+
|
|
1115
|
+
let authenticationPromise = Promise.resolve();
|
|
1116
|
+
if (this.authentications.token.accessToken) {
|
|
1117
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1118
|
+
this.authentications.token.applyToRequest(
|
|
1119
|
+
localVarRequestOptions
|
|
1120
|
+
)
|
|
1121
|
+
);
|
|
1122
|
+
}
|
|
1123
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1124
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1125
|
+
);
|
|
1126
|
+
|
|
1127
|
+
let interceptorPromise = authenticationPromise;
|
|
1128
|
+
for (const interceptor of this.interceptors) {
|
|
1129
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1130
|
+
interceptor(localVarRequestOptions)
|
|
1131
|
+
);
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
return interceptorPromise.then(() => {
|
|
1135
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1136
|
+
if (localVarUseFormData) {
|
|
1137
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1138
|
+
} else {
|
|
1139
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
return new Promise<{
|
|
1143
|
+
response: http.IncomingMessage;
|
|
1144
|
+
body: CreateSourceRegulation200Response;
|
|
1145
|
+
}>((resolve, reject) => {
|
|
1146
|
+
localVarRequest(
|
|
1147
|
+
localVarRequestOptions,
|
|
1148
|
+
(error, response, body) => {
|
|
1149
|
+
if (error) {
|
|
1150
|
+
reject(error);
|
|
1151
|
+
} else {
|
|
1152
|
+
if (
|
|
1153
|
+
response.statusCode &&
|
|
1154
|
+
response.statusCode >= 200 &&
|
|
1155
|
+
response.statusCode <= 299
|
|
1156
|
+
) {
|
|
1157
|
+
body = ObjectSerializer.deserialize(
|
|
1158
|
+
body,
|
|
1159
|
+
'CreateSourceRegulation200Response'
|
|
1160
|
+
);
|
|
1161
|
+
resolve({ response: response, body: body });
|
|
1162
|
+
} else {
|
|
1163
|
+
reject(
|
|
1164
|
+
new HttpError(
|
|
1165
|
+
response,
|
|
1166
|
+
body,
|
|
1167
|
+
response.statusCode
|
|
1168
|
+
)
|
|
1169
|
+
);
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
);
|
|
1174
|
+
});
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
/**
|
|
1178
|
+
* Creates a Workspace-scoped regulation. When called, this endpoint may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent`
|
|
1179
|
+
* @summary Create Workspace Regulation
|
|
1180
|
+
* @param CreateWorkspaceRegulationV1Input
|
|
1181
|
+
*/
|
|
1182
|
+
public async createWorkspaceRegulationAlpha(
|
|
1183
|
+
CreateWorkspaceRegulationV1Input: CreateWorkspaceRegulationV1Input,
|
|
1184
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1185
|
+
): Promise<{
|
|
1186
|
+
response: http.IncomingMessage;
|
|
1187
|
+
body: CreateWorkspaceRegulation200Response;
|
|
1188
|
+
}> {
|
|
1189
|
+
const localVarPath = this.basePath + '/regulations';
|
|
1190
|
+
let localVarQueryParameters: any = {};
|
|
1191
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1192
|
+
{},
|
|
1193
|
+
this._defaultHeaders
|
|
1194
|
+
);
|
|
1195
|
+
const produces = [
|
|
1196
|
+
'application/vnd.segment.v1alpha+json',
|
|
1197
|
+
'application/json',
|
|
1198
|
+
];
|
|
1199
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1200
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1201
|
+
} else {
|
|
1202
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1203
|
+
}
|
|
1204
|
+
let localVarFormParams: any = {};
|
|
1205
|
+
|
|
1206
|
+
// verify required parameter 'CreateWorkspaceRegulationV1Input' is not null or undefined
|
|
1207
|
+
if (
|
|
1208
|
+
CreateWorkspaceRegulationV1Input === null ||
|
|
1209
|
+
CreateWorkspaceRegulationV1Input === undefined
|
|
1210
|
+
) {
|
|
1211
|
+
throw new Error(
|
|
1212
|
+
'Required parameter CreateWorkspaceRegulationV1Input was null or undefined when calling createWorkspaceRegulationAlpha.'
|
|
1213
|
+
);
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1217
|
+
|
|
1218
|
+
let localVarUseFormData = false;
|
|
1219
|
+
|
|
1220
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1221
|
+
method: 'POST',
|
|
1222
|
+
qs: localVarQueryParameters,
|
|
1223
|
+
headers: localVarHeaderParams,
|
|
1224
|
+
uri: localVarPath,
|
|
1225
|
+
useQuerystring: this._useQuerystring,
|
|
1226
|
+
json: true,
|
|
1227
|
+
body: ObjectSerializer.serialize(
|
|
1228
|
+
CreateWorkspaceRegulationV1Input,
|
|
1229
|
+
'CreateWorkspaceRegulationV1Input'
|
|
1230
|
+
),
|
|
1231
|
+
};
|
|
1232
|
+
|
|
1233
|
+
let authenticationPromise = Promise.resolve();
|
|
1234
|
+
if (this.authentications.token.accessToken) {
|
|
1235
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1236
|
+
this.authentications.token.applyToRequest(
|
|
1237
|
+
localVarRequestOptions
|
|
1238
|
+
)
|
|
1239
|
+
);
|
|
1240
|
+
}
|
|
1241
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1242
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1243
|
+
);
|
|
1244
|
+
|
|
1245
|
+
let interceptorPromise = authenticationPromise;
|
|
1246
|
+
for (const interceptor of this.interceptors) {
|
|
1247
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1248
|
+
interceptor(localVarRequestOptions)
|
|
1249
|
+
);
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
return interceptorPromise.then(() => {
|
|
1253
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1254
|
+
if (localVarUseFormData) {
|
|
1255
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1256
|
+
} else {
|
|
1257
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
return new Promise<{
|
|
1261
|
+
response: http.IncomingMessage;
|
|
1262
|
+
body: CreateWorkspaceRegulation200Response;
|
|
1263
|
+
}>((resolve, reject) => {
|
|
1264
|
+
localVarRequest(
|
|
1265
|
+
localVarRequestOptions,
|
|
1266
|
+
(error, response, body) => {
|
|
1267
|
+
if (error) {
|
|
1268
|
+
reject(error);
|
|
1269
|
+
} else {
|
|
1270
|
+
if (
|
|
1271
|
+
response.statusCode &&
|
|
1272
|
+
response.statusCode >= 200 &&
|
|
1273
|
+
response.statusCode <= 299
|
|
1274
|
+
) {
|
|
1275
|
+
body = ObjectSerializer.deserialize(
|
|
1276
|
+
body,
|
|
1277
|
+
'CreateWorkspaceRegulation200Response'
|
|
1278
|
+
);
|
|
1279
|
+
resolve({ response: response, body: body });
|
|
1280
|
+
} else {
|
|
1281
|
+
reject(
|
|
1282
|
+
new HttpError(
|
|
1283
|
+
response,
|
|
1284
|
+
body,
|
|
1285
|
+
response.statusCode
|
|
1286
|
+
)
|
|
1287
|
+
);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
);
|
|
1292
|
+
});
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* Creates a Workspace-scoped regulation. When called, this endpoint may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent`
|
|
1297
|
+
* @summary Create Workspace Regulation
|
|
1298
|
+
* @param CreateWorkspaceRegulationV1Input
|
|
1299
|
+
*/
|
|
1300
|
+
public async createWorkspaceRegulationBeta(
|
|
1301
|
+
CreateWorkspaceRegulationV1Input: CreateWorkspaceRegulationV1Input,
|
|
1302
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1303
|
+
): Promise<{
|
|
1304
|
+
response: http.IncomingMessage;
|
|
1305
|
+
body: CreateWorkspaceRegulation200Response;
|
|
1306
|
+
}> {
|
|
1307
|
+
const localVarPath = this.basePath + '/regulations';
|
|
1308
|
+
let localVarQueryParameters: any = {};
|
|
1309
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1310
|
+
{},
|
|
1311
|
+
this._defaultHeaders
|
|
1312
|
+
);
|
|
1313
|
+
const produces = [
|
|
1314
|
+
'application/vnd.segment.v1beta+json',
|
|
1315
|
+
'application/json',
|
|
1316
|
+
];
|
|
1317
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1318
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1319
|
+
} else {
|
|
1320
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1321
|
+
}
|
|
1322
|
+
let localVarFormParams: any = {};
|
|
1323
|
+
|
|
1324
|
+
// verify required parameter 'CreateWorkspaceRegulationV1Input' is not null or undefined
|
|
1325
|
+
if (
|
|
1326
|
+
CreateWorkspaceRegulationV1Input === null ||
|
|
1327
|
+
CreateWorkspaceRegulationV1Input === undefined
|
|
1328
|
+
) {
|
|
1329
|
+
throw new Error(
|
|
1330
|
+
'Required parameter CreateWorkspaceRegulationV1Input was null or undefined when calling createWorkspaceRegulationBeta.'
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1335
|
+
|
|
1336
|
+
let localVarUseFormData = false;
|
|
1337
|
+
|
|
1338
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1339
|
+
method: 'POST',
|
|
1340
|
+
qs: localVarQueryParameters,
|
|
1341
|
+
headers: localVarHeaderParams,
|
|
1342
|
+
uri: localVarPath,
|
|
1343
|
+
useQuerystring: this._useQuerystring,
|
|
1344
|
+
json: true,
|
|
1345
|
+
body: ObjectSerializer.serialize(
|
|
1346
|
+
CreateWorkspaceRegulationV1Input,
|
|
1347
|
+
'CreateWorkspaceRegulationV1Input'
|
|
1348
|
+
),
|
|
1349
|
+
};
|
|
1350
|
+
|
|
1351
|
+
let authenticationPromise = Promise.resolve();
|
|
1352
|
+
if (this.authentications.token.accessToken) {
|
|
1353
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1354
|
+
this.authentications.token.applyToRequest(
|
|
1355
|
+
localVarRequestOptions
|
|
1356
|
+
)
|
|
1357
|
+
);
|
|
1358
|
+
}
|
|
1359
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1360
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1361
|
+
);
|
|
1362
|
+
|
|
1363
|
+
let interceptorPromise = authenticationPromise;
|
|
1364
|
+
for (const interceptor of this.interceptors) {
|
|
1365
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1366
|
+
interceptor(localVarRequestOptions)
|
|
1367
|
+
);
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
return interceptorPromise.then(() => {
|
|
1371
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1372
|
+
if (localVarUseFormData) {
|
|
1373
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1374
|
+
} else {
|
|
1375
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
return new Promise<{
|
|
1379
|
+
response: http.IncomingMessage;
|
|
1380
|
+
body: CreateWorkspaceRegulation200Response;
|
|
1381
|
+
}>((resolve, reject) => {
|
|
1382
|
+
localVarRequest(
|
|
1383
|
+
localVarRequestOptions,
|
|
1384
|
+
(error, response, body) => {
|
|
1385
|
+
if (error) {
|
|
1386
|
+
reject(error);
|
|
1387
|
+
} else {
|
|
1388
|
+
if (
|
|
1389
|
+
response.statusCode &&
|
|
1390
|
+
response.statusCode >= 200 &&
|
|
1391
|
+
response.statusCode <= 299
|
|
1392
|
+
) {
|
|
1393
|
+
body = ObjectSerializer.deserialize(
|
|
1394
|
+
body,
|
|
1395
|
+
'CreateWorkspaceRegulation200Response'
|
|
1396
|
+
);
|
|
1397
|
+
resolve({ response: response, body: body });
|
|
1398
|
+
} else {
|
|
1399
|
+
reject(
|
|
1400
|
+
new HttpError(
|
|
1401
|
+
response,
|
|
1402
|
+
body,
|
|
1403
|
+
response.statusCode
|
|
1404
|
+
)
|
|
1405
|
+
);
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
);
|
|
1410
|
+
});
|
|
1411
|
+
});
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Creates a Workspace-scoped regulation. When called, this endpoint may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent`
|
|
1415
|
+
* @summary Create Workspace Regulation
|
|
1416
|
+
* @param CreateWorkspaceRegulationV1Input
|
|
1417
|
+
*/
|
|
1418
|
+
public async createWorkspaceRegulationCurrent(
|
|
1419
|
+
CreateWorkspaceRegulationV1Input: CreateWorkspaceRegulationV1Input,
|
|
1420
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1421
|
+
): Promise<{
|
|
1422
|
+
response: http.IncomingMessage;
|
|
1423
|
+
body: CreateWorkspaceRegulation200Response;
|
|
1424
|
+
}> {
|
|
1425
|
+
const localVarPath = this.basePath + '/regulations';
|
|
1426
|
+
let localVarQueryParameters: any = {};
|
|
1427
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1428
|
+
{},
|
|
1429
|
+
this._defaultHeaders
|
|
1430
|
+
);
|
|
1431
|
+
const produces = [
|
|
1432
|
+
'application/vnd.segment.v1+json',
|
|
1433
|
+
'application/json',
|
|
1434
|
+
];
|
|
1435
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1436
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1437
|
+
} else {
|
|
1438
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1439
|
+
}
|
|
1440
|
+
let localVarFormParams: any = {};
|
|
1441
|
+
|
|
1442
|
+
// verify required parameter 'CreateWorkspaceRegulationV1Input' is not null or undefined
|
|
1443
|
+
if (
|
|
1444
|
+
CreateWorkspaceRegulationV1Input === null ||
|
|
1445
|
+
CreateWorkspaceRegulationV1Input === undefined
|
|
1446
|
+
) {
|
|
1447
|
+
throw new Error(
|
|
1448
|
+
'Required parameter CreateWorkspaceRegulationV1Input was null or undefined when calling createWorkspaceRegulationCurrent.'
|
|
1449
|
+
);
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1453
|
+
|
|
1454
|
+
let localVarUseFormData = false;
|
|
1455
|
+
|
|
1456
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1457
|
+
method: 'POST',
|
|
1458
|
+
qs: localVarQueryParameters,
|
|
1459
|
+
headers: localVarHeaderParams,
|
|
1460
|
+
uri: localVarPath,
|
|
1461
|
+
useQuerystring: this._useQuerystring,
|
|
1462
|
+
json: true,
|
|
1463
|
+
body: ObjectSerializer.serialize(
|
|
1464
|
+
CreateWorkspaceRegulationV1Input,
|
|
1465
|
+
'CreateWorkspaceRegulationV1Input'
|
|
1466
|
+
),
|
|
1467
|
+
};
|
|
1468
|
+
|
|
1469
|
+
let authenticationPromise = Promise.resolve();
|
|
1470
|
+
if (this.authentications.token.accessToken) {
|
|
1471
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1472
|
+
this.authentications.token.applyToRequest(
|
|
1473
|
+
localVarRequestOptions
|
|
1474
|
+
)
|
|
1475
|
+
);
|
|
1476
|
+
}
|
|
1477
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1478
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1479
|
+
);
|
|
1480
|
+
|
|
1481
|
+
let interceptorPromise = authenticationPromise;
|
|
1482
|
+
for (const interceptor of this.interceptors) {
|
|
1483
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1484
|
+
interceptor(localVarRequestOptions)
|
|
1485
|
+
);
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1488
|
+
return interceptorPromise.then(() => {
|
|
1489
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1490
|
+
if (localVarUseFormData) {
|
|
1491
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1492
|
+
} else {
|
|
1493
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1494
|
+
}
|
|
1495
|
+
}
|
|
1496
|
+
return new Promise<{
|
|
1497
|
+
response: http.IncomingMessage;
|
|
1498
|
+
body: CreateWorkspaceRegulation200Response;
|
|
1499
|
+
}>((resolve, reject) => {
|
|
1500
|
+
localVarRequest(
|
|
1501
|
+
localVarRequestOptions,
|
|
1502
|
+
(error, response, body) => {
|
|
1503
|
+
if (error) {
|
|
1504
|
+
reject(error);
|
|
1505
|
+
} else {
|
|
1506
|
+
if (
|
|
1507
|
+
response.statusCode &&
|
|
1508
|
+
response.statusCode >= 200 &&
|
|
1509
|
+
response.statusCode <= 299
|
|
1510
|
+
) {
|
|
1511
|
+
body = ObjectSerializer.deserialize(
|
|
1512
|
+
body,
|
|
1513
|
+
'CreateWorkspaceRegulation200Response'
|
|
1514
|
+
);
|
|
1515
|
+
resolve({ response: response, body: body });
|
|
1516
|
+
} else {
|
|
1517
|
+
reject(
|
|
1518
|
+
new HttpError(
|
|
1519
|
+
response,
|
|
1520
|
+
body,
|
|
1521
|
+
response.statusCode
|
|
1522
|
+
)
|
|
1523
|
+
);
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
);
|
|
1528
|
+
});
|
|
1529
|
+
});
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Creates a Workspace-scoped regulation. When called, this endpoint may generate the `Workspace Regulation Created` [Audit Trail](/tag/Audit-Trail) event. Config API omitted fields: - `attributes`, - `userAgent`
|
|
1533
|
+
* @summary Create Workspace Regulation
|
|
1534
|
+
* @param CreateWorkspaceRegulationV1Input
|
|
1535
|
+
*/
|
|
1536
|
+
public async createWorkspaceRegulationV1(
|
|
1537
|
+
CreateWorkspaceRegulationV1Input: CreateWorkspaceRegulationV1Input,
|
|
1538
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1539
|
+
): Promise<{
|
|
1540
|
+
response: http.IncomingMessage;
|
|
1541
|
+
body: CreateWorkspaceRegulation200Response;
|
|
1542
|
+
}> {
|
|
1543
|
+
const localVarPath = this.basePath + '/regulations';
|
|
1544
|
+
let localVarQueryParameters: any = {};
|
|
1545
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1546
|
+
{},
|
|
1547
|
+
this._defaultHeaders
|
|
1548
|
+
);
|
|
1549
|
+
const produces = [
|
|
1550
|
+
'application/vnd.segment.v1+json',
|
|
1551
|
+
'application/json',
|
|
1552
|
+
];
|
|
1553
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1554
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1555
|
+
} else {
|
|
1556
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1557
|
+
}
|
|
1558
|
+
let localVarFormParams: any = {};
|
|
1559
|
+
|
|
1560
|
+
// verify required parameter 'CreateWorkspaceRegulationV1Input' is not null or undefined
|
|
1561
|
+
if (
|
|
1562
|
+
CreateWorkspaceRegulationV1Input === null ||
|
|
1563
|
+
CreateWorkspaceRegulationV1Input === undefined
|
|
1564
|
+
) {
|
|
1565
|
+
throw new Error(
|
|
1566
|
+
'Required parameter CreateWorkspaceRegulationV1Input was null or undefined when calling createWorkspaceRegulationV1.'
|
|
1567
|
+
);
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1570
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1571
|
+
|
|
1572
|
+
let localVarUseFormData = false;
|
|
1573
|
+
|
|
1574
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1575
|
+
method: 'POST',
|
|
1576
|
+
qs: localVarQueryParameters,
|
|
1577
|
+
headers: localVarHeaderParams,
|
|
1578
|
+
uri: localVarPath,
|
|
1579
|
+
useQuerystring: this._useQuerystring,
|
|
1580
|
+
json: true,
|
|
1581
|
+
body: ObjectSerializer.serialize(
|
|
1582
|
+
CreateWorkspaceRegulationV1Input,
|
|
1583
|
+
'CreateWorkspaceRegulationV1Input'
|
|
1584
|
+
),
|
|
1585
|
+
};
|
|
1586
|
+
|
|
1587
|
+
let authenticationPromise = Promise.resolve();
|
|
1588
|
+
if (this.authentications.token.accessToken) {
|
|
1589
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1590
|
+
this.authentications.token.applyToRequest(
|
|
1591
|
+
localVarRequestOptions
|
|
1592
|
+
)
|
|
1593
|
+
);
|
|
1594
|
+
}
|
|
1595
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1596
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1597
|
+
);
|
|
1598
|
+
|
|
1599
|
+
let interceptorPromise = authenticationPromise;
|
|
1600
|
+
for (const interceptor of this.interceptors) {
|
|
1601
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1602
|
+
interceptor(localVarRequestOptions)
|
|
1603
|
+
);
|
|
1604
|
+
}
|
|
1605
|
+
|
|
1606
|
+
return interceptorPromise.then(() => {
|
|
1607
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1608
|
+
if (localVarUseFormData) {
|
|
1609
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1610
|
+
} else {
|
|
1611
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
return new Promise<{
|
|
1615
|
+
response: http.IncomingMessage;
|
|
1616
|
+
body: CreateWorkspaceRegulation200Response;
|
|
1617
|
+
}>((resolve, reject) => {
|
|
1618
|
+
localVarRequest(
|
|
1619
|
+
localVarRequestOptions,
|
|
1620
|
+
(error, response, body) => {
|
|
1621
|
+
if (error) {
|
|
1622
|
+
reject(error);
|
|
1623
|
+
} else {
|
|
1624
|
+
if (
|
|
1625
|
+
response.statusCode &&
|
|
1626
|
+
response.statusCode >= 200 &&
|
|
1627
|
+
response.statusCode <= 299
|
|
1628
|
+
) {
|
|
1629
|
+
body = ObjectSerializer.deserialize(
|
|
1630
|
+
body,
|
|
1631
|
+
'CreateWorkspaceRegulation200Response'
|
|
1632
|
+
);
|
|
1633
|
+
resolve({ response: response, body: body });
|
|
1634
|
+
} else {
|
|
1635
|
+
reject(
|
|
1636
|
+
new HttpError(
|
|
1637
|
+
response,
|
|
1638
|
+
body,
|
|
1639
|
+
response.statusCode
|
|
1640
|
+
)
|
|
1641
|
+
);
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
);
|
|
1646
|
+
});
|
|
1647
|
+
});
|
|
1648
|
+
}
|
|
1649
|
+
/**
|
|
1650
|
+
* Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. When called, this endpoint may generate the `Regulation Deleted` [Audit Trail](/tag/Audit-Trail) event.
|
|
1651
|
+
* @summary Delete Regulation
|
|
1652
|
+
* @param regulateId
|
|
1653
|
+
*/
|
|
1654
|
+
public async deleteRegulationAlpha(
|
|
1655
|
+
regulateId: string,
|
|
1656
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1657
|
+
): Promise<{
|
|
1658
|
+
response: http.IncomingMessage;
|
|
1659
|
+
body: DeleteRegulation200Response;
|
|
1660
|
+
}> {
|
|
1661
|
+
const localVarPath =
|
|
1662
|
+
this.basePath +
|
|
1663
|
+
'/regulations/{regulateId}'.replace(
|
|
1664
|
+
'{' + 'regulateId' + '}',
|
|
1665
|
+
encodeURIComponent(String(regulateId))
|
|
1666
|
+
);
|
|
1667
|
+
let localVarQueryParameters: any = {};
|
|
1668
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1669
|
+
{},
|
|
1670
|
+
this._defaultHeaders
|
|
1671
|
+
);
|
|
1672
|
+
const produces = [
|
|
1673
|
+
'application/vnd.segment.v1alpha+json',
|
|
1674
|
+
'application/json',
|
|
1675
|
+
];
|
|
1676
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1677
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1678
|
+
} else {
|
|
1679
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1680
|
+
}
|
|
1681
|
+
let localVarFormParams: any = {};
|
|
1682
|
+
|
|
1683
|
+
// verify required parameter 'regulateId' is not null or undefined
|
|
1684
|
+
if (regulateId === null || regulateId === undefined) {
|
|
1685
|
+
throw new Error(
|
|
1686
|
+
'Required parameter regulateId was null or undefined when calling deleteRegulationAlpha.'
|
|
1687
|
+
);
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1691
|
+
|
|
1692
|
+
let localVarUseFormData = false;
|
|
1693
|
+
|
|
1694
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1695
|
+
method: 'DELETE',
|
|
1696
|
+
qs: localVarQueryParameters,
|
|
1697
|
+
headers: localVarHeaderParams,
|
|
1698
|
+
uri: localVarPath,
|
|
1699
|
+
useQuerystring: this._useQuerystring,
|
|
1700
|
+
json: true,
|
|
1701
|
+
};
|
|
1702
|
+
|
|
1703
|
+
let authenticationPromise = Promise.resolve();
|
|
1704
|
+
if (this.authentications.token.accessToken) {
|
|
1705
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1706
|
+
this.authentications.token.applyToRequest(
|
|
1707
|
+
localVarRequestOptions
|
|
1708
|
+
)
|
|
1709
|
+
);
|
|
1710
|
+
}
|
|
1711
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1712
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1713
|
+
);
|
|
1714
|
+
|
|
1715
|
+
let interceptorPromise = authenticationPromise;
|
|
1716
|
+
for (const interceptor of this.interceptors) {
|
|
1717
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1718
|
+
interceptor(localVarRequestOptions)
|
|
1719
|
+
);
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
return interceptorPromise.then(() => {
|
|
1723
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1724
|
+
if (localVarUseFormData) {
|
|
1725
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1726
|
+
} else {
|
|
1727
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1728
|
+
}
|
|
1729
|
+
}
|
|
1730
|
+
return new Promise<{
|
|
1731
|
+
response: http.IncomingMessage;
|
|
1732
|
+
body: DeleteRegulation200Response;
|
|
1733
|
+
}>((resolve, reject) => {
|
|
1734
|
+
localVarRequest(
|
|
1735
|
+
localVarRequestOptions,
|
|
1736
|
+
(error, response, body) => {
|
|
1737
|
+
if (error) {
|
|
1738
|
+
reject(error);
|
|
1739
|
+
} else {
|
|
1740
|
+
if (
|
|
1741
|
+
response.statusCode &&
|
|
1742
|
+
response.statusCode >= 200 &&
|
|
1743
|
+
response.statusCode <= 299
|
|
1744
|
+
) {
|
|
1745
|
+
body = ObjectSerializer.deserialize(
|
|
1746
|
+
body,
|
|
1747
|
+
'DeleteRegulation200Response'
|
|
1748
|
+
);
|
|
1749
|
+
resolve({ response: response, body: body });
|
|
1750
|
+
} else {
|
|
1751
|
+
reject(
|
|
1752
|
+
new HttpError(
|
|
1753
|
+
response,
|
|
1754
|
+
body,
|
|
1755
|
+
response.statusCode
|
|
1756
|
+
)
|
|
1757
|
+
);
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
);
|
|
1762
|
+
});
|
|
1763
|
+
});
|
|
1764
|
+
}
|
|
1765
|
+
/**
|
|
1766
|
+
* Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. When called, this endpoint may generate the `Regulation Deleted` [Audit Trail](/tag/Audit-Trail) event.
|
|
1767
|
+
* @summary Delete Regulation
|
|
1768
|
+
* @param regulateId
|
|
1769
|
+
*/
|
|
1770
|
+
public async deleteRegulationBeta(
|
|
1771
|
+
regulateId: string,
|
|
1772
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1773
|
+
): Promise<{
|
|
1774
|
+
response: http.IncomingMessage;
|
|
1775
|
+
body: DeleteRegulation200Response;
|
|
1776
|
+
}> {
|
|
1777
|
+
const localVarPath =
|
|
1778
|
+
this.basePath +
|
|
1779
|
+
'/regulations/{regulateId}'.replace(
|
|
1780
|
+
'{' + 'regulateId' + '}',
|
|
1781
|
+
encodeURIComponent(String(regulateId))
|
|
1782
|
+
);
|
|
1783
|
+
let localVarQueryParameters: any = {};
|
|
1784
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1785
|
+
{},
|
|
1786
|
+
this._defaultHeaders
|
|
1787
|
+
);
|
|
1788
|
+
const produces = [
|
|
1789
|
+
'application/vnd.segment.v1beta+json',
|
|
1790
|
+
'application/json',
|
|
1791
|
+
];
|
|
1792
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1793
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1794
|
+
} else {
|
|
1795
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1796
|
+
}
|
|
1797
|
+
let localVarFormParams: any = {};
|
|
1798
|
+
|
|
1799
|
+
// verify required parameter 'regulateId' is not null or undefined
|
|
1800
|
+
if (regulateId === null || regulateId === undefined) {
|
|
1801
|
+
throw new Error(
|
|
1802
|
+
'Required parameter regulateId was null or undefined when calling deleteRegulationBeta.'
|
|
1803
|
+
);
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1807
|
+
|
|
1808
|
+
let localVarUseFormData = false;
|
|
1809
|
+
|
|
1810
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1811
|
+
method: 'DELETE',
|
|
1812
|
+
qs: localVarQueryParameters,
|
|
1813
|
+
headers: localVarHeaderParams,
|
|
1814
|
+
uri: localVarPath,
|
|
1815
|
+
useQuerystring: this._useQuerystring,
|
|
1816
|
+
json: true,
|
|
1817
|
+
};
|
|
1818
|
+
|
|
1819
|
+
let authenticationPromise = Promise.resolve();
|
|
1820
|
+
if (this.authentications.token.accessToken) {
|
|
1821
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1822
|
+
this.authentications.token.applyToRequest(
|
|
1823
|
+
localVarRequestOptions
|
|
1824
|
+
)
|
|
1825
|
+
);
|
|
1826
|
+
}
|
|
1827
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1828
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1829
|
+
);
|
|
1830
|
+
|
|
1831
|
+
let interceptorPromise = authenticationPromise;
|
|
1832
|
+
for (const interceptor of this.interceptors) {
|
|
1833
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1834
|
+
interceptor(localVarRequestOptions)
|
|
1835
|
+
);
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
return interceptorPromise.then(() => {
|
|
1839
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1840
|
+
if (localVarUseFormData) {
|
|
1841
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1842
|
+
} else {
|
|
1843
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
return new Promise<{
|
|
1847
|
+
response: http.IncomingMessage;
|
|
1848
|
+
body: DeleteRegulation200Response;
|
|
1849
|
+
}>((resolve, reject) => {
|
|
1850
|
+
localVarRequest(
|
|
1851
|
+
localVarRequestOptions,
|
|
1852
|
+
(error, response, body) => {
|
|
1853
|
+
if (error) {
|
|
1854
|
+
reject(error);
|
|
1855
|
+
} else {
|
|
1856
|
+
if (
|
|
1857
|
+
response.statusCode &&
|
|
1858
|
+
response.statusCode >= 200 &&
|
|
1859
|
+
response.statusCode <= 299
|
|
1860
|
+
) {
|
|
1861
|
+
body = ObjectSerializer.deserialize(
|
|
1862
|
+
body,
|
|
1863
|
+
'DeleteRegulation200Response'
|
|
1864
|
+
);
|
|
1865
|
+
resolve({ response: response, body: body });
|
|
1866
|
+
} else {
|
|
1867
|
+
reject(
|
|
1868
|
+
new HttpError(
|
|
1869
|
+
response,
|
|
1870
|
+
body,
|
|
1871
|
+
response.statusCode
|
|
1872
|
+
)
|
|
1873
|
+
);
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
);
|
|
1878
|
+
});
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. When called, this endpoint may generate the `Regulation Deleted` [Audit Trail](/tag/Audit-Trail) event.
|
|
1883
|
+
* @summary Delete Regulation
|
|
1884
|
+
* @param regulateId
|
|
1885
|
+
*/
|
|
1886
|
+
public async deleteRegulationCurrent(
|
|
1887
|
+
regulateId: string,
|
|
1888
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
1889
|
+
): Promise<{
|
|
1890
|
+
response: http.IncomingMessage;
|
|
1891
|
+
body: DeleteRegulation200Response;
|
|
1892
|
+
}> {
|
|
1893
|
+
const localVarPath =
|
|
1894
|
+
this.basePath +
|
|
1895
|
+
'/regulations/{regulateId}'.replace(
|
|
1896
|
+
'{' + 'regulateId' + '}',
|
|
1897
|
+
encodeURIComponent(String(regulateId))
|
|
1898
|
+
);
|
|
1899
|
+
let localVarQueryParameters: any = {};
|
|
1900
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
1901
|
+
{},
|
|
1902
|
+
this._defaultHeaders
|
|
1903
|
+
);
|
|
1904
|
+
const produces = ['application/json'];
|
|
1905
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1906
|
+
localVarHeaderParams.Accept = produces[0];
|
|
1907
|
+
} else {
|
|
1908
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1909
|
+
}
|
|
1910
|
+
let localVarFormParams: any = {};
|
|
1911
|
+
|
|
1912
|
+
// verify required parameter 'regulateId' is not null or undefined
|
|
1913
|
+
if (regulateId === null || regulateId === undefined) {
|
|
1914
|
+
throw new Error(
|
|
1915
|
+
'Required parameter regulateId was null or undefined when calling deleteRegulationCurrent.'
|
|
1916
|
+
);
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
1920
|
+
|
|
1921
|
+
let localVarUseFormData = false;
|
|
1922
|
+
|
|
1923
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
1924
|
+
method: 'DELETE',
|
|
1925
|
+
qs: localVarQueryParameters,
|
|
1926
|
+
headers: localVarHeaderParams,
|
|
1927
|
+
uri: localVarPath,
|
|
1928
|
+
useQuerystring: this._useQuerystring,
|
|
1929
|
+
json: true,
|
|
1930
|
+
};
|
|
1931
|
+
|
|
1932
|
+
let authenticationPromise = Promise.resolve();
|
|
1933
|
+
if (this.authentications.token.accessToken) {
|
|
1934
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1935
|
+
this.authentications.token.applyToRequest(
|
|
1936
|
+
localVarRequestOptions
|
|
1937
|
+
)
|
|
1938
|
+
);
|
|
1939
|
+
}
|
|
1940
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
1941
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
1942
|
+
);
|
|
1943
|
+
|
|
1944
|
+
let interceptorPromise = authenticationPromise;
|
|
1945
|
+
for (const interceptor of this.interceptors) {
|
|
1946
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
1947
|
+
interceptor(localVarRequestOptions)
|
|
1948
|
+
);
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
return interceptorPromise.then(() => {
|
|
1952
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1953
|
+
if (localVarUseFormData) {
|
|
1954
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
1955
|
+
} else {
|
|
1956
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
return new Promise<{
|
|
1960
|
+
response: http.IncomingMessage;
|
|
1961
|
+
body: DeleteRegulation200Response;
|
|
1962
|
+
}>((resolve, reject) => {
|
|
1963
|
+
localVarRequest(
|
|
1964
|
+
localVarRequestOptions,
|
|
1965
|
+
(error, response, body) => {
|
|
1966
|
+
if (error) {
|
|
1967
|
+
reject(error);
|
|
1968
|
+
} else {
|
|
1969
|
+
if (
|
|
1970
|
+
response.statusCode &&
|
|
1971
|
+
response.statusCode >= 200 &&
|
|
1972
|
+
response.statusCode <= 299
|
|
1973
|
+
) {
|
|
1974
|
+
body = ObjectSerializer.deserialize(
|
|
1975
|
+
body,
|
|
1976
|
+
'DeleteRegulation200Response'
|
|
1977
|
+
);
|
|
1978
|
+
resolve({ response: response, body: body });
|
|
1979
|
+
} else {
|
|
1980
|
+
reject(
|
|
1981
|
+
new HttpError(
|
|
1982
|
+
response,
|
|
1983
|
+
body,
|
|
1984
|
+
response.statusCode
|
|
1985
|
+
)
|
|
1986
|
+
);
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
}
|
|
1990
|
+
);
|
|
1991
|
+
});
|
|
1992
|
+
});
|
|
1993
|
+
}
|
|
1994
|
+
/**
|
|
1995
|
+
* Deletes a regulation from the Workspace. The regulation must be in the initialized state to be deleted. When called, this endpoint may generate the `Regulation Deleted` [Audit Trail](/tag/Audit-Trail) event.
|
|
1996
|
+
* @summary Delete Regulation
|
|
1997
|
+
* @param regulateId
|
|
1998
|
+
*/
|
|
1999
|
+
public async deleteRegulationV1(
|
|
2000
|
+
regulateId: string,
|
|
2001
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
2002
|
+
): Promise<{
|
|
2003
|
+
response: http.IncomingMessage;
|
|
2004
|
+
body: DeleteRegulation200Response;
|
|
2005
|
+
}> {
|
|
2006
|
+
const localVarPath =
|
|
2007
|
+
this.basePath +
|
|
2008
|
+
'/regulations/{regulateId}'.replace(
|
|
2009
|
+
'{' + 'regulateId' + '}',
|
|
2010
|
+
encodeURIComponent(String(regulateId))
|
|
2011
|
+
);
|
|
2012
|
+
let localVarQueryParameters: any = {};
|
|
2013
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
2014
|
+
{},
|
|
2015
|
+
this._defaultHeaders
|
|
2016
|
+
);
|
|
2017
|
+
const produces = [
|
|
2018
|
+
'application/vnd.segment.v1+json',
|
|
2019
|
+
'application/json',
|
|
2020
|
+
];
|
|
2021
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2022
|
+
localVarHeaderParams.Accept = produces[0];
|
|
2023
|
+
} else {
|
|
2024
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2025
|
+
}
|
|
2026
|
+
let localVarFormParams: any = {};
|
|
2027
|
+
|
|
2028
|
+
// verify required parameter 'regulateId' is not null or undefined
|
|
2029
|
+
if (regulateId === null || regulateId === undefined) {
|
|
2030
|
+
throw new Error(
|
|
2031
|
+
'Required parameter regulateId was null or undefined when calling deleteRegulationV1.'
|
|
2032
|
+
);
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2036
|
+
|
|
2037
|
+
let localVarUseFormData = false;
|
|
2038
|
+
|
|
2039
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2040
|
+
method: 'DELETE',
|
|
2041
|
+
qs: localVarQueryParameters,
|
|
2042
|
+
headers: localVarHeaderParams,
|
|
2043
|
+
uri: localVarPath,
|
|
2044
|
+
useQuerystring: this._useQuerystring,
|
|
2045
|
+
json: true,
|
|
2046
|
+
};
|
|
2047
|
+
|
|
2048
|
+
let authenticationPromise = Promise.resolve();
|
|
2049
|
+
if (this.authentications.token.accessToken) {
|
|
2050
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2051
|
+
this.authentications.token.applyToRequest(
|
|
2052
|
+
localVarRequestOptions
|
|
2053
|
+
)
|
|
2054
|
+
);
|
|
2055
|
+
}
|
|
2056
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2057
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
2058
|
+
);
|
|
2059
|
+
|
|
2060
|
+
let interceptorPromise = authenticationPromise;
|
|
2061
|
+
for (const interceptor of this.interceptors) {
|
|
2062
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
2063
|
+
interceptor(localVarRequestOptions)
|
|
2064
|
+
);
|
|
2065
|
+
}
|
|
2066
|
+
|
|
2067
|
+
return interceptorPromise.then(() => {
|
|
2068
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2069
|
+
if (localVarUseFormData) {
|
|
2070
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2071
|
+
} else {
|
|
2072
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
return new Promise<{
|
|
2076
|
+
response: http.IncomingMessage;
|
|
2077
|
+
body: DeleteRegulation200Response;
|
|
2078
|
+
}>((resolve, reject) => {
|
|
2079
|
+
localVarRequest(
|
|
2080
|
+
localVarRequestOptions,
|
|
2081
|
+
(error, response, body) => {
|
|
2082
|
+
if (error) {
|
|
2083
|
+
reject(error);
|
|
2084
|
+
} else {
|
|
2085
|
+
if (
|
|
2086
|
+
response.statusCode &&
|
|
2087
|
+
response.statusCode >= 200 &&
|
|
2088
|
+
response.statusCode <= 299
|
|
2089
|
+
) {
|
|
2090
|
+
body = ObjectSerializer.deserialize(
|
|
2091
|
+
body,
|
|
2092
|
+
'DeleteRegulation200Response'
|
|
2093
|
+
);
|
|
2094
|
+
resolve({ response: response, body: body });
|
|
2095
|
+
} else {
|
|
2096
|
+
reject(
|
|
2097
|
+
new HttpError(
|
|
2098
|
+
response,
|
|
2099
|
+
body,
|
|
2100
|
+
response.statusCode
|
|
2101
|
+
)
|
|
2102
|
+
);
|
|
2103
|
+
}
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
);
|
|
2107
|
+
});
|
|
2108
|
+
});
|
|
2109
|
+
}
|
|
2110
|
+
/**
|
|
2111
|
+
* Gets a regulation from the Workspace. Config API omitted fields: - `parent`
|
|
2112
|
+
* @summary Get Regulation
|
|
2113
|
+
* @param regulateId
|
|
2114
|
+
*/
|
|
2115
|
+
public async getRegulationAlpha(
|
|
2116
|
+
regulateId: string,
|
|
2117
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
2118
|
+
): Promise<{
|
|
2119
|
+
response: http.IncomingMessage;
|
|
2120
|
+
body: GetRegulation200Response;
|
|
2121
|
+
}> {
|
|
2122
|
+
const localVarPath =
|
|
2123
|
+
this.basePath +
|
|
2124
|
+
'/regulations/{regulateId}'.replace(
|
|
2125
|
+
'{' + 'regulateId' + '}',
|
|
2126
|
+
encodeURIComponent(String(regulateId))
|
|
2127
|
+
);
|
|
2128
|
+
let localVarQueryParameters: any = {};
|
|
2129
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
2130
|
+
{},
|
|
2131
|
+
this._defaultHeaders
|
|
2132
|
+
);
|
|
2133
|
+
const produces = [
|
|
2134
|
+
'application/vnd.segment.v1alpha+json',
|
|
2135
|
+
'application/json',
|
|
2136
|
+
];
|
|
2137
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2138
|
+
localVarHeaderParams.Accept = produces[0];
|
|
2139
|
+
} else {
|
|
2140
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2141
|
+
}
|
|
2142
|
+
let localVarFormParams: any = {};
|
|
2143
|
+
|
|
2144
|
+
// verify required parameter 'regulateId' is not null or undefined
|
|
2145
|
+
if (regulateId === null || regulateId === undefined) {
|
|
2146
|
+
throw new Error(
|
|
2147
|
+
'Required parameter regulateId was null or undefined when calling getRegulationAlpha.'
|
|
2148
|
+
);
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2152
|
+
|
|
2153
|
+
let localVarUseFormData = false;
|
|
2154
|
+
|
|
2155
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2156
|
+
method: 'GET',
|
|
2157
|
+
qs: localVarQueryParameters,
|
|
2158
|
+
headers: localVarHeaderParams,
|
|
2159
|
+
uri: localVarPath,
|
|
2160
|
+
useQuerystring: this._useQuerystring,
|
|
2161
|
+
json: true,
|
|
2162
|
+
};
|
|
2163
|
+
|
|
2164
|
+
let authenticationPromise = Promise.resolve();
|
|
2165
|
+
if (this.authentications.token.accessToken) {
|
|
2166
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2167
|
+
this.authentications.token.applyToRequest(
|
|
2168
|
+
localVarRequestOptions
|
|
2169
|
+
)
|
|
2170
|
+
);
|
|
2171
|
+
}
|
|
2172
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2173
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
2174
|
+
);
|
|
2175
|
+
|
|
2176
|
+
let interceptorPromise = authenticationPromise;
|
|
2177
|
+
for (const interceptor of this.interceptors) {
|
|
2178
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
2179
|
+
interceptor(localVarRequestOptions)
|
|
2180
|
+
);
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
return interceptorPromise.then(() => {
|
|
2184
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2185
|
+
if (localVarUseFormData) {
|
|
2186
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2187
|
+
} else {
|
|
2188
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2189
|
+
}
|
|
2190
|
+
}
|
|
2191
|
+
return new Promise<{
|
|
2192
|
+
response: http.IncomingMessage;
|
|
2193
|
+
body: GetRegulation200Response;
|
|
2194
|
+
}>((resolve, reject) => {
|
|
2195
|
+
localVarRequest(
|
|
2196
|
+
localVarRequestOptions,
|
|
2197
|
+
(error, response, body) => {
|
|
2198
|
+
if (error) {
|
|
2199
|
+
reject(error);
|
|
2200
|
+
} else {
|
|
2201
|
+
if (
|
|
2202
|
+
response.statusCode &&
|
|
2203
|
+
response.statusCode >= 200 &&
|
|
2204
|
+
response.statusCode <= 299
|
|
2205
|
+
) {
|
|
2206
|
+
body = ObjectSerializer.deserialize(
|
|
2207
|
+
body,
|
|
2208
|
+
'GetRegulation200Response'
|
|
2209
|
+
);
|
|
2210
|
+
resolve({ response: response, body: body });
|
|
2211
|
+
} else {
|
|
2212
|
+
reject(
|
|
2213
|
+
new HttpError(
|
|
2214
|
+
response,
|
|
2215
|
+
body,
|
|
2216
|
+
response.statusCode
|
|
2217
|
+
)
|
|
2218
|
+
);
|
|
2219
|
+
}
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
);
|
|
2223
|
+
});
|
|
2224
|
+
});
|
|
2225
|
+
}
|
|
2226
|
+
/**
|
|
2227
|
+
* Gets a regulation from the Workspace. Config API omitted fields: - `parent`
|
|
2228
|
+
* @summary Get Regulation
|
|
2229
|
+
* @param regulateId
|
|
2230
|
+
*/
|
|
2231
|
+
public async getRegulationBeta(
|
|
2232
|
+
regulateId: string,
|
|
2233
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
2234
|
+
): Promise<{
|
|
2235
|
+
response: http.IncomingMessage;
|
|
2236
|
+
body: GetRegulation200Response;
|
|
2237
|
+
}> {
|
|
2238
|
+
const localVarPath =
|
|
2239
|
+
this.basePath +
|
|
2240
|
+
'/regulations/{regulateId}'.replace(
|
|
2241
|
+
'{' + 'regulateId' + '}',
|
|
2242
|
+
encodeURIComponent(String(regulateId))
|
|
2243
|
+
);
|
|
2244
|
+
let localVarQueryParameters: any = {};
|
|
2245
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
2246
|
+
{},
|
|
2247
|
+
this._defaultHeaders
|
|
2248
|
+
);
|
|
2249
|
+
const produces = [
|
|
2250
|
+
'application/vnd.segment.v1beta+json',
|
|
2251
|
+
'application/json',
|
|
2252
|
+
];
|
|
2253
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2254
|
+
localVarHeaderParams.Accept = produces[0];
|
|
2255
|
+
} else {
|
|
2256
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2257
|
+
}
|
|
2258
|
+
let localVarFormParams: any = {};
|
|
2259
|
+
|
|
2260
|
+
// verify required parameter 'regulateId' is not null or undefined
|
|
2261
|
+
if (regulateId === null || regulateId === undefined) {
|
|
2262
|
+
throw new Error(
|
|
2263
|
+
'Required parameter regulateId was null or undefined when calling getRegulationBeta.'
|
|
2264
|
+
);
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2268
|
+
|
|
2269
|
+
let localVarUseFormData = false;
|
|
2270
|
+
|
|
2271
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2272
|
+
method: 'GET',
|
|
2273
|
+
qs: localVarQueryParameters,
|
|
2274
|
+
headers: localVarHeaderParams,
|
|
2275
|
+
uri: localVarPath,
|
|
2276
|
+
useQuerystring: this._useQuerystring,
|
|
2277
|
+
json: true,
|
|
2278
|
+
};
|
|
2279
|
+
|
|
2280
|
+
let authenticationPromise = Promise.resolve();
|
|
2281
|
+
if (this.authentications.token.accessToken) {
|
|
2282
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2283
|
+
this.authentications.token.applyToRequest(
|
|
2284
|
+
localVarRequestOptions
|
|
2285
|
+
)
|
|
2286
|
+
);
|
|
2287
|
+
}
|
|
2288
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2289
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
2290
|
+
);
|
|
2291
|
+
|
|
2292
|
+
let interceptorPromise = authenticationPromise;
|
|
2293
|
+
for (const interceptor of this.interceptors) {
|
|
2294
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
2295
|
+
interceptor(localVarRequestOptions)
|
|
2296
|
+
);
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
return interceptorPromise.then(() => {
|
|
2300
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2301
|
+
if (localVarUseFormData) {
|
|
2302
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2303
|
+
} else {
|
|
2304
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
return new Promise<{
|
|
2308
|
+
response: http.IncomingMessage;
|
|
2309
|
+
body: GetRegulation200Response;
|
|
2310
|
+
}>((resolve, reject) => {
|
|
2311
|
+
localVarRequest(
|
|
2312
|
+
localVarRequestOptions,
|
|
2313
|
+
(error, response, body) => {
|
|
2314
|
+
if (error) {
|
|
2315
|
+
reject(error);
|
|
2316
|
+
} else {
|
|
2317
|
+
if (
|
|
2318
|
+
response.statusCode &&
|
|
2319
|
+
response.statusCode >= 200 &&
|
|
2320
|
+
response.statusCode <= 299
|
|
2321
|
+
) {
|
|
2322
|
+
body = ObjectSerializer.deserialize(
|
|
2323
|
+
body,
|
|
2324
|
+
'GetRegulation200Response'
|
|
2325
|
+
);
|
|
2326
|
+
resolve({ response: response, body: body });
|
|
2327
|
+
} else {
|
|
2328
|
+
reject(
|
|
2329
|
+
new HttpError(
|
|
2330
|
+
response,
|
|
2331
|
+
body,
|
|
2332
|
+
response.statusCode
|
|
2333
|
+
)
|
|
2334
|
+
);
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
);
|
|
2339
|
+
});
|
|
2340
|
+
});
|
|
2341
|
+
}
|
|
2342
|
+
/**
|
|
2343
|
+
* Gets a regulation from the Workspace. Config API omitted fields: - `parent`
|
|
2344
|
+
* @summary Get Regulation
|
|
2345
|
+
* @param regulateId
|
|
2346
|
+
*/
|
|
2347
|
+
public async getRegulationCurrent(
|
|
2348
|
+
regulateId: string,
|
|
2349
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
2350
|
+
): Promise<{
|
|
2351
|
+
response: http.IncomingMessage;
|
|
2352
|
+
body: GetRegulation200Response;
|
|
2353
|
+
}> {
|
|
2354
|
+
const localVarPath =
|
|
2355
|
+
this.basePath +
|
|
2356
|
+
'/regulations/{regulateId}'.replace(
|
|
2357
|
+
'{' + 'regulateId' + '}',
|
|
2358
|
+
encodeURIComponent(String(regulateId))
|
|
2359
|
+
);
|
|
2360
|
+
let localVarQueryParameters: any = {};
|
|
2361
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
2362
|
+
{},
|
|
2363
|
+
this._defaultHeaders
|
|
2364
|
+
);
|
|
2365
|
+
const produces = ['application/json'];
|
|
2366
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2367
|
+
localVarHeaderParams.Accept = produces[0];
|
|
2368
|
+
} else {
|
|
2369
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2370
|
+
}
|
|
2371
|
+
let localVarFormParams: any = {};
|
|
2372
|
+
|
|
2373
|
+
// verify required parameter 'regulateId' is not null or undefined
|
|
2374
|
+
if (regulateId === null || regulateId === undefined) {
|
|
2375
|
+
throw new Error(
|
|
2376
|
+
'Required parameter regulateId was null or undefined when calling getRegulationCurrent.'
|
|
2377
|
+
);
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2380
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2381
|
+
|
|
2382
|
+
let localVarUseFormData = false;
|
|
2383
|
+
|
|
2384
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2385
|
+
method: 'GET',
|
|
2386
|
+
qs: localVarQueryParameters,
|
|
2387
|
+
headers: localVarHeaderParams,
|
|
2388
|
+
uri: localVarPath,
|
|
2389
|
+
useQuerystring: this._useQuerystring,
|
|
2390
|
+
json: true,
|
|
2391
|
+
};
|
|
2392
|
+
|
|
2393
|
+
let authenticationPromise = Promise.resolve();
|
|
2394
|
+
if (this.authentications.token.accessToken) {
|
|
2395
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2396
|
+
this.authentications.token.applyToRequest(
|
|
2397
|
+
localVarRequestOptions
|
|
2398
|
+
)
|
|
2399
|
+
);
|
|
2400
|
+
}
|
|
2401
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2402
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
2403
|
+
);
|
|
2404
|
+
|
|
2405
|
+
let interceptorPromise = authenticationPromise;
|
|
2406
|
+
for (const interceptor of this.interceptors) {
|
|
2407
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
2408
|
+
interceptor(localVarRequestOptions)
|
|
2409
|
+
);
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
return interceptorPromise.then(() => {
|
|
2413
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2414
|
+
if (localVarUseFormData) {
|
|
2415
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2416
|
+
} else {
|
|
2417
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
return new Promise<{
|
|
2421
|
+
response: http.IncomingMessage;
|
|
2422
|
+
body: GetRegulation200Response;
|
|
2423
|
+
}>((resolve, reject) => {
|
|
2424
|
+
localVarRequest(
|
|
2425
|
+
localVarRequestOptions,
|
|
2426
|
+
(error, response, body) => {
|
|
2427
|
+
if (error) {
|
|
2428
|
+
reject(error);
|
|
2429
|
+
} else {
|
|
2430
|
+
if (
|
|
2431
|
+
response.statusCode &&
|
|
2432
|
+
response.statusCode >= 200 &&
|
|
2433
|
+
response.statusCode <= 299
|
|
2434
|
+
) {
|
|
2435
|
+
body = ObjectSerializer.deserialize(
|
|
2436
|
+
body,
|
|
2437
|
+
'GetRegulation200Response'
|
|
2438
|
+
);
|
|
2439
|
+
resolve({ response: response, body: body });
|
|
2440
|
+
} else {
|
|
2441
|
+
reject(
|
|
2442
|
+
new HttpError(
|
|
2443
|
+
response,
|
|
2444
|
+
body,
|
|
2445
|
+
response.statusCode
|
|
2446
|
+
)
|
|
2447
|
+
);
|
|
2448
|
+
}
|
|
2449
|
+
}
|
|
2450
|
+
}
|
|
2451
|
+
);
|
|
2452
|
+
});
|
|
2453
|
+
});
|
|
2454
|
+
}
|
|
2455
|
+
/**
|
|
2456
|
+
* Gets a regulation from the Workspace. Config API omitted fields: - `parent`
|
|
2457
|
+
* @summary Get Regulation
|
|
2458
|
+
* @param regulateId
|
|
2459
|
+
*/
|
|
2460
|
+
public async getRegulationV1(
|
|
2461
|
+
regulateId: string,
|
|
2462
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
2463
|
+
): Promise<{
|
|
2464
|
+
response: http.IncomingMessage;
|
|
2465
|
+
body: GetRegulation200Response;
|
|
2466
|
+
}> {
|
|
2467
|
+
const localVarPath =
|
|
2468
|
+
this.basePath +
|
|
2469
|
+
'/regulations/{regulateId}'.replace(
|
|
2470
|
+
'{' + 'regulateId' + '}',
|
|
2471
|
+
encodeURIComponent(String(regulateId))
|
|
2472
|
+
);
|
|
2473
|
+
let localVarQueryParameters: any = {};
|
|
2474
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
2475
|
+
{},
|
|
2476
|
+
this._defaultHeaders
|
|
2477
|
+
);
|
|
2478
|
+
const produces = [
|
|
2479
|
+
'application/vnd.segment.v1+json',
|
|
2480
|
+
'application/json',
|
|
2481
|
+
];
|
|
2482
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2483
|
+
localVarHeaderParams.Accept = produces[0];
|
|
2484
|
+
} else {
|
|
2485
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2486
|
+
}
|
|
2487
|
+
let localVarFormParams: any = {};
|
|
2488
|
+
|
|
2489
|
+
// verify required parameter 'regulateId' is not null or undefined
|
|
2490
|
+
if (regulateId === null || regulateId === undefined) {
|
|
2491
|
+
throw new Error(
|
|
2492
|
+
'Required parameter regulateId was null or undefined when calling getRegulationV1.'
|
|
2493
|
+
);
|
|
2494
|
+
}
|
|
2495
|
+
|
|
2496
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2497
|
+
|
|
2498
|
+
let localVarUseFormData = false;
|
|
2499
|
+
|
|
2500
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2501
|
+
method: 'GET',
|
|
2502
|
+
qs: localVarQueryParameters,
|
|
2503
|
+
headers: localVarHeaderParams,
|
|
2504
|
+
uri: localVarPath,
|
|
2505
|
+
useQuerystring: this._useQuerystring,
|
|
2506
|
+
json: true,
|
|
2507
|
+
};
|
|
2508
|
+
|
|
2509
|
+
let authenticationPromise = Promise.resolve();
|
|
2510
|
+
if (this.authentications.token.accessToken) {
|
|
2511
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2512
|
+
this.authentications.token.applyToRequest(
|
|
2513
|
+
localVarRequestOptions
|
|
2514
|
+
)
|
|
2515
|
+
);
|
|
2516
|
+
}
|
|
2517
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2518
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
2519
|
+
);
|
|
2520
|
+
|
|
2521
|
+
let interceptorPromise = authenticationPromise;
|
|
2522
|
+
for (const interceptor of this.interceptors) {
|
|
2523
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
2524
|
+
interceptor(localVarRequestOptions)
|
|
2525
|
+
);
|
|
2526
|
+
}
|
|
2527
|
+
|
|
2528
|
+
return interceptorPromise.then(() => {
|
|
2529
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2530
|
+
if (localVarUseFormData) {
|
|
2531
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2532
|
+
} else {
|
|
2533
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
return new Promise<{
|
|
2537
|
+
response: http.IncomingMessage;
|
|
2538
|
+
body: GetRegulation200Response;
|
|
2539
|
+
}>((resolve, reject) => {
|
|
2540
|
+
localVarRequest(
|
|
2541
|
+
localVarRequestOptions,
|
|
2542
|
+
(error, response, body) => {
|
|
2543
|
+
if (error) {
|
|
2544
|
+
reject(error);
|
|
2545
|
+
} else {
|
|
2546
|
+
if (
|
|
2547
|
+
response.statusCode &&
|
|
2548
|
+
response.statusCode >= 200 &&
|
|
2549
|
+
response.statusCode <= 299
|
|
2550
|
+
) {
|
|
2551
|
+
body = ObjectSerializer.deserialize(
|
|
2552
|
+
body,
|
|
2553
|
+
'GetRegulation200Response'
|
|
2554
|
+
);
|
|
2555
|
+
resolve({ response: response, body: body });
|
|
2556
|
+
} else {
|
|
2557
|
+
reject(
|
|
2558
|
+
new HttpError(
|
|
2559
|
+
response,
|
|
2560
|
+
body,
|
|
2561
|
+
response.statusCode
|
|
2562
|
+
)
|
|
2563
|
+
);
|
|
2564
|
+
}
|
|
2565
|
+
}
|
|
2566
|
+
}
|
|
2567
|
+
);
|
|
2568
|
+
});
|
|
2569
|
+
});
|
|
2570
|
+
}
|
|
2571
|
+
/**
|
|
2572
|
+
* Lists all Source-scoped regulations.
|
|
2573
|
+
* @summary List Regulations from Source
|
|
2574
|
+
* @param sourceId
|
|
2575
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
2576
|
+
* @param status The status on which to filter returned regulations. This parameter exists in alpha.
|
|
2577
|
+
* @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha.
|
|
2578
|
+
*/
|
|
2579
|
+
public async listRegulationsFromSourceAlpha(
|
|
2580
|
+
sourceId: string,
|
|
2581
|
+
pagination: PaginationInput,
|
|
2582
|
+
status?:
|
|
2583
|
+
| 'FAILED'
|
|
2584
|
+
| 'FINISHED'
|
|
2585
|
+
| 'INITIALIZED'
|
|
2586
|
+
| 'INVALID'
|
|
2587
|
+
| 'NOT_SUPPORTED'
|
|
2588
|
+
| 'PARTIAL_SUCCESS'
|
|
2589
|
+
| 'RUNNING',
|
|
2590
|
+
regulationTypes?: Array<
|
|
2591
|
+
| 'BULK_DELETE_ONLY'
|
|
2592
|
+
| 'DELETE_INTERNAL'
|
|
2593
|
+
| 'DELETE_ONLY'
|
|
2594
|
+
| 'SUPPRESS_ONLY'
|
|
2595
|
+
| 'SUPPRESS_WITH_DELETE'
|
|
2596
|
+
| 'UNSUPPRESS'
|
|
2597
|
+
>,
|
|
2598
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
2599
|
+
): Promise<{
|
|
2600
|
+
response: http.IncomingMessage;
|
|
2601
|
+
body: ListRegulationsFromSource200Response;
|
|
2602
|
+
}> {
|
|
2603
|
+
const localVarPath =
|
|
2604
|
+
this.basePath +
|
|
2605
|
+
'/regulations/sources/{sourceId}'.replace(
|
|
2606
|
+
'{' + 'sourceId' + '}',
|
|
2607
|
+
encodeURIComponent(String(sourceId))
|
|
2608
|
+
);
|
|
2609
|
+
let localVarQueryParameters: any = {};
|
|
2610
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
2611
|
+
{},
|
|
2612
|
+
this._defaultHeaders
|
|
2613
|
+
);
|
|
2614
|
+
const produces = [
|
|
2615
|
+
'application/vnd.segment.v1alpha+json',
|
|
2616
|
+
'application/json',
|
|
2617
|
+
];
|
|
2618
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2619
|
+
localVarHeaderParams.Accept = produces[0];
|
|
2620
|
+
} else {
|
|
2621
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2622
|
+
}
|
|
2623
|
+
let localVarFormParams: any = {};
|
|
2624
|
+
|
|
2625
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
2626
|
+
if (sourceId === null || sourceId === undefined) {
|
|
2627
|
+
throw new Error(
|
|
2628
|
+
'Required parameter sourceId was null or undefined when calling listRegulationsFromSourceAlpha.'
|
|
2629
|
+
);
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
2633
|
+
if (pagination === null || pagination === undefined) {
|
|
2634
|
+
throw new Error(
|
|
2635
|
+
'Required parameter pagination was null or undefined when calling listRegulationsFromSourceAlpha.'
|
|
2636
|
+
);
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
if (status !== undefined) {
|
|
2640
|
+
localVarQueryParameters['status'] = ObjectSerializer.serialize(
|
|
2641
|
+
status,
|
|
2642
|
+
"'FAILED' | 'FINISHED' | 'INITIALIZED' | 'INVALID' | 'NOT_SUPPORTED' | 'PARTIAL_SUCCESS' | 'RUNNING'"
|
|
2643
|
+
);
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
if (regulationTypes !== undefined) {
|
|
2647
|
+
localVarQueryParameters['regulationTypes'] =
|
|
2648
|
+
ObjectSerializer.serialize(
|
|
2649
|
+
regulationTypes,
|
|
2650
|
+
"Array<'BULK_DELETE_ONLY' | 'DELETE_INTERNAL' | 'DELETE_ONLY' | 'SUPPRESS_ONLY' | 'SUPPRESS_WITH_DELETE' | 'UNSUPPRESS'>"
|
|
2651
|
+
);
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2654
|
+
if (pagination !== undefined) {
|
|
2655
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
2656
|
+
pagination,
|
|
2657
|
+
'PaginationInput'
|
|
2658
|
+
);
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2662
|
+
|
|
2663
|
+
let localVarUseFormData = false;
|
|
2664
|
+
|
|
2665
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2666
|
+
method: 'GET',
|
|
2667
|
+
qs: localVarQueryParameters,
|
|
2668
|
+
headers: localVarHeaderParams,
|
|
2669
|
+
uri: localVarPath,
|
|
2670
|
+
useQuerystring: this._useQuerystring,
|
|
2671
|
+
json: true,
|
|
2672
|
+
};
|
|
2673
|
+
|
|
2674
|
+
let authenticationPromise = Promise.resolve();
|
|
2675
|
+
if (this.authentications.token.accessToken) {
|
|
2676
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2677
|
+
this.authentications.token.applyToRequest(
|
|
2678
|
+
localVarRequestOptions
|
|
2679
|
+
)
|
|
2680
|
+
);
|
|
2681
|
+
}
|
|
2682
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2683
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
2684
|
+
);
|
|
2685
|
+
|
|
2686
|
+
let interceptorPromise = authenticationPromise;
|
|
2687
|
+
for (const interceptor of this.interceptors) {
|
|
2688
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
2689
|
+
interceptor(localVarRequestOptions)
|
|
2690
|
+
);
|
|
2691
|
+
}
|
|
2692
|
+
|
|
2693
|
+
return interceptorPromise.then(() => {
|
|
2694
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2695
|
+
if (localVarUseFormData) {
|
|
2696
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2697
|
+
} else {
|
|
2698
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
return new Promise<{
|
|
2702
|
+
response: http.IncomingMessage;
|
|
2703
|
+
body: ListRegulationsFromSource200Response;
|
|
2704
|
+
}>((resolve, reject) => {
|
|
2705
|
+
localVarRequest(
|
|
2706
|
+
localVarRequestOptions,
|
|
2707
|
+
(error, response, body) => {
|
|
2708
|
+
if (error) {
|
|
2709
|
+
reject(error);
|
|
2710
|
+
} else {
|
|
2711
|
+
if (
|
|
2712
|
+
response.statusCode &&
|
|
2713
|
+
response.statusCode >= 200 &&
|
|
2714
|
+
response.statusCode <= 299
|
|
2715
|
+
) {
|
|
2716
|
+
body = ObjectSerializer.deserialize(
|
|
2717
|
+
body,
|
|
2718
|
+
'ListRegulationsFromSource200Response'
|
|
2719
|
+
);
|
|
2720
|
+
resolve({ response: response, body: body });
|
|
2721
|
+
} else {
|
|
2722
|
+
reject(
|
|
2723
|
+
new HttpError(
|
|
2724
|
+
response,
|
|
2725
|
+
body,
|
|
2726
|
+
response.statusCode
|
|
2727
|
+
)
|
|
2728
|
+
);
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2731
|
+
}
|
|
2732
|
+
);
|
|
2733
|
+
});
|
|
2734
|
+
});
|
|
2735
|
+
}
|
|
2736
|
+
/**
|
|
2737
|
+
* Lists all Source-scoped regulations.
|
|
2738
|
+
* @summary List Regulations from Source
|
|
2739
|
+
* @param sourceId
|
|
2740
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
2741
|
+
* @param status The status on which to filter returned regulations. This parameter exists in alpha.
|
|
2742
|
+
* @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha.
|
|
2743
|
+
*/
|
|
2744
|
+
public async listRegulationsFromSourceBeta(
|
|
2745
|
+
sourceId: string,
|
|
2746
|
+
pagination: PaginationInput,
|
|
2747
|
+
status?:
|
|
2748
|
+
| 'FAILED'
|
|
2749
|
+
| 'FINISHED'
|
|
2750
|
+
| 'INITIALIZED'
|
|
2751
|
+
| 'INVALID'
|
|
2752
|
+
| 'NOT_SUPPORTED'
|
|
2753
|
+
| 'PARTIAL_SUCCESS'
|
|
2754
|
+
| 'RUNNING',
|
|
2755
|
+
regulationTypes?: Array<
|
|
2756
|
+
| 'BULK_DELETE_ONLY'
|
|
2757
|
+
| 'DELETE_INTERNAL'
|
|
2758
|
+
| 'DELETE_ONLY'
|
|
2759
|
+
| 'SUPPRESS_ONLY'
|
|
2760
|
+
| 'SUPPRESS_WITH_DELETE'
|
|
2761
|
+
| 'UNSUPPRESS'
|
|
2762
|
+
>,
|
|
2763
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
2764
|
+
): Promise<{
|
|
2765
|
+
response: http.IncomingMessage;
|
|
2766
|
+
body: ListRegulationsFromSource200Response;
|
|
2767
|
+
}> {
|
|
2768
|
+
const localVarPath =
|
|
2769
|
+
this.basePath +
|
|
2770
|
+
'/regulations/sources/{sourceId}'.replace(
|
|
2771
|
+
'{' + 'sourceId' + '}',
|
|
2772
|
+
encodeURIComponent(String(sourceId))
|
|
2773
|
+
);
|
|
2774
|
+
let localVarQueryParameters: any = {};
|
|
2775
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
2776
|
+
{},
|
|
2777
|
+
this._defaultHeaders
|
|
2778
|
+
);
|
|
2779
|
+
const produces = [
|
|
2780
|
+
'application/vnd.segment.v1beta+json',
|
|
2781
|
+
'application/json',
|
|
2782
|
+
];
|
|
2783
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2784
|
+
localVarHeaderParams.Accept = produces[0];
|
|
2785
|
+
} else {
|
|
2786
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2787
|
+
}
|
|
2788
|
+
let localVarFormParams: any = {};
|
|
2789
|
+
|
|
2790
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
2791
|
+
if (sourceId === null || sourceId === undefined) {
|
|
2792
|
+
throw new Error(
|
|
2793
|
+
'Required parameter sourceId was null or undefined when calling listRegulationsFromSourceBeta.'
|
|
2794
|
+
);
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
2798
|
+
if (pagination === null || pagination === undefined) {
|
|
2799
|
+
throw new Error(
|
|
2800
|
+
'Required parameter pagination was null or undefined when calling listRegulationsFromSourceBeta.'
|
|
2801
|
+
);
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
if (status !== undefined) {
|
|
2805
|
+
localVarQueryParameters['status'] = ObjectSerializer.serialize(
|
|
2806
|
+
status,
|
|
2807
|
+
"'FAILED' | 'FINISHED' | 'INITIALIZED' | 'INVALID' | 'NOT_SUPPORTED' | 'PARTIAL_SUCCESS' | 'RUNNING'"
|
|
2808
|
+
);
|
|
2809
|
+
}
|
|
2810
|
+
|
|
2811
|
+
if (regulationTypes !== undefined) {
|
|
2812
|
+
localVarQueryParameters['regulationTypes'] =
|
|
2813
|
+
ObjectSerializer.serialize(
|
|
2814
|
+
regulationTypes,
|
|
2815
|
+
"Array<'BULK_DELETE_ONLY' | 'DELETE_INTERNAL' | 'DELETE_ONLY' | 'SUPPRESS_ONLY' | 'SUPPRESS_WITH_DELETE' | 'UNSUPPRESS'>"
|
|
2816
|
+
);
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
if (pagination !== undefined) {
|
|
2820
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
2821
|
+
pagination,
|
|
2822
|
+
'PaginationInput'
|
|
2823
|
+
);
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2827
|
+
|
|
2828
|
+
let localVarUseFormData = false;
|
|
2829
|
+
|
|
2830
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2831
|
+
method: 'GET',
|
|
2832
|
+
qs: localVarQueryParameters,
|
|
2833
|
+
headers: localVarHeaderParams,
|
|
2834
|
+
uri: localVarPath,
|
|
2835
|
+
useQuerystring: this._useQuerystring,
|
|
2836
|
+
json: true,
|
|
2837
|
+
};
|
|
2838
|
+
|
|
2839
|
+
let authenticationPromise = Promise.resolve();
|
|
2840
|
+
if (this.authentications.token.accessToken) {
|
|
2841
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2842
|
+
this.authentications.token.applyToRequest(
|
|
2843
|
+
localVarRequestOptions
|
|
2844
|
+
)
|
|
2845
|
+
);
|
|
2846
|
+
}
|
|
2847
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
2848
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
2849
|
+
);
|
|
2850
|
+
|
|
2851
|
+
let interceptorPromise = authenticationPromise;
|
|
2852
|
+
for (const interceptor of this.interceptors) {
|
|
2853
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
2854
|
+
interceptor(localVarRequestOptions)
|
|
2855
|
+
);
|
|
2856
|
+
}
|
|
2857
|
+
|
|
2858
|
+
return interceptorPromise.then(() => {
|
|
2859
|
+
if (Object.keys(localVarFormParams).length) {
|
|
2860
|
+
if (localVarUseFormData) {
|
|
2861
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
2862
|
+
} else {
|
|
2863
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
2864
|
+
}
|
|
2865
|
+
}
|
|
2866
|
+
return new Promise<{
|
|
2867
|
+
response: http.IncomingMessage;
|
|
2868
|
+
body: ListRegulationsFromSource200Response;
|
|
2869
|
+
}>((resolve, reject) => {
|
|
2870
|
+
localVarRequest(
|
|
2871
|
+
localVarRequestOptions,
|
|
2872
|
+
(error, response, body) => {
|
|
2873
|
+
if (error) {
|
|
2874
|
+
reject(error);
|
|
2875
|
+
} else {
|
|
2876
|
+
if (
|
|
2877
|
+
response.statusCode &&
|
|
2878
|
+
response.statusCode >= 200 &&
|
|
2879
|
+
response.statusCode <= 299
|
|
2880
|
+
) {
|
|
2881
|
+
body = ObjectSerializer.deserialize(
|
|
2882
|
+
body,
|
|
2883
|
+
'ListRegulationsFromSource200Response'
|
|
2884
|
+
);
|
|
2885
|
+
resolve({ response: response, body: body });
|
|
2886
|
+
} else {
|
|
2887
|
+
reject(
|
|
2888
|
+
new HttpError(
|
|
2889
|
+
response,
|
|
2890
|
+
body,
|
|
2891
|
+
response.statusCode
|
|
2892
|
+
)
|
|
2893
|
+
);
|
|
2894
|
+
}
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
);
|
|
2898
|
+
});
|
|
2899
|
+
});
|
|
2900
|
+
}
|
|
2901
|
+
/**
|
|
2902
|
+
* Lists all Source-scoped regulations.
|
|
2903
|
+
* @summary List Regulations from Source
|
|
2904
|
+
* @param sourceId
|
|
2905
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
2906
|
+
* @param status The status on which to filter returned regulations. This parameter exists in alpha.
|
|
2907
|
+
* @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha.
|
|
2908
|
+
*/
|
|
2909
|
+
public async listRegulationsFromSourceCurrent(
|
|
2910
|
+
sourceId: string,
|
|
2911
|
+
pagination: PaginationInput,
|
|
2912
|
+
status?:
|
|
2913
|
+
| 'FAILED'
|
|
2914
|
+
| 'FINISHED'
|
|
2915
|
+
| 'INITIALIZED'
|
|
2916
|
+
| 'INVALID'
|
|
2917
|
+
| 'NOT_SUPPORTED'
|
|
2918
|
+
| 'PARTIAL_SUCCESS'
|
|
2919
|
+
| 'RUNNING',
|
|
2920
|
+
regulationTypes?: Array<
|
|
2921
|
+
| 'BULK_DELETE_ONLY'
|
|
2922
|
+
| 'DELETE_INTERNAL'
|
|
2923
|
+
| 'DELETE_ONLY'
|
|
2924
|
+
| 'SUPPRESS_ONLY'
|
|
2925
|
+
| 'SUPPRESS_WITH_DELETE'
|
|
2926
|
+
| 'UNSUPPRESS'
|
|
2927
|
+
>,
|
|
2928
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
2929
|
+
): Promise<{
|
|
2930
|
+
response: http.IncomingMessage;
|
|
2931
|
+
body: ListRegulationsFromSource200Response;
|
|
2932
|
+
}> {
|
|
2933
|
+
const localVarPath =
|
|
2934
|
+
this.basePath +
|
|
2935
|
+
'/regulations/sources/{sourceId}'.replace(
|
|
2936
|
+
'{' + 'sourceId' + '}',
|
|
2937
|
+
encodeURIComponent(String(sourceId))
|
|
2938
|
+
);
|
|
2939
|
+
let localVarQueryParameters: any = {};
|
|
2940
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
2941
|
+
{},
|
|
2942
|
+
this._defaultHeaders
|
|
2943
|
+
);
|
|
2944
|
+
const produces = ['application/json'];
|
|
2945
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2946
|
+
localVarHeaderParams.Accept = produces[0];
|
|
2947
|
+
} else {
|
|
2948
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2949
|
+
}
|
|
2950
|
+
let localVarFormParams: any = {};
|
|
2951
|
+
|
|
2952
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
2953
|
+
if (sourceId === null || sourceId === undefined) {
|
|
2954
|
+
throw new Error(
|
|
2955
|
+
'Required parameter sourceId was null or undefined when calling listRegulationsFromSourceCurrent.'
|
|
2956
|
+
);
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
2960
|
+
if (pagination === null || pagination === undefined) {
|
|
2961
|
+
throw new Error(
|
|
2962
|
+
'Required parameter pagination was null or undefined when calling listRegulationsFromSourceCurrent.'
|
|
2963
|
+
);
|
|
2964
|
+
}
|
|
2965
|
+
|
|
2966
|
+
if (status !== undefined) {
|
|
2967
|
+
localVarQueryParameters['status'] = ObjectSerializer.serialize(
|
|
2968
|
+
status,
|
|
2969
|
+
"'FAILED' | 'FINISHED' | 'INITIALIZED' | 'INVALID' | 'NOT_SUPPORTED' | 'PARTIAL_SUCCESS' | 'RUNNING'"
|
|
2970
|
+
);
|
|
2971
|
+
}
|
|
2972
|
+
|
|
2973
|
+
if (regulationTypes !== undefined) {
|
|
2974
|
+
localVarQueryParameters['regulationTypes'] =
|
|
2975
|
+
ObjectSerializer.serialize(
|
|
2976
|
+
regulationTypes,
|
|
2977
|
+
"Array<'BULK_DELETE_ONLY' | 'DELETE_INTERNAL' | 'DELETE_ONLY' | 'SUPPRESS_ONLY' | 'SUPPRESS_WITH_DELETE' | 'UNSUPPRESS'>"
|
|
2978
|
+
);
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2981
|
+
if (pagination !== undefined) {
|
|
2982
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
2983
|
+
pagination,
|
|
2984
|
+
'PaginationInput'
|
|
2985
|
+
);
|
|
2986
|
+
}
|
|
2987
|
+
|
|
2988
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
2989
|
+
|
|
2990
|
+
let localVarUseFormData = false;
|
|
2991
|
+
|
|
2992
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
2993
|
+
method: 'GET',
|
|
2994
|
+
qs: localVarQueryParameters,
|
|
2995
|
+
headers: localVarHeaderParams,
|
|
2996
|
+
uri: localVarPath,
|
|
2997
|
+
useQuerystring: this._useQuerystring,
|
|
2998
|
+
json: true,
|
|
2999
|
+
};
|
|
3000
|
+
|
|
3001
|
+
let authenticationPromise = Promise.resolve();
|
|
3002
|
+
if (this.authentications.token.accessToken) {
|
|
3003
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3004
|
+
this.authentications.token.applyToRequest(
|
|
3005
|
+
localVarRequestOptions
|
|
3006
|
+
)
|
|
3007
|
+
);
|
|
3008
|
+
}
|
|
3009
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3010
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
3011
|
+
);
|
|
3012
|
+
|
|
3013
|
+
let interceptorPromise = authenticationPromise;
|
|
3014
|
+
for (const interceptor of this.interceptors) {
|
|
3015
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
3016
|
+
interceptor(localVarRequestOptions)
|
|
3017
|
+
);
|
|
3018
|
+
}
|
|
3019
|
+
|
|
3020
|
+
return interceptorPromise.then(() => {
|
|
3021
|
+
if (Object.keys(localVarFormParams).length) {
|
|
3022
|
+
if (localVarUseFormData) {
|
|
3023
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
3024
|
+
} else {
|
|
3025
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
3026
|
+
}
|
|
3027
|
+
}
|
|
3028
|
+
return new Promise<{
|
|
3029
|
+
response: http.IncomingMessage;
|
|
3030
|
+
body: ListRegulationsFromSource200Response;
|
|
3031
|
+
}>((resolve, reject) => {
|
|
3032
|
+
localVarRequest(
|
|
3033
|
+
localVarRequestOptions,
|
|
3034
|
+
(error, response, body) => {
|
|
3035
|
+
if (error) {
|
|
3036
|
+
reject(error);
|
|
3037
|
+
} else {
|
|
3038
|
+
if (
|
|
3039
|
+
response.statusCode &&
|
|
3040
|
+
response.statusCode >= 200 &&
|
|
3041
|
+
response.statusCode <= 299
|
|
3042
|
+
) {
|
|
3043
|
+
body = ObjectSerializer.deserialize(
|
|
3044
|
+
body,
|
|
3045
|
+
'ListRegulationsFromSource200Response'
|
|
3046
|
+
);
|
|
3047
|
+
resolve({ response: response, body: body });
|
|
3048
|
+
} else {
|
|
3049
|
+
reject(
|
|
3050
|
+
new HttpError(
|
|
3051
|
+
response,
|
|
3052
|
+
body,
|
|
3053
|
+
response.statusCode
|
|
3054
|
+
)
|
|
3055
|
+
);
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
);
|
|
3060
|
+
});
|
|
3061
|
+
});
|
|
3062
|
+
}
|
|
3063
|
+
/**
|
|
3064
|
+
* Lists all Source-scoped regulations.
|
|
3065
|
+
* @summary List Regulations from Source
|
|
3066
|
+
* @param sourceId
|
|
3067
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
3068
|
+
* @param status The status on which to filter returned regulations. This parameter exists in alpha.
|
|
3069
|
+
* @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha.
|
|
3070
|
+
*/
|
|
3071
|
+
public async listRegulationsFromSourceV1(
|
|
3072
|
+
sourceId: string,
|
|
3073
|
+
pagination: PaginationInput,
|
|
3074
|
+
status?:
|
|
3075
|
+
| 'FAILED'
|
|
3076
|
+
| 'FINISHED'
|
|
3077
|
+
| 'INITIALIZED'
|
|
3078
|
+
| 'INVALID'
|
|
3079
|
+
| 'NOT_SUPPORTED'
|
|
3080
|
+
| 'PARTIAL_SUCCESS'
|
|
3081
|
+
| 'RUNNING',
|
|
3082
|
+
regulationTypes?: Array<
|
|
3083
|
+
| 'BULK_DELETE_ONLY'
|
|
3084
|
+
| 'DELETE_INTERNAL'
|
|
3085
|
+
| 'DELETE_ONLY'
|
|
3086
|
+
| 'SUPPRESS_ONLY'
|
|
3087
|
+
| 'SUPPRESS_WITH_DELETE'
|
|
3088
|
+
| 'UNSUPPRESS'
|
|
3089
|
+
>,
|
|
3090
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
3091
|
+
): Promise<{
|
|
3092
|
+
response: http.IncomingMessage;
|
|
3093
|
+
body: ListRegulationsFromSource200Response;
|
|
3094
|
+
}> {
|
|
3095
|
+
const localVarPath =
|
|
3096
|
+
this.basePath +
|
|
3097
|
+
'/regulations/sources/{sourceId}'.replace(
|
|
3098
|
+
'{' + 'sourceId' + '}',
|
|
3099
|
+
encodeURIComponent(String(sourceId))
|
|
3100
|
+
);
|
|
3101
|
+
let localVarQueryParameters: any = {};
|
|
3102
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
3103
|
+
{},
|
|
3104
|
+
this._defaultHeaders
|
|
3105
|
+
);
|
|
3106
|
+
const produces = [
|
|
3107
|
+
'application/vnd.segment.v1+json',
|
|
3108
|
+
'application/json',
|
|
3109
|
+
];
|
|
3110
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
3111
|
+
localVarHeaderParams.Accept = produces[0];
|
|
3112
|
+
} else {
|
|
3113
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
3114
|
+
}
|
|
3115
|
+
let localVarFormParams: any = {};
|
|
3116
|
+
|
|
3117
|
+
// verify required parameter 'sourceId' is not null or undefined
|
|
3118
|
+
if (sourceId === null || sourceId === undefined) {
|
|
3119
|
+
throw new Error(
|
|
3120
|
+
'Required parameter sourceId was null or undefined when calling listRegulationsFromSourceV1.'
|
|
3121
|
+
);
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3124
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
3125
|
+
if (pagination === null || pagination === undefined) {
|
|
3126
|
+
throw new Error(
|
|
3127
|
+
'Required parameter pagination was null or undefined when calling listRegulationsFromSourceV1.'
|
|
3128
|
+
);
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
if (status !== undefined) {
|
|
3132
|
+
localVarQueryParameters['status'] = ObjectSerializer.serialize(
|
|
3133
|
+
status,
|
|
3134
|
+
"'FAILED' | 'FINISHED' | 'INITIALIZED' | 'INVALID' | 'NOT_SUPPORTED' | 'PARTIAL_SUCCESS' | 'RUNNING'"
|
|
3135
|
+
);
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
if (regulationTypes !== undefined) {
|
|
3139
|
+
localVarQueryParameters['regulationTypes'] =
|
|
3140
|
+
ObjectSerializer.serialize(
|
|
3141
|
+
regulationTypes,
|
|
3142
|
+
"Array<'BULK_DELETE_ONLY' | 'DELETE_INTERNAL' | 'DELETE_ONLY' | 'SUPPRESS_ONLY' | 'SUPPRESS_WITH_DELETE' | 'UNSUPPRESS'>"
|
|
3143
|
+
);
|
|
3144
|
+
}
|
|
3145
|
+
|
|
3146
|
+
if (pagination !== undefined) {
|
|
3147
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
3148
|
+
pagination,
|
|
3149
|
+
'PaginationInput'
|
|
3150
|
+
);
|
|
3151
|
+
}
|
|
3152
|
+
|
|
3153
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
3154
|
+
|
|
3155
|
+
let localVarUseFormData = false;
|
|
3156
|
+
|
|
3157
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
3158
|
+
method: 'GET',
|
|
3159
|
+
qs: localVarQueryParameters,
|
|
3160
|
+
headers: localVarHeaderParams,
|
|
3161
|
+
uri: localVarPath,
|
|
3162
|
+
useQuerystring: this._useQuerystring,
|
|
3163
|
+
json: true,
|
|
3164
|
+
};
|
|
3165
|
+
|
|
3166
|
+
let authenticationPromise = Promise.resolve();
|
|
3167
|
+
if (this.authentications.token.accessToken) {
|
|
3168
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3169
|
+
this.authentications.token.applyToRequest(
|
|
3170
|
+
localVarRequestOptions
|
|
3171
|
+
)
|
|
3172
|
+
);
|
|
3173
|
+
}
|
|
3174
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3175
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
3176
|
+
);
|
|
3177
|
+
|
|
3178
|
+
let interceptorPromise = authenticationPromise;
|
|
3179
|
+
for (const interceptor of this.interceptors) {
|
|
3180
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
3181
|
+
interceptor(localVarRequestOptions)
|
|
3182
|
+
);
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
return interceptorPromise.then(() => {
|
|
3186
|
+
if (Object.keys(localVarFormParams).length) {
|
|
3187
|
+
if (localVarUseFormData) {
|
|
3188
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
3189
|
+
} else {
|
|
3190
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
3191
|
+
}
|
|
3192
|
+
}
|
|
3193
|
+
return new Promise<{
|
|
3194
|
+
response: http.IncomingMessage;
|
|
3195
|
+
body: ListRegulationsFromSource200Response;
|
|
3196
|
+
}>((resolve, reject) => {
|
|
3197
|
+
localVarRequest(
|
|
3198
|
+
localVarRequestOptions,
|
|
3199
|
+
(error, response, body) => {
|
|
3200
|
+
if (error) {
|
|
3201
|
+
reject(error);
|
|
3202
|
+
} else {
|
|
3203
|
+
if (
|
|
3204
|
+
response.statusCode &&
|
|
3205
|
+
response.statusCode >= 200 &&
|
|
3206
|
+
response.statusCode <= 299
|
|
3207
|
+
) {
|
|
3208
|
+
body = ObjectSerializer.deserialize(
|
|
3209
|
+
body,
|
|
3210
|
+
'ListRegulationsFromSource200Response'
|
|
3211
|
+
);
|
|
3212
|
+
resolve({ response: response, body: body });
|
|
3213
|
+
} else {
|
|
3214
|
+
reject(
|
|
3215
|
+
new HttpError(
|
|
3216
|
+
response,
|
|
3217
|
+
body,
|
|
3218
|
+
response.statusCode
|
|
3219
|
+
)
|
|
3220
|
+
);
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3223
|
+
}
|
|
3224
|
+
);
|
|
3225
|
+
});
|
|
3226
|
+
});
|
|
3227
|
+
}
|
|
3228
|
+
/**
|
|
3229
|
+
* Lists all suppressions in a given Workspace.
|
|
3230
|
+
* @summary List Suppressions
|
|
3231
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
3232
|
+
*/
|
|
3233
|
+
public async listSuppressionsAlpha(
|
|
3234
|
+
pagination: PaginationInput,
|
|
3235
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
3236
|
+
): Promise<{
|
|
3237
|
+
response: http.IncomingMessage;
|
|
3238
|
+
body: ListSuppressions200Response;
|
|
3239
|
+
}> {
|
|
3240
|
+
const localVarPath = this.basePath + '/suppressions';
|
|
3241
|
+
let localVarQueryParameters: any = {};
|
|
3242
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
3243
|
+
{},
|
|
3244
|
+
this._defaultHeaders
|
|
3245
|
+
);
|
|
3246
|
+
const produces = [
|
|
3247
|
+
'application/vnd.segment.v1alpha+json',
|
|
3248
|
+
'application/json',
|
|
3249
|
+
];
|
|
3250
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
3251
|
+
localVarHeaderParams.Accept = produces[0];
|
|
3252
|
+
} else {
|
|
3253
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
3254
|
+
}
|
|
3255
|
+
let localVarFormParams: any = {};
|
|
3256
|
+
|
|
3257
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
3258
|
+
if (pagination === null || pagination === undefined) {
|
|
3259
|
+
throw new Error(
|
|
3260
|
+
'Required parameter pagination was null or undefined when calling listSuppressionsAlpha.'
|
|
3261
|
+
);
|
|
3262
|
+
}
|
|
3263
|
+
|
|
3264
|
+
if (pagination !== undefined) {
|
|
3265
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
3266
|
+
pagination,
|
|
3267
|
+
'PaginationInput'
|
|
3268
|
+
);
|
|
3269
|
+
}
|
|
3270
|
+
|
|
3271
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
3272
|
+
|
|
3273
|
+
let localVarUseFormData = false;
|
|
3274
|
+
|
|
3275
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
3276
|
+
method: 'GET',
|
|
3277
|
+
qs: localVarQueryParameters,
|
|
3278
|
+
headers: localVarHeaderParams,
|
|
3279
|
+
uri: localVarPath,
|
|
3280
|
+
useQuerystring: this._useQuerystring,
|
|
3281
|
+
json: true,
|
|
3282
|
+
};
|
|
3283
|
+
|
|
3284
|
+
let authenticationPromise = Promise.resolve();
|
|
3285
|
+
if (this.authentications.token.accessToken) {
|
|
3286
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3287
|
+
this.authentications.token.applyToRequest(
|
|
3288
|
+
localVarRequestOptions
|
|
3289
|
+
)
|
|
3290
|
+
);
|
|
3291
|
+
}
|
|
3292
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3293
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
3294
|
+
);
|
|
3295
|
+
|
|
3296
|
+
let interceptorPromise = authenticationPromise;
|
|
3297
|
+
for (const interceptor of this.interceptors) {
|
|
3298
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
3299
|
+
interceptor(localVarRequestOptions)
|
|
3300
|
+
);
|
|
3301
|
+
}
|
|
3302
|
+
|
|
3303
|
+
return interceptorPromise.then(() => {
|
|
3304
|
+
if (Object.keys(localVarFormParams).length) {
|
|
3305
|
+
if (localVarUseFormData) {
|
|
3306
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
3307
|
+
} else {
|
|
3308
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
3309
|
+
}
|
|
3310
|
+
}
|
|
3311
|
+
return new Promise<{
|
|
3312
|
+
response: http.IncomingMessage;
|
|
3313
|
+
body: ListSuppressions200Response;
|
|
3314
|
+
}>((resolve, reject) => {
|
|
3315
|
+
localVarRequest(
|
|
3316
|
+
localVarRequestOptions,
|
|
3317
|
+
(error, response, body) => {
|
|
3318
|
+
if (error) {
|
|
3319
|
+
reject(error);
|
|
3320
|
+
} else {
|
|
3321
|
+
if (
|
|
3322
|
+
response.statusCode &&
|
|
3323
|
+
response.statusCode >= 200 &&
|
|
3324
|
+
response.statusCode <= 299
|
|
3325
|
+
) {
|
|
3326
|
+
body = ObjectSerializer.deserialize(
|
|
3327
|
+
body,
|
|
3328
|
+
'ListSuppressions200Response'
|
|
3329
|
+
);
|
|
3330
|
+
resolve({ response: response, body: body });
|
|
3331
|
+
} else {
|
|
3332
|
+
reject(
|
|
3333
|
+
new HttpError(
|
|
3334
|
+
response,
|
|
3335
|
+
body,
|
|
3336
|
+
response.statusCode
|
|
3337
|
+
)
|
|
3338
|
+
);
|
|
3339
|
+
}
|
|
3340
|
+
}
|
|
3341
|
+
}
|
|
3342
|
+
);
|
|
3343
|
+
});
|
|
3344
|
+
});
|
|
3345
|
+
}
|
|
3346
|
+
/**
|
|
3347
|
+
* Lists all suppressions in a given Workspace.
|
|
3348
|
+
* @summary List Suppressions
|
|
3349
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
3350
|
+
*/
|
|
3351
|
+
public async listSuppressionsBeta(
|
|
3352
|
+
pagination: PaginationInput,
|
|
3353
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
3354
|
+
): Promise<{
|
|
3355
|
+
response: http.IncomingMessage;
|
|
3356
|
+
body: ListSuppressions200Response;
|
|
3357
|
+
}> {
|
|
3358
|
+
const localVarPath = this.basePath + '/suppressions';
|
|
3359
|
+
let localVarQueryParameters: any = {};
|
|
3360
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
3361
|
+
{},
|
|
3362
|
+
this._defaultHeaders
|
|
3363
|
+
);
|
|
3364
|
+
const produces = [
|
|
3365
|
+
'application/vnd.segment.v1beta+json',
|
|
3366
|
+
'application/json',
|
|
3367
|
+
];
|
|
3368
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
3369
|
+
localVarHeaderParams.Accept = produces[0];
|
|
3370
|
+
} else {
|
|
3371
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
3372
|
+
}
|
|
3373
|
+
let localVarFormParams: any = {};
|
|
3374
|
+
|
|
3375
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
3376
|
+
if (pagination === null || pagination === undefined) {
|
|
3377
|
+
throw new Error(
|
|
3378
|
+
'Required parameter pagination was null or undefined when calling listSuppressionsBeta.'
|
|
3379
|
+
);
|
|
3380
|
+
}
|
|
3381
|
+
|
|
3382
|
+
if (pagination !== undefined) {
|
|
3383
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
3384
|
+
pagination,
|
|
3385
|
+
'PaginationInput'
|
|
3386
|
+
);
|
|
3387
|
+
}
|
|
3388
|
+
|
|
3389
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
3390
|
+
|
|
3391
|
+
let localVarUseFormData = false;
|
|
3392
|
+
|
|
3393
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
3394
|
+
method: 'GET',
|
|
3395
|
+
qs: localVarQueryParameters,
|
|
3396
|
+
headers: localVarHeaderParams,
|
|
3397
|
+
uri: localVarPath,
|
|
3398
|
+
useQuerystring: this._useQuerystring,
|
|
3399
|
+
json: true,
|
|
3400
|
+
};
|
|
3401
|
+
|
|
3402
|
+
let authenticationPromise = Promise.resolve();
|
|
3403
|
+
if (this.authentications.token.accessToken) {
|
|
3404
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3405
|
+
this.authentications.token.applyToRequest(
|
|
3406
|
+
localVarRequestOptions
|
|
3407
|
+
)
|
|
3408
|
+
);
|
|
3409
|
+
}
|
|
3410
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3411
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
3412
|
+
);
|
|
3413
|
+
|
|
3414
|
+
let interceptorPromise = authenticationPromise;
|
|
3415
|
+
for (const interceptor of this.interceptors) {
|
|
3416
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
3417
|
+
interceptor(localVarRequestOptions)
|
|
3418
|
+
);
|
|
3419
|
+
}
|
|
3420
|
+
|
|
3421
|
+
return interceptorPromise.then(() => {
|
|
3422
|
+
if (Object.keys(localVarFormParams).length) {
|
|
3423
|
+
if (localVarUseFormData) {
|
|
3424
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
3425
|
+
} else {
|
|
3426
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
3427
|
+
}
|
|
3428
|
+
}
|
|
3429
|
+
return new Promise<{
|
|
3430
|
+
response: http.IncomingMessage;
|
|
3431
|
+
body: ListSuppressions200Response;
|
|
3432
|
+
}>((resolve, reject) => {
|
|
3433
|
+
localVarRequest(
|
|
3434
|
+
localVarRequestOptions,
|
|
3435
|
+
(error, response, body) => {
|
|
3436
|
+
if (error) {
|
|
3437
|
+
reject(error);
|
|
3438
|
+
} else {
|
|
3439
|
+
if (
|
|
3440
|
+
response.statusCode &&
|
|
3441
|
+
response.statusCode >= 200 &&
|
|
3442
|
+
response.statusCode <= 299
|
|
3443
|
+
) {
|
|
3444
|
+
body = ObjectSerializer.deserialize(
|
|
3445
|
+
body,
|
|
3446
|
+
'ListSuppressions200Response'
|
|
3447
|
+
);
|
|
3448
|
+
resolve({ response: response, body: body });
|
|
3449
|
+
} else {
|
|
3450
|
+
reject(
|
|
3451
|
+
new HttpError(
|
|
3452
|
+
response,
|
|
3453
|
+
body,
|
|
3454
|
+
response.statusCode
|
|
3455
|
+
)
|
|
3456
|
+
);
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
);
|
|
3461
|
+
});
|
|
3462
|
+
});
|
|
3463
|
+
}
|
|
3464
|
+
/**
|
|
3465
|
+
* Lists all suppressions in a given Workspace.
|
|
3466
|
+
* @summary List Suppressions
|
|
3467
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
3468
|
+
*/
|
|
3469
|
+
public async listSuppressionsCurrent(
|
|
3470
|
+
pagination: PaginationInput,
|
|
3471
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
3472
|
+
): Promise<{
|
|
3473
|
+
response: http.IncomingMessage;
|
|
3474
|
+
body: ListSuppressions200Response;
|
|
3475
|
+
}> {
|
|
3476
|
+
const localVarPath = this.basePath + '/suppressions';
|
|
3477
|
+
let localVarQueryParameters: any = {};
|
|
3478
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
3479
|
+
{},
|
|
3480
|
+
this._defaultHeaders
|
|
3481
|
+
);
|
|
3482
|
+
const produces = ['application/json'];
|
|
3483
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
3484
|
+
localVarHeaderParams.Accept = produces[0];
|
|
3485
|
+
} else {
|
|
3486
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
3487
|
+
}
|
|
3488
|
+
let localVarFormParams: any = {};
|
|
3489
|
+
|
|
3490
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
3491
|
+
if (pagination === null || pagination === undefined) {
|
|
3492
|
+
throw new Error(
|
|
3493
|
+
'Required parameter pagination was null or undefined when calling listSuppressionsCurrent.'
|
|
3494
|
+
);
|
|
3495
|
+
}
|
|
3496
|
+
|
|
3497
|
+
if (pagination !== undefined) {
|
|
3498
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
3499
|
+
pagination,
|
|
3500
|
+
'PaginationInput'
|
|
3501
|
+
);
|
|
3502
|
+
}
|
|
3503
|
+
|
|
3504
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
3505
|
+
|
|
3506
|
+
let localVarUseFormData = false;
|
|
3507
|
+
|
|
3508
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
3509
|
+
method: 'GET',
|
|
3510
|
+
qs: localVarQueryParameters,
|
|
3511
|
+
headers: localVarHeaderParams,
|
|
3512
|
+
uri: localVarPath,
|
|
3513
|
+
useQuerystring: this._useQuerystring,
|
|
3514
|
+
json: true,
|
|
3515
|
+
};
|
|
3516
|
+
|
|
3517
|
+
let authenticationPromise = Promise.resolve();
|
|
3518
|
+
if (this.authentications.token.accessToken) {
|
|
3519
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3520
|
+
this.authentications.token.applyToRequest(
|
|
3521
|
+
localVarRequestOptions
|
|
3522
|
+
)
|
|
3523
|
+
);
|
|
3524
|
+
}
|
|
3525
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3526
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
3527
|
+
);
|
|
3528
|
+
|
|
3529
|
+
let interceptorPromise = authenticationPromise;
|
|
3530
|
+
for (const interceptor of this.interceptors) {
|
|
3531
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
3532
|
+
interceptor(localVarRequestOptions)
|
|
3533
|
+
);
|
|
3534
|
+
}
|
|
3535
|
+
|
|
3536
|
+
return interceptorPromise.then(() => {
|
|
3537
|
+
if (Object.keys(localVarFormParams).length) {
|
|
3538
|
+
if (localVarUseFormData) {
|
|
3539
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
3540
|
+
} else {
|
|
3541
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
return new Promise<{
|
|
3545
|
+
response: http.IncomingMessage;
|
|
3546
|
+
body: ListSuppressions200Response;
|
|
3547
|
+
}>((resolve, reject) => {
|
|
3548
|
+
localVarRequest(
|
|
3549
|
+
localVarRequestOptions,
|
|
3550
|
+
(error, response, body) => {
|
|
3551
|
+
if (error) {
|
|
3552
|
+
reject(error);
|
|
3553
|
+
} else {
|
|
3554
|
+
if (
|
|
3555
|
+
response.statusCode &&
|
|
3556
|
+
response.statusCode >= 200 &&
|
|
3557
|
+
response.statusCode <= 299
|
|
3558
|
+
) {
|
|
3559
|
+
body = ObjectSerializer.deserialize(
|
|
3560
|
+
body,
|
|
3561
|
+
'ListSuppressions200Response'
|
|
3562
|
+
);
|
|
3563
|
+
resolve({ response: response, body: body });
|
|
3564
|
+
} else {
|
|
3565
|
+
reject(
|
|
3566
|
+
new HttpError(
|
|
3567
|
+
response,
|
|
3568
|
+
body,
|
|
3569
|
+
response.statusCode
|
|
3570
|
+
)
|
|
3571
|
+
);
|
|
3572
|
+
}
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
);
|
|
3576
|
+
});
|
|
3577
|
+
});
|
|
3578
|
+
}
|
|
3579
|
+
/**
|
|
3580
|
+
* Lists all suppressions in a given Workspace.
|
|
3581
|
+
* @summary List Suppressions
|
|
3582
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
3583
|
+
*/
|
|
3584
|
+
public async listSuppressionsV1(
|
|
3585
|
+
pagination: PaginationInput,
|
|
3586
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
3587
|
+
): Promise<{
|
|
3588
|
+
response: http.IncomingMessage;
|
|
3589
|
+
body: ListSuppressions200Response;
|
|
3590
|
+
}> {
|
|
3591
|
+
const localVarPath = this.basePath + '/suppressions';
|
|
3592
|
+
let localVarQueryParameters: any = {};
|
|
3593
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
3594
|
+
{},
|
|
3595
|
+
this._defaultHeaders
|
|
3596
|
+
);
|
|
3597
|
+
const produces = [
|
|
3598
|
+
'application/vnd.segment.v1+json',
|
|
3599
|
+
'application/json',
|
|
3600
|
+
];
|
|
3601
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
3602
|
+
localVarHeaderParams.Accept = produces[0];
|
|
3603
|
+
} else {
|
|
3604
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
3605
|
+
}
|
|
3606
|
+
let localVarFormParams: any = {};
|
|
3607
|
+
|
|
3608
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
3609
|
+
if (pagination === null || pagination === undefined) {
|
|
3610
|
+
throw new Error(
|
|
3611
|
+
'Required parameter pagination was null or undefined when calling listSuppressionsV1.'
|
|
3612
|
+
);
|
|
3613
|
+
}
|
|
3614
|
+
|
|
3615
|
+
if (pagination !== undefined) {
|
|
3616
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
3617
|
+
pagination,
|
|
3618
|
+
'PaginationInput'
|
|
3619
|
+
);
|
|
3620
|
+
}
|
|
3621
|
+
|
|
3622
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
3623
|
+
|
|
3624
|
+
let localVarUseFormData = false;
|
|
3625
|
+
|
|
3626
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
3627
|
+
method: 'GET',
|
|
3628
|
+
qs: localVarQueryParameters,
|
|
3629
|
+
headers: localVarHeaderParams,
|
|
3630
|
+
uri: localVarPath,
|
|
3631
|
+
useQuerystring: this._useQuerystring,
|
|
3632
|
+
json: true,
|
|
3633
|
+
};
|
|
3634
|
+
|
|
3635
|
+
let authenticationPromise = Promise.resolve();
|
|
3636
|
+
if (this.authentications.token.accessToken) {
|
|
3637
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3638
|
+
this.authentications.token.applyToRequest(
|
|
3639
|
+
localVarRequestOptions
|
|
3640
|
+
)
|
|
3641
|
+
);
|
|
3642
|
+
}
|
|
3643
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3644
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
3645
|
+
);
|
|
3646
|
+
|
|
3647
|
+
let interceptorPromise = authenticationPromise;
|
|
3648
|
+
for (const interceptor of this.interceptors) {
|
|
3649
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
3650
|
+
interceptor(localVarRequestOptions)
|
|
3651
|
+
);
|
|
3652
|
+
}
|
|
3653
|
+
|
|
3654
|
+
return interceptorPromise.then(() => {
|
|
3655
|
+
if (Object.keys(localVarFormParams).length) {
|
|
3656
|
+
if (localVarUseFormData) {
|
|
3657
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
3658
|
+
} else {
|
|
3659
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
3660
|
+
}
|
|
3661
|
+
}
|
|
3662
|
+
return new Promise<{
|
|
3663
|
+
response: http.IncomingMessage;
|
|
3664
|
+
body: ListSuppressions200Response;
|
|
3665
|
+
}>((resolve, reject) => {
|
|
3666
|
+
localVarRequest(
|
|
3667
|
+
localVarRequestOptions,
|
|
3668
|
+
(error, response, body) => {
|
|
3669
|
+
if (error) {
|
|
3670
|
+
reject(error);
|
|
3671
|
+
} else {
|
|
3672
|
+
if (
|
|
3673
|
+
response.statusCode &&
|
|
3674
|
+
response.statusCode >= 200 &&
|
|
3675
|
+
response.statusCode <= 299
|
|
3676
|
+
) {
|
|
3677
|
+
body = ObjectSerializer.deserialize(
|
|
3678
|
+
body,
|
|
3679
|
+
'ListSuppressions200Response'
|
|
3680
|
+
);
|
|
3681
|
+
resolve({ response: response, body: body });
|
|
3682
|
+
} else {
|
|
3683
|
+
reject(
|
|
3684
|
+
new HttpError(
|
|
3685
|
+
response,
|
|
3686
|
+
body,
|
|
3687
|
+
response.statusCode
|
|
3688
|
+
)
|
|
3689
|
+
);
|
|
3690
|
+
}
|
|
3691
|
+
}
|
|
3692
|
+
}
|
|
3693
|
+
);
|
|
3694
|
+
});
|
|
3695
|
+
});
|
|
3696
|
+
}
|
|
3697
|
+
/**
|
|
3698
|
+
* Lists all Workspace-scoped regulations.
|
|
3699
|
+
* @summary List Workspace Regulations
|
|
3700
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
3701
|
+
* @param status The status on which to filter the returned regulations. This parameter exists in alpha.
|
|
3702
|
+
* @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha.
|
|
3703
|
+
*/
|
|
3704
|
+
public async listWorkspaceRegulationsAlpha(
|
|
3705
|
+
pagination: PaginationInput,
|
|
3706
|
+
status?:
|
|
3707
|
+
| 'FAILED'
|
|
3708
|
+
| 'FINISHED'
|
|
3709
|
+
| 'INITIALIZED'
|
|
3710
|
+
| 'INVALID'
|
|
3711
|
+
| 'NOT_SUPPORTED'
|
|
3712
|
+
| 'PARTIAL_SUCCESS'
|
|
3713
|
+
| 'RUNNING',
|
|
3714
|
+
regulationTypes?: Array<
|
|
3715
|
+
| 'BULK_DELETE_ONLY'
|
|
3716
|
+
| 'DELETE_INTERNAL'
|
|
3717
|
+
| 'DELETE_ONLY'
|
|
3718
|
+
| 'SUPPRESS_ONLY'
|
|
3719
|
+
| 'SUPPRESS_WITH_DELETE'
|
|
3720
|
+
| 'UNSUPPRESS'
|
|
3721
|
+
>,
|
|
3722
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
3723
|
+
): Promise<{
|
|
3724
|
+
response: http.IncomingMessage;
|
|
3725
|
+
body: ListWorkspaceRegulations200Response;
|
|
3726
|
+
}> {
|
|
3727
|
+
const localVarPath = this.basePath + '/regulations';
|
|
3728
|
+
let localVarQueryParameters: any = {};
|
|
3729
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
3730
|
+
{},
|
|
3731
|
+
this._defaultHeaders
|
|
3732
|
+
);
|
|
3733
|
+
const produces = [
|
|
3734
|
+
'application/vnd.segment.v1alpha+json',
|
|
3735
|
+
'application/json',
|
|
3736
|
+
];
|
|
3737
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
3738
|
+
localVarHeaderParams.Accept = produces[0];
|
|
3739
|
+
} else {
|
|
3740
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
3741
|
+
}
|
|
3742
|
+
let localVarFormParams: any = {};
|
|
3743
|
+
|
|
3744
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
3745
|
+
if (pagination === null || pagination === undefined) {
|
|
3746
|
+
throw new Error(
|
|
3747
|
+
'Required parameter pagination was null or undefined when calling listWorkspaceRegulationsAlpha.'
|
|
3748
|
+
);
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
if (status !== undefined) {
|
|
3752
|
+
localVarQueryParameters['status'] = ObjectSerializer.serialize(
|
|
3753
|
+
status,
|
|
3754
|
+
"'FAILED' | 'FINISHED' | 'INITIALIZED' | 'INVALID' | 'NOT_SUPPORTED' | 'PARTIAL_SUCCESS' | 'RUNNING'"
|
|
3755
|
+
);
|
|
3756
|
+
}
|
|
3757
|
+
|
|
3758
|
+
if (regulationTypes !== undefined) {
|
|
3759
|
+
localVarQueryParameters['regulationTypes'] =
|
|
3760
|
+
ObjectSerializer.serialize(
|
|
3761
|
+
regulationTypes,
|
|
3762
|
+
"Array<'BULK_DELETE_ONLY' | 'DELETE_INTERNAL' | 'DELETE_ONLY' | 'SUPPRESS_ONLY' | 'SUPPRESS_WITH_DELETE' | 'UNSUPPRESS'>"
|
|
3763
|
+
);
|
|
3764
|
+
}
|
|
3765
|
+
|
|
3766
|
+
if (pagination !== undefined) {
|
|
3767
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
3768
|
+
pagination,
|
|
3769
|
+
'PaginationInput'
|
|
3770
|
+
);
|
|
3771
|
+
}
|
|
3772
|
+
|
|
3773
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
3774
|
+
|
|
3775
|
+
let localVarUseFormData = false;
|
|
3776
|
+
|
|
3777
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
3778
|
+
method: 'GET',
|
|
3779
|
+
qs: localVarQueryParameters,
|
|
3780
|
+
headers: localVarHeaderParams,
|
|
3781
|
+
uri: localVarPath,
|
|
3782
|
+
useQuerystring: this._useQuerystring,
|
|
3783
|
+
json: true,
|
|
3784
|
+
};
|
|
3785
|
+
|
|
3786
|
+
let authenticationPromise = Promise.resolve();
|
|
3787
|
+
if (this.authentications.token.accessToken) {
|
|
3788
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3789
|
+
this.authentications.token.applyToRequest(
|
|
3790
|
+
localVarRequestOptions
|
|
3791
|
+
)
|
|
3792
|
+
);
|
|
3793
|
+
}
|
|
3794
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3795
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
3796
|
+
);
|
|
3797
|
+
|
|
3798
|
+
let interceptorPromise = authenticationPromise;
|
|
3799
|
+
for (const interceptor of this.interceptors) {
|
|
3800
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
3801
|
+
interceptor(localVarRequestOptions)
|
|
3802
|
+
);
|
|
3803
|
+
}
|
|
3804
|
+
|
|
3805
|
+
return interceptorPromise.then(() => {
|
|
3806
|
+
if (Object.keys(localVarFormParams).length) {
|
|
3807
|
+
if (localVarUseFormData) {
|
|
3808
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
3809
|
+
} else {
|
|
3810
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
3811
|
+
}
|
|
3812
|
+
}
|
|
3813
|
+
return new Promise<{
|
|
3814
|
+
response: http.IncomingMessage;
|
|
3815
|
+
body: ListWorkspaceRegulations200Response;
|
|
3816
|
+
}>((resolve, reject) => {
|
|
3817
|
+
localVarRequest(
|
|
3818
|
+
localVarRequestOptions,
|
|
3819
|
+
(error, response, body) => {
|
|
3820
|
+
if (error) {
|
|
3821
|
+
reject(error);
|
|
3822
|
+
} else {
|
|
3823
|
+
if (
|
|
3824
|
+
response.statusCode &&
|
|
3825
|
+
response.statusCode >= 200 &&
|
|
3826
|
+
response.statusCode <= 299
|
|
3827
|
+
) {
|
|
3828
|
+
body = ObjectSerializer.deserialize(
|
|
3829
|
+
body,
|
|
3830
|
+
'ListWorkspaceRegulations200Response'
|
|
3831
|
+
);
|
|
3832
|
+
resolve({ response: response, body: body });
|
|
3833
|
+
} else {
|
|
3834
|
+
reject(
|
|
3835
|
+
new HttpError(
|
|
3836
|
+
response,
|
|
3837
|
+
body,
|
|
3838
|
+
response.statusCode
|
|
3839
|
+
)
|
|
3840
|
+
);
|
|
3841
|
+
}
|
|
3842
|
+
}
|
|
3843
|
+
}
|
|
3844
|
+
);
|
|
3845
|
+
});
|
|
3846
|
+
});
|
|
3847
|
+
}
|
|
3848
|
+
/**
|
|
3849
|
+
* Lists all Workspace-scoped regulations.
|
|
3850
|
+
* @summary List Workspace Regulations
|
|
3851
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
3852
|
+
* @param status The status on which to filter the returned regulations. This parameter exists in alpha.
|
|
3853
|
+
* @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha.
|
|
3854
|
+
*/
|
|
3855
|
+
public async listWorkspaceRegulationsBeta(
|
|
3856
|
+
pagination: PaginationInput,
|
|
3857
|
+
status?:
|
|
3858
|
+
| 'FAILED'
|
|
3859
|
+
| 'FINISHED'
|
|
3860
|
+
| 'INITIALIZED'
|
|
3861
|
+
| 'INVALID'
|
|
3862
|
+
| 'NOT_SUPPORTED'
|
|
3863
|
+
| 'PARTIAL_SUCCESS'
|
|
3864
|
+
| 'RUNNING',
|
|
3865
|
+
regulationTypes?: Array<
|
|
3866
|
+
| 'BULK_DELETE_ONLY'
|
|
3867
|
+
| 'DELETE_INTERNAL'
|
|
3868
|
+
| 'DELETE_ONLY'
|
|
3869
|
+
| 'SUPPRESS_ONLY'
|
|
3870
|
+
| 'SUPPRESS_WITH_DELETE'
|
|
3871
|
+
| 'UNSUPPRESS'
|
|
3872
|
+
>,
|
|
3873
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
3874
|
+
): Promise<{
|
|
3875
|
+
response: http.IncomingMessage;
|
|
3876
|
+
body: ListWorkspaceRegulations200Response;
|
|
3877
|
+
}> {
|
|
3878
|
+
const localVarPath = this.basePath + '/regulations';
|
|
3879
|
+
let localVarQueryParameters: any = {};
|
|
3880
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
3881
|
+
{},
|
|
3882
|
+
this._defaultHeaders
|
|
3883
|
+
);
|
|
3884
|
+
const produces = [
|
|
3885
|
+
'application/vnd.segment.v1beta+json',
|
|
3886
|
+
'application/json',
|
|
3887
|
+
];
|
|
3888
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
3889
|
+
localVarHeaderParams.Accept = produces[0];
|
|
3890
|
+
} else {
|
|
3891
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
3892
|
+
}
|
|
3893
|
+
let localVarFormParams: any = {};
|
|
3894
|
+
|
|
3895
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
3896
|
+
if (pagination === null || pagination === undefined) {
|
|
3897
|
+
throw new Error(
|
|
3898
|
+
'Required parameter pagination was null or undefined when calling listWorkspaceRegulationsBeta.'
|
|
3899
|
+
);
|
|
3900
|
+
}
|
|
3901
|
+
|
|
3902
|
+
if (status !== undefined) {
|
|
3903
|
+
localVarQueryParameters['status'] = ObjectSerializer.serialize(
|
|
3904
|
+
status,
|
|
3905
|
+
"'FAILED' | 'FINISHED' | 'INITIALIZED' | 'INVALID' | 'NOT_SUPPORTED' | 'PARTIAL_SUCCESS' | 'RUNNING'"
|
|
3906
|
+
);
|
|
3907
|
+
}
|
|
3908
|
+
|
|
3909
|
+
if (regulationTypes !== undefined) {
|
|
3910
|
+
localVarQueryParameters['regulationTypes'] =
|
|
3911
|
+
ObjectSerializer.serialize(
|
|
3912
|
+
regulationTypes,
|
|
3913
|
+
"Array<'BULK_DELETE_ONLY' | 'DELETE_INTERNAL' | 'DELETE_ONLY' | 'SUPPRESS_ONLY' | 'SUPPRESS_WITH_DELETE' | 'UNSUPPRESS'>"
|
|
3914
|
+
);
|
|
3915
|
+
}
|
|
3916
|
+
|
|
3917
|
+
if (pagination !== undefined) {
|
|
3918
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
3919
|
+
pagination,
|
|
3920
|
+
'PaginationInput'
|
|
3921
|
+
);
|
|
3922
|
+
}
|
|
3923
|
+
|
|
3924
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
3925
|
+
|
|
3926
|
+
let localVarUseFormData = false;
|
|
3927
|
+
|
|
3928
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
3929
|
+
method: 'GET',
|
|
3930
|
+
qs: localVarQueryParameters,
|
|
3931
|
+
headers: localVarHeaderParams,
|
|
3932
|
+
uri: localVarPath,
|
|
3933
|
+
useQuerystring: this._useQuerystring,
|
|
3934
|
+
json: true,
|
|
3935
|
+
};
|
|
3936
|
+
|
|
3937
|
+
let authenticationPromise = Promise.resolve();
|
|
3938
|
+
if (this.authentications.token.accessToken) {
|
|
3939
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3940
|
+
this.authentications.token.applyToRequest(
|
|
3941
|
+
localVarRequestOptions
|
|
3942
|
+
)
|
|
3943
|
+
);
|
|
3944
|
+
}
|
|
3945
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
3946
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
3947
|
+
);
|
|
3948
|
+
|
|
3949
|
+
let interceptorPromise = authenticationPromise;
|
|
3950
|
+
for (const interceptor of this.interceptors) {
|
|
3951
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
3952
|
+
interceptor(localVarRequestOptions)
|
|
3953
|
+
);
|
|
3954
|
+
}
|
|
3955
|
+
|
|
3956
|
+
return interceptorPromise.then(() => {
|
|
3957
|
+
if (Object.keys(localVarFormParams).length) {
|
|
3958
|
+
if (localVarUseFormData) {
|
|
3959
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
3960
|
+
} else {
|
|
3961
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
3962
|
+
}
|
|
3963
|
+
}
|
|
3964
|
+
return new Promise<{
|
|
3965
|
+
response: http.IncomingMessage;
|
|
3966
|
+
body: ListWorkspaceRegulations200Response;
|
|
3967
|
+
}>((resolve, reject) => {
|
|
3968
|
+
localVarRequest(
|
|
3969
|
+
localVarRequestOptions,
|
|
3970
|
+
(error, response, body) => {
|
|
3971
|
+
if (error) {
|
|
3972
|
+
reject(error);
|
|
3973
|
+
} else {
|
|
3974
|
+
if (
|
|
3975
|
+
response.statusCode &&
|
|
3976
|
+
response.statusCode >= 200 &&
|
|
3977
|
+
response.statusCode <= 299
|
|
3978
|
+
) {
|
|
3979
|
+
body = ObjectSerializer.deserialize(
|
|
3980
|
+
body,
|
|
3981
|
+
'ListWorkspaceRegulations200Response'
|
|
3982
|
+
);
|
|
3983
|
+
resolve({ response: response, body: body });
|
|
3984
|
+
} else {
|
|
3985
|
+
reject(
|
|
3986
|
+
new HttpError(
|
|
3987
|
+
response,
|
|
3988
|
+
body,
|
|
3989
|
+
response.statusCode
|
|
3990
|
+
)
|
|
3991
|
+
);
|
|
3992
|
+
}
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3995
|
+
);
|
|
3996
|
+
});
|
|
3997
|
+
});
|
|
3998
|
+
}
|
|
3999
|
+
/**
|
|
4000
|
+
* Lists all Workspace-scoped regulations.
|
|
4001
|
+
* @summary List Workspace Regulations
|
|
4002
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
4003
|
+
* @param status The status on which to filter the returned regulations. This parameter exists in alpha.
|
|
4004
|
+
* @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha.
|
|
4005
|
+
*/
|
|
4006
|
+
public async listWorkspaceRegulationsCurrent(
|
|
4007
|
+
pagination: PaginationInput,
|
|
4008
|
+
status?:
|
|
4009
|
+
| 'FAILED'
|
|
4010
|
+
| 'FINISHED'
|
|
4011
|
+
| 'INITIALIZED'
|
|
4012
|
+
| 'INVALID'
|
|
4013
|
+
| 'NOT_SUPPORTED'
|
|
4014
|
+
| 'PARTIAL_SUCCESS'
|
|
4015
|
+
| 'RUNNING',
|
|
4016
|
+
regulationTypes?: Array<
|
|
4017
|
+
| 'BULK_DELETE_ONLY'
|
|
4018
|
+
| 'DELETE_INTERNAL'
|
|
4019
|
+
| 'DELETE_ONLY'
|
|
4020
|
+
| 'SUPPRESS_ONLY'
|
|
4021
|
+
| 'SUPPRESS_WITH_DELETE'
|
|
4022
|
+
| 'UNSUPPRESS'
|
|
4023
|
+
>,
|
|
4024
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
4025
|
+
): Promise<{
|
|
4026
|
+
response: http.IncomingMessage;
|
|
4027
|
+
body: ListWorkspaceRegulations200Response;
|
|
4028
|
+
}> {
|
|
4029
|
+
const localVarPath = this.basePath + '/regulations';
|
|
4030
|
+
let localVarQueryParameters: any = {};
|
|
4031
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
4032
|
+
{},
|
|
4033
|
+
this._defaultHeaders
|
|
4034
|
+
);
|
|
4035
|
+
const produces = ['application/json'];
|
|
4036
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
4037
|
+
localVarHeaderParams.Accept = produces[0];
|
|
4038
|
+
} else {
|
|
4039
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
4040
|
+
}
|
|
4041
|
+
let localVarFormParams: any = {};
|
|
4042
|
+
|
|
4043
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
4044
|
+
if (pagination === null || pagination === undefined) {
|
|
4045
|
+
throw new Error(
|
|
4046
|
+
'Required parameter pagination was null or undefined when calling listWorkspaceRegulationsCurrent.'
|
|
4047
|
+
);
|
|
4048
|
+
}
|
|
4049
|
+
|
|
4050
|
+
if (status !== undefined) {
|
|
4051
|
+
localVarQueryParameters['status'] = ObjectSerializer.serialize(
|
|
4052
|
+
status,
|
|
4053
|
+
"'FAILED' | 'FINISHED' | 'INITIALIZED' | 'INVALID' | 'NOT_SUPPORTED' | 'PARTIAL_SUCCESS' | 'RUNNING'"
|
|
4054
|
+
);
|
|
4055
|
+
}
|
|
4056
|
+
|
|
4057
|
+
if (regulationTypes !== undefined) {
|
|
4058
|
+
localVarQueryParameters['regulationTypes'] =
|
|
4059
|
+
ObjectSerializer.serialize(
|
|
4060
|
+
regulationTypes,
|
|
4061
|
+
"Array<'BULK_DELETE_ONLY' | 'DELETE_INTERNAL' | 'DELETE_ONLY' | 'SUPPRESS_ONLY' | 'SUPPRESS_WITH_DELETE' | 'UNSUPPRESS'>"
|
|
4062
|
+
);
|
|
4063
|
+
}
|
|
4064
|
+
|
|
4065
|
+
if (pagination !== undefined) {
|
|
4066
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
4067
|
+
pagination,
|
|
4068
|
+
'PaginationInput'
|
|
4069
|
+
);
|
|
4070
|
+
}
|
|
4071
|
+
|
|
4072
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
4073
|
+
|
|
4074
|
+
let localVarUseFormData = false;
|
|
4075
|
+
|
|
4076
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
4077
|
+
method: 'GET',
|
|
4078
|
+
qs: localVarQueryParameters,
|
|
4079
|
+
headers: localVarHeaderParams,
|
|
4080
|
+
uri: localVarPath,
|
|
4081
|
+
useQuerystring: this._useQuerystring,
|
|
4082
|
+
json: true,
|
|
4083
|
+
};
|
|
4084
|
+
|
|
4085
|
+
let authenticationPromise = Promise.resolve();
|
|
4086
|
+
if (this.authentications.token.accessToken) {
|
|
4087
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
4088
|
+
this.authentications.token.applyToRequest(
|
|
4089
|
+
localVarRequestOptions
|
|
4090
|
+
)
|
|
4091
|
+
);
|
|
4092
|
+
}
|
|
4093
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
4094
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
4095
|
+
);
|
|
4096
|
+
|
|
4097
|
+
let interceptorPromise = authenticationPromise;
|
|
4098
|
+
for (const interceptor of this.interceptors) {
|
|
4099
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
4100
|
+
interceptor(localVarRequestOptions)
|
|
4101
|
+
);
|
|
4102
|
+
}
|
|
4103
|
+
|
|
4104
|
+
return interceptorPromise.then(() => {
|
|
4105
|
+
if (Object.keys(localVarFormParams).length) {
|
|
4106
|
+
if (localVarUseFormData) {
|
|
4107
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
4108
|
+
} else {
|
|
4109
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4112
|
+
return new Promise<{
|
|
4113
|
+
response: http.IncomingMessage;
|
|
4114
|
+
body: ListWorkspaceRegulations200Response;
|
|
4115
|
+
}>((resolve, reject) => {
|
|
4116
|
+
localVarRequest(
|
|
4117
|
+
localVarRequestOptions,
|
|
4118
|
+
(error, response, body) => {
|
|
4119
|
+
if (error) {
|
|
4120
|
+
reject(error);
|
|
4121
|
+
} else {
|
|
4122
|
+
if (
|
|
4123
|
+
response.statusCode &&
|
|
4124
|
+
response.statusCode >= 200 &&
|
|
4125
|
+
response.statusCode <= 299
|
|
4126
|
+
) {
|
|
4127
|
+
body = ObjectSerializer.deserialize(
|
|
4128
|
+
body,
|
|
4129
|
+
'ListWorkspaceRegulations200Response'
|
|
4130
|
+
);
|
|
4131
|
+
resolve({ response: response, body: body });
|
|
4132
|
+
} else {
|
|
4133
|
+
reject(
|
|
4134
|
+
new HttpError(
|
|
4135
|
+
response,
|
|
4136
|
+
body,
|
|
4137
|
+
response.statusCode
|
|
4138
|
+
)
|
|
4139
|
+
);
|
|
4140
|
+
}
|
|
4141
|
+
}
|
|
4142
|
+
}
|
|
4143
|
+
);
|
|
4144
|
+
});
|
|
4145
|
+
});
|
|
4146
|
+
}
|
|
4147
|
+
/**
|
|
4148
|
+
* Lists all Workspace-scoped regulations.
|
|
4149
|
+
* @summary List Workspace Regulations
|
|
4150
|
+
* @param pagination Pagination parameters. This parameter exists in alpha.
|
|
4151
|
+
* @param status The status on which to filter the returned regulations. This parameter exists in alpha.
|
|
4152
|
+
* @param regulationTypes The regulation types on which to filter returned regulations. This parameter exists in alpha.
|
|
4153
|
+
*/
|
|
4154
|
+
public async listWorkspaceRegulationsV1(
|
|
4155
|
+
pagination: PaginationInput,
|
|
4156
|
+
status?:
|
|
4157
|
+
| 'FAILED'
|
|
4158
|
+
| 'FINISHED'
|
|
4159
|
+
| 'INITIALIZED'
|
|
4160
|
+
| 'INVALID'
|
|
4161
|
+
| 'NOT_SUPPORTED'
|
|
4162
|
+
| 'PARTIAL_SUCCESS'
|
|
4163
|
+
| 'RUNNING',
|
|
4164
|
+
regulationTypes?: Array<
|
|
4165
|
+
| 'BULK_DELETE_ONLY'
|
|
4166
|
+
| 'DELETE_INTERNAL'
|
|
4167
|
+
| 'DELETE_ONLY'
|
|
4168
|
+
| 'SUPPRESS_ONLY'
|
|
4169
|
+
| 'SUPPRESS_WITH_DELETE'
|
|
4170
|
+
| 'UNSUPPRESS'
|
|
4171
|
+
>,
|
|
4172
|
+
options: { headers: { [name: string]: string } } = { headers: {} }
|
|
4173
|
+
): Promise<{
|
|
4174
|
+
response: http.IncomingMessage;
|
|
4175
|
+
body: ListWorkspaceRegulations200Response;
|
|
4176
|
+
}> {
|
|
4177
|
+
const localVarPath = this.basePath + '/regulations';
|
|
4178
|
+
let localVarQueryParameters: any = {};
|
|
4179
|
+
let localVarHeaderParams: any = (<any>Object).assign(
|
|
4180
|
+
{},
|
|
4181
|
+
this._defaultHeaders
|
|
4182
|
+
);
|
|
4183
|
+
const produces = [
|
|
4184
|
+
'application/vnd.segment.v1+json',
|
|
4185
|
+
'application/json',
|
|
4186
|
+
];
|
|
4187
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
4188
|
+
localVarHeaderParams.Accept = produces[0];
|
|
4189
|
+
} else {
|
|
4190
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
4191
|
+
}
|
|
4192
|
+
let localVarFormParams: any = {};
|
|
4193
|
+
|
|
4194
|
+
// verify required parameter 'pagination' is not null or undefined
|
|
4195
|
+
if (pagination === null || pagination === undefined) {
|
|
4196
|
+
throw new Error(
|
|
4197
|
+
'Required parameter pagination was null or undefined when calling listWorkspaceRegulationsV1.'
|
|
4198
|
+
);
|
|
4199
|
+
}
|
|
4200
|
+
|
|
4201
|
+
if (status !== undefined) {
|
|
4202
|
+
localVarQueryParameters['status'] = ObjectSerializer.serialize(
|
|
4203
|
+
status,
|
|
4204
|
+
"'FAILED' | 'FINISHED' | 'INITIALIZED' | 'INVALID' | 'NOT_SUPPORTED' | 'PARTIAL_SUCCESS' | 'RUNNING'"
|
|
4205
|
+
);
|
|
4206
|
+
}
|
|
4207
|
+
|
|
4208
|
+
if (regulationTypes !== undefined) {
|
|
4209
|
+
localVarQueryParameters['regulationTypes'] =
|
|
4210
|
+
ObjectSerializer.serialize(
|
|
4211
|
+
regulationTypes,
|
|
4212
|
+
"Array<'BULK_DELETE_ONLY' | 'DELETE_INTERNAL' | 'DELETE_ONLY' | 'SUPPRESS_ONLY' | 'SUPPRESS_WITH_DELETE' | 'UNSUPPRESS'>"
|
|
4213
|
+
);
|
|
4214
|
+
}
|
|
4215
|
+
|
|
4216
|
+
if (pagination !== undefined) {
|
|
4217
|
+
localVarQueryParameters['pagination'] = ObjectSerializer.serialize(
|
|
4218
|
+
pagination,
|
|
4219
|
+
'PaginationInput'
|
|
4220
|
+
);
|
|
4221
|
+
}
|
|
4222
|
+
|
|
4223
|
+
(<any>Object).assign(localVarHeaderParams, options.headers);
|
|
4224
|
+
|
|
4225
|
+
let localVarUseFormData = false;
|
|
4226
|
+
|
|
4227
|
+
let localVarRequestOptions: localVarRequest.Options = {
|
|
4228
|
+
method: 'GET',
|
|
4229
|
+
qs: localVarQueryParameters,
|
|
4230
|
+
headers: localVarHeaderParams,
|
|
4231
|
+
uri: localVarPath,
|
|
4232
|
+
useQuerystring: this._useQuerystring,
|
|
4233
|
+
json: true,
|
|
4234
|
+
};
|
|
4235
|
+
|
|
4236
|
+
let authenticationPromise = Promise.resolve();
|
|
4237
|
+
if (this.authentications.token.accessToken) {
|
|
4238
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
4239
|
+
this.authentications.token.applyToRequest(
|
|
4240
|
+
localVarRequestOptions
|
|
4241
|
+
)
|
|
4242
|
+
);
|
|
4243
|
+
}
|
|
4244
|
+
authenticationPromise = authenticationPromise.then(() =>
|
|
4245
|
+
this.authentications.default.applyToRequest(localVarRequestOptions)
|
|
4246
|
+
);
|
|
4247
|
+
|
|
4248
|
+
let interceptorPromise = authenticationPromise;
|
|
4249
|
+
for (const interceptor of this.interceptors) {
|
|
4250
|
+
interceptorPromise = interceptorPromise.then(() =>
|
|
4251
|
+
interceptor(localVarRequestOptions)
|
|
4252
|
+
);
|
|
4253
|
+
}
|
|
4254
|
+
|
|
4255
|
+
return interceptorPromise.then(() => {
|
|
4256
|
+
if (Object.keys(localVarFormParams).length) {
|
|
4257
|
+
if (localVarUseFormData) {
|
|
4258
|
+
(<any>localVarRequestOptions).formData = localVarFormParams;
|
|
4259
|
+
} else {
|
|
4260
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
4261
|
+
}
|
|
4262
|
+
}
|
|
4263
|
+
return new Promise<{
|
|
4264
|
+
response: http.IncomingMessage;
|
|
4265
|
+
body: ListWorkspaceRegulations200Response;
|
|
4266
|
+
}>((resolve, reject) => {
|
|
4267
|
+
localVarRequest(
|
|
4268
|
+
localVarRequestOptions,
|
|
4269
|
+
(error, response, body) => {
|
|
4270
|
+
if (error) {
|
|
4271
|
+
reject(error);
|
|
4272
|
+
} else {
|
|
4273
|
+
if (
|
|
4274
|
+
response.statusCode &&
|
|
4275
|
+
response.statusCode >= 200 &&
|
|
4276
|
+
response.statusCode <= 299
|
|
4277
|
+
) {
|
|
4278
|
+
body = ObjectSerializer.deserialize(
|
|
4279
|
+
body,
|
|
4280
|
+
'ListWorkspaceRegulations200Response'
|
|
4281
|
+
);
|
|
4282
|
+
resolve({ response: response, body: body });
|
|
4283
|
+
} else {
|
|
4284
|
+
reject(
|
|
4285
|
+
new HttpError(
|
|
4286
|
+
response,
|
|
4287
|
+
body,
|
|
4288
|
+
response.statusCode
|
|
4289
|
+
)
|
|
4290
|
+
);
|
|
4291
|
+
}
|
|
4292
|
+
}
|
|
4293
|
+
}
|
|
4294
|
+
);
|
|
4295
|
+
});
|
|
4296
|
+
});
|
|
4297
|
+
}
|
|
4298
|
+
}
|