Skip to content

Commit ad5b64c

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@cc3bddcf.
1 parent 1372650 commit ad5b64c

File tree

8 files changed

+283
-28
lines changed

8 files changed

+283
-28
lines changed

docs/AudiencesApi.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Method | HTTP request | Description
1919

2020
## Operation: create_audience
2121

22-
> CreateAudience200Response create_audience(space_id, create_audience_alpha_input)
22+
> CreateAudience200Response create_audience(space_id, create_audience_beta_input)
2323
2424
Create Audience
2525

26-
Creates 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 Created` event in the [audit trail](/tag/Audit-Trail). Note: The definition for an Audience created using the API is not editable through the Segment App. The rate limit for this endpoint is 10 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.
26+
Creates Audience. • This endpoint is in **Beta** 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 Created` event in the [audit trail](/tag/Audit-Trail). Note: The definition for an Audience created using the API is not editable through the Segment App. The rate limit for this endpoint is 10 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.
2727

2828
### Example
2929

@@ -33,7 +33,7 @@ import time
3333
import os
3434
import segment_public_api
3535
from segment_public_api.models.create_audience200_response import CreateAudience200Response
36-
from segment_public_api.models.create_audience_alpha_input import CreateAudienceAlphaInput
36+
from segment_public_api.models.create_audience_beta_input import CreateAudienceBetaInput
3737
from segment_public_api.rest import ApiException
3838
from pprint import pprint
3939

@@ -49,11 +49,11 @@ with segment_public_api.ApiClient(configuration) as api_client:
4949
# Create an instance of the API class
5050
api_instance = segment_public_api.AudiencesApi(api_client)
5151
space_id = '9aQ1Lj62S4bomZKLF4DPqW' # str |
52-
create_audience_alpha_input = {"name":"name","description":"description","enabled":false,"audienceType":"USERS","definition":{"query":"event('Shoes Bought').count() >= 1"},"options":{"includeHistoricalData":true}} # CreateAudienceAlphaInput |
52+
create_audience_beta_input = {"name":"Linked Audience","description":"Test linked audience example","enabled":true,"audienceType":"LINKED","definition":{"query":"entity('owned-accounts').count() > 1","targetEntity":"owned-accounts"},"options":{"includeHistoricalData":true}} # CreateAudienceBetaInput |
5353

5454
try:
5555
# Create Audience
56-
api_response = api_instance.create_audience(space_id, create_audience_alpha_input)
56+
api_response = api_instance.create_audience(space_id, create_audience_beta_input)
5757
print("The response of AudiencesApi->create_audience:\n")
5858
pprint(api_response)
5959
except Exception as e:
@@ -67,7 +67,7 @@ with segment_public_api.ApiClient(configuration) as api_client:
6767
Name | Type | Description | Notes
6868
------------- | ------------- | ------------- | -------------
6969
**space_id** | **str**| |
70-
**create_audience_alpha_input** | [**CreateAudienceAlphaInput**](CreateAudienceAlphaInput.md)| |
70+
**create_audience_beta_input** | [**CreateAudienceBetaInput**](CreateAudienceBetaInput.md)| |
7171

7272
### Return type
7373

@@ -79,8 +79,8 @@ Name | Type | Description | Notes
7979

8080
### HTTP request headers
8181

82-
- **Content-Type**: application/vnd.segment.v1alpha+json
83-
- **Accept**: application/vnd.segment.v1alpha+json, application/json
82+
- **Content-Type**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json
83+
- **Accept**: application/vnd.segment.v1beta+json, application/vnd.segment.v1alpha+json, application/json
8484

8585
### HTTP response details
8686
| Status code | Description | Response headers |

segment_public_api/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,11 @@
124124
from segment_public_api.models.connection import Connection
125125
from segment_public_api.models.contact import Contact
126126
from segment_public_api.models.create_audience200_response import CreateAudience200Response
127+
from segment_public_api.models.create_audience200_response1 import CreateAudience200Response1
127128
from segment_public_api.models.create_audience_alpha_input import CreateAudienceAlphaInput
128129
from segment_public_api.models.create_audience_alpha_output import CreateAudienceAlphaOutput
130+
from segment_public_api.models.create_audience_beta_input import CreateAudienceBetaInput
131+
from segment_public_api.models.create_audience_beta_output import CreateAudienceBetaOutput
129132
from segment_public_api.models.create_audience_preview200_response import CreateAudiencePreview200Response
130133
from segment_public_api.models.create_audience_preview200_response1 import CreateAudiencePreview200Response1
131134
from segment_public_api.models.create_audience_preview_alpha_input import CreateAudiencePreviewAlphaInput

segment_public_api/api/audiences_api.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from typing import Optional
2626

2727
from segment_public_api.models.create_audience200_response import CreateAudience200Response
28-
from segment_public_api.models.create_audience_alpha_input import CreateAudienceAlphaInput
28+
from segment_public_api.models.create_audience_beta_input import CreateAudienceBetaInput
2929
from segment_public_api.models.create_audience_preview200_response import CreateAudiencePreview200Response
3030
from segment_public_api.models.create_audience_preview_beta_input import CreateAudiencePreviewBetaInput
3131
from segment_public_api.models.get_audience200_response import GetAudience200Response
@@ -63,20 +63,20 @@ def __init__(self, api_client=None) -> None:
6363
self.api_client = api_client
6464

6565
@validate_arguments
66-
def create_audience(self, space_id : constr(strict=True), create_audience_alpha_input : CreateAudienceAlphaInput, **kwargs) -> CreateAudience200Response: # noqa: E501
66+
def create_audience(self, space_id : constr(strict=True), create_audience_beta_input : CreateAudienceBetaInput, **kwargs) -> CreateAudience200Response: # noqa: E501
6767
"""Create Audience # noqa: E501
6868
69-
Creates 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 Created` event in the [audit trail](/tag/Audit-Trail). Note: The definition for an Audience created using the API is not editable through the Segment App. The rate limit for this endpoint is 10 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
69+
Creates Audience. • This endpoint is in **Beta** 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 Created` event in the [audit trail](/tag/Audit-Trail). Note: The definition for an Audience created using the API is not editable through the Segment App. The rate limit for this endpoint is 10 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
7070
This method makes a synchronous HTTP request by default. To make an
7171
asynchronous HTTP request, please pass async_req=True
7272
73-
>>> thread = api.create_audience(space_id, create_audience_alpha_input, async_req=True)
73+
>>> thread = api.create_audience(space_id, create_audience_beta_input, async_req=True)
7474
>>> result = thread.get()
7575
7676
:param space_id: (required)
7777
:type space_id: str
78-
:param create_audience_alpha_input: (required)
79-
:type create_audience_alpha_input: CreateAudienceAlphaInput
78+
:param create_audience_beta_input: (required)
79+
:type create_audience_beta_input: CreateAudienceBetaInput
8080
:param async_req: Whether to execute the request asynchronously.
8181
:type async_req: bool, optional
8282
:param _request_timeout: timeout setting for this request.
@@ -92,23 +92,23 @@ def create_audience(self, space_id : constr(strict=True), create_audience_alpha_
9292
if '_preload_content' in kwargs:
9393
message = "Error! Please call the create_audience_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501
9494
raise ValueError(message)
95-
return self.create_audience_with_http_info(space_id, create_audience_alpha_input, **kwargs) # noqa: E501
95+
return self.create_audience_with_http_info(space_id, create_audience_beta_input, **kwargs) # noqa: E501
9696

9797
@validate_arguments
98-
def create_audience_with_http_info(self, space_id : constr(strict=True), create_audience_alpha_input : CreateAudienceAlphaInput, **kwargs) -> ApiResponse: # noqa: E501
98+
def create_audience_with_http_info(self, space_id : constr(strict=True), create_audience_beta_input : CreateAudienceBetaInput, **kwargs) -> ApiResponse: # noqa: E501
9999
"""Create Audience # noqa: E501
100100
101-
Creates 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 Created` event in the [audit trail](/tag/Audit-Trail). Note: The definition for an Audience created using the API is not editable through the Segment App. The rate limit for this endpoint is 10 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
101+
Creates Audience. • This endpoint is in **Beta** 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 Created` event in the [audit trail](/tag/Audit-Trail). Note: The definition for an Audience created using the API is not editable through the Segment App. The rate limit for this endpoint is 10 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
102102
This method makes a synchronous HTTP request by default. To make an
103103
asynchronous HTTP request, please pass async_req=True
104104
105-
>>> thread = api.create_audience_with_http_info(space_id, create_audience_alpha_input, async_req=True)
105+
>>> thread = api.create_audience_with_http_info(space_id, create_audience_beta_input, async_req=True)
106106
>>> result = thread.get()
107107
108108
:param space_id: (required)
109109
:type space_id: str
110-
:param create_audience_alpha_input: (required)
111-
:type create_audience_alpha_input: CreateAudienceAlphaInput
110+
:param create_audience_beta_input: (required)
111+
:type create_audience_beta_input: CreateAudienceBetaInput
112112
:param async_req: Whether to execute the request asynchronously.
113113
:type async_req: bool, optional
114114
:param _preload_content: if False, the ApiResponse.data will
@@ -138,7 +138,7 @@ def create_audience_with_http_info(self, space_id : constr(strict=True), create_
138138

139139
_all_params = [
140140
'space_id',
141-
'create_audience_alpha_input'
141+
'create_audience_beta_input'
142142
]
143143
_all_params.extend(
144144
[
@@ -179,17 +179,17 @@ def create_audience_with_http_info(self, space_id : constr(strict=True), create_
179179
_files = {}
180180
# process the body parameter
181181
_body_params = None
182-
if _params['create_audience_alpha_input'] is not None:
183-
_body_params = _params['create_audience_alpha_input']
182+
if _params['create_audience_beta_input'] is not None:
183+
_body_params = _params['create_audience_beta_input']
184184

185185
# set the HTTP header `Accept`
186186
_header_params['Accept'] = self.api_client.select_header_accept(
187-
['application/vnd.segment.v1alpha+json', 'application/json']) # noqa: E501
187+
['application/vnd.segment.v1beta+json', 'application/vnd.segment.v1alpha+json', 'application/json']) # noqa: E501
188188

189189
# set the HTTP header `Content-Type`
190190
_content_types_list = _params.get('_content_type',
191191
self.api_client.select_header_content_type(
192-
['application/vnd.segment.v1alpha+json']))
192+
['application/vnd.segment.v1beta+json', 'application/vnd.segment.v1alpha+json']))
193193
if _content_types_list:
194194
_header_params['Content-Type'] = _content_types_list
195195

segment_public_api/models/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,11 @@
7777
from segment_public_api.models.connection import Connection
7878
from segment_public_api.models.contact import Contact
7979
from segment_public_api.models.create_audience200_response import CreateAudience200Response
80+
from segment_public_api.models.create_audience200_response1 import CreateAudience200Response1
8081
from segment_public_api.models.create_audience_alpha_input import CreateAudienceAlphaInput
8182
from segment_public_api.models.create_audience_alpha_output import CreateAudienceAlphaOutput
83+
from segment_public_api.models.create_audience_beta_input import CreateAudienceBetaInput
84+
from segment_public_api.models.create_audience_beta_output import CreateAudienceBetaOutput
8285
from segment_public_api.models.create_audience_preview200_response import CreateAudiencePreview200Response
8386
from segment_public_api.models.create_audience_preview200_response1 import CreateAudiencePreview200Response1
8487
from segment_public_api.models.create_audience_preview_alpha_input import CreateAudiencePreviewAlphaInput

segment_public_api/models/create_audience200_response.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121

2222
from typing import Optional
2323
from pydantic import BaseModel
24-
from segment_public_api.models.create_audience_alpha_output import CreateAudienceAlphaOutput
24+
from segment_public_api.models.create_audience_beta_output import CreateAudienceBetaOutput
2525

2626
class CreateAudience200Response(BaseModel):
2727
"""
2828
CreateAudience200Response
2929
"""
30-
data: Optional[CreateAudienceAlphaOutput] = None
30+
data: Optional[CreateAudienceBetaOutput] = None
3131
__properties = ["data"]
3232

3333
class Config:
@@ -69,7 +69,7 @@ def from_dict(cls, obj: dict) -> CreateAudience200Response:
6969
return CreateAudience200Response.parse_obj(obj)
7070

7171
_obj = CreateAudience200Response.parse_obj({
72-
"data": CreateAudienceAlphaOutput.from_dict(obj.get("data")) if obj.get("data") is not None else None
72+
"data": CreateAudienceBetaOutput.from_dict(obj.get("data")) if obj.get("data") is not None else None
7373
})
7474
return _obj
7575

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# coding: utf-8
2+
3+
"""
4+
Segment Public API
5+
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+
8+
The version of the OpenAPI document: 59.1.0
9+
10+
Generated by OpenAPI Generator (https://openapi-generator.tech)
11+
12+
Do not edit the class manually.
13+
""" # noqa: E501
14+
15+
16+
from __future__ import annotations
17+
import pprint
18+
import re # noqa: F401
19+
import json
20+
21+
22+
from typing import Optional
23+
from pydantic import BaseModel
24+
from segment_public_api.models.create_audience_alpha_output import CreateAudienceAlphaOutput
25+
26+
class CreateAudience200Response1(BaseModel):
27+
"""
28+
CreateAudience200Response1
29+
"""
30+
data: Optional[CreateAudienceAlphaOutput] = None
31+
__properties = ["data"]
32+
33+
class Config:
34+
"""Pydantic configuration"""
35+
allow_population_by_field_name = True
36+
validate_assignment = True
37+
38+
def to_str(self) -> str:
39+
"""Returns the string representation of the model using alias"""
40+
return pprint.pformat(self.dict(by_alias=True))
41+
42+
def to_json(self) -> str:
43+
"""Returns the JSON representation of the model using alias"""
44+
return json.dumps(self.to_dict())
45+
46+
@classmethod
47+
def from_json(cls, json_str: str) -> CreateAudience200Response1:
48+
"""Create an instance of CreateAudience200Response1 from a JSON string"""
49+
return cls.from_dict(json.loads(json_str))
50+
51+
def to_dict(self):
52+
"""Returns the dictionary representation of the model using alias"""
53+
_dict = self.dict(by_alias=True,
54+
exclude={
55+
},
56+
exclude_none=True)
57+
# override the default output from pydantic by calling `to_dict()` of data
58+
if self.data:
59+
_dict['data'] = self.data.to_dict()
60+
return _dict
61+
62+
@classmethod
63+
def from_dict(cls, obj: dict) -> CreateAudience200Response1:
64+
"""Create an instance of CreateAudience200Response1 from a dict"""
65+
if obj is None:
66+
return None
67+
68+
if not isinstance(obj, dict):
69+
return CreateAudience200Response1.parse_obj(obj)
70+
71+
_obj = CreateAudience200Response1.parse_obj({
72+
"data": CreateAudienceAlphaOutput.from_dict(obj.get("data")) if obj.get("data") is not None else None
73+
})
74+
return _obj
75+
76+

0 commit comments

Comments
 (0)