Skip to content

Commit 3a2318c

Browse files
committed
build(codegen): updating SDK
1 parent 644a770 commit 3a2318c

14 files changed

+655
-0
lines changed

changes.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
- added property `invalidateOlderTokens` to type `CustomerCreatePasswordResetToken`
5555
- added property `customerGroupAssignments` to type `CustomerDraft`
5656
- added property `invalidateOlderTokens` to type `CustomerToken`
57+
- added property `minCartQuantity` to type `InventoryEntry`
58+
- added property `maxCartQuantity` to type `InventoryEntry`
59+
- added property `minCartQuantity` to type `InventoryEntryDraft`
60+
- added property `maxCartQuantity` to type `InventoryEntryDraft`
5761
- added property `recurrenceInfo` to type `MyLineItemDraft`
5862
- added property `recurrenceInfo` to type `MyCartAddLineItemAction`
5963
- added property `value` to type `CustomerEmailTokenCreatedMessage`
@@ -169,6 +173,7 @@
169173
- added type `ImportUnresolvedEventData`
170174
- added type `ImportValidationFailedEventData`
171175
- added type `ImportWaitForMasterVariantEventData`
176+
- added type `InventoryEntrySetInventoryLimitsAction`
172177
- added type `MyCartSetCustomLineItemRecurrenceInfoAction`
173178
- added type `MyCartSetLineItemRecurrenceInfoAction`
174179
- added type `MyPaymentSetMethodInfoCustomFieldAction`

lib/commercetools-api/docs/RequestBuilder.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6995,8 +6995,13 @@ $request = $builder
69956995
```
69966996
## `withProjectKey("projectKey")->inventory()->post(null)`
69976997

6998+
Creates an InventoryEntry in the Project.
6999+
7000+
If quantity limits are provided, existing Line Items that reference a Product Variant with an SKU that matches the Inventory Entry can be affected. For more information, see [Quantity limits](/../api/carts-orders-overview#quantity-limits).
7001+
69987002
Produces the [InventoryEntryCreated](ctp:api:type:InventoryEntryCreatedMessage) Message.
69997003

7004+
70007005
### Example
70017006
```php
70027007
use Commercetools\Api\Client\ApiRequestBuilder;

lib/commercetools-api/src/Models/Inventory/InventoryEntry.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ interface InventoryEntry extends BaseResource
2626
public const FIELD_SUPPLY_CHANNEL = 'supplyChannel';
2727
public const FIELD_QUANTITY_ON_STOCK = 'quantityOnStock';
2828
public const FIELD_AVAILABLE_QUANTITY = 'availableQuantity';
29+
public const FIELD_MIN_CART_QUANTITY = 'minCartQuantity';
30+
public const FIELD_MAX_CART_QUANTITY = 'maxCartQuantity';
2931
public const FIELD_RESTOCKABLE_IN_DAYS = 'restockableInDays';
3032
public const FIELD_EXPECTED_DELIVERY = 'expectedDelivery';
3133
public const FIELD_CUSTOM = 'custom';
@@ -118,6 +120,22 @@ public function getQuantityOnStock();
118120
*/
119121
public function getAvailableQuantity();
120122

123+
/**
124+
* <p>Minimum quantity that can be added to a Cart. See <a href="/../api/carts-orders-overview#quantity-limits">Quantity limits</a>.</p>
125+
*
126+
127+
* @return null|int
128+
*/
129+
public function getMinCartQuantity();
130+
131+
/**
132+
* <p>Maximum quantity that can be added to a Cart. See <a href="/../api/carts-orders-overview#quantity-limits">Quantity limits</a>.</p>
133+
*
134+
135+
* @return null|int
136+
*/
137+
public function getMaxCartQuantity();
138+
121139
/**
122140
* <p>How often the InventoryEntry is restocked (in days).</p>
123141
*
@@ -197,6 +215,16 @@ public function setQuantityOnStock(?int $quantityOnStock): void;
197215
*/
198216
public function setAvailableQuantity(?int $availableQuantity): void;
199217

218+
/**
219+
* @param ?int $minCartQuantity
220+
*/
221+
public function setMinCartQuantity(?int $minCartQuantity): void;
222+
223+
/**
224+
* @param ?int $maxCartQuantity
225+
*/
226+
public function setMaxCartQuantity(?int $maxCartQuantity): void;
227+
200228
/**
201229
* @param ?int $restockableInDays
202230
*/

lib/commercetools-api/src/Models/Inventory/InventoryEntryBuilder.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,18 @@ final class InventoryEntryBuilder implements Builder
9797
*/
9898
private $availableQuantity;
9999

100+
/**
101+
102+
* @var ?int
103+
*/
104+
private $minCartQuantity;
105+
106+
/**
107+
108+
* @var ?int
109+
*/
110+
private $maxCartQuantity;
111+
100112
/**
101113
102114
* @var ?int
@@ -236,6 +248,28 @@ public function getAvailableQuantity()
236248
return $this->availableQuantity;
237249
}
238250

251+
/**
252+
* <p>Minimum quantity that can be added to a Cart. See <a href="/../api/carts-orders-overview#quantity-limits">Quantity limits</a>.</p>
253+
*
254+
255+
* @return null|int
256+
*/
257+
public function getMinCartQuantity()
258+
{
259+
return $this->minCartQuantity;
260+
}
261+
262+
/**
263+
* <p>Maximum quantity that can be added to a Cart. See <a href="/../api/carts-orders-overview#quantity-limits">Quantity limits</a>.</p>
264+
*
265+
266+
* @return null|int
267+
*/
268+
public function getMaxCartQuantity()
269+
{
270+
return $this->maxCartQuantity;
271+
}
272+
239273
/**
240274
* <p>How often the InventoryEntry is restocked (in days).</p>
241275
*
@@ -390,6 +424,28 @@ public function withAvailableQuantity(?int $availableQuantity)
390424
return $this;
391425
}
392426

427+
/**
428+
* @param ?int $minCartQuantity
429+
* @return $this
430+
*/
431+
public function withMinCartQuantity(?int $minCartQuantity)
432+
{
433+
$this->minCartQuantity = $minCartQuantity;
434+
435+
return $this;
436+
}
437+
438+
/**
439+
* @param ?int $maxCartQuantity
440+
* @return $this
441+
*/
442+
public function withMaxCartQuantity(?int $maxCartQuantity)
443+
{
444+
$this->maxCartQuantity = $maxCartQuantity;
445+
446+
return $this;
447+
}
448+
393449
/**
394450
* @param ?int $restockableInDays
395451
* @return $this
@@ -481,6 +537,8 @@ public function build(): InventoryEntry
481537
$this->supplyChannel instanceof ChannelReferenceBuilder ? $this->supplyChannel->build() : $this->supplyChannel,
482538
$this->quantityOnStock,
483539
$this->availableQuantity,
540+
$this->minCartQuantity,
541+
$this->maxCartQuantity,
484542
$this->restockableInDays,
485543
$this->expectedDelivery,
486544
$this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom

lib/commercetools-api/src/Models/Inventory/InventoryEntryDraft.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ interface InventoryEntryDraft extends JsonObject
2020
public const FIELD_KEY = 'key';
2121
public const FIELD_SUPPLY_CHANNEL = 'supplyChannel';
2222
public const FIELD_QUANTITY_ON_STOCK = 'quantityOnStock';
23+
public const FIELD_MIN_CART_QUANTITY = 'minCartQuantity';
24+
public const FIELD_MAX_CART_QUANTITY = 'maxCartQuantity';
2325
public const FIELD_RESTOCKABLE_IN_DAYS = 'restockableInDays';
2426
public const FIELD_EXPECTED_DELIVERY = 'expectedDelivery';
2527
public const FIELD_CUSTOM = 'custom';
@@ -57,6 +59,22 @@ public function getSupplyChannel();
5759
*/
5860
public function getQuantityOnStock();
5961

62+
/**
63+
* <p>Minimum quantity that can be added to a Cart. See <a href="/../api/carts-orders-overview#quantity-limits">Quantity limits</a>.</p>
64+
*
65+
66+
* @return null|int
67+
*/
68+
public function getMinCartQuantity();
69+
70+
/**
71+
* <p>Maximum quantity that can be added to a Cart. See <a href="/../api/carts-orders-overview#quantity-limits">Quantity limits</a>.</p>
72+
*
73+
74+
* @return null|int
75+
*/
76+
public function getMaxCartQuantity();
77+
6078
/**
6179
* <p>How often the InventoryEntry is restocked (in days).</p>
6280
*
@@ -101,6 +119,16 @@ public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): voi
101119
*/
102120
public function setQuantityOnStock(?int $quantityOnStock): void;
103121

122+
/**
123+
* @param ?int $minCartQuantity
124+
*/
125+
public function setMinCartQuantity(?int $minCartQuantity): void;
126+
127+
/**
128+
* @param ?int $maxCartQuantity
129+
*/
130+
public function setMaxCartQuantity(?int $maxCartQuantity): void;
131+
104132
/**
105133
* @param ?int $restockableInDays
106134
*/

lib/commercetools-api/src/Models/Inventory/InventoryEntryDraftBuilder.php

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ final class InventoryEntryDraftBuilder implements Builder
4949
*/
5050
private $quantityOnStock;
5151

52+
/**
53+
54+
* @var ?int
55+
*/
56+
private $minCartQuantity;
57+
58+
/**
59+
60+
* @var ?int
61+
*/
62+
private $maxCartQuantity;
63+
5264
/**
5365
5466
* @var ?int
@@ -112,6 +124,28 @@ public function getQuantityOnStock()
112124
return $this->quantityOnStock;
113125
}
114126

127+
/**
128+
* <p>Minimum quantity that can be added to a Cart. See <a href="/../api/carts-orders-overview#quantity-limits">Quantity limits</a>.</p>
129+
*
130+
131+
* @return null|int
132+
*/
133+
public function getMinCartQuantity()
134+
{
135+
return $this->minCartQuantity;
136+
}
137+
138+
/**
139+
* <p>Maximum quantity that can be added to a Cart. See <a href="/../api/carts-orders-overview#quantity-limits">Quantity limits</a>.</p>
140+
*
141+
142+
* @return null|int
143+
*/
144+
public function getMaxCartQuantity()
145+
{
146+
return $this->maxCartQuantity;
147+
}
148+
115149
/**
116150
* <p>How often the InventoryEntry is restocked (in days).</p>
117151
*
@@ -189,6 +223,28 @@ public function withQuantityOnStock(?int $quantityOnStock)
189223
return $this;
190224
}
191225

226+
/**
227+
* @param ?int $minCartQuantity
228+
* @return $this
229+
*/
230+
public function withMinCartQuantity(?int $minCartQuantity)
231+
{
232+
$this->minCartQuantity = $minCartQuantity;
233+
234+
return $this;
235+
}
236+
237+
/**
238+
* @param ?int $maxCartQuantity
239+
* @return $this
240+
*/
241+
public function withMaxCartQuantity(?int $maxCartQuantity)
242+
{
243+
$this->maxCartQuantity = $maxCartQuantity;
244+
245+
return $this;
246+
}
247+
192248
/**
193249
* @param ?int $restockableInDays
194250
* @return $this
@@ -251,6 +307,8 @@ public function build(): InventoryEntryDraft
251307
$this->key,
252308
$this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel,
253309
$this->quantityOnStock,
310+
$this->minCartQuantity,
311+
$this->maxCartQuantity,
254312
$this->restockableInDays,
255313
$this->expectedDelivery,
256314
$this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom

0 commit comments

Comments
 (0)