Skip to content

Commit 55db8fb

Browse files
Merge pull request #347 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents 60e2a6e + 16cbb53 commit 55db8fb

31 files changed

+378
-158
lines changed

changes.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
- :warning: changed property `triggerPattern` of type `CartDiscountPatternTarget` to be required
2121
- changed property `images` of type `ProductTailoringSetExternalImagesAction` to be optional
22+
- changed property `facets` of type `ProductProjectionPagedSearchResponse` to be optional
2223
</details>
2324

2425

@@ -74,6 +75,13 @@
7475
</details>
7576

7677

78+
<details>
79+
<summary>Removed QueryParameter(s)</summary>
80+
81+
- :warning: removed query parameter `withTotal` from method `get /{projectKey}/product-projections/search`
82+
</details>
83+
84+
7785
<details>
7886
<summary>Added Type(s)</summary>
7987

lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyProductProjectionsSearchTest.php

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -102,77 +102,77 @@ function (ApiRequestBuilder $builder): RequestInterface {
102102
'post',
103103
'test_projectKey/product-projections/search',
104104
],
105-
'ByProjectKeyProductProjectionsSearchGet_withFuzzy' => [
105+
'ByProjectKeyProductProjectionsSearchGet_withMarkMatchingVariants' => [
106106
function (ApiRequestBuilder $builder): RequestInterface {
107107
return $builder
108108
->withProjectKey('test_projectKey')
109109
->productProjections()
110110
->search()
111111
->get()
112-
->withFuzzy('fuzzy');
112+
->withMarkMatchingVariants('markMatchingVariants');
113113
},
114114
'get',
115-
'test_projectKey/product-projections/search?fuzzy=fuzzy',
115+
'test_projectKey/product-projections/search?markMatchingVariants=markMatchingVariants',
116116
],
117-
'ByProjectKeyProductProjectionsSearchGet_withFuzzyLevel' => [
117+
'ByProjectKeyProductProjectionsSearchGet_withText' => [
118118
function (ApiRequestBuilder $builder): RequestInterface {
119119
return $builder
120120
->withProjectKey('test_projectKey')
121121
->productProjections()
122122
->search()
123123
->get()
124-
->withFuzzyLevel('fuzzyLevel');
124+
->withText('locale', 'text.locale');
125125
},
126126
'get',
127-
'test_projectKey/product-projections/search?fuzzyLevel=fuzzyLevel',
127+
'test_projectKey/product-projections/search?text.locale=text.locale',
128128
],
129-
'ByProjectKeyProductProjectionsSearchGet_withMarkMatchingVariants' => [
129+
'ByProjectKeyProductProjectionsSearchGet_withFuzzy' => [
130130
function (ApiRequestBuilder $builder): RequestInterface {
131131
return $builder
132132
->withProjectKey('test_projectKey')
133133
->productProjections()
134134
->search()
135135
->get()
136-
->withMarkMatchingVariants('markMatchingVariants');
136+
->withFuzzy('fuzzy');
137137
},
138138
'get',
139-
'test_projectKey/product-projections/search?markMatchingVariants=markMatchingVariants',
139+
'test_projectKey/product-projections/search?fuzzy=fuzzy',
140140
],
141-
'ByProjectKeyProductProjectionsSearchGet_withFilter' => [
141+
'ByProjectKeyProductProjectionsSearchGet_withFuzzyLevel' => [
142142
function (ApiRequestBuilder $builder): RequestInterface {
143143
return $builder
144144
->withProjectKey('test_projectKey')
145145
->productProjections()
146146
->search()
147147
->get()
148-
->withFilter('filter');
148+
->withFuzzyLevel('fuzzyLevel');
149149
},
150150
'get',
151-
'test_projectKey/product-projections/search?filter=filter',
151+
'test_projectKey/product-projections/search?fuzzyLevel=fuzzyLevel',
152152
],
153-
'ByProjectKeyProductProjectionsSearchGet_withFilterFacets' => [
153+
'ByProjectKeyProductProjectionsSearchGet_withFilterQuery' => [
154154
function (ApiRequestBuilder $builder): RequestInterface {
155155
return $builder
156156
->withProjectKey('test_projectKey')
157157
->productProjections()
158158
->search()
159159
->get()
160-
->withFilterFacets('filter.facets');
160+
->withFilterQuery('filter.query');
161161
},
162162
'get',
163-
'test_projectKey/product-projections/search?filter.facets=filter.facets',
163+
'test_projectKey/product-projections/search?filter.query=filter.query',
164164
],
165-
'ByProjectKeyProductProjectionsSearchGet_withFilterQuery' => [
165+
'ByProjectKeyProductProjectionsSearchGet_withFilter' => [
166166
function (ApiRequestBuilder $builder): RequestInterface {
167167
return $builder
168168
->withProjectKey('test_projectKey')
169169
->productProjections()
170170
->search()
171171
->get()
172-
->withFilterQuery('filter.query');
172+
->withFilter('filter');
173173
},
174174
'get',
175-
'test_projectKey/product-projections/search?filter.query=filter.query',
175+
'test_projectKey/product-projections/search?filter=filter',
176176
],
177177
'ByProjectKeyProductProjectionsSearchGet_withFacet' => [
178178
function (ApiRequestBuilder $builder): RequestInterface {
@@ -186,65 +186,65 @@ function (ApiRequestBuilder $builder): RequestInterface {
186186
'get',
187187
'test_projectKey/product-projections/search?facet=facet',
188188
],
189-
'ByProjectKeyProductProjectionsSearchGet_withText' => [
189+
'ByProjectKeyProductProjectionsSearchGet_withFilterFacets' => [
190190
function (ApiRequestBuilder $builder): RequestInterface {
191191
return $builder
192192
->withProjectKey('test_projectKey')
193193
->productProjections()
194194
->search()
195195
->get()
196-
->withText('locale', 'text.locale');
196+
->withFilterFacets('filter.facets');
197197
},
198198
'get',
199-
'test_projectKey/product-projections/search?text.locale=text.locale',
199+
'test_projectKey/product-projections/search?filter.facets=filter.facets',
200200
],
201-
'ByProjectKeyProductProjectionsSearchGet_withSort' => [
201+
'ByProjectKeyProductProjectionsSearchGet_withExpand' => [
202202
function (ApiRequestBuilder $builder): RequestInterface {
203203
return $builder
204204
->withProjectKey('test_projectKey')
205205
->productProjections()
206206
->search()
207207
->get()
208-
->withSort('sort');
208+
->withExpand('expand');
209209
},
210210
'get',
211-
'test_projectKey/product-projections/search?sort=sort',
211+
'test_projectKey/product-projections/search?expand=expand',
212212
],
213-
'ByProjectKeyProductProjectionsSearchGet_withLimit' => [
213+
'ByProjectKeyProductProjectionsSearchGet_withSort' => [
214214
function (ApiRequestBuilder $builder): RequestInterface {
215215
return $builder
216216
->withProjectKey('test_projectKey')
217217
->productProjections()
218218
->search()
219219
->get()
220-
->withLimit('limit');
220+
->withSort('sort');
221221
},
222222
'get',
223-
'test_projectKey/product-projections/search?limit=limit',
223+
'test_projectKey/product-projections/search?sort=sort',
224224
],
225-
'ByProjectKeyProductProjectionsSearchGet_withOffset' => [
225+
'ByProjectKeyProductProjectionsSearchGet_withLimit' => [
226226
function (ApiRequestBuilder $builder): RequestInterface {
227227
return $builder
228228
->withProjectKey('test_projectKey')
229229
->productProjections()
230230
->search()
231231
->get()
232-
->withOffset('offset');
232+
->withLimit('limit');
233233
},
234234
'get',
235-
'test_projectKey/product-projections/search?offset=offset',
235+
'test_projectKey/product-projections/search?limit=limit',
236236
],
237-
'ByProjectKeyProductProjectionsSearchGet_withWithTotal' => [
237+
'ByProjectKeyProductProjectionsSearchGet_withOffset' => [
238238
function (ApiRequestBuilder $builder): RequestInterface {
239239
return $builder
240240
->withProjectKey('test_projectKey')
241241
->productProjections()
242242
->search()
243243
->get()
244-
->withWithTotal('withTotal');
244+
->withOffset('offset');
245245
},
246246
'get',
247-
'test_projectKey/product-projections/search?withTotal=withTotal',
247+
'test_projectKey/product-projections/search?offset=offset',
248248
],
249249
'ByProjectKeyProductProjectionsSearchGet_withStaged' => [
250250
function (ApiRequestBuilder $builder): RequestInterface {
@@ -342,18 +342,6 @@ function (ApiRequestBuilder $builder): RequestInterface {
342342
'get',
343343
'test_projectKey/product-projections/search?storeProjection=storeProjection',
344344
],
345-
'ByProjectKeyProductProjectionsSearchGet_withExpand' => [
346-
function (ApiRequestBuilder $builder): RequestInterface {
347-
return $builder
348-
->withProjectKey('test_projectKey')
349-
->productProjections()
350-
->search()
351-
->get()
352-
->withExpand('expand');
353-
},
354-
'get',
355-
'test_projectKey/product-projections/search?expand=expand',
356-
],
357345
'ByProjectKeyProductProjectionsSearchGet' => [
358346
function (ApiRequestBuilder $builder): RequestInterface {
359347
return $builder

lib/commercetools-api/docs/RequestBuilder.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9134,7 +9134,9 @@ $request = $builder
91349134
```
91359135
## `withProjectKey("projectKey")->productProjections()->search()->post(null)`
91369136

9137-
Product Projection Search
9137+
For implementing funnel search on Product Listing Pages where users select multiple filters, use this POST method.
9138+
To avoid URL length restrictions, this method passes the same query parameters as defined in the [GET](ctp:api:endpoint:/{projectKey}/product-projections/search:GET) method, within the request body in URL-encoded format.
9139+
91389140

91399141
### Example
91409142
```php
@@ -9149,7 +9151,11 @@ $request = $builder
91499151
```
91509152
## `withProjectKey("projectKey")->productProjections()->search()->get()`
91519153

9152-
Product Projection Search
9154+
This method appends query parameters to the URL.
9155+
The maximum allowed URL length is 8192 characters.
9156+
Exceeding this limit will result in URL truncation, potentially leading to unexpected results.
9157+
For funnel searches on Product Listing Pages, where users select multiple filters, we recommend the [POST](ctp:api:endpoint:/{projectKey}/product-projections/search:POST) method which passes the query parameters within the request body, avoiding URL length restrictions.
9158+
91539159

91549160
### Example
91559161
```php

lib/commercetools-api/src/Client/Resource/ByProjectKeyProductProjectionsSearchGet.php

Lines changed: 31 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,14 @@
3030
/**
3131
3232
* @psalm-suppress PropertyNotSetInConstructor
33-
* @template-implements Sortable<ByProjectKeyProductProjectionsSearchGet>
34-
* @template-implements Paging<ByProjectKeyProductProjectionsSearchGet>
3533
* @template-implements ProjectionSelecting<ByProjectKeyProductProjectionsSearchGet>
3634
* @template-implements PriceSelecting<ByProjectKeyProductProjectionsSearchGet>
3735
* @template-implements LocaleProjecting<ByProjectKeyProductProjectionsSearchGet>
3836
* @template-implements StoreProjectingTailoring<ByProjectKeyProductProjectionsSearchGet>
39-
* @template-implements Expandable<ByProjectKeyProductProjectionsSearchGet>
4037
* @template-implements Errorable<ByProjectKeyProductProjectionsSearchGet>
4138
* @template-implements Deprecatable200<ByProjectKeyProductProjectionsSearchGet>
4239
*/
43-
class ByProjectKeyProductProjectionsSearchGet extends ApiRequest implements Sortable, Paging, ProjectionSelecting, PriceSelecting, LocaleProjecting, StoreProjectingTailoring, Expandable, Errorable, Deprecatable200
40+
class ByProjectKeyProductProjectionsSearchGet extends ApiRequest implements ProjectionSelecting, PriceSelecting, LocaleProjecting, StoreProjectingTailoring, Errorable, Deprecatable200
4441
{
4542
/**
4643
* @param ?object|array|string $body
@@ -150,6 +147,24 @@ function (RequestException $e) use ($resultType) {
150147
);
151148
}
152149

150+
/**
151+
*
152+
* @psalm-param scalar|scalar[] $markMatchingVariants
153+
*/
154+
public function withMarkMatchingVariants($markMatchingVariants): ByProjectKeyProductProjectionsSearchGet
155+
{
156+
return $this->withQueryParam('markMatchingVariants', $markMatchingVariants);
157+
}
158+
159+
/**
160+
* @psalm-param string $locale
161+
* @psalm-param scalar|scalar[] $text
162+
*/
163+
public function withText(string $locale, $text): ByProjectKeyProductProjectionsSearchGet
164+
{
165+
return $this->withQueryParam(sprintf('text.%s', $locale), $text);
166+
}
167+
153168
/**
154169
*
155170
* @psalm-param scalar|scalar[] $fuzzy
@@ -170,11 +185,11 @@ public function withFuzzyLevel($fuzzyLevel): ByProjectKeyProductProjectionsSearc
170185

171186
/**
172187
*
173-
* @psalm-param scalar|scalar[] $markMatchingVariants
188+
* @psalm-param scalar|scalar[] $filterQuery
174189
*/
175-
public function withMarkMatchingVariants($markMatchingVariants): ByProjectKeyProductProjectionsSearchGet
190+
public function withFilterQuery($filterQuery): ByProjectKeyProductProjectionsSearchGet
176191
{
177-
return $this->withQueryParam('markMatchingVariants', $markMatchingVariants);
192+
return $this->withQueryParam('filter.query', $filterQuery);
178193
}
179194

180195
/**
@@ -188,38 +203,29 @@ public function withFilter($filter): ByProjectKeyProductProjectionsSearchGet
188203

189204
/**
190205
*
191-
* @psalm-param scalar|scalar[] $filterFacets
206+
* @psalm-param scalar|scalar[] $facet
192207
*/
193-
public function withFilterFacets($filterFacets): ByProjectKeyProductProjectionsSearchGet
208+
public function withFacet($facet): ByProjectKeyProductProjectionsSearchGet
194209
{
195-
return $this->withQueryParam('filter.facets', $filterFacets);
210+
return $this->withQueryParam('facet', $facet);
196211
}
197212

198213
/**
199214
*
200-
* @psalm-param scalar|scalar[] $filterQuery
215+
* @psalm-param scalar|scalar[] $filterFacets
201216
*/
202-
public function withFilterQuery($filterQuery): ByProjectKeyProductProjectionsSearchGet
217+
public function withFilterFacets($filterFacets): ByProjectKeyProductProjectionsSearchGet
203218
{
204-
return $this->withQueryParam('filter.query', $filterQuery);
219+
return $this->withQueryParam('filter.facets', $filterFacets);
205220
}
206221

207222
/**
208223
*
209-
* @psalm-param scalar|scalar[] $facet
210-
*/
211-
public function withFacet($facet): ByProjectKeyProductProjectionsSearchGet
212-
{
213-
return $this->withQueryParam('facet', $facet);
214-
}
215-
216-
/**
217-
* @psalm-param string $locale
218-
* @psalm-param scalar|scalar[] $text
224+
* @psalm-param scalar|scalar[] $expand
219225
*/
220-
public function withText(string $locale, $text): ByProjectKeyProductProjectionsSearchGet
226+
public function withExpand($expand): ByProjectKeyProductProjectionsSearchGet
221227
{
222-
return $this->withQueryParam(sprintf('text.%s', $locale), $text);
228+
return $this->withQueryParam('expand', $expand);
223229
}
224230

225231
/**
@@ -249,15 +255,6 @@ public function withOffset($offset): ByProjectKeyProductProjectionsSearchGet
249255
return $this->withQueryParam('offset', $offset);
250256
}
251257

252-
/**
253-
*
254-
* @psalm-param scalar|scalar[] $withTotal
255-
*/
256-
public function withWithTotal($withTotal): ByProjectKeyProductProjectionsSearchGet
257-
{
258-
return $this->withQueryParam('withTotal', $withTotal);
259-
}
260-
261258
/**
262259
*
263260
* @psalm-param scalar|scalar[] $staged
@@ -329,13 +326,4 @@ public function withStoreProjection($storeProjection): ByProjectKeyProductProjec
329326
{
330327
return $this->withQueryParam('storeProjection', $storeProjection);
331328
}
332-
333-
/**
334-
*
335-
* @psalm-param scalar|scalar[] $expand
336-
*/
337-
public function withExpand($expand): ByProjectKeyProductProjectionsSearchGet
338-
{
339-
return $this->withQueryParam('expand', $expand);
340-
}
341329
}

lib/commercetools-api/src/Models/Common/PagedQueryResponse.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,17 @@ public function getCount();
5757
public function getTotal();
5858

5959
/**
60+
* <p>The resources matching the query predicate.
61+
* Each query endpoint returns resources of its specific type.</p>
62+
*
6063
6164
* @return null|BaseResourceCollection
6265
*/
6366
public function getResults();
6467

6568
/**
69+
* <p>Object containing supplementary information about the results.</p>
70+
*
6671
6772
* @return null|mixed
6873
*/

0 commit comments

Comments
 (0)