Skip to content

Commit f0520da

Browse files
Merge pull request #401 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents ea07eef + 9c89cf0 commit f0520da

46 files changed

Lines changed: 1708 additions & 8 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

changes.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- added type `BestDeal`
1010
- added type `DiscountTypeCombination`
1111
- added type `Stacking`
12+
- added type `CartChangePriceRoundingModeAction`
1213
- added type `CustomerGroupAssignment`
1314
- added type `CustomerGroupAssignmentDraft`
1415
- added type `CustomerAddCustomerGroupAssignmentAction`
@@ -76,11 +77,14 @@
7677
- added type `DiscountGroupKeySetMessagePayload`
7778
- added type `DiscountGroupSortOrderSetMessagePayload`
7879
- added type `OrderBusinessUnitSetMessagePayload`
80+
- added type `StagedOrderChangePriceRoundingModeAction`
7981
- added type `StagedOrderSetBusinessUnitAction`
8082
- added type `OrderSetBusinessUnitAction`
8183
- added type `ProductTailoringSetProductAttributeAction`
8284
- added type `AttributeLevelEnum`
8385
- added type `ProductSetProductAttributeAction`
86+
- added type `ProjectChangePriceRoundingModeAction`
87+
- added type `ProjectChangeTaxRoundingModeAction`
8488
- added type `ShoppingListSetBusinessUnitAction`
8589
- added type `EventDeliveryPayload`
8690
- added type `EventSubscription`
@@ -169,7 +173,9 @@
169173
- added property `inheritedStores` to type `Division`
170174
- added property `discountGroup` to type `CartDiscount`
171175
- added property `discountGroup` to type `CartDiscountDraft`
176+
- added property `priceRoundingMode` to type `Cart`
172177
- added property `discountTypeCombination` to type `Cart`
178+
- added property `priceRoundingMode` to type `CartDraft`
173179
- added property `customerGroupAssignments` to type `Customer`
174180
- added property `invalidateOlderTokens` to type `CustomerCreateEmailToken`
175181
- added property `invalidateOlderTokens` to type `CustomerCreatePasswordResetToken`
@@ -185,8 +191,11 @@
185191
- added property `value` to type `CustomerPasswordTokenCreatedMessagePayload`
186192
- added property `invalidateOlderTokens` to type `CustomerPasswordTokenCreatedMessagePayload`
187193
- added property `attributes` to type `ProductTailoringCreatedMessagePayload`
194+
- added property `priceRoundingMode` to type `StagedOrder`
188195
- added property `discountTypeCombination` to type `StagedOrder`
196+
- added property `priceRoundingMode` to type `Order`
189197
- added property `discountTypeCombination` to type `Order`
198+
- added property `priceRoundingMode` to type `OrderImportDraft`
190199
- added property `priceCustomerGroupAssignments` to type `ProductSearchProjectionParams`
191200
- added property `attributes` to type `ProductTailoringData`
192201
- added property `attributes` to type `ProductTailoringDraft`
@@ -198,6 +207,10 @@
198207
- added property `attributes` to type `ProductDraft`
199208
- added property `attributes` to type `ProductProjection`
200209
- added property `/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/` to type `ProductVariantChannelAvailabilityMap`
210+
- added property `priceRoundingMode` to type `CartsConfiguration`
211+
- added property `taxRoundingMode` to type `CartsConfiguration`
212+
- added property `priceRoundingMode` to type `QuoteRequest`
213+
- added property `priceRoundingMode` to type `Quote`
201214
- added property `businessUnit` to type `ShoppingList`
202215
- added property `businessUnit` to type `ShoppingListDraft`
203216
- added property `published` to type `ShoppingListLineItem`

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ interface Cart extends BaseResource
4141
public const FIELD_TAXED_SHIPPING_PRICE = 'taxedShippingPrice';
4242
public const FIELD_DISCOUNT_ON_TOTAL_PRICE = 'discountOnTotalPrice';
4343
public const FIELD_TAX_MODE = 'taxMode';
44+
public const FIELD_PRICE_ROUNDING_MODE = 'priceRoundingMode';
4445
public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode';
4546
public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode';
4647
public const FIELD_INVENTORY_MODE = 'inventoryMode';
@@ -210,7 +211,15 @@ public function getDiscountOnTotalPrice();
210211
public function getTaxMode();
211212

212213
/**
213-
* <p>Indicates how monetary values are rounded when calculating taxes for <code>taxedPrice</code>.</p>
214+
* <p>Indicates how the total prices on <a href="ctp:api:type:LineItem">LineItems</a> and <a href="ctp:api:type:CustomLineItem">CustomLineItems</a> are rounded when calculated. Configured in <a href="ctp:api:type:CartsConfiguration">Project settings</a>.</p>
215+
*
216+
217+
* @return null|string
218+
*/
219+
public function getPriceRoundingMode();
220+
221+
/**
222+
* <p>Indicates how monetary values are rounded when calculating taxes for <code>taxedPrice</code>. Configured in <a href="ctp:api:type:CartsConfiguration">Project settings</a>.</p>
214223
*
215224
216225
* @return null|string
@@ -517,6 +526,11 @@ public function setDiscountOnTotalPrice(?DiscountOnTotalPrice $discountOnTotalPr
517526
*/
518527
public function setTaxMode(?string $taxMode): void;
519528

529+
/**
530+
* @param ?string $priceRoundingMode
531+
*/
532+
public function setPriceRoundingMode(?string $priceRoundingMode): void;
533+
520534
/**
521535
* @param ?string $taxRoundingMode
522536
*/

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

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,12 @@ final class CartBuilder implements Builder
157157
*/
158158
private $taxMode;
159159

160+
/**
161+
162+
* @var ?string
163+
*/
164+
private $priceRoundingMode;
165+
160166
/**
161167
162168
* @var ?string
@@ -523,7 +529,18 @@ public function getTaxMode()
523529
}
524530

525531
/**
526-
* <p>Indicates how monetary values are rounded when calculating taxes for <code>taxedPrice</code>.</p>
532+
* <p>Indicates how the total prices on <a href="ctp:api:type:LineItem">LineItems</a> and <a href="ctp:api:type:CustomLineItem">CustomLineItems</a> are rounded when calculated. Configured in <a href="ctp:api:type:CartsConfiguration">Project settings</a>.</p>
533+
*
534+
535+
* @return null|string
536+
*/
537+
public function getPriceRoundingMode()
538+
{
539+
return $this->priceRoundingMode;
540+
}
541+
542+
/**
543+
* <p>Indicates how monetary values are rounded when calculating taxes for <code>taxedPrice</code>. Configured in <a href="ctp:api:type:CartsConfiguration">Project settings</a>.</p>
527544
*
528545
529546
* @return null|string
@@ -1013,6 +1030,17 @@ public function withTaxMode(?string $taxMode)
10131030
return $this;
10141031
}
10151032

1033+
/**
1034+
* @param ?string $priceRoundingMode
1035+
* @return $this
1036+
*/
1037+
public function withPriceRoundingMode(?string $priceRoundingMode)
1038+
{
1039+
$this->priceRoundingMode = $priceRoundingMode;
1040+
1041+
return $this;
1042+
}
1043+
10161044
/**
10171045
* @param ?string $taxRoundingMode
10181046
* @return $this
@@ -1497,6 +1525,7 @@ public function build(): Cart
14971525
$this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice,
14981526
$this->discountOnTotalPrice instanceof DiscountOnTotalPriceBuilder ? $this->discountOnTotalPrice->build() : $this->discountOnTotalPrice,
14991527
$this->taxMode,
1528+
$this->priceRoundingMode,
15001529
$this->taxRoundingMode,
15011530
$this->taxCalculationMode,
15021531
$this->inventoryMode,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\Cart;
10+
11+
use Commercetools\Base\DateTimeImmutableCollection;
12+
use Commercetools\Base\JsonObject;
13+
14+
interface CartChangePriceRoundingModeAction extends CartUpdateAction
15+
{
16+
public const FIELD_PRICE_ROUNDING_MODE = 'priceRoundingMode';
17+
18+
/**
19+
* <p>New value to set.</p>
20+
*
21+
22+
* @return null|string
23+
*/
24+
public function getPriceRoundingMode();
25+
26+
/**
27+
* @param ?string $priceRoundingMode
28+
*/
29+
public function setPriceRoundingMode(?string $priceRoundingMode): void;
30+
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\Cart;
10+
11+
use Commercetools\Base\Builder;
12+
use Commercetools\Base\DateTimeImmutableCollection;
13+
use Commercetools\Base\JsonObject;
14+
use Commercetools\Base\JsonObjectModel;
15+
use Commercetools\Base\MapperFactory;
16+
use stdClass;
17+
18+
/**
19+
* @implements Builder<CartChangePriceRoundingModeAction>
20+
*/
21+
final class CartChangePriceRoundingModeActionBuilder implements Builder
22+
{
23+
/**
24+
25+
* @var ?string
26+
*/
27+
private $priceRoundingMode;
28+
29+
/**
30+
* <p>New value to set.</p>
31+
*
32+
33+
* @return null|string
34+
*/
35+
public function getPriceRoundingMode()
36+
{
37+
return $this->priceRoundingMode;
38+
}
39+
40+
/**
41+
* @param ?string $priceRoundingMode
42+
* @return $this
43+
*/
44+
public function withPriceRoundingMode(?string $priceRoundingMode)
45+
{
46+
$this->priceRoundingMode = $priceRoundingMode;
47+
48+
return $this;
49+
}
50+
51+
52+
public function build(): CartChangePriceRoundingModeAction
53+
{
54+
return new CartChangePriceRoundingModeActionModel(
55+
$this->priceRoundingMode
56+
);
57+
}
58+
59+
public static function of(): CartChangePriceRoundingModeActionBuilder
60+
{
61+
return new self();
62+
}
63+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\Cart;
10+
11+
use Commercetools\Api\Models\Cart\CartUpdateActionCollection;
12+
use Commercetools\Exception\InvalidArgumentException;
13+
use stdClass;
14+
15+
/**
16+
* @extends CartUpdateActionCollection<CartChangePriceRoundingModeAction>
17+
* @method CartChangePriceRoundingModeAction current()
18+
* @method CartChangePriceRoundingModeAction end()
19+
* @method CartChangePriceRoundingModeAction at($offset)
20+
*/
21+
class CartChangePriceRoundingModeActionCollection extends CartUpdateActionCollection
22+
{
23+
/**
24+
* @psalm-assert CartChangePriceRoundingModeAction $value
25+
* @psalm-param CartChangePriceRoundingModeAction|stdClass $value
26+
* @throws InvalidArgumentException
27+
*
28+
* @return CartChangePriceRoundingModeActionCollection
29+
*/
30+
public function add($value)
31+
{
32+
if (!$value instanceof CartChangePriceRoundingModeAction) {
33+
throw new InvalidArgumentException();
34+
}
35+
$this->store($value);
36+
37+
return $this;
38+
}
39+
40+
/**
41+
* @psalm-return callable(int):?CartChangePriceRoundingModeAction
42+
*/
43+
protected function mapper()
44+
{
45+
return function (?int $index): ?CartChangePriceRoundingModeAction {
46+
$data = $this->get($index);
47+
if ($data instanceof stdClass) {
48+
/** @var CartChangePriceRoundingModeAction $data */
49+
$data = CartChangePriceRoundingModeActionModel::of($data);
50+
$this->set($data, $index);
51+
}
52+
53+
return $data;
54+
};
55+
}
56+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
/**
5+
* This file has been auto generated
6+
* Do not change it.
7+
*/
8+
9+
namespace Commercetools\Api\Models\Cart;
10+
11+
use Commercetools\Base\DateTimeImmutableCollection;
12+
use Commercetools\Base\JsonObject;
13+
use Commercetools\Base\JsonObjectModel;
14+
use Commercetools\Base\MapperFactory;
15+
use stdClass;
16+
17+
/**
18+
* @internal
19+
*/
20+
final class CartChangePriceRoundingModeActionModel extends JsonObjectModel implements CartChangePriceRoundingModeAction
21+
{
22+
public const DISCRIMINATOR_VALUE = 'changePriceRoundingMode';
23+
/**
24+
*
25+
* @var ?string
26+
*/
27+
protected $action;
28+
29+
/**
30+
*
31+
* @var ?string
32+
*/
33+
protected $priceRoundingMode;
34+
35+
36+
/**
37+
* @psalm-suppress MissingParamType
38+
*/
39+
public function __construct(
40+
?string $priceRoundingMode = null,
41+
?string $action = null
42+
) {
43+
$this->priceRoundingMode = $priceRoundingMode;
44+
$this->action = $action ?? self::DISCRIMINATOR_VALUE;
45+
}
46+
47+
/**
48+
*
49+
* @return null|string
50+
*/
51+
public function getAction()
52+
{
53+
if (is_null($this->action)) {
54+
/** @psalm-var ?string $data */
55+
$data = $this->raw(self::FIELD_ACTION);
56+
if (is_null($data)) {
57+
return null;
58+
}
59+
$this->action = (string) $data;
60+
}
61+
62+
return $this->action;
63+
}
64+
65+
/**
66+
* <p>New value to set.</p>
67+
*
68+
*
69+
* @return null|string
70+
*/
71+
public function getPriceRoundingMode()
72+
{
73+
if (is_null($this->priceRoundingMode)) {
74+
/** @psalm-var ?string $data */
75+
$data = $this->raw(self::FIELD_PRICE_ROUNDING_MODE);
76+
if (is_null($data)) {
77+
return null;
78+
}
79+
$this->priceRoundingMode = (string) $data;
80+
}
81+
82+
return $this->priceRoundingMode;
83+
}
84+
85+
86+
/**
87+
* @param ?string $priceRoundingMode
88+
*/
89+
public function setPriceRoundingMode(?string $priceRoundingMode): void
90+
{
91+
$this->priceRoundingMode = $priceRoundingMode;
92+
}
93+
}

0 commit comments

Comments
 (0)