Skip to content

Commit 30121cb

Browse files
author
klaviyo-sdk
committed
version 12.1.0
1 parent 3072851 commit 30121cb

35 files changed

Lines changed: 11423 additions & 6178 deletions

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ 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.1.0] - revision 2024-10-15
11+
### Changed
12+
- Updated REAME to use named arguments
13+
- Some methods have been renamed- the old methods are now deprecated aliases
14+
1015
## [12.0.1] - revision 2024-10-15
1116
### Fixed
1217
- Updated [Uploading Image From File](https://github.com/klaviyo/klaviyo-api-php#uploading-image-from-file) section of README

README.md

Lines changed: 694 additions & 440 deletions
Large diffs are not rendered by default.

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": "12.0.1",
3+
"version": "12.1.0",
44
"description": "PHP SDK for Klaviyo's API.",
55
"keywords": [
66
"openapitools",

lib/API/CampaignsApi.php

Lines changed: 466 additions & 331 deletions
Large diffs are not rendered by default.

lib/API/CatalogsApi.php

Lines changed: 636 additions & 83 deletions
Large diffs are not rendered by default.

lib/API/CouponsApi.php

Lines changed: 324 additions & 175 deletions
Large diffs are not rendered by default.

lib/API/EventsApi.php

Lines changed: 326 additions & 236 deletions
Large diffs are not rendered by default.

lib/API/FlowsApi.php

Lines changed: 1005 additions & 780 deletions
Large diffs are not rendered by default.

lib/API/FormsApi.php

Lines changed: 162 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,14 +2165,18 @@ public function getFormsRequest($fields_form = null, $filter = null, $page_curso
21652165
* Get Version IDs for Form
21662166
*
21672167
* @param string $id The ID of the form (required)
2168+
* @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`form_type`: `any`, `equals`<br>`status`: `equals`<br>`updated_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`created_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than` (optional)
2169+
* @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional)
2170+
* @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20)
2171+
* @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional)
21682172
*
21692173
* @throws \KlaviyoAPI\ApiException on non-2xx response
21702174
* @throws \InvalidArgumentException
21712175
* @return array<string,mixed>|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response
21722176
*/
2173-
public function getVersionIdsForForm($id, $apiKey = null)
2177+
public function getVersionIdsForForm($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null)
21742178
{
2175-
list($response) = $this->getVersionIdsForFormWithHttpInfo($id, $apiKey);
2179+
list($response) = $this->getVersionIdsForFormWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey);
21762180
return $response;
21772181
}
21782182

@@ -2185,20 +2189,33 @@ public function getFormRelationshipsFormVersions(...$args) {
21852189
return $this->getVersionIdsForForm(...$args);
21862190
}
21872191

2192+
/**
2193+
* Alias of `getVersionIdsForForm`
2194+
*
2195+
* @deprecated use `getVersionIdsForForm` instead
2196+
*/
2197+
public function getFormRelationshipsVersions(...$args) {
2198+
return $this->getVersionIdsForForm(...$args);
2199+
}
2200+
21882201
/**
21892202
* Operation getVersionIdsForFormWithHttpInfo
21902203
*
21912204
* Get Version IDs for Form
21922205
*
21932206
* @param string $id The ID of the form (required)
2207+
* @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;form_type&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;status&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;updated_at&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60;&lt;br&gt;&#x60;created_at&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60; (optional)
2208+
* @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional)
2209+
* @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20)
2210+
* @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional)
21942211
*
21952212
* @throws \KlaviyoAPI\ApiException on non-2xx response
21962213
* @throws \InvalidArgumentException
21972214
* @return array of array<string,mixed>|\KlaviyoAPI\Model\GetAccounts400Response|\KlaviyoAPI\Model\GetAccounts400Response, HTTP status code, HTTP response headers (array of strings)
21982215
*/
2199-
public function getVersionIdsForFormWithHttpInfo($id, $apiKey = null)
2216+
public function getVersionIdsForFormWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null)
22002217
{
2201-
$request = $this->getVersionIdsForFormRequest($id, $apiKey);
2218+
$request = $this->getVersionIdsForFormRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey);
22022219

22032220
try {
22042221
$options = $this->createHttpClientOption();
@@ -2362,19 +2379,32 @@ public function getFormRelationshipsFormVersionsWithHttpInfo(...$args) {
23622379
return $this->getVersionIdsForFormWithHttpInfo(...$args);
23632380
}
23642381

2382+
/**
2383+
* Alias of `getVersionIdsForFormWithHttpInfo`
2384+
*
2385+
* @deprecated use `getVersionIdsForFormWithHttpInfo` instead
2386+
*/
2387+
public function getFormRelationshipsVersionsWithHttpInfo(...$args) {
2388+
return $this->getVersionIdsForFormWithHttpInfo(...$args);
2389+
}
2390+
23652391
/**
23662392
* Operation getVersionIdsForFormAsync
23672393
*
23682394
* Get Version IDs for Form
23692395
*
23702396
* @param string $id The ID of the form (required)
2397+
* @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;form_type&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;status&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;updated_at&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60;&lt;br&gt;&#x60;created_at&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60; (optional)
2398+
* @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional)
2399+
* @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20)
2400+
* @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional)
23712401
*
23722402
* @throws \InvalidArgumentException
23732403
* @return \GuzzleHttp\Promise\PromiseInterface
23742404
*/
2375-
public function getVersionIdsForFormAsync($id, $apiKey = null)
2405+
public function getVersionIdsForFormAsync($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null)
23762406
{
2377-
return $this->getVersionIdsForFormAsyncWithHttpInfo($id, $apiKey)
2407+
return $this->getVersionIdsForFormAsyncWithHttpInfo($id, $filter, $page_cursor, $page_size, $sort, $apiKey)
23782408
->then(
23792409
function ($response) {
23802410
return $response[0];
@@ -2391,20 +2421,33 @@ public function getFormRelationshipsFormVersionsAsync(...$args) {
23912421
return $this->getVersionIdsForFormAsync(...$args);
23922422
}
23932423

2424+
/**
2425+
* Alias of `getVersionIdsForFormAsync`
2426+
*
2427+
* @deprecated use `getVersionIdsForFormAsync` instead
2428+
*/
2429+
public function getFormRelationshipsVersionsAsync(...$args) {
2430+
return $this->getVersionIdsForFormAsync(...$args);
2431+
}
2432+
23942433
/**
23952434
* Operation getVersionIdsForFormAsyncWithHttpInfo
23962435
*
23972436
* Get Version IDs for Form
23982437
*
23992438
* @param string $id The ID of the form (required)
2439+
* @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;form_type&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;status&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;updated_at&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60;&lt;br&gt;&#x60;created_at&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60; (optional)
2440+
* @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional)
2441+
* @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20)
2442+
* @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional)
24002443
*
24012444
* @throws \InvalidArgumentException
24022445
* @return \GuzzleHttp\Promise\PromiseInterface
24032446
*/
2404-
public function getVersionIdsForFormAsyncWithHttpInfo($id, $apiKey = null)
2447+
public function getVersionIdsForFormAsyncWithHttpInfo($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null)
24052448
{
24062449
$returnType = 'array<string,mixed>';
2407-
$request = $this->getVersionIdsForFormRequest($id, $apiKey);
2450+
$request = $this->getVersionIdsForFormRequest($id, $filter, $page_cursor, $page_size, $sort, $apiKey);
24082451

24092452
return $this->client
24102453
->sendAsync($request, $this->createHttpClientOption())
@@ -2456,22 +2499,42 @@ public function getFormRelationshipsFormVersionsAsyncWithHttpInfo(...$args) {
24562499
return $this->getVersionIdsForFormAsyncWithHttpInfo(...$args);
24572500
}
24582501

2502+
/**
2503+
* Alias of `getVersionIdsForFormAsyncWithHttpInfo`
2504+
*
2505+
* @deprecated use `getVersionIdsForFormAsyncWithHttpInfo` instead
2506+
*/
2507+
public function getFormRelationshipsVersionsAsyncWithHttpInfo(...$args) {
2508+
return $this->getVersionIdsForFormAsyncWithHttpInfo(...$args);
2509+
}
2510+
24592511
/**
24602512
* Create request for operation 'getVersionIdsForForm'
24612513
*
24622514
* @param string $id The ID of the form (required)
2515+
* @param string $filter For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#filtering&lt;br&gt;Allowed field(s)/operator(s):&lt;br&gt;&#x60;form_type&#x60;: &#x60;any&#x60;, &#x60;equals&#x60;&lt;br&gt;&#x60;status&#x60;: &#x60;equals&#x60;&lt;br&gt;&#x60;updated_at&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60;&lt;br&gt;&#x60;created_at&#x60;: &#x60;greater-or-equal&#x60;, &#x60;greater-than&#x60;, &#x60;less-or-equal&#x60;, &#x60;less-than&#x60; (optional)
2516+
* @param string $page_cursor For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#pagination (optional)
2517+
* @param int $page_size Default: 20. Min: 1. Max: 100. (optional, default to 20)
2518+
* @param string $sort For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sorting (optional)
24632519
*
24642520
* @throws \InvalidArgumentException
24652521
* @return \GuzzleHttp\Psr7\Request
24662522
*/
2467-
public function getVersionIdsForFormRequest($id, $apiKey = null)
2523+
public function getVersionIdsForFormRequest($id, $filter = null, $page_cursor = null, $page_size = 20, $sort = null, $apiKey = null)
24682524
{
24692525
// verify the required parameter 'id' is set
24702526
if ($id === null || (is_array($id) && count($id) === 0)) {
24712527
throw new \InvalidArgumentException(
24722528
'Missing the required parameter $id when calling getVersionIdsForForm'
24732529
);
24742530
}
2531+
if ($page_size !== null && $page_size > 100) {
2532+
throw new \InvalidArgumentException('invalid value for "$page_size" when calling FormsApi.getVersionIdsForForm, must be smaller than or equal to 100.');
2533+
}
2534+
if ($page_size !== null && $page_size < 1) {
2535+
throw new \InvalidArgumentException('invalid value for "$page_size" when calling FormsApi.getVersionIdsForForm, must be bigger than or equal to 1.');
2536+
}
2537+
24752538

24762539
$resourcePath = '/api/forms/{id}/relationships/form-versions';
24772540
$formParams = [];
@@ -2480,6 +2543,42 @@ public function getVersionIdsForFormRequest($id, $apiKey = null)
24802543
$httpBody = '';
24812544
$multipart = false;
24822545

2546+
// query params
2547+
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
2548+
$filter,
2549+
'filter', // param base name
2550+
'string', // openApiType
2551+
'form', // style
2552+
true, // explode
2553+
false // required
2554+
) ?? []);
2555+
// query params
2556+
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
2557+
$page_cursor,
2558+
'page[cursor]', // param base name
2559+
'string', // openApiType
2560+
'form', // style
2561+
true, // explode
2562+
false // required
2563+
) ?? []);
2564+
// query params
2565+
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
2566+
$page_size,
2567+
'page[size]', // param base name
2568+
'integer', // openApiType
2569+
'form', // style
2570+
true, // explode
2571+
false // required
2572+
) ?? []);
2573+
// query params
2574+
$queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue(
2575+
$sort,
2576+
'sort', // param base name
2577+
'string', // openApiType
2578+
'form', // style
2579+
true, // explode
2580+
false // required
2581+
) ?? []);
24832582

24842583

24852584
// path params
@@ -2569,6 +2668,15 @@ public function getFormRelationshipsFormVersionsRequest(...$args) {
25692668
return $this->getVersionIdsForFormRequest(...$args);
25702669
}
25712670

2671+
/**
2672+
* Alias of `getVersionIdsForFormRequest`
2673+
*
2674+
* @deprecated use `getVersionIdsForFormRequest` instead
2675+
*/
2676+
public function getFormRelationshipsVersionsRequest(...$args) {
2677+
return $this->getVersionIdsForFormRequest(...$args);
2678+
}
2679+
25722680
/**
25732681
* Operation getVersionsForForm
25742682
*
@@ -2600,6 +2708,15 @@ public function getFormFormVersions(...$args) {
26002708
return $this->getVersionsForForm(...$args);
26012709
}
26022710

2711+
/**
2712+
* Alias of `getVersionsForForm`
2713+
*
2714+
* @deprecated use `getVersionsForForm` instead
2715+
*/
2716+
public function getFormVersions(...$args) {
2717+
return $this->getVersionsForForm(...$args);
2718+
}
2719+
26032720
/**
26042721
* Operation getVersionsForFormWithHttpInfo
26052722
*
@@ -2782,6 +2899,15 @@ public function getFormFormVersionsWithHttpInfo(...$args) {
27822899
return $this->getVersionsForFormWithHttpInfo(...$args);
27832900
}
27842901

2902+
/**
2903+
* Alias of `getVersionsForFormWithHttpInfo`
2904+
*
2905+
* @deprecated use `getVersionsForFormWithHttpInfo` instead
2906+
*/
2907+
public function getFormVersionsWithHttpInfo(...$args) {
2908+
return $this->getVersionsForFormWithHttpInfo(...$args);
2909+
}
2910+
27852911
/**
27862912
* Operation getVersionsForFormAsync
27872913
*
@@ -2816,6 +2942,15 @@ public function getFormFormVersionsAsync(...$args) {
28162942
return $this->getVersionsForFormAsync(...$args);
28172943
}
28182944

2945+
/**
2946+
* Alias of `getVersionsForFormAsync`
2947+
*
2948+
* @deprecated use `getVersionsForFormAsync` instead
2949+
*/
2950+
public function getFormVersionsAsync(...$args) {
2951+
return $this->getVersionsForFormAsync(...$args);
2952+
}
2953+
28192954
/**
28202955
* Operation getVersionsForFormAsyncWithHttpInfo
28212956
*
@@ -2886,6 +3021,15 @@ public function getFormFormVersionsAsyncWithHttpInfo(...$args) {
28863021
return $this->getVersionsForFormAsyncWithHttpInfo(...$args);
28873022
}
28883023

3024+
/**
3025+
* Alias of `getVersionsForFormAsyncWithHttpInfo`
3026+
*
3027+
* @deprecated use `getVersionsForFormAsyncWithHttpInfo` instead
3028+
*/
3029+
public function getFormVersionsAsyncWithHttpInfo(...$args) {
3030+
return $this->getVersionsForFormAsyncWithHttpInfo(...$args);
3031+
}
3032+
28893033
/**
28903034
* Create request for operation 'getVersionsForForm'
28913035
*
@@ -3056,6 +3200,15 @@ public function getFormFormVersionsRequest(...$args) {
30563200
return $this->getVersionsForFormRequest(...$args);
30573201
}
30583202

3203+
/**
3204+
* Alias of `getVersionsForFormRequest`
3205+
*
3206+
* @deprecated use `getVersionsForFormRequest` instead
3207+
*/
3208+
public function getFormVersionsRequest(...$args) {
3209+
return $this->getVersionsForFormRequest(...$args);
3210+
}
3211+
30593212
/**
30603213
* Create http client option
30613214
*

0 commit comments

Comments
 (0)