Skip to content

Commit 048598b

Browse files
author
Auto Mation
committed
TASK: Updating SDK
1 parent b8e7d71 commit 048598b

File tree

6 files changed

+79
-5
lines changed

6 files changed

+79
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hash=9b5f99017afa0bea3a5e85627b672d040973c596
1+
hash=64beef3a8f3cb2824ae9a2dffbed72ce612fbe87
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hash=9b5f99017afa0bea3a5e85627b672d040973c596
1+
hash=64beef3a8f3cb2824ae9a2dffbed72ce612fbe87

lib/commercetools-api/src/Models/Cart/CartDraft.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ interface CartDraft extends JsonObject
4242
public const FIELD_ORIGIN = 'origin';
4343
public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput';
4444
public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses';
45+
public const FIELD_DISCOUNT_CODES = 'discountCodes';
4546

4647
/**
4748
* <p>A three-digit currency code as per <a href="https://en.wikipedia.org/wiki/ISO_4217">ISO 4217</a>.</p>
@@ -205,6 +206,13 @@ public function getShippingRateInput();
205206
*/
206207
public function getItemShippingAddresses();
207208

209+
/**
210+
* <p>The code of existing DiscountCodes.</p>
211+
*
212+
* @return null|array
213+
*/
214+
public function getDiscountCodes();
215+
208216
/**
209217
* @param ?string $currency
210218
*/
@@ -319,4 +327,9 @@ public function setShippingRateInput(?ShippingRateInputDraft $shippingRateInput)
319327
* @param ?AddressCollection $itemShippingAddresses
320328
*/
321329
public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void;
330+
331+
/**
332+
* @param ?array $discountCodes
333+
*/
334+
public function setDiscountCodes(?array $discountCodes): void;
322335
}

lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,11 @@ final class CartDraftBuilder implements Builder
146146
*/
147147
private $itemShippingAddresses;
148148

149+
/**
150+
* @var ?array
151+
*/
152+
private $discountCodes;
153+
149154
/**
150155
* <p>A three-digit currency code as per <a href="https://en.wikipedia.org/wiki/ISO_4217">ISO 4217</a>.</p>
151156
*
@@ -377,6 +382,16 @@ public function getItemShippingAddresses()
377382
return $this->itemShippingAddresses;
378383
}
379384

385+
/**
386+
* <p>The code of existing DiscountCodes.</p>
387+
*
388+
* @return null|array
389+
*/
390+
public function getDiscountCodes()
391+
{
392+
return $this->discountCodes;
393+
}
394+
380395
/**
381396
* @param ?string $currency
382397
* @return $this
@@ -630,6 +645,17 @@ public function withItemShippingAddresses(?AddressCollection $itemShippingAddres
630645
return $this;
631646
}
632647

648+
/**
649+
* @param ?array $discountCodes
650+
* @return $this
651+
*/
652+
public function withDiscountCodes(?array $discountCodes)
653+
{
654+
$this->discountCodes = $discountCodes;
655+
656+
return $this;
657+
}
658+
633659
/**
634660
* @return $this
635661
*/
@@ -735,7 +761,8 @@ public function build(): CartDraft
735761
$this->deleteDaysAfterLastModification,
736762
$this->origin,
737763
$this->shippingRateInput instanceof ShippingRateInputDraftBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput,
738-
$this->itemShippingAddresses
764+
$this->itemShippingAddresses,
765+
$this->discountCodes
739766
);
740767
}
741768

lib/commercetools-api/src/Models/Cart/CartDraftModel.php

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ final class CartDraftModel extends JsonObjectModel implements CartDraft
145145
*/
146146
protected $itemShippingAddresses;
147147

148+
/**
149+
* @var ?array
150+
*/
151+
protected $discountCodes;
152+
148153

149154
/**
150155
* @psalm-suppress MissingParamType
@@ -172,7 +177,8 @@ public function __construct(
172177
?int $deleteDaysAfterLastModification = null,
173178
?string $origin = null,
174179
?ShippingRateInputDraft $shippingRateInput = null,
175-
?AddressCollection $itemShippingAddresses = null
180+
?AddressCollection $itemShippingAddresses = null,
181+
?array $discountCodes = null
176182
) {
177183
$this->currency = $currency;
178184
$this->customerId = $customerId;
@@ -197,6 +203,7 @@ public function __construct(
197203
$this->origin = $origin;
198204
$this->shippingRateInput = $shippingRateInput;
199205
$this->itemShippingAddresses = $itemShippingAddresses;
206+
$this->discountCodes = $discountCodes;
200207
}
201208

202209
/**
@@ -645,6 +652,25 @@ public function getItemShippingAddresses()
645652
return $this->itemShippingAddresses;
646653
}
647654

655+
/**
656+
* <p>The code of existing DiscountCodes.</p>
657+
*
658+
* @return null|array
659+
*/
660+
public function getDiscountCodes()
661+
{
662+
if (is_null($this->discountCodes)) {
663+
/** @psalm-var ?list<mixed> $data */
664+
$data = $this->raw(self::FIELD_DISCOUNT_CODES);
665+
if (is_null($data)) {
666+
return null;
667+
}
668+
$this->discountCodes = $data;
669+
}
670+
671+
return $this->discountCodes;
672+
}
673+
648674

649675
/**
650676
* @param ?string $currency
@@ -829,4 +855,12 @@ public function setItemShippingAddresses(?AddressCollection $itemShippingAddress
829855
{
830856
$this->itemShippingAddresses = $itemShippingAddresses;
831857
}
858+
859+
/**
860+
* @param ?array $discountCodes
861+
*/
862+
public function setDiscountCodes(?array $discountCodes): void
863+
{
864+
$this->discountCodes = $discountCodes;
865+
}
832866
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
hash=469c219cf815f2368aa427a54d7677e00ce0c1d0
1+
hash=64beef3a8f3cb2824ae9a2dffbed72ce612fbe87

0 commit comments

Comments
 (0)