Skip to content

Commit 7531bc1

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@457f3203.
1 parent 5a80b62 commit 7531bc1

File tree

605 files changed

+1013
-608
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

605 files changed

+1013
-608
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ See the next sections for more information on how to use the Segment Public API.
1111

1212
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
1313

14-
- API version: 58.0.1
15-
- Package version: 58.0.1
14+
- API version: 58.1.1
15+
- Package version: 58.1.1
1616
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
1717

1818
For more information, please visit [https://docs.segmentapis.com](https://docs.segmentapis.com)

docs/AudiencesApi.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Method | HTTP request | Description
66
------------- | ------------- | -------------
77
[**create_audience**](AudiencesApi.md#create_audience) | **POST** /spaces/{spaceId}/audiences | Create Audience
88
[**get_audience**](AudiencesApi.md#get_audience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience
9+
[**list_audience_consumers_from_space_and_audience**](AudiencesApi.md#list_audience_consumers_from_space_and_audience) | **GET** /spaces/{spaceId}/audiences/{id}/audience-references | List Audience Consumers from Space And Audience
910
[**list_audiences**](AudiencesApi.md#list_audiences) | **GET** /spaces/{spaceId}/audiences | List Audiences
1011
[**remove_audience_from_space**](AudiencesApi.md#remove_audience_from_space) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space
1112
[**update_audience_for_space**](AudiencesApi.md#update_audience_for_space) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space
@@ -163,6 +164,84 @@ Name | Type | Description | Notes
163164
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
164165

165166

167+
## Operation: list_audience_consumers_from_space_and_audience
168+
169+
> ListAudienceConsumersFromSpaceAndAudience200Response list_audience_consumers_from_space_and_audience(space_id, id, pagination=pagination)
170+
171+
List Audience Consumers from Space And Audience
172+
173+
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.
174+
175+
### Example
176+
177+
* Bearer Authentication (token):
178+
```python
179+
import time
180+
import os
181+
import segment_public_api
182+
from segment_public_api.models.list_audience_consumers_from_space_and_audience200_response import ListAudienceConsumersFromSpaceAndAudience200Response
183+
from segment_public_api.models.pagination_input import PaginationInput
184+
from segment_public_api.rest import ApiException
185+
from pprint import pprint
186+
187+
188+
189+
# Configure Bearer authorization: token
190+
configuration = segment_public_api.Configuration(
191+
access_token = os.environ["BEARER_TOKEN"]
192+
)
193+
194+
# Enter a context with an instance of the API client
195+
with segment_public_api.ApiClient(configuration) as api_client:
196+
# Create an instance of the API class
197+
api_instance = segment_public_api.AudiencesApi(api_client)
198+
space_id = 'spaceId' # str |
199+
id = 'ReferencedAudienceId' # str |
200+
pagination = segment_public_api.PaginationInput(count=10) # PaginationInput | 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. (optional)
201+
202+
try:
203+
# List Audience Consumers from Space And Audience
204+
api_response = api_instance.list_audience_consumers_from_space_and_audience(space_id, id, pagination=pagination)
205+
print("The response of AudiencesApi->list_audience_consumers_from_space_and_audience:\n")
206+
pprint(api_response)
207+
except Exception as e:
208+
print("Exception when calling AudiencesApi->list_audience_consumers_from_space_and_audience: %s\n" % e)
209+
```
210+
211+
212+
213+
### Parameters
214+
215+
Name | Type | Description | Notes
216+
------------- | ------------- | ------------- | -------------
217+
**space_id** | **str**| |
218+
**id** | **str**| |
219+
**pagination** | [**PaginationInput**](.md)| 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. | [optional]
220+
221+
### Return type
222+
223+
[**ListAudienceConsumersFromSpaceAndAudience200Response**](ListAudienceConsumersFromSpaceAndAudience200Response.md)
224+
225+
### Authorization
226+
227+
[token](../README.md#token)
228+
229+
### HTTP request headers
230+
231+
- **Content-Type**: Not defined
232+
- **Accept**: application/vnd.segment.v1alpha+json, application/json
233+
234+
### HTTP response details
235+
| Status code | Description | Response headers |
236+
|-------------|-------------|------------------|
237+
**200** | OK | - |
238+
**404** | Resource not found | - |
239+
**422** | Validation failure | - |
240+
**429** | Too many requests | - |
241+
242+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
243+
244+
166245
## Operation: list_audiences
167246

168247
> ListAudiences200Response list_audiences(space_id, pagination=pagination)

segment_public_api/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
88
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.
99
10-
The version of the OpenAPI document: 58.0.1
10+
The version of the OpenAPI document: 58.1.1
1111
1212
Generated by OpenAPI Generator (https://openapi-generator.tech)
1313
1414
Do not edit the class manually.
1515
""" # noqa: E501
1616

1717

18-
__version__ = "58.0.1"
18+
__version__ = "58.1.1"
1919

2020
# import apis into sdk package
2121
from segment_public_api.api.api_calls_api import APICallsApi
@@ -349,6 +349,8 @@
349349
from segment_public_api.models.invite_v1 import InviteV1
350350
from segment_public_api.models.label_alpha import LabelAlpha
351351
from segment_public_api.models.label_v1 import LabelV1
352+
from segment_public_api.models.list_audience_consumers_from_space_and_audience200_response import ListAudienceConsumersFromSpaceAndAudience200Response
353+
from segment_public_api.models.list_audience_consumers_from_space_and_audience_output import ListAudienceConsumersFromSpaceAndAudienceOutput
352354
from segment_public_api.models.list_audiences200_response import ListAudiences200Response
353355
from segment_public_api.models.list_audiences_alpha_output import ListAudiencesAlphaOutput
354356
from segment_public_api.models.list_audit_events200_response import ListAuditEvents200Response

segment_public_api/api/api_calls_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
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.
77
8-
The version of the OpenAPI document: 58.0.1
8+
The version of the OpenAPI document: 58.1.1
99
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111

segment_public_api/api/audiences_api.py

Lines changed: 161 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
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.
77
8-
The version of the OpenAPI document: 58.0.1
8+
The version of the OpenAPI document: 58.1.1
99
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111
@@ -27,6 +27,7 @@
2727
from segment_public_api.models.create_audience200_response import CreateAudience200Response
2828
from segment_public_api.models.create_audience_alpha_input import CreateAudienceAlphaInput
2929
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
3031
from segment_public_api.models.list_audiences200_response import ListAudiences200Response
3132
from segment_public_api.models.pagination_input import PaginationInput
3233
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
362363
collection_formats=_collection_formats,
363364
_request_auth=_params.get('_request_auth'))
364365

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+
365525
@validate_arguments
366526
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
367527
"""List Audiences # noqa: E501

0 commit comments

Comments
 (0)