Skip to content

Commit c07aa82

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@21dc9641.
1 parent 4c3eeaa commit c07aa82

File tree

614 files changed

+1248
-614
lines changed

Some content is hidden

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

614 files changed

+1248
-614
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.3.0
15-
- Package version: 58.3.0
14+
- API version: 58.4.0
15+
- Package version: 58.4.0
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: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Method | HTTP request | Description
88
[**get_audience**](AudiencesApi.md#get_audience) | **GET** /spaces/{spaceId}/audiences/{id} | Get Audience
99
[**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
1010
[**list_audiences**](AudiencesApi.md#list_audiences) | **GET** /spaces/{spaceId}/audiences | List Audiences
11+
[**preview_audience**](AudiencesApi.md#preview_audience) | **POST** /spaces/{spaceId}/audiences/previews | Preview Audience
1112
[**remove_audience_from_space**](AudiencesApi.md#remove_audience_from_space) | **DELETE** /spaces/{spaceId}/audiences/{id} | Remove Audience from Space
1213
[**update_audience_for_space**](AudiencesApi.md#update_audience_for_space) | **PATCH** /spaces/{spaceId}/audiences/{id} | Update Audience for Space
1314

@@ -324,6 +325,82 @@ Name | Type | Description | Notes
324325
[[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)
325326

326327

328+
## Operation: preview_audience
329+
330+
> PreviewAudience200Response preview_audience(space_id, preview_audience_input)
331+
332+
Preview Audience
333+
334+
Previews 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. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail).
335+
336+
### Example
337+
338+
* Bearer Authentication (token):
339+
```python
340+
import time
341+
import os
342+
import segment_public_api
343+
from segment_public_api.models.preview_audience200_response import PreviewAudience200Response
344+
from segment_public_api.models.preview_audience_input import PreviewAudienceInput
345+
from segment_public_api.rest import ApiException
346+
from pprint import pprint
347+
348+
349+
350+
# Configure Bearer authorization: token
351+
configuration = segment_public_api.Configuration(
352+
access_token = os.environ["BEARER_TOKEN"]
353+
)
354+
355+
# Enter a context with an instance of the API client
356+
with segment_public_api.ApiClient(configuration) as api_client:
357+
# Create an instance of the API class
358+
api_instance = segment_public_api.AudiencesApi(api_client)
359+
space_id = 'spaceId' # str |
360+
preview_audience_input = {"definition":{"query":"event('Shoes Bought').count() >= 1"},"audienceType":"USERS","options":{"filterByExternalIds":["android.idfa","anonymous_id","email","ios.idfa","user_id"],"includeAnonymousUsers":true,"includeHistoricalData":true,"backfillEventDataDays":7}} # PreviewAudienceInput |
361+
362+
try:
363+
# Preview Audience
364+
api_response = api_instance.preview_audience(space_id, preview_audience_input)
365+
print("The response of AudiencesApi->preview_audience:\n")
366+
pprint(api_response)
367+
except Exception as e:
368+
print("Exception when calling AudiencesApi->preview_audience: %s\n" % e)
369+
```
370+
371+
372+
373+
### Parameters
374+
375+
Name | Type | Description | Notes
376+
------------- | ------------- | ------------- | -------------
377+
**space_id** | **str**| |
378+
**preview_audience_input** | [**PreviewAudienceInput**](PreviewAudienceInput.md)| |
379+
380+
### Return type
381+
382+
[**PreviewAudience200Response**](PreviewAudience200Response.md)
383+
384+
### Authorization
385+
386+
[token](../README.md#token)
387+
388+
### HTTP request headers
389+
390+
- **Content-Type**: application/vnd.segment.v1alpha+json
391+
- **Accept**: application/vnd.segment.v1alpha+json, application/json
392+
393+
### HTTP response details
394+
| Status code | Description | Response headers |
395+
|-------------|-------------|------------------|
396+
**200** | OK | - |
397+
**404** | Resource not found | - |
398+
**422** | Validation failure | - |
399+
**429** | Too many requests | - |
400+
401+
[[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)
402+
403+
327404
## Operation: remove_audience_from_space
328405

329406
> RemoveAudienceFromSpace200Response remove_audience_from_space(space_id, id)

segment_public_api/__init__.py

Lines changed: 7 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.3.0
10+
The version of the OpenAPI document: 58.4.0
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.3.0"
18+
__version__ = "58.4.0"
1919

2020
# import apis into sdk package
2121
from segment_public_api.api.api_calls_api import APICallsApi
@@ -87,6 +87,7 @@
8787
from segment_public_api.models.allowed_label_beta import AllowedLabelBeta
8888
from segment_public_api.models.audience_compute_cadence import AudienceComputeCadence
8989
from segment_public_api.models.audience_definition import AudienceDefinition
90+
from segment_public_api.models.audience_definition_without_type import AudienceDefinitionWithoutType
9091
from segment_public_api.models.audience_options import AudienceOptions
9192
from segment_public_api.models.audience_options_with_lookback import AudienceOptionsWithLookback
9293
from segment_public_api.models.audience_summary import AudienceSummary
@@ -461,6 +462,10 @@
461462
from segment_public_api.models.permission_input_v1 import PermissionInputV1
462463
from segment_public_api.models.permission_resource_v1 import PermissionResourceV1
463464
from segment_public_api.models.permission_v1 import PermissionV1
465+
from segment_public_api.models.preview import Preview
466+
from segment_public_api.models.preview_audience200_response import PreviewAudience200Response
467+
from segment_public_api.models.preview_audience_input import PreviewAudienceInput
468+
from segment_public_api.models.preview_audience_output import PreviewAudienceOutput
464469
from segment_public_api.models.preview_destination_filter200_response import PreviewDestinationFilter200Response
465470
from segment_public_api.models.preview_destination_filter_v1 import PreviewDestinationFilterV1
466471
from segment_public_api.models.preview_destination_filter_v1_input import PreviewDestinationFilterV1Input

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.3.0
8+
The version of the OpenAPI document: 58.4.0
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.3.0
8+
The version of the OpenAPI document: 58.4.0
99
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111
@@ -33,6 +33,8 @@
3333
from segment_public_api.models.list_audiences200_response import ListAudiences200Response
3434
from segment_public_api.models.list_audiences_pagination_input import ListAudiencesPaginationInput
3535
from segment_public_api.models.pagination_input import PaginationInput
36+
from segment_public_api.models.preview_audience200_response import PreviewAudience200Response
37+
from segment_public_api.models.preview_audience_input import PreviewAudienceInput
3638
from segment_public_api.models.remove_audience_from_space200_response import RemoveAudienceFromSpace200Response
3739
from segment_public_api.models.update_audience_for_space200_response import UpdateAudienceForSpace200Response
3840
from segment_public_api.models.update_audience_for_space_alpha_input import UpdateAudienceForSpaceAlphaInput
@@ -692,6 +694,164 @@ def list_audiences_with_http_info(self, space_id : constr(strict=True), paginati
692694
collection_formats=_collection_formats,
693695
_request_auth=_params.get('_request_auth'))
694696

697+
@validate_arguments
698+
def preview_audience(self, space_id : constr(strict=True), preview_audience_input : PreviewAudienceInput, **kwargs) -> PreviewAudience200Response: # noqa: E501
699+
"""Preview Audience # noqa: E501
700+
701+
Previews 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. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). # noqa: E501
702+
This method makes a synchronous HTTP request by default. To make an
703+
asynchronous HTTP request, please pass async_req=True
704+
705+
>>> thread = api.preview_audience(space_id, preview_audience_input, async_req=True)
706+
>>> result = thread.get()
707+
708+
:param space_id: (required)
709+
:type space_id: str
710+
:param preview_audience_input: (required)
711+
:type preview_audience_input: PreviewAudienceInput
712+
:param async_req: Whether to execute the request asynchronously.
713+
:type async_req: bool, optional
714+
:param _request_timeout: timeout setting for this request.
715+
If one number provided, it will be total request
716+
timeout. It can also be a pair (tuple) of
717+
(connection, read) timeouts.
718+
:return: Returns the result object.
719+
If the method is called asynchronously,
720+
returns the request thread.
721+
:rtype: PreviewAudience200Response
722+
"""
723+
kwargs['_return_http_data_only'] = True
724+
if '_preload_content' in kwargs:
725+
message = "Error! Please call the preview_audience_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
726+
raise ValueError(message)
727+
return self.preview_audience_with_http_info(space_id, preview_audience_input, **kwargs) # noqa: E501
728+
729+
@validate_arguments
730+
def preview_audience_with_http_info(self, space_id : constr(strict=True), preview_audience_input : PreviewAudienceInput, **kwargs) -> ApiResponse: # noqa: E501
731+
"""Preview Audience # noqa: E501
732+
733+
Previews 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. • When called, this endpoint may generate the `Audience Preview Created` event in the [audit trail](/tag/Audit-Trail). # noqa: E501
734+
This method makes a synchronous HTTP request by default. To make an
735+
asynchronous HTTP request, please pass async_req=True
736+
737+
>>> thread = api.preview_audience_with_http_info(space_id, preview_audience_input, async_req=True)
738+
>>> result = thread.get()
739+
740+
:param space_id: (required)
741+
:type space_id: str
742+
:param preview_audience_input: (required)
743+
:type preview_audience_input: PreviewAudienceInput
744+
:param async_req: Whether to execute the request asynchronously.
745+
:type async_req: bool, optional
746+
:param _preload_content: if False, the ApiResponse.data will
747+
be set to none and raw_data will store the
748+
HTTP response body without reading/decoding.
749+
Default is True.
750+
:type _preload_content: bool, optional
751+
:param _return_http_data_only: response data instead of ApiResponse
752+
object with status code, headers, etc
753+
:type _return_http_data_only: bool, optional
754+
:param _request_timeout: timeout setting for this request. If one
755+
number provided, it will be total request
756+
timeout. It can also be a pair (tuple) of
757+
(connection, read) timeouts.
758+
:param _request_auth: set to override the auth_settings for an a single
759+
request; this effectively ignores the authentication
760+
in the spec for a single request.
761+
:type _request_auth: dict, optional
762+
:type _content_type: string, optional: force content-type for the request
763+
:return: Returns the result object.
764+
If the method is called asynchronously,
765+
returns the request thread.
766+
:rtype: tuple(PreviewAudience200Response, status_code(int), headers(HTTPHeaderDict))
767+
"""
768+
769+
_params = locals()
770+
771+
_all_params = [
772+
'space_id',
773+
'preview_audience_input'
774+
]
775+
_all_params.extend(
776+
[
777+
'async_req',
778+
'_return_http_data_only',
779+
'_preload_content',
780+
'_request_timeout',
781+
'_request_auth',
782+
'_content_type',
783+
'_headers'
784+
]
785+
)
786+
787+
# validate the arguments
788+
for _key, _val in _params['kwargs'].items():
789+
if _key not in _all_params:
790+
raise ApiTypeError(
791+
"Got an unexpected keyword argument '%s'"
792+
" to method preview_audience" % _key
793+
)
794+
_params[_key] = _val
795+
del _params['kwargs']
796+
797+
_collection_formats = {}
798+
799+
# process the path parameters
800+
_path_params = {}
801+
if _params['space_id']:
802+
_path_params['spaceId'] = _params['space_id']
803+
804+
805+
# process the query parameters
806+
_query_params = []
807+
# process the header parameters
808+
_header_params = dict(_params.get('_headers', {}))
809+
# process the form parameters
810+
_form_params = []
811+
_files = {}
812+
# process the body parameter
813+
_body_params = None
814+
if _params['preview_audience_input'] is not None:
815+
_body_params = _params['preview_audience_input']
816+
817+
# set the HTTP header `Accept`
818+
_header_params['Accept'] = self.api_client.select_header_accept(
819+
['application/vnd.segment.v1alpha+json', 'application/json']) # noqa: E501
820+
821+
# set the HTTP header `Content-Type`
822+
_content_types_list = _params.get('_content_type',
823+
self.api_client.select_header_content_type(
824+
['application/vnd.segment.v1alpha+json']))
825+
if _content_types_list:
826+
_header_params['Content-Type'] = _content_types_list
827+
828+
# authentication setting
829+
_auth_settings = ['token'] # noqa: E501
830+
831+
_response_types_map = {
832+
'200': "PreviewAudience200Response",
833+
'404': "RequestErrorEnvelope",
834+
'422': "RequestErrorEnvelope",
835+
'429': "RequestErrorEnvelope",
836+
}
837+
838+
return self.api_client.call_api(
839+
'/spaces/{spaceId}/audiences/previews', 'POST',
840+
_path_params,
841+
_query_params,
842+
_header_params,
843+
body=_body_params,
844+
post_params=_form_params,
845+
files=_files,
846+
response_types_map=_response_types_map,
847+
auth_settings=_auth_settings,
848+
async_req=_params.get('async_req'),
849+
_return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501
850+
_preload_content=_params.get('_preload_content', True),
851+
_request_timeout=_params.get('_request_timeout'),
852+
collection_formats=_collection_formats,
853+
_request_auth=_params.get('_request_auth'))
854+
695855
@validate_arguments
696856
def remove_audience_from_space(self, space_id : constr(strict=True), id : constr(strict=True), **kwargs) -> RemoveAudienceFromSpace200Response: # noqa: E501
697857
"""Remove Audience from Space # noqa: E501

segment_public_api/api/audit_trail_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.3.0
8+
The version of the OpenAPI document: 58.4.0
99
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111

segment_public_api/api/catalog_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.3.0
8+
The version of the OpenAPI document: 58.4.0
99
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111

segment_public_api/api/computed_traits_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.3.0
8+
The version of the OpenAPI document: 58.4.0
99
1010
Generated by OpenAPI Generator (https://openapi-generator.tech)
1111

0 commit comments

Comments
 (0)