Skip to content

Commit c6fc3c9

Browse files
committed
build(codegen): updating SDK
1 parent 4682298 commit c6fc3c9

11 files changed

+295
-3
lines changed

changes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646

4747
- added property `applicationMode` to type `CartDiscountValueFixed`
4848
- added property `applicationMode` to type `CartDiscountValueFixedDraft`
49+
- added property `custom` to type `CartSetCustomShippingMethodAction`
50+
- added property `custom` to type `StagedOrderSetCustomShippingMethodAction`
51+
- added property `custom` to type `StagedOrderSetShippingAddressAndCustomShippingMethodAction`
4952
</details>
5053

5154
**History changes**

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft;
1212
use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier;
13+
use Commercetools\Api\Models\Type\CustomFieldsDraft;
1314
use Commercetools\Base\DateTimeImmutableCollection;
1415
use Commercetools\Base\JsonObject;
1516

@@ -19,6 +20,7 @@ interface CartSetCustomShippingMethodAction extends CartUpdateAction
1920
public const FIELD_SHIPPING_RATE = 'shippingRate';
2021
public const FIELD_TAX_CATEGORY = 'taxCategory';
2122
public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate';
23+
public const FIELD_CUSTOM = 'custom';
2224

2325
/**
2426
* <p>Name of the custom Shipping Method.</p>
@@ -52,6 +54,14 @@ public function getTaxCategory();
5254
*/
5355
public function getExternalTaxRate();
5456

57+
/**
58+
* <p>Custom Fields for the custom Shipping Method.</p>
59+
*
60+
61+
* @return null|CustomFieldsDraft
62+
*/
63+
public function getCustom();
64+
5565
/**
5666
* @param ?string $shippingMethodName
5767
*/
@@ -71,4 +81,9 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi
7181
* @param ?ExternalTaxRateDraft $externalTaxRate
7282
*/
7383
public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void;
84+
85+
/**
86+
* @param ?CustomFieldsDraft $custom
87+
*/
88+
public function setCustom(?CustomFieldsDraft $custom): void;
7489
}

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

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftBuilder;
1313
use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier;
1414
use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder;
15+
use Commercetools\Api\Models\Type\CustomFieldsDraft;
16+
use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder;
1517
use Commercetools\Base\Builder;
1618
use Commercetools\Base\DateTimeImmutableCollection;
1719
use Commercetools\Base\JsonObject;
@@ -48,6 +50,12 @@ final class CartSetCustomShippingMethodActionBuilder implements Builder
4850
*/
4951
private $externalTaxRate;
5052

53+
/**
54+
55+
* @var null|CustomFieldsDraft|CustomFieldsDraftBuilder
56+
*/
57+
private $custom;
58+
5159
/**
5260
* <p>Name of the custom Shipping Method.</p>
5361
*
@@ -92,6 +100,17 @@ public function getExternalTaxRate()
92100
return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate;
93101
}
94102

103+
/**
104+
* <p>Custom Fields for the custom Shipping Method.</p>
105+
*
106+
107+
* @return null|CustomFieldsDraft
108+
*/
109+
public function getCustom()
110+
{
111+
return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
112+
}
113+
95114
/**
96115
* @param ?string $shippingMethodName
97116
* @return $this
@@ -136,6 +155,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate)
136155
return $this;
137156
}
138157

158+
/**
159+
* @param ?CustomFieldsDraft $custom
160+
* @return $this
161+
*/
162+
public function withCustom(?CustomFieldsDraft $custom)
163+
{
164+
$this->custom = $custom;
165+
166+
return $this;
167+
}
168+
139169
/**
140170
* @deprecated use withShippingRate() instead
141171
* @return $this
@@ -169,13 +199,25 @@ public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externa
169199
return $this;
170200
}
171201

202+
/**
203+
* @deprecated use withCustom() instead
204+
* @return $this
205+
*/
206+
public function withCustomBuilder(?CustomFieldsDraftBuilder $custom)
207+
{
208+
$this->custom = $custom;
209+
210+
return $this;
211+
}
212+
172213
public function build(): CartSetCustomShippingMethodAction
173214
{
174215
return new CartSetCustomShippingMethodActionModel(
175216
$this->shippingMethodName,
176217
$this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate,
177218
$this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory,
178-
$this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate
219+
$this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate,
220+
$this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
179221
);
180222
}
181223

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

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftModel;
1313
use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier;
1414
use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierModel;
15+
use Commercetools\Api\Models\Type\CustomFieldsDraft;
16+
use Commercetools\Api\Models\Type\CustomFieldsDraftModel;
1517
use Commercetools\Base\DateTimeImmutableCollection;
1618
use Commercetools\Base\JsonObject;
1719
use Commercetools\Base\JsonObjectModel;
@@ -54,6 +56,12 @@ final class CartSetCustomShippingMethodActionModel extends JsonObjectModel imple
5456
*/
5557
protected $externalTaxRate;
5658

59+
/**
60+
*
61+
* @var ?CustomFieldsDraft
62+
*/
63+
protected $custom;
64+
5765

5866
/**
5967
* @psalm-suppress MissingParamType
@@ -63,12 +71,14 @@ public function __construct(
6371
?ShippingRateDraft $shippingRate = null,
6472
?TaxCategoryResourceIdentifier $taxCategory = null,
6573
?ExternalTaxRateDraft $externalTaxRate = null,
74+
?CustomFieldsDraft $custom = null,
6675
?string $action = null
6776
) {
6877
$this->shippingMethodName = $shippingMethodName;
6978
$this->shippingRate = $shippingRate;
7079
$this->taxCategory = $taxCategory;
7180
$this->externalTaxRate = $externalTaxRate;
81+
$this->custom = $custom;
7282
$this->action = $action ?? self::DISCRIMINATOR_VALUE;
7383
}
7484

@@ -173,6 +183,27 @@ public function getExternalTaxRate()
173183
return $this->externalTaxRate;
174184
}
175185

186+
/**
187+
* <p>Custom Fields for the custom Shipping Method.</p>
188+
*
189+
*
190+
* @return null|CustomFieldsDraft
191+
*/
192+
public function getCustom()
193+
{
194+
if (is_null($this->custom)) {
195+
/** @psalm-var stdClass|array<string, mixed>|null $data */
196+
$data = $this->raw(self::FIELD_CUSTOM);
197+
if (is_null($data)) {
198+
return null;
199+
}
200+
201+
$this->custom = CustomFieldsDraftModel::of($data);
202+
}
203+
204+
return $this->custom;
205+
}
206+
176207

177208
/**
178209
* @param ?string $shippingMethodName
@@ -205,4 +236,12 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void
205236
{
206237
$this->externalTaxRate = $externalTaxRate;
207238
}
239+
240+
/**
241+
* @param ?CustomFieldsDraft $custom
242+
*/
243+
public function setCustom(?CustomFieldsDraft $custom): void
244+
{
245+
$this->custom = $custom;
246+
}
208247
}

lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Commercetools\Api\Models\Order\StagedOrderUpdateAction;
1313
use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft;
1414
use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier;
15+
use Commercetools\Api\Models\Type\CustomFieldsDraft;
1516
use Commercetools\Base\DateTimeImmutableCollection;
1617
use Commercetools\Base\JsonObject;
1718

@@ -21,6 +22,7 @@ interface StagedOrderSetCustomShippingMethodAction extends StagedOrderUpdateActi
2122
public const FIELD_SHIPPING_RATE = 'shippingRate';
2223
public const FIELD_TAX_CATEGORY = 'taxCategory';
2324
public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate';
25+
public const FIELD_CUSTOM = 'custom';
2426

2527
/**
2628
* <p>Name of the custom Shipping Method.</p>
@@ -54,6 +56,14 @@ public function getTaxCategory();
5456
*/
5557
public function getExternalTaxRate();
5658

59+
/**
60+
* <p>Custom Fields for the custom Shipping Method.</p>
61+
*
62+
63+
* @return null|CustomFieldsDraft
64+
*/
65+
public function getCustom();
66+
5767
/**
5868
* @param ?string $shippingMethodName
5969
*/
@@ -73,4 +83,9 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi
7383
* @param ?ExternalTaxRateDraft $externalTaxRate
7484
*/
7585
public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void;
86+
87+
/**
88+
* @param ?CustomFieldsDraft $custom
89+
*/
90+
public function setCustom(?CustomFieldsDraft $custom): void;
7691
}

lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftBuilder;
1717
use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier;
1818
use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder;
19+
use Commercetools\Api\Models\Type\CustomFieldsDraft;
20+
use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder;
1921
use Commercetools\Base\Builder;
2022
use Commercetools\Base\DateTimeImmutableCollection;
2123
use Commercetools\Base\JsonObject;
@@ -52,6 +54,12 @@ final class StagedOrderSetCustomShippingMethodActionBuilder implements Builder
5254
*/
5355
private $externalTaxRate;
5456

57+
/**
58+
59+
* @var null|CustomFieldsDraft|CustomFieldsDraftBuilder
60+
*/
61+
private $custom;
62+
5563
/**
5664
* <p>Name of the custom Shipping Method.</p>
5765
*
@@ -96,6 +104,17 @@ public function getExternalTaxRate()
96104
return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate;
97105
}
98106

107+
/**
108+
* <p>Custom Fields for the custom Shipping Method.</p>
109+
*
110+
111+
* @return null|CustomFieldsDraft
112+
*/
113+
public function getCustom()
114+
{
115+
return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom;
116+
}
117+
99118
/**
100119
* @param ?string $shippingMethodName
101120
* @return $this
@@ -140,6 +159,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate)
140159
return $this;
141160
}
142161

162+
/**
163+
* @param ?CustomFieldsDraft $custom
164+
* @return $this
165+
*/
166+
public function withCustom(?CustomFieldsDraft $custom)
167+
{
168+
$this->custom = $custom;
169+
170+
return $this;
171+
}
172+
143173
/**
144174
* @deprecated use withShippingRate() instead
145175
* @return $this
@@ -173,13 +203,25 @@ public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externa
173203
return $this;
174204
}
175205

206+
/**
207+
* @deprecated use withCustom() instead
208+
* @return $this
209+
*/
210+
public function withCustomBuilder(?CustomFieldsDraftBuilder $custom)
211+
{
212+
$this->custom = $custom;
213+
214+
return $this;
215+
}
216+
176217
public function build(): StagedOrderSetCustomShippingMethodAction
177218
{
178219
return new StagedOrderSetCustomShippingMethodActionModel(
179220
$this->shippingMethodName,
180221
$this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate,
181222
$this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory,
182-
$this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate
223+
$this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate,
224+
$this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom
183225
);
184226
}
185227

0 commit comments

Comments
 (0)