Skip to content

Commit 692c6ca

Browse files
Merge pull request #244 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents bb6edcc + 906e4ec commit 692c6ca

File tree

7 files changed

+113
-8
lines changed

7 files changed

+113
-8
lines changed

changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- added property `attributes` to type `ProductVariantTailoringDraft`
1111
- added property `attributes` to type `ProductTailoringAddVariantAction`
1212
- added property `warnings` to type `Product`
13+
- added property `customers` to type `SearchIndexingConfiguration`
1314
</details>
1415

1516

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,15 @@ function (ApiRequestBuilder $builder): RequestInterface {
249249
},
250250
200
251251
],
252-
'ByProjectKeyCustomersSearchHead_404' => [
252+
'ByProjectKeyCustomersSearchHead_409' => [
253253
function (ApiRequestBuilder $builder): RequestInterface {
254254
return $builder
255255
->withProjectKey("projectKey")
256256
->customers()
257257
->search()
258258
->head();
259259
},
260-
404
260+
409
261261
],
262262
'ByProjectKeyCustomersSearchHead_400' => [
263263
function (ApiRequestBuilder $builder): RequestInterface {
@@ -289,6 +289,16 @@ function (ApiRequestBuilder $builder): RequestInterface {
289289
},
290290
403
291291
],
292+
'ByProjectKeyCustomersSearchHead_404' => [
293+
function (ApiRequestBuilder $builder): RequestInterface {
294+
return $builder
295+
->withProjectKey("projectKey")
296+
->customers()
297+
->search()
298+
->head();
299+
},
300+
404
301+
],
292302
'ByProjectKeyCustomersSearchHead_500' => [
293303
function (ApiRequestBuilder $builder): RequestInterface {
294304
return $builder

lib/commercetools-api/docs/RequestBuilder.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2878,7 +2878,8 @@ $request = $builder
28782878
```
28792879
## `withProjectKey("projectKey")->customers()->search()->post(null)`
28802880

2881-
null
2881+
A [SearchNotReady](ctp:api:type:SearchNotReadyError) error is returned if the indexing is in progress or the feature is deactivated. If deactivated, you can [reactivate](/../api/projects/customer-search#reactivate) it.
2882+
28822883

28832884
### Example
28842885
```php
@@ -2893,8 +2894,8 @@ $request = $builder
28932894
```
28942895
## `withProjectKey("projectKey")->customers()->search()->head()`
28952896

2896-
Checks whether a search index for the Project's Customers exists.
2897-
Returns a `200 OK` status if the index exists or `404 Not Found` otherwise.
2897+
Checks whether a search index of Customers exists for a Project.
2898+
If an index exists, a `200 OK` is returned; otherwise, a `409 Conflict`.
28982899

28992900

29002901
### Example
@@ -2910,7 +2911,8 @@ $request = $builder
29102911
```
29112912
## `withProjectKey("projectKey")->customers()->searchIndexingStatus()->get()`
29122913

2913-
null
2914+
Returns the indexing status of the Customer Search for a Project.
2915+
29142916

29152917
### Example
29162918
```php

lib/commercetools-api/src/Models/Project/SearchIndexingConfiguration.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ interface SearchIndexingConfiguration extends JsonObject
1616
public const FIELD_PRODUCTS = 'products';
1717
public const FIELD_PRODUCTS_SEARCH = 'productsSearch';
1818
public const FIELD_ORDERS = 'orders';
19+
public const FIELD_CUSTOMERS = 'customers';
1920

2021
/**
2122
* <p>Configuration for the <a href="/../api/projects/products-search">Product Projection Search</a> and <a href="/../api/projects/products-suggestions">Product Suggestions</a> endpoints.</p>
@@ -41,6 +42,14 @@ public function getProductsSearch();
4142
*/
4243
public function getOrders();
4344

45+
/**
46+
* <p>Configuration for the <a href="/../api/projects/customer-search">Customer Search</a> feature.</p>
47+
*
48+
49+
* @return null|SearchIndexingConfigurationValues
50+
*/
51+
public function getCustomers();
52+
4453
/**
4554
* @param ?SearchIndexingConfigurationValues $products
4655
*/
@@ -55,4 +64,9 @@ public function setProductsSearch(?SearchIndexingConfigurationValues $productsSe
5564
* @param ?SearchIndexingConfigurationValues $orders
5665
*/
5766
public function setOrders(?SearchIndexingConfigurationValues $orders): void;
67+
68+
/**
69+
* @param ?SearchIndexingConfigurationValues $customers
70+
*/
71+
public function setCustomers(?SearchIndexingConfigurationValues $customers): void;
5872
}

lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationBuilder.php

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ final class SearchIndexingConfigurationBuilder implements Builder
3838
*/
3939
private $orders;
4040

41+
/**
42+
43+
* @var null|SearchIndexingConfigurationValues|SearchIndexingConfigurationValuesBuilder
44+
*/
45+
private $customers;
46+
4147
/**
4248
* <p>Configuration for the <a href="/../api/projects/products-search">Product Projection Search</a> and <a href="/../api/projects/products-suggestions">Product Suggestions</a> endpoints.</p>
4349
*
@@ -71,6 +77,17 @@ public function getOrders()
7177
return $this->orders instanceof SearchIndexingConfigurationValuesBuilder ? $this->orders->build() : $this->orders;
7278
}
7379

80+
/**
81+
* <p>Configuration for the <a href="/../api/projects/customer-search">Customer Search</a> feature.</p>
82+
*
83+
84+
* @return null|SearchIndexingConfigurationValues
85+
*/
86+
public function getCustomers()
87+
{
88+
return $this->customers instanceof SearchIndexingConfigurationValuesBuilder ? $this->customers->build() : $this->customers;
89+
}
90+
7491
/**
7592
* @param ?SearchIndexingConfigurationValues $products
7693
* @return $this
@@ -104,6 +121,17 @@ public function withOrders(?SearchIndexingConfigurationValues $orders)
104121
return $this;
105122
}
106123

124+
/**
125+
* @param ?SearchIndexingConfigurationValues $customers
126+
* @return $this
127+
*/
128+
public function withCustomers(?SearchIndexingConfigurationValues $customers)
129+
{
130+
$this->customers = $customers;
131+
132+
return $this;
133+
}
134+
107135
/**
108136
* @deprecated use withProducts() instead
109137
* @return $this
@@ -137,12 +165,24 @@ public function withOrdersBuilder(?SearchIndexingConfigurationValuesBuilder $ord
137165
return $this;
138166
}
139167

168+
/**
169+
* @deprecated use withCustomers() instead
170+
* @return $this
171+
*/
172+
public function withCustomersBuilder(?SearchIndexingConfigurationValuesBuilder $customers)
173+
{
174+
$this->customers = $customers;
175+
176+
return $this;
177+
}
178+
140179
public function build(): SearchIndexingConfiguration
141180
{
142181
return new SearchIndexingConfigurationModel(
143182
$this->products instanceof SearchIndexingConfigurationValuesBuilder ? $this->products->build() : $this->products,
144183
$this->productsSearch instanceof SearchIndexingConfigurationValuesBuilder ? $this->productsSearch->build() : $this->productsSearch,
145-
$this->orders instanceof SearchIndexingConfigurationValuesBuilder ? $this->orders->build() : $this->orders
184+
$this->orders instanceof SearchIndexingConfigurationValuesBuilder ? $this->orders->build() : $this->orders,
185+
$this->customers instanceof SearchIndexingConfigurationValuesBuilder ? $this->customers->build() : $this->customers
146186
);
147187
}
148188

lib/commercetools-api/src/Models/Project/SearchIndexingConfigurationModel.php

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,26 @@ final class SearchIndexingConfigurationModel extends JsonObjectModel implements
3737
*/
3838
protected $orders;
3939

40+
/**
41+
*
42+
* @var ?SearchIndexingConfigurationValues
43+
*/
44+
protected $customers;
45+
4046

4147
/**
4248
* @psalm-suppress MissingParamType
4349
*/
4450
public function __construct(
4551
?SearchIndexingConfigurationValues $products = null,
4652
?SearchIndexingConfigurationValues $productsSearch = null,
47-
?SearchIndexingConfigurationValues $orders = null
53+
?SearchIndexingConfigurationValues $orders = null,
54+
?SearchIndexingConfigurationValues $customers = null
4855
) {
4956
$this->products = $products;
5057
$this->productsSearch = $productsSearch;
5158
$this->orders = $orders;
59+
$this->customers = $customers;
5260
}
5361

5462
/**
@@ -114,6 +122,27 @@ public function getOrders()
114122
return $this->orders;
115123
}
116124

125+
/**
126+
* <p>Configuration for the <a href="/../api/projects/customer-search">Customer Search</a> feature.</p>
127+
*
128+
*
129+
* @return null|SearchIndexingConfigurationValues
130+
*/
131+
public function getCustomers()
132+
{
133+
if (is_null($this->customers)) {
134+
/** @psalm-var stdClass|array<string, mixed>|null $data */
135+
$data = $this->raw(self::FIELD_CUSTOMERS);
136+
if (is_null($data)) {
137+
return null;
138+
}
139+
140+
$this->customers = SearchIndexingConfigurationValuesModel::of($data);
141+
}
142+
143+
return $this->customers;
144+
}
145+
117146

118147
/**
119148
* @param ?SearchIndexingConfigurationValues $products
@@ -138,4 +167,12 @@ public function setOrders(?SearchIndexingConfigurationValues $orders): void
138167
{
139168
$this->orders = $orders;
140169
}
170+
171+
/**
172+
* @param ?SearchIndexingConfigurationValues $customers
173+
*/
174+
public function setCustomers(?SearchIndexingConfigurationValues $customers): void
175+
{
176+
$this->customers = $customers;
177+
}
141178
}

references.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,3 +304,4 @@ f9461c5c0a8dd0551b9373ad3d59e1e193e47314
304304
58b253e878bca9833c1735913f764f4f479c1c9a
305305
4ee8b39787eb0f0b2d025520acdaa022122bd617
306306
c77ec902f368c2c31505fcb65a835ce148350077
307+
903922e6a2dc0ff9283757645395f5119f61be0e

0 commit comments

Comments
 (0)