Skip to content

Commit f54ac95

Browse files
authored
Merge pull request #1 from klaviyo/20221025-jonb-segment-profiles-fix
removed autogen setup.cfg, regenerated with new spec (get_segment_pro…
2 parents a6fc24a + f0db0ff commit f54ac95

9 files changed

Lines changed: 49 additions & 14 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Klaviyo Python SDK
22

3-
- SDK version: 1.0.1
3+
- SDK version: 1.0.2
44
- API revision: 2022-10-17
55

66
## Helpful Resources
@@ -1740,10 +1740,11 @@ klaviyo.Segments.get_segment(id, fields_segment=fields_segment);
17401740

17411741
## Keyword Arguments
17421742

1743+
# fields_profile | [str]
17431744
# filter | str
17441745
# page_cursor | str
17451746

1746-
klaviyo.Segments.get_segment_profiles(segment_id, filter=filter, page_cursor=page_cursor);
1747+
klaviyo.Segments.get_segment_profiles(segment_id, fields_profile=fields_profile, filter=filter, page_cursor=page_cursor);
17471748
```
17481749

17491750

openapi_client/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"""
1212

1313

14-
__version__ = "1.0.1"
14+
__version__ = "1.0.2"
1515

1616
# import ApiClient
1717
from openapi_client.api_client import ApiClient

openapi_client/api/events_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ def get_event_relationships(
916916
):
917917
"""Get Event Relationships # noqa: E501
918918
919-
Get metrics or profile [relationships](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#relationships) for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Profiles Read` # noqa: E501
919+
Get metrics or profile [relationships](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#relationships) for an event with the given event ID.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `Events Read` `Metrics Read` `Profiles Read` # noqa: E501
920920
This method makes a synchronous HTTP request by default. To make an
921921
asynchronous HTTP request, please pass async_req=True
922922

openapi_client/api/flows_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ def get_flow_action_messages(
13621362
):
13631363
"""Get Messages For Flow Action # noqa: E501
13641364
1365-
Get all flow messages associated with the given action ID. Flow messages can be sorted by the following fields, in ascending and descending order: `id`, `name`, `created`, `updated` Use filters to narrow your results. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 50 flows per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination). Offset pagination uses the following parameters: `page[size]` and `page[number]`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read` # noqa: E501
1365+
Get all flow messages associated with the given action ID. Flow messages can be sorted by the following fields, in ascending and descending order: ascending: `id`, `name`, `created`, `updated` descending: `-id`, `-name`, `-created`, `-updated` Use filters to narrow your results. Request specific fields using [sparse fieldsets](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#sparse-fieldsets). Returns a maximum of 50 flows per request, which can be paginated with [offset pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination). Offset pagination uses the following parameters: `page[size]` and `page[number]`<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Flows Read` # noqa: E501
13661366
This method makes a synchronous HTTP request by default. To make an
13671367
asynchronous HTTP request, please pass async_req=True
13681368

openapi_client/api/lists_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ def get_list_profiles(
10711071
):
10721072
"""Get List Profiles # noqa: E501
10731073
1074-
Get all profiles within a list with the given list ID. Use filters to narrow your results. Returns a maximum of 10 results per page, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `List Read` `Profiles Read` # noqa: E501
1074+
Get all profiles within a list with the given list ID. Filter to request a subset of all profiles. Profiles can be filtered by `email`, `phone_number`, and `push_token` fields. Returns a maximum of 10 results per page, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `List Read` `Profiles Read` # noqa: E501
10751075
This method makes a synchronous HTTP request by default. To make an
10761076
asynchronous HTTP request, please pass async_req=True
10771077
@@ -1244,7 +1244,7 @@ def get_lists(
12441244
):
12451245
"""Get Lists # noqa: E501
12461246
1247-
Get all lists in an account. Use filters to narrow your results. Returns a maximum of 10 results per page, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `List Read` # noqa: E501
1247+
Get all lists in an account. Filter to request a subset of all lists. Lists can be filtered by `id`, `name`, `created`, and `updated` fields. Returns a maximum of 10 results per page, which can be paginated with [cursor-based pagination](https://developers.klaviyo.com/en/v2022-10-17/reference/api_overview#pagination).<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `List Read` # noqa: E501
12481248
This method makes a synchronous HTTP request by default. To make an
12491249
asynchronous HTTP request, please pass async_req=True
12501250
@@ -1254,7 +1254,7 @@ def get_lists(
12541254
12551255
Keyword Args:
12561256
fields_list ([str]): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets. [optional]
1257-
filter (str): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`. [optional]
1257+
filter (str): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`. [optional]
12581258
page_cursor (str): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination. [optional]
12591259
_return_http_data_only (bool): response data without head status
12601260
code and headers. Default is True.

openapi_client/api/profiles_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1038,7 +1038,7 @@ def get_profile_relationships(
10381038
):
10391039
"""Get Profile Relationships # noqa: E501
10401040
1041-
Get list membership or segment membership relationships for a profile with the given profile ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Profiles Read` `Segments Read` # noqa: E501
1041+
Get list membership or segment membership relationships for a profile with the given profile ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `Lists Read` `Profiles Read` `Segments Read` # noqa: E501
10421042
This method makes a synchronous HTTP request by default. To make an
10431043
asynchronous HTTP request, please pass async_req=True
10441044

openapi_client/api/segments_api.py

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def __init__(self, api_client=None):
103103
)
104104
self.get_segment_profiles_endpoint = _Endpoint(
105105
settings={
106-
'response_type': None,
106+
'response_type': ({str: (bool, date, datetime, dict, float, int, list, str, none_type)},),
107107
'auth': [
108108
'Klaviyo-API-Key'
109109
],
@@ -115,6 +115,7 @@ def __init__(self, api_client=None):
115115
params_map={
116116
'all': [
117117
'segment_id',
118+
'fields_profile',
118119
'filter',
119120
'page_cursor',
120121
],
@@ -124,6 +125,7 @@ def __init__(self, api_client=None):
124125
'nullable': [
125126
],
126127
'enum': [
128+
'fields_profile',
127129
],
128130
'validation': [
129131
]
@@ -132,26 +134,57 @@ def __init__(self, api_client=None):
132134
'validations': {
133135
},
134136
'allowed_values': {
137+
('fields_profile',): {
138+
139+
"EMAIL": "email",
140+
"PHONE_NUMBER": "phone_number",
141+
"EXTERNAL_ID": "external_id",
142+
"ANONYMOUS_ID": "anonymous_id",
143+
"FIRST_NAME": "first_name",
144+
"LAST_NAME": "last_name",
145+
"ORGANIZATION": "organization",
146+
"TITLE": "title",
147+
"IMAGE": "image",
148+
"CREATED": "created",
149+
"UPDATED": "updated",
150+
"LAST_EVENT_DATE": "last_event_date",
151+
"LOCATION": "location",
152+
"LOCATION.ADDRESS1": "location.address1",
153+
"LOCATION.ADDRESS2": "location.address2",
154+
"LOCATION.CITY": "location.city",
155+
"LOCATION.COUNTRY": "location.country",
156+
"LOCATION.LATITUDE": "location.latitude",
157+
"LOCATION.LONGITUDE": "location.longitude",
158+
"LOCATION.REGION": "location.region",
159+
"LOCATION.ZIP": "location.zip",
160+
"LOCATION.TIMEZONE": "location.timezone",
161+
"PROPERTIES": "properties"
162+
},
135163
},
136164
'openapi_types': {
137165
'segment_id':
138166
(str,),
167+
'fields_profile':
168+
([str],),
139169
'filter':
140170
(str,),
141171
'page_cursor':
142172
(str,),
143173
},
144174
'attribute_map': {
145175
'segment_id': 'segment_id',
176+
'fields_profile': 'fields[profile]',
146177
'filter': 'filter',
147178
'page_cursor': 'page[cursor]',
148179
},
149180
'location_map': {
150181
'segment_id': 'path',
182+
'fields_profile': 'query',
151183
'filter': 'query',
152184
'page_cursor': 'query',
153185
},
154186
'collection_format_map': {
187+
'fields_profile': 'csv',
155188
}
156189
},
157190
headers_map={
@@ -457,6 +490,7 @@ def get_segment_profiles(
457490
segment_id (str):
458491
459492
Keyword Args:
493+
fields_profile ([str]): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets. [optional]
460494
filter (str): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`email`: `any`<br>`phone_number`: `any`<br>`push_token`: `any`<br>`_kx`: `equals`. [optional]
461495
page_cursor (str): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination. [optional]
462496
_return_http_data_only (bool): response data without head status
@@ -491,7 +525,7 @@ def get_segment_profiles(
491525
async_req (bool): execute request asynchronously
492526
493527
Returns:
494-
None
528+
{str: (bool, date, datetime, dict, float, int, list, str, none_type)}
495529
If the method is called asynchronously, returns the request
496530
thread.
497531
"""
@@ -628,7 +662,7 @@ def get_segments(
628662
629663
Keyword Args:
630664
fields_segment ([str]): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#sparse-fieldsets. [optional]
631-
filter (str): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`. [optional]
665+
filter (str): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`name`: `any`, `equals`<br>`id`: `any`, `equals`<br>`created`: `greater-than`<br>`updated`: `greater-than`. [optional]
632666
page_cursor (str): For more information please visit https://developers.klaviyo.com/en/v2022-10-17/reference/api-overview#pagination. [optional]
633667
_return_http_data_only (bool): response data without head status
634668
code and headers. Default is True.

openapi_client/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None,
7777
self.default_headers[header_name] = header_value
7878
self.cookie = cookie
7979
# Set default User-Agent.
80-
self.user_agent = 'klaviyo-python-sdk-beta/1.0.1'
80+
self.user_agent = 'klaviyo-python-sdk-beta/1.0.2'
8181

8282
def __enter__(self):
8383
return self

openapi_client/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def to_debug_report(self):
410410
"OS: {env}\n"\
411411
"Python Version: {pyversion}\n"\
412412
"Version of the API: 2022-10-17\n"\
413-
"SDK Package Version: 1.0.1".\
413+
"SDK Package Version: 1.0.2".\
414414
format(env=sys.platform, pyversion=sys.version)
415415

416416
def get_host_settings(self):

0 commit comments

Comments
 (0)