diff --git a/changes.md b/changes.md index 938b93a9a8f..f5a06a8e53f 100644 --- a/changes.md +++ b/changes.md @@ -46,6 +46,9 @@ - added property `applicationMode` to type `CartDiscountValueFixed` - added property `applicationMode` to type `CartDiscountValueFixedDraft` +- added property `custom` to type `CartSetCustomShippingMethodAction` +- added property `custom` to type `StagedOrderSetCustomShippingMethodAction` +- added property `custom` to type `StagedOrderSetShippingAddressAndCustomShippingMethodAction` **History changes** diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php index 2b0bc510acd..e19c08ea309 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodAction.php @@ -10,6 +10,7 @@ use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; +use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -19,6 +20,7 @@ interface CartSetCustomShippingMethodAction extends CartUpdateAction public const FIELD_SHIPPING_RATE = 'shippingRate'; public const FIELD_TAX_CATEGORY = 'taxCategory'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_CUSTOM = 'custom'; /** *

Name of the custom Shipping Method.

@@ -52,6 +54,14 @@ public function getTaxCategory(); */ public function getExternalTaxRate(); + /** + *

Custom Fields for the custom Shipping Method.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom(); + /** * @param ?string $shippingMethodName */ @@ -71,4 +81,9 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi * @param ?ExternalTaxRateDraft $externalTaxRate */ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php index e5925478bbb..1f19f805757 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionBuilder.php @@ -12,6 +12,8 @@ use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftBuilder; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -48,6 +50,12 @@ final class CartSetCustomShippingMethodActionBuilder implements Builder */ private $externalTaxRate; + /** + + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; + /** *

Name of the custom Shipping Method.

* @@ -92,6 +100,17 @@ public function getExternalTaxRate() return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } + /** + *

Custom Fields for the custom Shipping Method.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + } + /** * @param ?string $shippingMethodName * @return $this @@ -136,6 +155,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) return $this; } + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; + + return $this; + } + /** * @deprecated use withShippingRate() instead * @return $this @@ -169,13 +199,25 @@ public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externa return $this; } + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): CartSetCustomShippingMethodAction { return new CartSetCustomShippingMethodActionModel( $this->shippingMethodName, $this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php index d048af09b71..5c324b9df26 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomShippingMethodActionModel.php @@ -12,6 +12,8 @@ use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftModel; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierModel; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -54,6 +56,12 @@ final class CartSetCustomShippingMethodActionModel extends JsonObjectModel imple */ protected $externalTaxRate; + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; + /** * @psalm-suppress MissingParamType @@ -63,12 +71,14 @@ public function __construct( ?ShippingRateDraft $shippingRate = null, ?TaxCategoryResourceIdentifier $taxCategory = null, ?ExternalTaxRateDraft $externalTaxRate = null, + ?CustomFieldsDraft $custom = null, ?string $action = null ) { $this->shippingMethodName = $shippingMethodName; $this->shippingRate = $shippingRate; $this->taxCategory = $taxCategory; $this->externalTaxRate = $externalTaxRate; + $this->custom = $custom; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -173,6 +183,27 @@ public function getExternalTaxRate() return $this->externalTaxRate; } + /** + *

Custom Fields for the custom Shipping Method.

+ * + * + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsDraftModel::of($data); + } + + return $this->custom; + } + /** * @param ?string $shippingMethodName @@ -205,4 +236,12 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php index ed47c74f202..49318aafe7a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php @@ -12,6 +12,7 @@ use Commercetools\Api\Models\Order\StagedOrderUpdateAction; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; +use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -21,6 +22,7 @@ interface StagedOrderSetCustomShippingMethodAction extends StagedOrderUpdateActi public const FIELD_SHIPPING_RATE = 'shippingRate'; public const FIELD_TAX_CATEGORY = 'taxCategory'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_CUSTOM = 'custom'; /** *

Name of the custom Shipping Method.

@@ -54,6 +56,14 @@ public function getTaxCategory(); */ public function getExternalTaxRate(); + /** + *

Custom Fields for the custom Shipping Method.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom(); + /** * @param ?string $shippingMethodName */ @@ -73,4 +83,9 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi * @param ?ExternalTaxRateDraft $externalTaxRate */ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php index 7220586a5a7..e0e2fad686e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php @@ -16,6 +16,8 @@ use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftBuilder; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -52,6 +54,12 @@ final class StagedOrderSetCustomShippingMethodActionBuilder implements Builder */ private $externalTaxRate; + /** + + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; + /** *

Name of the custom Shipping Method.

* @@ -96,6 +104,17 @@ public function getExternalTaxRate() return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } + /** + *

Custom Fields for the custom Shipping Method.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + } + /** * @param ?string $shippingMethodName * @return $this @@ -140,6 +159,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) return $this; } + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; + + return $this; + } + /** * @deprecated use withShippingRate() instead * @return $this @@ -173,13 +203,25 @@ public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externa return $this; } + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): StagedOrderSetCustomShippingMethodAction { return new StagedOrderSetCustomShippingMethodActionModel( $this->shippingMethodName, $this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php index 9734cfeca2b..a034972f64e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php @@ -16,6 +16,8 @@ use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftModel; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierModel; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -58,6 +60,12 @@ final class StagedOrderSetCustomShippingMethodActionModel extends JsonObjectMode */ protected $externalTaxRate; + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; + /** * @psalm-suppress MissingParamType @@ -67,12 +75,14 @@ public function __construct( ?ShippingRateDraft $shippingRate = null, ?TaxCategoryResourceIdentifier $taxCategory = null, ?ExternalTaxRateDraft $externalTaxRate = null, + ?CustomFieldsDraft $custom = null, ?string $action = null ) { $this->shippingMethodName = $shippingMethodName; $this->shippingRate = $shippingRate; $this->taxCategory = $taxCategory; $this->externalTaxRate = $externalTaxRate; + $this->custom = $custom; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -177,6 +187,27 @@ public function getExternalTaxRate() return $this->externalTaxRate; } + /** + *

Custom Fields for the custom Shipping Method.

+ * + * + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsDraftModel::of($data); + } + + return $this->custom; + } + /** * @param ?string $shippingMethodName @@ -209,4 +240,12 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php index e6c11729e11..ea1058a8713 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php @@ -13,6 +13,7 @@ use Commercetools\Api\Models\Order\StagedOrderUpdateAction; use Commercetools\Api\Models\ShippingMethod\ShippingRateDraft; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; +use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -23,6 +24,7 @@ interface StagedOrderSetShippingAddressAndCustomShippingMethodAction extends Sta public const FIELD_SHIPPING_RATE = 'shippingRate'; public const FIELD_TAX_CATEGORY = 'taxCategory'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_CUSTOM = 'custom'; /** *

Value to set for shippingAddress.

@@ -64,6 +66,14 @@ public function getTaxCategory(); */ public function getExternalTaxRate(); + /** + *

Custom Fields for the custom Shipping Method.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom(); + /** * @param ?BaseAddress $address */ @@ -88,4 +98,9 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi * @param ?ExternalTaxRateDraft $externalTaxRate */ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php index f5abdbd8e21..93f4cac3b94 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php @@ -18,6 +18,8 @@ use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftBuilder; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -60,6 +62,12 @@ final class StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder im */ private $externalTaxRate; + /** + + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; + /** *

Value to set for shippingAddress.

* @@ -115,6 +123,17 @@ public function getExternalTaxRate() return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } + /** + *

Custom Fields for the custom Shipping Method.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + } + /** * @param ?BaseAddress $address * @return $this @@ -170,6 +189,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) return $this; } + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; + + return $this; + } + /** * @deprecated use withAddress() instead * @return $this @@ -214,6 +244,17 @@ public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externa return $this; } + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): StagedOrderSetShippingAddressAndCustomShippingMethodAction { return new StagedOrderSetShippingAddressAndCustomShippingMethodActionModel( @@ -221,7 +262,8 @@ public function build(): StagedOrderSetShippingAddressAndCustomShippingMethodAct $this->shippingMethodName, $this->shippingRate instanceof ShippingRateDraftBuilder ? $this->shippingRate->build() : $this->shippingRate, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php index 33f2b5985f1..853817fb809 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php @@ -18,6 +18,8 @@ use Commercetools\Api\Models\ShippingMethod\ShippingRateDraftModel; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierModel; +use Commercetools\Api\Models\Type\CustomFieldsDraft; +use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -66,6 +68,12 @@ final class StagedOrderSetShippingAddressAndCustomShippingMethodActionModel exte */ protected $externalTaxRate; + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; + /** * @psalm-suppress MissingParamType @@ -76,6 +84,7 @@ public function __construct( ?ShippingRateDraft $shippingRate = null, ?TaxCategoryResourceIdentifier $taxCategory = null, ?ExternalTaxRateDraft $externalTaxRate = null, + ?CustomFieldsDraft $custom = null, ?string $action = null ) { $this->address = $address; @@ -83,6 +92,7 @@ public function __construct( $this->shippingRate = $shippingRate; $this->taxCategory = $taxCategory; $this->externalTaxRate = $externalTaxRate; + $this->custom = $custom; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -208,6 +218,27 @@ public function getExternalTaxRate() return $this->externalTaxRate; } + /** + *

Custom Fields for the custom Shipping Method.

+ * + * + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($data)) { + return null; + } + + $this->custom = CustomFieldsDraftModel::of($data); + } + + return $this->custom; + } + /** * @param ?BaseAddress $address @@ -248,4 +279,12 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } } diff --git a/references.txt b/references.txt index 02daa1420a9..290ad299e1a 100644 --- a/references.txt +++ b/references.txt @@ -339,3 +339,4 @@ df53588d26d7953dfdf44166866ca03045f0a70b 9066fb1012d20a92037e102e18a6295bdbcb82e3 4025ec42d633ae6b77320e24f6244d9dce608e6e 7abe530c4e76020a59ffb61623f20b87ae406e02 +55ee33c4d18af345c4e89be226286c56c187a878