From 0941cc72236013c298da5a94acce24947e4bba6a Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 11:46:18 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 32 +++++++++---------- .../src/Models/Cart/CartDraftModel.php | 4 +-- .../src/Models/Cart/CartModel.php | 4 +-- .../src/Models/Cart/CustomLineItemModel.php | 4 +-- .../Models/Cart/CustomShippingDraftModel.php | 4 +-- .../Models/Cart/DiscountOnTotalPriceModel.php | 12 +++---- .../DiscountedLineItemPortionDraftModel.php | 8 ++--- .../Cart/DiscountedLineItemPortionModel.php | 8 ++--- .../Cart/DiscountedLineItemPriceModel.php | 4 +-- .../Cart/DiscountedTotalPricePortionModel.php | 4 +-- .../src/Models/Cart/ShippingDraftModel.php | 4 +-- .../src/Models/Cart/ShippingModel.php | 4 +-- .../src/Models/Cart/TaxedPriceDraftModel.php | 4 +-- .../CartDiscount/CartDiscountDraftModel.php | 8 ++--- .../Models/CartDiscount/CartDiscountModel.php | 8 ++--- .../src/Models/Channel/ChannelDraftModel.php | 4 +-- .../src/Models/Channel/ChannelModel.php | 4 +-- .../ChannelSetGeoLocationActionModel.php | 4 +-- .../Models/Common/DiscountedPriceModel.php | 4 +-- .../src/Models/Common/PriceModel.php | 4 +-- .../src/Models/Common/PriceTierModel.php | 4 +-- .../src/Models/Common/ScopedPriceModel.php | 8 ++--- ...ithDifferentVariantSelectionErrorModel.php | 4 +-- ...ithDifferentVariantSelectionErrorModel.php | 4 +-- .../src/Models/Extension/ExtensionModel.php | 4 +-- .../Models/Extension/HttpDestinationModel.php | 4 +-- ...oductSelectionProductAddedMessageModel.php | 4 +-- ...lectionProductAddedMessagePayloadModel.php | 4 +-- ...ionVariantSelectionChangedMessageModel.php | 8 ++--- ...antSelectionChangedMessagePayloadModel.php | 8 ++--- .../src/Models/OrderEdit/OrderEditModel.php | 4 +-- .../src/Models/Product/SearchKeywordModel.php | 4 +-- .../ProductDiscountDraftModel.php | 4 +-- .../ProductDiscount/ProductDiscountModel.php | 4 +-- .../AssignedProductReferenceModel.php | 4 +-- .../AssignedProductSelectionModel.php | 4 +-- .../ProductSelectionAssignmentModel.php | 4 +-- .../AttributeDefinitionDraftModel.php | 4 +-- .../ProductType/AttributeDefinitionModel.php | 4 +-- .../ProductType/AttributeSetTypeModel.php | 4 +-- .../src/Models/Project/ProjectModel.php | 4 +-- .../Subscription/CloudEventsPayloadModel.php | 4 +-- .../Models/Type/CustomFieldSetTypeModel.php | 4 +-- .../src/Models/Type/FieldDefinitionModel.php | 4 +-- .../src/Models/ChangeHistory/RecordModel.php | 8 ++--- .../Customfields/ReferenceFieldModel.php | 4 +-- .../Models/Products/SearchKeywordModel.php | 4 +-- .../Producttypes/AttributeDefinitionModel.php | 4 +-- references.txt | 1 + 49 files changed, 131 insertions(+), 130 deletions(-) diff --git a/changes.md b/changes.md index dacd0dbda5a..3a21b575c14 100644 --- a/changes.md +++ b/changes.md @@ -1,5 +1,21 @@ **Api changes** +
+Removed Method(s) + +- :warning: removed method `$apiRoot->withProjectKey()->me()->businessUnits()->withId()->delete()` +- :warning: removed method `$apiRoot->withProjectKey()->me()->businessUnits()->withKey()->delete()` +
+ + +
+Added Property(s) + +- added property `applicationMode` to type `CartDiscountValueAbsolute` +- added property `applicationMode` to type `CartDiscountValueAbsoluteDraft` +
+ +
Added Type(s) @@ -16,22 +32,6 @@ - added type `DeliveryCustomTypeSetMessagePayload`
- -
-Removed Method(s) - -- :warning: removed method `$apiRoot->withProjectKey()->me()->businessUnits()->withId()->delete()` -- :warning: removed method `$apiRoot->withProjectKey()->me()->businessUnits()->withKey()->delete()` -
- - -
-Added Property(s) - -- added property `applicationMode` to type `CartDiscountValueAbsolute` -- added property `applicationMode` to type `CartDiscountValueAbsoluteDraft` -
- **Import changes**
diff --git a/lib/commercetools-api/src/Models/Cart/CartDraftModel.php b/lib/commercetools-api/src/Models/Cart/CartDraftModel.php index 276c20de52f..dc69d68ea09 100644 --- a/lib/commercetools-api/src/Models/Cart/CartDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartDraftModel.php @@ -662,8 +662,8 @@ public function getShippingRateInput() if (is_null($data)) { return null; } - - $this->shippingRateInput = ShippingRateInputDraftModel::of($data); + $className = ShippingRateInputDraftModel::resolveDiscriminatorClass($data); + $this->shippingRateInput = $className::of($data); } return $this->shippingRateInput; diff --git a/lib/commercetools-api/src/Models/Cart/CartModel.php b/lib/commercetools-api/src/Models/Cart/CartModel.php index 35ddaefa5ba..627e83b81be 100644 --- a/lib/commercetools-api/src/Models/Cart/CartModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartModel.php @@ -998,8 +998,8 @@ public function getShippingRateInput() if (is_null($data)) { return null; } - - $this->shippingRateInput = ShippingRateInputModel::of($data); + $className = ShippingRateInputModel::resolveDiscriminatorClass($data); + $this->shippingRateInput = $className::of($data); } return $this->shippingRateInput; diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php index 627d234e74a..20907b674a9 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php @@ -251,8 +251,8 @@ public function getMoney() if (is_null($data)) { return null; } - - $this->money = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->money = $className::of($data); } return $this->money; diff --git a/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php index 6c33375798d..0a749fd6ed5 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomShippingDraftModel.php @@ -210,8 +210,8 @@ public function getShippingRateInput() if (is_null($data)) { return null; } - - $this->shippingRateInput = ShippingRateInputDraftModel::of($data); + $className = ShippingRateInputDraftModel::resolveDiscriminatorClass($data); + $this->shippingRateInput = $className::of($data); } return $this->shippingRateInput; diff --git a/lib/commercetools-api/src/Models/Cart/DiscountOnTotalPriceModel.php b/lib/commercetools-api/src/Models/Cart/DiscountOnTotalPriceModel.php index 1317b68a9b9..6e0d81bbcd4 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountOnTotalPriceModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountOnTotalPriceModel.php @@ -75,8 +75,8 @@ public function getDiscountedAmount() if (is_null($data)) { return null; } - - $this->discountedAmount = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->discountedAmount = $className::of($data); } return $this->discountedAmount; @@ -117,8 +117,8 @@ public function getDiscountedNetAmount() if (is_null($data)) { return null; } - - $this->discountedNetAmount = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->discountedNetAmount = $className::of($data); } return $this->discountedNetAmount; @@ -139,8 +139,8 @@ public function getDiscountedGrossAmount() if (is_null($data)) { return null; } - - $this->discountedGrossAmount = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->discountedGrossAmount = $className::of($data); } return $this->discountedGrossAmount; diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionDraftModel.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionDraftModel.php index 75c536fef4b..801757661ef 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionDraftModel.php @@ -61,8 +61,8 @@ public function getDiscount() if (is_null($data)) { return null; } - - $this->discount = ReferenceModel::of($data); + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->discount = $className::of($data); } return $this->discount; @@ -82,8 +82,8 @@ public function getDiscountedAmount() if (is_null($data)) { return null; } - - $this->discountedAmount = TypedMoneyDraftModel::of($data); + $className = TypedMoneyDraftModel::resolveDiscriminatorClass($data); + $this->discountedAmount = $className::of($data); } return $this->discountedAmount; diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php index c3b9a76ca17..206d5513469 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPortionModel.php @@ -61,8 +61,8 @@ public function getDiscount() if (is_null($data)) { return null; } - - $this->discount = ReferenceModel::of($data); + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->discount = $className::of($data); } return $this->discount; @@ -82,8 +82,8 @@ public function getDiscountedAmount() if (is_null($data)) { return null; } - - $this->discountedAmount = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->discountedAmount = $className::of($data); } return $this->discountedAmount; diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php index af1685a17db..aed26dc3902 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedLineItemPriceModel.php @@ -59,8 +59,8 @@ public function getValue() if (is_null($data)) { return null; } - - $this->value = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); } return $this->value; diff --git a/lib/commercetools-api/src/Models/Cart/DiscountedTotalPricePortionModel.php b/lib/commercetools-api/src/Models/Cart/DiscountedTotalPricePortionModel.php index c9a1bd9ec41..2f953047ab1 100644 --- a/lib/commercetools-api/src/Models/Cart/DiscountedTotalPricePortionModel.php +++ b/lib/commercetools-api/src/Models/Cart/DiscountedTotalPricePortionModel.php @@ -82,8 +82,8 @@ public function getDiscountedAmount() if (is_null($data)) { return null; } - - $this->discountedAmount = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->discountedAmount = $className::of($data); } return $this->discountedAmount; diff --git a/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php b/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php index 48cdce125ee..72b06aaaa34 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingDraftModel.php @@ -172,8 +172,8 @@ public function getShippingRateInput() if (is_null($data)) { return null; } - - $this->shippingRateInput = ShippingRateInputDraftModel::of($data); + $className = ShippingRateInputDraftModel::resolveDiscriminatorClass($data); + $this->shippingRateInput = $className::of($data); } return $this->shippingRateInput; diff --git a/lib/commercetools-api/src/Models/Cart/ShippingModel.php b/lib/commercetools-api/src/Models/Cart/ShippingModel.php index 79c4a39e5f6..7efe7da6439 100644 --- a/lib/commercetools-api/src/Models/Cart/ShippingModel.php +++ b/lib/commercetools-api/src/Models/Cart/ShippingModel.php @@ -153,8 +153,8 @@ public function getShippingRateInput() if (is_null($data)) { return null; } - - $this->shippingRateInput = ShippingRateInputModel::of($data); + $className = ShippingRateInputModel::resolveDiscriminatorClass($data); + $this->shippingRateInput = $className::of($data); } return $this->shippingRateInput; diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php index 4587ebaed54..e8bf6e16938 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php @@ -140,8 +140,8 @@ public function getTotalTax() if (is_null($data)) { return null; } - - $this->totalTax = TypedMoneyDraftModel::of($data); + $className = TypedMoneyDraftModel::resolveDiscriminatorClass($data); + $this->totalTax = $className::of($data); } return $this->totalTax; diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php index ef9e4213299..fed8b342e28 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php @@ -221,8 +221,8 @@ public function getValue() if (is_null($data)) { return null; } - - $this->value = CartDiscountValueDraftModel::of($data); + $className = CartDiscountValueDraftModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); } return $this->value; @@ -263,8 +263,8 @@ public function getTarget() if (is_null($data)) { return null; } - - $this->target = CartDiscountTargetModel::of($data); + $className = CartDiscountTargetModel::resolveDiscriminatorClass($data); + $this->target = $className::of($data); } return $this->target; diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php index 19bfbf9e39c..ff253ad624e 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php @@ -414,8 +414,8 @@ public function getValue() if (is_null($data)) { return null; } - - $this->value = CartDiscountValueModel::of($data); + $className = CartDiscountValueModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); } return $this->value; @@ -456,8 +456,8 @@ public function getTarget() if (is_null($data)) { return null; } - - $this->target = CartDiscountTargetModel::of($data); + $className = CartDiscountTargetModel::resolveDiscriminatorClass($data); + $this->target = $className::of($data); } return $this->target; diff --git a/lib/commercetools-api/src/Models/Channel/ChannelDraftModel.php b/lib/commercetools-api/src/Models/Channel/ChannelDraftModel.php index 7f179f1cd66..f1ee93ecc02 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelDraftModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelDraftModel.php @@ -232,8 +232,8 @@ public function getGeoLocation() if (is_null($data)) { return null; } - - $this->geoLocation = GeoJsonModel::of($data); + $className = GeoJsonModel::resolveDiscriminatorClass($data); + $this->geoLocation = $className::of($data); } return $this->geoLocation; diff --git a/lib/commercetools-api/src/Models/Channel/ChannelModel.php b/lib/commercetools-api/src/Models/Channel/ChannelModel.php index 346e650eb55..cc688e8f334 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelModel.php @@ -445,8 +445,8 @@ public function getGeoLocation() if (is_null($data)) { return null; } - - $this->geoLocation = GeoJsonModel::of($data); + $className = GeoJsonModel::resolveDiscriminatorClass($data); + $this->geoLocation = $className::of($data); } return $this->geoLocation; diff --git a/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionModel.php b/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionModel.php index 88dbe9f4ad2..d182cfd4305 100644 --- a/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionModel.php +++ b/lib/commercetools-api/src/Models/Channel/ChannelSetGeoLocationActionModel.php @@ -78,8 +78,8 @@ public function getGeoLocation() if (is_null($data)) { return null; } - - $this->geoLocation = GeoJsonModel::of($data); + $className = GeoJsonModel::resolveDiscriminatorClass($data); + $this->geoLocation = $className::of($data); } return $this->geoLocation; diff --git a/lib/commercetools-api/src/Models/Common/DiscountedPriceModel.php b/lib/commercetools-api/src/Models/Common/DiscountedPriceModel.php index c7fabe1c614..43d1168e542 100644 --- a/lib/commercetools-api/src/Models/Common/DiscountedPriceModel.php +++ b/lib/commercetools-api/src/Models/Common/DiscountedPriceModel.php @@ -59,8 +59,8 @@ public function getValue() if (is_null($data)) { return null; } - - $this->value = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); } return $this->value; diff --git a/lib/commercetools-api/src/Models/Common/PriceModel.php b/lib/commercetools-api/src/Models/Common/PriceModel.php index 043f9fa019a..a9db5398142 100644 --- a/lib/commercetools-api/src/Models/Common/PriceModel.php +++ b/lib/commercetools-api/src/Models/Common/PriceModel.php @@ -176,8 +176,8 @@ public function getValue() if (is_null($data)) { return null; } - - $this->value = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); } return $this->value; diff --git a/lib/commercetools-api/src/Models/Common/PriceTierModel.php b/lib/commercetools-api/src/Models/Common/PriceTierModel.php index 93065e841c1..ca158392b51 100644 --- a/lib/commercetools-api/src/Models/Common/PriceTierModel.php +++ b/lib/commercetools-api/src/Models/Common/PriceTierModel.php @@ -80,8 +80,8 @@ public function getValue() if (is_null($data)) { return null; } - - $this->value = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); } return $this->value; diff --git a/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php b/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php index 31777607a38..c4602e4b6c6 100644 --- a/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php +++ b/lib/commercetools-api/src/Models/Common/ScopedPriceModel.php @@ -148,8 +148,8 @@ public function getValue() if (is_null($data)) { return null; } - - $this->value = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); } return $this->value; @@ -169,8 +169,8 @@ public function getCurrentValue() if (is_null($data)) { return null; } - - $this->currentValue = TypedMoneyModel::of($data); + $className = TypedMoneyModel::resolveDiscriminatorClass($data); + $this->currentValue = $className::of($data); } return $this->currentValue; diff --git a/lib/commercetools-api/src/Models/Error/GraphQLProductPresentWithDifferentVariantSelectionErrorModel.php b/lib/commercetools-api/src/Models/Error/GraphQLProductPresentWithDifferentVariantSelectionErrorModel.php index 8e94a961572..f649594f64e 100644 --- a/lib/commercetools-api/src/Models/Error/GraphQLProductPresentWithDifferentVariantSelectionErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/GraphQLProductPresentWithDifferentVariantSelectionErrorModel.php @@ -109,8 +109,8 @@ public function getExistingVariantSelection() if (is_null($data)) { return null; } - - $this->existingVariantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->existingVariantSelection = $className::of($data); } return $this->existingVariantSelection; diff --git a/lib/commercetools-api/src/Models/Error/ProductPresentWithDifferentVariantSelectionErrorModel.php b/lib/commercetools-api/src/Models/Error/ProductPresentWithDifferentVariantSelectionErrorModel.php index c590543da7b..eb25396fc2c 100644 --- a/lib/commercetools-api/src/Models/Error/ProductPresentWithDifferentVariantSelectionErrorModel.php +++ b/lib/commercetools-api/src/Models/Error/ProductPresentWithDifferentVariantSelectionErrorModel.php @@ -137,8 +137,8 @@ public function getExistingVariantSelection() if (is_null($data)) { return null; } - - $this->existingVariantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->existingVariantSelection = $className::of($data); } return $this->existingVariantSelection; diff --git a/lib/commercetools-api/src/Models/Extension/ExtensionModel.php b/lib/commercetools-api/src/Models/Extension/ExtensionModel.php index 6c679115a6a..26a6054aab5 100644 --- a/lib/commercetools-api/src/Models/Extension/ExtensionModel.php +++ b/lib/commercetools-api/src/Models/Extension/ExtensionModel.php @@ -278,8 +278,8 @@ public function getDestination() if (is_null($data)) { return null; } - - $this->destination = ExtensionDestinationModel::of($data); + $className = ExtensionDestinationModel::resolveDiscriminatorClass($data); + $this->destination = $className::of($data); } return $this->destination; diff --git a/lib/commercetools-api/src/Models/Extension/HttpDestinationModel.php b/lib/commercetools-api/src/Models/Extension/HttpDestinationModel.php index ab2bb88fec7..51f612024ee 100644 --- a/lib/commercetools-api/src/Models/Extension/HttpDestinationModel.php +++ b/lib/commercetools-api/src/Models/Extension/HttpDestinationModel.php @@ -104,8 +104,8 @@ public function getAuthentication() if (is_null($data)) { return null; } - - $this->authentication = HttpDestinationAuthenticationModel::of($data); + $className = HttpDestinationAuthenticationModel::resolveDiscriminatorClass($data); + $this->authentication = $className::of($data); } return $this->authentication; diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageModel.php index 80b7f6a53e4..9b736bfd5ed 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessageModel.php @@ -411,8 +411,8 @@ public function getVariantSelection() if (is_null($data)) { return null; } - - $this->variantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->variantSelection = $className::of($data); } return $this->variantSelection; diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadModel.php index 40dad39e803..fc1e8bfa342 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionProductAddedMessagePayloadModel.php @@ -109,8 +109,8 @@ public function getVariantSelection() if (is_null($data)) { return null; } - - $this->variantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->variantSelection = $className::of($data); } return $this->variantSelection; diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageModel.php index 0e98994efb4..a0f9737d6ea 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessageModel.php @@ -419,8 +419,8 @@ public function getOldVariantSelection() if (is_null($data)) { return null; } - - $this->oldVariantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->oldVariantSelection = $className::of($data); } return $this->oldVariantSelection; @@ -440,8 +440,8 @@ public function getNewVariantSelection() if (is_null($data)) { return null; } - - $this->newVariantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->newVariantSelection = $className::of($data); } return $this->newVariantSelection; diff --git a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadModel.php index 4beb47d74a6..bd6165cb7e4 100644 --- a/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ProductSelectionVariantSelectionChangedMessagePayloadModel.php @@ -117,8 +117,8 @@ public function getOldVariantSelection() if (is_null($data)) { return null; } - - $this->oldVariantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->oldVariantSelection = $className::of($data); } return $this->oldVariantSelection; @@ -138,8 +138,8 @@ public function getNewVariantSelection() if (is_null($data)) { return null; } - - $this->newVariantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->newVariantSelection = $className::of($data); } return $this->newVariantSelection; diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php index 400ae23848a..566039a1d01 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php @@ -299,8 +299,8 @@ public function getResult() if (is_null($data)) { return null; } - - $this->result = OrderEditResultModel::of($data); + $className = OrderEditResultModel::resolveDiscriminatorClass($data); + $this->result = $className::of($data); } return $this->result; diff --git a/lib/commercetools-api/src/Models/Product/SearchKeywordModel.php b/lib/commercetools-api/src/Models/Product/SearchKeywordModel.php index 546eb4002f0..7c935acb8a9 100644 --- a/lib/commercetools-api/src/Models/Product/SearchKeywordModel.php +++ b/lib/commercetools-api/src/Models/Product/SearchKeywordModel.php @@ -77,8 +77,8 @@ public function getSuggestTokenizer() if (is_null($data)) { return null; } - - $this->suggestTokenizer = SuggestTokenizerModel::of($data); + $className = SuggestTokenizerModel::resolveDiscriminatorClass($data); + $this->suggestTokenizer = $className::of($data); } return $this->suggestTokenizer; diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftModel.php index b2fe7d9c854..8aa0fc6dc8a 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountDraftModel.php @@ -178,8 +178,8 @@ public function getValue() if (is_null($data)) { return null; } - - $this->value = ProductDiscountValueDraftModel::of($data); + $className = ProductDiscountValueDraftModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); } return $this->value; diff --git a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountModel.php b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountModel.php index 708da01fdb7..8311ff54709 100644 --- a/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountModel.php +++ b/lib/commercetools-api/src/Models/ProductDiscount/ProductDiscountModel.php @@ -371,8 +371,8 @@ public function getValue() if (is_null($data)) { return null; } - - $this->value = ProductDiscountValueModel::of($data); + $className = ProductDiscountValueModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); } return $this->value; diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceModel.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceModel.php index f504e93afe2..c432b21806a 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductReferenceModel.php @@ -90,8 +90,8 @@ public function getVariantSelection() if (is_null($data)) { return null; } - - $this->variantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->variantSelection = $className::of($data); } return $this->variantSelection; diff --git a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionModel.php b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionModel.php index 1902e91febf..e19607b0087 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/AssignedProductSelectionModel.php @@ -96,8 +96,8 @@ public function getVariantSelection() if (is_null($data)) { return null; } - - $this->variantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->variantSelection = $className::of($data); } return $this->variantSelection; diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentModel.php index f63b303bfa9..91d2fb4c40f 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionAssignmentModel.php @@ -119,8 +119,8 @@ public function getVariantSelection() if (is_null($data)) { return null; } - - $this->variantSelection = ProductVariantSelectionModel::of($data); + $className = ProductVariantSelectionModel::resolveDiscriminatorClass($data); + $this->variantSelection = $className::of($data); } return $this->variantSelection; diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftModel.php index 41fe8573bd1..f9756486ba7 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionDraftModel.php @@ -108,8 +108,8 @@ public function getType() if (is_null($data)) { return null; } - - $this->type = AttributeTypeModel::of($data); + $className = AttributeTypeModel::resolveDiscriminatorClass($data); + $this->type = $className::of($data); } return $this->type; diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionModel.php index 5ab6e864c6a..1794810b53d 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeDefinitionModel.php @@ -107,8 +107,8 @@ public function getType() if (is_null($data)) { return null; } - - $this->type = AttributeTypeModel::of($data); + $className = AttributeTypeModel::resolveDiscriminatorClass($data); + $this->type = $className::of($data); } return $this->type; diff --git a/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeModel.php b/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeModel.php index ef7535dbaf7..0e7acabd25a 100644 --- a/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductType/AttributeSetTypeModel.php @@ -76,8 +76,8 @@ public function getElementType() if (is_null($data)) { return null; } - - $this->elementType = AttributeTypeModel::of($data); + $className = AttributeTypeModel::resolveDiscriminatorClass($data); + $this->elementType = $className::of($data); } return $this->elementType; diff --git a/lib/commercetools-api/src/Models/Project/ProjectModel.php b/lib/commercetools-api/src/Models/Project/ProjectModel.php index f6cf8c523a3..bebe31df27c 100644 --- a/lib/commercetools-api/src/Models/Project/ProjectModel.php +++ b/lib/commercetools-api/src/Models/Project/ProjectModel.php @@ -391,8 +391,8 @@ public function getShippingRateInputType() if (is_null($data)) { return null; } - - $this->shippingRateInputType = ShippingRateInputTypeModel::of($data); + $className = ShippingRateInputTypeModel::resolveDiscriminatorClass($data); + $this->shippingRateInputType = $className::of($data); } return $this->shippingRateInputType; diff --git a/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadModel.php b/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadModel.php index 9d0f39d3673..c0897a65730 100644 --- a/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadModel.php +++ b/lib/commercetools-api/src/Models/Subscription/CloudEventsPayloadModel.php @@ -308,8 +308,8 @@ public function getData() if (is_null($data)) { return null; } - - $this->data = DeliveryPayloadModel::of($data); + $className = DeliveryPayloadModel::resolveDiscriminatorClass($data); + $this->data = $className::of($data); } return $this->data; diff --git a/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeModel.php b/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeModel.php index 37b640a3840..4351a3b3095 100644 --- a/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeModel.php +++ b/lib/commercetools-api/src/Models/Type/CustomFieldSetTypeModel.php @@ -76,8 +76,8 @@ public function getElementType() if (is_null($data)) { return null; } - - $this->elementType = FieldTypeModel::of($data); + $className = FieldTypeModel::resolveDiscriminatorClass($data); + $this->elementType = $className::of($data); } return $this->elementType; diff --git a/lib/commercetools-api/src/Models/Type/FieldDefinitionModel.php b/lib/commercetools-api/src/Models/Type/FieldDefinitionModel.php index b4f338f558b..e05522d2a9e 100644 --- a/lib/commercetools-api/src/Models/Type/FieldDefinitionModel.php +++ b/lib/commercetools-api/src/Models/Type/FieldDefinitionModel.php @@ -83,8 +83,8 @@ public function getType() if (is_null($data)) { return null; } - - $this->type = FieldTypeModel::of($data); + $className = FieldTypeModel::resolveDiscriminatorClass($data); + $this->type = $className::of($data); } return $this->type; diff --git a/lib/commercetools-history/src/Models/ChangeHistory/RecordModel.php b/lib/commercetools-history/src/Models/ChangeHistory/RecordModel.php index daafa698d13..99541972317 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/RecordModel.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/RecordModel.php @@ -251,8 +251,8 @@ public function getLabel() if (is_null($data)) { return null; } - - $this->label = LabelModel::of($data); + $className = LabelModel::resolveDiscriminatorClass($data); + $this->label = $className::of($data); } return $this->label; @@ -272,8 +272,8 @@ public function getPreviousLabel() if (is_null($data)) { return null; } - - $this->previousLabel = LabelModel::of($data); + $className = LabelModel::resolveDiscriminatorClass($data); + $this->previousLabel = $className::of($data); } return $this->previousLabel; diff --git a/lib/commercetools-import/src/Models/Customfields/ReferenceFieldModel.php b/lib/commercetools-import/src/Models/Customfields/ReferenceFieldModel.php index 38864fa1d9f..a02c0ba5afc 100644 --- a/lib/commercetools-import/src/Models/Customfields/ReferenceFieldModel.php +++ b/lib/commercetools-import/src/Models/Customfields/ReferenceFieldModel.php @@ -80,8 +80,8 @@ public function getValue() if (is_null($data)) { return null; } - - $this->value = KeyReferenceModel::of($data); + $className = KeyReferenceModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); } return $this->value; diff --git a/lib/commercetools-import/src/Models/Products/SearchKeywordModel.php b/lib/commercetools-import/src/Models/Products/SearchKeywordModel.php index 06b8cc25df9..c01c0176085 100644 --- a/lib/commercetools-import/src/Models/Products/SearchKeywordModel.php +++ b/lib/commercetools-import/src/Models/Products/SearchKeywordModel.php @@ -75,8 +75,8 @@ public function getSuggestTokenizer() if (is_null($data)) { return null; } - - $this->suggestTokenizer = SuggestTokenizerModel::of($data); + $className = SuggestTokenizerModel::resolveDiscriminatorClass($data); + $this->suggestTokenizer = $className::of($data); } return $this->suggestTokenizer; diff --git a/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionModel.php b/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionModel.php index 3467ba8df9c..3ec765ebe2b 100644 --- a/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionModel.php +++ b/lib/commercetools-import/src/Models/Producttypes/AttributeDefinitionModel.php @@ -105,8 +105,8 @@ public function getType() if (is_null($data)) { return null; } - - $this->type = AttributeTypeModel::of($data); + $className = AttributeTypeModel::resolveDiscriminatorClass($data); + $this->type = $className::of($data); } return $this->type; diff --git a/references.txt b/references.txt index 7fe9edbf919..aa3c6329797 100644 --- a/references.txt +++ b/references.txt @@ -292,3 +292,4 @@ ab4dd4a6e46c77f13c03d43fe3628f37509c95b4 9fafdcce46660fc8908b89d215d54744fb51cef5 9fb04dae472dbd5e7e4749ba34c1bb12161336bb 83b81d8842fe000b486145eebd80ad6c3dd0b4ae +7fa01c3fa58cb65ecfaeeac01d0584541a8d26e5