|
5 | 5 |
|
6 | 6 | 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. |
7 | 7 |
|
8 | | - The version of the OpenAPI document: 61.1.4 |
| 8 | + The version of the OpenAPI document: 61.2.0 |
9 | 9 | Contact: friends@segment.com |
10 | 10 | Generated by OpenAPI Generator (https://openapi-generator.tech) |
11 | 11 |
|
|
20 | 20 | frompydanticimportvalidate_arguments,ValidationError |
21 | 21 |
|
22 | 22 | fromtyping_extensionsimportAnnotated |
23 | | -frompydanticimportField,constr |
| 23 | +frompydanticimportField,StrictStr,constr |
24 | 24 |
|
25 | 25 | fromtypingimportOptional |
26 | 26 |
|
|
31 | 31 | fromsegment_public_api.models.get_activation_from_audience200_responseimportGetActivationFromAudience200Response |
32 | 32 | fromsegment_public_api.models.list_activations_from_audience200_responseimportListActivationsFromAudience200Response |
33 | 33 | fromsegment_public_api.models.list_destinations_from_audience200_responseimportListDestinationsFromAudience200Response |
| 34 | +fromsegment_public_api.models.list_supported_destinations_from_audience200_responseimportListSupportedDestinationsFromAudience200Response |
34 | 35 | fromsegment_public_api.models.pagination_inputimportPaginationInput |
35 | 36 | fromsegment_public_api.models.remove_activation_from_audience200_responseimportRemoveActivationFromAudience200Response |
36 | 37 | fromsegment_public_api.models.update_activation_for_audience200_responseimportUpdateActivationForAudience200Response |
@@ -873,6 +874,173 @@ def list_destinations_from_audience_with_http_info(self, space_id : constr(stric |
873 | 874 | collection_formats=_collection_formats, |
874 | 875 | _request_auth=_params.get('_request_auth')) |
875 | 876 |
|
| 877 | +@validate_arguments |
| 878 | +deflist_supported_destinations_from_audience(self,space_id :constr(strict=True),audience_type :constr(strict=True),slug :Annotated[Optional[StrictStr],Field(description="Optional destination slug to filter results. This parameter exists in alpha.")]=None,action_id :Annotated[Optional[StrictStr],Field(description="Optional destination action id to filter results. This parameter exists in alpha.")]=None,**kwargs)->ListSupportedDestinationsFromAudience200Response:# noqa: E501 |
| 879 | +"""List Supported Destinations from Audience # noqa: E501 |
| 880 | +
|
| 881 | + Lists all Supported Destinations for this audience type that can be activated. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Supported Destinations Listed For Audience` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. # noqa: E501 |
| 882 | + This method makes a synchronous HTTP request by default. To make an |
| 883 | + asynchronous HTTP request, please pass async_req=True |
| 884 | +
|
| 885 | + >>> thread = api.list_supported_destinations_from_audience(space_id, audience_type, slug, action_id, async_req=True) |
| 886 | + >>> result = thread.get() |
| 887 | +
|
| 888 | + :param space_id: (required) |
| 889 | + :type space_id: str |
| 890 | + :param audience_type: (required) |
| 891 | + :type audience_type: str |
| 892 | + :param slug: Optional destination slug to filter results. This parameter exists in alpha. |
| 893 | + :type slug: str |
| 894 | + :param action_id: Optional destination action id to filter results. This parameter exists in alpha. |
| 895 | + :type action_id: str |
| 896 | + :param async_req: Whether to execute the request asynchronously. |
| 897 | + :type async_req: bool, optional |
| 898 | + :param _request_timeout: timeout setting for this request. |
| 899 | + If one number provided, it will be total request |
| 900 | + timeout. It can also be a pair (tuple) of |
| 901 | + (connection, read) timeouts. |
| 902 | + :return: Returns the result object. |
| 903 | + If the method is called asynchronously, |
| 904 | + returns the request thread. |
| 905 | + :rtype: ListSupportedDestinationsFromAudience200Response |
| 906 | + """ |
| 907 | +kwargs['_return_http_data_only']=True |
| 908 | +if'_preload_content'inkwargs: |
| 909 | +message="Error! Please call the list_supported_destinations_from_audience_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data"# noqa: E501 |
| 910 | +raiseValueError(message) |
| 911 | +returnself.list_supported_destinations_from_audience_with_http_info(space_id,audience_type,slug,action_id,**kwargs)# noqa: E501 |
| 912 | + |
| 913 | +@validate_arguments |
| 914 | +deflist_supported_destinations_from_audience_with_http_info(self,space_id :constr(strict=True),audience_type :constr(strict=True),slug :Annotated[Optional[StrictStr],Field(description="Optional destination slug to filter results. This parameter exists in alpha.")]=None,action_id :Annotated[Optional[StrictStr],Field(description="Optional destination action id to filter results. This parameter exists in alpha.")]=None,**kwargs)->ApiResponse:# noqa: E501 |
| 915 | +"""List Supported Destinations from Audience # noqa: E501 |
| 916 | +
|
| 917 | + Lists all Supported Destinations for this audience type that can be activated. • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to friends@segment.com. • In order to successfully call this endpoint, the specified Workspace needs to have the Audience feature enabled. Please reach out to your customer success manager for more information. • When called, this endpoint may generate the `Supported Destinations Listed For Audience` event in the [audit trail](/tag/Audit-Trail). The rate limit for this endpoint is 60 requests per minute, which is lower than the default due to access pattern restrictions. Once reached, this endpoint will respond with the 429 HTTP status code with headers indicating the limit parameters. See [Rate Limiting](/#tag/Rate-Limits) for more information. # noqa: E501 |
| 918 | + This method makes a synchronous HTTP request by default. To make an |
| 919 | + asynchronous HTTP request, please pass async_req=True |
| 920 | +
|
| 921 | + >>> thread = api.list_supported_destinations_from_audience_with_http_info(space_id, audience_type, slug, action_id, async_req=True) |
| 922 | + >>> result = thread.get() |
| 923 | +
|
| 924 | + :param space_id: (required) |
| 925 | + :type space_id: str |
| 926 | + :param audience_type: (required) |
| 927 | + :type audience_type: str |
| 928 | + :param slug: Optional destination slug to filter results. This parameter exists in alpha. |
| 929 | + :type slug: str |
| 930 | + :param action_id: Optional destination action id to filter results. This parameter exists in alpha. |
| 931 | + :type action_id: str |
| 932 | + :param async_req: Whether to execute the request asynchronously. |
| 933 | + :type async_req: bool, optional |
| 934 | + :param _preload_content: if False, the ApiResponse.data will |
| 935 | + be set to none and raw_data will store the |
| 936 | + HTTP response body without reading/decoding. |
| 937 | + Default is True. |
| 938 | + :type _preload_content: bool, optional |
| 939 | + :param _return_http_data_only: response data instead of ApiResponse |
| 940 | + object with status code, headers, etc |
| 941 | + :type _return_http_data_only: bool, optional |
| 942 | + :param _request_timeout: timeout setting for this request. If one |
| 943 | + number provided, it will be total request |
| 944 | + timeout. It can also be a pair (tuple) of |
| 945 | + (connection, read) timeouts. |
| 946 | + :param _request_auth: set to override the auth_settings for an a single |
| 947 | + request; this effectively ignores the authentication |
| 948 | + in the spec for a single request. |
| 949 | + :type _request_auth: dict, optional |
| 950 | + :type _content_type: string, optional: force content-type for the request |
| 951 | + :return: Returns the result object. |
| 952 | + If the method is called asynchronously, |
| 953 | + returns the request thread. |
| 954 | + :rtype: tuple(ListSupportedDestinationsFromAudience200Response, status_code(int), headers(HTTPHeaderDict)) |
| 955 | + """ |
| 956 | + |
| 957 | +_params=locals() |
| 958 | + |
| 959 | +_all_params= [ |
| 960 | +'space_id', |
| 961 | +'audience_type', |
| 962 | +'slug', |
| 963 | +'action_id' |
| 964 | + ] |
| 965 | +_all_params.extend( |
| 966 | + [ |
| 967 | +'async_req', |
| 968 | +'_return_http_data_only', |
| 969 | +'_preload_content', |
| 970 | +'_request_timeout', |
| 971 | +'_request_auth', |
| 972 | +'_content_type', |
| 973 | +'_headers' |
| 974 | + ] |
| 975 | + ) |
| 976 | + |
| 977 | +# validate the arguments |
| 978 | +for_key,_valin_params['kwargs'].items(): |
| 979 | +if_keynotin_all_params: |
| 980 | +raiseApiTypeError( |
| 981 | +"Got an unexpected keyword argument '%s'" |
| 982 | +" to method list_supported_destinations_from_audience"%_key |
| 983 | + ) |
| 984 | +_params[_key]=_val |
| 985 | +del_params['kwargs'] |
| 986 | + |
| 987 | +_collection_formats= {} |
| 988 | + |
| 989 | +# process the path parameters |
| 990 | +_path_params= {} |
| 991 | +if_params['space_id']: |
| 992 | +_path_params['spaceId']=_params['space_id'] |
| 993 | + |
| 994 | +if_params['audience_type']: |
| 995 | +_path_params['audienceType']=_params['audience_type'] |
| 996 | + |
| 997 | + |
| 998 | +# process the query parameters |
| 999 | +_query_params= [] |
| 1000 | +if_params.get('slug')isnotNone:# noqa: E501 |
| 1001 | +_query_params.append(('slug',_params['slug'])) |
| 1002 | + |
| 1003 | +if_params.get('action_id')isnotNone:# noqa: E501 |
| 1004 | +_query_params.append(('actionId',_params['action_id'])) |
| 1005 | + |
| 1006 | +# process the header parameters |
| 1007 | +_header_params=dict(_params.get('_headers', {})) |
| 1008 | +# process the form parameters |
| 1009 | +_form_params= [] |
| 1010 | +_files= {} |
| 1011 | +# process the body parameter |
| 1012 | +_body_params=None |
| 1013 | +# set the HTTP header `Accept` |
| 1014 | +_header_params['Accept']=self.api_client.select_header_accept( |
| 1015 | + ['application/vnd.segment.v1alpha+json','application/json'])# noqa: E501 |
| 1016 | + |
| 1017 | +# authentication setting |
| 1018 | +_auth_settings= ['token']# noqa: E501 |
| 1019 | + |
| 1020 | +_response_types_map= { |
| 1021 | +'200':"ListSupportedDestinationsFromAudience200Response", |
| 1022 | +'404':"RequestErrorEnvelope", |
| 1023 | +'422':"RequestErrorEnvelope", |
| 1024 | +'429':"RequestErrorEnvelope", |
| 1025 | + } |
| 1026 | + |
| 1027 | +returnself.api_client.call_api( |
| 1028 | +'/spaces/{spaceId}/audienceType/{audienceType}/supported-destinations','GET', |
| 1029 | +_path_params, |
| 1030 | +_query_params, |
| 1031 | +_header_params, |
| 1032 | +body=_body_params, |
| 1033 | +post_params=_form_params, |
| 1034 | +files=_files, |
| 1035 | +response_types_map=_response_types_map, |
| 1036 | +auth_settings=_auth_settings, |
| 1037 | +async_req=_params.get('async_req'), |
| 1038 | +_return_http_data_only=_params.get('_return_http_data_only'),# noqa: E501 |
| 1039 | +_preload_content=_params.get('_preload_content',True), |
| 1040 | +_request_timeout=_params.get('_request_timeout'), |
| 1041 | +collection_formats=_collection_formats, |
| 1042 | +_request_auth=_params.get('_request_auth')) |
| 1043 | + |
876 | 1044 | @validate_arguments |
877 | 1045 | defremove_activation_from_audience(self,space_id :constr(strict=True),audience_id :constr(strict=True),id :constr(strict=True),**kwargs)->RemoveActivationFromAudience200Response:# noqa: E501 |
878 | 1046 | """Remove Activation from Audience # noqa: E501 |
|