Skip to content

Commit 9a1951c

Browse files
author
APIs and Common Services team
committed
Automated SDK update
This updates the SDK from internal repo commit segmentio/public-api@8031567d.
1 parent 77af0b5 commit 9a1951c

File tree

4 files changed

+27
-14
lines changed

4 files changed

+27
-14
lines changed

segment_public_api/models/audience_options.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,18 @@
1919
import json
2020

2121

22-
from typing import Optional
23-
from pydantic import BaseModel, Field, StrictBool
22+
from typing import List, Optional, Union
23+
from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist
2424

2525
class AudienceOptions(BaseModel):
2626
"""
2727
AudienceOptions
2828
"""
2929
include_historical_data: Optional[StrictBool] = Field(None, alias="includeHistoricalData", description="Determines whether data prior to the audience being created is included when determining audience membership. Note that including historical data may be needed in order to properly handle the definition specified. In these cases, Segment will automatically handle including historical data and the response will return the includeHistoricalData parameter as true.")
3030
include_anonymous_users: Optional[StrictBool] = Field(None, alias="includeAnonymousUsers", description="Determines whether anonymous users should be included when determining audience membership.")
31-
__properties = ["includeHistoricalData", "includeAnonymousUsers"]
31+
filter_by_external_ids: Optional[conlist(StrictStr)] = Field(None, alias="filterByExternalIds", description="The set of profile external identifiers being used to determine audience membership. Profiles will only be considered for audience membership if the profile has at least one external id whose key matches a value in this set.")
32+
backfill_event_data_days: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="backfillEventDataDays", description="If specified, the value of this field indicates the number of days, specified from the date the audience was created, that event data will be included from when determining audience membership. If unspecified, defer to the value of `includeHistoricalData` to determine whether historical data is either entirely included or entirely excluded when determining audience membership.")
33+
__properties = ["includeHistoricalData", "includeAnonymousUsers", "filterByExternalIds", "backfillEventDataDays"]
3234

3335
class Config:
3436
"""Pydantic configuration"""
@@ -67,7 +69,9 @@ def from_dict(cls, obj: dict) -> AudienceOptions:
6769

6870
_obj = AudienceOptions.parse_obj({
6971
"include_historical_data": obj.get("includeHistoricalData"),
70-
"include_anonymous_users": obj.get("includeAnonymousUsers")
72+
"include_anonymous_users": obj.get("includeAnonymousUsers"),
73+
"filter_by_external_ids": obj.get("filterByExternalIds"),
74+
"backfill_event_data_days": obj.get("backfillEventDataDays")
7175
})
7276
return _obj
7377

segment_public_api/models/audience_options_with_lookback.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ class AudienceOptionsWithLookback(BaseModel):
2727
AudienceOptionsWithLookback
2828
"""
2929
filter_by_external_ids: conlist(StrictStr) = Field(..., alias="filterByExternalIds", description="The set of profile external identifiers being used to determine audience membership. Profiles will only be considered for audience membership if the profile has at least one external id whose key matches a value in this set.")
30-
backfill_event_data_days: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="backfillEventDataDays", description="If specified, the value of this field indicates the number of days, specified from the date the audience was created, that event data will be included from when determining audience membership. If unspecified, defer to the value of `includeHistoricalData` to determine whether historical data is either entirely included or entirely excluded when determining audience membership.")
3130
include_historical_data: Optional[StrictBool] = Field(None, alias="includeHistoricalData", description="Determines whether data prior to the audience being created is included when determining audience membership. Note that including historical data may be needed in order to properly handle the definition specified. In these cases, Segment will automatically handle including historical data and the response will return the includeHistoricalData parameter as true.")
3231
include_anonymous_users: Optional[StrictBool] = Field(None, alias="includeAnonymousUsers", description="Determines whether anonymous users should be included when determining audience membership.")
33-
__properties = ["filterByExternalIds", "backfillEventDataDays", "includeHistoricalData", "includeAnonymousUsers"]
32+
backfill_event_data_days: Optional[Union[StrictFloat, StrictInt]] = Field(None, alias="backfillEventDataDays", description="If specified, the value of this field indicates the number of days, specified from the date the audience was created, that event data will be included from when determining audience membership. If unspecified, defer to the value of `includeHistoricalData` to determine whether historical data is either entirely included or entirely excluded when determining audience membership.")
33+
__properties = ["filterByExternalIds", "includeHistoricalData", "includeAnonymousUsers", "backfillEventDataDays"]
3434

3535
class Config:
3636
"""Pydantic configuration"""
@@ -69,9 +69,9 @@ def from_dict(cls, obj: dict) -> AudienceOptionsWithLookback:
6969

7070
_obj = AudienceOptionsWithLookback.parse_obj({
7171
"filter_by_external_ids": obj.get("filterByExternalIds"),
72-
"backfill_event_data_days": obj.get("backfillEventDataDays"),
7372
"include_historical_data": obj.get("includeHistoricalData"),
74-
"include_anonymous_users": obj.get("includeAnonymousUsers")
73+
"include_anonymous_users": obj.get("includeAnonymousUsers"),
74+
"backfill_event_data_days": obj.get("backfillEventDataDays")
7575
})
7676
return _obj
7777

segment_public_api/models/audience_summary.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222
from typing import Optional
23-
from pydantic import BaseModel, Field, StrictBool, StrictStr
23+
from pydantic import BaseModel, Field, StrictBool, StrictStr, validator
2424
from segment_public_api.models.audience_definition import AudienceDefinition
2525
from segment_public_api.models.audience_options import AudienceOptions
2626

@@ -40,8 +40,16 @@ class AudienceSummary(BaseModel):
4040
updated_by: StrictStr = Field(..., alias="updatedBy", description="User id who last updated the audience.")
4141
created_at: StrictStr = Field(..., alias="createdAt", description="Date the audience was created.")
4242
updated_at: StrictStr = Field(..., alias="updatedAt", description="Date the audience was last updated.")
43+
audience_type: StrictStr = Field(..., alias="audienceType", description="Discriminator denoting the audience's product type.")
4344
options: Optional[AudienceOptions] = None
44-
__properties = ["id", "spaceId", "name", "description", "key", "enabled", "definition", "status", "createdBy", "updatedBy", "createdAt", "updatedAt", "options"]
45+
__properties = ["id", "spaceId", "name", "description", "key", "enabled", "definition", "status", "createdBy", "updatedBy", "createdAt", "updatedAt", "audienceType", "options"]
46+
47+
@validator('audience_type')
48+
def audience_type_validate_enum(cls, value):
49+
"""Validates the enum"""
50+
if value not in ('ACCOUNTS', 'LINKED', 'USERS'):
51+
raise ValueError("must be one of enum values ('ACCOUNTS', 'LINKED', 'USERS')")
52+
return value
4553

4654
class Config:
4755
"""Pydantic configuration"""
@@ -102,6 +110,7 @@ def from_dict(cls, obj: dict) -> AudienceSummary:
102110
"updated_by": obj.get("updatedBy"),
103111
"created_at": obj.get("createdAt"),
104112
"updated_at": obj.get("updatedAt"),
113+
"audience_type": obj.get("audienceType"),
105114
"options": AudienceOptions.from_dict(obj.get("options")) if obj.get("options") is not None else None
106115
})
107116
return _obj

segment_public_api/models/audience_summary_with_audience_type_and_lookback.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class AudienceSummaryWithAudienceTypeAndLookback(BaseModel):
3131
"""
3232
AudienceSummaryWithAudienceTypeAndLookback
3333
"""
34-
audience_type: StrictStr = Field(..., alias="audienceType", description="Discriminator denoting the audience's product type.")
3534
compute_cadence: AudienceComputeCadence = Field(..., alias="computeCadence")
3635
size: Optional[AudienceSize] = None
3736
options: Optional[AudienceOptionsWithLookback] = None
@@ -48,7 +47,8 @@ class AudienceSummaryWithAudienceTypeAndLookback(BaseModel):
4847
updated_by: StrictStr = Field(..., alias="updatedBy", description="User id who last updated the audience.")
4948
created_at: StrictStr = Field(..., alias="createdAt", description="Date the audience was created.")
5049
updated_at: StrictStr = Field(..., alias="updatedAt", description="Date the audience was last updated.")
51-
__properties = ["audienceType", "computeCadence", "size", "options", "schedules", "id", "spaceId", "name", "description", "key", "enabled", "definition", "status", "createdBy", "updatedBy", "createdAt", "updatedAt"]
50+
audience_type: StrictStr = Field(..., alias="audienceType", description="Discriminator denoting the audience's product type.")
51+
__properties = ["computeCadence", "size", "options", "schedules", "id", "spaceId", "name", "description", "key", "enabled", "definition", "status", "createdBy", "updatedBy", "createdAt", "updatedAt", "audienceType"]
5252

5353
@validator('audience_type')
5454
def audience_type_validate_enum(cls, value):
@@ -117,7 +117,6 @@ def from_dict(cls, obj: dict) -> AudienceSummaryWithAudienceTypeAndLookback:
117117
return AudienceSummaryWithAudienceTypeAndLookback.parse_obj(obj)
118118

119119
_obj = AudienceSummaryWithAudienceTypeAndLookback.parse_obj({
120-
"audience_type": obj.get("audienceType"),
121120
"compute_cadence": AudienceComputeCadence.from_dict(obj.get("computeCadence")) if obj.get("computeCadence") is not None else None,
122121
"size": AudienceSize.from_dict(obj.get("size")) if obj.get("size") is not None else None,
123122
"options": AudienceOptionsWithLookback.from_dict(obj.get("options")) if obj.get("options") is not None else None,
@@ -133,7 +132,8 @@ def from_dict(cls, obj: dict) -> AudienceSummaryWithAudienceTypeAndLookback:
133132
"created_by": obj.get("createdBy"),
134133
"updated_by": obj.get("updatedBy"),
135134
"created_at": obj.get("createdAt"),
136-
"updated_at": obj.get("updatedAt")
135+
"updated_at": obj.get("updatedAt"),
136+
"audience_type": obj.get("audienceType")
137137
})
138138
return _obj
139139

0 commit comments

Comments
 (0)