|
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: 59.3.0 |
| 8 | + The version of the OpenAPI document: 59.4.0 |
9 | 9 |
|
10 | 10 | Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11 | 11 |
|
|
24 | 24 |
|
25 | 25 | from typing import Optional
|
26 | 26 |
|
| 27 | +from segment_public_api.models.add_audience_schedule_to_audience200_response import AddAudienceScheduleToAudience200Response |
| 28 | +from segment_public_api.models.add_audience_schedule_to_audience_alpha_input import AddAudienceScheduleToAudienceAlphaInput |
27 | 29 | from segment_public_api.models.create_audience200_response import CreateAudience200Response
|
28 | 30 | from segment_public_api.models.create_audience_beta_input import CreateAudienceBetaInput
|
29 | 31 | from segment_public_api.models.create_audience_preview200_response import CreateAudiencePreview200Response
|
@@ -62,6 +64,172 @@ def __init__(self, api_client=None) -> None:
|
62 | 64 | api_client = ApiClient.get_default()
|
63 | 65 | self.api_client = api_client
|
64 | 66 |
|
| 67 | + @validate_arguments |
| 68 | + def add_audience_schedule_to_audience(self, space_id : constr(strict=True), id : constr(strict=True), add_audience_schedule_to_audience_alpha_input : AddAudienceScheduleToAudienceAlphaInput, **kwargs) -> AddAudienceScheduleToAudience200Response: # noqa: E501 |
| 69 | + """Add Audience Schedule to Audience # noqa: E501 |
| 70 | +
|
| 71 | + The ability to configure the run schedule for an Audience is limited to Linked Audiences (audienceType = LINKED). • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to [email protected]. • 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. # noqa: E501 |
| 72 | + This method makes a synchronous HTTP request by default. To make an |
| 73 | + asynchronous HTTP request, please pass async_req=True |
| 74 | +
|
| 75 | + >>> thread = api.add_audience_schedule_to_audience(space_id, id, add_audience_schedule_to_audience_alpha_input, async_req=True) |
| 76 | + >>> result = thread.get() |
| 77 | +
|
| 78 | + :param space_id: (required) |
| 79 | + :type space_id: str |
| 80 | + :param id: (required) |
| 81 | + :type id: str |
| 82 | + :param add_audience_schedule_to_audience_alpha_input: (required) |
| 83 | + :type add_audience_schedule_to_audience_alpha_input: AddAudienceScheduleToAudienceAlphaInput |
| 84 | + :param async_req: Whether to execute the request asynchronously. |
| 85 | + :type async_req: bool, optional |
| 86 | + :param _request_timeout: timeout setting for this request. |
| 87 | + If one number provided, it will be total request |
| 88 | + timeout. It can also be a pair (tuple) of |
| 89 | + (connection, read) timeouts. |
| 90 | + :return: Returns the result object. |
| 91 | + If the method is called asynchronously, |
| 92 | + returns the request thread. |
| 93 | + :rtype: AddAudienceScheduleToAudience200Response |
| 94 | + """ |
| 95 | + kwargs['_return_http_data_only'] = True |
| 96 | + if '_preload_content' in kwargs: |
| 97 | + message = "Error! Please call the add_audience_schedule_to_audience_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 |
| 98 | + raise ValueError(message) |
| 99 | + return self.add_audience_schedule_to_audience_with_http_info(space_id, id, add_audience_schedule_to_audience_alpha_input, **kwargs) # noqa: E501 |
| 100 | + |
| 101 | + @validate_arguments |
| 102 | + def add_audience_schedule_to_audience_with_http_info(self, space_id : constr(strict=True), id : constr(strict=True), add_audience_schedule_to_audience_alpha_input : AddAudienceScheduleToAudienceAlphaInput, **kwargs) -> ApiResponse: # noqa: E501 |
| 103 | + """Add Audience Schedule to Audience # noqa: E501 |
| 104 | +
|
| 105 | + The ability to configure the run schedule for an Audience is limited to Linked Audiences (audienceType = LINKED). • This endpoint is in **Alpha** testing. Please submit any feedback by sending an email to [email protected]. • 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. # noqa: E501 |
| 106 | + This method makes a synchronous HTTP request by default. To make an |
| 107 | + asynchronous HTTP request, please pass async_req=True |
| 108 | +
|
| 109 | + >>> thread = api.add_audience_schedule_to_audience_with_http_info(space_id, id, add_audience_schedule_to_audience_alpha_input, async_req=True) |
| 110 | + >>> result = thread.get() |
| 111 | +
|
| 112 | + :param space_id: (required) |
| 113 | + :type space_id: str |
| 114 | + :param id: (required) |
| 115 | + :type id: str |
| 116 | + :param add_audience_schedule_to_audience_alpha_input: (required) |
| 117 | + :type add_audience_schedule_to_audience_alpha_input: AddAudienceScheduleToAudienceAlphaInput |
| 118 | + :param async_req: Whether to execute the request asynchronously. |
| 119 | + :type async_req: bool, optional |
| 120 | + :param _preload_content: if False, the ApiResponse.data will |
| 121 | + be set to none and raw_data will store the |
| 122 | + HTTP response body without reading/decoding. |
| 123 | + Default is True. |
| 124 | + :type _preload_content: bool, optional |
| 125 | + :param _return_http_data_only: response data instead of ApiResponse |
| 126 | + object with status code, headers, etc |
| 127 | + :type _return_http_data_only: bool, optional |
| 128 | + :param _request_timeout: timeout setting for this request. If one |
| 129 | + number provided, it will be total request |
| 130 | + timeout. It can also be a pair (tuple) of |
| 131 | + (connection, read) timeouts. |
| 132 | + :param _request_auth: set to override the auth_settings for an a single |
| 133 | + request; this effectively ignores the authentication |
| 134 | + in the spec for a single request. |
| 135 | + :type _request_auth: dict, optional |
| 136 | + :type _content_type: string, optional: force content-type for the request |
| 137 | + :return: Returns the result object. |
| 138 | + If the method is called asynchronously, |
| 139 | + returns the request thread. |
| 140 | + :rtype: tuple(AddAudienceScheduleToAudience200Response, status_code(int), headers(HTTPHeaderDict)) |
| 141 | + """ |
| 142 | + |
| 143 | + _params = locals() |
| 144 | + |
| 145 | + _all_params = [ |
| 146 | + 'space_id', |
| 147 | + 'id', |
| 148 | + 'add_audience_schedule_to_audience_alpha_input' |
| 149 | + ] |
| 150 | + _all_params.extend( |
| 151 | + [ |
| 152 | + 'async_req', |
| 153 | + '_return_http_data_only', |
| 154 | + '_preload_content', |
| 155 | + '_request_timeout', |
| 156 | + '_request_auth', |
| 157 | + '_content_type', |
| 158 | + '_headers' |
| 159 | + ] |
| 160 | + ) |
| 161 | + |
| 162 | + # validate the arguments |
| 163 | + for _key, _val in _params['kwargs'].items(): |
| 164 | + if _key not in _all_params: |
| 165 | + raise ApiTypeError( |
| 166 | + "Got an unexpected keyword argument '%s'" |
| 167 | + " to method add_audience_schedule_to_audience" % _key |
| 168 | + ) |
| 169 | + _params[_key] = _val |
| 170 | + del _params['kwargs'] |
| 171 | + |
| 172 | + _collection_formats = {} |
| 173 | + |
| 174 | + # process the path parameters |
| 175 | + _path_params = {} |
| 176 | + if _params['space_id']: |
| 177 | + _path_params['spaceId'] = _params['space_id'] |
| 178 | + |
| 179 | + if _params['id']: |
| 180 | + _path_params['id'] = _params['id'] |
| 181 | + |
| 182 | + |
| 183 | + # process the query parameters |
| 184 | + _query_params = [] |
| 185 | + # process the header parameters |
| 186 | + _header_params = dict(_params.get('_headers', {})) |
| 187 | + # process the form parameters |
| 188 | + _form_params = [] |
| 189 | + _files = {} |
| 190 | + # process the body parameter |
| 191 | + _body_params = None |
| 192 | + if _params['add_audience_schedule_to_audience_alpha_input'] is not None: |
| 193 | + _body_params = _params['add_audience_schedule_to_audience_alpha_input'] |
| 194 | + |
| 195 | + # set the HTTP header `Accept` |
| 196 | + _header_params['Accept'] = self.api_client.select_header_accept( |
| 197 | + ['application/vnd.segment.v1alpha+json', 'application/json']) # noqa: E501 |
| 198 | + |
| 199 | + # set the HTTP header `Content-Type` |
| 200 | + _content_types_list = _params.get('_content_type', |
| 201 | + self.api_client.select_header_content_type( |
| 202 | + ['application/vnd.segment.v1alpha+json'])) |
| 203 | + if _content_types_list: |
| 204 | + _header_params['Content-Type'] = _content_types_list |
| 205 | + |
| 206 | + # authentication setting |
| 207 | + _auth_settings = ['token'] # noqa: E501 |
| 208 | + |
| 209 | + _response_types_map = { |
| 210 | + '200': "AddAudienceScheduleToAudience200Response", |
| 211 | + '404': "RequestErrorEnvelope", |
| 212 | + '422': "RequestErrorEnvelope", |
| 213 | + '429': "RequestErrorEnvelope", |
| 214 | + } |
| 215 | + |
| 216 | + return self.api_client.call_api( |
| 217 | + '/spaces/{spaceId}/audiences/{id}/schedules', 'POST', |
| 218 | + _path_params, |
| 219 | + _query_params, |
| 220 | + _header_params, |
| 221 | + body=_body_params, |
| 222 | + post_params=_form_params, |
| 223 | + files=_files, |
| 224 | + response_types_map=_response_types_map, |
| 225 | + auth_settings=_auth_settings, |
| 226 | + async_req=_params.get('async_req'), |
| 227 | + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 |
| 228 | + _preload_content=_params.get('_preload_content', True), |
| 229 | + _request_timeout=_params.get('_request_timeout'), |
| 230 | + collection_formats=_collection_formats, |
| 231 | + _request_auth=_params.get('_request_auth')) |
| 232 | + |
65 | 233 | @validate_arguments
|
66 | 234 | def create_audience(self, space_id : constr(strict=True), create_audience_beta_input : CreateAudienceBetaInput, **kwargs) -> CreateAudience200Response: # noqa: E501
|
67 | 235 | """Create Audience # noqa: E501
|
|
0 commit comments