Skip to content

Commit a4c84af

Browse files
author
klaviyo-sdk
committed
version 12.0.0
1 parent e291820 commit a4c84af

12 files changed

Lines changed: 198 additions & 123 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ 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+
## [12.0.0] - revision 2024-10-15
11+
### Added
12+
- Sample Change
13+
1014
## [11.0.0] - revision 2024-10-15
1115
### Added
1216
- Universal Content API

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Klaviyo PHP SDK
22

3-
- SDK version: 11.0.0
3+
- SDK version: 12.0.0
44
- API Revision: 2024-10-15
55

66
## Helpful Resources
@@ -114,9 +114,8 @@ require_once(__DIR__ . '/vendor/autoload.php');
114114
use KlaviyoAPI\KlaviyoAPI;
115115

116116
$klaviyo = new KlaviyoAPI(
117-
'YOUR_API_KEY',
118-
$num_retries = 3,
119-
$wait_seconds = 3,
117+
'YOUR_API_KEY',
118+
$num_retries = 3,
120119
$guzzle_options = [],
121120
$user_agent_suffix = "/YOUR_APP_NAME");
122121

@@ -227,7 +226,7 @@ klaviyo.Images.upload_image_from_file(file, name=name)
227226

228227
* The SDK retries on resolvable errors, namely: rate limits (common) and server errors on Klaviyo's end (rare).
229228
* The keyword arguments in the example above define retry behavior
230-
* `wait_seconds` denotes how long to wait per retry, in *seconds*
229+
* The time interval between retries is calculated using exponential backoff and the `Retry-After` header
231230
* If you wish to disable retries, set `$num_retries = 0`
232231
* the example is populated with the default values
233232
* non-resolvable errors and resolvable errors which have timed out throw an `ApiException`, detailed below.
@@ -3336,11 +3335,15 @@ $klaviyo->Profiles->createProfileSuppressionBulkDeleteJob($body);
33363335

33373336
# $body | associative array
33383337

3339-
$klaviyo->Profiles->createOrUpdateProfile($body);
3338+
## Keyword Arguments
3339+
3340+
# $additional_fields_profile | string[]
3341+
3342+
$klaviyo->Profiles->createOrUpdateProfile($body, $additional_fields_profile=$additional_fields_profile);
33403343
```
33413344
##### Method alias:
33423345
```php
3343-
$klaviyo->Profiles->createProfileImport($body);
3346+
$klaviyo->Profiles->createProfileImport($body, $additional_fields_profile=$additional_fields_profile);
33443347
```
33453348

33463349

@@ -3353,7 +3356,11 @@ $klaviyo->Profiles->createProfileImport($body);
33533356

33543357
# $body | associative array
33553358

3356-
$klaviyo->Profiles->createProfile($body);
3359+
## Keyword Arguments
3360+
3361+
# $additional_fields_profile | string[]
3362+
3363+
$klaviyo->Profiles->createProfile($body, $additional_fields_profile=$additional_fields_profile);
33573364
```
33583365

33593366

@@ -3798,7 +3805,11 @@ $klaviyo->Profiles->createProfileBulkImportJob($body);
37983805
# $id | string
37993806
# $body | associative array
38003807

3801-
$klaviyo->Profiles->updateProfile($id, $body);
3808+
## Keyword Arguments
3809+
3810+
# $additional_fields_profile | string[]
3811+
3812+
$klaviyo->Profiles->updateProfile($id, $body, $additional_fields_profile=$additional_fields_profile);
38023813
```
38033814

38043815

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "klaviyo/api",
3-
"version": "11.0.0",
3+
"version": "12.0.0",
44
"description": "PHP SDK for Klaviyo's API.",
55
"keywords": [
66
"openapitools",

lib/API/ProfilesApi.php

Lines changed: 69 additions & 27 deletions
Large diffs are not rendered by default.

lib/Configuration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class Configuration
101101
*
102102
* @var string
103103
*/
104-
protected $userAgent = 'klaviyo-api-php/11.0.0';
104+
protected $userAgent = 'klaviyo-api-php/12.0.0';
105105

106106
/**
107107
* Debug switch (default set to false)
@@ -434,7 +434,7 @@ public static function toDebugReport()
434434
$report .= ' OS: ' . php_uname() . PHP_EOL;
435435
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
436436
$report .= ' The version of the OpenAPI document: 2024-10-15' . PHP_EOL;
437-
$report .= ' SDK Package Version: 11.0.0' . PHP_EOL;
437+
$report .= ' SDK Package Version: 12.0.0' . PHP_EOL;
438438
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
439439

440440
return $report;

lib/KlaviyoAPI.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ class KlaviyoAPI {
5656

5757

5858

59-
public function __construct($api_key, $num_retries = 3, $wait_seconds = 3, $guzzle_options = [], $user_agent_suffix = "") {
59+
public function __construct($api_key, $num_retries = 3, $wait_seconds = null, $guzzle_options = [], $user_agent_suffix = "") {
6060

6161
if (gettype($num_retries) == 'NULL'){
6262
$num_retries = 3;
6363
}
6464

65-
if (gettype($wait_seconds) == 'NULL'){
66-
$wait_seconds = 3;
65+
if ($wait_seconds !== null){
66+
trigger_error("The 'wait_seconds' parameter is deprecated and will be removed in a future version. Please remove this to enable exponential backoff for retry intervals.", E_USER_WARNING);
6767
}
6868

6969
$this->api_key = $api_key;

lib/Model/DeviceMetadata.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ public function getModelName()
286286
}
287287

288288
public const KLAVIYO_SDK_ANDROID = 'android';
289+
public const KLAVIYO_SDK_FLUTTER_COMMUNITY = 'flutter_community';
289290
public const KLAVIYO_SDK_REACT_NATIVE = 'react_native';
290291
public const KLAVIYO_SDK_SWIFT = 'swift';
291292
public const OS_NAME_ANDROID = 'android';
@@ -305,6 +306,7 @@ public function getKlaviyoSdkAllowableValues()
305306
{
306307
return [
307308
self::KLAVIYO_SDK_ANDROID,
309+
self::KLAVIYO_SDK_FLUTTER_COMMUNITY,
308310
self::KLAVIYO_SDK_REACT_NATIVE,
309311
self::KLAVIYO_SDK_SWIFT,
310312
];

lib/Model/FormSeriesRequestDTOResourceObjectAttributes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ public function getGroupBy()
514514
/**
515515
* Sets group_by
516516
*
517-
* @param string[]|null $group_by List of attributes to group the data by. Allowed group-bys are form_id, form_version_id. If not passed in, the data will be grouped by form_id. If a group by has prerequisites, they must be passed in together. The prerequisites for form_version_id is form_id
517+
* @param string[]|null $group_by List of attributes to group the data by. Allowed group-bys are form_version_id, form_id. If not passed in, the data will be grouped by form_id. If a group by has prerequisites, they must be passed in together. The prerequisites for form_version_id is form_id
518518
*
519519
* @return self
520520
*/
@@ -559,7 +559,7 @@ public function getFilter()
559559
/**
560560
* Sets filter
561561
*
562-
* @param string|null $filter API filter string used to filter the query. Allowed filters are form_id, form_version_id. Allowed operators are equals, any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter.
562+
* @param string|null $filter API filter string used to filter the query. Allowed filters are form_version_id, form_id. Allowed operators are equals, any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter.
563563
*
564564
* @return self
565565
*/

lib/Model/FormValuesRequestDTOResourceObjectAttributes.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ public function getGroupBy()
437437
/**
438438
* Sets group_by
439439
*
440-
* @param string[]|null $group_by List of attributes to group the data by. Allowed group-bys are form_id, form_version_id. If not passed in, the data will be grouped by form_id. If a group by has prerequisites, they must be passed in together. The prerequisites for form_version_id is form_id
440+
* @param string[]|null $group_by List of attributes to group the data by. Allowed group-bys are form_version_id, form_id. If not passed in, the data will be grouped by form_id. If a group by has prerequisites, they must be passed in together. The prerequisites for form_version_id is form_id
441441
*
442442
* @return self
443443
*/
@@ -482,7 +482,7 @@ public function getFilter()
482482
/**
483483
* Sets filter
484484
*
485-
* @param string|null $filter API filter string used to filter the query. Allowed filters are form_id, form_version_id. Allowed operators are equals, any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter.
485+
* @param string|null $filter API filter string used to filter the query. Allowed filters are form_version_id, form_id. Allowed operators are equals, any. Only one filter can be used per attribute, only AND can be used as a combination operator. Max of 100 messages per ANY filter.
486486
*
487487
* @return self
488488
*/

lib/Model/HTMLBlockData.php

Lines changed: 6 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ class HTMLBlockData implements ModelInterface, ArrayAccess, \JsonSerializable
5959
*/
6060
protected static $openAPITypes = [
6161
'content' => 'string',
62-
'display_options' => '\KlaviyoAPI\Model\BlockDisplayOptions',
63-
'styles' => 'string'
62+
'display_options' => '\KlaviyoAPI\Model\BlockDisplayOptions'
6463
];
6564

6665
/**
@@ -72,8 +71,7 @@ class HTMLBlockData implements ModelInterface, ArrayAccess, \JsonSerializable
7271
*/
7372
protected static $openAPIFormats = [
7473
'content' => null,
75-
'display_options' => null,
76-
'styles' => null
74+
'display_options' => null
7775
];
7876

7977
/**
@@ -83,8 +81,7 @@ class HTMLBlockData implements ModelInterface, ArrayAccess, \JsonSerializable
8381
*/
8482
protected static array $openAPINullables = [
8583
'content' => false,
86-
'display_options' => false,
87-
'styles' => true
84+
'display_options' => false
8885
];
8986

9087
/**
@@ -164,8 +161,7 @@ public function isNullableSetToNull(string $property): bool
164161
*/
165162
protected static $attributeMap = [
166163
'content' => 'content',
167-
'display_options' => 'display_options',
168-
'styles' => 'styles'
164+
'display_options' => 'display_options'
169165
];
170166

171167
/**
@@ -175,8 +171,7 @@ public function isNullableSetToNull(string $property): bool
175171
*/
176172
protected static $setters = [
177173
'content' => 'setContent',
178-
'display_options' => 'setDisplayOptions',
179-
'styles' => 'setStyles'
174+
'display_options' => 'setDisplayOptions'
180175
];
181176

182177
/**
@@ -186,8 +181,7 @@ public function isNullableSetToNull(string $property): bool
186181
*/
187182
protected static $getters = [
188183
'content' => 'getContent',
189-
'display_options' => 'getDisplayOptions',
190-
'styles' => 'getStyles'
184+
'display_options' => 'getDisplayOptions'
191185
];
192186

193187
/**
@@ -249,7 +243,6 @@ public function __construct(array $data = null)
249243
{
250244
$this->setIfExists('content', $data ?? [], null);
251245
$this->setIfExists('display_options', $data ?? [], null);
252-
$this->setIfExists('styles', $data ?? [], null);
253246
}
254247

255248
/**
@@ -357,42 +350,6 @@ public function setDisplayOptions($display_options)
357350

358351
return $this;
359352
}
360-
361-
/**
362-
* Gets styles
363-
*
364-
* @return string|null
365-
*/
366-
public function getStyles()
367-
{
368-
return $this->container['styles'];
369-
}
370-
371-
/**
372-
* Sets styles
373-
*
374-
* @param string|null $styles styles
375-
*
376-
* @return self
377-
*/
378-
public function setStyles($styles)
379-
{
380-
381-
if (is_null($styles)) {
382-
array_push($this->openAPINullablesSetToNull, 'styles');
383-
} else {
384-
$nullablesSetToNull = $this->getOpenAPINullablesSetToNull();
385-
$index = array_search('styles', $nullablesSetToNull);
386-
if ($index !== FALSE) {
387-
unset($nullablesSetToNull[$index]);
388-
$this->setOpenAPINullablesSetToNull($nullablesSetToNull);
389-
}
390-
}
391-
392-
$this->container['styles'] = $styles;
393-
394-
return $this;
395-
}
396353
/**
397354
* Returns true if offset exists. False otherwise.
398355
*

0 commit comments

Comments
 (0)