|
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: 58.0.1 |
| 8 | + The version of the OpenAPI document: 58.1.1 |
9 | 9 |
|
10 | 10 | Generated by OpenAPI Generator (https://openapi-generator.tech)
|
11 | 11 |
|
|
27 | 27 | from segment_public_api.models.create_audience200_response import CreateAudience200Response
|
28 | 28 | from segment_public_api.models.create_audience_alpha_input import CreateAudienceAlphaInput
|
29 | 29 | from segment_public_api.models.get_audience200_response import GetAudience200Response
|
| 30 | +from segment_public_api.models.list_audience_consumers_from_space_and_audience200_response import ListAudienceConsumersFromSpaceAndAudience200Response |
30 | 31 | from segment_public_api.models.list_audiences200_response import ListAudiences200Response
|
31 | 32 | from segment_public_api.models.pagination_input import PaginationInput
|
32 | 33 | from segment_public_api.models.remove_audience_from_space200_response import RemoveAudienceFromSpace200Response
|
@@ -362,6 +363,165 @@ def get_audience_with_http_info(self, space_id : constr(strict=True), id : const
|
362 | 363 | collection_formats=_collection_formats,
|
363 | 364 | _request_auth=_params.get('_request_auth'))
|
364 | 365 |
|
| 366 | + @validate_arguments |
| 367 | + def list_audience_consumers_from_space_and_audience(self, space_id : constr(strict=True), id : constr(strict=True), pagination : Annotated[Optional[PaginationInput], Field(description="Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha.")] = None, **kwargs) -> ListAudienceConsumersFromSpaceAndAudience200Response: # noqa: E501 |
| 368 | + """List Audience Consumers from Space And Audience # noqa: E501 |
| 369 | +
|
| 370 | + Returns the list of consumers for the given audience. • 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. The rate limit for this endpoint is 25 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 |
| 371 | + This method makes a synchronous HTTP request by default. To make an |
| 372 | + asynchronous HTTP request, please pass async_req=True |
| 373 | +
|
| 374 | + >>> thread = api.list_audience_consumers_from_space_and_audience(space_id, id, pagination, async_req=True) |
| 375 | + >>> result = thread.get() |
| 376 | +
|
| 377 | + :param space_id: (required) |
| 378 | + :type space_id: str |
| 379 | + :param id: (required) |
| 380 | + :type id: str |
| 381 | + :param pagination: Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. |
| 382 | + :type pagination: PaginationInput |
| 383 | + :param async_req: Whether to execute the request asynchronously. |
| 384 | + :type async_req: bool, optional |
| 385 | + :param _request_timeout: timeout setting for this request. |
| 386 | + If one number provided, it will be total request |
| 387 | + timeout. It can also be a pair (tuple) of |
| 388 | + (connection, read) timeouts. |
| 389 | + :return: Returns the result object. |
| 390 | + If the method is called asynchronously, |
| 391 | + returns the request thread. |
| 392 | + :rtype: ListAudienceConsumersFromSpaceAndAudience200Response |
| 393 | + """ |
| 394 | + kwargs['_return_http_data_only'] = True |
| 395 | + if '_preload_content' in kwargs: |
| 396 | + message = "Error! Please call the list_audience_consumers_from_space_and_audience_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 |
| 397 | + raise ValueError(message) |
| 398 | + return self.list_audience_consumers_from_space_and_audience_with_http_info(space_id, id, pagination, **kwargs) # noqa: E501 |
| 399 | + |
| 400 | + @validate_arguments |
| 401 | + def list_audience_consumers_from_space_and_audience_with_http_info(self, space_id : constr(strict=True), id : constr(strict=True), pagination : Annotated[Optional[PaginationInput], Field(description="Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha.")] = None, **kwargs) -> ApiResponse: # noqa: E501 |
| 402 | + """List Audience Consumers from Space And Audience # noqa: E501 |
| 403 | +
|
| 404 | + Returns the list of consumers for the given audience. • 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. The rate limit for this endpoint is 25 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 |
| 405 | + This method makes a synchronous HTTP request by default. To make an |
| 406 | + asynchronous HTTP request, please pass async_req=True |
| 407 | +
|
| 408 | + >>> thread = api.list_audience_consumers_from_space_and_audience_with_http_info(space_id, id, pagination, async_req=True) |
| 409 | + >>> result = thread.get() |
| 410 | +
|
| 411 | + :param space_id: (required) |
| 412 | + :type space_id: str |
| 413 | + :param id: (required) |
| 414 | + :type id: str |
| 415 | + :param pagination: Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha. |
| 416 | + :type pagination: PaginationInput |
| 417 | + :param async_req: Whether to execute the request asynchronously. |
| 418 | + :type async_req: bool, optional |
| 419 | + :param _preload_content: if False, the ApiResponse.data will |
| 420 | + be set to none and raw_data will store the |
| 421 | + HTTP response body without reading/decoding. |
| 422 | + Default is True. |
| 423 | + :type _preload_content: bool, optional |
| 424 | + :param _return_http_data_only: response data instead of ApiResponse |
| 425 | + object with status code, headers, etc |
| 426 | + :type _return_http_data_only: bool, optional |
| 427 | + :param _request_timeout: timeout setting for this request. If one |
| 428 | + number provided, it will be total request |
| 429 | + timeout. It can also be a pair (tuple) of |
| 430 | + (connection, read) timeouts. |
| 431 | + :param _request_auth: set to override the auth_settings for an a single |
| 432 | + request; this effectively ignores the authentication |
| 433 | + in the spec for a single request. |
| 434 | + :type _request_auth: dict, optional |
| 435 | + :type _content_type: string, optional: force content-type for the request |
| 436 | + :return: Returns the result object. |
| 437 | + If the method is called asynchronously, |
| 438 | + returns the request thread. |
| 439 | + :rtype: tuple(ListAudienceConsumersFromSpaceAndAudience200Response, status_code(int), headers(HTTPHeaderDict)) |
| 440 | + """ |
| 441 | + |
| 442 | + _params = locals() |
| 443 | + |
| 444 | + _all_params = [ |
| 445 | + 'space_id', |
| 446 | + 'id', |
| 447 | + 'pagination' |
| 448 | + ] |
| 449 | + _all_params.extend( |
| 450 | + [ |
| 451 | + 'async_req', |
| 452 | + '_return_http_data_only', |
| 453 | + '_preload_content', |
| 454 | + '_request_timeout', |
| 455 | + '_request_auth', |
| 456 | + '_content_type', |
| 457 | + '_headers' |
| 458 | + ] |
| 459 | + ) |
| 460 | + |
| 461 | + # validate the arguments |
| 462 | + for _key, _val in _params['kwargs'].items(): |
| 463 | + if _key not in _all_params: |
| 464 | + raise ApiTypeError( |
| 465 | + "Got an unexpected keyword argument '%s'" |
| 466 | + " to method list_audience_consumers_from_space_and_audience" % _key |
| 467 | + ) |
| 468 | + _params[_key] = _val |
| 469 | + del _params['kwargs'] |
| 470 | + |
| 471 | + _collection_formats = {} |
| 472 | + |
| 473 | + # process the path parameters |
| 474 | + _path_params = {} |
| 475 | + if _params['space_id']: |
| 476 | + _path_params['spaceId'] = _params['space_id'] |
| 477 | + |
| 478 | + if _params['id']: |
| 479 | + _path_params['id'] = _params['id'] |
| 480 | + |
| 481 | + |
| 482 | + # process the query parameters |
| 483 | + _query_params = [] |
| 484 | + if _params.get('pagination') is not None: # noqa: E501 |
| 485 | + _query_params.append(('pagination', _params['pagination'])) |
| 486 | + |
| 487 | + # process the header parameters |
| 488 | + _header_params = dict(_params.get('_headers', {})) |
| 489 | + # process the form parameters |
| 490 | + _form_params = [] |
| 491 | + _files = {} |
| 492 | + # process the body parameter |
| 493 | + _body_params = None |
| 494 | + # set the HTTP header `Accept` |
| 495 | + _header_params['Accept'] = self.api_client.select_header_accept( |
| 496 | + ['application/vnd.segment.v1alpha+json', 'application/json']) # noqa: E501 |
| 497 | + |
| 498 | + # authentication setting |
| 499 | + _auth_settings = ['token'] # noqa: E501 |
| 500 | + |
| 501 | + _response_types_map = { |
| 502 | + '200': "ListAudienceConsumersFromSpaceAndAudience200Response", |
| 503 | + '404': "RequestErrorEnvelope", |
| 504 | + '422': "RequestErrorEnvelope", |
| 505 | + '429': "RequestErrorEnvelope", |
| 506 | + } |
| 507 | + |
| 508 | + return self.api_client.call_api( |
| 509 | + '/spaces/{spaceId}/audiences/{id}/audience-references', 'GET', |
| 510 | + _path_params, |
| 511 | + _query_params, |
| 512 | + _header_params, |
| 513 | + body=_body_params, |
| 514 | + post_params=_form_params, |
| 515 | + files=_files, |
| 516 | + response_types_map=_response_types_map, |
| 517 | + auth_settings=_auth_settings, |
| 518 | + async_req=_params.get('async_req'), |
| 519 | + _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 |
| 520 | + _preload_content=_params.get('_preload_content', True), |
| 521 | + _request_timeout=_params.get('_request_timeout'), |
| 522 | + collection_formats=_collection_formats, |
| 523 | + _request_auth=_params.get('_request_auth')) |
| 524 | + |
365 | 525 | @validate_arguments
|
366 | 526 | def list_audiences(self, space_id : constr(strict=True), pagination : Annotated[Optional[PaginationInput], Field(description="Information about the pagination of this response. [See pagination](https://docs.segmentapis.com/tag/Pagination/#section/Pagination-parameters) for more info. This parameter exists in alpha.")] = None, **kwargs) -> ListAudiences200Response: # noqa: E501
|
367 | 527 | """List Audiences # noqa: E501
|
|
0 commit comments