Skip to content

Commit 01bfb6a

Browse files
klaviyo-sdkklaviyo-sdk
and
klaviyo-sdk
authored
version 5.1.2 (#38)
Co-authored-by: klaviyo-sdk <[email protected]>
1 parent f090517 commit 01bfb6a

19 files changed

+203
-179
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
NOTE: For more granular API-specific changes, please see our [API Changelog](https://developers.klaviyo.com/en/docs/changelog_)
99

10+
## [5.1.2] - revision 2023-08-15
11+
12+
### Added
13+
14+
- override `api_key` with OAuth access token by setting client `access_token` keyword arg
15+
16+
1017
## [5.1.1] - revision 2023-08-15
1118

1219
### Fixed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Klaviyo Python SDK
22

3-
- SDK version: 5.1.1
3+
- SDK version: 5.1.2
44
- API revision: 2023-08-15
55

66
## Helpful Resources

klaviyo_api/wrapper.py

+12-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class KlaviyoAPI:
2929
max_delay: int = 60
3030
max_retries: int = 3
3131
test_host: str = ''
32+
access_token: str = None
33+
3234

3335
_REVISION = "2023-08-15"
3436

@@ -50,10 +52,18 @@ class KlaviyoAPI:
5052

5153
def __post_init__(self):
5254

53-
self.configuration = openapi_client.Configuration(
54-
api_key={'Klaviyo-API-Key':f'Klaviyo-API-Key {self.api_key}'}
55+
if self.access_token is not None:
56+
57+
self.configuration = openapi_client.Configuration(
58+
access_token=self.access_token
5559
)
5660

61+
elif self.api_key is not None:
62+
63+
self.configuration = openapi_client.Configuration(
64+
api_key={'Klaviyo-API-Key':f'Klaviyo-API-Key {self.api_key}'}
65+
)
66+
5767
if self.test_host:
5868
self.configuration.host = self.test_host
5969

openapi_client/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"""
1616

1717

18-
__version__ = "5.1.1"
18+
__version__ = "5.1.2"
1919

2020
# import apis into sdk package
2121
from openapi_client.api.accounts_api import AccountsApi

openapi_client/api/accounts_api.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ def get_account_with_http_info(self, id : Annotated[StrictStr, Field(..., descri
175175
['application/json']) # noqa: E501
176176

177177
# authentication setting
178-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
178+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
179179

180180
_response_types_map = {
181181
'200': "Dict[str, object]",
@@ -320,7 +320,7 @@ def get_accounts_with_http_info(self, fields_account : Annotated[Optional[conlis
320320
['application/json']) # noqa: E501
321321

322322
# authentication setting
323-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
323+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
324324

325325
_response_types_map = {
326326
'200': "Dict[str, object]",

openapi_client/api/campaigns_api.py

+23-23
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def create_campaign_with_http_info(self, campaign_create_query : Annotated[Campa
178178
_header_params['Content-Type'] = _content_types_list
179179

180180
# authentication setting
181-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
181+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
182182

183183
_response_types_map = {
184184
'201': "Dict[str, object]",
@@ -326,7 +326,7 @@ def create_campaign_clone_with_http_info(self, campaign_clone_query : Annotated[
326326
_header_params['Content-Type'] = _content_types_list
327327

328328
# authentication setting
329-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
329+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
330330

331331
_response_types_map = {
332332
'201': "Dict[str, object]",
@@ -474,7 +474,7 @@ def create_campaign_message_assign_template_with_http_info(self, campaign_messag
474474
_header_params['Content-Type'] = _content_types_list
475475

476476
# authentication setting
477-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
477+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
478478

479479
_response_types_map = {
480480
'201': "Dict[str, object]",
@@ -622,7 +622,7 @@ def create_campaign_recipient_estimation_job_with_http_info(self, campaign_recip
622622
_header_params['Content-Type'] = _content_types_list
623623

624624
# authentication setting
625-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
625+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
626626

627627
_response_types_map = {
628628
'202': "Dict[str, object]",
@@ -770,7 +770,7 @@ def create_campaign_send_job_with_http_info(self, campaign_send_job_create_query
770770
_header_params['Content-Type'] = _content_types_list
771771

772772
# authentication setting
773-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
773+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
774774

775775
_response_types_map = {
776776
'202': "Dict[str, object]",
@@ -911,7 +911,7 @@ def delete_campaign_with_http_info(self, id : Annotated[StrictStr, Field(..., de
911911
['application/json']) # noqa: E501
912912

913913
# authentication setting
914-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
914+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
915915

916916
_response_types_map = {}
917917

@@ -1096,7 +1096,7 @@ def get_campaign_with_http_info(self, id : Annotated[StrictStr, Field(..., descr
10961096
['application/json']) # noqa: E501
10971097

10981098
# authentication setting
1099-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
1099+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
11001100

11011101
_response_types_map = {
11021102
'200': "Dict[str, object]",
@@ -1285,7 +1285,7 @@ def get_campaign_campaign_messages_with_http_info(self, id : StrictStr, fields_c
12851285
['application/json']) # noqa: E501
12861286

12871287
# authentication setting
1288-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
1288+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
12891289

12901290
_response_types_map = {
12911291
'200': "Dict[str, object]",
@@ -1474,7 +1474,7 @@ def get_campaign_message_with_http_info(self, id : Annotated[StrictStr, Field(..
14741474
['application/json']) # noqa: E501
14751475

14761476
# authentication setting
1477-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
1477+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
14781478

14791479
_response_types_map = {
14801480
'200': "Dict[str, object]",
@@ -1627,7 +1627,7 @@ def get_campaign_message_campaign_with_http_info(self, id : StrictStr, fields_ca
16271627
['application/json']) # noqa: E501
16281628

16291629
# authentication setting
1630-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
1630+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
16311631

16321632
_response_types_map = {
16331633
'200': "Dict[str, object]",
@@ -1768,7 +1768,7 @@ def get_campaign_message_relationships_campaign_with_http_info(self, id : Strict
17681768
['application/json']) # noqa: E501
17691769

17701770
# authentication setting
1771-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
1771+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
17721772

17731773
_response_types_map = {
17741774
'200': "Dict[str, object]",
@@ -1909,7 +1909,7 @@ def get_campaign_message_relationships_template_with_http_info(self, id : Strict
19091909
['application/json']) # noqa: E501
19101910

19111911
# authentication setting
1912-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
1912+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
19131913

19141914
_response_types_map = {
19151915
'200': "Dict[str, object]",
@@ -2062,7 +2062,7 @@ def get_campaign_message_template_with_http_info(self, id : StrictStr, fields_te
20622062
['application/json']) # noqa: E501
20632063

20642064
# authentication setting
2065-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
2065+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
20662066

20672067
_response_types_map = {
20682068
'200': "Dict[str, object]",
@@ -2215,7 +2215,7 @@ def get_campaign_recipient_estimation_with_http_info(self, id : Annotated[Strict
22152215
['application/json']) # noqa: E501
22162216

22172217
# authentication setting
2218-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
2218+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
22192219

22202220
_response_types_map = {
22212221
'200': "Dict[str, object]",
@@ -2368,7 +2368,7 @@ def get_campaign_recipient_estimation_job_with_http_info(self, id : Annotated[St
23682368
['application/json']) # noqa: E501
23692369

23702370
# authentication setting
2371-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
2371+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
23722372

23732373
_response_types_map = {
23742374
'200': "Dict[str, object]",
@@ -2509,7 +2509,7 @@ def get_campaign_relationships_campaign_messages_with_http_info(self, id : Stric
25092509
['application/json']) # noqa: E501
25102510

25112511
# authentication setting
2512-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
2512+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
25132513

25142514
_response_types_map = {
25152515
'200': "Dict[str, object]",
@@ -2650,7 +2650,7 @@ def get_campaign_relationships_tags_with_http_info(self, id : StrictStr, **kwarg
26502650
['application/json']) # noqa: E501
26512651

26522652
# authentication setting
2653-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
2653+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
26542654

26552655
_response_types_map = {
26562656
'200': "Dict[str, object]",
@@ -2803,7 +2803,7 @@ def get_campaign_send_job_with_http_info(self, id : Annotated[StrictStr, Field(.
28032803
['application/json']) # noqa: E501
28042804

28052805
# authentication setting
2806-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
2806+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
28072807

28082808
_response_types_map = {
28092809
'200': "Dict[str, object]",
@@ -2956,7 +2956,7 @@ def get_campaign_tags_with_http_info(self, id : StrictStr, fields_tag : Annotate
29562956
['application/json']) # noqa: E501
29572957

29582958
# authentication setting
2959-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
2959+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
29602960

29612961
_response_types_map = {
29622962
'200': "Dict[str, object]",
@@ -3170,7 +3170,7 @@ def get_campaigns_with_http_info(self, filter : Annotated[StrictStr, Field(...,
31703170
['application/json']) # noqa: E501
31713171

31723172
# authentication setting
3173-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
3173+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
31743174

31753175
_response_types_map = {
31763176
'200': "Dict[str, object]",
@@ -3326,7 +3326,7 @@ def update_campaign_with_http_info(self, id : Annotated[StrictStr, Field(..., de
33263326
_header_params['Content-Type'] = _content_types_list
33273327

33283328
# authentication setting
3329-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
3329+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
33303330

33313331
_response_types_map = {
33323332
'200': "Dict[str, object]",
@@ -3482,7 +3482,7 @@ def update_campaign_message_with_http_info(self, id : Annotated[StrictStr, Field
34823482
_header_params['Content-Type'] = _content_types_list
34833483

34843484
# authentication setting
3485-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
3485+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
34863486

34873487
_response_types_map = {
34883488
'200': "Dict[str, object]",
@@ -3638,7 +3638,7 @@ def update_campaign_send_job_with_http_info(self, id : Annotated[StrictStr, Fiel
36383638
_header_params['Content-Type'] = _content_types_list
36393639

36403640
# authentication setting
3641-
_auth_settings = ['Klaviyo-API-Key'] # noqa: E501
3641+
_auth_settings = ['Klaviyo-API-Key', 'OAuth'] # noqa: E501
36423642

36433643
_response_types_map = {}
36443644

0 commit comments

Comments
 (0)