From c3c3ac549ab7482678f3c875e9f3c5d12e3df935 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Wed, 5 Jul 2023 11:39:55 +0000 Subject: [PATCH 01/44] TASK: Updating SDK --- changes.md | 333 +---------- ...toreKeyByStoreKeyCartDiscountsByIDTest.php | 552 ++++++++++++++++++ ...KeyByStoreKeyCartDiscountsKeyByKeyTest.php | 552 ++++++++++++++++++ ...yInStoreKeyByStoreKeyCartDiscountsTest.php | 229 ++++++++ ...ceByProjectKeyInStoreKeyByStoreKeyTest.php | 12 + lib/commercetools-api/docs/RequestBuilder.md | 220 +++++-- ...reKeyByStoreKeyCartDiscountsByIDDelete.php | 170 ++++++ ...StoreKeyByStoreKeyCartDiscountsByIDGet.php | 155 +++++ ...toreKeyByStoreKeyCartDiscountsByIDPost.php | 160 +++++ ...eyInStoreKeyByStoreKeyCartDiscountsGet.php | 118 ++++ ...yByStoreKeyCartDiscountsKeyByKeyDelete.php | 170 ++++++ ...eKeyByStoreKeyCartDiscountsKeyByKeyGet.php | 155 +++++ ...KeyByStoreKeyCartDiscountsKeyByKeyPost.php | 160 +++++ ...yInStoreKeyByStoreKeyCartDiscountsPost.php | 118 ++++ ...sourceByProjectKeyInStoreKeyByStoreKey.php | 8 + ...ctKeyInStoreKeyByStoreKeyCartDiscounts.php | 72 +++ ...yInStoreKeyByStoreKeyCartDiscountsByID.php | 59 ++ ...toreKeyByStoreKeyCartDiscountsKeyByKey.php | 59 ++ .../Cart/CartAddCustomLineItemAction.php | 14 + .../CartAddCustomLineItemActionBuilder.php | 29 + .../Cart/CartAddCustomLineItemActionModel.php | 36 ++ .../src/Models/Cart/CustomLineItem.php | 14 + .../src/Models/Cart/CustomLineItemBuilder.php | 29 + .../src/Models/Cart/CustomLineItemDraft.php | 14 + .../Cart/CustomLineItemDraftBuilder.php | 29 + .../Models/Cart/CustomLineItemDraftModel.php | 36 ++ .../src/Models/Cart/CustomLineItemModel.php | 36 ++ .../src/Models/CartDiscount/CartDiscount.php | 18 + .../CartDiscountAddStoreAction.php | 36 ++ .../CartDiscountAddStoreActionBuilder.php | 80 +++ .../CartDiscountAddStoreActionCollection.php | 56 ++ .../CartDiscountAddStoreActionModel.php | 101 ++++ .../CartDiscount/CartDiscountBuilder.php | 33 ++ .../CartDiscountChangeIsActiveAction.php | 1 + ...artDiscountChangeIsActiveActionBuilder.php | 1 + .../CartDiscountChangeIsActiveActionModel.php | 1 + .../Models/CartDiscount/CartDiscountDraft.php | 23 +- .../CartDiscount/CartDiscountDraftBuilder.php | 38 +- .../CartDiscount/CartDiscountDraftModel.php | 45 +- .../Models/CartDiscount/CartDiscountModel.php | 40 ++ .../CartDiscountRemoveStoreAction.php | 31 + .../CartDiscountRemoveStoreActionBuilder.php | 75 +++ ...artDiscountRemoveStoreActionCollection.php | 56 ++ .../CartDiscountRemoveStoreActionModel.php | 96 +++ .../CartDiscountSetStoresAction.php | 38 ++ .../CartDiscountSetStoresActionBuilder.php | 71 +++ .../CartDiscountSetStoresActionCollection.php | 56 ++ .../CartDiscountSetStoresActionModel.php | 101 ++++ .../CartDiscountUpdateActionModel.php | 3 + .../src/Models/Error/ErrorObjectModel.php | 3 + .../Models/Error/GraphQLErrorObjectModel.php | 3 + .../GraphQLMaxCartDiscountsReachedError.php | 21 + ...hQLMaxCartDiscountsReachedErrorBuilder.php | 33 ++ ...MaxCartDiscountsReachedErrorCollection.php | 56 ++ ...aphQLMaxCartDiscountsReachedErrorModel.php | 71 +++ .../GraphQLMaxStoreReferencesReachedError.php | 21 + ...LMaxStoreReferencesReachedErrorBuilder.php | 33 ++ ...xStoreReferencesReachedErrorCollection.php | 56 ++ ...hQLMaxStoreReferencesReachedErrorModel.php | 71 +++ ...hQLStoreCartDiscountsLimitReachedError.php | 37 ++ ...eCartDiscountsLimitReachedErrorBuilder.php | 64 ++ ...rtDiscountsLimitReachedErrorCollection.php | 56 ++ ...oreCartDiscountsLimitReachedErrorModel.php | 107 ++++ .../Error/MaxCartDiscountsReachedError.php | 34 ++ .../MaxCartDiscountsReachedErrorBuilder.php | 63 ++ ...MaxCartDiscountsReachedErrorCollection.php | 56 ++ .../MaxCartDiscountsReachedErrorModel.php | 106 ++++ .../Error/MaxStoreReferencesReachedError.php | 34 ++ .../MaxStoreReferencesReachedErrorBuilder.php | 63 ++ ...xStoreReferencesReachedErrorCollection.php | 56 ++ .../MaxStoreReferencesReachedErrorModel.php | 106 ++++ .../StoreCartDiscountsLimitReachedError.php | 50 ++ ...eCartDiscountsLimitReachedErrorBuilder.php | 93 +++ ...rtDiscountsLimitReachedErrorCollection.php | 56 ++ ...oreCartDiscountsLimitReachedErrorModel.php | 143 +++++ .../StagedOrderAddCustomLineItemAction.php | 14 + ...gedOrderAddCustomLineItemActionBuilder.php | 29 + ...tagedOrderAddCustomLineItemActionModel.php | 36 ++ reference.txt | 1 + references.txt | 1 + 80 files changed, 5756 insertions(+), 356 deletions(-) create mode 100644 lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDTest.php create mode 100644 lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyTest.php create mode 100644 lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsTest.php create mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete.php create mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet.php create mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost.php create mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsGet.php create mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete.php create mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet.php create mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost.php create mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsPost.php create mode 100644 lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts.php create mode 100644 lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByID.php create mode 100644 lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKey.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreAction.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionBuilder.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionCollection.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionModel.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreAction.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionBuilder.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionCollection.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionModel.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresAction.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionBuilder.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionCollection.php create mode 100644 lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionModel.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedError.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedErrorBuilder.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedErrorCollection.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedErrorModel.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedError.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedErrorBuilder.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedErrorCollection.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedErrorModel.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedError.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorBuilder.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorCollection.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorModel.php create mode 100644 lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedError.php create mode 100644 lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorBuilder.php create mode 100644 lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorCollection.php create mode 100644 lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorModel.php create mode 100644 lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedError.php create mode 100644 lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorBuilder.php create mode 100644 lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorCollection.php create mode 100644 lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorModel.php create mode 100644 lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedError.php create mode 100644 lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorBuilder.php create mode 100644 lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorCollection.php create mode 100644 lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorModel.php create mode 100644 reference.txt diff --git a/changes.md b/changes.md index aacad5c524b..4dcd2702227 100644 --- a/changes.md +++ b/changes.md @@ -1,332 +1,47 @@ **Api changes**
-Added Property(s) - -- added property `perMethodTaxRate` to type `CustomLineItem` -- added property `key` to type `LineItem` -- added property `key` to type `LineItemDraft` -- added property `key` to type `CartAddLineItemAction` -- added property `lineItemKey` to type `CartApplyDeltaToLineItemShippingDetailsTargetsAction` -- added property `lineItemKey` to type `CartChangeLineItemQuantityAction` -- added property `lineItemKey` to type `CartRemoveLineItemAction` -- added property `lineItemKey` to type `CartSetLineItemCustomFieldAction` -- added property `lineItemKey` to type `CartSetLineItemCustomTypeAction` -- added property `lineItemKey` to type `CartSetLineItemDistributionChannelAction` -- added property `lineItemKey` to type `CartSetLineItemInventoryModeAction` -- added property `lineItemKey` to type `CartSetLineItemPriceAction` -- added property `lineItemKey` to type `CartSetLineItemShippingDetailsAction` -- added property `lineItemKey` to type `CartSetLineItemSupplyChannelAction` -- added property `lineItemKey` to type `CartSetLineItemTaxAmountAction` -- added property `lineItemKey` to type `CartSetLineItemTaxRateAction` -- added property `lineItemKey` to type `CartSetLineItemTotalPriceAction` -- added property `key` to type `MyLineItemDraft` -- added property `key` to type `MyCartAddLineItemAction` -- added property `lineItemKey` to type `MyCartApplyDeltaToLineItemShippingDetailsTargetsAction` -- added property `lineItemKey` to type `MyCartChangeLineItemQuantityAction` -- added property `lineItemKey` to type `MyCartRemoveLineItemAction` -- added property `lineItemKey` to type `MyCartSetLineItemCustomFieldAction` -- added property `lineItemKey` to type `MyCartSetLineItemCustomTypeAction` -- added property `lineItemKey` to type `MyCartSetLineItemDistributionChannelAction` -- added property `lineItemKey` to type `MyCartSetLineItemShippingDetailsAction` -- added property `lineItemKey` to type `MyCartSetLineItemSupplyChannelAction` -- added property `lineItemKey` to type `MyShoppingListChangeLineItemQuantityAction` -- added property `sku` to type `StandalonePriceDeletedMessage` -- added property `sku` to type `StandalonePriceDeletedMessagePayload` -- added property `key` to type `StagedOrderAddLineItemAction` -- added property `parcelKey` to type `StagedOrderAddParcelToDeliveryAction` -- added property `lineItemKey` to type `StagedOrderChangeLineItemQuantityAction` -- added property `lineItemKey` to type `StagedOrderRemoveLineItemAction` -- added property `parcelKey` to type `StagedOrderRemoveParcelFromDeliveryAction` -- added property `lineItemKey` to type `StagedOrderSetLineItemCustomFieldAction` -- added property `lineItemKey` to type `StagedOrderSetLineItemCustomTypeAction` -- added property `lineItemKey` to type `StagedOrderSetLineItemDistributionChannelAction` -- added property `lineItemKey` to type `StagedOrderSetLineItemPriceAction` -- added property `lineItemKey` to type `StagedOrderSetLineItemShippingDetailsAction` -- added property `lineItemKey` to type `StagedOrderSetLineItemTaxAmountAction` -- added property `lineItemKey` to type `StagedOrderSetLineItemTaxRateAction` -- added property `lineItemKey` to type `StagedOrderSetLineItemTotalPriceAction` -- added property `parcelKey` to type `StagedOrderSetParcelCustomFieldAction` -- added property `parcelKey` to type `StagedOrderSetParcelCustomTypeAction` -- added property `parcelKey` to type `StagedOrderSetParcelItemsAction` -- added property `parcelKey` to type `StagedOrderSetParcelMeasurementsAction` -- added property `parcelKey` to type `StagedOrderSetParcelTrackingDataAction` -- added property `key` to type `Parcel` -- added property `key` to type `ParcelDraft` -- added property `parcelKey` to type `OrderAddParcelToDeliveryAction` -- added property `parcelKey` to type `OrderRemoveParcelFromDeliveryAction` -- added property `lineItemKey` to type `OrderSetLineItemCustomFieldAction` -- added property `lineItemKey` to type `OrderSetLineItemCustomTypeAction` -- added property `lineItemKey` to type `OrderSetLineItemShippingDetailsAction` -- added property `parcelKey` to type `OrderSetParcelCustomFieldAction` -- added property `parcelKey` to type `OrderSetParcelCustomTypeAction` -- added property `parcelKey` to type `OrderSetParcelItemsAction` -- added property `parcelKey` to type `OrderSetParcelMeasurementsAction` -- added property `parcelKey` to type `OrderSetParcelTrackingDataAction` -
- - -
-Required Property(s) - -- changed property `lineItemId` of type `CartApplyDeltaToLineItemShippingDetailsTargetsAction` to be optional -- changed property `lineItemId` of type `CartChangeLineItemQuantityAction` to be optional -- changed property `lineItemId` of type `CartRemoveLineItemAction` to be optional -- changed property `lineItemId` of type `CartSetLineItemCustomFieldAction` to be optional -- changed property `lineItemId` of type `CartSetLineItemCustomTypeAction` to be optional -- changed property `lineItemId` of type `CartSetLineItemDistributionChannelAction` to be optional -- changed property `lineItemId` of type `CartSetLineItemInventoryModeAction` to be optional -- changed property `lineItemId` of type `CartSetLineItemPriceAction` to be optional -- changed property `lineItemId` of type `CartSetLineItemShippingDetailsAction` to be optional -- changed property `lineItemId` of type `CartSetLineItemSupplyChannelAction` to be optional -- changed property `lineItemId` of type `CartSetLineItemTaxAmountAction` to be optional -- changed property `lineItemId` of type `CartSetLineItemTaxRateAction` to be optional -- changed property `lineItemId` of type `CartSetLineItemTotalPriceAction` to be optional -- changed property `lineItemId` of type `MyCartApplyDeltaToLineItemShippingDetailsTargetsAction` to be optional -- changed property `lineItemId` of type `MyCartChangeLineItemQuantityAction` to be optional -- changed property `lineItemId` of type `MyCartRemoveLineItemAction` to be optional -- changed property `lineItemId` of type `MyCartSetLineItemCustomFieldAction` to be optional -- changed property `lineItemId` of type `MyCartSetLineItemCustomTypeAction` to be optional -- changed property `lineItemId` of type `MyCartSetLineItemDistributionChannelAction` to be optional -- changed property `lineItemId` of type `MyCartSetLineItemShippingDetailsAction` to be optional -- changed property `lineItemId` of type `MyCartSetLineItemSupplyChannelAction` to be optional -- changed property `lineItemId` of type `MyShoppingListChangeLineItemQuantityAction` to be optional -- changed property `lineItemId` of type `StagedOrderChangeLineItemQuantityAction` to be optional -- changed property `lineItemId` of type `StagedOrderRemoveLineItemAction` to be optional -- changed property `parcelId` of type `StagedOrderRemoveParcelFromDeliveryAction` to be optional -- changed property `lineItemId` of type `StagedOrderSetLineItemCustomFieldAction` to be optional -- changed property `lineItemId` of type `StagedOrderSetLineItemCustomTypeAction` to be optional -- changed property `lineItemId` of type `StagedOrderSetLineItemDistributionChannelAction` to be optional -- changed property `lineItemId` of type `StagedOrderSetLineItemPriceAction` to be optional -- changed property `lineItemId` of type `StagedOrderSetLineItemShippingDetailsAction` to be optional -- changed property `lineItemId` of type `StagedOrderSetLineItemTaxAmountAction` to be optional -- changed property `lineItemId` of type `StagedOrderSetLineItemTaxRateAction` to be optional -- changed property `lineItemId` of type `StagedOrderSetLineItemTotalPriceAction` to be optional -- changed property `parcelId` of type `StagedOrderSetParcelCustomFieldAction` to be optional -- changed property `parcelId` of type `StagedOrderSetParcelCustomTypeAction` to be optional -- changed property `parcelId` of type `StagedOrderSetParcelItemsAction` to be optional -- changed property `parcelId` of type `StagedOrderSetParcelMeasurementsAction` to be optional -- changed property `parcelId` of type `StagedOrderSetParcelTrackingDataAction` to be optional -- changed property `parcelId` of type `OrderRemoveParcelFromDeliveryAction` to be optional -- changed property `lineItemId` of type `OrderSetLineItemCustomFieldAction` to be optional -- changed property `lineItemId` of type `OrderSetLineItemCustomTypeAction` to be optional -- changed property `lineItemId` of type `OrderSetLineItemShippingDetailsAction` to be optional -- changed property `parcelId` of type `OrderSetParcelCustomFieldAction` to be optional -- changed property `parcelId` of type `OrderSetParcelCustomTypeAction` to be optional -- changed property `parcelId` of type `OrderSetParcelItemsAction` to be optional -- changed property `parcelId` of type `OrderSetParcelMeasurementsAction` to be optional -- changed property `parcelId` of type `OrderSetParcelTrackingDataAction` to be optional -
- - -
-Deprecated Property(s) - -- property `MyCartChangeLineItemQuantityAction::externalPrice` is removed -- property `MyCartChangeLineItemQuantityAction::externalTotalPrice` is removed -
- - -
-Deprecated Type(s) - -- type `ProductVariantSelectionExclusion` is removed -- type `ProductVariantSelectionInclusion` is removed -
- - -
-Removed Type(s) - -- :warning: removed type `MyCartSetDirectDiscountsAction` -
- - -
-Added Type(s) +Added Resource(s) -- added type `StandalonePriceTierAddedMessage` -- added type `StandalonePriceTierRemovedMessage` -- added type `StandalonePriceTiersSetMessage` -- added type `StandalonePriceValidFromAndUntilSetMessage` -- added type `StandalonePriceValidFromSetMessage` -- added type `StandalonePriceValidUntilSetMessage` -- added type `StandalonePriceTierAddedMessagePayload` -- added type `StandalonePriceTierRemovedMessagePayload` -- added type `StandalonePriceTiersSetMessagePayload` -- added type `StandalonePriceValidFromAndUntilSetMessagePayload` -- added type `StandalonePriceValidFromSetMessagePayload` -- added type `StandalonePriceValidUntilSetMessagePayload` -- added type `StandalonePriceAddPriceTierAction` -- added type `StandalonePriceRemovePriceTierAction` -- added type `StandalonePriceSetPriceTiersAction` -- added type `StandalonePriceSetValidFromAction` -- added type `StandalonePriceSetValidFromAndUntilAction` -- added type `StandalonePriceSetValidUntilAction` -- added type `ConfluentCloudDestination` +- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts` +- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}` +- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}`
-
-Added Enum(s) - -- added enum `associate-role` to type `CustomFieldReferenceValue` -- added enum `business-unit` to type `CustomFieldReferenceValue` -
- -**Import changes** - -
-Added Enum(s) - -- added enum `associate-role` to type `CustomFieldReferenceValue` -- added enum `business-unit` to type `CustomFieldReferenceValue` -
- -**History changes** -
Added Property(s) -- added property `variantSelection` to type `AddProductChange` -
- - -
-Changed Property(s) - -- :warning: changed property `resource` of type `Record` from type `Reference` to `ResourceIdentifier` -
- - -
-Added QueryParameter(s) - -- added query parameter `resourceKey` to method `get /{projectKey}` -- added query parameter `resourceKey` to method `get /{projectKey}/{resourceType}` -
- - -
-Removed QueryParameter(s) - -- :warning: removed query parameter `resourceId` from method `get /{projectKey}/{resourceType}` +- added property `stores` to type `CartDiscount` +- added property `stores` to type `CartDiscountDraft`
Added Type(s) -- added type `AddAssociateChange` -- added type `AddProductSelectionChange` -- added type `Associate` -- added type `AssociateRoleAssignment` -- added type `AssociateRoleInheritanceMode` -- added type `BusinessUnitAssociateMode` -- added type `BusinessUnitLabel` -- added type `BusinessUnitStatus` -- added type `BusinessUnitStoreMode` -- added type `ChangeAssociateChange` -- added type `ChangeAssociateModeChange` -- added type `ChangeParentUnitChange` -- added type `ChangeProductSelectionActiveChange` -- added type `ChangeStatusChange` -- added type `ProductVariantSelection` -- added type `ProductVariantSelectionTypeEnum` -- added type `RemoveAssociateChange` -- added type `RemoveProductSelectionChange` -- added type `RequestQuoteRenegotiationChange` -- added type `ResourceIdentifier` -- added type `SetAddressCustomFieldChange` -- added type `SetAddressCustomTypeChange` -- added type `SetContactEmailChange` -- added type `SetStoreModeChange` -- added type `SetVariantSelectionChange` +- added type `CartDiscountAddStoreAction` +- added type `CartDiscountRemoveStoreAction` +- added type `CartDiscountSetStoresAction` +- added type `MaxCartDiscountsReachedError` +- added type `MaxStoreReferencesReachedError` +- added type `StoreCartDiscountsLimitReachedError` +- added type `GraphQLMaxCartDiscountsReachedError` +- added type `GraphQLMaxStoreReferencesReachedError` +- added type `GraphQLStoreCartDiscountsLimitReachedError`
-Added Enum(s) +Added Method(s) -- added enum `business-unit` to type `ChangeHistoryResourceType` -- added enum `addAssociate` to type `UpdateType` -- added enum `addCustomLineItem` to type `UpdateType` -- added enum `addDiscountCode` to type `UpdateType` -- added enum `addProduct` to type `UpdateType` -- added enum `addProductSelection` to type `UpdateType` -- added enum `addProperty` to type `UpdateType` -- added enum `changeAmountAuthorized` to type `UpdateType` -- added enum `changeAssociate` to type `UpdateType` -- added enum `changeAssociateMode` to type `UpdateType` -- added enum `changeCustomLineItemQuantity` to type `UpdateType` -- added enum `changeLineItemName` to type `UpdateType` -- added enum `changeParentUnit` to type `UpdateType` -- added enum `changeProductSelectionActive` to type `UpdateType` -- added enum `changeQuoteRequestState` to type `UpdateType` -- added enum `changeQuoteState` to type `UpdateType` -- added enum `changeStagedQuoteState` to type `UpdateType` -- added enum `changeStatus` to type `UpdateType` -- added enum `changeTaxCalculationMode` to type `UpdateType` -- added enum `changeTaxMode` to type `UpdateType` -- added enum `changeTaxRoundingMode` to type `UpdateType` -- added enum `moveImageToPosition` to type `UpdateType` -- added enum `removeAssociate` to type `UpdateType` -- added enum `removeCustomLineItem` to type `UpdateType` -- added enum `removeDiscountCode` to type `UpdateType` -- added enum `removeProduct` to type `UpdateType` -- added enum `removeProductSelection` to type `UpdateType` -- added enum `removeProperty` to type `UpdateType` -- added enum `requestQuoteRenegotiation` to type `UpdateType` -- added enum `setAddressCustomField` to type `UpdateType` -- added enum `setAddressCustomType` to type `UpdateType` -- added enum `setApplicationVersion` to type `UpdateType` -- added enum `setAuthenticationMode` to type `UpdateType` -- added enum `setContactEmail` to type `UpdateType` -- added enum `setCountries` to type `UpdateType` -- added enum `setCountry` to type `UpdateType` -- added enum `setCustomLineItemMoney` to type `UpdateType` -- added enum `setCustomLineItemTaxAmount` to type `UpdateType` -- added enum `setCustomLineItemTaxCategory` to type `UpdateType` -- added enum `setCustomLineItemTaxRate` to type `UpdateType` -- added enum `setCustomLineItemTaxedPrice` to type `UpdateType` -- added enum `setCustomLineItemTotalPrice` to type `UpdateType` -- added enum `setCustomShippingMethod` to type `UpdateType` -- added enum `setIsValid` to type `UpdateType` -- added enum `setLineItemDeactivatedAt` to type `UpdateType` -- added enum `setLineItemDiscountedPrice` to type `UpdateType` -- added enum `setLineItemDiscountedPricePerQuantity` to type `UpdateType` -- added enum `setLineItemDistributionChannel` to type `UpdateType` -- added enum `setLineItemPrice` to type `UpdateType` -- added enum `setLineItemProductKey` to type `UpdateType` -- added enum `setLineItemProductSlug` to type `UpdateType` -- added enum `setLineItemTaxAmount` to type `UpdateType` -- added enum `setLineItemTaxRate` to type `UpdateType` -- added enum `setLineItemTaxedPrice` to type `UpdateType` -- added enum `setLineItemTotalPrice` to type `UpdateType` -- added enum `setOrderTaxedPrice` to type `UpdateType` -- added enum `setOrderTotalPrice` to type `UpdateType` -- added enum `setOrderTotalTax` to type `UpdateType` -- added enum `setPrices` to type `UpdateType` -- added enum `setProductCount` to type `UpdateType` -- added enum `setProductSelections` to type `UpdateType` -- added enum `setProperty` to type `UpdateType` -- added enum `setPurchaseOrderNumber` to type `UpdateType` -- added enum `setReservations` to type `UpdateType` -- added enum `setSellerComment` to type `UpdateType` -- added enum `setShippingInfoPrice` to type `UpdateType` -- added enum `setShippingInfoTaxedPrice` to type `UpdateType` -- added enum `setShippingMethod` to type `UpdateType` -- added enum `setShippingMethodTaxAmount` to type `UpdateType` -- added enum `setShippingMethodTaxRate` to type `UpdateType` -- added enum `setShippingRate` to type `UpdateType` -- added enum `setShippingRateInput` to type `UpdateType` -- added enum `setStoreMode` to type `UpdateType` -- added enum `setSupplyChannels` to type `UpdateType` -- added enum `setValidTo` to type `UpdateType` -- added enum `setValue` to type `UpdateType` -- added enum `setVariantSelection` to type `UpdateType` -- added enum `DeclinedForRenegotiation` to type `QuoteState` -- added enum `associate-role` to type `ReferenceTypeId` -- added enum `business-unit` to type `ReferenceTypeId` +- added method `$apiRoot->withProjectKey()->inStoreKeyWithStoreKeyValue()->cartDiscounts()->get()` +- added method `$apiRoot->withProjectKey()->inStoreKeyWithStoreKeyValue()->cartDiscounts()->post()` +- added method `$apiRoot->withProjectKey()->inStoreKeyWithStoreKeyValue()->cartDiscounts()->withKey()->get()` +- added method `$apiRoot->withProjectKey()->inStoreKeyWithStoreKeyValue()->cartDiscounts()->withKey()->post()` +- added method `$apiRoot->withProjectKey()->inStoreKeyWithStoreKeyValue()->cartDiscounts()->withKey()->delete()` +- added method `$apiRoot->withProjectKey()->inStoreKeyWithStoreKeyValue()->cartDiscounts()->withId()->get()` +- added method `$apiRoot->withProjectKey()->inStoreKeyWithStoreKeyValue()->cartDiscounts()->withId()->post()` +- added method `$apiRoot->withProjectKey()->inStoreKeyWithStoreKeyValue()->cartDiscounts()->withId()->delete()`
diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDTest.php new file mode 100644 index 00000000000..d8bba5fd4b1 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDTest.php @@ -0,0 +1,552 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->cartDiscounts() + ->withId('test_ID') + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/test_ID?expand=expand', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts() + ->withId("test_ID") + ->get(); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/test_ID', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->cartDiscounts() + ->withId('test_ID') + ->post(null) + ->withExpand('expand'); + }, + 'post', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/test_ID?expand=expand', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts() + ->withId("test_ID") + ->post(null); + }, + 'post', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/test_ID', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_withVersion' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->cartDiscounts() + ->withId('test_ID') + ->delete() + ->withVersion('version'); + }, + 'delete', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/test_ID?version=version', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->cartDiscounts() + ->withId('test_ID') + ->delete() + ->withExpand('expand'); + }, + 'delete', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/test_ID?expand=expand', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts() + ->withId("test_ID") + ->delete(); + }, + 'delete', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/test_ID', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); + } + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + } + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); + }, + 200 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); + }, + 400 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); + }, + 401 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); + }, + 403 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); + }, + 404 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); + }, + 500 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); + }, + 502 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); + }, + 503 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); + }, + 599 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + }, + 200 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + }, + 409 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + }, + 400 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + }, + 401 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + }, + 403 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + }, + 404 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + }, + 500 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + }, + 502 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + }, + 503 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); + }, + 599 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + }, + 200 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + }, + 409 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + }, + 400 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + }, + 401 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + }, + 403 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + }, + 404 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + }, + 500 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + }, + 502 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + }, + 503 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyTest.php new file mode 100644 index 00000000000..f74becf2604 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyTest.php @@ -0,0 +1,552 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->cartDiscounts() + ->withKey('test_key') + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/key=test_key?expand=expand', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts() + ->withKey("test_key") + ->get(); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/key=test_key', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->cartDiscounts() + ->withKey('test_key') + ->post(null) + ->withExpand('expand'); + }, + 'post', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/key=test_key?expand=expand', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts() + ->withKey("test_key") + ->post(null); + }, + 'post', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/key=test_key', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_withVersion' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->cartDiscounts() + ->withKey('test_key') + ->delete() + ->withVersion('version'); + }, + 'delete', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/key=test_key?version=version', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->cartDiscounts() + ->withKey('test_key') + ->delete() + ->withExpand('expand'); + }, + 'delete', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/key=test_key?expand=expand', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts() + ->withKey("test_key") + ->delete(); + }, + 'delete', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts/key=test_key', + ] + ]; + } + + public function getResources() + { + return [ + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); + } + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + } + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); + }, + 200 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); + }, + 400 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); + }, + 401 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); + }, + 403 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); + }, + 404 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); + }, + 500 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); + }, + 502 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); + }, + 503 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); + }, + 599 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + }, + 200 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + }, + 409 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + }, + 400 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + }, + 401 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + }, + 403 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + }, + 404 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + }, + 500 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + }, + 502 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + }, + 503 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); + }, + 599 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + }, + 200 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_409' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + }, + 409 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + }, + 400 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + }, + 401 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + }, + 403 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + }, + 404 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + }, + 500 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + }, + 502 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + }, + 503 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsTest.php new file mode 100644 index 00000000000..b2b0f09b770 --- /dev/null +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsTest.php @@ -0,0 +1,229 @@ +assertSame(strtolower($method), strtolower($request->getMethod())); + $this->assertSame($relativeUri, (string) $request->getUri()); + if (!is_null($body)) { + $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); + } else { + $this->assertSame("", (string) $request->getBody()); + } + } + + /** + * @dataProvider getResources() + */ + public function testResources(callable $builderFunction, string $class, array $expectedArgs) + { + $builder = new ApiRequestBuilder(); + $resource = $builderFunction($builder); + $this->assertInstanceOf($class, $resource); + $this->assertEquals($expectedArgs, $resource->getArgs()); + } + + /** + * @dataProvider getRequestBuilderResponses() + */ + public function testMapFromResponse(callable $builderFunction, $statusCode) + { + $builder = new ApiRequestBuilder(); + $request = $builderFunction($builder); + $this->assertInstanceOf(ApiRequest::class, $request); + + $response = new Response($statusCode, [], "{}"); + $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteClientException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); + + $this->expectException(ApiClientException::class); + $request->execute(); + } + + /** + * @dataProvider getRequestBuilders() + */ + public function testExecuteServerException(callable $builderFunction) + { + $client = $this->createMock(ClientInterface::class); + + $builder = new ApiRequestBuilder($client); + $request = $builderFunction($builder); + $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); + + $this->expectException(ApiServerException::class); + $request->execute(); + } + + public function getRequests() + { + return [ + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts() + ->get(); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts', + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts() + ->post(null); + }, + 'post', + 'test_projectKey/in-store/key=test_storeKey/cart-discounts', + ] + ]; + } + + public function getResources() + { + return [ + 'ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKey' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKey { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts() + ->withKey("test_key"); + }, + ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKey::class, + ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey', 'key' => 'test_key'], + '/{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}' + ], + 'ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByID' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByID { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts() + ->withId("test_ID"); + }, + ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByID::class, + ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey', 'ID' => 'test_ID'], + '/{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}' + ] + ]; + } + + public function getRequestBuilders() + { + return [ + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->get(); + } + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsPost' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->post(null); + } + ] + ]; + } + + public function getRequestBuilderResponses() + { + return [ + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsGet_200' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->get(); + }, + 200 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsGet_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->get(); + }, + 599 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsPost_201' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->post(null); + }, + 201 + ], + 'ByProjectKeyInStoreKeyByStoreKeyCartDiscountsPost_599' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->post(null); + }, + 599 + ] + ]; + } +} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyTest.php index ca68fdf027f..3b3774f2cd1 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyTest.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Test\Client\Resource; use Commercetools\Api\Client\ApiRequestBuilder; +use Commercetools\Api\Client\Resource\ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts; use Commercetools\Api\Client\Resource\ResourceByProjectKeyInStoreKeyByStoreKeyCarts; use Commercetools\Api\Client\Resource\ResourceByProjectKeyInStoreKeyByStoreKeyCustomers; use Commercetools\Api\Client\Resource\ResourceByProjectKeyInStoreKeyByStoreKeyLogin; @@ -158,6 +159,17 @@ function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyP ResourceByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignments::class, ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], '/{projectKey}/in-store/key={storeKey}/product-selection-assignments' + ], + 'ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts' => [ + function (ApiRequestBuilder $builder): ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts { + return $builder + ->withProjectKey("test_projectKey") + ->inStoreKeyWithStoreKeyValue("test_storeKey") + ->cartDiscounts(); + }, + ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts::class, + ['projectKey' => 'test_projectKey', 'storeKey' => 'test_storeKey'], + '/{projectKey}/in-store/key={storeKey}/cart-discounts' ] ]; } diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 6753758b8f5..7e537092624 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -2189,7 +2189,88 @@ $request = $builder ->customers() ->post(null); ``` -## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->get()` +## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->get()` + +null + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->get(); +``` +## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->post(null)` + +When using the endpoint, the Store specified in the path and the Stores specified in the payload's `stores` field are added to the CartDiscount. + + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->post(null); +``` +## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withId("ID")->get()` + + + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->get(); +``` +## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withId("ID")->post(null)` + +To update a CartDiscount, you must have permissions for all Stores the CartDiscount is associated with, except when [removing a Store](ctp:api:type:CartDiscountRemoveStoreAction). + + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->post(null); +``` +## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withId("ID")->delete()` + +To delete a CartDiscount, specify the `manage_cart_discounts:{projectKey}:{storeKey}` scope for all Stores associated with the CartDiscount. + + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withId("ID") + ->delete(); +``` +## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withKey("key")->get()` null @@ -2197,6 +2278,56 @@ null ```php use Commercetools\Api\Client\ApiRequestBuilder; +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->get(); +``` +## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withKey("key")->post(null)` + +To update a CartDiscount, you must have permissions for all Stores the CartDiscount is associated with, except when [removing a Store](ctp:api:type:CartDiscountRemoveStoreAction). + + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->post(null); +``` +## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->cartDiscounts()->withKey("key")->delete()` + +To delete a CartDiscount, specify the `manage_cart_discounts:{projectKey}:{storeKey}` scope for all Stores associated with the CartDiscount. + + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + +$builder = new ApiRequestBuilder(); +$request = $builder + ->withProjectKey("projectKey") + ->inStoreKeyWithStoreKeyValue("storeKey") + ->cartDiscounts() + ->withKey("key") + ->delete(); +``` +## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->get()` + +Queries carts in a specific [Store](ctp:api:type:Store). + +### Example +```php +use Commercetools\Api\Client\ApiRequestBuilder; + $builder = new ApiRequestBuilder(); $request = $builder ->withProjectKey("projectKey") @@ -2206,9 +2337,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->post(null)` -The `store` field in the created [Cart](ctp:api:type:Cart) is set to the Store specified by the `storeKey` path parameter. - -Specific Error Codes: [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +Creates a [Cart](ctp:api:type:Cart) in the [Store](ctp:api:type:Store) specified by `storeKey`. +When using this endpoint the Cart's `store` field is always set to the [Store](ctp:api:type:Store) specified in the path parameter. +If the referenced [ShippingMethod](ctp:api:type:ShippingMethod) in the [CartDraft](ctp:api:type:CartDraft) has a predicate that does not match, an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned. ### Example @@ -2243,7 +2374,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withId("ID")->post(null)` -Updates a [Cart](ctp:api:type:Cart) in the Store specified by `storeKey`. +Updates a [Cart](ctp:api:type:Cart) in the [Store](ctp:api:type:Store) specified by `storeKey`. If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. @@ -2388,11 +2519,11 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->post(null)` -When using this endpoint, if omitted, the Customer `stores` field is set to the Store specified in the path parameter. +When using this endpoint, if omitted, the Customer `stores` field is set to the [Store](ctp:api:type:Store) specified in the path parameter. If the `anonymousCart` field is set on the [CustomerDraft](ctp:api:type:CustomerDraft), then the newly created Customer will be assigned to that [Cart](ctp:api:type:Cart). Similarly, if the `anonymousId` field is set, the Customer will be set on all [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [ShoppingLists](ctp:api:type:ShoppingList) and [Payments](ctp:api:type:Payment) with the same `anonymousId`. -If a Cart with a `store` field specified, the `store` field must reference the same Store specified in the `{storeKey}` path parameter. +If a Cart with a `store` field specified, the `store` field must reference the same [Store](ctp:api:type:Store) specified in the `{storeKey}` path parameter. Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. @@ -2426,7 +2557,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withId("ID")->post(null)` -If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -2465,7 +2596,7 @@ $request = $builder The customer verifies the email using the token value. Verifying the email of the Customer produces the [CustomerEmailVerified](ctp:api:type:CustomerEmailVerifiedMessage) Message. -If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -2499,7 +2630,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withEmailToken("emailToken")->get()` -If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -2516,7 +2647,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->customers()->withKey("key")->get()` -If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -2552,7 +2683,7 @@ $request = $builder Deleting a Customer produces the [CustomerDeleted](ctp:api:type:CustomerDeletedMessage) Message. -If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -2588,7 +2719,7 @@ $request = $builder Resetting the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. -If the Customer exists in the Project but the `stores` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -2639,9 +2770,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->login()->post(null)` -Authenticates a Customer associated with a Store. For more information, see [Global versus Store-specific Customers](/../api/customers-overview#global-versus-store-specific-customers). +Authenticates a Customer associated with a [Store](ctp:api:type:Store). For more information, see [Global versus Store-specific Customers](/../api/customers-overview#global-versus-store-specific-customers). -If the Customer exists in the Project but the `stores` field references a different Store, this method returns an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error. +If the Customer exists in the Project but the `stores` field references a different [Store](ctp:api:type:Store), this method returns an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error. ### Example @@ -2953,7 +3084,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->post(null)` -When using this endpoint, the `store` field of a ShoppingList is always set to the Store specified in the path parameter. +When using this endpoint, the `store` field of a ShoppingList is always set to the [Store](ctp:api:type:Store) specified in the path parameter. ### Example @@ -2970,7 +3101,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withId("ID")->get()` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. @@ -2989,7 +3120,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withId("ID")->post(null)` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. @@ -3008,7 +3139,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withId("ID")->delete()` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. @@ -3027,7 +3158,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withKey("key")->get()` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, the [ResourceNotFound](/errors#404-not-found-1) error is returned. +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. ### Example @@ -3045,7 +3176,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withKey("key")->post(null)` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. @@ -3064,7 +3195,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->shoppingLists()->withKey("key")->delete()` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. @@ -3083,7 +3214,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->signup()->post(null)` -If omitted in the request body, the [Customer](ctp:api:type:Customer) `stores` field is set to the Store specified in the path parameter. +If omitted in the request body, the [Customer](ctp:api:type:Customer) `stores` field is set to the [Store](ctp:api:type:Store) specified in the path parameter. Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. @@ -3102,7 +3233,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->get()` -Queries orders in a specific Store. +Queries orders in a specific [Store](ctp:api:type:Store). ### Example ```php @@ -3117,8 +3248,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->post(null)` -Creates an order from a Cart from a specific Store. -When using this endpoint the orders's store field is always set to the store specified in the path parameter. +Creates an order from a Cart from a specific [Store](ctp:api:type:Store). +When using this endpoint the orders's `store` field is always set to the [Store](ctp:api:type:Store) specified in the path parameter. The cart must have a shipping address set before creating an order. When using the Platform TaxMode, the shipping address is used for tax calculation. @@ -3136,8 +3267,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withId("ID")->get()` -Returns an order by its ID from a specific Store. -If the order exists in the project but does not have the store field, +Returns an [Order](ctp:api:type:Order) by its ID from a specific [Store](ctp:api:type:Store). +If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. @@ -3155,8 +3286,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withId("ID")->post(null)` -Updates an order in the store specified by {storeKey}. -If the order exists in the project but does not have the store field, +Updates an [Order](ctp:api:type:Order) in the [Store](ctp:api:type:Store) specified by {storeKey}. +If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. @@ -3190,10 +3321,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withOrderNumber("orderNumber")->get()` -Returns an order by its order number from a specific Store. +Returns an order by its order number from a specific [Store](ctp:api:type:Store). -If the order exists in the project but does not have the store field, -or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +If the Order exists in the Project but does not have the `store` field, +or the `store` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. In case the orderNumber does not match the regular expression [a-zA-Z0-9_-]+, it should be provided in URL-encoded format. @@ -3212,8 +3343,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withOrderNumber("orderNumber")->post(null)` -Updates an order in the store specified by {storeKey}. -If the order exists in the project but does not have the store field, +Updates an order in the [Store](ctp:api:type:Store) specified by {storeKey}. + +If the [Order](ctp:api:type:Order) exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. In case the orderNumber does not match the regular expression [a-zA-Z0-9_-]+, it should be provided in URL-encoded format. @@ -3293,7 +3425,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->productSelectionAssignments()->get()` -Queries Product Selection assignments over all Product Selections that are active in a specific Store. +Queries Product Selection assignments in a specific [Store](ctp:api:type:Store). The response will include duplicate Products whenever more than one active Product Selection of the Store includes a Product. To make clear through which Product Selection a Product is available in the Store @@ -3314,7 +3446,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shippingMethods()->matchingCart()->get()` -Retrieves all the ShippingMethods that can ship to the shipping address of the given Cart in a given Store. +Retrieves all the ShippingMethods that can ship to the shipping address of the given Cart in a given [Store](ctp:api:type:Store). Each ShippingMethod contains exactly one ShippingRate with the flag `isMatching` set to `true`. This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction). @@ -3348,7 +3480,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->post(null)` -When using this endpoint, the `store` field of a ShoppingList is always set to the Store specified in the path parameter. +When using this endpoint, the `store` field of a ShoppingList is always set to the [Store](ctp:api:type:Store) specified in the path parameter. ### Example @@ -3364,7 +3496,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withId("ID")->get()` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. @@ -3382,7 +3514,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withId("ID")->post(null)` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. @@ -3400,7 +3532,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withId("ID")->delete()` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. @@ -3418,7 +3550,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withKey("key")->get()` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. @@ -3436,7 +3568,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withKey("key")->post(null)` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. @@ -3454,7 +3586,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->shoppingLists()->withKey("key")->delete()` -If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different Store, +If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete.php new file mode 100644 index 00000000000..849d50445a4 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete.php @@ -0,0 +1,170 @@ + + * @template-implements Conflicting + * @template-implements Expandable + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $storeKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{storeKey}', '{ID}'], [$projectKey, $storeKey, $ID], '{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}'); + parent::__construct($client, 'DELETE', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return CartDiscount|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = CartDiscountModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|CartDiscount|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $version + */ + public function withVersion($version): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete + { + return $this->withQueryParam('version', $version); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet.php new file mode 100644 index 00000000000..a7254d9e1d0 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet.php @@ -0,0 +1,155 @@ + + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $storeKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{storeKey}', '{ID}'], [$projectKey, $storeKey, $ID], '{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return CartDiscount|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = CartDiscountModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|CartDiscount|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost.php new file mode 100644 index 00000000000..e1b3c4c9448 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost.php @@ -0,0 +1,160 @@ + + * @template-implements Expandable + * @template-implements Deprecatable200 + * @template-implements Errorable + */ +class ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $storeKey, string $ID, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{storeKey}', '{ID}'], [$projectKey, $storeKey, $ID], '{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return CartDiscount|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = CartDiscountModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|CartDiscount|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsGet.php new file mode 100644 index 00000000000..44d7435fce0 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsGet.php @@ -0,0 +1,118 @@ + $headers + */ + public function __construct(string $projectKey, string $storeKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{storeKey}'], [$projectKey, $storeKey], '{projectKey}/in-store/key={storeKey}/cart-discounts'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return CartDiscount|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = CartDiscountModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|CartDiscount|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete.php new file mode 100644 index 00000000000..31ec4a48b01 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete.php @@ -0,0 +1,170 @@ + + * @template-implements Conflicting + * @template-implements Expandable + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $storeKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{storeKey}', '{key}'], [$projectKey, $storeKey, $key], '{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}'); + parent::__construct($client, 'DELETE', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return CartDiscount|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = CartDiscountModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|CartDiscount|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $version + */ + public function withVersion($version): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete + { + return $this->withQueryParam('version', $version); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet.php new file mode 100644 index 00000000000..42640ee8311 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet.php @@ -0,0 +1,155 @@ + + * @template-implements Errorable + * @template-implements Deprecatable200 + */ +class ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $storeKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{storeKey}', '{key}'], [$projectKey, $storeKey, $key], '{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}'); + parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return CartDiscount|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = CartDiscountModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|CartDiscount|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost.php new file mode 100644 index 00000000000..6cd1f5bf068 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost.php @@ -0,0 +1,160 @@ + + * @template-implements Expandable + * @template-implements Deprecatable200 + * @template-implements Errorable + */ +class ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +{ + /** + * @param ?object|array|string $body + * @psalm-param array $headers + */ + public function __construct(string $projectKey, string $storeKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{storeKey}', '{key}'], [$projectKey, $storeKey, $key], '{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return CartDiscount|ErrorResponse|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '200': + $resultType = CartDiscountModel::class; + + break; + case '409': + $resultType = ErrorResponseModel::class; + + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|CartDiscount|ErrorResponse|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } + + /** + * + * @psalm-param scalar|scalar[] $expand + */ + public function withExpand($expand): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost + { + return $this->withQueryParam('expand', $expand); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsPost.php new file mode 100644 index 00000000000..d5916723309 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyCartDiscountsPost.php @@ -0,0 +1,118 @@ + $headers + */ + public function __construct(string $projectKey, string $storeKey, $body = null, array $headers = [], ClientInterface $client = null) + { + $uri = str_replace(['{projectKey}', '{storeKey}'], [$projectKey, $storeKey], '{projectKey}/in-store/key={storeKey}/cart-discounts'); + parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * @return CartDiscount|JsonObject|T|null + */ + public function mapFromResponse(?ResponseInterface $response, string $resultType = null) + { + if (is_null($response)) { + return null; + } + if (is_null($resultType)) { + switch ($response->getStatusCode()) { + case '201': + $resultType = CartDiscountModel::class; + + break; + default: + $resultType = JsonObjectModel::class; + + break; + } + } + + return $resultType::of($this->responseData($response)); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return null|T|CartDiscount|JsonObject + */ + public function execute(array $options = [], string $resultType = null) + { + try { + $response = $this->send($options); + } catch (ServerException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } catch (ClientException $e) { + $response = $e->getResponse(); + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + throw $e; + } + + return $this->mapFromResponse($response, $resultType); + } + + /** + * @template T of JsonObject + * @psalm-param ?class-string $resultType + * + * @return PromiseInterface + */ + public function executeAsync(array $options = [], string $resultType = null) + { + return $this->sendAsync($options)->then( + function (ResponseInterface $response) use ($resultType) { + return $this->mapFromResponse($response, $resultType); + }, + function (RequestException $e) use ($resultType) { + $response = $e->getResponse(); + if ($e instanceof ServerException) { + $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + if ($e instanceof ClientException) { + $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); + } + throw $e; + } + ); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKey.php index 852331095a2..f5a461475c5 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKey.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKey.php @@ -97,4 +97,12 @@ public function productSelectionAssignments(): ResourceByProjectKeyInStoreKeyByS return new ResourceByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignments($args, $this->getClient()); } + /** + */ + public function cartDiscounts(): ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts + { + $args = $this->getArgs(); + + return new ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts($args, $this->getClient()); + } } diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts.php new file mode 100644 index 00000000000..7f5d7d87f0d --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscounts.php @@ -0,0 +1,72 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/in-store/key={storeKey}/cart-discounts', $args, $client); + } + + /** + */ + public function withKey(string $key = null): ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKey + { + $args = $this->getArgs(); + if (!is_null($key)) { + $args['key'] = $key; + } + + return new ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKey($args, $this->getClient()); + } + /** + */ + public function withId(string $ID = null): ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByID + { + $args = $this->getArgs(); + if (!is_null($ID)) { + $args['ID'] = $ID; + } + + return new ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByID($args, $this->getClient()); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsGet + { + $args = $this->getArgs(); + + return new ByProjectKeyInStoreKeyByStoreKeyCartDiscountsGet($args['projectKey'], $args['storeKey'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?CartDiscountDraft $body + * @psalm-param array $headers + */ + public function post(?CartDiscountDraft $body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsPost + { + $args = $this->getArgs(); + + return new ByProjectKeyInStoreKeyByStoreKeyCartDiscountsPost($args['projectKey'], $args['storeKey'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByID.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByID.php new file mode 100644 index 00000000000..5f4ca5037c7 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsByID.php @@ -0,0 +1,59 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}', $args, $client); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet + { + $args = $this->getArgs(); + + return new ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDGet($args['projectKey'], $args['storeKey'], $args['ID'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?CartDiscountUpdate $body + * @psalm-param array $headers + */ + public function post(?CartDiscountUpdate $body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost + { + $args = $this->getArgs(); + + return new ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDPost($args['projectKey'], $args['storeKey'], $args['ID'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function delete($body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete + { + $args = $this->getArgs(); + + return new ByProjectKeyInStoreKeyByStoreKeyCartDiscountsByIDDelete($args['projectKey'], $args['storeKey'], $args['ID'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKey.php new file mode 100644 index 00000000000..c2d180f0465 --- /dev/null +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKey.php @@ -0,0 +1,59 @@ + $args + */ + public function __construct(array $args = [], ClientInterface $client = null) + { + parent::__construct('/{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}', $args, $client); + } + + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function get($body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet + { + $args = $this->getArgs(); + + return new ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyGet($args['projectKey'], $args['storeKey'], $args['key'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?CartDiscountUpdate $body + * @psalm-param array $headers + */ + public function post(?CartDiscountUpdate $body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost + { + $args = $this->getArgs(); + + return new ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyPost($args['projectKey'], $args['storeKey'], $args['key'], $body, $headers, $this->getClient()); + } + /** + * @psalm-param ?object|array|string $body + * @psalm-param array $headers + */ + public function delete($body = null, array $headers = []): ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete + { + $args = $this->getArgs(); + + return new ByProjectKeyInStoreKeyByStoreKeyCartDiscountsKeyByKeyDelete($args['projectKey'], $args['storeKey'], $args['key'], $body, $headers, $this->getClient()); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php index d1075a09630..60fa3bb439c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemAction.php @@ -19,6 +19,7 @@ interface CartAddCustomLineItemAction extends CartUpdateAction { public const FIELD_MONEY = 'money'; public const FIELD_NAME = 'name'; + public const FIELD_KEY = 'key'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_SLUG = 'slug'; public const FIELD_TAX_CATEGORY = 'taxCategory'; @@ -44,6 +45,14 @@ public function getMoney(); */ public function getName(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Number of Custom Line Items to add to the Cart.

* @@ -116,6 +125,11 @@ public function setMoney(?Money $money): void; */ public function setName(?LocalizedString $name): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php index b397ff6797d..023bcc6dbcd 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionBuilder.php @@ -40,6 +40,12 @@ final class CartAddCustomLineItemActionBuilder implements Builder */ private $name; + /** + + * @var ?string + */ + private $key; + /** * @var ?int @@ -105,6 +111,17 @@ public function getName() return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Number of Custom Line Items to add to the Cart.

* @@ -210,6 +227,17 @@ public function withName(?LocalizedString $name) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -358,6 +386,7 @@ public function build(): CartAddCustomLineItemAction return new CartAddCustomLineItemActionModel( $this->money instanceof MoneyBuilder ? $this->money->build() : $this->money, $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, + $this->key, $this->quantity, $this->slug, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, diff --git a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php index ac8b5f3ed93..06b545027f7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddCustomLineItemActionModel.php @@ -46,6 +46,12 @@ final class CartAddCustomLineItemActionModel extends JsonObjectModel implements */ protected $name; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?int @@ -95,6 +101,7 @@ final class CartAddCustomLineItemActionModel extends JsonObjectModel implements public function __construct( ?Money $money = null, ?LocalizedString $name = null, + ?string $key = null, ?int $quantity = null, ?string $slug = null, ?TaxCategoryResourceIdentifier $taxCategory = null, @@ -106,6 +113,7 @@ public function __construct( ) { $this->money = $money; $this->name = $name; + $this->key = $key; $this->quantity = $quantity; $this->slug = $slug; $this->taxCategory = $taxCategory; @@ -177,6 +185,26 @@ public function getName() return $this->name; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Number of Custom Line Items to add to the Cart.

* @@ -344,6 +372,14 @@ public function setName(?LocalizedString $name): void $this->name = $name; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItem.php b/lib/commercetools-api/src/Models/Cart/CustomLineItem.php index 17516ae14fd..c32e101db7f 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItem.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItem.php @@ -21,6 +21,7 @@ interface CustomLineItem extends JsonObject { public const FIELD_ID = 'id'; + public const FIELD_KEY = 'key'; public const FIELD_NAME = 'name'; public const FIELD_MONEY = 'money'; public const FIELD_TAXED_PRICE = 'taxedPrice'; @@ -44,6 +45,14 @@ interface CustomLineItem extends JsonObject */ public function getId(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Name of the Custom Line Item.

* @@ -168,6 +177,11 @@ public function getPriceMode(); */ public function setId(?string $id): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?LocalizedString $name */ diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php index 30a6fcdbdad..335fbc35706 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php @@ -39,6 +39,12 @@ final class CustomLineItemBuilder implements Builder */ private $id; + /** + + * @var ?string + */ + private $key; + /** * @var null|LocalizedString|LocalizedStringBuilder @@ -134,6 +140,17 @@ public function getId() return $this->id; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Name of the Custom Line Item.

* @@ -306,6 +323,17 @@ public function withId(?string $id) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?LocalizedString $name * @return $this @@ -552,6 +580,7 @@ public function build(): CustomLineItem { return new CustomLineItemModel( $this->id, + $this->key, $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, $this->money instanceof TypedMoneyBuilder ? $this->money->build() : $this->money, $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php index ad6178ce628..1755d0538ad 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraft.php @@ -18,6 +18,7 @@ interface CustomLineItemDraft extends JsonObject { public const FIELD_NAME = 'name'; + public const FIELD_KEY = 'key'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_MONEY = 'money'; public const FIELD_SLUG = 'slug'; @@ -35,6 +36,14 @@ interface CustomLineItemDraft extends JsonObject */ public function getName(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Number of Custom Line Items to add to the Cart.

* @@ -111,6 +120,11 @@ public function getPriceMode(); */ public function setName(?LocalizedString $name): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php index 1e3f7b76b2d..b07ae9e5605 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftBuilder.php @@ -34,6 +34,12 @@ final class CustomLineItemDraftBuilder implements Builder */ private $name; + /** + + * @var ?string + */ + private $key; + /** * @var ?int @@ -93,6 +99,17 @@ public function getName() return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Number of Custom Line Items to add to the Cart.

* @@ -199,6 +216,17 @@ public function withName(?LocalizedString $name) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -357,6 +385,7 @@ public function build(): CustomLineItemDraft { return new CustomLineItemDraftModel( $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, + $this->key, $this->quantity, $this->money instanceof MoneyBuilder ? $this->money->build() : $this->money, $this->slug, diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php index d09a3059263..d0a75496d86 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemDraftModel.php @@ -33,6 +33,12 @@ final class CustomLineItemDraftModel extends JsonObjectModel implements CustomLi */ protected $name; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?int @@ -87,6 +93,7 @@ final class CustomLineItemDraftModel extends JsonObjectModel implements CustomLi */ public function __construct( ?LocalizedString $name = null, + ?string $key = null, ?int $quantity = null, ?Money $money = null, ?string $slug = null, @@ -97,6 +104,7 @@ public function __construct( ?string $priceMode = null ) { $this->name = $name; + $this->key = $key; $this->quantity = $quantity; $this->money = $money; $this->slug = $slug; @@ -128,6 +136,26 @@ public function getName() return $this->name; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Number of Custom Line Items to add to the Cart.

* @@ -309,6 +337,14 @@ public function setName(?LocalizedString $name): void $this->name = $name; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php index 3dc56fc4aa5..fb2b48b4f2b 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php @@ -38,6 +38,12 @@ final class CustomLineItemModel extends JsonObjectModel implements CustomLineIte */ protected $id; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?LocalizedString @@ -128,6 +134,7 @@ final class CustomLineItemModel extends JsonObjectModel implements CustomLineIte */ public function __construct( ?string $id = null, + ?string $key = null, ?LocalizedString $name = null, ?TypedMoney $money = null, ?TaxedItemPrice $taxedPrice = null, @@ -144,6 +151,7 @@ public function __construct( ?string $priceMode = null ) { $this->id = $id; + $this->key = $key; $this->name = $name; $this->money = $money; $this->taxedPrice = $taxedPrice; @@ -180,6 +188,26 @@ public function getId() return $this->id; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Name of the Custom Line Item.

* @@ -484,6 +512,14 @@ public function setId(?string $id): void $this->id = $id; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?LocalizedString $name */ diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php index ecebcc2ce03..b137eb51b5d 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php @@ -13,6 +13,7 @@ use Commercetools\Api\Models\Common\LastModifiedBy; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\ReferenceCollection; +use Commercetools\Api\Models\Store\StoreKeyReferenceCollection; use Commercetools\Api\Models\Type\CustomFields; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -29,6 +30,7 @@ interface CartDiscount extends BaseResource public const FIELD_CART_PREDICATE = 'cartPredicate'; public const FIELD_TARGET = 'target'; public const FIELD_SORT_ORDER = 'sortOrder'; + public const FIELD_STORES = 'stores'; public const FIELD_IS_ACTIVE = 'isActive'; public const FIELD_VALID_FROM = 'validFrom'; public const FIELD_VALID_UNTIL = 'validUntil'; @@ -144,6 +146,17 @@ public function getTarget(); */ public function getSortOrder(); + /** + *
    + *
  • If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field.
  • + *
  • If empty, the Cart Discount applies on all Carts, irrespective of a Store.
  • + *
+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores(); + /** *

Indicates if the CartDiscount is active and can be applied to the Cart.

* @@ -266,6 +279,11 @@ public function setTarget(?CartDiscountTarget $target): void; */ public function setSortOrder(?string $sortOrder): void; + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void; + /** * @param ?bool $isActive */ diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreAction.php new file mode 100644 index 00000000000..703217b1eca --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreAction.php @@ -0,0 +1,36 @@ +Store to add.

+ *

A failed update can return the following errors:

+ * + * + + * @return null|StoreResourceIdentifier + */ + public function getStore(); + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void; +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionBuilder.php new file mode 100644 index 00000000000..fd88cf5c6ca --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionBuilder.php @@ -0,0 +1,80 @@ + + */ +final class CartDiscountAddStoreActionBuilder implements Builder +{ + /** + + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder + */ + private $store; + + /** + *

Store to add.

+ *

A failed update can return the following errors:

+ * + * + + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store; + } + + /** + * @param ?StoreResourceIdentifier $store + * @return $this + */ + public function withStore(?StoreResourceIdentifier $store) + { + $this->store = $store; + + return $this; + } + + /** + * @deprecated use withStore() instead + * @return $this + */ + public function withStoreBuilder(?StoreResourceIdentifierBuilder $store) + { + $this->store = $store; + + return $this; + } + + public function build(): CartDiscountAddStoreAction + { + return new CartDiscountAddStoreActionModel( + $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store + ); + } + + public static function of(): CartDiscountAddStoreActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionCollection.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionCollection.php new file mode 100644 index 00000000000..b08317ea9e9 --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionCollection.php @@ -0,0 +1,56 @@ + + * @method CartDiscountAddStoreAction current() + * @method CartDiscountAddStoreAction end() + * @method CartDiscountAddStoreAction at($offset) + */ +class CartDiscountAddStoreActionCollection extends CartDiscountUpdateActionCollection +{ + /** + * @psalm-assert CartDiscountAddStoreAction $value + * @psalm-param CartDiscountAddStoreAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CartDiscountAddStoreActionCollection + */ + public function add($value) + { + if (!$value instanceof CartDiscountAddStoreAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CartDiscountAddStoreAction + */ + protected function mapper() + { + return function (?int $index): ?CartDiscountAddStoreAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CartDiscountAddStoreAction $data */ + $data = CartDiscountAddStoreActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionModel.php new file mode 100644 index 00000000000..e51783e0d6e --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountAddStoreActionModel.php @@ -0,0 +1,101 @@ +store = $store; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Store to add.

+ *

A failed update can return the following errors:

+ * + * + * + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreResourceIdentifierModel::of($data); + } + + return $this->store; + } + + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void + { + $this->store = $store; + } +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php index d0988021332..e0cdcdac08b 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php @@ -17,6 +17,7 @@ use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringBuilder; use Commercetools\Api\Models\Common\ReferenceCollection; +use Commercetools\Api\Models\Store\StoreKeyReferenceCollection; use Commercetools\Api\Models\Type\CustomFields; use Commercetools\Api\Models\Type\CustomFieldsBuilder; use Commercetools\Base\Builder; @@ -110,6 +111,12 @@ final class CartDiscountBuilder implements Builder */ private $sortOrder; + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + /** * @var ?bool @@ -298,6 +305,20 @@ public function getSortOrder() return $this->sortOrder; } + /** + *
    + *
  • If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field.
  • + *
  • If empty, the Cart Discount applies on all Carts, irrespective of a Store.
  • + *
+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + /** *

Indicates if the CartDiscount is active and can be applied to the Cart.

* @@ -519,6 +540,17 @@ public function withSortOrder(?string $sortOrder) return $this; } + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + /** * @param ?bool $isActive * @return $this @@ -689,6 +721,7 @@ public function build(): CartDiscount $this->cartPredicate, $this->target instanceof CartDiscountTargetBuilder ? $this->target->build() : $this->target, $this->sortOrder, + $this->stores, $this->isActive, $this->validFrom, $this->validUntil, diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveAction.php index f6323511454..49cf97ea0af 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveAction.php @@ -18,6 +18,7 @@ interface CartDiscountChangeIsActiveAction extends CartDiscountUpdateAction /** *

New value to set. * If set to true, the Discount will be applied to the Cart.

+ *

If the limit for active Cart Discounts is reached, a MaxCartDiscountsReached error is returned.

* * @return null|bool diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionBuilder.php index cc2c50d7c02..003c77cbf67 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionBuilder.php @@ -29,6 +29,7 @@ final class CartDiscountChangeIsActiveActionBuilder implements Builder /** *

New value to set. * If set to true, the Discount will be applied to the Cart.

+ *

If the limit for active Cart Discounts is reached, a MaxCartDiscountsReached error is returned.

* * @return null|bool diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionModel.php index 1dc3c3dd1c6..a9ba8dbfc64 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeIsActiveActionModel.php @@ -65,6 +65,7 @@ public function getAction() /** *

New value to set. * If set to true, the Discount will be applied to the Cart.

+ *

If the limit for active Cart Discounts is reached, a MaxCartDiscountsReached error is returned.

* * * @return null|bool diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php index bd4960464c1..3b10675fc5f 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\CartDiscount; use Commercetools\Api\Models\Common\LocalizedString; +use Commercetools\Api\Models\Store\StoreResourceIdentifierCollection; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -23,6 +24,7 @@ interface CartDiscountDraft extends JsonObject public const FIELD_CART_PREDICATE = 'cartPredicate'; public const FIELD_TARGET = 'target'; public const FIELD_SORT_ORDER = 'sortOrder'; + public const FIELD_STORES = 'stores'; public const FIELD_IS_ACTIVE = 'isActive'; public const FIELD_VALID_FROM = 'validFrom'; public const FIELD_VALID_UNTIL = 'validUntil'; @@ -90,7 +92,21 @@ public function getTarget(); public function getSortOrder(); /** - *

Only active Discounts can be applied to the Cart.

+ *
    + *
  • If defined, the Cart Discount applies on Carts having a Store matching any Store defined for this field.
  • + *
  • If not defined, the Cart Discount applies on all Carts, irrespective of a Store.
  • + *
+ *

If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.

+ *

If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.

+ * + + * @return null|StoreResourceIdentifierCollection + */ + public function getStores(); + + /** + *

Only active Discounts can be applied to the Cart. + * If the limit for active Cart Discounts is reached, a MaxCartDiscountsReached error is returned.

* * @return null|bool @@ -172,6 +188,11 @@ public function setTarget(?CartDiscountTarget $target): void; */ public function setSortOrder(?string $sortOrder): void; + /** + * @param ?StoreResourceIdentifierCollection $stores + */ + public function setStores(?StoreResourceIdentifierCollection $stores): void; + /** * @param ?bool $isActive */ diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php index 98154c23c44..427555390a3 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php @@ -10,6 +10,7 @@ use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringBuilder; +use Commercetools\Api\Models\Store\StoreResourceIdentifierCollection; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftBuilder; use Commercetools\Base\Builder; @@ -67,6 +68,12 @@ final class CartDiscountDraftBuilder implements Builder */ private $sortOrder; + /** + + * @var ?StoreResourceIdentifierCollection + */ + private $stores; + /** * @var ?bool @@ -184,7 +191,24 @@ public function getSortOrder() } /** - *

Only active Discounts can be applied to the Cart.

+ *
    + *
  • If defined, the Cart Discount applies on Carts having a Store matching any Store defined for this field.
  • + *
  • If not defined, the Cart Discount applies on all Carts, irrespective of a Store.
  • + *
+ *

If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.

+ *

If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.

+ * + + * @return null|StoreResourceIdentifierCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + *

Only active Discounts can be applied to the Cart. + * If the limit for active Cart Discounts is reached, a MaxCartDiscountsReached error is returned.

* * @return null|bool @@ -326,6 +350,17 @@ public function withSortOrder(?string $sortOrder) return $this; } + /** + * @param ?StoreResourceIdentifierCollection $stores + * @return $this + */ + public function withStores(?StoreResourceIdentifierCollection $stores) + { + $this->stores = $stores; + + return $this; + } + /** * @param ?bool $isActive * @return $this @@ -457,6 +492,7 @@ public function build(): CartDiscountDraft $this->cartPredicate, $this->target instanceof CartDiscountTargetBuilder ? $this->target->build() : $this->target, $this->sortOrder, + $this->stores, $this->isActive, $this->validFrom, $this->validUntil, diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php index 96a7edaa86e..69c5d18fa1a 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php @@ -10,6 +10,7 @@ use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringModel; +use Commercetools\Api\Models\Store\StoreResourceIdentifierCollection; use Commercetools\Api\Models\Type\CustomFieldsDraft; use Commercetools\Api\Models\Type\CustomFieldsDraftModel; use Commercetools\Base\DateTimeImmutableCollection; @@ -66,6 +67,12 @@ final class CartDiscountDraftModel extends JsonObjectModel implements CartDiscou */ protected $sortOrder; + /** + * + * @var ?StoreResourceIdentifierCollection + */ + protected $stores; + /** * * @var ?bool @@ -114,6 +121,7 @@ public function __construct( ?string $cartPredicate = null, ?CartDiscountTarget $target = null, ?string $sortOrder = null, + ?StoreResourceIdentifierCollection $stores = null, ?bool $isActive = null, ?DateTimeImmutable $validFrom = null, ?DateTimeImmutable $validUntil = null, @@ -128,6 +136,7 @@ public function __construct( $this->cartPredicate = $cartPredicate; $this->target = $target; $this->sortOrder = $sortOrder; + $this->stores = $stores; $this->isActive = $isActive; $this->validFrom = $validFrom; $this->validUntil = $validUntil; @@ -284,7 +293,33 @@ public function getSortOrder() } /** - *

Only active Discounts can be applied to the Cart.

+ *
    + *
  • If defined, the Cart Discount applies on Carts having a Store matching any Store defined for this field.
  • + *
  • If not defined, the Cart Discount applies on all Carts, irrespective of a Store.
  • + *
+ *

If the referenced Stores exceed the limit, a MaxStoreReferencesReached error is returned.

+ *

If the referenced Stores exceed the limit for Cart Discounts that do not require a Discount Code, a StoreCartDiscountsLimitReached error is returned.

+ * + * + * @return null|StoreResourceIdentifierCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreResourceIdentifierCollection::fromArray($data); + } + + return $this->stores; + } + + /** + *

Only active Discounts can be applied to the Cart. + * If the limit for active Cart Discounts is reached, a MaxCartDiscountsReached error is returned.

* * * @return null|bool @@ -469,6 +504,14 @@ public function setSortOrder(?string $sortOrder): void $this->sortOrder = $sortOrder; } + /** + * @param ?StoreResourceIdentifierCollection $stores + */ + public function setStores(?StoreResourceIdentifierCollection $stores): void + { + $this->stores = $stores; + } + /** * @param ?bool $isActive */ diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php index c856e302bb0..78112057e65 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php @@ -17,6 +17,7 @@ use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringModel; use Commercetools\Api\Models\Common\ReferenceCollection; +use Commercetools\Api\Models\Store\StoreKeyReferenceCollection; use Commercetools\Api\Models\Type\CustomFields; use Commercetools\Api\Models\Type\CustomFieldsModel; use Commercetools\Base\DateTimeImmutableCollection; @@ -109,6 +110,12 @@ final class CartDiscountModel extends JsonObjectModel implements CartDiscount */ protected $sortOrder; + /** + * + * @var ?StoreKeyReferenceCollection + */ + protected $stores; + /** * * @var ?bool @@ -169,6 +176,7 @@ public function __construct( ?string $cartPredicate = null, ?CartDiscountTarget $target = null, ?string $sortOrder = null, + ?StoreKeyReferenceCollection $stores = null, ?bool $isActive = null, ?DateTimeImmutable $validFrom = null, ?DateTimeImmutable $validUntil = null, @@ -190,6 +198,7 @@ public function __construct( $this->cartPredicate = $cartPredicate; $this->target = $target; $this->sortOrder = $sortOrder; + $this->stores = $stores; $this->isActive = $isActive; $this->validFrom = $validFrom; $this->validUntil = $validUntil; @@ -476,6 +485,29 @@ public function getSortOrder() return $this->sortOrder; } + /** + *
    + *
  • If a value exists, the Cart Discount applies on Carts having a Store matching any Store defined for this field.
  • + *
  • If empty, the Cart Discount applies on all Carts, irrespective of a Store.
  • + *
+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + /** *

Indicates if the CartDiscount is active and can be applied to the Cart.

* @@ -731,6 +763,14 @@ public function setSortOrder(?string $sortOrder): void $this->sortOrder = $sortOrder; } + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + /** * @param ?bool $isActive */ diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreAction.php new file mode 100644 index 00000000000..5926c6df5ae --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreAction.php @@ -0,0 +1,31 @@ +Store to remove.

+ * + + * @return null|StoreResourceIdentifier + */ + public function getStore(); + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void; +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionBuilder.php new file mode 100644 index 00000000000..a3261b53490 --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionBuilder.php @@ -0,0 +1,75 @@ + + */ +final class CartDiscountRemoveStoreActionBuilder implements Builder +{ + /** + + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder + */ + private $store; + + /** + *

Store to remove.

+ * + + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store; + } + + /** + * @param ?StoreResourceIdentifier $store + * @return $this + */ + public function withStore(?StoreResourceIdentifier $store) + { + $this->store = $store; + + return $this; + } + + /** + * @deprecated use withStore() instead + * @return $this + */ + public function withStoreBuilder(?StoreResourceIdentifierBuilder $store) + { + $this->store = $store; + + return $this; + } + + public function build(): CartDiscountRemoveStoreAction + { + return new CartDiscountRemoveStoreActionModel( + $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store + ); + } + + public static function of(): CartDiscountRemoveStoreActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionCollection.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionCollection.php new file mode 100644 index 00000000000..f06166db4d5 --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionCollection.php @@ -0,0 +1,56 @@ + + * @method CartDiscountRemoveStoreAction current() + * @method CartDiscountRemoveStoreAction end() + * @method CartDiscountRemoveStoreAction at($offset) + */ +class CartDiscountRemoveStoreActionCollection extends CartDiscountUpdateActionCollection +{ + /** + * @psalm-assert CartDiscountRemoveStoreAction $value + * @psalm-param CartDiscountRemoveStoreAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CartDiscountRemoveStoreActionCollection + */ + public function add($value) + { + if (!$value instanceof CartDiscountRemoveStoreAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CartDiscountRemoveStoreAction + */ + protected function mapper() + { + return function (?int $index): ?CartDiscountRemoveStoreAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CartDiscountRemoveStoreAction $data */ + $data = CartDiscountRemoveStoreActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionModel.php new file mode 100644 index 00000000000..56a45816dd9 --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountRemoveStoreActionModel.php @@ -0,0 +1,96 @@ +store = $store; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Store to remove.

+ * + * + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreResourceIdentifierModel::of($data); + } + + return $this->store; + } + + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void + { + $this->store = $store; + } +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresAction.php new file mode 100644 index 00000000000..b2d382da739 --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresAction.php @@ -0,0 +1,38 @@ +Stores to set. + * Overrides the current list of Stores. + * If empty, any existing values will be removed.

+ *

A failed update can return the following errors:

+ * + * + + * @return null|StoreResourceIdentifierCollection + */ + public function getStores(); + + /** + * @param ?StoreResourceIdentifierCollection $stores + */ + public function setStores(?StoreResourceIdentifierCollection $stores): void; +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionBuilder.php new file mode 100644 index 00000000000..e84e6dac931 --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionBuilder.php @@ -0,0 +1,71 @@ + + */ +final class CartDiscountSetStoresActionBuilder implements Builder +{ + /** + + * @var ?StoreResourceIdentifierCollection + */ + private $stores; + + /** + *

Stores to set. + * Overrides the current list of Stores. + * If empty, any existing values will be removed.

+ *

A failed update can return the following errors:

+ * + * + + * @return null|StoreResourceIdentifierCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + * @param ?StoreResourceIdentifierCollection $stores + * @return $this + */ + public function withStores(?StoreResourceIdentifierCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + + public function build(): CartDiscountSetStoresAction + { + return new CartDiscountSetStoresActionModel( + $this->stores + ); + } + + public static function of(): CartDiscountSetStoresActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionCollection.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionCollection.php new file mode 100644 index 00000000000..224c4a69c02 --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionCollection.php @@ -0,0 +1,56 @@ + + * @method CartDiscountSetStoresAction current() + * @method CartDiscountSetStoresAction end() + * @method CartDiscountSetStoresAction at($offset) + */ +class CartDiscountSetStoresActionCollection extends CartDiscountUpdateActionCollection +{ + /** + * @psalm-assert CartDiscountSetStoresAction $value + * @psalm-param CartDiscountSetStoresAction|stdClass $value + * @throws InvalidArgumentException + * + * @return CartDiscountSetStoresActionCollection + */ + public function add($value) + { + if (!$value instanceof CartDiscountSetStoresAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CartDiscountSetStoresAction + */ + protected function mapper() + { + return function (?int $index): ?CartDiscountSetStoresAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CartDiscountSetStoresAction $data */ + $data = CartDiscountSetStoresActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionModel.php new file mode 100644 index 00000000000..3b8929a5d66 --- /dev/null +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountSetStoresActionModel.php @@ -0,0 +1,101 @@ +stores = $stores; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Stores to set. + * Overrides the current list of Stores. + * If empty, any existing values will be removed.

+ *

A failed update can return the following errors:

+ * + * + * + * @return null|StoreResourceIdentifierCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreResourceIdentifierCollection::fromArray($data); + } + + return $this->stores; + } + + + /** + * @param ?StoreResourceIdentifierCollection $stores + */ + public function setStores(?StoreResourceIdentifierCollection $stores): void + { + $this->stores = $stores; + } +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateActionModel.php index 7189d2f9b5d..53f2ee37372 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountUpdateActionModel.php @@ -31,6 +31,7 @@ final class CartDiscountUpdateActionModel extends JsonObjectModel implements Car * */ private static $discriminatorClasses = [ + 'addStore' => CartDiscountAddStoreActionModel::class, 'changeCartPredicate' => CartDiscountChangeCartPredicateActionModel::class, 'changeIsActive' => CartDiscountChangeIsActiveActionModel::class, 'changeName' => CartDiscountChangeNameActionModel::class, @@ -39,10 +40,12 @@ final class CartDiscountUpdateActionModel extends JsonObjectModel implements Car 'changeStackingMode' => CartDiscountChangeStackingModeActionModel::class, 'changeTarget' => CartDiscountChangeTargetActionModel::class, 'changeValue' => CartDiscountChangeValueActionModel::class, + 'removeStore' => CartDiscountRemoveStoreActionModel::class, 'setCustomField' => CartDiscountSetCustomFieldActionModel::class, 'setCustomType' => CartDiscountSetCustomTypeActionModel::class, 'setDescription' => CartDiscountSetDescriptionActionModel::class, 'setKey' => CartDiscountSetKeyActionModel::class, + 'setStores' => CartDiscountSetStoresActionModel::class, 'setValidFrom' => CartDiscountSetValidFromActionModel::class, 'setValidFromAndUntil' => CartDiscountSetValidFromAndUntilActionModel::class, 'setValidUntil' => CartDiscountSetValidUntilActionModel::class, diff --git a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php index 30905d94476..790c8bd9752 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php +++ b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php @@ -78,7 +78,9 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject 'InvalidSubject' => InvalidSubjectErrorModel::class, 'LanguageUsedInStores' => LanguageUsedInStoresErrorModel::class, 'MatchingPriceNotFound' => MatchingPriceNotFoundErrorModel::class, + 'MaxCartDiscountsReached' => MaxCartDiscountsReachedErrorModel::class, 'MaxResourceLimitExceeded' => MaxResourceLimitExceededErrorModel::class, + 'MaxStoreReferencesReached' => MaxStoreReferencesReachedErrorModel::class, 'MissingRoleOnChannel' => MissingRoleOnChannelErrorModel::class, 'MissingTaxRateForCountry' => MissingTaxRateForCountryErrorModel::class, 'MoneyOverflow' => MoneyOverflowErrorModel::class, @@ -106,6 +108,7 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject 'SearchIndexingInProgress' => SearchIndexingInProgressErrorModel::class, 'SemanticError' => SemanticErrorErrorModel::class, 'ShippingMethodDoesNotMatchCart' => ShippingMethodDoesNotMatchCartErrorModel::class, + 'StoreCartDiscountsLimitReached' => StoreCartDiscountsLimitReachedErrorModel::class, 'SyntaxError' => SyntaxErrorErrorModel::class, 'insufficient_scope' => InsufficientScopeErrorModel::class, 'invalid_token' => InvalidTokenErrorModel::class, diff --git a/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php b/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php index 981653a4e7f..6a13b97c692 100644 --- a/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php +++ b/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php @@ -72,7 +72,9 @@ final class GraphQLErrorObjectModel extends JsonObjectModel implements GraphQLEr 'InvalidSubject' => GraphQLInvalidSubjectErrorModel::class, 'LanguageUsedInStores' => GraphQLLanguageUsedInStoresErrorModel::class, 'MatchingPriceNotFound' => GraphQLMatchingPriceNotFoundErrorModel::class, + 'MaxCartDiscountsReached' => GraphQLMaxCartDiscountsReachedErrorModel::class, 'MaxResourceLimitExceeded' => GraphQLMaxResourceLimitExceededErrorModel::class, + 'MaxStoreReferencesReached' => GraphQLMaxStoreReferencesReachedErrorModel::class, 'MissingRoleOnChannel' => GraphQLMissingRoleOnChannelErrorModel::class, 'MissingTaxRateForCountry' => GraphQLMissingTaxRateForCountryErrorModel::class, 'MoneyOverflow' => GraphQLMoneyOverflowErrorModel::class, @@ -100,6 +102,7 @@ final class GraphQLErrorObjectModel extends JsonObjectModel implements GraphQLEr 'SearchIndexingInProgress' => GraphQLSearchIndexingInProgressErrorModel::class, 'SemanticError' => GraphQLSemanticErrorErrorModel::class, 'ShippingMethodDoesNotMatchCart' => GraphQLShippingMethodDoesNotMatchCartErrorModel::class, + 'StoreCartDiscountsLimitReached' => GraphQLStoreCartDiscountsLimitReachedErrorModel::class, 'SyntaxError' => GraphQLSyntaxErrorErrorModel::class, 'insufficient_scope' => GraphQLInsufficientScopeErrorModel::class, 'invalid_token' => GraphQLInvalidTokenErrorModel::class, diff --git a/lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedError.php b/lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedError.php new file mode 100644 index 00000000000..a5d8d97de0e --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedError.php @@ -0,0 +1,21 @@ + + */ +final class GraphQLMaxCartDiscountsReachedErrorBuilder implements Builder +{ + public function build(): GraphQLMaxCartDiscountsReachedError + { + return new GraphQLMaxCartDiscountsReachedErrorModel( + ); + } + + public static function of(): GraphQLMaxCartDiscountsReachedErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedErrorCollection.php b/lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedErrorCollection.php new file mode 100644 index 00000000000..4c74dd38caf --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedErrorCollection.php @@ -0,0 +1,56 @@ + + * @method GraphQLMaxCartDiscountsReachedError current() + * @method GraphQLMaxCartDiscountsReachedError end() + * @method GraphQLMaxCartDiscountsReachedError at($offset) + */ +class GraphQLMaxCartDiscountsReachedErrorCollection extends GraphQLErrorObjectCollection +{ + /** + * @psalm-assert GraphQLMaxCartDiscountsReachedError $value + * @psalm-param GraphQLMaxCartDiscountsReachedError|stdClass $value + * @throws InvalidArgumentException + * + * @return GraphQLMaxCartDiscountsReachedErrorCollection + */ + public function add($value) + { + if (!$value instanceof GraphQLMaxCartDiscountsReachedError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?GraphQLMaxCartDiscountsReachedError + */ + protected function mapper() + { + return function (?int $index): ?GraphQLMaxCartDiscountsReachedError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var GraphQLMaxCartDiscountsReachedError $data */ + $data = GraphQLMaxCartDiscountsReachedErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedErrorModel.php b/lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedErrorModel.php new file mode 100644 index 00000000000..4bc26e0baf6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLMaxCartDiscountsReachedErrorModel.php @@ -0,0 +1,71 @@ +code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedError.php b/lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedError.php new file mode 100644 index 00000000000..13c61b35598 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedError.php @@ -0,0 +1,21 @@ + + */ +final class GraphQLMaxStoreReferencesReachedErrorBuilder implements Builder +{ + public function build(): GraphQLMaxStoreReferencesReachedError + { + return new GraphQLMaxStoreReferencesReachedErrorModel( + ); + } + + public static function of(): GraphQLMaxStoreReferencesReachedErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedErrorCollection.php b/lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedErrorCollection.php new file mode 100644 index 00000000000..fbe382c27c7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedErrorCollection.php @@ -0,0 +1,56 @@ + + * @method GraphQLMaxStoreReferencesReachedError current() + * @method GraphQLMaxStoreReferencesReachedError end() + * @method GraphQLMaxStoreReferencesReachedError at($offset) + */ +class GraphQLMaxStoreReferencesReachedErrorCollection extends GraphQLErrorObjectCollection +{ + /** + * @psalm-assert GraphQLMaxStoreReferencesReachedError $value + * @psalm-param GraphQLMaxStoreReferencesReachedError|stdClass $value + * @throws InvalidArgumentException + * + * @return GraphQLMaxStoreReferencesReachedErrorCollection + */ + public function add($value) + { + if (!$value instanceof GraphQLMaxStoreReferencesReachedError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?GraphQLMaxStoreReferencesReachedError + */ + protected function mapper() + { + return function (?int $index): ?GraphQLMaxStoreReferencesReachedError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var GraphQLMaxStoreReferencesReachedError $data */ + $data = GraphQLMaxStoreReferencesReachedErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedErrorModel.php b/lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedErrorModel.php new file mode 100644 index 00000000000..07abaa133cb --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLMaxStoreReferencesReachedErrorModel.php @@ -0,0 +1,71 @@ +code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedError.php b/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedError.php new file mode 100644 index 00000000000..c661af9a226 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedError.php @@ -0,0 +1,37 @@ +Stores for which the limit for active Cart Discounts that can exist has been reached.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores(); + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void; +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorBuilder.php new file mode 100644 index 00000000000..975ae3d1301 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorBuilder.php @@ -0,0 +1,64 @@ + + */ +final class GraphQLStoreCartDiscountsLimitReachedErrorBuilder implements Builder +{ + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + *

Stores for which the limit for active Cart Discounts that can exist has been reached.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + + public function build(): GraphQLStoreCartDiscountsLimitReachedError + { + return new GraphQLStoreCartDiscountsLimitReachedErrorModel( + $this->stores + ); + } + + public static function of(): GraphQLStoreCartDiscountsLimitReachedErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorCollection.php b/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorCollection.php new file mode 100644 index 00000000000..d4581710b83 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorCollection.php @@ -0,0 +1,56 @@ + + * @method GraphQLStoreCartDiscountsLimitReachedError current() + * @method GraphQLStoreCartDiscountsLimitReachedError end() + * @method GraphQLStoreCartDiscountsLimitReachedError at($offset) + */ +class GraphQLStoreCartDiscountsLimitReachedErrorCollection extends GraphQLErrorObjectCollection +{ + /** + * @psalm-assert GraphQLStoreCartDiscountsLimitReachedError $value + * @psalm-param GraphQLStoreCartDiscountsLimitReachedError|stdClass $value + * @throws InvalidArgumentException + * + * @return GraphQLStoreCartDiscountsLimitReachedErrorCollection + */ + public function add($value) + { + if (!$value instanceof GraphQLStoreCartDiscountsLimitReachedError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?GraphQLStoreCartDiscountsLimitReachedError + */ + protected function mapper() + { + return function (?int $index): ?GraphQLStoreCartDiscountsLimitReachedError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var GraphQLStoreCartDiscountsLimitReachedError $data */ + $data = GraphQLStoreCartDiscountsLimitReachedErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorModel.php b/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorModel.php new file mode 100644 index 00000000000..6a34782a400 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLStoreCartDiscountsLimitReachedErrorModel.php @@ -0,0 +1,107 @@ +stores = $stores; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + /** + *

Stores for which the limit for active Cart Discounts that can exist has been reached.

+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedError.php b/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedError.php new file mode 100644 index 00000000000..13d892232a6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedError.php @@ -0,0 +1,34 @@ +"Maximum number of active cart discounts reached ($max)."

+ * + + * @return null|string + */ + public function getMessage(); + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void; +} diff --git a/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorBuilder.php new file mode 100644 index 00000000000..5d142a0c794 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorBuilder.php @@ -0,0 +1,63 @@ + + */ +final class MaxCartDiscountsReachedErrorBuilder implements Builder +{ + /** + + * @var ?string + */ + private $message; + + /** + *

"Maximum number of active cart discounts reached ($max)."

+ * + + * @return null|string + */ + public function getMessage() + { + return $this->message; + } + + /** + * @param ?string $message + * @return $this + */ + public function withMessage(?string $message) + { + $this->message = $message; + + return $this; + } + + + public function build(): MaxCartDiscountsReachedError + { + return new MaxCartDiscountsReachedErrorModel( + $this->message + ); + } + + public static function of(): MaxCartDiscountsReachedErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorCollection.php b/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorCollection.php new file mode 100644 index 00000000000..e524bec85d0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorCollection.php @@ -0,0 +1,56 @@ + + * @method MaxCartDiscountsReachedError current() + * @method MaxCartDiscountsReachedError end() + * @method MaxCartDiscountsReachedError at($offset) + */ +class MaxCartDiscountsReachedErrorCollection extends ErrorObjectCollection +{ + /** + * @psalm-assert MaxCartDiscountsReachedError $value + * @psalm-param MaxCartDiscountsReachedError|stdClass $value + * @throws InvalidArgumentException + * + * @return MaxCartDiscountsReachedErrorCollection + */ + public function add($value) + { + if (!$value instanceof MaxCartDiscountsReachedError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MaxCartDiscountsReachedError + */ + protected function mapper() + { + return function (?int $index): ?MaxCartDiscountsReachedError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MaxCartDiscountsReachedError $data */ + $data = MaxCartDiscountsReachedErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorModel.php b/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorModel.php new file mode 100644 index 00000000000..7064eef1a8f --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/MaxCartDiscountsReachedErrorModel.php @@ -0,0 +1,106 @@ +message = $message; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + /** + *

"Maximum number of active cart discounts reached ($max)."

+ * + * + * @return null|string + */ + public function getMessage() + { + if (is_null($this->message)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_MESSAGE); + if (is_null($data)) { + return null; + } + $this->message = (string) $data; + } + + return $this->message; + } + + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void + { + $this->message = $message; + } + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedError.php b/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedError.php new file mode 100644 index 00000000000..62d15991ec3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedError.php @@ -0,0 +1,34 @@ +"Maximum number of store discounts on a single cart discount reached $max".

+ * + + * @return null|string + */ + public function getMessage(); + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void; +} diff --git a/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorBuilder.php new file mode 100644 index 00000000000..79acb337a7d --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorBuilder.php @@ -0,0 +1,63 @@ + + */ +final class MaxStoreReferencesReachedErrorBuilder implements Builder +{ + /** + + * @var ?string + */ + private $message; + + /** + *

"Maximum number of store discounts on a single cart discount reached $max".

+ * + + * @return null|string + */ + public function getMessage() + { + return $this->message; + } + + /** + * @param ?string $message + * @return $this + */ + public function withMessage(?string $message) + { + $this->message = $message; + + return $this; + } + + + public function build(): MaxStoreReferencesReachedError + { + return new MaxStoreReferencesReachedErrorModel( + $this->message + ); + } + + public static function of(): MaxStoreReferencesReachedErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorCollection.php b/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorCollection.php new file mode 100644 index 00000000000..c67dce62591 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorCollection.php @@ -0,0 +1,56 @@ + + * @method MaxStoreReferencesReachedError current() + * @method MaxStoreReferencesReachedError end() + * @method MaxStoreReferencesReachedError at($offset) + */ +class MaxStoreReferencesReachedErrorCollection extends ErrorObjectCollection +{ + /** + * @psalm-assert MaxStoreReferencesReachedError $value + * @psalm-param MaxStoreReferencesReachedError|stdClass $value + * @throws InvalidArgumentException + * + * @return MaxStoreReferencesReachedErrorCollection + */ + public function add($value) + { + if (!$value instanceof MaxStoreReferencesReachedError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MaxStoreReferencesReachedError + */ + protected function mapper() + { + return function (?int $index): ?MaxStoreReferencesReachedError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MaxStoreReferencesReachedError $data */ + $data = MaxStoreReferencesReachedErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorModel.php b/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorModel.php new file mode 100644 index 00000000000..e64ebbf95cc --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/MaxStoreReferencesReachedErrorModel.php @@ -0,0 +1,106 @@ +message = $message; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + /** + *

"Maximum number of store discounts on a single cart discount reached $max".

+ * + * + * @return null|string + */ + public function getMessage() + { + if (is_null($this->message)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_MESSAGE); + if (is_null($data)) { + return null; + } + $this->message = (string) $data; + } + + return $this->message; + } + + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void + { + $this->message = $message; + } + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedError.php b/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedError.php new file mode 100644 index 00000000000..c69d62428f3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedError.php @@ -0,0 +1,50 @@ +"Maximum number of active cart discounts reached for $stores."

+ * + + * @return null|string + */ + public function getMessage(); + + /** + *

Stores for which the limit for active Cart Discounts that can exist has been reached.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores(); + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void; + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void; +} diff --git a/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorBuilder.php b/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorBuilder.php new file mode 100644 index 00000000000..36af3969d55 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorBuilder.php @@ -0,0 +1,93 @@ + + */ +final class StoreCartDiscountsLimitReachedErrorBuilder implements Builder +{ + /** + + * @var ?string + */ + private $message; + + /** + + * @var ?StoreKeyReferenceCollection + */ + private $stores; + + /** + *

"Maximum number of active cart discounts reached for $stores."

+ * + + * @return null|string + */ + public function getMessage() + { + return $this->message; + } + + /** + *

Stores for which the limit for active Cart Discounts that can exist has been reached.

+ * + + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + return $this->stores; + } + + /** + * @param ?string $message + * @return $this + */ + public function withMessage(?string $message) + { + $this->message = $message; + + return $this; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + * @return $this + */ + public function withStores(?StoreKeyReferenceCollection $stores) + { + $this->stores = $stores; + + return $this; + } + + + public function build(): StoreCartDiscountsLimitReachedError + { + return new StoreCartDiscountsLimitReachedErrorModel( + $this->message, + $this->stores + ); + } + + public static function of(): StoreCartDiscountsLimitReachedErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorCollection.php b/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorCollection.php new file mode 100644 index 00000000000..7b1cc5a83ba --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorCollection.php @@ -0,0 +1,56 @@ + + * @method StoreCartDiscountsLimitReachedError current() + * @method StoreCartDiscountsLimitReachedError end() + * @method StoreCartDiscountsLimitReachedError at($offset) + */ +class StoreCartDiscountsLimitReachedErrorCollection extends ErrorObjectCollection +{ + /** + * @psalm-assert StoreCartDiscountsLimitReachedError $value + * @psalm-param StoreCartDiscountsLimitReachedError|stdClass $value + * @throws InvalidArgumentException + * + * @return StoreCartDiscountsLimitReachedErrorCollection + */ + public function add($value) + { + if (!$value instanceof StoreCartDiscountsLimitReachedError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StoreCartDiscountsLimitReachedError + */ + protected function mapper() + { + return function (?int $index): ?StoreCartDiscountsLimitReachedError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StoreCartDiscountsLimitReachedError $data */ + $data = StoreCartDiscountsLimitReachedErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorModel.php b/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorModel.php new file mode 100644 index 00000000000..3f6b06c54ce --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/StoreCartDiscountsLimitReachedErrorModel.php @@ -0,0 +1,143 @@ +message = $message; + $this->stores = $stores; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + /** + *

"Maximum number of active cart discounts reached for $stores."

+ * + * + * @return null|string + */ + public function getMessage() + { + if (is_null($this->message)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_MESSAGE); + if (is_null($data)) { + return null; + } + $this->message = (string) $data; + } + + return $this->message; + } + + /** + *

Stores for which the limit for active Cart Discounts that can exist has been reached.

+ * + * + * @return null|StoreKeyReferenceCollection + */ + public function getStores() + { + if (is_null($this->stores)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STORES); + if (is_null($data)) { + return null; + } + $this->stores = StoreKeyReferenceCollection::fromArray($data); + } + + return $this->stores; + } + + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void + { + $this->message = $message; + } + + /** + * @param ?StoreKeyReferenceCollection $stores + */ + public function setStores(?StoreKeyReferenceCollection $stores): void + { + $this->stores = $stores; + } + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php index 9e2d73453c0..738d066c327 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php @@ -21,6 +21,7 @@ interface StagedOrderAddCustomLineItemAction extends StagedOrderUpdateAction { public const FIELD_MONEY = 'money'; public const FIELD_NAME = 'name'; + public const FIELD_KEY = 'key'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_SLUG = 'slug'; public const FIELD_TAX_CATEGORY = 'taxCategory'; @@ -44,6 +45,14 @@ public function getMoney(); */ public function getName(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getKey(); + /** * @return null|int @@ -102,6 +111,11 @@ public function setMoney(?Money $money): void; */ public function setName(?LocalizedString $name): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php index 8af724867df..e661f2fecf6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php @@ -44,6 +44,12 @@ final class StagedOrderAddCustomLineItemActionBuilder implements Builder */ private $name; + /** + + * @var ?string + */ + private $key; + /** * @var ?int @@ -102,6 +108,17 @@ public function getName() return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** * @return null|int @@ -190,6 +207,17 @@ public function withName(?LocalizedString $name) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -316,6 +344,7 @@ public function build(): StagedOrderAddCustomLineItemAction return new StagedOrderAddCustomLineItemActionModel( $this->money instanceof MoneyBuilder ? $this->money->build() : $this->money, $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, + $this->key, $this->quantity, $this->slug, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php index fb37436b511..fb016514ff5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php @@ -50,6 +50,12 @@ final class StagedOrderAddCustomLineItemActionModel extends JsonObjectModel impl */ protected $name; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?int @@ -93,6 +99,7 @@ final class StagedOrderAddCustomLineItemActionModel extends JsonObjectModel impl public function __construct( ?Money $money = null, ?LocalizedString $name = null, + ?string $key = null, ?int $quantity = null, ?string $slug = null, ?TaxCategoryResourceIdentifier $taxCategory = null, @@ -103,6 +110,7 @@ public function __construct( ) { $this->money = $money; $this->name = $name; + $this->key = $key; $this->quantity = $quantity; $this->slug = $slug; $this->taxCategory = $taxCategory; @@ -172,6 +180,26 @@ public function getName() return $this->name; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** * * @return null|int @@ -312,6 +340,14 @@ public function setName(?LocalizedString $name): void $this->name = $name; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?int $quantity */ diff --git a/reference.txt b/reference.txt new file mode 100644 index 00000000000..75750bb2f47 --- /dev/null +++ b/reference.txt @@ -0,0 +1 @@ +5236e2e59da78d272ca45725e5423318d5e0175b diff --git a/references.txt b/references.txt index db0d703fe11..9bc2da37af2 100644 --- a/references.txt +++ b/references.txt @@ -62,3 +62,4 @@ cca2a403a6ab01eb9e0bd2487c0d8f4a97b521bc 1ce375bcc89b580bc63fe029066812b511e42dfb 469db24ebd23ce69a05ad4208ed3a69f97a012f8 b8643304f30b6ab91906dd29ad787d9b2064d738 +e7b3eac188a2a18e9a68ef54a58476e76b005774 From 040ab186b61649a7c6afc07f49052b76b09db383 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Thu, 6 Jul 2023 05:19:26 +0000 Subject: [PATCH 02/44] TASK: Updating SDK --- changes.md | 1 + .../StagedOrderAddDeliveryAction.php | 14 ++++++++ .../StagedOrderAddDeliveryActionBuilder.php | 29 +++++++++++++++ .../StagedOrderAddDeliveryActionModel.php | 36 +++++++++++++++++++ references.txt | 1 + 5 files changed, 81 insertions(+) diff --git a/changes.md b/changes.md index 4dcd2702227..e4810f5f6f3 100644 --- a/changes.md +++ b/changes.md @@ -14,6 +14,7 @@ - added property `stores` to type `CartDiscount` - added property `stores` to type `CartDiscountDraft` +- added property `shippingKey` to type `StagedOrderAddDeliveryAction` diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php index 777c5b70900..e65f6ed80f9 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php @@ -19,6 +19,7 @@ interface StagedOrderAddDeliveryAction extends StagedOrderUpdateAction { public const FIELD_DELIVERY_KEY = 'deliveryKey'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; public const FIELD_ITEMS = 'items'; public const FIELD_ADDRESS = 'address'; public const FIELD_PARCELS = 'parcels'; @@ -32,6 +33,14 @@ interface StagedOrderAddDeliveryAction extends StagedOrderUpdateAction */ public function getDeliveryKey(); + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + /** * @return null|DeliveryItemCollection @@ -67,6 +76,11 @@ public function getCustom(); */ public function setDeliveryKey(?string $deliveryKey): void; + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; + /** * @param ?DeliveryItemCollection $items */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php index 6f14e3cfefb..057722f0c43 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php @@ -34,6 +34,12 @@ final class StagedOrderAddDeliveryActionBuilder implements Builder */ private $deliveryKey; + /** + + * @var ?string + */ + private $shippingKey; + /** * @var ?DeliveryItemCollection @@ -69,6 +75,17 @@ public function getDeliveryKey() return $this->deliveryKey; } + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @return null|DeliveryItemCollection @@ -122,6 +139,17 @@ public function withDeliveryKey(?string $deliveryKey) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @param ?DeliveryItemCollection $items * @return $this @@ -192,6 +220,7 @@ public function build(): StagedOrderAddDeliveryAction { return new StagedOrderAddDeliveryActionModel( $this->deliveryKey, + $this->shippingKey, $this->items, $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address, $this->parcels, diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php index 7f798d7ec81..0fe1256187b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php @@ -40,6 +40,12 @@ final class StagedOrderAddDeliveryActionModel extends JsonObjectModel implements */ protected $deliveryKey; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * * @var ?DeliveryItemCollection @@ -70,6 +76,7 @@ final class StagedOrderAddDeliveryActionModel extends JsonObjectModel implements */ public function __construct( ?string $deliveryKey = null, + ?string $shippingKey = null, ?DeliveryItemCollection $items = null, ?BaseAddress $address = null, ?ParcelDraftCollection $parcels = null, @@ -77,6 +84,7 @@ public function __construct( ?string $action = null ) { $this->deliveryKey = $deliveryKey; + $this->shippingKey = $shippingKey; $this->items = $items; $this->address = $address; $this->parcels = $parcels; @@ -122,6 +130,26 @@ public function getDeliveryKey() return $this->deliveryKey; } + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * * @return null|DeliveryItemCollection @@ -211,6 +239,14 @@ public function setDeliveryKey(?string $deliveryKey): void $this->deliveryKey = $deliveryKey; } + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } + /** * @param ?DeliveryItemCollection $items */ diff --git a/references.txt b/references.txt index 9bc2da37af2..7ba78e7767b 100644 --- a/references.txt +++ b/references.txt @@ -63,3 +63,4 @@ cca2a403a6ab01eb9e0bd2487c0d8f4a97b521bc 469db24ebd23ce69a05ad4208ed3a69f97a012f8 b8643304f30b6ab91906dd29ad787d9b2064d738 e7b3eac188a2a18e9a68ef54a58476e76b005774 +1ceef2dd3899ca1e1d39ceee0dbbc5b3ea99cdfd From 86c3922ad63e43364e15ff965473eff1602fe6f2 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Thu, 6 Jul 2023 07:31:10 +0000 Subject: [PATCH 03/44] TASK: Updating SDK --- .../src/Models/CartDiscount/CartDiscountChangeValueAction.php | 3 ++- .../CartDiscount/CartDiscountChangeValueActionBuilder.php | 3 ++- .../Models/CartDiscount/CartDiscountChangeValueActionModel.php | 3 ++- references.txt | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueAction.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueAction.php index 2536ed89176..bf8d1efed56 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueAction.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueAction.php @@ -16,7 +16,8 @@ interface CartDiscountChangeValueAction extends CartDiscountUpdateAction public const FIELD_VALUE = 'value'; /** - *

New value to set.

+ *

New value to set. + * When trying to set a CartDiscountValueGiftLineItemDraft an InvalidInput error is returned.

* * @return null|CartDiscountValueDraft diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionBuilder.php index 12d702bc6e1..15941610eac 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionBuilder.php @@ -27,7 +27,8 @@ final class CartDiscountChangeValueActionBuilder implements Builder private $value; /** - *

New value to set.

+ *

New value to set. + * When trying to set a CartDiscountValueGiftLineItemDraft an InvalidInput error is returned.

* * @return null|CartDiscountValueDraft diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionModel.php index e7378b89dca..112664e4802 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountChangeValueActionModel.php @@ -63,7 +63,8 @@ public function getAction() } /** - *

New value to set.

+ *

New value to set. + * When trying to set a CartDiscountValueGiftLineItemDraft an InvalidInput error is returned.

* * * @return null|CartDiscountValueDraft diff --git a/references.txt b/references.txt index 7ba78e7767b..b396f8161e8 100644 --- a/references.txt +++ b/references.txt @@ -64,3 +64,4 @@ cca2a403a6ab01eb9e0bd2487c0d8f4a97b521bc b8643304f30b6ab91906dd29ad787d9b2064d738 e7b3eac188a2a18e9a68ef54a58476e76b005774 1ceef2dd3899ca1e1d39ceee0dbbc5b3ea99cdfd +43841c37c1701f6fbc97ecc822ac0a281d74c38c From ecae5479990e57f6fbc136d8e869a2504c79ed60 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Thu, 6 Jul 2023 08:37:54 +0000 Subject: [PATCH 04/44] TASK: Updating SDK --- .../StandalonePrice/StandalonePriceSetPriceTiersActionModel.php | 2 +- .../Models/StandalonePrice/StandalonePriceUpdateActionModel.php | 2 +- references.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetPriceTiersActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetPriceTiersActionModel.php index 6f202e32c8c..74e4b5b5ab4 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetPriceTiersActionModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceSetPriceTiersActionModel.php @@ -20,7 +20,7 @@ */ final class StandalonePriceSetPriceTiersActionModel extends JsonObjectModel implements StandalonePriceSetPriceTiersAction { - public const DISCRIMINATOR_VALUE = 'setPriceTier'; + public const DISCRIMINATOR_VALUE = 'setPriceTiers'; /** * * @var ?string diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php index 844c10a3254..8b0db41de5c 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php @@ -40,7 +40,7 @@ final class StandalonePriceUpdateActionModel extends JsonObjectModel implements 'setCustomType' => StandalonePriceSetCustomTypeActionModel::class, 'setDiscountedPrice' => StandalonePriceSetDiscountedPriceActionModel::class, 'setKey' => StandalonePriceSetKeyActionModel::class, - 'setPriceTier' => StandalonePriceSetPriceTiersActionModel::class, + 'setPriceTiers' => StandalonePriceSetPriceTiersActionModel::class, 'setValidFrom' => StandalonePriceSetValidFromActionModel::class, 'setValidFromAndUntil' => StandalonePriceSetValidFromAndUntilActionModel::class, 'setValidUntil' => StandalonePriceSetValidUntilActionModel::class, diff --git a/references.txt b/references.txt index b396f8161e8..7aeadb15d2a 100644 --- a/references.txt +++ b/references.txt @@ -65,3 +65,4 @@ b8643304f30b6ab91906dd29ad787d9b2064d738 e7b3eac188a2a18e9a68ef54a58476e76b005774 1ceef2dd3899ca1e1d39ceee0dbbc5b3ea99cdfd 43841c37c1701f6fbc97ecc822ac0a281d74c38c +d94fc7474c8ac7870fd980d59c0e5991b3a045ef From 034755f87f5d44314793c8fbea9260e8cca3e4f8 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Thu, 6 Jul 2023 11:50:43 +0000 Subject: [PATCH 05/44] TASK: Updating SDK --- references.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/references.txt b/references.txt index 7aeadb15d2a..44bc97b6747 100644 --- a/references.txt +++ b/references.txt @@ -66,3 +66,4 @@ e7b3eac188a2a18e9a68ef54a58476e76b005774 1ceef2dd3899ca1e1d39ceee0dbbc5b3ea99cdfd 43841c37c1701f6fbc97ecc822ac0a281d74c38c d94fc7474c8ac7870fd980d59c0e5991b3a045ef +cf1efa8eee337b806a5a943b0e44af7d890e4802 From 610e6b0b32a9293eae0203dc64cae63ce3ebea57 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Thu, 6 Jul 2023 14:54:38 +0000 Subject: [PATCH 06/44] TASK: Updating SDK --- changes.md | 8 + ...artSetDeliveryAddressCustomFieldAction.php | 60 ------ ...eliveryAddressCustomFieldActionBuilder.php | 123 ------------- ...veryAddressCustomFieldActionCollection.php | 56 ------ ...tDeliveryAddressCustomFieldActionModel.php | 167 ----------------- ...CartSetDeliveryAddressCustomTypeAction.php | 61 ------- ...DeliveryAddressCustomTypeActionBuilder.php | 147 --------------- ...iveryAddressCustomTypeActionCollection.php | 56 ------ ...etDeliveryAddressCustomTypeActionModel.php | 172 ------------------ .../src/Models/Cart/CartUpdateActionModel.php | 2 - references.txt | 1 + 11 files changed, 9 insertions(+), 844 deletions(-) delete mode 100644 lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php delete mode 100644 lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php delete mode 100644 lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionCollection.php delete mode 100644 lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php delete mode 100644 lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php delete mode 100644 lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php delete mode 100644 lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionCollection.php delete mode 100644 lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php diff --git a/changes.md b/changes.md index e4810f5f6f3..fdaa42cf741 100644 --- a/changes.md +++ b/changes.md @@ -18,6 +18,14 @@ +
+Removed Type(s) + +- :warning: removed type `CartSetDeliveryAddressCustomFieldAction` +- :warning: removed type `CartSetDeliveryAddressCustomTypeAction` +
+ +
Added Type(s) diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php deleted file mode 100644 index 82450cec922..00000000000 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldAction.php +++ /dev/null @@ -1,60 +0,0 @@ -id of the Delivery.

- * - - * @return null|string - */ - public function getDeliveryId(); - - /** - *

Name of the Custom Field.

- * - - * @return null|string - */ - public function getName(); - - /** - *

If value is absent or null, this field will be removed if it exists. - * Removing a field that does not exist returns an InvalidOperation error. - * If value is provided, it is set for the field defined by name.

- * - - * @return null|mixed - */ - public function getValue(); - - /** - * @param ?string $deliveryId - */ - public function setDeliveryId(?string $deliveryId): void; - - /** - * @param ?string $name - */ - public function setName(?string $name): void; - - /** - * @param mixed $value - */ - public function setValue($value): void; -} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php deleted file mode 100644 index ea86c4883f0..00000000000 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionBuilder.php +++ /dev/null @@ -1,123 +0,0 @@ - - */ -final class CartSetDeliveryAddressCustomFieldActionBuilder implements Builder -{ - /** - - * @var ?string - */ - private $deliveryId; - - /** - - * @var ?string - */ - private $name; - - /** - - * @var null|mixed|mixed - */ - private $value; - - /** - *

id of the Delivery.

- * - - * @return null|string - */ - public function getDeliveryId() - { - return $this->deliveryId; - } - - /** - *

Name of the Custom Field.

- * - - * @return null|string - */ - public function getName() - { - return $this->name; - } - - /** - *

If value is absent or null, this field will be removed if it exists. - * Removing a field that does not exist returns an InvalidOperation error. - * If value is provided, it is set for the field defined by name.

- * - - * @return null|mixed - */ - public function getValue() - { - return $this->value; - } - - /** - * @param ?string $deliveryId - * @return $this - */ - public function withDeliveryId(?string $deliveryId) - { - $this->deliveryId = $deliveryId; - - return $this; - } - - /** - * @param ?string $name - * @return $this - */ - public function withName(?string $name) - { - $this->name = $name; - - return $this; - } - - /** - * @param mixed $value - * @return $this - */ - public function withValue($value) - { - $this->value = $value; - - return $this; - } - - - public function build(): CartSetDeliveryAddressCustomFieldAction - { - return new CartSetDeliveryAddressCustomFieldActionModel( - $this->deliveryId, - $this->name, - $this->value - ); - } - - public static function of(): CartSetDeliveryAddressCustomFieldActionBuilder - { - return new self(); - } -} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionCollection.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionCollection.php deleted file mode 100644 index c053b6ffabf..00000000000 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method CartSetDeliveryAddressCustomFieldAction current() - * @method CartSetDeliveryAddressCustomFieldAction end() - * @method CartSetDeliveryAddressCustomFieldAction at($offset) - */ -class CartSetDeliveryAddressCustomFieldActionCollection extends CartUpdateActionCollection -{ - /** - * @psalm-assert CartSetDeliveryAddressCustomFieldAction $value - * @psalm-param CartSetDeliveryAddressCustomFieldAction|stdClass $value - * @throws InvalidArgumentException - * - * @return CartSetDeliveryAddressCustomFieldActionCollection - */ - public function add($value) - { - if (!$value instanceof CartSetDeliveryAddressCustomFieldAction) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?CartSetDeliveryAddressCustomFieldAction - */ - protected function mapper() - { - return function (?int $index): ?CartSetDeliveryAddressCustomFieldAction { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var CartSetDeliveryAddressCustomFieldAction $data */ - $data = CartSetDeliveryAddressCustomFieldActionModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php deleted file mode 100644 index 5d13d59df76..00000000000 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomFieldActionModel.php +++ /dev/null @@ -1,167 +0,0 @@ -deliveryId = $deliveryId; - $this->name = $name; - $this->value = $value; - $this->action = $action ?? self::DISCRIMINATOR_VALUE; - } - - /** - * - * @return null|string - */ - public function getAction() - { - if (is_null($this->action)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ACTION); - if (is_null($data)) { - return null; - } - $this->action = (string) $data; - } - - return $this->action; - } - - /** - *

id of the Delivery.

- * - * - * @return null|string - */ - public function getDeliveryId() - { - if (is_null($this->deliveryId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_DELIVERY_ID); - if (is_null($data)) { - return null; - } - $this->deliveryId = (string) $data; - } - - return $this->deliveryId; - } - - /** - *

Name of the Custom Field.

- * - * - * @return null|string - */ - public function getName() - { - if (is_null($this->name)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_NAME); - if (is_null($data)) { - return null; - } - $this->name = (string) $data; - } - - return $this->name; - } - - /** - *

If value is absent or null, this field will be removed if it exists. - * Removing a field that does not exist returns an InvalidOperation error. - * If value is provided, it is set for the field defined by name.

- * - * - * @return null|mixed - */ - public function getValue() - { - if (is_null($this->value)) { - /** @psalm-var mixed $data */ - $data = $this->raw(self::FIELD_VALUE); - if (is_null($data)) { - return null; - } - $this->value = $data; - } - - return $this->value; - } - - - /** - * @param ?string $deliveryId - */ - public function setDeliveryId(?string $deliveryId): void - { - $this->deliveryId = $deliveryId; - } - - /** - * @param ?string $name - */ - public function setName(?string $name): void - { - $this->name = $name; - } - - /** - * @param mixed $value - */ - public function setValue($value): void - { - $this->value = $value; - } -} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php deleted file mode 100644 index 811bd15f402..00000000000 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeAction.php +++ /dev/null @@ -1,61 +0,0 @@ -id of the Delivery.

- * - - * @return null|string - */ - public function getDeliveryId(); - - /** - *

Defines the Type that extends the Delivery address with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the Delivery address.

- * - - * @return null|TypeResourceIdentifier - */ - public function getType(); - - /** - *

Sets the Custom Fields fields for the Delivery address.

- * - - * @return null|FieldContainer - */ - public function getFields(); - - /** - * @param ?string $deliveryId - */ - public function setDeliveryId(?string $deliveryId): void; - - /** - * @param ?TypeResourceIdentifier $type - */ - public function setType(?TypeResourceIdentifier $type): void; - - /** - * @param ?FieldContainer $fields - */ - public function setFields(?FieldContainer $fields): void; -} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php deleted file mode 100644 index 4aedf4fc2cc..00000000000 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionBuilder.php +++ /dev/null @@ -1,147 +0,0 @@ - - */ -final class CartSetDeliveryAddressCustomTypeActionBuilder implements Builder -{ - /** - - * @var ?string - */ - private $deliveryId; - - /** - - * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder - */ - private $type; - - /** - - * @var null|FieldContainer|FieldContainerBuilder - */ - private $fields; - - /** - *

id of the Delivery.

- * - - * @return null|string - */ - public function getDeliveryId() - { - return $this->deliveryId; - } - - /** - *

Defines the Type that extends the Delivery address with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the Delivery address.

- * - - * @return null|TypeResourceIdentifier - */ - public function getType() - { - return $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type; - } - - /** - *

Sets the Custom Fields fields for the Delivery address.

- * - - * @return null|FieldContainer - */ - public function getFields() - { - return $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields; - } - - /** - * @param ?string $deliveryId - * @return $this - */ - public function withDeliveryId(?string $deliveryId) - { - $this->deliveryId = $deliveryId; - - return $this; - } - - /** - * @param ?TypeResourceIdentifier $type - * @return $this - */ - public function withType(?TypeResourceIdentifier $type) - { - $this->type = $type; - - return $this; - } - - /** - * @param ?FieldContainer $fields - * @return $this - */ - public function withFields(?FieldContainer $fields) - { - $this->fields = $fields; - - return $this; - } - - /** - * @deprecated use withType() instead - * @return $this - */ - public function withTypeBuilder(?TypeResourceIdentifierBuilder $type) - { - $this->type = $type; - - return $this; - } - - /** - * @deprecated use withFields() instead - * @return $this - */ - public function withFieldsBuilder(?FieldContainerBuilder $fields) - { - $this->fields = $fields; - - return $this; - } - - public function build(): CartSetDeliveryAddressCustomTypeAction - { - return new CartSetDeliveryAddressCustomTypeActionModel( - $this->deliveryId, - $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, - $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields - ); - } - - public static function of(): CartSetDeliveryAddressCustomTypeActionBuilder - { - return new self(); - } -} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionCollection.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionCollection.php deleted file mode 100644 index 59b4948babf..00000000000 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method CartSetDeliveryAddressCustomTypeAction current() - * @method CartSetDeliveryAddressCustomTypeAction end() - * @method CartSetDeliveryAddressCustomTypeAction at($offset) - */ -class CartSetDeliveryAddressCustomTypeActionCollection extends CartUpdateActionCollection -{ - /** - * @psalm-assert CartSetDeliveryAddressCustomTypeAction $value - * @psalm-param CartSetDeliveryAddressCustomTypeAction|stdClass $value - * @throws InvalidArgumentException - * - * @return CartSetDeliveryAddressCustomTypeActionCollection - */ - public function add($value) - { - if (!$value instanceof CartSetDeliveryAddressCustomTypeAction) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?CartSetDeliveryAddressCustomTypeAction - */ - protected function mapper() - { - return function (?int $index): ?CartSetDeliveryAddressCustomTypeAction { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var CartSetDeliveryAddressCustomTypeAction $data */ - $data = CartSetDeliveryAddressCustomTypeActionModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php deleted file mode 100644 index 9b55d62ec8a..00000000000 --- a/lib/commercetools-api/src/Models/Cart/CartSetDeliveryAddressCustomTypeActionModel.php +++ /dev/null @@ -1,172 +0,0 @@ -deliveryId = $deliveryId; - $this->type = $type; - $this->fields = $fields; - $this->action = $action ?? self::DISCRIMINATOR_VALUE; - } - - /** - * - * @return null|string - */ - public function getAction() - { - if (is_null($this->action)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ACTION); - if (is_null($data)) { - return null; - } - $this->action = (string) $data; - } - - return $this->action; - } - - /** - *

id of the Delivery.

- * - * - * @return null|string - */ - public function getDeliveryId() - { - if (is_null($this->deliveryId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_DELIVERY_ID); - if (is_null($data)) { - return null; - } - $this->deliveryId = (string) $data; - } - - return $this->deliveryId; - } - - /** - *

Defines the Type that extends the Delivery address with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the Delivery address.

- * - * - * @return null|TypeResourceIdentifier - */ - public function getType() - { - if (is_null($this->type)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_TYPE); - if (is_null($data)) { - return null; - } - - $this->type = TypeResourceIdentifierModel::of($data); - } - - return $this->type; - } - - /** - *

Sets the Custom Fields fields for the Delivery address.

- * - * - * @return null|FieldContainer - */ - public function getFields() - { - if (is_null($this->fields)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_FIELDS); - if (is_null($data)) { - return null; - } - - $this->fields = FieldContainerModel::of($data); - } - - return $this->fields; - } - - - /** - * @param ?string $deliveryId - */ - public function setDeliveryId(?string $deliveryId): void - { - $this->deliveryId = $deliveryId; - } - - /** - * @param ?TypeResourceIdentifier $type - */ - public function setType(?TypeResourceIdentifier $type): void - { - $this->type = $type; - } - - /** - * @param ?FieldContainer $fields - */ - public function setFields(?FieldContainer $fields): void - { - $this->fields = $fields; - } -} diff --git a/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php index d4a3b237103..6382d058562 100644 --- a/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartUpdateActionModel.php @@ -75,8 +75,6 @@ final class CartUpdateActionModel extends JsonObjectModel implements CartUpdateA 'setCustomerGroup' => CartSetCustomerGroupActionModel::class, 'setCustomerId' => CartSetCustomerIdActionModel::class, 'setDeleteDaysAfterLastModification' => CartSetDeleteDaysAfterLastModificationActionModel::class, - 'setDeliveryAddressCustomField' => CartSetDeliveryAddressCustomFieldActionModel::class, - 'setDeliveryAddressCustomType' => CartSetDeliveryAddressCustomTypeActionModel::class, 'setDirectDiscounts' => CartSetDirectDiscountsActionModel::class, 'setItemShippingAddressCustomField' => CartSetItemShippingAddressCustomFieldActionModel::class, 'setItemShippingAddressCustomType' => CartSetItemShippingAddressCustomTypeActionModel::class, diff --git a/references.txt b/references.txt index 44bc97b6747..2a2f9bb4dd4 100644 --- a/references.txt +++ b/references.txt @@ -67,3 +67,4 @@ e7b3eac188a2a18e9a68ef54a58476e76b005774 43841c37c1701f6fbc97ecc822ac0a281d74c38c d94fc7474c8ac7870fd980d59c0e5991b3a045ef cf1efa8eee337b806a5a943b0e44af7d890e4802 +cc581bbaa4c907418e64d72d70a1b17ef1297638 From 952074e1730a3ddd9f502def08b494de58cadd6c Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 7 Jul 2023 07:31:50 +0000 Subject: [PATCH 07/44] TASK: Updating SDK --- lib/commercetools-api/docs/RequestBuilder.md | 1 - references.txt | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 7e537092624..10f372227a9 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -2174,7 +2174,6 @@ $request = $builder The My Business Unit endpoint does not support assigning existing Customers to a Business Unit. Associates with the `UpdateAssociates` [Permission](ctp:api:type:Permission) can use this endpoint to create a new Customer and associate it with the Business Unit. If the required [Permission](/projects/associate-roles#permission) is missing, an [AssociateMissingPermission](/errors#associatemissingpermission) error is returned. -The new Associate is created with an empty set of roles. ### Example diff --git a/references.txt b/references.txt index 2a2f9bb4dd4..4e5e875a60c 100644 --- a/references.txt +++ b/references.txt @@ -68,3 +68,4 @@ e7b3eac188a2a18e9a68ef54a58476e76b005774 d94fc7474c8ac7870fd980d59c0e5991b3a045ef cf1efa8eee337b806a5a943b0e44af7d890e4802 cc581bbaa4c907418e64d72d70a1b17ef1297638 +e40afdfd0ae914b593926d478cb307e9a3b7328b From 127bb66168fec940a5607a4475e5d142f7e1f205 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 10 Jul 2023 10:11:11 +0000 Subject: [PATCH 08/44] TASK: Updating SDK --- changes.md | 8 +++++++ ...toreKeyProductSelectionAssignmentsTest.php | 24 +++++++++++++++++++ ...StoreKeyProductSelectionAssignmentsGet.php | 21 +++++++++++++++- .../Models/Message/DeliveryAddedMessage.php | 2 +- .../Message/DeliveryAddedMessageBuilder.php | 2 +- .../Message/DeliveryAddedMessageModel.php | 2 +- .../Message/DeliveryAddedMessagePayload.php | 2 +- .../DeliveryAddedMessagePayloadBuilder.php | 2 +- .../DeliveryAddedMessagePayloadModel.php | 2 +- .../Message/DeliveryAddressSetMessage.php | 2 +- .../DeliveryAddressSetMessageBuilder.php | 2 +- .../DeliveryAddressSetMessageModel.php | 2 +- .../DeliveryAddressSetMessagePayload.php | 2 +- ...eliveryAddressSetMessagePayloadBuilder.php | 2 +- .../DeliveryAddressSetMessagePayloadModel.php | 2 +- .../Message/DeliveryItemsUpdatedMessage.php | 2 +- .../DeliveryItemsUpdatedMessageBuilder.php | 2 +- .../DeliveryItemsUpdatedMessageModel.php | 2 +- .../DeliveryItemsUpdatedMessagePayload.php | 2 +- ...iveryItemsUpdatedMessagePayloadBuilder.php | 2 +- ...eliveryItemsUpdatedMessagePayloadModel.php | 2 +- .../Models/Message/DeliveryRemovedMessage.php | 2 +- .../Message/DeliveryRemovedMessageBuilder.php | 2 +- .../Message/DeliveryRemovedMessageModel.php | 2 +- .../Message/DeliveryRemovedMessagePayload.php | 2 +- .../DeliveryRemovedMessagePayloadBuilder.php | 2 +- .../DeliveryRemovedMessagePayloadModel.php | 2 +- .../OrderLineItemDiscountSetMessage.php | 2 +- ...OrderLineItemDiscountSetMessageBuilder.php | 2 +- .../OrderLineItemDiscountSetMessageModel.php | 2 +- ...OrderLineItemDiscountSetMessagePayload.php | 2 +- ...neItemDiscountSetMessagePayloadBuilder.php | 2 +- ...LineItemDiscountSetMessagePayloadModel.php | 2 +- .../Message/ParcelAddedToDeliveryMessage.php | 2 +- .../ParcelAddedToDeliveryMessageBuilder.php | 2 +- .../ParcelAddedToDeliveryMessageModel.php | 2 +- .../ParcelAddedToDeliveryMessagePayload.php | 2 +- ...elAddedToDeliveryMessagePayloadBuilder.php | 2 +- ...rcelAddedToDeliveryMessagePayloadModel.php | 2 +- .../Message/ParcelItemsUpdatedMessage.php | 2 +- .../ParcelItemsUpdatedMessageBuilder.php | 2 +- .../ParcelItemsUpdatedMessageModel.php | 2 +- .../ParcelItemsUpdatedMessagePayload.php | 2 +- ...arcelItemsUpdatedMessagePayloadBuilder.php | 2 +- .../ParcelItemsUpdatedMessagePayloadModel.php | 2 +- .../ParcelMeasurementsUpdatedMessage.php | 2 +- ...arcelMeasurementsUpdatedMessageBuilder.php | 2 +- .../ParcelMeasurementsUpdatedMessageModel.php | 2 +- ...arcelMeasurementsUpdatedMessagePayload.php | 2 +- ...asurementsUpdatedMessagePayloadBuilder.php | 2 +- ...MeasurementsUpdatedMessagePayloadModel.php | 2 +- .../ParcelRemovedFromDeliveryMessage.php | 2 +- ...arcelRemovedFromDeliveryMessageBuilder.php | 2 +- .../ParcelRemovedFromDeliveryMessageModel.php | 2 +- ...arcelRemovedFromDeliveryMessagePayload.php | 2 +- ...movedFromDeliveryMessagePayloadBuilder.php | 2 +- ...RemovedFromDeliveryMessagePayloadModel.php | 2 +- .../ParcelTrackingDataUpdatedMessage.php | 2 +- ...arcelTrackingDataUpdatedMessageBuilder.php | 2 +- .../ParcelTrackingDataUpdatedMessageModel.php | 2 +- ...arcelTrackingDataUpdatedMessagePayload.php | 2 +- ...ackingDataUpdatedMessagePayloadBuilder.php | 2 +- ...TrackingDataUpdatedMessagePayloadModel.php | 2 +- .../src/Models/Order/Order.php | 6 ++--- .../Models/Order/OrderAddDeliveryAction.php | 2 +- .../Order/OrderAddDeliveryActionBuilder.php | 2 +- .../Order/OrderAddDeliveryActionModel.php | 2 +- .../src/Models/Order/OrderBuilder.php | 6 ++--- .../src/Models/Order/OrderModel.php | 6 ++--- .../StagedOrderAddDeliveryAction.php | 2 +- .../StagedOrderAddDeliveryActionBuilder.php | 2 +- .../StagedOrderAddDeliveryActionModel.php | 2 +- .../Models/OrderEdit/StagedOrderBuilder.php | 6 ++--- .../src/Models/OrderEdit/StagedOrderModel.php | 6 ++--- references.txt | 1 + 75 files changed, 134 insertions(+), 82 deletions(-) diff --git a/changes.md b/changes.md index fdaa42cf741..9fee46c54e9 100644 --- a/changes.md +++ b/changes.md @@ -18,6 +18,14 @@
+
+Added QueryParameter(s) + +- added query parameter `where` to method `get /{projectKey}/in-store/key={storeKey}/product-selection-assignments` +- added query parameter `/^var[.][a-zA-Z0-9]+$/` to method `get /{projectKey}/in-store/key={storeKey}/product-selection-assignments` +
+ +
Removed Type(s) diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsTest.php index e96993001ab..bf0c71e0d74 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsTest.php @@ -138,6 +138,30 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/in-store/key=test_storeKey/product-selection-assignments?expand=expand', ], + 'ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet_withWhere' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productSelectionAssignments() + ->get() + ->withWhere('where'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-selection-assignments?where=where', + ], + 'ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet_withPredicateVar' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->inStoreKeyWithStoreKeyValue('test_storeKey') + ->productSelectionAssignments() + ->get() + ->withPredicateVar('varName', 'var.varName'); + }, + 'get', + 'test_projectKey/in-store/key=test_storeKey/product-selection-assignments?var.varName=var.varName', + ], 'ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet.php index 9f270a73406..c5e5d03482d 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet.php @@ -31,10 +31,11 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Expandable + * @template-implements Query * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +class ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet extends ApiRequest implements Expandable, Query, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -179,4 +180,22 @@ public function withExpand($expand): ByProjectKeyInStoreKeyByStoreKeyProductSele { return $this->withQueryParam('expand', $expand); } + + /** + * + * @psalm-param scalar|scalar[] $where + */ + public function withWhere($where): ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet + { + return $this->withQueryParam('where', $where); + } + + /** + * @psalm-param string $varName + * @psalm-param scalar|scalar[] $predicateVar + */ + public function withPredicateVar(string $varName, $predicateVar): ByProjectKeyInStoreKeyByStoreKeyProductSelectionAssignmentsGet + { + return $this->withQueryParam(sprintf('var.%s', $varName), $predicateVar); + } } diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php index 2978a332a5f..983af9a602e 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php @@ -26,7 +26,7 @@ interface DeliveryAddedMessage extends OrderMessage public function getDelivery(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php index 02b2caa81c2..de488e5d054 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php @@ -224,7 +224,7 @@ public function getDelivery() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php index 49f03940d72..08f0b78625f 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php @@ -396,7 +396,7 @@ public function getDelivery() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php index 8c3327ca8ee..876b6aaae6e 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php @@ -26,7 +26,7 @@ interface DeliveryAddedMessagePayload extends OrderMessagePayload public function getDelivery(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php index 3f7f6398396..c849b0eeb3f 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php @@ -46,7 +46,7 @@ public function getDelivery() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php index 437f9f3901e..974f20783d5 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php @@ -94,7 +94,7 @@ public function getDelivery() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessage.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessage.php index 024aa1c7dff..dddd2264ec1 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessage.php @@ -44,7 +44,7 @@ public function getAddress(); public function getOldAddress(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageBuilder.php index 4849b1433c0..45267ac55d4 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageBuilder.php @@ -258,7 +258,7 @@ public function getOldAddress() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageModel.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageModel.php index c8100d3897d..0cf30a747b6 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessageModel.php @@ -453,7 +453,7 @@ public function getOldAddress() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayload.php index 6be09a19380..7fb04c6bf75 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayload.php @@ -44,7 +44,7 @@ public function getAddress(); public function getOldAddress(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadBuilder.php index 85a9e699c04..3b481ffc625 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadBuilder.php @@ -80,7 +80,7 @@ public function getOldAddress() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadModel.php index 8add65f815f..3a21ba86929 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddressSetMessagePayloadModel.php @@ -151,7 +151,7 @@ public function getOldAddress() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessage.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessage.php index d7b7edf1be9..f236dab40c6 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessage.php @@ -44,7 +44,7 @@ public function getItems(); public function getOldItems(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageBuilder.php index 67975b7997e..68ab48487f2 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageBuilder.php @@ -257,7 +257,7 @@ public function getOldItems() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageModel.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageModel.php index aab980f629a..3b511ec76a7 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessageModel.php @@ -450,7 +450,7 @@ public function getOldItems() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayload.php index 99159545692..f6ed89af947 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayload.php @@ -44,7 +44,7 @@ public function getItems(); public function getOldItems(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadBuilder.php index 1fb21efa634..44178019976 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadBuilder.php @@ -79,7 +79,7 @@ public function getOldItems() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadModel.php index 93c120d5341..771695b1b28 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryItemsUpdatedMessagePayloadModel.php @@ -148,7 +148,7 @@ public function getOldItems() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessage.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessage.php index c5866003801..2fd601c1e4c 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessage.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessage.php @@ -26,7 +26,7 @@ interface DeliveryRemovedMessage extends OrderMessage public function getDelivery(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageBuilder.php index a7f08979fd0..b1d5b831235 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageBuilder.php @@ -224,7 +224,7 @@ public function getDelivery() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageModel.php index 2495d4a2a57..639c7d242eb 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessageModel.php @@ -396,7 +396,7 @@ public function getDelivery() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayload.php index 8c627a1d49a..a878dec4ae7 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayload.php @@ -26,7 +26,7 @@ interface DeliveryRemovedMessagePayload extends OrderMessagePayload public function getDelivery(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadBuilder.php index 323cf171eb9..6d97b634125 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadBuilder.php @@ -46,7 +46,7 @@ public function getDelivery() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadModel.php index 11712a8cb9f..aab61d5b493 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryRemovedMessagePayloadModel.php @@ -94,7 +94,7 @@ public function getDelivery() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php index 0a8a64e2549..5edaa210699 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php @@ -56,7 +56,7 @@ public function getTotalPrice(); public function getTaxedPrice(); /** - *

Taxed price of the Shipping Methods in a Cart with Multi ShippingMode.

+ *

Taxed price of the Shipping Methods in a Cart with Multiple ShippingMode.

* * @return null|MethodTaxedPriceCollection diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php index 162817cb3d9..91724b4f729 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php @@ -279,7 +279,7 @@ public function getTaxedPrice() } /** - *

Taxed price of the Shipping Methods in a Cart with Multi ShippingMode.

+ *

Taxed price of the Shipping Methods in a Cart with Multiple ShippingMode.

* * @return null|MethodTaxedPriceCollection diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php index 796591c6fd6..89e247189c4 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php @@ -485,7 +485,7 @@ public function getTaxedPrice() } /** - *

Taxed price of the Shipping Methods in a Cart with Multi ShippingMode.

+ *

Taxed price of the Shipping Methods in a Cart with Multiple ShippingMode.

* * * @return null|MethodTaxedPriceCollection diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php index 9f4dad98936..2e7be7b3b2e 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php @@ -56,7 +56,7 @@ public function getTotalPrice(); public function getTaxedPrice(); /** - *

Taxed price of the Shipping Methods in a Cart with Multi ShippingMode.

+ *

Taxed price of the Shipping Methods in a Cart with Multiple ShippingMode.

* * @return null|MethodTaxedPriceCollection diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php index 119fb300ce1..e003e91b3c4 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php @@ -101,7 +101,7 @@ public function getTaxedPrice() } /** - *

Taxed price of the Shipping Methods in a Cart with Multi ShippingMode.

+ *

Taxed price of the Shipping Methods in a Cart with Multiple ShippingMode.

* * @return null|MethodTaxedPriceCollection diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php index c3f1953c228..0554fdde612 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php @@ -183,7 +183,7 @@ public function getTaxedPrice() } /** - *

Taxed price of the Shipping Methods in a Cart with Multi ShippingMode.

+ *

Taxed price of the Shipping Methods in a Cart with Multiple ShippingMode.

* * * @return null|MethodTaxedPriceCollection diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessage.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessage.php index b909a0755ff..4aef6e632bd 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessage.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessage.php @@ -36,7 +36,7 @@ public function getDelivery(); public function getParcel(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageBuilder.php index 05e4b89bff0..82cc24f245f 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageBuilder.php @@ -243,7 +243,7 @@ public function getParcel() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageModel.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageModel.php index 5e53d28d67b..0fb800ad692 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessageModel.php @@ -427,7 +427,7 @@ public function getParcel() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayload.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayload.php index 1f4111e4fb8..3814b46aa58 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayload.php @@ -36,7 +36,7 @@ public function getDelivery(); public function getParcel(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadBuilder.php index 6798912a933..eceb58dbdf8 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadBuilder.php @@ -65,7 +65,7 @@ public function getParcel() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadModel.php index 23b4fe1c7e9..d02f85d08ad 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelAddedToDeliveryMessagePayloadModel.php @@ -125,7 +125,7 @@ public function getParcel() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessage.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessage.php index 31633899086..a0bcf9aa92e 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessage.php @@ -53,7 +53,7 @@ public function getItems(); public function getOldItems(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageBuilder.php index 88e6bf3b549..267433c6c04 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageBuilder.php @@ -274,7 +274,7 @@ public function getOldItems() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageModel.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageModel.php index 0e1e864a356..7fd3277f7ee 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessageModel.php @@ -478,7 +478,7 @@ public function getOldItems() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayload.php index 56a4ae92d22..fcc641d6234 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayload.php @@ -53,7 +53,7 @@ public function getItems(); public function getOldItems(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadBuilder.php index 1805b8a5de8..3f20b6500e8 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadBuilder.php @@ -96,7 +96,7 @@ public function getOldItems() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadModel.php index c0a1f966a25..4ab21fbec42 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelItemsUpdatedMessagePayloadModel.php @@ -176,7 +176,7 @@ public function getOldItems() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessage.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessage.php index 5eb96cc0409..a60b8dffb4a 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessage.php @@ -44,7 +44,7 @@ public function getParcelId(); public function getMeasurements(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageBuilder.php index fda14214276..54ce26995a7 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageBuilder.php @@ -258,7 +258,7 @@ public function getMeasurements() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageModel.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageModel.php index 5b34ca7b5f3..16b0d9f111e 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessageModel.php @@ -452,7 +452,7 @@ public function getMeasurements() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayload.php index d2e72e487ec..05691155d78 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayload.php @@ -44,7 +44,7 @@ public function getParcelId(); public function getMeasurements(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadBuilder.php index 8059bb0b34e..2374b2a35c6 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadBuilder.php @@ -80,7 +80,7 @@ public function getMeasurements() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadModel.php index 13beffa0a2a..5659b845f02 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelMeasurementsUpdatedMessagePayloadModel.php @@ -150,7 +150,7 @@ public function getMeasurements() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessage.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessage.php index 2646d33127f..2b86566b7ab 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessage.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessage.php @@ -35,7 +35,7 @@ public function getDeliveryId(); public function getParcel(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageBuilder.php index 072538c19a3..1aca9e57eb8 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageBuilder.php @@ -241,7 +241,7 @@ public function getParcel() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageModel.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageModel.php index 2341e6fb319..301696b2158 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessageModel.php @@ -424,7 +424,7 @@ public function getParcel() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayload.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayload.php index f5e0a238663..2737a40d9c8 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayload.php @@ -35,7 +35,7 @@ public function getDeliveryId(); public function getParcel(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadBuilder.php index 65827367e43..dbbcaa98195 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadBuilder.php @@ -63,7 +63,7 @@ public function getParcel() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadModel.php index d215c5796cf..81874a9409a 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelRemovedFromDeliveryMessagePayloadModel.php @@ -122,7 +122,7 @@ public function getParcel() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessage.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessage.php index 9acd4aa36cd..e44485d5251 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessage.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessage.php @@ -44,7 +44,7 @@ public function getParcelId(); public function getTrackingData(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageBuilder.php index 8f28b94193f..e931cfc8aa3 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageBuilder.php @@ -258,7 +258,7 @@ public function getTrackingData() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageModel.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageModel.php index 9f4dd817014..17542055c6c 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessageModel.php @@ -452,7 +452,7 @@ public function getTrackingData() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayload.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayload.php index a9a7f9e98dd..04ca0d34134 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayload.php @@ -44,7 +44,7 @@ public function getParcelId(); public function getTrackingData(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadBuilder.php index 3f9178b900a..81a746a66b7 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadBuilder.php @@ -80,7 +80,7 @@ public function getTrackingData() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadModel.php index 5ae0a3e2f3c..88eb98629a1 100644 --- a/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/ParcelTrackingDataUpdatedMessagePayloadModel.php @@ -150,7 +150,7 @@ public function getTrackingData() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/Order.php b/lib/commercetools-api/src/Models/Order/Order.php index 9c214bfdbf3..a511c628436 100644 --- a/lib/commercetools-api/src/Models/Order/Order.php +++ b/lib/commercetools-api/src/Models/Order/Order.php @@ -216,7 +216,7 @@ public function getTaxedShippingPrice(); /** *

Holds all shipping-related information per Shipping Method.

- *

For Multi ShippingMode, it is updated automatically after the Shipping Methods are added.

+ *

For Multiple ShippingMode, it is updated automatically after the Shipping Methods are added.

* * @return null|Address @@ -238,7 +238,7 @@ public function getBillingAddress(); public function getShippingMode(); /** - *

User-defined unique identifier of the Shipping Method with Single ShippingMode.

+ *

key of the ShippingMethod for Single ShippingMode.

* * @return null|string @@ -254,7 +254,7 @@ public function getShippingKey(); public function getShippingCustomFields(); /** - *

Holds all shipping-related information per Shipping Method for Multi ShippingMode.

+ *

Holds all shipping-related information per Shipping Method for Multiple ShippingMode.

*

It is updated automatically after the Shipping Method is added.

* diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php index 47187c23d6c..e738da8777b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php @@ -37,7 +37,7 @@ public function getDeliveryKey(); public function getItems(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

key of the ShippingMethod, required for Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php index 22f546c8738..fc8b3a85101 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php @@ -81,7 +81,7 @@ public function getItems() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

key of the ShippingMethod, required for Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php index db5c83bc03b..d5441f4eb33 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php @@ -145,7 +145,7 @@ public function getItems() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

key of the ShippingMethod, required for Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderBuilder.php b/lib/commercetools-api/src/Models/Order/OrderBuilder.php index 628ec0e2514..e5dc86f3a4f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderBuilder.php @@ -541,7 +541,7 @@ public function getTaxedShippingPrice() /** *

Holds all shipping-related information per Shipping Method.

- *

For Multi ShippingMode, it is updated automatically after the Shipping Methods are added.

+ *

For Multiple ShippingMode, it is updated automatically after the Shipping Methods are added.

* * @return null|Address @@ -572,7 +572,7 @@ public function getShippingMode() } /** - *

User-defined unique identifier of the Shipping Method with Single ShippingMode.

+ *

key of the ShippingMethod for Single ShippingMode.

* * @return null|string @@ -594,7 +594,7 @@ public function getShippingCustomFields() } /** - *

Holds all shipping-related information per Shipping Method for Multi ShippingMode.

+ *

Holds all shipping-related information per Shipping Method for Multiple ShippingMode.

*

It is updated automatically after the Shipping Method is added.

* diff --git a/lib/commercetools-api/src/Models/Order/OrderModel.php b/lib/commercetools-api/src/Models/Order/OrderModel.php index d84c53de0e9..d7d89dabbbf 100644 --- a/lib/commercetools-api/src/Models/Order/OrderModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderModel.php @@ -827,7 +827,7 @@ public function getTaxedShippingPrice() /** *

Holds all shipping-related information per Shipping Method.

- *

For Multi ShippingMode, it is updated automatically after the Shipping Methods are added.

+ *

For Multiple ShippingMode, it is updated automatically after the Shipping Methods are added.

* * * @return null|Address @@ -887,7 +887,7 @@ public function getShippingMode() } /** - *

User-defined unique identifier of the Shipping Method with Single ShippingMode.

+ *

key of the ShippingMethod for Single ShippingMode.

* * * @return null|string @@ -928,7 +928,7 @@ public function getShippingCustomFields() } /** - *

Holds all shipping-related information per Shipping Method for Multi ShippingMode.

+ *

Holds all shipping-related information per Shipping Method for Multiple ShippingMode.

*

It is updated automatically after the Shipping Method is added.

* * diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php index e65f6ed80f9..e55e1f21e42 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php @@ -34,7 +34,7 @@ interface StagedOrderAddDeliveryAction extends StagedOrderUpdateAction public function getDeliveryKey(); /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

key of the ShippingMethod,required for Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php index 057722f0c43..67b40ba6db1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php @@ -76,7 +76,7 @@ public function getDeliveryKey() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

key of the ShippingMethod,required for Multiple ShippingMode.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php index 0fe1256187b..2a1d5022d78 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php @@ -131,7 +131,7 @@ public function getDeliveryKey() } /** - *

User-defined unique identifier of the Shipping Method in a Cart with Multi ShippingMode.

+ *

key of the ShippingMethod,required for Multiple ShippingMode.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php index 079226572fe..37472b2b84e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php @@ -543,7 +543,7 @@ public function getTaxedShippingPrice() /** *

Holds all shipping-related information per Shipping Method.

- *

For Multi ShippingMode, it is updated automatically after the Shipping Methods are added.

+ *

For Multiple ShippingMode, it is updated automatically after the Shipping Methods are added.

* * @return null|Address @@ -574,7 +574,7 @@ public function getShippingMode() } /** - *

User-defined unique identifier of the Shipping Method with Single ShippingMode.

+ *

key of the ShippingMethod for Single ShippingMode.

* * @return null|string @@ -596,7 +596,7 @@ public function getShippingCustomFields() } /** - *

Holds all shipping-related information per Shipping Method for Multi ShippingMode.

+ *

Holds all shipping-related information per Shipping Method for Multiple ShippingMode.

*

It is updated automatically after the Shipping Method is added.

* diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php index 9d883a600c0..30374bf9976 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php @@ -829,7 +829,7 @@ public function getTaxedShippingPrice() /** *

Holds all shipping-related information per Shipping Method.

- *

For Multi ShippingMode, it is updated automatically after the Shipping Methods are added.

+ *

For Multiple ShippingMode, it is updated automatically after the Shipping Methods are added.

* * * @return null|Address @@ -889,7 +889,7 @@ public function getShippingMode() } /** - *

User-defined unique identifier of the Shipping Method with Single ShippingMode.

+ *

key of the ShippingMethod for Single ShippingMode.

* * * @return null|string @@ -930,7 +930,7 @@ public function getShippingCustomFields() } /** - *

Holds all shipping-related information per Shipping Method for Multi ShippingMode.

+ *

Holds all shipping-related information per Shipping Method for Multiple ShippingMode.

*

It is updated automatically after the Shipping Method is added.

* * diff --git a/references.txt b/references.txt index 4e5e875a60c..7f8ab7506bd 100644 --- a/references.txt +++ b/references.txt @@ -69,3 +69,4 @@ d94fc7474c8ac7870fd980d59c0e5991b3a045ef cf1efa8eee337b806a5a943b0e44af7d890e4802 cc581bbaa4c907418e64d72d70a1b17ef1297638 e40afdfd0ae914b593926d478cb307e9a3b7328b +da31e9917b314501c2a67a8e3bc2e6dfe9c228ca From 0150539b8e716d99e07e350b6f1e0ca20ced85c2 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 11 Jul 2023 14:43:08 +0000 Subject: [PATCH 09/44] TASK: Updating SDK --- changes.md | 29 + ...ResourceByProjectKeyMeOrdersQuotesTest.php | 85 +- .../ResourceByProjectKeyMeOrdersTest.php | 2 +- lib/commercetools-api/docs/RequestBuilder.md | 158 ++- .../ByProjectKeyMeOrdersQuotesPost.php | 34 +- .../Resource/ResourceByProjectKeyMeOrders.php | 2 +- .../Cart/CartAddItemShippingAddressAction.php | 2 +- ...artAddItemShippingAddressActionBuilder.php | 2 +- .../CartAddItemShippingAddressActionModel.php | 2 +- .../src/Models/Cart/CustomLineItem.php | 4 +- .../src/Models/Cart/CustomLineItemBuilder.php | 4 +- .../src/Models/Cart/CustomLineItemModel.php | 4 +- .../src/Models/Cart/LineItem.php | 8 +- .../src/Models/Cart/LineItemBuilder.php | 8 +- .../src/Models/Cart/LineItemModel.php | 8 +- .../src/Models/Me/MyOrderFromCartDraft.php | 4 +- .../Models/Me/MyOrderFromCartDraftBuilder.php | 4 +- .../Models/Me/MyOrderFromCartDraftModel.php | 4 +- .../src/Models/Me/MyOrderFromQuoteDraft.php | 6 +- .../Me/MyOrderFromQuoteDraftBuilder.php | 6 +- .../Models/Me/MyOrderFromQuoteDraftModel.php | 6 +- .../Models/Message/DeliveryAddedMessage.php | 2 +- .../Message/DeliveryAddedMessageBuilder.php | 2 +- .../Message/DeliveryAddedMessageModel.php | 2 +- .../Message/DeliveryAddedMessagePayload.php | 2 +- .../DeliveryAddedMessagePayloadBuilder.php | 2 +- .../DeliveryAddedMessagePayloadModel.php | 2 +- .../OrderPurchaseOrderNumberSetMessage.php | 4 +- ...erPurchaseOrderNumberSetMessageBuilder.php | 4 +- ...rderPurchaseOrderNumberSetMessageModel.php | 4 +- ...erPurchaseOrderNumberSetMessagePayload.php | 4 +- ...aseOrderNumberSetMessagePayloadBuilder.php | 4 +- ...chaseOrderNumberSetMessagePayloadModel.php | 4 +- .../Models/Order/CustomLineItemReturnItem.php | 15 + .../Order/CustomLineItemReturnItemBuilder.php | 22 +- .../Order/CustomLineItemReturnItemModel.php | 22 +- .../src/Models/Order/Delivery.php | 11 +- .../src/Models/Order/DeliveryBuilder.php | 11 +- .../src/Models/Order/DeliveryDraft.php | 10 +- .../src/Models/Order/DeliveryDraftBuilder.php | 10 +- .../src/Models/Order/DeliveryDraftModel.php | 10 +- .../src/Models/Order/DeliveryItem.php | 4 +- .../src/Models/Order/DeliveryItemBuilder.php | 4 +- .../src/Models/Order/DeliveryItemModel.php | 4 +- .../src/Models/Order/DeliveryModel.php | 11 +- .../src/Models/Order/ItemState.php | 4 + .../src/Models/Order/ItemStateBuilder.php | 4 + .../src/Models/Order/ItemStateModel.php | 4 + .../src/Models/Order/LineItemReturnItem.php | 15 + .../Order/LineItemReturnItemBuilder.php | 22 +- .../Models/Order/LineItemReturnItemModel.php | 22 +- .../src/Models/Order/Order.php | 498 ++++---- .../Models/Order/OrderAddDeliveryAction.php | 33 +- .../Order/OrderAddDeliveryActionBuilder.php | 49 +- .../Order/OrderAddDeliveryActionModel.php | 67 +- .../OrderAddItemShippingAddressAction.php | 5 +- ...derAddItemShippingAddressActionBuilder.php | 5 +- ...OrderAddItemShippingAddressActionModel.php | 5 +- .../Order/OrderAddParcelToDeliveryAction.php | 14 +- .../OrderAddParcelToDeliveryActionBuilder.php | 14 +- .../OrderAddParcelToDeliveryActionModel.php | 14 +- .../Models/Order/OrderAddPaymentAction.php | 3 +- .../Order/OrderAddPaymentActionBuilder.php | 3 +- .../Order/OrderAddPaymentActionModel.php | 3 +- .../Models/Order/OrderAddReturnInfoAction.php | 8 + .../Order/OrderAddReturnInfoActionBuilder.php | 8 + .../Order/OrderAddReturnInfoActionModel.php | 8 + .../src/Models/Order/OrderBuilder.php | 833 +++++++------ .../Order/OrderChangeOrderStateAction.php | 2 + .../OrderChangeOrderStateActionBuilder.php | 2 + .../OrderChangeOrderStateActionModel.php | 2 + .../Order/OrderChangePaymentStateAction.php | 2 + .../OrderChangePaymentStateActionBuilder.php | 2 + .../OrderChangePaymentStateActionModel.php | 2 + .../Order/OrderChangeShipmentStateAction.php | 2 + .../OrderChangeShipmentStateActionBuilder.php | 2 + .../OrderChangeShipmentStateActionModel.php | 2 + .../src/Models/Order/OrderFromCartDraft.php | 36 +- .../Order/OrderFromCartDraftBuilder.php | 36 +- .../Models/Order/OrderFromCartDraftModel.php | 36 +- .../src/Models/Order/OrderFromQuoteDraft.php | 20 +- .../Order/OrderFromQuoteDraftBuilder.php | 20 +- .../Models/Order/OrderFromQuoteDraftModel.php | 20 +- .../OrderImportCustomLineItemStateAction.php | 4 + ...ImportCustomLineItemStateActionBuilder.php | 4 + ...erImportCustomLineItemStateActionModel.php | 4 + .../src/Models/Order/OrderImportDraft.php | 6 +- .../Models/Order/OrderImportDraftBuilder.php | 6 +- .../Models/Order/OrderImportDraftModel.php | 6 +- .../Order/OrderImportLineItemStateAction.php | 4 + .../OrderImportLineItemStateActionBuilder.php | 4 + .../OrderImportLineItemStateActionModel.php | 4 + .../src/Models/Order/OrderModel.php | 1108 +++++++++-------- .../Models/Order/OrderPagedQueryResponse.php | 30 +- .../Order/OrderPagedQueryResponseBuilder.php | 50 +- .../Order/OrderPagedQueryResponseModel.php | 68 +- .../src/Models/Order/OrderReference.php | 15 + .../Models/Order/OrderReferenceBuilder.php | 4 +- .../src/Models/Order/OrderReferenceModel.php | 4 +- .../Order/OrderRemoveDeliveryAction.php | 6 +- .../OrderRemoveDeliveryActionBuilder.php | 6 +- .../Order/OrderRemoveDeliveryActionModel.php | 6 +- .../OrderRemoveItemShippingAddressAction.php | 2 + ...RemoveItemShippingAddressActionBuilder.php | 2 + ...erRemoveItemShippingAddressActionModel.php | 2 + .../OrderRemoveParcelFromDeliveryAction.php | 6 +- ...rRemoveParcelFromDeliveryActionBuilder.php | 6 +- ...derRemoveParcelFromDeliveryActionModel.php | 6 +- .../Models/Order/OrderRemovePaymentAction.php | 2 +- .../Order/OrderRemovePaymentActionBuilder.php | 2 +- .../Order/OrderRemovePaymentActionModel.php | 2 +- .../Models/Order/OrderResourceIdentifier.php | 25 + .../Order/OrderResourceIdentifierBuilder.php | 4 +- .../Order/OrderResourceIdentifierModel.php | 4 +- .../Order/OrderSetBillingAddressAction.php | 5 +- .../OrderSetBillingAddressActionBuilder.php | 5 +- .../OrderSetBillingAddressActionModel.php | 5 +- ...rderSetCustomLineItemCustomFieldAction.php | 2 + ...CustomLineItemCustomFieldActionBuilder.php | 2 + ...etCustomLineItemCustomFieldActionModel.php | 2 + ...OrderSetCustomLineItemCustomTypeAction.php | 8 +- ...tCustomLineItemCustomTypeActionBuilder.php | 8 +- ...SetCustomLineItemCustomTypeActionModel.php | 8 +- ...SetCustomLineItemShippingDetailsAction.php | 5 +- ...omLineItemShippingDetailsActionBuilder.php | 5 +- ...stomLineItemShippingDetailsActionModel.php | 5 +- .../Order/OrderSetCustomerEmailAction.php | 3 + .../OrderSetCustomerEmailActionBuilder.php | 3 + .../OrderSetCustomerEmailActionModel.php | 3 + .../Models/Order/OrderSetCustomerIdAction.php | 3 + .../Order/OrderSetCustomerIdActionBuilder.php | 3 + .../Order/OrderSetCustomerIdActionModel.php | 3 + .../Order/OrderSetDeliveryAddressAction.php | 11 +- .../OrderSetDeliveryAddressActionBuilder.php | 11 +- .../OrderSetDeliveryAddressActionModel.php | 11 +- ...derSetDeliveryAddressCustomFieldAction.php | 6 +- ...eliveryAddressCustomFieldActionBuilder.php | 6 +- ...tDeliveryAddressCustomFieldActionModel.php | 6 +- ...rderSetDeliveryAddressCustomTypeAction.php | 12 +- ...DeliveryAddressCustomTypeActionBuilder.php | 12 +- ...etDeliveryAddressCustomTypeActionModel.php | 12 +- .../OrderSetDeliveryCustomFieldAction.php | 6 +- ...derSetDeliveryCustomFieldActionBuilder.php | 6 +- ...OrderSetDeliveryCustomFieldActionModel.php | 6 +- .../OrderSetDeliveryCustomTypeAction.php | 6 +- ...rderSetDeliveryCustomTypeActionBuilder.php | 6 +- .../OrderSetDeliveryCustomTypeActionModel.php | 6 +- .../Order/OrderSetDeliveryItemsAction.php | 9 +- .../OrderSetDeliveryItemsActionBuilder.php | 9 +- .../OrderSetDeliveryItemsActionModel.php | 9 +- ...etItemShippingAddressCustomFieldAction.php | 2 + ...hippingAddressCustomFieldActionBuilder.php | 2 + ...mShippingAddressCustomFieldActionModel.php | 2 + ...SetItemShippingAddressCustomTypeAction.php | 2 + ...ShippingAddressCustomTypeActionBuilder.php | 2 + ...emShippingAddressCustomTypeActionModel.php | 2 + .../OrderSetLineItemCustomTypeAction.php | 6 +- ...rderSetLineItemCustomTypeActionBuilder.php | 6 +- .../OrderSetLineItemCustomTypeActionModel.php | 6 +- .../OrderSetLineItemShippingDetailsAction.php | 3 +- ...etLineItemShippingDetailsActionBuilder.php | 3 +- ...rSetLineItemShippingDetailsActionModel.php | 3 +- .../src/Models/Order/OrderSetLocaleAction.php | 4 + .../Order/OrderSetLocaleActionBuilder.php | 4 + .../Order/OrderSetLocaleActionModel.php | 4 + .../Order/OrderSetOrderNumberAction.php | 4 + .../OrderSetOrderNumberActionBuilder.php | 4 + .../Order/OrderSetOrderNumberActionModel.php | 4 + .../Order/OrderSetParcelCustomFieldAction.php | 6 +- ...OrderSetParcelCustomFieldActionBuilder.php | 6 +- .../OrderSetParcelCustomFieldActionModel.php | 6 +- .../Order/OrderSetParcelCustomTypeAction.php | 6 +- .../OrderSetParcelCustomTypeActionBuilder.php | 6 +- .../OrderSetParcelCustomTypeActionModel.php | 6 +- .../Order/OrderSetParcelItemsAction.php | 9 +- .../OrderSetParcelItemsActionBuilder.php | 9 +- .../Order/OrderSetParcelItemsActionModel.php | 9 +- .../OrderSetParcelMeasurementsAction.php | 9 +- ...rderSetParcelMeasurementsActionBuilder.php | 9 +- .../OrderSetParcelMeasurementsActionModel.php | 9 +- .../OrderSetParcelTrackingDataAction.php | 9 +- ...rderSetParcelTrackingDataActionBuilder.php | 9 +- .../OrderSetParcelTrackingDataActionModel.php | 9 +- .../OrderSetPurchaseOrderNumberAction.php | 4 +- ...derSetPurchaseOrderNumberActionBuilder.php | 4 +- ...OrderSetPurchaseOrderNumberActionModel.php | 4 +- .../Models/Order/OrderSetReturnInfoAction.php | 3 + .../Order/OrderSetReturnInfoActionBuilder.php | 3 + .../Order/OrderSetReturnInfoActionModel.php | 3 + .../OrderSetReturnItemCustomFieldAction.php | 2 + ...rSetReturnItemCustomFieldActionBuilder.php | 2 + ...derSetReturnItemCustomFieldActionModel.php | 2 + .../OrderSetReturnItemCustomTypeAction.php | 8 +- ...erSetReturnItemCustomTypeActionBuilder.php | 8 +- ...rderSetReturnItemCustomTypeActionModel.php | 8 +- .../OrderSetReturnPaymentStateAction.php | 4 + ...rderSetReturnPaymentStateActionBuilder.php | 4 + .../OrderSetReturnPaymentStateActionModel.php | 4 + .../OrderSetReturnShipmentStateAction.php | 4 + ...derSetReturnShipmentStateActionBuilder.php | 4 + ...OrderSetReturnShipmentStateActionModel.php | 4 + .../Order/OrderSetShippingAddressAction.php | 5 +- .../OrderSetShippingAddressActionBuilder.php | 5 +- .../OrderSetShippingAddressActionModel.php | 5 +- .../src/Models/Order/OrderSetStoreAction.php | 4 +- .../Order/OrderSetStoreActionBuilder.php | 4 +- .../Models/Order/OrderSetStoreActionModel.php | 4 +- ...derTransitionCustomLineItemStateAction.php | 10 +- ...sitionCustomLineItemStateActionBuilder.php | 10 +- ...ansitionCustomLineItemStateActionModel.php | 10 +- .../OrderTransitionLineItemStateAction.php | 10 +- ...erTransitionLineItemStateActionBuilder.php | 10 +- ...rderTransitionLineItemStateActionModel.php | 10 +- .../Order/OrderTransitionStateAction.php | 5 +- .../OrderTransitionStateActionBuilder.php | 5 +- .../Order/OrderTransitionStateActionModel.php | 5 +- .../src/Models/Order/OrderUpdate.php | 2 +- .../src/Models/Order/OrderUpdateBuilder.php | 2 +- .../OrderUpdateItemShippingAddressAction.php | 4 +- ...UpdateItemShippingAddressActionBuilder.php | 4 +- ...erUpdateItemShippingAddressActionModel.php | 4 +- .../src/Models/Order/OrderUpdateModel.php | 2 +- .../Order/OrderUpdateSyncInfoAction.php | 26 +- .../OrderUpdateSyncInfoActionBuilder.php | 42 +- .../Order/OrderUpdateSyncInfoActionModel.php | 62 +- .../src/Models/Order/Parcel.php | 10 +- .../src/Models/Order/ParcelBuilder.php | 10 +- .../src/Models/Order/ParcelDraft.php | 8 +- .../src/Models/Order/ParcelDraftBuilder.php | 8 +- .../src/Models/Order/ParcelDraftModel.php | 8 +- .../src/Models/Order/ParcelMeasurements.php | 8 + .../Order/ParcelMeasurementsBuilder.php | 8 + .../Models/Order/ParcelMeasurementsModel.php | 8 + .../src/Models/Order/ParcelModel.php | 10 +- .../src/Models/Order/PaymentInfo.php | 2 + .../src/Models/Order/PaymentInfoBuilder.php | 2 + .../src/Models/Order/PaymentInfoModel.php | 2 + .../src/Models/Order/ReturnInfo.php | 6 +- .../src/Models/Order/ReturnInfoBuilder.php | 6 +- .../src/Models/Order/ReturnInfoDraft.php | 6 +- .../Models/Order/ReturnInfoDraftBuilder.php | 6 +- .../src/Models/Order/ReturnInfoDraftModel.php | 6 +- .../src/Models/Order/ReturnInfoModel.php | 6 +- .../src/Models/Order/ReturnItem.php | 20 +- .../src/Models/Order/ReturnItemBuilder.php | 20 +- .../src/Models/Order/ReturnItemDraft.php | 15 +- .../Models/Order/ReturnItemDraftBuilder.php | 15 +- .../src/Models/Order/ReturnItemDraftModel.php | 15 +- .../src/Models/Order/ReturnItemModel.php | 20 +- .../Models/Order/StagedOrderUpdateAction.php | 2 + .../Order/StagedOrderUpdateActionBuilder.php | 4 + .../Order/StagedOrderUpdateActionModel.php | 6 + .../src/Models/Order/SyncInfo.php | 6 +- .../src/Models/Order/SyncInfoBuilder.php | 6 +- .../src/Models/Order/SyncInfoModel.php | 6 +- .../src/Models/Order/TrackingData.php | 13 +- .../src/Models/Order/TrackingDataBuilder.php | 13 +- .../src/Models/Order/TrackingDataModel.php | 13 +- .../src/Models/OrderEdit/OrderEdit.php | 111 +- .../OrderEditAddStagedActionAction.php | 2 + .../OrderEditAddStagedActionActionBuilder.php | 2 + .../OrderEditAddStagedActionActionModel.php | 2 + .../src/Models/OrderEdit/OrderEditApplied.php | 14 + .../OrderEdit/OrderEditAppliedBuilder.php | 6 + .../OrderEdit/OrderEditAppliedModel.php | 8 + .../src/Models/OrderEdit/OrderEditApply.php | 4 + .../OrderEdit/OrderEditApplyBuilder.php | 4 + .../Models/OrderEdit/OrderEditApplyModel.php | 4 + .../src/Models/OrderEdit/OrderEditBuilder.php | 177 +-- .../src/Models/OrderEdit/OrderEditDraft.php | 15 +- .../OrderEdit/OrderEditDraftBuilder.php | 15 +- .../Models/OrderEdit/OrderEditDraftModel.php | 15 +- .../src/Models/OrderEdit/OrderEditModel.php | 205 +-- .../OrderEdit/OrderEditNotProcessed.php | 7 + .../OrderEdit/OrderEditNotProcessedModel.php | 2 + .../OrderEdit/OrderEditPagedQueryResponse.php | 30 +- .../OrderEditPagedQueryResponseBuilder.php | 50 +- .../OrderEditPagedQueryResponseModel.php | 68 +- .../OrderEdit/OrderEditPreviewFailure.php | 2 + .../OrderEditPreviewFailureBuilder.php | 2 + .../OrderEditPreviewFailureModel.php | 2 + .../OrderEdit/OrderEditPreviewSuccess.php | 4 + .../OrderEditPreviewSuccessBuilder.php | 4 + .../OrderEditPreviewSuccessModel.php | 4 + .../Models/OrderEdit/OrderEditReference.php | 2 +- .../OrderEdit/OrderEditReferenceBuilder.php | 2 +- .../OrderEdit/OrderEditReferenceModel.php | 2 +- .../OrderEdit/OrderEditResourceIdentifier.php | 4 +- .../OrderEditResourceIdentifierBuilder.php | 4 +- .../OrderEditResourceIdentifierModel.php | 4 +- .../OrderEdit/OrderEditSetCommentAction.php | 3 + .../OrderEditSetCommentActionBuilder.php | 3 + .../OrderEditSetCommentActionModel.php | 3 + .../OrderEditSetCustomTypeAction.php | 6 +- .../OrderEditSetCustomTypeActionBuilder.php | 6 +- .../OrderEditSetCustomTypeActionModel.php | 6 +- .../OrderEdit/OrderEditSetKeyAction.php | 3 +- .../OrderEditSetKeyActionBuilder.php | 3 +- .../OrderEdit/OrderEditSetKeyActionModel.php | 3 +- .../OrderEditSetStagedActionsAction.php | 2 +- ...OrderEditSetStagedActionsActionBuilder.php | 2 +- .../OrderEditSetStagedActionsActionModel.php | 2 +- .../src/Models/OrderEdit/OrderEditUpdate.php | 7 + .../OrderEdit/OrderEditUpdateBuilder.php | 7 + .../Models/OrderEdit/OrderEditUpdateModel.php | 7 + .../src/Models/OrderEdit/OrderExcerpt.php | 6 + .../Models/OrderEdit/OrderExcerptBuilder.php | 6 + .../Models/OrderEdit/OrderExcerptModel.php | 6 + .../StagedOrderAddCustomLineItemAction.php | 48 +- ...gedOrderAddCustomLineItemActionBuilder.php | 105 +- ...tagedOrderAddCustomLineItemActionModel.php | 102 +- .../StagedOrderAddDeliveryAction.php | 15 +- .../StagedOrderAddDeliveryActionBuilder.php | 15 +- .../StagedOrderAddDeliveryActionModel.php | 15 +- .../StagedOrderAddDiscountCodeAction.php | 2 + ...tagedOrderAddDiscountCodeActionBuilder.php | 2 + .../StagedOrderAddDiscountCodeActionModel.php | 2 + ...tagedOrderAddItemShippingAddressAction.php | 5 +- ...derAddItemShippingAddressActionBuilder.php | 5 +- ...OrderAddItemShippingAddressActionModel.php | 5 +- .../StagedOrderAddLineItemAction.php | 114 +- .../StagedOrderAddLineItemActionBuilder.php | 227 ++-- .../StagedOrderAddLineItemActionModel.php | 274 ++-- .../StagedOrderAddParcelToDeliveryAction.php | 14 +- ...dOrderAddParcelToDeliveryActionBuilder.php | 14 +- ...gedOrderAddParcelToDeliveryActionModel.php | 14 +- .../OrderEdit/StagedOrderAddPaymentAction.php | 3 +- .../StagedOrderAddPaymentActionBuilder.php | 3 +- .../StagedOrderAddPaymentActionModel.php | 3 +- .../StagedOrderAddReturnInfoAction.php | 8 + .../StagedOrderAddReturnInfoActionBuilder.php | 8 + .../StagedOrderAddReturnInfoActionModel.php | 8 + .../StagedOrderAddShoppingListAction.php | 22 +- ...tagedOrderAddShoppingListActionBuilder.php | 48 +- .../StagedOrderAddShoppingListActionModel.php | 48 +- .../Models/OrderEdit/StagedOrderBuilder.php | 833 +++++++------ ...edOrderChangeCustomLineItemMoneyAction.php | 6 +- ...ChangeCustomLineItemMoneyActionBuilder.php | 6 +- ...erChangeCustomLineItemMoneyActionModel.php | 6 +- ...rderChangeCustomLineItemQuantityAction.php | 5 + ...ngeCustomLineItemQuantityActionBuilder.php | 5 + ...hangeCustomLineItemQuantityActionModel.php | 5 + ...tagedOrderChangeLineItemQuantityAction.php | 8 +- ...derChangeLineItemQuantityActionBuilder.php | 8 +- ...OrderChangeLineItemQuantityActionModel.php | 8 +- .../StagedOrderChangeOrderStateAction.php | 2 + ...agedOrderChangeOrderStateActionBuilder.php | 2 + ...StagedOrderChangeOrderStateActionModel.php | 2 + .../StagedOrderChangePaymentStateAction.php | 2 + ...edOrderChangePaymentStateActionBuilder.php | 2 + ...agedOrderChangePaymentStateActionModel.php | 2 + .../StagedOrderChangeShipmentStateAction.php | 2 + ...dOrderChangeShipmentStateActionBuilder.php | 2 + ...gedOrderChangeShipmentStateActionModel.php | 2 + ...gedOrderChangeTaxCalculationModeAction.php | 2 +- ...rChangeTaxCalculationModeActionBuilder.php | 2 +- ...derChangeTaxCalculationModeActionModel.php | 2 +- .../StagedOrderChangeTaxModeAction.php | 2 +- .../StagedOrderChangeTaxModeActionBuilder.php | 2 +- .../StagedOrderChangeTaxModeActionModel.php | 2 +- ...StagedOrderChangeTaxRoundingModeAction.php | 2 +- ...rderChangeTaxRoundingModeActionBuilder.php | 2 +- ...dOrderChangeTaxRoundingModeActionModel.php | 2 +- ...edOrderImportCustomLineItemStateAction.php | 4 + ...ImportCustomLineItemStateActionBuilder.php | 4 + ...erImportCustomLineItemStateActionModel.php | 4 + .../StagedOrderImportLineItemStateAction.php | 4 + ...dOrderImportLineItemStateActionBuilder.php | 4 + ...gedOrderImportLineItemStateActionModel.php | 4 + .../src/Models/OrderEdit/StagedOrderModel.php | 1108 +++++++++-------- .../StagedOrderRemoveCustomLineItemAction.php | 2 + ...OrderRemoveCustomLineItemActionBuilder.php | 2 + ...edOrderRemoveCustomLineItemActionModel.php | 2 + .../StagedOrderRemoveDeliveryAction.php | 6 +- ...StagedOrderRemoveDeliveryActionBuilder.php | 6 +- .../StagedOrderRemoveDeliveryActionModel.php | 6 +- .../StagedOrderRemoveDiscountCodeAction.php | 2 +- ...edOrderRemoveDiscountCodeActionBuilder.php | 2 +- ...agedOrderRemoveDiscountCodeActionModel.php | 2 +- ...edOrderRemoveItemShippingAddressAction.php | 2 + ...RemoveItemShippingAddressActionBuilder.php | 2 + ...erRemoveItemShippingAddressActionModel.php | 2 + .../StagedOrderRemoveLineItemAction.php | 9 +- ...StagedOrderRemoveLineItemActionBuilder.php | 9 +- .../StagedOrderRemoveLineItemActionModel.php | 9 +- ...gedOrderRemoveParcelFromDeliveryAction.php | 6 +- ...rRemoveParcelFromDeliveryActionBuilder.php | 6 +- ...derRemoveParcelFromDeliveryActionModel.php | 6 +- .../StagedOrderRemovePaymentAction.php | 2 +- .../StagedOrderRemovePaymentActionBuilder.php | 2 +- .../StagedOrderRemovePaymentActionModel.php | 2 +- .../StagedOrderSetBillingAddressAction.php | 5 +- ...gedOrderSetBillingAddressActionBuilder.php | 5 +- ...tagedOrderSetBillingAddressActionModel.php | 5 +- .../OrderEdit/StagedOrderSetCountryAction.php | 5 + .../StagedOrderSetCountryActionBuilder.php | 5 + .../StagedOrderSetCountryActionModel.php | 5 + ...rderSetCustomLineItemCustomFieldAction.php | 2 + ...CustomLineItemCustomFieldActionBuilder.php | 2 + ...etCustomLineItemCustomFieldActionModel.php | 2 + ...OrderSetCustomLineItemCustomTypeAction.php | 8 +- ...tCustomLineItemCustomTypeActionBuilder.php | 8 +- ...SetCustomLineItemCustomTypeActionModel.php | 8 +- ...SetCustomLineItemShippingDetailsAction.php | 5 +- ...omLineItemShippingDetailsActionBuilder.php | 5 +- ...stomLineItemShippingDetailsActionModel.php | 5 +- ...dOrderSetCustomLineItemTaxAmountAction.php | 10 +- ...etCustomLineItemTaxAmountActionBuilder.php | 10 +- ...rSetCustomLineItemTaxAmountActionModel.php | 10 +- ...gedOrderSetCustomLineItemTaxRateAction.php | 5 +- ...rSetCustomLineItemTaxRateActionBuilder.php | 5 +- ...derSetCustomLineItemTaxRateActionModel.php | 5 +- ...agedOrderSetCustomShippingMethodAction.php | 8 +- ...erSetCustomShippingMethodActionBuilder.php | 8 +- ...rderSetCustomShippingMethodActionModel.php | 8 +- .../StagedOrderSetCustomTypeAction.php | 6 +- .../StagedOrderSetCustomTypeActionBuilder.php | 6 +- .../StagedOrderSetCustomTypeActionModel.php | 6 +- .../StagedOrderSetCustomerEmailAction.php | 3 + ...agedOrderSetCustomerEmailActionBuilder.php | 3 + ...StagedOrderSetCustomerEmailActionModel.php | 3 + .../StagedOrderSetCustomerGroupAction.php | 3 +- ...agedOrderSetCustomerGroupActionBuilder.php | 3 +- ...StagedOrderSetCustomerGroupActionModel.php | 3 +- .../StagedOrderSetCustomerIdAction.php | 3 + .../StagedOrderSetCustomerIdActionBuilder.php | 3 + .../StagedOrderSetCustomerIdActionModel.php | 3 + .../StagedOrderSetDeliveryAddressAction.php | 11 +- ...edOrderSetDeliveryAddressActionBuilder.php | 11 +- ...agedOrderSetDeliveryAddressActionModel.php | 11 +- ...derSetDeliveryAddressCustomFieldAction.php | 6 +- ...eliveryAddressCustomFieldActionBuilder.php | 6 +- ...tDeliveryAddressCustomFieldActionModel.php | 6 +- ...rderSetDeliveryAddressCustomTypeAction.php | 12 +- ...DeliveryAddressCustomTypeActionBuilder.php | 12 +- ...etDeliveryAddressCustomTypeActionModel.php | 12 +- ...tagedOrderSetDeliveryCustomFieldAction.php | 6 +- ...derSetDeliveryCustomFieldActionBuilder.php | 6 +- ...OrderSetDeliveryCustomFieldActionModel.php | 6 +- ...StagedOrderSetDeliveryCustomTypeAction.php | 6 +- ...rderSetDeliveryCustomTypeActionBuilder.php | 6 +- ...dOrderSetDeliveryCustomTypeActionModel.php | 6 +- .../StagedOrderSetDeliveryItemsAction.php | 9 +- ...agedOrderSetDeliveryItemsActionBuilder.php | 9 +- ...StagedOrderSetDeliveryItemsActionModel.php | 9 +- .../StagedOrderSetDirectDiscountsAction.php | 36 + ...edOrderSetDirectDiscountsActionBuilder.php | 70 ++ ...rderSetDirectDiscountsActionCollection.php | 56 + ...agedOrderSetDirectDiscountsActionModel.php | 100 ++ ...etItemShippingAddressCustomFieldAction.php | 2 + ...hippingAddressCustomFieldActionBuilder.php | 2 + ...mShippingAddressCustomFieldActionModel.php | 2 + ...SetItemShippingAddressCustomTypeAction.php | 2 + ...ShippingAddressCustomTypeActionBuilder.php | 2 + ...emShippingAddressCustomTypeActionModel.php | 2 + ...StagedOrderSetLineItemCustomTypeAction.php | 6 +- ...rderSetLineItemCustomTypeActionBuilder.php | 6 +- ...dOrderSetLineItemCustomTypeActionModel.php | 6 +- ...erSetLineItemDistributionChannelAction.php | 6 +- ...neItemDistributionChannelActionBuilder.php | 6 +- ...LineItemDistributionChannelActionModel.php | 6 +- .../StagedOrderSetLineItemPriceAction.php | 3 +- ...agedOrderSetLineItemPriceActionBuilder.php | 3 +- ...StagedOrderSetLineItemPriceActionModel.php | 3 +- ...dOrderSetLineItemShippingDetailsAction.php | 3 +- ...etLineItemShippingDetailsActionBuilder.php | 3 +- ...rSetLineItemShippingDetailsActionModel.php | 3 +- .../StagedOrderSetLineItemTaxAmountAction.php | 10 +- ...OrderSetLineItemTaxAmountActionBuilder.php | 10 +- ...edOrderSetLineItemTaxAmountActionModel.php | 10 +- .../StagedOrderSetLineItemTaxRateAction.php | 3 +- ...edOrderSetLineItemTaxRateActionBuilder.php | 3 +- ...agedOrderSetLineItemTaxRateActionModel.php | 3 +- ...StagedOrderSetLineItemTotalPriceAction.php | 3 + ...rderSetLineItemTotalPriceActionBuilder.php | 3 + ...dOrderSetLineItemTotalPriceActionModel.php | 3 + .../OrderEdit/StagedOrderSetLocaleAction.php | 4 + .../StagedOrderSetLocaleActionBuilder.php | 4 + .../StagedOrderSetLocaleActionModel.php | 4 + .../StagedOrderSetOrderNumberAction.php | 3 + ...StagedOrderSetOrderNumberActionBuilder.php | 3 + .../StagedOrderSetOrderNumberActionModel.php | 3 + .../StagedOrderSetOrderTotalTaxAction.php | 4 +- ...agedOrderSetOrderTotalTaxActionBuilder.php | 4 +- ...StagedOrderSetOrderTotalTaxActionModel.php | 4 +- .../StagedOrderSetParcelCustomFieldAction.php | 6 +- ...OrderSetParcelCustomFieldActionBuilder.php | 6 +- ...edOrderSetParcelCustomFieldActionModel.php | 6 +- .../StagedOrderSetParcelCustomTypeAction.php | 6 +- ...dOrderSetParcelCustomTypeActionBuilder.php | 6 +- ...gedOrderSetParcelCustomTypeActionModel.php | 6 +- .../StagedOrderSetParcelItemsAction.php | 9 +- ...StagedOrderSetParcelItemsActionBuilder.php | 9 +- .../StagedOrderSetParcelItemsActionModel.php | 9 +- ...StagedOrderSetParcelMeasurementsAction.php | 9 +- ...rderSetParcelMeasurementsActionBuilder.php | 9 +- ...dOrderSetParcelMeasurementsActionModel.php | 9 +- ...StagedOrderSetParcelTrackingDataAction.php | 9 +- ...rderSetParcelTrackingDataActionBuilder.php | 9 +- ...dOrderSetParcelTrackingDataActionModel.php | 9 +- ...tagedOrderSetPurchaseOrderNumberAction.php | 3 +- ...derSetPurchaseOrderNumberActionBuilder.php | 3 +- ...OrderSetPurchaseOrderNumberActionModel.php | 3 +- .../StagedOrderSetReturnInfoAction.php | 3 + .../StagedOrderSetReturnInfoActionBuilder.php | 3 + .../StagedOrderSetReturnInfoActionModel.php | 3 + ...gedOrderSetReturnItemCustomFieldAction.php | 2 + ...rSetReturnItemCustomFieldActionBuilder.php | 2 + ...derSetReturnItemCustomFieldActionModel.php | 2 + ...agedOrderSetReturnItemCustomTypeAction.php | 8 +- ...erSetReturnItemCustomTypeActionBuilder.php | 8 +- ...rderSetReturnItemCustomTypeActionModel.php | 8 +- ...StagedOrderSetReturnPaymentStateAction.php | 4 + ...rderSetReturnPaymentStateActionBuilder.php | 4 + ...dOrderSetReturnPaymentStateActionModel.php | 4 + ...tagedOrderSetReturnShipmentStateAction.php | 4 + ...derSetReturnShipmentStateActionBuilder.php | 4 + ...OrderSetReturnShipmentStateActionModel.php | 4 + .../StagedOrderSetShippingAddressAction.php | 5 +- ...edOrderSetShippingAddressActionBuilder.php | 5 +- ...agedOrderSetShippingAddressActionModel.php | 5 +- ...ngAddressAndCustomShippingMethodAction.php | 12 +- ...ssAndCustomShippingMethodActionBuilder.php | 12 +- ...ressAndCustomShippingMethodActionModel.php | 12 +- ...ShippingAddressAndShippingMethodAction.php | 8 +- ...gAddressAndShippingMethodActionBuilder.php | 8 +- ...ingAddressAndShippingMethodActionModel.php | 8 +- .../StagedOrderSetShippingMethodAction.php | 5 +- ...gedOrderSetShippingMethodActionBuilder.php | 5 +- ...tagedOrderSetShippingMethodActionModel.php | 5 +- ...dOrderSetShippingMethodTaxAmountAction.php | 7 +- ...etShippingMethodTaxAmountActionBuilder.php | 7 +- ...rSetShippingMethodTaxAmountActionModel.php | 7 +- ...gedOrderSetShippingMethodTaxRateAction.php | 3 +- ...rSetShippingMethodTaxRateActionBuilder.php | 3 +- ...derSetShippingMethodTaxRateActionModel.php | 3 +- .../StagedOrderSetShippingRateInputAction.php | 7 +- ...OrderSetShippingRateInputActionBuilder.php | 7 +- ...edOrderSetShippingRateInputActionModel.php | 7 +- .../OrderEdit/StagedOrderSetStoreAction.php | 33 + .../StagedOrderSetStoreActionBuilder.php | 78 ++ .../StagedOrderSetStoreActionCollection.php | 56 + .../StagedOrderSetStoreActionModel.php | 99 ++ ...derTransitionCustomLineItemStateAction.php | 10 +- ...sitionCustomLineItemStateActionBuilder.php | 10 +- ...ansitionCustomLineItemStateActionModel.php | 10 +- ...agedOrderTransitionLineItemStateAction.php | 10 +- ...erTransitionLineItemStateActionBuilder.php | 10 +- ...rderTransitionLineItemStateActionModel.php | 10 +- .../StagedOrderTransitionStateAction.php | 5 +- ...tagedOrderTransitionStateActionBuilder.php | 5 +- .../StagedOrderTransitionStateActionModel.php | 5 +- ...edOrderUpdateItemShippingAddressAction.php | 4 +- ...UpdateItemShippingAddressActionBuilder.php | 4 +- ...erUpdateItemShippingAddressActionModel.php | 4 +- .../StagedOrderUpdateSyncInfoAction.php | 26 +- ...StagedOrderUpdateSyncInfoActionBuilder.php | 42 +- .../StagedOrderUpdateSyncInfoActionModel.php | 62 +- references.txt | 1 + 559 files changed, 6706 insertions(+), 3796 deletions(-) create mode 100644 lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsAction.php create mode 100644 lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionBuilder.php create mode 100644 lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionCollection.php create mode 100644 lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionModel.php create mode 100644 lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreAction.php create mode 100644 lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionBuilder.php create mode 100644 lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionCollection.php create mode 100644 lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionModel.php diff --git a/changes.md b/changes.md index 9fee46c54e9..7fb2d322fbc 100644 --- a/changes.md +++ b/changes.md @@ -14,7 +14,34 @@ - added property `stores` to type `CartDiscount` - added property `stores` to type `CartDiscountDraft` +- added property `directDiscounts` to type `StagedOrder` +- added property `shippingDetails` to type `StagedOrderAddCustomLineItemAction` - added property `shippingKey` to type `StagedOrderAddDeliveryAction` +- added property `inventoryMode` to type `StagedOrderAddLineItemAction` +- added property `directDiscounts` to type `Order` +
+ + +
+Required Property(s) + +- :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required +- :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required +- :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required +- :warning: changed property `shipmentState` of type `OrderChangeShipmentStateAction` to be required +
+ + +
+Changed Property(s) + +- :warning: changed property `country` of type `StagedOrder` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `StagedOrder` from type `string` to `Locale` +- :warning: changed property `country` of type `StagedOrderSetCountryAction` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `StagedOrderSetLocaleAction` from type `string` to `Locale` +- :warning: changed property `country` of type `Order` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `Order` from type `string` to `Locale` +- :warning: changed property `locale` of type `OrderSetLocaleAction` from type `string` to `Locale`
@@ -46,6 +73,8 @@ - added type `GraphQLMaxCartDiscountsReachedError` - added type `GraphQLMaxStoreReferencesReachedError` - added type `GraphQLStoreCartDiscountsLimitReachedError` +- added type `StagedOrderSetDirectDiscountsAction` +- added type `StagedOrderSetStoreAction` diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersQuotesTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersQuotesTest.php index dbd8e00fb07..ce799139911 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersQuotesTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersQuotesTest.php @@ -96,7 +96,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withProjectKey("test_projectKey") ->me() ->orders() - ->quotes() + ->orderQuote() ->post(null); }, 'post', @@ -120,7 +120,7 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withProjectKey("projectKey") ->me() ->orders() - ->quotes() + ->orderQuote() ->post(null); } ] @@ -136,18 +136,95 @@ function (ApiRequestBuilder $builder): RequestInterface { ->withProjectKey("projectKey") ->me() ->orders() - ->quotes() + ->orderQuote() ->post(null); }, 201 ], + 'ByProjectKeyMeOrdersQuotesPost_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->orderQuote() + ->post(null); + }, + 400 + ], + 'ByProjectKeyMeOrdersQuotesPost_401' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->orderQuote() + ->post(null); + }, + 401 + ], + 'ByProjectKeyMeOrdersQuotesPost_403' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->orderQuote() + ->post(null); + }, + 403 + ], + 'ByProjectKeyMeOrdersQuotesPost_404' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->orderQuote() + ->post(null); + }, + 404 + ], + 'ByProjectKeyMeOrdersQuotesPost_500' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->orderQuote() + ->post(null); + }, + 500 + ], + 'ByProjectKeyMeOrdersQuotesPost_502' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->orderQuote() + ->post(null); + }, + 502 + ], + 'ByProjectKeyMeOrdersQuotesPost_503' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->orders() + ->orderQuote() + ->post(null); + }, + 503 + ], 'ByProjectKeyMeOrdersQuotesPost_599' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->orders() - ->quotes() + ->orderQuote() ->post(null); }, 599 diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersTest.php index 466011e94ef..bb9fa2abbad 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeOrdersTest.php @@ -244,7 +244,7 @@ function (ApiRequestBuilder $builder): ResourceByProjectKeyMeOrdersQuotes { ->withProjectKey("test_projectKey") ->me() ->orders() - ->quotes(); + ->orderQuote(); }, ResourceByProjectKeyMeOrdersQuotes::class, ['projectKey' => 'test_projectKey'], diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 10f372227a9..de771280a7b 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -1254,7 +1254,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->carts()->withCustomerId("customerId")->get()` -Retrieves the recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +Retrieves the recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. @@ -2354,7 +2354,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withId("ID")->get()` -If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. @@ -2374,7 +2374,7 @@ $request = $builder ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withId("ID")->post(null)` Updates a [Cart](ctp:api:type:Cart) in the [Store](ctp:api:type:Store) specified by `storeKey`. -If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -2408,9 +2408,9 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withCustomerId("customerId")->get()` -Retrieves the recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +Retrieves the recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. -If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. @@ -2429,7 +2429,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->carts()->withKey("key")->get()` -If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. @@ -2836,7 +2836,7 @@ Retrieves the Customer's most recently modified active Cart in the Store specifi Carts with `Merchant` or `Quote` [CartOrigin](ctp:api:type:CartOrigin) are ignored. -If no active Cart exists, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -2997,7 +2997,18 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->orders()->post(null)` -null +The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). + +Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. + +Specific Error Codes: + +- [OutOfStock](ctp:api:type:OutOfStockError) +- [PriceChanged](ctp:api:type:PriceChangedError) +- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +- [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) + ### Example ```php @@ -3013,7 +3024,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->me()->orders()->withId("ID")->get()` -null +If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + ### Example ```php @@ -3232,7 +3244,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->get()` -Queries orders in a specific [Store](ctp:api:type:Store). +null ### Example ```php @@ -3247,10 +3259,21 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->post(null)` -Creates an order from a Cart from a specific [Store](ctp:api:type:Store). -When using this endpoint the orders's `store` field is always set to the [Store](ctp:api:type:Store) specified in the path parameter. -The cart must have a shipping address set before creating an order. When using the Platform TaxMode, -the shipping address is used for tax calculation. +Before you create an Order, the Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction). +The shipping address is used for tax calculation for a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode). + +Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. + +Specific Error Codes: + +- [OutOfStock](ctp:api:type:OutOfStockError) +- [PriceChanged](ctp:api:type:PriceChangedError) +- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +- [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) +- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) +- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) ### Example @@ -3266,9 +3289,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withId("ID")->get()` -Returns an [Order](ctp:api:type:Order) by its ID from a specific [Store](ctp:api:type:Store). -If the Order exists in the Project but does not have the `store` field, -or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -3285,9 +3306,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withId("ID")->post(null)` -Updates an [Order](ctp:api:type:Order) in the [Store](ctp:api:type:Store) specified by {storeKey}. -If the Order exists in the Project but does not have the `store` field, -or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. +If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -3304,7 +3323,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withId("ID")->delete()` -null +If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + +Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message. + ### Example ```php @@ -3320,12 +3342,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withOrderNumber("orderNumber")->get()` -Returns an order by its order number from a specific [Store](ctp:api:type:Store). - -If the Order exists in the Project but does not have the `store` field, -or the `store` field references a different [Store](ctp:api:type:Store), this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. -In case the orderNumber does not match the regular expression [a-zA-Z0-9_-]+, -it should be provided in URL-encoded format. +If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -3342,12 +3359,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withOrderNumber("orderNumber")->post(null)` -Updates an order in the [Store](ctp:api:type:Store) specified by {storeKey}. - -If the [Order](ctp:api:type:Order) exists in the Project but does not have the `store` field, -or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. -In case the orderNumber does not match the regular expression [a-zA-Z0-9_-]+, -it should be provided in URL-encoded format. +If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -3364,7 +3376,10 @@ $request = $builder ``` ## `withProjectKey("projectKey")->inStoreKeyWithStoreKeyValue("storeKey")->orders()->withOrderNumber("orderNumber")->delete()` -null +If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + +Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message. + ### Example ```php @@ -3785,7 +3800,7 @@ $request = $builder Retrieves the Customer's most recently modified active Cart. Carts with `Merchant` or `Quote` [CartOrigin](ctp:api:type:CartOrigin) are ignored. -If no active Cart exists, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. +If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. ### Example @@ -4137,7 +4152,17 @@ $request = $builder ``` ## `withProjectKey("projectKey")->me()->orders()->post(null)` -null +The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission). + +Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. + +Specific Error Codes: + +- [OutOfStock](ctp:api:type:OutOfStockError) +- [PriceChanged](ctp:api:type:PriceChangedError) +- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +- [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) + ### Example ```php @@ -4166,9 +4191,20 @@ $request = $builder ->withId("ID") ->get(); ``` -## `withProjectKey("projectKey")->me()->orders()->quotes()->post(null)` +## `withProjectKey("projectKey")->me()->orders()->orderQuote()->post(null)` + +When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyQuotes` [Permission](ctp:api:type:Permission). + +Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. + +Specific Error Codes: + +- [OutOfStock](ctp:api:type:OutOfStockError) +- [PriceChanged](ctp:api:type:PriceChangedError) +- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) +- [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) -null ### Example ```php @@ -4179,7 +4215,7 @@ $request = $builder ->withProjectKey("projectKey") ->me() ->orders() - ->quotes() + ->orderQuote() ->post(null); ``` ## `withProjectKey("projectKey")->me()->password()->post(null)` @@ -4744,9 +4780,20 @@ $request = $builder ``` ## `withProjectKey("projectKey")->orders()->post(null)` -Creates an order from a Cart. -The cart must have a shipping address set before creating an order. -When using the Platform TaxMode, the shipping address is used for tax calculation. +Before you create an Order, the Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction). +The shipping address is used for tax calculation for a Cart with `Platform` [TaxMode](ctp:api:type:TaxMode). + +Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. + +Specific Error Codes: + +- [OutOfStock](ctp:api:type:OutOfStockError) +- [PriceChanged](ctp:api:type:PriceChangedError) +- [DiscountCodeNonApplicable](ctp:api:type:DiscountCodeNonApplicableError) +- [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) +- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +- [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) +- [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) ### Example @@ -4791,7 +4838,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->orders()->withId("ID")->delete()` -null +Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message. + ### Example ```php @@ -4821,7 +4869,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->orders()->edits()->post(null)` -null +You can either create multiple Order Edits for an Order and apply them sequentially to an Order, or create multiple Order Edits parallelly (as alternatives to each other) and apply one of them to the Order. + ### Example ```php @@ -4884,7 +4933,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->orders()->edits()->withId("ID")->apply()->post(null)` -null +Applying an OrderEdit produces the [OrderEditApplied](ctp:api:type:OrderEditAppliedMessage) Message. + ### Example ```php @@ -4964,9 +5014,7 @@ $request = $builder ``` ## `withProjectKey("projectKey")->orders()->withOrderNumber("orderNumber")->get()` -In case the orderNumber does not match the regular expression [a-zA-Z0-9_-]+, -it should be provided in URL-encoded format. - +null ### Example ```php @@ -4996,7 +5044,8 @@ $request = $builder ``` ## `withProjectKey("projectKey")->orders()->withOrderNumber("orderNumber")->delete()` -null +Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message. + ### Example ```php @@ -5011,7 +5060,16 @@ $request = $builder ``` ## `withProjectKey("projectKey")->orders()->orderQuote()->post(null)` -Create an Order from a Quote +Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. + +Specific Error Codes: + +- [OutOfStock](ctp:api:type:OutOfStockError) +- [PriceChanged](ctp:api:type:PriceChangedError) +- [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) +- [InvalidOperation](ctp:api:type:InvalidOperationError) +- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) + ### Example ```php diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersQuotesPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersQuotesPost.php index 3c9255781ef..d4f3dc6ea07 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersQuotesPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMeOrdersQuotesPost.php @@ -8,6 +8,8 @@ namespace Commercetools\Api\Client\Resource; +use Commercetools\Api\Models\Error\ErrorResponse; +use Commercetools\Api\Models\Error\ErrorResponseModel; use Commercetools\Api\Models\Order\Order; use Commercetools\Api\Models\Order\OrderModel; use Commercetools\Base\JsonObject; @@ -28,9 +30,9 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * + * @template-implements Errorable */ -class ByProjectKeyMeOrdersQuotesPost extends ApiRequest +class ByProjectKeyMeOrdersQuotesPost extends ApiRequest implements Errorable { /** * @param ?object|array|string $body @@ -45,7 +47,7 @@ public function __construct(string $projectKey, $body = null, array $headers = [ /** * @template T of JsonObject * @psalm-param ?class-string $resultType - * @return JsonObject|Order|T|null + * @return ErrorResponse|JsonObject|Order|T|null */ public function mapFromResponse(?ResponseInterface $response, string $resultType = null) { @@ -57,6 +59,30 @@ public function mapFromResponse(?ResponseInterface $response, string $resultType case '201': $resultType = OrderModel::class; + break; + case '400': + $resultType = ErrorResponseModel::class; + + break; + case '401': + $resultType = ErrorResponseModel::class; + + break; + case '403': + $resultType = ErrorResponseModel::class; + + break; + case '500': + $resultType = ErrorResponseModel::class; + + break; + case '502': + $resultType = ErrorResponseModel::class; + + break; + case '503': + $resultType = ErrorResponseModel::class; + break; default: $resultType = JsonObjectModel::class; @@ -72,7 +98,7 @@ public function mapFromResponse(?ResponseInterface $response, string $resultType * @template T of JsonObject * @psalm-param ?class-string $resultType * - * @return null|T|JsonObject|Order + * @return null|T|ErrorResponse|JsonObject|Order */ public function execute(array $options = [], string $resultType = null) { diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrders.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrders.php index 97aa45fcd30..727b40915f3 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrders.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeOrders.php @@ -39,7 +39,7 @@ public function withId(string $ID = null): ResourceByProjectKeyMeOrdersByID } /** */ - public function quotes(): ResourceByProjectKeyMeOrdersQuotes + public function orderQuote(): ResourceByProjectKeyMeOrdersQuotes { $args = $this->getArgs(); diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php index d1f41efbfc3..41ea871cdff 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressAction.php @@ -18,7 +18,7 @@ interface CartAddItemShippingAddressAction extends CartUpdateAction /** *

Address to append to itemShippingAddresses.

- *

The new Address must have a key that is unique accross this Cart.

+ *

The new Address must have a key that is unique across this Cart.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php index a66cc33dd79..8ef30bce136 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionBuilder.php @@ -30,7 +30,7 @@ final class CartAddItemShippingAddressActionBuilder implements Builder /** *

Address to append to itemShippingAddresses.

- *

The new Address must have a key that is unique accross this Cart.

+ *

The new Address must have a key that is unique across this Cart.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php index 2ebfe7ce313..e3896bea3e2 100644 --- a/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartAddItemShippingAddressActionModel.php @@ -66,7 +66,7 @@ public function getAction() /** *

Address to append to itemShippingAddresses.

- *

The new Address must have a key that is unique accross this Cart.

+ *

The new Address must have a key that is unique across this Cart.

* * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItem.php b/lib/commercetools-api/src/Models/Cart/CustomLineItem.php index c32e101db7f..083997fcba1 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItem.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItem.php @@ -97,7 +97,7 @@ public function getTotalPrice(); public function getSlug(); /** - *

Number of Custom Line Items in the Cart.

+ *

Number of Custom Line Items in the Cart or Order.

* * @return null|int @@ -105,7 +105,7 @@ public function getSlug(); public function getQuantity(); /** - *

State of the Custom Line Item in the Cart.

+ *

State of the Custom Line Item in the Cart or Order.

* * @return null|ItemStateCollection diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php index 335fbc35706..613aa609761 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php @@ -210,7 +210,7 @@ public function getSlug() } /** - *

Number of Custom Line Items in the Cart.

+ *

Number of Custom Line Items in the Cart or Order.

* * @return null|int @@ -221,7 +221,7 @@ public function getQuantity() } /** - *

State of the Custom Line Item in the Cart.

+ *

State of the Custom Line Item in the Cart or Order.

* * @return null|ItemStateCollection diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php index fb2b48b4f2b..73b22020d7d 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php @@ -316,7 +316,7 @@ public function getSlug() } /** - *

Number of Custom Line Items in the Cart.

+ *

Number of Custom Line Items in the Cart or Order.

* * * @return null|int @@ -336,7 +336,7 @@ public function getQuantity() } /** - *

State of the Custom Line Item in the Cart.

+ *

State of the Custom Line Item in the Cart or Order.

* * * @return null|ItemStateCollection diff --git a/lib/commercetools-api/src/Models/Cart/LineItem.php b/lib/commercetools-api/src/Models/Cart/LineItem.php index 3900e764f8c..1f67a29789e 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItem.php +++ b/lib/commercetools-api/src/Models/Cart/LineItem.php @@ -78,8 +78,8 @@ public function getProductId(); *

key of the Product.

*

This field is only present on:

*
    - *
  • Line Items in a Cart when the key is available on that specific Product at the time the Line Item was created or updated on the Cart.
  • - *
  • Orders when the key is available on the specific Product at the time the Order was created from the Cart.
  • + *
  • Line Items in a Cart when the key is available on that specific Product at the time the LineItem was created or updated on the Cart.
  • + *
  • Line Items in an Order when the key is available on the specific Product at the time the Order was created from the Cart.
  • *
*

Present on resources created or updated after 3 December 2021.

* @@ -132,7 +132,7 @@ public function getVariant(); public function getPrice(); /** - *

Number of Line Items of the given Product Variant present in the Cart.

+ *

Number of Line Items of the given Product Variant present in the Cart or Order.

* * @return null|int @@ -173,7 +173,7 @@ public function getTaxedPrice(); public function getTaxedPricePortions(); /** - *

State of the Line Item in the Cart.

+ *

State of the Line Item in the Cart or the Order.

* * @return null|ItemStateCollection diff --git a/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php b/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php index 698e8963bb6..feeef90016b 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemBuilder.php @@ -231,8 +231,8 @@ public function getProductId() *

key of the Product.

*

This field is only present on:

*
    - *
  • Line Items in a Cart when the key is available on that specific Product at the time the Line Item was created or updated on the Cart.
  • - *
  • Orders when the key is available on the specific Product at the time the Order was created from the Cart.
  • + *
  • Line Items in a Cart when the key is available on that specific Product at the time the LineItem was created or updated on the Cart.
  • + *
  • Line Items in an Order when the key is available on the specific Product at the time the Order was created from the Cart.
  • *
*

Present on resources created or updated after 3 December 2021.

* @@ -303,7 +303,7 @@ public function getPrice() } /** - *

Number of Line Items of the given Product Variant present in the Cart.

+ *

Number of Line Items of the given Product Variant present in the Cart or Order.

* * @return null|int @@ -359,7 +359,7 @@ public function getTaxedPricePortions() } /** - *

State of the Line Item in the Cart.

+ *

State of the Line Item in the Cart or the Order.

* * @return null|ItemStateCollection diff --git a/lib/commercetools-api/src/Models/Cart/LineItemModel.php b/lib/commercetools-api/src/Models/Cart/LineItemModel.php index 9d137216b0e..10cb9a11638 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemModel.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemModel.php @@ -317,8 +317,8 @@ public function getProductId() *

key of the Product.

*

This field is only present on:

*
    - *
  • Line Items in a Cart when the key is available on that specific Product at the time the Line Item was created or updated on the Cart.
  • - *
  • Orders when the key is available on the specific Product at the time the Order was created from the Cart.
  • + *
  • Line Items in a Cart when the key is available on that specific Product at the time the LineItem was created or updated on the Cart.
  • + *
  • Line Items in an Order when the key is available on the specific Product at the time the Order was created from the Cart.
  • *
*

Present on resources created or updated after 3 December 2021.

* @@ -448,7 +448,7 @@ public function getPrice() } /** - *

Number of Line Items of the given Product Variant present in the Cart.

+ *

Number of Line Items of the given Product Variant present in the Cart or Order.

* * * @return null|int @@ -551,7 +551,7 @@ public function getTaxedPricePortions() } /** - *

State of the Line Item in the Cart.

+ *

State of the Line Item in the Cart or the Order.

* * * @return null|ItemStateCollection diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraft.php b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraft.php index 6e9eefa552c..c16f9194339 100644 --- a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraft.php @@ -17,7 +17,7 @@ interface MyOrderFromCartDraft extends JsonObject public const FIELD_VERSION = 'version'; /** - *

Unique identifier of the Cart that initiates an Order creation.

+ *

id of the Cart from which the Order is created.

* * @return null|string @@ -25,6 +25,8 @@ interface MyOrderFromCartDraft extends JsonObject public function getId(); /** + *

Current version of the Cart from which the Order is created.

+ * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftBuilder.php index 404a57907b6..5dba5c6f106 100644 --- a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftBuilder.php @@ -33,7 +33,7 @@ final class MyOrderFromCartDraftBuilder implements Builder private $version; /** - *

Unique identifier of the Cart that initiates an Order creation.

+ *

id of the Cart from which the Order is created.

* * @return null|string @@ -44,6 +44,8 @@ public function getId() } /** + *

Current version of the Cart from which the Order is created.

+ * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftModel.php b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftModel.php index b525a102331..2a534f5adcf 100644 --- a/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromCartDraftModel.php @@ -44,7 +44,7 @@ public function __construct( } /** - *

Unique identifier of the Cart that initiates an Order creation.

+ *

id of the Cart from which the Order is created.

* * * @return null|string @@ -64,6 +64,8 @@ public function getId() } /** + *

Current version of the Cart from which the Order is created.

+ * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraft.php b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraft.php index a8d1d4ba4ff..8fc1eaffc43 100644 --- a/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraft.php @@ -18,7 +18,7 @@ interface MyOrderFromQuoteDraft extends JsonObject public const FIELD_QUOTE_STATE_TO_ACCEPTED = 'quoteStateToAccepted'; /** - *

Unique identifier of the Quote from which the Order is created.

+ *

id of the Quote from which the Order is created.

* * @return null|string @@ -26,7 +26,7 @@ interface MyOrderFromQuoteDraft extends JsonObject public function getId(); /** - *

version of the Quote from which the Order is created.

+ *

Current version of the Quote from which the Order is created.

* * @return null|int @@ -34,7 +34,7 @@ public function getId(); public function getVersion(); /** - *

Set to true, if the quoteState of the referenced Quote should be set to Accepted.

+ *

Set to true, if the quoteState of the referenced Quote should be set to Accepted.

* * @return null|bool diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftBuilder.php index 252f76783f0..fd4d63fbd0f 100644 --- a/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftBuilder.php @@ -39,7 +39,7 @@ final class MyOrderFromQuoteDraftBuilder implements Builder private $quoteStateToAccepted; /** - *

Unique identifier of the Quote from which the Order is created.

+ *

id of the Quote from which the Order is created.

* * @return null|string @@ -50,7 +50,7 @@ public function getId() } /** - *

version of the Quote from which the Order is created.

+ *

Current version of the Quote from which the Order is created.

* * @return null|int @@ -61,7 +61,7 @@ public function getVersion() } /** - *

Set to true, if the quoteState of the referenced Quote should be set to Accepted.

+ *

Set to true, if the quoteState of the referenced Quote should be set to Accepted.

* * @return null|bool diff --git a/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftModel.php b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftModel.php index e0d19a693c5..e866a45f706 100644 --- a/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyOrderFromQuoteDraftModel.php @@ -52,7 +52,7 @@ public function __construct( } /** - *

Unique identifier of the Quote from which the Order is created.

+ *

id of the Quote from which the Order is created.

* * * @return null|string @@ -72,7 +72,7 @@ public function getId() } /** - *

version of the Quote from which the Order is created.

+ *

Current version of the Quote from which the Order is created.

* * * @return null|int @@ -92,7 +92,7 @@ public function getVersion() } /** - *

Set to true, if the quoteState of the referenced Quote should be set to Accepted.

+ *

Set to true, if the quoteState of the referenced Quote should be set to Accepted.

* * * @return null|bool diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php index 983af9a602e..5e3b58579e8 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessage.php @@ -18,7 +18,7 @@ interface DeliveryAddedMessage extends OrderMessage public const FIELD_SHIPPING_KEY = 'shippingKey'; /** - *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

+ *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional Parcel Added To Delivery Message containing information about the Parcels.

* * @return null|Delivery diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php index de488e5d054..4865de7a628 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageBuilder.php @@ -213,7 +213,7 @@ public function getResourceUserProvidedIdentifiers() } /** - *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

+ *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional Parcel Added To Delivery Message containing information about the Parcels.

* * @return null|Delivery diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php index 08f0b78625f..e4f93618625 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessageModel.php @@ -375,7 +375,7 @@ public function getResourceUserProvidedIdentifiers() } /** - *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

+ *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional Parcel Added To Delivery Message containing information about the Parcels.

* * * @return null|Delivery diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php index 876b6aaae6e..fc178dc82d9 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayload.php @@ -18,7 +18,7 @@ interface DeliveryAddedMessagePayload extends OrderMessagePayload public const FIELD_SHIPPING_KEY = 'shippingKey'; /** - *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

+ *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional Parcel Added To Delivery Message containing information about the Parcels.

* * @return null|Delivery diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php index c849b0eeb3f..44b2ded14d7 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadBuilder.php @@ -35,7 +35,7 @@ final class DeliveryAddedMessagePayloadBuilder implements Builder private $shippingKey; /** - *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

+ *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional Parcel Added To Delivery Message containing information about the Parcels.

* * @return null|Delivery diff --git a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php index 974f20783d5..2dbfababb1e 100644 --- a/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/DeliveryAddedMessagePayloadModel.php @@ -73,7 +73,7 @@ public function getType() } /** - *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional ParcelAddedToDelivery Message containing information about the Parcels.

+ *

Delivery that was added to the Order. The Delivery in the Message body does not contain Parcels if those were part of the initial Add Delivery update action. In that case, the update action produces an additional Parcel Added To Delivery Message containing information about the Parcels.

* * * @return null|Delivery diff --git a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessage.php index ceabc85c91c..63b2048873f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessage.php @@ -17,7 +17,7 @@ interface OrderPurchaseOrderNumberSetMessage extends OrderMessage public const FIELD_OLD_PURCHASE_ORDER_NUMBER = 'oldPurchaseOrderNumber'; /** - *

Purchase order number on the Order after the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order after the Set Purchase Order Number update action.

* * @return null|string @@ -25,7 +25,7 @@ interface OrderPurchaseOrderNumberSetMessage extends OrderMessage public function getPurchaseOrderNumber(); /** - *

Purchase order number on the Order before the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order before the Set Purchase Order Number update action.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessageBuilder.php index d083cd24483..e0643d20916 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessageBuilder.php @@ -211,7 +211,7 @@ public function getResourceUserProvidedIdentifiers() } /** - *

Purchase order number on the Order after the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order after the Set Purchase Order Number update action.

* * @return null|string @@ -222,7 +222,7 @@ public function getPurchaseOrderNumber() } /** - *

Purchase order number on the Order before the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order before the Set Purchase Order Number update action.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessageModel.php index ab1138e5825..5afe07adf3d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessageModel.php @@ -373,7 +373,7 @@ public function getResourceUserProvidedIdentifiers() } /** - *

Purchase order number on the Order after the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order after the Set Purchase Order Number update action.

* * * @return null|string @@ -393,7 +393,7 @@ public function getPurchaseOrderNumber() } /** - *

Purchase order number on the Order before the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order before the Set Purchase Order Number update action.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayload.php index 6aa70a72bb6..85414ae14d0 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayload.php @@ -17,7 +17,7 @@ interface OrderPurchaseOrderNumberSetMessagePayload extends OrderMessagePayload public const FIELD_OLD_PURCHASE_ORDER_NUMBER = 'oldPurchaseOrderNumber'; /** - *

Purchase order number on the Order after the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order after the Set Purchase Order Number update action.

* * @return null|string @@ -25,7 +25,7 @@ interface OrderPurchaseOrderNumberSetMessagePayload extends OrderMessagePayload public function getPurchaseOrderNumber(); /** - *

Purchase order number on the Order before the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order before the Set Purchase Order Number update action.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayloadBuilder.php index 3ca4994db45..fa70e43141d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayloadBuilder.php @@ -33,7 +33,7 @@ final class OrderPurchaseOrderNumberSetMessagePayloadBuilder implements Builder private $oldPurchaseOrderNumber; /** - *

Purchase order number on the Order after the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order after the Set Purchase Order Number update action.

* * @return null|string @@ -44,7 +44,7 @@ public function getPurchaseOrderNumber() } /** - *

Purchase order number on the Order before the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order before the Set Purchase Order Number update action.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayloadModel.php index c105d9dea36..59d094f84e6 100644 --- a/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderPurchaseOrderNumberSetMessagePayloadModel.php @@ -71,7 +71,7 @@ public function getType() } /** - *

Purchase order number on the Order after the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order after the Set Purchase Order Number update action.

* * * @return null|string @@ -91,7 +91,7 @@ public function getPurchaseOrderNumber() } /** - *

Purchase order number on the Order before the Set PurchaseOrderNumber update action.

+ *

Purchase order number on the Order before the Set Purchase Order Number update action.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php index bae6094349c..d5698c68fc4 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php @@ -16,13 +16,28 @@ interface CustomLineItemReturnItem extends ReturnItem public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; /** + *

id of the returned CustomLineItem.

+ * * @return null|string */ public function getCustomLineItemId(); + /** + *

Number of Custom Line Items returned.

+ * + + * @return null|int + */ + public function getQuantity(); + /** * @param ?string $customLineItemId */ public function setCustomLineItemId(?string $customLineItemId): void; + + /** + * @param ?int $quantity + */ + public function setQuantity(?int $quantity): void; } diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php index 7a33f9223d4..5b1425034f4 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php @@ -78,7 +78,7 @@ final class CustomLineItemReturnItemBuilder implements Builder private $customLineItemId; /** - *

Unique identifier of the ReturnItem.

+ *

Unique identifier of the Return Item.

* * @return null|string @@ -89,6 +89,8 @@ public function getId() } /** + *

Number of Custom Line Items returned.

+ * * @return null|int */ @@ -98,6 +100,8 @@ public function getQuantity() } /** + *

User-defined description for the return.

+ * * @return null|string */ @@ -107,6 +111,8 @@ public function getComment() } /** + *

Shipment status of the Return Item.

+ * * @return null|string */ @@ -116,6 +122,12 @@ public function getShipmentState() } /** + *

Payment status of the Return Item:

+ * + * * @return null|string */ @@ -125,7 +137,7 @@ public function getPaymentState() } /** - *

Custom Fields of this return item.

+ *

Custom Fields of the Return Item.

* * @return null|CustomFields @@ -136,6 +148,8 @@ public function getCustom() } /** + *

Date and time (UTC) the Return Item was last updated.

+ * * @return null|DateTimeImmutable */ @@ -145,6 +159,8 @@ public function getLastModifiedAt() } /** + *

Date and time (UTC) the Return Item was intitially created.

+ * * @return null|DateTimeImmutable */ @@ -154,6 +170,8 @@ public function getCreatedAt() } /** + *

id of the returned CustomLineItem.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php index cc1c9e1050a..dc948c38485 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php @@ -112,7 +112,7 @@ public function __construct( } /** - *

Unique identifier of the ReturnItem.

+ *

Unique identifier of the Return Item.

* * * @return null|string @@ -132,6 +132,8 @@ public function getId() } /** + *

Number of Custom Line Items returned.

+ * * * @return null|int */ @@ -168,6 +170,8 @@ public function getType() } /** + *

User-defined description for the return.

+ * * * @return null|string */ @@ -186,6 +190,8 @@ public function getComment() } /** + *

Shipment status of the Return Item.

+ * * * @return null|string */ @@ -204,6 +210,12 @@ public function getShipmentState() } /** + *

Payment status of the Return Item:

+ * + * * * @return null|string */ @@ -222,7 +234,7 @@ public function getPaymentState() } /** - *

Custom Fields of this return item.

+ *

Custom Fields of the Return Item.

* * * @return null|CustomFields @@ -243,6 +255,8 @@ public function getCustom() } /** + *

Date and time (UTC) the Return Item was last updated.

+ * * * @return null|DateTimeImmutable */ @@ -265,6 +279,8 @@ public function getLastModifiedAt() } /** + *

Date and time (UTC) the Return Item was intitially created.

+ * * * @return null|DateTimeImmutable */ @@ -287,6 +303,8 @@ public function getCreatedAt() } /** + *

id of the returned CustomLineItem.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/Delivery.php b/lib/commercetools-api/src/Models/Order/Delivery.php index 4a63ca4b673..00b81e585fa 100644 --- a/lib/commercetools-api/src/Models/Order/Delivery.php +++ b/lib/commercetools-api/src/Models/Order/Delivery.php @@ -41,14 +41,15 @@ public function getId(); public function getKey(); /** + *

Date and time (UTC) the Delivery was created.

+ * * @return null|DateTimeImmutable */ public function getCreatedAt(); /** - *

Items which are shipped in this delivery regardless their distribution over several parcels. - * Can also be specified individually for each Parcel.

+ *

Line Items or Custom Line Items that are delivered.

* * @return null|DeliveryItemCollection @@ -56,19 +57,23 @@ public function getCreatedAt(); public function getItems(); /** + *

Information regarding the appearance, content, and shipment of a Parcel.

+ * * @return null|ParcelCollection */ public function getParcels(); /** + *

Address to which Parcels are delivered.

+ * * @return null|Address */ public function getAddress(); /** - *

Custom Fields for the Transaction.

+ *

Custom Fields of the Delivery.

* * @return null|CustomFields diff --git a/lib/commercetools-api/src/Models/Order/DeliveryBuilder.php b/lib/commercetools-api/src/Models/Order/DeliveryBuilder.php index f825a5a7e23..239e728bc36 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryBuilder.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryBuilder.php @@ -90,6 +90,8 @@ public function getKey() } /** + *

Date and time (UTC) the Delivery was created.

+ * * @return null|DateTimeImmutable */ @@ -99,8 +101,7 @@ public function getCreatedAt() } /** - *

Items which are shipped in this delivery regardless their distribution over several parcels. - * Can also be specified individually for each Parcel.

+ *

Line Items or Custom Line Items that are delivered.

* * @return null|DeliveryItemCollection @@ -111,6 +112,8 @@ public function getItems() } /** + *

Information regarding the appearance, content, and shipment of a Parcel.

+ * * @return null|ParcelCollection */ @@ -120,6 +123,8 @@ public function getParcels() } /** + *

Address to which Parcels are delivered.

+ * * @return null|Address */ @@ -129,7 +134,7 @@ public function getAddress() } /** - *

Custom Fields for the Transaction.

+ *

Custom Fields of the Delivery.

* * @return null|CustomFields diff --git a/lib/commercetools-api/src/Models/Order/DeliveryDraft.php b/lib/commercetools-api/src/Models/Order/DeliveryDraft.php index b1eb02f7cc1..91d12c26e22 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryDraft.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryDraft.php @@ -30,8 +30,8 @@ interface DeliveryDraft extends JsonObject public function getKey(); /** - *

Items which are shipped in this delivery regardless their distribution over several parcels. - * Can also be specified individually for each Parcel.

+ *

Line Items or Custom Line Items to deliver. + * It can also be specified individually for each Parcel.

* * @return null|DeliveryItemCollection @@ -39,19 +39,23 @@ public function getKey(); public function getItems(); /** + *

Information regarding the appearance, content, and shipment of a parcel.

+ * * @return null|ParcelDraftCollection */ public function getParcels(); /** + *

Address to which the Parcels are delivered.

+ * * @return null|AddressDraft */ public function getAddress(); /** - *

Custom Fields for the Transaction.

+ *

Custom Fields for the Delivery.

* * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/DeliveryDraftBuilder.php b/lib/commercetools-api/src/Models/Order/DeliveryDraftBuilder.php index 9e0920b84c5..82e317a6568 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryDraftBuilder.php @@ -66,8 +66,8 @@ public function getKey() } /** - *

Items which are shipped in this delivery regardless their distribution over several parcels. - * Can also be specified individually for each Parcel.

+ *

Line Items or Custom Line Items to deliver. + * It can also be specified individually for each Parcel.

* * @return null|DeliveryItemCollection @@ -78,6 +78,8 @@ public function getItems() } /** + *

Information regarding the appearance, content, and shipment of a parcel.

+ * * @return null|ParcelDraftCollection */ @@ -87,6 +89,8 @@ public function getParcels() } /** + *

Address to which the Parcels are delivered.

+ * * @return null|AddressDraft */ @@ -96,7 +100,7 @@ public function getAddress() } /** - *

Custom Fields for the Transaction.

+ *

Custom Fields for the Delivery.

* * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/DeliveryDraftModel.php b/lib/commercetools-api/src/Models/Order/DeliveryDraftModel.php index d80ae8fe1cf..058194c4d91 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryDraftModel.php @@ -92,8 +92,8 @@ public function getKey() } /** - *

Items which are shipped in this delivery regardless their distribution over several parcels. - * Can also be specified individually for each Parcel.

+ *

Line Items or Custom Line Items to deliver. + * It can also be specified individually for each Parcel.

* * * @return null|DeliveryItemCollection @@ -113,6 +113,8 @@ public function getItems() } /** + *

Information regarding the appearance, content, and shipment of a parcel.

+ * * * @return null|ParcelDraftCollection */ @@ -131,6 +133,8 @@ public function getParcels() } /** + *

Address to which the Parcels are delivered.

+ * * * @return null|AddressDraft */ @@ -150,7 +154,7 @@ public function getAddress() } /** - *

Custom Fields for the Transaction.

+ *

Custom Fields for the Delivery.

* * * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/DeliveryItem.php b/lib/commercetools-api/src/Models/Order/DeliveryItem.php index fe83e620b1e..1a20b89cc40 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryItem.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryItem.php @@ -17,7 +17,7 @@ interface DeliveryItem extends JsonObject public const FIELD_QUANTITY = 'quantity'; /** - *

Unique identifier of the DeliveryItem.

+ *

id of the LineItem or CustomLineItem delivered.

* * @return null|string @@ -25,6 +25,8 @@ interface DeliveryItem extends JsonObject public function getId(); /** + *

Number of Line Items or Custom Line Items delivered.

+ * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Order/DeliveryItemBuilder.php b/lib/commercetools-api/src/Models/Order/DeliveryItemBuilder.php index 3dbc7f4be75..4f0312e6a1d 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryItemBuilder.php @@ -33,7 +33,7 @@ final class DeliveryItemBuilder implements Builder private $quantity; /** - *

Unique identifier of the DeliveryItem.

+ *

id of the LineItem or CustomLineItem delivered.

* * @return null|string @@ -44,6 +44,8 @@ public function getId() } /** + *

Number of Line Items or Custom Line Items delivered.

+ * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Order/DeliveryItemModel.php b/lib/commercetools-api/src/Models/Order/DeliveryItemModel.php index 3af065f3238..1ef11e08b2e 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryItemModel.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryItemModel.php @@ -44,7 +44,7 @@ public function __construct( } /** - *

Unique identifier of the DeliveryItem.

+ *

id of the LineItem or CustomLineItem delivered.

* * * @return null|string @@ -64,6 +64,8 @@ public function getId() } /** + *

Number of Line Items or Custom Line Items delivered.

+ * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Order/DeliveryModel.php b/lib/commercetools-api/src/Models/Order/DeliveryModel.php index 4a4265cb417..cb41cffe397 100644 --- a/lib/commercetools-api/src/Models/Order/DeliveryModel.php +++ b/lib/commercetools-api/src/Models/Order/DeliveryModel.php @@ -129,6 +129,8 @@ public function getKey() } /** + *

Date and time (UTC) the Delivery was created.

+ * * * @return null|DateTimeImmutable */ @@ -151,8 +153,7 @@ public function getCreatedAt() } /** - *

Items which are shipped in this delivery regardless their distribution over several parcels. - * Can also be specified individually for each Parcel.

+ *

Line Items or Custom Line Items that are delivered.

* * * @return null|DeliveryItemCollection @@ -172,6 +173,8 @@ public function getItems() } /** + *

Information regarding the appearance, content, and shipment of a Parcel.

+ * * * @return null|ParcelCollection */ @@ -190,6 +193,8 @@ public function getParcels() } /** + *

Address to which Parcels are delivered.

+ * * * @return null|Address */ @@ -209,7 +214,7 @@ public function getAddress() } /** - *

Custom Fields for the Transaction.

+ *

Custom Fields of the Delivery.

* * * @return null|CustomFields diff --git a/lib/commercetools-api/src/Models/Order/ItemState.php b/lib/commercetools-api/src/Models/Order/ItemState.php index 67679ac8791..c698dd48b71 100644 --- a/lib/commercetools-api/src/Models/Order/ItemState.php +++ b/lib/commercetools-api/src/Models/Order/ItemState.php @@ -18,12 +18,16 @@ interface ItemState extends JsonObject public const FIELD_STATE = 'state'; /** + *

Number of Line Items or Custom Line Items in this State.

+ * * @return null|int */ public function getQuantity(); /** + *

State of the Line Items or Custom Line Items in a custom workflow.

+ * * @return null|StateReference */ diff --git a/lib/commercetools-api/src/Models/Order/ItemStateBuilder.php b/lib/commercetools-api/src/Models/Order/ItemStateBuilder.php index 4d815a386ec..6a93807ea1e 100644 --- a/lib/commercetools-api/src/Models/Order/ItemStateBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ItemStateBuilder.php @@ -35,6 +35,8 @@ final class ItemStateBuilder implements Builder private $state; /** + *

Number of Line Items or Custom Line Items in this State.

+ * * @return null|int */ @@ -44,6 +46,8 @@ public function getQuantity() } /** + *

State of the Line Items or Custom Line Items in a custom workflow.

+ * * @return null|StateReference */ diff --git a/lib/commercetools-api/src/Models/Order/ItemStateModel.php b/lib/commercetools-api/src/Models/Order/ItemStateModel.php index 136c7ac8daf..6b3bd8e6f6a 100644 --- a/lib/commercetools-api/src/Models/Order/ItemStateModel.php +++ b/lib/commercetools-api/src/Models/Order/ItemStateModel.php @@ -46,6 +46,8 @@ public function __construct( } /** + *

Number of Line Items or Custom Line Items in this State.

+ * * * @return null|int */ @@ -64,6 +66,8 @@ public function getQuantity() } /** + *

State of the Line Items or Custom Line Items in a custom workflow.

+ * * * @return null|StateReference */ diff --git a/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php b/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php index f518b92d60e..15885ab9042 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php +++ b/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php @@ -16,13 +16,28 @@ interface LineItemReturnItem extends ReturnItem public const FIELD_LINE_ITEM_ID = 'lineItemId'; /** + *

id of the returned LineItem.

+ * * @return null|string */ public function getLineItemId(); + /** + *

Number of Line Items returned.

+ * + + * @return null|int + */ + public function getQuantity(); + /** * @param ?string $lineItemId */ public function setLineItemId(?string $lineItemId): void; + + /** + * @param ?int $quantity + */ + public function setQuantity(?int $quantity): void; } diff --git a/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php b/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php index ab4d19437b6..2afdad95ba2 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php @@ -78,7 +78,7 @@ final class LineItemReturnItemBuilder implements Builder private $lineItemId; /** - *

Unique identifier of the ReturnItem.

+ *

Unique identifier of the Return Item.

* * @return null|string @@ -89,6 +89,8 @@ public function getId() } /** + *

Number of Line Items returned.

+ * * @return null|int */ @@ -98,6 +100,8 @@ public function getQuantity() } /** + *

User-defined description for the return.

+ * * @return null|string */ @@ -107,6 +111,8 @@ public function getComment() } /** + *

Shipment status of the Return Item.

+ * * @return null|string */ @@ -116,6 +122,12 @@ public function getShipmentState() } /** + *

Payment status of the Return Item:

+ * + * * @return null|string */ @@ -125,7 +137,7 @@ public function getPaymentState() } /** - *

Custom Fields of this return item.

+ *

Custom Fields of the Return Item.

* * @return null|CustomFields @@ -136,6 +148,8 @@ public function getCustom() } /** + *

Date and time (UTC) the Return Item was last updated.

+ * * @return null|DateTimeImmutable */ @@ -145,6 +159,8 @@ public function getLastModifiedAt() } /** + *

Date and time (UTC) the Return Item was intitially created.

+ * * @return null|DateTimeImmutable */ @@ -154,6 +170,8 @@ public function getCreatedAt() } /** + *

id of the returned LineItem.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php b/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php index 7379c9bad2c..babd26bf3b9 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php +++ b/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php @@ -112,7 +112,7 @@ public function __construct( } /** - *

Unique identifier of the ReturnItem.

+ *

Unique identifier of the Return Item.

* * * @return null|string @@ -132,6 +132,8 @@ public function getId() } /** + *

Number of Line Items returned.

+ * * * @return null|int */ @@ -168,6 +170,8 @@ public function getType() } /** + *

User-defined description for the return.

+ * * * @return null|string */ @@ -186,6 +190,8 @@ public function getComment() } /** + *

Shipment status of the Return Item.

+ * * * @return null|string */ @@ -204,6 +210,12 @@ public function getShipmentState() } /** + *

Payment status of the Return Item:

+ * + * * * @return null|string */ @@ -222,7 +234,7 @@ public function getPaymentState() } /** - *

Custom Fields of this return item.

+ *

Custom Fields of the Return Item.

* * * @return null|CustomFields @@ -243,6 +255,8 @@ public function getCustom() } /** + *

Date and time (UTC) the Return Item was last updated.

+ * * * @return null|DateTimeImmutable */ @@ -265,6 +279,8 @@ public function getLastModifiedAt() } /** + *

Date and time (UTC) the Return Item was intitially created.

+ * * * @return null|DateTimeImmutable */ @@ -287,6 +303,8 @@ public function getCreatedAt() } /** + *

id of the returned LineItem.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/Order.php b/lib/commercetools-api/src/Models/Order/Order.php index a511c628436..530ed950b43 100644 --- a/lib/commercetools-api/src/Models/Order/Order.php +++ b/lib/commercetools-api/src/Models/Order/Order.php @@ -11,6 +11,7 @@ use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CustomLineItemCollection; +use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; use Commercetools\Api\Models\Cart\LineItemCollection; use Commercetools\Api\Models\Cart\ShippingCollection; @@ -36,12 +37,11 @@ interface Order extends BaseResource { - public const FIELD_LAST_MODIFIED_BY = 'lastModifiedBy'; - public const FIELD_CREATED_BY = 'createdBy'; - public const FIELD_COMPLETED_AT = 'completedAt'; public const FIELD_ORDER_NUMBER = 'orderNumber'; + public const FIELD_PURCHASE_ORDER_NUMBER = 'purchaseOrderNumber'; public const FIELD_CUSTOMER_ID = 'customerId'; public const FIELD_CUSTOMER_EMAIL = 'customerEmail'; + public const FIELD_CUSTOMER_GROUP = 'customerGroup'; public const FIELD_ANONYMOUS_ID = 'anonymousId'; public const FIELD_BUSINESS_UNIT = 'businessUnit'; public const FIELD_STORE = 'store'; @@ -50,37 +50,39 @@ interface Order extends BaseResource public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_TAXED_PRICE = 'taxedPrice'; public const FIELD_TAXED_SHIPPING_PRICE = 'taxedShippingPrice'; - public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; + public const FIELD_TAX_MODE = 'taxMode'; + public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; + public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; + public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_BILLING_ADDRESS = 'billingAddress'; + public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; public const FIELD_SHIPPING_MODE = 'shippingMode'; public const FIELD_SHIPPING_KEY = 'shippingKey'; + public const FIELD_SHIPPING_INFO = 'shippingInfo'; + public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; public const FIELD_SHIPPING_CUSTOM_FIELDS = 'shippingCustomFields'; public const FIELD_SHIPPING = 'shipping'; - public const FIELD_TAX_MODE = 'taxMode'; - public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; - public const FIELD_CUSTOMER_GROUP = 'customerGroup'; + public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; + public const FIELD_DISCOUNT_CODES = 'discountCodes'; + public const FIELD_DIRECT_DISCOUNTS = 'directDiscounts'; + public const FIELD_REFUSED_GIFTS = 'refusedGifts'; + public const FIELD_PAYMENT_INFO = 'paymentInfo'; public const FIELD_COUNTRY = 'country'; + public const FIELD_LOCALE = 'locale'; + public const FIELD_ORIGIN = 'origin'; + public const FIELD_CART = 'cart'; + public const FIELD_QUOTE = 'quote'; public const FIELD_ORDER_STATE = 'orderState'; - public const FIELD_STATE = 'state'; public const FIELD_SHIPMENT_STATE = 'shipmentState'; public const FIELD_PAYMENT_STATE = 'paymentState'; - public const FIELD_SHIPPING_INFO = 'shippingInfo'; + public const FIELD_STATE = 'state'; public const FIELD_SYNC_INFO = 'syncInfo'; public const FIELD_RETURN_INFO = 'returnInfo'; - public const FIELD_PURCHASE_ORDER_NUMBER = 'purchaseOrderNumber'; - public const FIELD_DISCOUNT_CODES = 'discountCodes'; public const FIELD_LAST_MESSAGE_SEQUENCE_NUMBER = 'lastMessageSequenceNumber'; - public const FIELD_CART = 'cart'; - public const FIELD_QUOTE = 'quote'; public const FIELD_CUSTOM = 'custom'; - public const FIELD_PAYMENT_INFO = 'paymentInfo'; - public const FIELD_LOCALE = 'locale'; - public const FIELD_INVENTORY_MODE = 'inventoryMode'; - public const FIELD_ORIGIN = 'origin'; - public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; - public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; - public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; - public const FIELD_REFUSED_GIFTS = 'refusedGifts'; + public const FIELD_COMPLETED_AT = 'completedAt'; + public const FIELD_LAST_MODIFIED_BY = 'lastModifiedBy'; + public const FIELD_CREATED_BY = 'createdBy'; /** *

Unique identifier of the Order.

@@ -91,7 +93,7 @@ interface Order extends BaseResource public function getId(); /** - *

The current version of the order.

+ *

Current version of the Order.

* * @return null|int @@ -99,66 +101,49 @@ public function getId(); public function getVersion(); /** - - * @return null|DateTimeImmutable - */ - public function getCreatedAt(); - - /** - - * @return null|DateTimeImmutable - */ - public function getLastModifiedAt(); - - /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

User-defined identifier of the Order that is unique across a Project.

* - * @return null|LastModifiedBy - */ - public function getLastModifiedBy(); - - /** - *

Present on resources created after 1 February 2019 except for events not tracked.

- * - - * @return null|CreatedBy + * @return null|string */ - public function getCreatedBy(); + public function getOrderNumber(); /** - *

This field will only be present if it was set for Order Import

+ *

User-defined identifier of a purchase Order.

+ *

It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow.

* - * @return null|DateTimeImmutable + * @return null|string */ - public function getCompletedAt(); + public function getPurchaseOrderNumber(); /** - *

String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed.

+ *

id of the Customer that the Order belongs to.

* * @return null|string */ - public function getOrderNumber(); + public function getCustomerId(); /** + *

Email address of the Customer that the Order belongs to.

+ * * @return null|string */ - public function getCustomerId(); + public function getCustomerEmail(); /** + *

Reference to the Customer Group of the Customer that the Order belongs to. + * Used for LineItem Price selection.

+ * - * @return null|string + * @return null|CustomerGroupReference */ - public function getCustomerEmail(); + public function getCustomerGroup(); /** - *

Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

+ *

Anonymous session associated with the Order.

* * @return null|string @@ -166,7 +151,7 @@ public function getCustomerEmail(); public function getAnonymousId(); /** - *

The Business Unit the Order belongs to.

+ *

Reference to a Business Unit the Order belongs to.

* * @return null|BusinessUnitKeyReference @@ -174,31 +159,43 @@ public function getAnonymousId(); public function getBusinessUnit(); /** + *

Reference to a Store the Order belongs to.

+ * * @return null|StoreKeyReference */ public function getStore(); /** + *

Line Items that are part of the Order.

+ * * @return null|LineItemCollection */ public function getLineItems(); /** + *

Custom Line Items that are part of the Order.

+ * * @return null|CustomLineItemCollection */ public function getCustomLineItems(); /** + *

Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo. + * Taxes are included if TaxRate includedInPrice is true for each price.

+ * * @return null|TypedMoney */ public function getTotalPrice(); /** - *

The taxes are calculated based on the shipping address.

+ *
    + *
  • For Platform TaxMode, it is automatically set when a shipping address is set.
  • + *
  • For External TaxMode, it is automatically set when the external Tax Rate for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.
  • + *
* * @return null|TaxedPrice @@ -206,8 +203,7 @@ public function getTotalPrice(); public function getTaxedPrice(); /** - *

Sum of taxedPrice of ShippingInfo across all Shipping Methods. - * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

+ *

Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

* * @return null|TaxedPrice @@ -215,159 +211,181 @@ public function getTaxedPrice(); public function getTaxedShippingPrice(); /** - *

Holds all shipping-related information per Shipping Method.

- *

For Multiple ShippingMode, it is updated automatically after the Shipping Methods are added.

+ *

Indicates how Tax Rates are set.

* - * @return null|Address + * @return null|string */ - public function getShippingAddress(); + public function getTaxMode(); /** + *

Indicates how monetary values are rounded when calculating taxes for taxedPrice.

+ * - * @return null|Address + * @return null|string */ - public function getBillingAddress(); + public function getTaxRoundingMode(); /** - *

Indicates whether one or multiple Shipping Methods are added to the Cart.

+ *

Indicates how taxes are calculated when calculating taxes for taxedPrice.

* * @return null|string */ - public function getShippingMode(); + public function getTaxCalculationMode(); /** - *

key of the ShippingMethod for Single ShippingMode.

+ *

Indicates how stock quantities are tracked for Line Items in the Order.

* * @return null|string */ - public function getShippingKey(); + public function getInventoryMode(); /** - *

Custom Fields of the Shipping Method for Single ShippingMode.

+ *

Billing address associated with the Order.

* - * @return null|CustomFields + * @return null|Address */ - public function getShippingCustomFields(); + public function getBillingAddress(); /** - *

Holds all shipping-related information per Shipping Method for Multiple ShippingMode.

- *

It is updated automatically after the Shipping Method is added.

+ *

Shipping address associated with the Order. + * Determines eligible ShippingMethod rates and Tax Rates of Line Items.

* - * @return null|ShippingCollection + * @return null|Address */ - public function getShipping(); + public function getShippingAddress(); /** + *

Indicates whether there can be one or multiple Shipping Methods.

+ * * @return null|string */ - public function getTaxMode(); + public function getShippingMode(); /** - *

When calculating taxes for taxedPrice, the selected mode is used for rouding.

+ *

key of the ShippingMethod for Single ShippingMode.

* * @return null|string */ - public function getTaxRoundingMode(); + public function getShippingKey(); /** - *

Set when the customer is set and the customer is a member of a customer group. - * Used for product variant price selection.

+ *

Shipping-related information for Single ShippingMode. + * Automatically set when a Shipping Method is set.

* - * @return null|CustomerGroupReference + * @return null|ShippingInfo */ - public function getCustomerGroup(); + public function getShippingInfo(); /** - *

A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

+ *

Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

+ * * - * @return null|string + * @return null|ShippingRateInput */ - public function getCountry(); + public function getShippingRateInput(); /** - *

One of the four predefined OrderStates.

+ *

Custom Fields of the Shipping Method for Single ShippingMode.

* - * @return null|string + * @return null|CustomFields */ - public function getOrderState(); + public function getShippingCustomFields(); /** - *

This reference can point to a state in a custom workflow.

+ *

Shipping-related information for Multiple ShippingMode. + * Updated automatically each time a new Shipping Method is added.

* - * @return null|StateReference + * @return null|ShippingCollection */ - public function getState(); + public function getShipping(); /** + *

Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. + * Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

+ * - * @return null|string + * @return null|AddressCollection */ - public function getShipmentState(); + public function getItemShippingAddresses(); /** + *

Discount Codes added to the Order. + * An Order that has directDiscounts cannot have discountCodes.

+ * - * @return null|string + * @return null|DiscountCodeInfoCollection */ - public function getPaymentState(); + public function getDiscountCodes(); /** - *

Set if the ShippingMethod is set.

+ *

Direct Discounts added to the Order. + * An Order that has discountCodes cannot have directDiscounts.

* - * @return null|ShippingInfo + * @return null|DirectDiscountCollection */ - public function getShippingInfo(); + public function getDirectDiscounts(); /** + *

Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

+ * - * @return null|SyncInfoCollection + * @return null|CartDiscountReferenceCollection */ - public function getSyncInfo(); + public function getRefusedGifts(); /** + *

Payment information related to the Order.

+ * - * @return null|ReturnInfoCollection + * @return null|PaymentInfo */ - public function getReturnInfo(); + public function getPaymentInfo(); /** - *

The Purchase Order Number is typically set by the Buyer on a QuoteRequest to - * track the purchase order during the quote and order flow.

+ *

Used for LineItem Price selection.

* * @return null|string */ - public function getPurchaseOrderNumber(); + public function getCountry(); /** + *

Languages of the Order. + * Can only contain languages supported by the Project.

+ * - * @return null|DiscountCodeInfoCollection + * @return null|string */ - public function getDiscountCodes(); + public function getLocale(); /** - *

Internal-only field.

+ *

Indicates the origin of the Cart from which the Order was created.

* - * @deprecated - * @return null|int + + * @return null|string */ - public function getLastMessageSequenceNumber(); + public function getOrigin(); /** - *

Set when this order was created from a cart. - * The cart will have the state Ordered.

+ *

Reference to the Cart for an Order created from Cart. + * The referenced Cart will have the Ordered CartState.

* * @return null|CartReference @@ -375,7 +393,7 @@ public function getLastMessageSequenceNumber(); public function getCart(); /** - *

Set when this order was created from a quote.

+ *

Reference to the Quote for an Order created from Quote.

* * @return null|QuoteReference @@ -383,113 +401,132 @@ public function getCart(); public function getQuote(); /** + *

Current status of the Order.

+ * - * @return null|CustomFields + * @return null|string */ - public function getCustom(); + public function getOrderState(); /** + *

Shipment status of the Order.

+ * - * @return null|PaymentInfo + * @return null|string */ - public function getPaymentInfo(); + public function getShipmentState(); /** + *

Payment status of the Order.

+ * * @return null|string */ - public function getLocale(); + public function getPaymentState(); /** + *

State of the Order. + * This reference can point to a State in a custom workflow.

+ * - * @return null|string + * @return null|StateReference */ - public function getInventoryMode(); + public function getState(); /** + *

Contains synchronization activity information of the Order (like export or import). + * Can only be set with Update SyncInfo update action.

+ * - * @return null|string + * @return null|SyncInfoCollection */ - public function getOrigin(); + public function getSyncInfo(); /** - *

When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

+ *

Contains information regarding the returns associated with the Order.

* - * @return null|string + * @return null|ReturnInfoCollection */ - public function getTaxCalculationMode(); + public function getReturnInfo(); /** - *

Input used to select a ShippingRatePriceTier. - * The data type of this field depends on the shippingRateInputType.type configured in the Project:

- * + *

Internal-only field.

* - - * @return null|ShippingRateInput + * @deprecated + * @return null|int */ - public function getShippingRateInput(); + public function getLastMessageSequenceNumber(); /** - *

Contains addresses for orders with multiple shipping addresses.

+ *

Custom Fields of the Order.

* - * @return null|AddressCollection + * @return null|CustomFields */ - public function getItemShippingAddresses(); + public function getCustom(); /** - *

Automatically filled when a line item with LineItemMode GiftLineItem is removed from this order.

+ *

User-defined date and time (UTC) of the Order. + * Present only on an Order created using Order Import.

* - * @return null|CartDiscountReferenceCollection + * @return null|DateTimeImmutable */ - public function getRefusedGifts(); + public function getCompletedAt(); /** - * @param ?string $id - */ - public function setId(?string $id): void; + *

Date and time (UTC) the Order was initially created.

+ * - /** - * @param ?int $version + * @return null|DateTimeImmutable */ - public function setVersion(?int $version): void; + public function getCreatedAt(); /** - * @param ?DateTimeImmutable $createdAt + *

Date and time (UTC) the Order was last updated.

+ * + + * @return null|DateTimeImmutable */ - public function setCreatedAt(?DateTimeImmutable $createdAt): void; + public function getLastModifiedAt(); /** - * @param ?DateTimeImmutable $lastModifiedAt + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|LastModifiedBy */ - public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void; + public function getLastModifiedBy(); /** - * @param ?LastModifiedBy $lastModifiedBy + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy */ - public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void; + public function getCreatedBy(); /** - * @param ?CreatedBy $createdBy + * @param ?string $id */ - public function setCreatedBy(?CreatedBy $createdBy): void; + public function setId(?string $id): void; /** - * @param ?DateTimeImmutable $completedAt + * @param ?int $version */ - public function setCompletedAt(?DateTimeImmutable $completedAt): void; + public function setVersion(?int $version): void; /** * @param ?string $orderNumber */ public function setOrderNumber(?string $orderNumber): void; + /** + * @param ?string $purchaseOrderNumber + */ + public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void; + /** * @param ?string $customerId */ @@ -500,6 +537,11 @@ public function setCustomerId(?string $customerId): void; */ public function setCustomerEmail(?string $customerEmail): void; + /** + * @param ?CustomerGroupReference $customerGroup + */ + public function setCustomerGroup(?CustomerGroupReference $customerGroup): void; + /** * @param ?string $anonymousId */ @@ -541,15 +583,35 @@ public function setTaxedPrice(?TaxedPrice $taxedPrice): void; public function setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice): void; /** - * @param ?Address $shippingAddress + * @param ?string $taxMode */ - public function setShippingAddress(?Address $shippingAddress): void; + public function setTaxMode(?string $taxMode): void; + + /** + * @param ?string $taxRoundingMode + */ + public function setTaxRoundingMode(?string $taxRoundingMode): void; + + /** + * @param ?string $taxCalculationMode + */ + public function setTaxCalculationMode(?string $taxCalculationMode): void; + + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void; /** * @param ?Address $billingAddress */ public function setBillingAddress(?Address $billingAddress): void; + /** + * @param ?Address $shippingAddress + */ + public function setShippingAddress(?Address $shippingAddress): void; + /** * @param ?string $shippingMode */ @@ -561,137 +623,137 @@ public function setShippingMode(?string $shippingMode): void; public function setShippingKey(?string $shippingKey): void; /** - * @param ?CustomFields $shippingCustomFields + * @param ?ShippingInfo $shippingInfo */ - public function setShippingCustomFields(?CustomFields $shippingCustomFields): void; + public function setShippingInfo(?ShippingInfo $shippingInfo): void; /** - * @param ?ShippingCollection $shipping + * @param ?ShippingRateInput $shippingRateInput */ - public function setShipping(?ShippingCollection $shipping): void; + public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void; /** - * @param ?string $taxMode + * @param ?CustomFields $shippingCustomFields */ - public function setTaxMode(?string $taxMode): void; + public function setShippingCustomFields(?CustomFields $shippingCustomFields): void; /** - * @param ?string $taxRoundingMode + * @param ?ShippingCollection $shipping */ - public function setTaxRoundingMode(?string $taxRoundingMode): void; + public function setShipping(?ShippingCollection $shipping): void; /** - * @param ?CustomerGroupReference $customerGroup + * @param ?AddressCollection $itemShippingAddresses */ - public function setCustomerGroup(?CustomerGroupReference $customerGroup): void; + public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void; /** - * @param ?string $country + * @param ?DiscountCodeInfoCollection $discountCodes */ - public function setCountry(?string $country): void; + public function setDiscountCodes(?DiscountCodeInfoCollection $discountCodes): void; /** - * @param ?string $orderState + * @param ?DirectDiscountCollection $directDiscounts */ - public function setOrderState(?string $orderState): void; + public function setDirectDiscounts(?DirectDiscountCollection $directDiscounts): void; /** - * @param ?StateReference $state + * @param ?CartDiscountReferenceCollection $refusedGifts */ - public function setState(?StateReference $state): void; + public function setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts): void; /** - * @param ?string $shipmentState + * @param ?PaymentInfo $paymentInfo */ - public function setShipmentState(?string $shipmentState): void; + public function setPaymentInfo(?PaymentInfo $paymentInfo): void; /** - * @param ?string $paymentState + * @param ?string $country */ - public function setPaymentState(?string $paymentState): void; + public function setCountry(?string $country): void; /** - * @param ?ShippingInfo $shippingInfo + * @param ?string $locale */ - public function setShippingInfo(?ShippingInfo $shippingInfo): void; + public function setLocale(?string $locale): void; /** - * @param ?SyncInfoCollection $syncInfo + * @param ?string $origin */ - public function setSyncInfo(?SyncInfoCollection $syncInfo): void; + public function setOrigin(?string $origin): void; /** - * @param ?ReturnInfoCollection $returnInfo + * @param ?CartReference $cart */ - public function setReturnInfo(?ReturnInfoCollection $returnInfo): void; + public function setCart(?CartReference $cart): void; /** - * @param ?string $purchaseOrderNumber + * @param ?QuoteReference $quote */ - public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void; + public function setQuote(?QuoteReference $quote): void; /** - * @param ?DiscountCodeInfoCollection $discountCodes + * @param ?string $orderState */ - public function setDiscountCodes(?DiscountCodeInfoCollection $discountCodes): void; + public function setOrderState(?string $orderState): void; /** - * @param ?int $lastMessageSequenceNumber + * @param ?string $shipmentState */ - public function setLastMessageSequenceNumber(?int $lastMessageSequenceNumber): void; + public function setShipmentState(?string $shipmentState): void; /** - * @param ?CartReference $cart + * @param ?string $paymentState */ - public function setCart(?CartReference $cart): void; + public function setPaymentState(?string $paymentState): void; /** - * @param ?QuoteReference $quote + * @param ?StateReference $state */ - public function setQuote(?QuoteReference $quote): void; + public function setState(?StateReference $state): void; /** - * @param ?CustomFields $custom + * @param ?SyncInfoCollection $syncInfo */ - public function setCustom(?CustomFields $custom): void; + public function setSyncInfo(?SyncInfoCollection $syncInfo): void; /** - * @param ?PaymentInfo $paymentInfo + * @param ?ReturnInfoCollection $returnInfo */ - public function setPaymentInfo(?PaymentInfo $paymentInfo): void; + public function setReturnInfo(?ReturnInfoCollection $returnInfo): void; /** - * @param ?string $locale + * @param ?int $lastMessageSequenceNumber */ - public function setLocale(?string $locale): void; + public function setLastMessageSequenceNumber(?int $lastMessageSequenceNumber): void; /** - * @param ?string $inventoryMode + * @param ?CustomFields $custom */ - public function setInventoryMode(?string $inventoryMode): void; + public function setCustom(?CustomFields $custom): void; /** - * @param ?string $origin + * @param ?DateTimeImmutable $completedAt */ - public function setOrigin(?string $origin): void; + public function setCompletedAt(?DateTimeImmutable $completedAt): void; /** - * @param ?string $taxCalculationMode + * @param ?DateTimeImmutable $createdAt */ - public function setTaxCalculationMode(?string $taxCalculationMode): void; + public function setCreatedAt(?DateTimeImmutable $createdAt): void; /** - * @param ?ShippingRateInput $shippingRateInput + * @param ?DateTimeImmutable $lastModifiedAt */ - public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void; + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void; /** - * @param ?AddressCollection $itemShippingAddresses + * @param ?LastModifiedBy $lastModifiedBy */ - public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void; + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void; /** - * @param ?CartDiscountReferenceCollection $refusedGifts + * @param ?CreatedBy $createdBy */ - public function setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts): void; + public function setCreatedBy(?CreatedBy $createdBy): void; } diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php index e738da8777b..caac18eb16e 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryAction.php @@ -16,14 +16,14 @@ interface OrderAddDeliveryAction extends OrderUpdateAction { public const FIELD_DELIVERY_KEY = 'deliveryKey'; - public const FIELD_ITEMS = 'items'; public const FIELD_SHIPPING_KEY = 'shippingKey'; + public const FIELD_ITEMS = 'items'; public const FIELD_ADDRESS = 'address'; public const FIELD_PARCELS = 'parcels'; public const FIELD_CUSTOM = 'custom'; /** - *

User-defined unique identifier of a Delivery.

+ *

key of an existing Delivery.

* * @return null|string @@ -31,23 +31,23 @@ interface OrderAddDeliveryAction extends OrderUpdateAction public function getDeliveryKey(); /** + *

key of the ShippingMethod, required for Multiple ShippingMode.

+ * - * @return null|DeliveryItemCollection + * @return null|string */ - public function getItems(); + public function getShippingKey(); /** - *

key of the ShippingMethod, required for Multiple ShippingMode.

+ *

Line Items or Custom Line Items to be included in the Delivery.

* - * @return null|string + * @return null|DeliveryItemCollection */ - public function getShippingKey(); + public function getItems(); /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Address the parcels should be delivered to.

* * @return null|BaseAddress @@ -55,13 +55,16 @@ public function getShippingKey(); public function getAddress(); /** + *

Parcels of the Delivery.

+ *

If provided, this update action produces the Parcel Added To Delivery Message.

+ * * @return null|ParcelDraftCollection */ public function getParcels(); /** - *

Custom Fields for the Transaction.

+ *

Custom Fields for the Delivery.

* * @return null|CustomFieldsDraft @@ -74,14 +77,14 @@ public function getCustom(); public function setDeliveryKey(?string $deliveryKey): void; /** - * @param ?DeliveryItemCollection $items + * @param ?string $shippingKey */ - public function setItems(?DeliveryItemCollection $items): void; + public function setShippingKey(?string $shippingKey): void; /** - * @param ?string $shippingKey + * @param ?DeliveryItemCollection $items */ - public function setShippingKey(?string $shippingKey): void; + public function setItems(?DeliveryItemCollection $items): void; /** * @param ?BaseAddress $address diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php index fc8b3a85101..7ff6903dfc6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionBuilder.php @@ -32,15 +32,15 @@ final class OrderAddDeliveryActionBuilder implements Builder /** - * @var ?DeliveryItemCollection + * @var ?string */ - private $items; + private $shippingKey; /** - * @var ?string + * @var ?DeliveryItemCollection */ - private $shippingKey; + private $items; /** @@ -61,7 +61,7 @@ final class OrderAddDeliveryActionBuilder implements Builder private $custom; /** - *

User-defined unique identifier of a Delivery.

+ *

key of an existing Delivery.

* * @return null|string @@ -72,29 +72,29 @@ public function getDeliveryKey() } /** + *

key of the ShippingMethod, required for Multiple ShippingMode.

+ * - * @return null|DeliveryItemCollection + * @return null|string */ - public function getItems() + public function getShippingKey() { - return $this->items; + return $this->shippingKey; } /** - *

key of the ShippingMethod, required for Multiple ShippingMode.

+ *

Line Items or Custom Line Items to be included in the Delivery.

* - * @return null|string + * @return null|DeliveryItemCollection */ - public function getShippingKey() + public function getItems() { - return $this->shippingKey; + return $this->items; } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Address the parcels should be delivered to.

* * @return null|BaseAddress @@ -105,6 +105,9 @@ public function getAddress() } /** + *

Parcels of the Delivery.

+ *

If provided, this update action produces the Parcel Added To Delivery Message.

+ * * @return null|ParcelDraftCollection */ @@ -114,7 +117,7 @@ public function getParcels() } /** - *

Custom Fields for the Transaction.

+ *

Custom Fields for the Delivery.

* * @return null|CustomFieldsDraft @@ -136,23 +139,23 @@ public function withDeliveryKey(?string $deliveryKey) } /** - * @param ?DeliveryItemCollection $items + * @param ?string $shippingKey * @return $this */ - public function withItems(?DeliveryItemCollection $items) + public function withShippingKey(?string $shippingKey) { - $this->items = $items; + $this->shippingKey = $shippingKey; return $this; } /** - * @param ?string $shippingKey + * @param ?DeliveryItemCollection $items * @return $this */ - public function withShippingKey(?string $shippingKey) + public function withItems(?DeliveryItemCollection $items) { - $this->shippingKey = $shippingKey; + $this->items = $items; return $this; } @@ -216,8 +219,8 @@ public function build(): OrderAddDeliveryAction { return new OrderAddDeliveryActionModel( $this->deliveryKey, - $this->items, $this->shippingKey, + $this->items, $this->address instanceof BaseAddressBuilder ? $this->address->build() : $this->address, $this->parcels, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom diff --git a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php index d5441f4eb33..772cabcb405 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddDeliveryActionModel.php @@ -38,15 +38,15 @@ final class OrderAddDeliveryActionModel extends JsonObjectModel implements Order /** * - * @var ?DeliveryItemCollection + * @var ?string */ - protected $items; + protected $shippingKey; /** * - * @var ?string + * @var ?DeliveryItemCollection */ - protected $shippingKey; + protected $items; /** * @@ -72,16 +72,16 @@ final class OrderAddDeliveryActionModel extends JsonObjectModel implements Order */ public function __construct( ?string $deliveryKey = null, - ?DeliveryItemCollection $items = null, ?string $shippingKey = null, + ?DeliveryItemCollection $items = null, ?BaseAddress $address = null, ?ParcelDraftCollection $parcels = null, ?CustomFieldsDraft $custom = null, ?string $action = null ) { $this->deliveryKey = $deliveryKey; - $this->items = $items; $this->shippingKey = $shippingKey; + $this->items = $items; $this->address = $address; $this->parcels = $parcels; $this->custom = $custom; @@ -107,7 +107,7 @@ public function getAction() } /** - *

User-defined unique identifier of a Delivery.

+ *

key of an existing Delivery.

* * * @return null|string @@ -127,47 +127,47 @@ public function getDeliveryKey() } /** + *

key of the ShippingMethod, required for Multiple ShippingMode.

* - * @return null|DeliveryItemCollection + * + * @return null|string */ - public function getItems() + public function getShippingKey() { - if (is_null($this->items)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_ITEMS); + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); if (is_null($data)) { return null; } - $this->items = DeliveryItemCollection::fromArray($data); + $this->shippingKey = (string) $data; } - return $this->items; + return $this->shippingKey; } /** - *

key of the ShippingMethod, required for Multiple ShippingMode.

+ *

Line Items or Custom Line Items to be included in the Delivery.

* * - * @return null|string + * @return null|DeliveryItemCollection */ - public function getShippingKey() + public function getItems() { - if (is_null($this->shippingKey)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($this->items)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ITEMS); if (is_null($data)) { return null; } - $this->shippingKey = (string) $data; + $this->items = DeliveryItemCollection::fromArray($data); } - return $this->shippingKey; + return $this->items; } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Address the parcels should be delivered to.

* * * @return null|BaseAddress @@ -188,6 +188,9 @@ public function getAddress() } /** + *

Parcels of the Delivery.

+ *

If provided, this update action produces the Parcel Added To Delivery Message.

+ * * * @return null|ParcelDraftCollection */ @@ -206,7 +209,7 @@ public function getParcels() } /** - *

Custom Fields for the Transaction.

+ *

Custom Fields for the Delivery.

* * * @return null|CustomFieldsDraft @@ -236,19 +239,19 @@ public function setDeliveryKey(?string $deliveryKey): void } /** - * @param ?DeliveryItemCollection $items + * @param ?string $shippingKey */ - public function setItems(?DeliveryItemCollection $items): void + public function setShippingKey(?string $shippingKey): void { - $this->items = $items; + $this->shippingKey = $shippingKey; } /** - * @param ?string $shippingKey + * @param ?DeliveryItemCollection $items */ - public function setShippingKey(?string $shippingKey): void + public function setItems(?DeliveryItemCollection $items): void { - $this->shippingKey = $shippingKey; + $this->items = $items; } /** diff --git a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php index 7f7d67059bd..d2b20eda2be 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressAction.php @@ -17,9 +17,8 @@ interface OrderAddItemShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Address to append to itemShippingAddresses. + * The new Address must have a key that is unique across this Order.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php index 06f282b8b46..cffde9c5058 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionBuilder.php @@ -29,9 +29,8 @@ final class OrderAddItemShippingAddressActionBuilder implements Builder private $address; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Address to append to itemShippingAddresses. + * The new Address must have a key that is unique across this Order.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php index 92f4c219ee0..af3e5b45312 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddItemShippingAddressActionModel.php @@ -65,9 +65,8 @@ public function getAction() } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Address to append to itemShippingAddresses. + * The new Address must have a key that is unique across this Order.

* * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryAction.php b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryAction.php index 736f8359f83..bd54bd9ed9a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryAction.php @@ -21,7 +21,8 @@ interface OrderAddParcelToDeliveryAction extends OrderUpdateAction public const FIELD_ITEMS = 'items'; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -29,7 +30,8 @@ interface OrderAddParcelToDeliveryAction extends OrderUpdateAction public function getDeliveryId(); /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -37,24 +39,32 @@ public function getDeliveryId(); public function getDeliveryKey(); /** + *

key of an existing Parcel.

+ * * @return null|string */ public function getParcelKey(); /** + *

Value to set.

+ * * @return null|ParcelMeasurements */ public function getMeasurements(); /** + *

Value to set.

+ * * @return null|TrackingData */ public function getTrackingData(); /** + *

Value to set.

+ * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionBuilder.php index d977cb46cc9..ad16aac6d01 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionBuilder.php @@ -57,7 +57,8 @@ final class OrderAddParcelToDeliveryActionBuilder implements Builder private $items; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -68,7 +69,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -79,6 +81,8 @@ public function getDeliveryKey() } /** + *

key of an existing Parcel.

+ * * @return null|string */ @@ -88,6 +92,8 @@ public function getParcelKey() } /** + *

Value to set.

+ * * @return null|ParcelMeasurements */ @@ -97,6 +103,8 @@ public function getMeasurements() } /** + *

Value to set.

+ * * @return null|TrackingData */ @@ -106,6 +114,8 @@ public function getTrackingData() } /** + *

Value to set.

+ * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionModel.php index 54a07e2bea3..8414fef9d02 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddParcelToDeliveryActionModel.php @@ -103,7 +103,8 @@ public function getAction() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -123,7 +124,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -143,6 +145,8 @@ public function getDeliveryKey() } /** + *

key of an existing Parcel.

+ * * * @return null|string */ @@ -161,6 +165,8 @@ public function getParcelKey() } /** + *

Value to set.

+ * * * @return null|ParcelMeasurements */ @@ -180,6 +186,8 @@ public function getMeasurements() } /** + *

Value to set.

+ * * * @return null|TrackingData */ @@ -199,6 +207,8 @@ public function getTrackingData() } /** + *

Value to set.

+ * * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddPaymentAction.php b/lib/commercetools-api/src/Models/Order/OrderAddPaymentAction.php index d56d582e8b5..75d0682c9b6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddPaymentAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddPaymentAction.php @@ -17,7 +17,8 @@ interface OrderAddPaymentAction extends OrderUpdateAction public const FIELD_PAYMENT = 'payment'; /** - *

ResourceIdentifier of a Payment.

+ *

Payment to add to the PaymentInfo. + * Must not be assigned to another Order or active Cart already.

* * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionBuilder.php index f5d3e04593b..27ad3d4d934 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionBuilder.php @@ -29,7 +29,8 @@ final class OrderAddPaymentActionBuilder implements Builder private $payment; /** - *

ResourceIdentifier of a Payment.

+ *

Payment to add to the PaymentInfo. + * Must not be assigned to another Order or active Cart already.

* * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionModel.php index 40576869b06..ad63898b217 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddPaymentActionModel.php @@ -65,7 +65,8 @@ public function getAction() } /** - *

ResourceIdentifier of a Payment.

+ *

Payment to add to the PaymentInfo. + * Must not be assigned to another Order or active Cart already.

* * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoAction.php b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoAction.php index 1203124ac83..81be79dffe3 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoAction.php @@ -19,18 +19,26 @@ interface OrderAddReturnInfoAction extends OrderUpdateAction public const FIELD_RETURN_DATE = 'returnDate'; /** + *

Value to set.

+ * * @return null|string */ public function getReturnTrackingId(); /** + *

Items to be returned. + * Must not be empty.

+ * * @return null|ReturnItemDraftCollection */ public function getItems(); /** + *

Value to set. + * If not set, it defaults to the current date and time.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionBuilder.php index b556ce578aa..c757dfb422d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionBuilder.php @@ -40,6 +40,8 @@ final class OrderAddReturnInfoActionBuilder implements Builder private $returnDate; /** + *

Value to set.

+ * * @return null|string */ @@ -49,6 +51,9 @@ public function getReturnTrackingId() } /** + *

Items to be returned. + * Must not be empty.

+ * * @return null|ReturnItemDraftCollection */ @@ -58,6 +63,9 @@ public function getItems() } /** + *

Value to set. + * If not set, it defaults to the current date and time.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionModel.php b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionModel.php index 493b3083198..a848695a533 100644 --- a/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderAddReturnInfoActionModel.php @@ -80,6 +80,8 @@ public function getAction() } /** + *

Value to set.

+ * * * @return null|string */ @@ -98,6 +100,9 @@ public function getReturnTrackingId() } /** + *

Items to be returned. + * Must not be empty.

+ * * * @return null|ReturnItemDraftCollection */ @@ -116,6 +121,9 @@ public function getItems() } /** + *

Value to set. + * If not set, it defaults to the current date and time.

+ * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/OrderBuilder.php b/lib/commercetools-api/src/Models/Order/OrderBuilder.php index e5dc86f3a4f..5d48a925831 100644 --- a/lib/commercetools-api/src/Models/Order/OrderBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderBuilder.php @@ -13,6 +13,7 @@ use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceBuilder; use Commercetools\Api\Models\Cart\CustomLineItemCollection; +use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; use Commercetools\Api\Models\Cart\LineItemCollection; use Commercetools\Api\Models\Cart\ShippingCollection; @@ -85,39 +86,33 @@ final class OrderBuilder implements Builder /** - * @var null|LastModifiedBy|LastModifiedByBuilder - */ - private $lastModifiedBy; - - /** - - * @var null|CreatedBy|CreatedByBuilder + * @var ?string */ - private $createdBy; + private $orderNumber; /** - * @var ?DateTimeImmutable + * @var ?string */ - private $completedAt; + private $purchaseOrderNumber; /** * @var ?string */ - private $orderNumber; + private $customerId; /** * @var ?string */ - private $customerId; + private $customerEmail; /** - * @var ?string + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ - private $customerEmail; + private $customerGroup; /** @@ -169,123 +164,123 @@ final class OrderBuilder implements Builder /** - * @var null|Address|AddressBuilder + * @var ?string */ - private $shippingAddress; + private $taxMode; /** - * @var null|Address|AddressBuilder + * @var ?string */ - private $billingAddress; + private $taxRoundingMode; /** * @var ?string */ - private $shippingMode; + private $taxCalculationMode; /** * @var ?string */ - private $shippingKey; + private $inventoryMode; /** - * @var null|CustomFields|CustomFieldsBuilder + * @var null|Address|AddressBuilder */ - private $shippingCustomFields; + private $billingAddress; /** - * @var ?ShippingCollection + * @var null|Address|AddressBuilder */ - private $shipping; + private $shippingAddress; /** * @var ?string */ - private $taxMode; + private $shippingMode; /** * @var ?string */ - private $taxRoundingMode; + private $shippingKey; /** - * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder + * @var null|ShippingInfo|ShippingInfoBuilder */ - private $customerGroup; + private $shippingInfo; /** - * @var ?string + * @var null|ShippingRateInput|ShippingRateInputBuilder */ - private $country; + private $shippingRateInput; /** - * @var ?string + * @var null|CustomFields|CustomFieldsBuilder */ - private $orderState; + private $shippingCustomFields; /** - * @var null|StateReference|StateReferenceBuilder + * @var ?ShippingCollection */ - private $state; + private $shipping; /** - * @var ?string + * @var ?AddressCollection */ - private $shipmentState; + private $itemShippingAddresses; /** - * @var ?string + * @var ?DiscountCodeInfoCollection */ - private $paymentState; + private $discountCodes; /** - * @var null|ShippingInfo|ShippingInfoBuilder + * @var ?DirectDiscountCollection */ - private $shippingInfo; + private $directDiscounts; /** - * @var ?SyncInfoCollection + * @var ?CartDiscountReferenceCollection */ - private $syncInfo; + private $refusedGifts; /** - * @var ?ReturnInfoCollection + * @var null|PaymentInfo|PaymentInfoBuilder */ - private $returnInfo; + private $paymentInfo; /** * @var ?string */ - private $purchaseOrderNumber; + private $country; /** - * @var ?DiscountCodeInfoCollection + * @var ?string */ - private $discountCodes; + private $locale; /** - * @deprecated - * @var ?int + + * @var ?string */ - private $lastMessageSequenceNumber; + private $origin; /** @@ -301,57 +296,69 @@ final class OrderBuilder implements Builder /** - * @var null|CustomFields|CustomFieldsBuilder + * @var ?string */ - private $custom; + private $orderState; /** - * @var null|PaymentInfo|PaymentInfoBuilder + * @var ?string */ - private $paymentInfo; + private $shipmentState; /** * @var ?string */ - private $locale; + private $paymentState; /** - * @var ?string + * @var null|StateReference|StateReferenceBuilder */ - private $inventoryMode; + private $state; /** - * @var ?string + * @var ?SyncInfoCollection */ - private $origin; + private $syncInfo; /** - * @var ?string + * @var ?ReturnInfoCollection */ - private $taxCalculationMode; + private $returnInfo; /** + * @deprecated + * @var ?int + */ + private $lastMessageSequenceNumber; - * @var null|ShippingRateInput|ShippingRateInputBuilder + /** + + * @var null|CustomFields|CustomFieldsBuilder */ - private $shippingRateInput; + private $custom; /** - * @var ?AddressCollection + * @var ?DateTimeImmutable */ - private $itemShippingAddresses; + private $completedAt; /** - * @var ?CartDiscountReferenceCollection + * @var null|LastModifiedBy|LastModifiedByBuilder */ - private $refusedGifts; + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; /** *

Unique identifier of the Order.

@@ -365,7 +372,7 @@ public function getId() } /** - *

The current version of the order.

+ *

Current version of the Order.

* * @return null|int @@ -376,6 +383,8 @@ public function getVersion() } /** + *

Date and time (UTC) the Order was initially created.

+ * * @return null|DateTimeImmutable */ @@ -385,6 +394,8 @@ public function getCreatedAt() } /** + *

Date and time (UTC) the Order was last updated.

+ * * @return null|DateTimeImmutable */ @@ -394,72 +405,64 @@ public function getLastModifiedAt() } /** - *

Present on resources created after 1 February 2019 except for events not tracked.

- * - - * @return null|LastModifiedBy - */ - public function getLastModifiedBy() - { - return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; - } - - /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

User-defined identifier of the Order that is unique across a Project.

* - * @return null|CreatedBy + * @return null|string */ - public function getCreatedBy() + public function getOrderNumber() { - return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + return $this->orderNumber; } /** - *

This field will only be present if it was set for Order Import

+ *

User-defined identifier of a purchase Order.

+ *

It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow.

* - * @return null|DateTimeImmutable + * @return null|string */ - public function getCompletedAt() + public function getPurchaseOrderNumber() { - return $this->completedAt; + return $this->purchaseOrderNumber; } /** - *

String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed.

+ *

id of the Customer that the Order belongs to.

* * @return null|string */ - public function getOrderNumber() + public function getCustomerId() { - return $this->orderNumber; + return $this->customerId; } /** + *

Email address of the Customer that the Order belongs to.

+ * * @return null|string */ - public function getCustomerId() + public function getCustomerEmail() { - return $this->customerId; + return $this->customerEmail; } /** + *

Reference to the Customer Group of the Customer that the Order belongs to. + * Used for LineItem Price selection.

+ * - * @return null|string + * @return null|CustomerGroupReference */ - public function getCustomerEmail() + public function getCustomerGroup() { - return $this->customerEmail; + return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup; } /** - *

Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

+ *

Anonymous session associated with the Order.

* * @return null|string @@ -470,7 +473,7 @@ public function getAnonymousId() } /** - *

The Business Unit the Order belongs to.

+ *

Reference to a Business Unit the Order belongs to.

* * @return null|BusinessUnitKeyReference @@ -481,6 +484,8 @@ public function getBusinessUnit() } /** + *

Reference to a Store the Order belongs to.

+ * * @return null|StoreKeyReference */ @@ -490,6 +495,8 @@ public function getStore() } /** + *

Line Items that are part of the Order.

+ * * @return null|LineItemCollection */ @@ -499,6 +506,8 @@ public function getLineItems() } /** + *

Custom Line Items that are part of the Order.

+ * * @return null|CustomLineItemCollection */ @@ -508,6 +517,9 @@ public function getCustomLineItems() } /** + *

Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo. + * Taxes are included if TaxRate includedInPrice is true for each price.

+ * * @return null|TypedMoney */ @@ -517,7 +529,10 @@ public function getTotalPrice() } /** - *

The taxes are calculated based on the shipping address.

+ *
    + *
  • For Platform TaxMode, it is automatically set when a shipping address is set.
  • + *
  • For External TaxMode, it is automatically set when the external Tax Rate for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.
  • + *
* * @return null|TaxedPrice @@ -528,8 +543,7 @@ public function getTaxedPrice() } /** - *

Sum of taxedPrice of ShippingInfo across all Shipping Methods. - * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

+ *

Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

* * @return null|TaxedPrice @@ -540,219 +554,241 @@ public function getTaxedShippingPrice() } /** - *

Holds all shipping-related information per Shipping Method.

- *

For Multiple ShippingMode, it is updated automatically after the Shipping Methods are added.

+ *

Indicates how Tax Rates are set.

* - * @return null|Address + * @return null|string */ - public function getShippingAddress() + public function getTaxMode() { - return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + return $this->taxMode; } /** + *

Indicates how monetary values are rounded when calculating taxes for taxedPrice.

+ * - * @return null|Address + * @return null|string */ - public function getBillingAddress() + public function getTaxRoundingMode() { - return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress; + return $this->taxRoundingMode; } /** - *

Indicates whether one or multiple Shipping Methods are added to the Cart.

+ *

Indicates how taxes are calculated when calculating taxes for taxedPrice.

* * @return null|string */ - public function getShippingMode() + public function getTaxCalculationMode() { - return $this->shippingMode; + return $this->taxCalculationMode; } /** - *

key of the ShippingMethod for Single ShippingMode.

+ *

Indicates how stock quantities are tracked for Line Items in the Order.

* * @return null|string */ - public function getShippingKey() + public function getInventoryMode() { - return $this->shippingKey; + return $this->inventoryMode; } /** - *

Custom Fields of the Shipping Method for Single ShippingMode.

+ *

Billing address associated with the Order.

* - * @return null|CustomFields + * @return null|Address */ - public function getShippingCustomFields() + public function getBillingAddress() { - return $this->shippingCustomFields instanceof CustomFieldsBuilder ? $this->shippingCustomFields->build() : $this->shippingCustomFields; + return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress; } /** - *

Holds all shipping-related information per Shipping Method for Multiple ShippingMode.

- *

It is updated automatically after the Shipping Method is added.

+ *

Shipping address associated with the Order. + * Determines eligible ShippingMethod rates and Tax Rates of Line Items.

* - * @return null|ShippingCollection + * @return null|Address */ - public function getShipping() + public function getShippingAddress() { - return $this->shipping; + return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; } /** + *

Indicates whether there can be one or multiple Shipping Methods.

+ * * @return null|string */ - public function getTaxMode() + public function getShippingMode() { - return $this->taxMode; + return $this->shippingMode; } /** - *

When calculating taxes for taxedPrice, the selected mode is used for rouding.

+ *

key of the ShippingMethod for Single ShippingMode.

* * @return null|string */ - public function getTaxRoundingMode() + public function getShippingKey() { - return $this->taxRoundingMode; + return $this->shippingKey; } /** - *

Set when the customer is set and the customer is a member of a customer group. - * Used for product variant price selection.

+ *

Shipping-related information for Single ShippingMode. + * Automatically set when a Shipping Method is set.

* - * @return null|CustomerGroupReference + * @return null|ShippingInfo */ - public function getCustomerGroup() + public function getShippingInfo() { - return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup; + return $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo; } /** - *

A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

+ *

Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

+ * * - * @return null|string + * @return null|ShippingRateInput */ - public function getCountry() + public function getShippingRateInput() { - return $this->country; + return $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; } /** - *

One of the four predefined OrderStates.

+ *

Custom Fields of the Shipping Method for Single ShippingMode.

* - * @return null|string + * @return null|CustomFields */ - public function getOrderState() + public function getShippingCustomFields() { - return $this->orderState; + return $this->shippingCustomFields instanceof CustomFieldsBuilder ? $this->shippingCustomFields->build() : $this->shippingCustomFields; } /** - *

This reference can point to a state in a custom workflow.

+ *

Shipping-related information for Multiple ShippingMode. + * Updated automatically each time a new Shipping Method is added.

* - * @return null|StateReference + * @return null|ShippingCollection */ - public function getState() + public function getShipping() { - return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + return $this->shipping; } /** + *

Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. + * Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

+ * - * @return null|string + * @return null|AddressCollection */ - public function getShipmentState() + public function getItemShippingAddresses() { - return $this->shipmentState; + return $this->itemShippingAddresses; } /** + *

Discount Codes added to the Order. + * An Order that has directDiscounts cannot have discountCodes.

+ * - * @return null|string + * @return null|DiscountCodeInfoCollection */ - public function getPaymentState() + public function getDiscountCodes() { - return $this->paymentState; + return $this->discountCodes; } /** - *

Set if the ShippingMethod is set.

+ *

Direct Discounts added to the Order. + * An Order that has discountCodes cannot have directDiscounts.

* - * @return null|ShippingInfo + * @return null|DirectDiscountCollection */ - public function getShippingInfo() + public function getDirectDiscounts() { - return $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo; + return $this->directDiscounts; } /** + *

Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

+ * - * @return null|SyncInfoCollection + * @return null|CartDiscountReferenceCollection */ - public function getSyncInfo() + public function getRefusedGifts() { - return $this->syncInfo; + return $this->refusedGifts; } /** + *

Payment information related to the Order.

+ * - * @return null|ReturnInfoCollection + * @return null|PaymentInfo */ - public function getReturnInfo() + public function getPaymentInfo() { - return $this->returnInfo; + return $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo; } /** - *

The Purchase Order Number is typically set by the Buyer on a QuoteRequest to - * track the purchase order during the quote and order flow.

+ *

Used for LineItem Price selection.

* * @return null|string */ - public function getPurchaseOrderNumber() + public function getCountry() { - return $this->purchaseOrderNumber; + return $this->country; } /** + *

Languages of the Order. + * Can only contain languages supported by the Project.

+ * - * @return null|DiscountCodeInfoCollection + * @return null|string */ - public function getDiscountCodes() + public function getLocale() { - return $this->discountCodes; + return $this->locale; } /** - *

Internal-only field.

+ *

Indicates the origin of the Cart from which the Order was created.

* - * @deprecated - * @return null|int + + * @return null|string */ - public function getLastMessageSequenceNumber() + public function getOrigin() { - return $this->lastMessageSequenceNumber; + return $this->origin; } /** - *

Set when this order was created from a cart. - * The cart will have the state Ordered.

+ *

Reference to the Cart for an Order created from Cart. + * The referenced Cart will have the Ordered CartState.

* * @return null|CartReference @@ -763,7 +799,7 @@ public function getCart() } /** - *

Set when this order was created from a quote.

+ *

Reference to the Quote for an Order created from Quote.

* * @return null|QuoteReference @@ -774,98 +810,127 @@ public function getQuote() } /** + *

Current status of the Order.

+ * - * @return null|CustomFields + * @return null|string */ - public function getCustom() + public function getOrderState() { - return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; + return $this->orderState; } /** + *

Shipment status of the Order.

+ * - * @return null|PaymentInfo + * @return null|string */ - public function getPaymentInfo() + public function getShipmentState() { - return $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo; + return $this->shipmentState; } /** + *

Payment status of the Order.

+ * * @return null|string */ - public function getLocale() + public function getPaymentState() { - return $this->locale; + return $this->paymentState; } /** + *

State of the Order. + * This reference can point to a State in a custom workflow.

+ * - * @return null|string + * @return null|StateReference */ - public function getInventoryMode() + public function getState() { - return $this->inventoryMode; + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; } /** + *

Contains synchronization activity information of the Order (like export or import). + * Can only be set with Update SyncInfo update action.

+ * - * @return null|string + * @return null|SyncInfoCollection */ - public function getOrigin() + public function getSyncInfo() { - return $this->origin; + return $this->syncInfo; } /** - *

When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

+ *

Contains information regarding the returns associated with the Order.

* - * @return null|string + * @return null|ReturnInfoCollection */ - public function getTaxCalculationMode() + public function getReturnInfo() { - return $this->taxCalculationMode; + return $this->returnInfo; } /** - *

Input used to select a ShippingRatePriceTier. - * The data type of this field depends on the shippingRateInputType.type configured in the Project:

- * + *

Internal-only field.

* + * @deprecated + * @return null|int + */ + public function getLastMessageSequenceNumber() + { + return $this->lastMessageSequenceNumber; + } - * @return null|ShippingRateInput + /** + *

Custom Fields of the Order.

+ * + + * @return null|CustomFields */ - public function getShippingRateInput() + public function getCustom() { - return $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; + return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; } /** - *

Contains addresses for orders with multiple shipping addresses.

+ *

User-defined date and time (UTC) of the Order. + * Present only on an Order created using Order Import.

* - * @return null|AddressCollection + * @return null|DateTimeImmutable */ - public function getItemShippingAddresses() + public function getCompletedAt() { - return $this->itemShippingAddresses; + return $this->completedAt; } /** - *

Automatically filled when a line item with LineItemMode GiftLineItem is removed from this order.

+ *

Present on resources created after 1 February 2019 except for events not tracked.

* - * @return null|CartDiscountReferenceCollection + * @return null|LastModifiedBy */ - public function getRefusedGifts() + public function getLastModifiedBy() { - return $this->refusedGifts; + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; } /** @@ -913,67 +978,56 @@ public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) } /** - * @param ?LastModifiedBy $lastModifiedBy - * @return $this - */ - public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) - { - $this->lastModifiedBy = $lastModifiedBy; - - return $this; - } - - /** - * @param ?CreatedBy $createdBy + * @param ?string $orderNumber * @return $this */ - public function withCreatedBy(?CreatedBy $createdBy) + public function withOrderNumber(?string $orderNumber) { - $this->createdBy = $createdBy; + $this->orderNumber = $orderNumber; return $this; } /** - * @param ?DateTimeImmutable $completedAt + * @param ?string $purchaseOrderNumber * @return $this */ - public function withCompletedAt(?DateTimeImmutable $completedAt) + public function withPurchaseOrderNumber(?string $purchaseOrderNumber) { - $this->completedAt = $completedAt; + $this->purchaseOrderNumber = $purchaseOrderNumber; return $this; } /** - * @param ?string $orderNumber + * @param ?string $customerId * @return $this */ - public function withOrderNumber(?string $orderNumber) + public function withCustomerId(?string $customerId) { - $this->orderNumber = $orderNumber; + $this->customerId = $customerId; return $this; } /** - * @param ?string $customerId + * @param ?string $customerEmail * @return $this */ - public function withCustomerId(?string $customerId) + public function withCustomerEmail(?string $customerEmail) { - $this->customerId = $customerId; + $this->customerEmail = $customerEmail; return $this; } /** - * @param ?string $customerEmail + * @param ?CustomerGroupReference $customerGroup * @return $this */ - public function withCustomerEmail(?string $customerEmail) + public function withCustomerGroup(?CustomerGroupReference $customerGroup) { - $this->customerEmail = $customerEmail; + $this->customerGroup = $customerGroup; return $this; } @@ -1067,221 +1121,221 @@ public function withTaxedShippingPrice(?TaxedPrice $taxedShippingPrice) } /** - * @param ?Address $shippingAddress + * @param ?string $taxMode * @return $this */ - public function withShippingAddress(?Address $shippingAddress) + public function withTaxMode(?string $taxMode) { - $this->shippingAddress = $shippingAddress; + $this->taxMode = $taxMode; return $this; } /** - * @param ?Address $billingAddress + * @param ?string $taxRoundingMode * @return $this */ - public function withBillingAddress(?Address $billingAddress) + public function withTaxRoundingMode(?string $taxRoundingMode) { - $this->billingAddress = $billingAddress; + $this->taxRoundingMode = $taxRoundingMode; return $this; } /** - * @param ?string $shippingMode + * @param ?string $taxCalculationMode * @return $this */ - public function withShippingMode(?string $shippingMode) + public function withTaxCalculationMode(?string $taxCalculationMode) { - $this->shippingMode = $shippingMode; + $this->taxCalculationMode = $taxCalculationMode; return $this; } /** - * @param ?string $shippingKey + * @param ?string $inventoryMode * @return $this */ - public function withShippingKey(?string $shippingKey) + public function withInventoryMode(?string $inventoryMode) { - $this->shippingKey = $shippingKey; + $this->inventoryMode = $inventoryMode; return $this; } /** - * @param ?CustomFields $shippingCustomFields + * @param ?Address $billingAddress * @return $this */ - public function withShippingCustomFields(?CustomFields $shippingCustomFields) + public function withBillingAddress(?Address $billingAddress) { - $this->shippingCustomFields = $shippingCustomFields; + $this->billingAddress = $billingAddress; return $this; } /** - * @param ?ShippingCollection $shipping + * @param ?Address $shippingAddress * @return $this */ - public function withShipping(?ShippingCollection $shipping) + public function withShippingAddress(?Address $shippingAddress) { - $this->shipping = $shipping; + $this->shippingAddress = $shippingAddress; return $this; } /** - * @param ?string $taxMode + * @param ?string $shippingMode * @return $this */ - public function withTaxMode(?string $taxMode) + public function withShippingMode(?string $shippingMode) { - $this->taxMode = $taxMode; + $this->shippingMode = $shippingMode; return $this; } /** - * @param ?string $taxRoundingMode + * @param ?string $shippingKey * @return $this */ - public function withTaxRoundingMode(?string $taxRoundingMode) + public function withShippingKey(?string $shippingKey) { - $this->taxRoundingMode = $taxRoundingMode; + $this->shippingKey = $shippingKey; return $this; } /** - * @param ?CustomerGroupReference $customerGroup + * @param ?ShippingInfo $shippingInfo * @return $this */ - public function withCustomerGroup(?CustomerGroupReference $customerGroup) + public function withShippingInfo(?ShippingInfo $shippingInfo) { - $this->customerGroup = $customerGroup; + $this->shippingInfo = $shippingInfo; return $this; } /** - * @param ?string $country + * @param ?ShippingRateInput $shippingRateInput * @return $this */ - public function withCountry(?string $country) + public function withShippingRateInput(?ShippingRateInput $shippingRateInput) { - $this->country = $country; + $this->shippingRateInput = $shippingRateInput; return $this; } /** - * @param ?string $orderState + * @param ?CustomFields $shippingCustomFields * @return $this */ - public function withOrderState(?string $orderState) + public function withShippingCustomFields(?CustomFields $shippingCustomFields) { - $this->orderState = $orderState; + $this->shippingCustomFields = $shippingCustomFields; return $this; } /** - * @param ?StateReference $state + * @param ?ShippingCollection $shipping * @return $this */ - public function withState(?StateReference $state) + public function withShipping(?ShippingCollection $shipping) { - $this->state = $state; + $this->shipping = $shipping; return $this; } /** - * @param ?string $shipmentState + * @param ?AddressCollection $itemShippingAddresses * @return $this */ - public function withShipmentState(?string $shipmentState) + public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses) { - $this->shipmentState = $shipmentState; + $this->itemShippingAddresses = $itemShippingAddresses; return $this; } /** - * @param ?string $paymentState + * @param ?DiscountCodeInfoCollection $discountCodes * @return $this */ - public function withPaymentState(?string $paymentState) + public function withDiscountCodes(?DiscountCodeInfoCollection $discountCodes) { - $this->paymentState = $paymentState; + $this->discountCodes = $discountCodes; return $this; } /** - * @param ?ShippingInfo $shippingInfo + * @param ?DirectDiscountCollection $directDiscounts * @return $this */ - public function withShippingInfo(?ShippingInfo $shippingInfo) + public function withDirectDiscounts(?DirectDiscountCollection $directDiscounts) { - $this->shippingInfo = $shippingInfo; + $this->directDiscounts = $directDiscounts; return $this; } /** - * @param ?SyncInfoCollection $syncInfo + * @param ?CartDiscountReferenceCollection $refusedGifts * @return $this */ - public function withSyncInfo(?SyncInfoCollection $syncInfo) + public function withRefusedGifts(?CartDiscountReferenceCollection $refusedGifts) { - $this->syncInfo = $syncInfo; + $this->refusedGifts = $refusedGifts; return $this; } /** - * @param ?ReturnInfoCollection $returnInfo + * @param ?PaymentInfo $paymentInfo * @return $this */ - public function withReturnInfo(?ReturnInfoCollection $returnInfo) + public function withPaymentInfo(?PaymentInfo $paymentInfo) { - $this->returnInfo = $returnInfo; + $this->paymentInfo = $paymentInfo; return $this; } /** - * @param ?string $purchaseOrderNumber + * @param ?string $country * @return $this */ - public function withPurchaseOrderNumber(?string $purchaseOrderNumber) + public function withCountry(?string $country) { - $this->purchaseOrderNumber = $purchaseOrderNumber; + $this->country = $country; return $this; } /** - * @param ?DiscountCodeInfoCollection $discountCodes + * @param ?string $locale * @return $this */ - public function withDiscountCodes(?DiscountCodeInfoCollection $discountCodes) + public function withLocale(?string $locale) { - $this->discountCodes = $discountCodes; + $this->locale = $locale; return $this; } /** - * @param ?int $lastMessageSequenceNumber + * @param ?string $origin * @return $this */ - public function withLastMessageSequenceNumber(?int $lastMessageSequenceNumber) + public function withOrigin(?string $origin) { - $this->lastMessageSequenceNumber = $lastMessageSequenceNumber; + $this->origin = $origin; return $this; } @@ -1309,109 +1363,109 @@ public function withQuote(?QuoteReference $quote) } /** - * @param ?CustomFields $custom + * @param ?string $orderState * @return $this */ - public function withCustom(?CustomFields $custom) + public function withOrderState(?string $orderState) { - $this->custom = $custom; + $this->orderState = $orderState; return $this; } /** - * @param ?PaymentInfo $paymentInfo + * @param ?string $shipmentState * @return $this */ - public function withPaymentInfo(?PaymentInfo $paymentInfo) + public function withShipmentState(?string $shipmentState) { - $this->paymentInfo = $paymentInfo; + $this->shipmentState = $shipmentState; return $this; } /** - * @param ?string $locale + * @param ?string $paymentState * @return $this */ - public function withLocale(?string $locale) + public function withPaymentState(?string $paymentState) { - $this->locale = $locale; + $this->paymentState = $paymentState; return $this; } /** - * @param ?string $inventoryMode + * @param ?StateReference $state * @return $this */ - public function withInventoryMode(?string $inventoryMode) + public function withState(?StateReference $state) { - $this->inventoryMode = $inventoryMode; + $this->state = $state; return $this; } /** - * @param ?string $origin + * @param ?SyncInfoCollection $syncInfo * @return $this */ - public function withOrigin(?string $origin) + public function withSyncInfo(?SyncInfoCollection $syncInfo) { - $this->origin = $origin; + $this->syncInfo = $syncInfo; return $this; } /** - * @param ?string $taxCalculationMode + * @param ?ReturnInfoCollection $returnInfo * @return $this */ - public function withTaxCalculationMode(?string $taxCalculationMode) + public function withReturnInfo(?ReturnInfoCollection $returnInfo) { - $this->taxCalculationMode = $taxCalculationMode; + $this->returnInfo = $returnInfo; return $this; } /** - * @param ?ShippingRateInput $shippingRateInput + * @param ?int $lastMessageSequenceNumber * @return $this */ - public function withShippingRateInput(?ShippingRateInput $shippingRateInput) + public function withLastMessageSequenceNumber(?int $lastMessageSequenceNumber) { - $this->shippingRateInput = $shippingRateInput; + $this->lastMessageSequenceNumber = $lastMessageSequenceNumber; return $this; } /** - * @param ?AddressCollection $itemShippingAddresses + * @param ?CustomFields $custom * @return $this */ - public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses) + public function withCustom(?CustomFields $custom) { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->custom = $custom; return $this; } /** - * @param ?CartDiscountReferenceCollection $refusedGifts + * @param ?DateTimeImmutable $completedAt * @return $this */ - public function withRefusedGifts(?CartDiscountReferenceCollection $refusedGifts) + public function withCompletedAt(?DateTimeImmutable $completedAt) { - $this->refusedGifts = $refusedGifts; + $this->completedAt = $completedAt; return $this; } /** - * @deprecated use withLastModifiedBy() instead + * @param ?LastModifiedBy $lastModifiedBy * @return $this */ - public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) { $this->lastModifiedBy = $lastModifiedBy; @@ -1419,16 +1473,27 @@ public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy } /** - * @deprecated use withCreatedBy() instead + * @param ?CreatedBy $createdBy * @return $this */ - public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + public function withCreatedBy(?CreatedBy $createdBy) { $this->createdBy = $createdBy; return $this; } + /** + * @deprecated use withCustomerGroup() instead + * @return $this + */ + public function withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup) + { + $this->customerGroup = $customerGroup; + + return $this; + } + /** * @deprecated use withBusinessUnit() instead * @return $this @@ -1485,67 +1550,67 @@ public function withTaxedShippingPriceBuilder(?TaxedPriceBuilder $taxedShippingP } /** - * @deprecated use withShippingAddress() instead + * @deprecated use withBillingAddress() instead * @return $this */ - public function withShippingAddressBuilder(?AddressBuilder $shippingAddress) + public function withBillingAddressBuilder(?AddressBuilder $billingAddress) { - $this->shippingAddress = $shippingAddress; + $this->billingAddress = $billingAddress; return $this; } /** - * @deprecated use withBillingAddress() instead + * @deprecated use withShippingAddress() instead * @return $this */ - public function withBillingAddressBuilder(?AddressBuilder $billingAddress) + public function withShippingAddressBuilder(?AddressBuilder $shippingAddress) { - $this->billingAddress = $billingAddress; + $this->shippingAddress = $shippingAddress; return $this; } /** - * @deprecated use withShippingCustomFields() instead + * @deprecated use withShippingInfo() instead * @return $this */ - public function withShippingCustomFieldsBuilder(?CustomFieldsBuilder $shippingCustomFields) + public function withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo) { - $this->shippingCustomFields = $shippingCustomFields; + $this->shippingInfo = $shippingInfo; return $this; } /** - * @deprecated use withCustomerGroup() instead + * @deprecated use withShippingRateInput() instead * @return $this */ - public function withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup) + public function withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput) { - $this->customerGroup = $customerGroup; + $this->shippingRateInput = $shippingRateInput; return $this; } /** - * @deprecated use withState() instead + * @deprecated use withShippingCustomFields() instead * @return $this */ - public function withStateBuilder(?StateReferenceBuilder $state) + public function withShippingCustomFieldsBuilder(?CustomFieldsBuilder $shippingCustomFields) { - $this->state = $state; + $this->shippingCustomFields = $shippingCustomFields; return $this; } /** - * @deprecated use withShippingInfo() instead + * @deprecated use withPaymentInfo() instead * @return $this */ - public function withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo) + public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo) { - $this->shippingInfo = $shippingInfo; + $this->paymentInfo = $paymentInfo; return $this; } @@ -1572,6 +1637,17 @@ public function withQuoteBuilder(?QuoteReferenceBuilder $quote) return $this; } + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + /** * @deprecated use withCustom() instead * @return $this @@ -1584,23 +1660,23 @@ public function withCustomBuilder(?CustomFieldsBuilder $custom) } /** - * @deprecated use withPaymentInfo() instead + * @deprecated use withLastModifiedBy() instead * @return $this */ - public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo) + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) { - $this->paymentInfo = $paymentInfo; + $this->lastModifiedBy = $lastModifiedBy; return $this; } /** - * @deprecated use withShippingRateInput() instead + * @deprecated use withCreatedBy() instead * @return $this */ - public function withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput) + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) { - $this->shippingRateInput = $shippingRateInput; + $this->createdBy = $createdBy; return $this; } @@ -1612,12 +1688,11 @@ public function build(): Order $this->version, $this->createdAt, $this->lastModifiedAt, - $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, - $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, - $this->completedAt, $this->orderNumber, + $this->purchaseOrderNumber, $this->customerId, $this->customerEmail, + $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, $this->anonymousId, $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit, $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store, @@ -1626,37 +1701,39 @@ public function build(): Order $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, $this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice, - $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->taxMode, + $this->taxRoundingMode, + $this->taxCalculationMode, + $this->inventoryMode, $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress, + $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, $this->shippingMode, $this->shippingKey, + $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo, + $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, $this->shippingCustomFields instanceof CustomFieldsBuilder ? $this->shippingCustomFields->build() : $this->shippingCustomFields, $this->shipping, - $this->taxMode, - $this->taxRoundingMode, - $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, + $this->itemShippingAddresses, + $this->discountCodes, + $this->directDiscounts, + $this->refusedGifts, + $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo, $this->country, + $this->locale, + $this->origin, + $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart, + $this->quote instanceof QuoteReferenceBuilder ? $this->quote->build() : $this->quote, $this->orderState, - $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, $this->shipmentState, $this->paymentState, - $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, $this->syncInfo, $this->returnInfo, - $this->purchaseOrderNumber, - $this->discountCodes, $this->lastMessageSequenceNumber, - $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart, - $this->quote instanceof QuoteReferenceBuilder ? $this->quote->build() : $this->quote, $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, - $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo, - $this->locale, - $this->inventoryMode, - $this->origin, - $this->taxCalculationMode, - $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, - $this->itemShippingAddresses, - $this->refusedGifts + $this->completedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy ); } diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateAction.php b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateAction.php index 9b1e4d1439f..edff5fb9c39 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateAction.php @@ -16,6 +16,8 @@ interface OrderChangeOrderStateAction extends OrderUpdateAction public const FIELD_ORDER_STATE = 'orderState'; /** + *

New status of the Order.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionBuilder.php index 28ec7c040fe..3b0f7f62ca7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionBuilder.php @@ -27,6 +27,8 @@ final class OrderChangeOrderStateActionBuilder implements Builder private $orderState; /** + *

New status of the Order.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionModel.php index 8977a7325a8..81edf6ef45b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeOrderStateActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

New status of the Order.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateAction.php b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateAction.php index db06b37be93..061e37bce1d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateAction.php @@ -16,6 +16,8 @@ interface OrderChangePaymentStateAction extends OrderUpdateAction public const FIELD_PAYMENT_STATE = 'paymentState'; /** + *

New payment status of the Order.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionBuilder.php index f8071ff1161..b76569367df 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionBuilder.php @@ -27,6 +27,8 @@ final class OrderChangePaymentStateActionBuilder implements Builder private $paymentState; /** + *

New payment status of the Order.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionModel.php index da6aa197fbb..39f90d962b4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangePaymentStateActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

New payment status of the Order.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateAction.php b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateAction.php index 4d8d00f24da..4e5c3bdf401 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateAction.php @@ -16,6 +16,8 @@ interface OrderChangeShipmentStateAction extends OrderUpdateAction public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** + *

New shipment status of the Order.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionBuilder.php index 2b6575692a7..026d786016a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionBuilder.php @@ -27,6 +27,8 @@ final class OrderChangeShipmentStateActionBuilder implements Builder private $shipmentState; /** + *

New shipment status of the Order.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionModel.php index ad00204e01a..f2e2a7f055d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderChangeShipmentStateActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

New shipment status of the Order.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderFromCartDraft.php b/lib/commercetools-api/src/Models/Order/OrderFromCartDraft.php index 8ef0d447d3b..997706a11b0 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromCartDraft.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromCartDraft.php @@ -28,7 +28,7 @@ interface OrderFromCartDraft extends JsonObject public const FIELD_CUSTOM = 'custom'; /** - *

Unique identifier of the Cart from which you can create an Order.

+ *

id of the Cart used to create the Order.

* * @deprecated * @return null|string @@ -36,7 +36,8 @@ interface OrderFromCartDraft extends JsonObject public function getId(); /** - *

ResourceIdentifier of the Cart from which the Order is created.

+ *

ResourceIdentifier to the Cart from which the Order is created.

+ *

This field is required, but is marked as optional for backwards compatibility reasons.

* * @return null|CartResourceIdentifier @@ -44,8 +45,7 @@ public function getId(); public function getCart(); /** - *

Expected version of the Cart from which the Order is created. - * If the expected version does not match the actual version, a 409 Conflict error will be returned.

+ *

version of the Cart from which the Order is created.

* * @return null|int @@ -53,11 +53,8 @@ public function getCart(); public function getVersion(); /** - *

String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed. - * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

+ *

User-defined identifier for the Order that is unique across a Project. + * Once set, the value cannot be changed.

* * @return null|string @@ -65,8 +62,8 @@ public function getVersion(); public function getOrderNumber(); /** - *

Identifier for a purchase order, usually in a B2B context. - * The Purchase Order Number is typically entered by the Buyer and can also be used with Quotes.

+ *

User-defined identifier for a purchase Order.

+ *

It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow.

* * @return null|string @@ -74,7 +71,7 @@ public function getOrderNumber(); public function getPurchaseOrderNumber(); /** - *

Payment state for the Order.

+ *

Payment status for the Order.

* * @return null|string @@ -82,7 +79,7 @@ public function getPurchaseOrderNumber(); public function getPaymentState(); /** - *

Shipment state for the Order.

+ *

Shipment status for the Order.

* * @return null|string @@ -90,7 +87,7 @@ public function getPaymentState(); public function getShipmentState(); /** - *

Order will be created with Open status by default.

+ *

Current status for the Order.

* * @return null|string @@ -98,7 +95,7 @@ public function getShipmentState(); public function getOrderState(); /** - *

Reference to a State indicating the Order's state.

+ *

State for the Order in a custom workflow.

* * @return null|StateResourceIdentifier @@ -106,9 +103,12 @@ public function getOrderState(); public function getState(); /** - *

Custom Fields for the Order. The Custom Field type must match the type of the Custom Fields in the referenced Cart. - * If specified, the Custom Fields are merged with the Custom Fields on the referenced Cart and added to the Order. - * If empty, the Custom Fields on the referenced Cart are added to the Order automatically.

+ *

Custom Fields for the Order. + * The Custom Fields' type must match the Custom Fields' type in the referenced Cart.

+ *
    + *
  • If empty, the Custom Fields on the referenced Cart are added to the Order automatically.
  • + *
  • If specified, the Custom Fields are merged with the Custom Fields on the referenced Cart and added to the Order.
  • + *
* * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/OrderFromCartDraftBuilder.php b/lib/commercetools-api/src/Models/Order/OrderFromCartDraftBuilder.php index 1738530de44..8b9bf727e1c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromCartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromCartDraftBuilder.php @@ -87,7 +87,7 @@ final class OrderFromCartDraftBuilder implements Builder private $custom; /** - *

Unique identifier of the Cart from which you can create an Order.

+ *

id of the Cart used to create the Order.

* * @deprecated * @return null|string @@ -98,7 +98,8 @@ public function getId() } /** - *

ResourceIdentifier of the Cart from which the Order is created.

+ *

ResourceIdentifier to the Cart from which the Order is created.

+ *

This field is required, but is marked as optional for backwards compatibility reasons.

* * @return null|CartResourceIdentifier @@ -109,8 +110,7 @@ public function getCart() } /** - *

Expected version of the Cart from which the Order is created. - * If the expected version does not match the actual version, a 409 Conflict error will be returned.

+ *

version of the Cart from which the Order is created.

* * @return null|int @@ -121,11 +121,8 @@ public function getVersion() } /** - *

String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed. - * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

+ *

User-defined identifier for the Order that is unique across a Project. + * Once set, the value cannot be changed.

* * @return null|string @@ -136,8 +133,8 @@ public function getOrderNumber() } /** - *

Identifier for a purchase order, usually in a B2B context. - * The Purchase Order Number is typically entered by the Buyer and can also be used with Quotes.

+ *

User-defined identifier for a purchase Order.

+ *

It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow.

* * @return null|string @@ -148,7 +145,7 @@ public function getPurchaseOrderNumber() } /** - *

Payment state for the Order.

+ *

Payment status for the Order.

* * @return null|string @@ -159,7 +156,7 @@ public function getPaymentState() } /** - *

Shipment state for the Order.

+ *

Shipment status for the Order.

* * @return null|string @@ -170,7 +167,7 @@ public function getShipmentState() } /** - *

Order will be created with Open status by default.

+ *

Current status for the Order.

* * @return null|string @@ -181,7 +178,7 @@ public function getOrderState() } /** - *

Reference to a State indicating the Order's state.

+ *

State for the Order in a custom workflow.

* * @return null|StateResourceIdentifier @@ -192,9 +189,12 @@ public function getState() } /** - *

Custom Fields for the Order. The Custom Field type must match the type of the Custom Fields in the referenced Cart. - * If specified, the Custom Fields are merged with the Custom Fields on the referenced Cart and added to the Order. - * If empty, the Custom Fields on the referenced Cart are added to the Order automatically.

+ *

Custom Fields for the Order. + * The Custom Fields' type must match the Custom Fields' type in the referenced Cart.

+ *
    + *
  • If empty, the Custom Fields on the referenced Cart are added to the Order automatically.
  • + *
  • If specified, the Custom Fields are merged with the Custom Fields on the referenced Cart and added to the Order.
  • + *
* * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/OrderFromCartDraftModel.php b/lib/commercetools-api/src/Models/Order/OrderFromCartDraftModel.php index e220e48aab2..0e50ce9cb2f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromCartDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromCartDraftModel.php @@ -114,7 +114,7 @@ public function __construct( } /** - *

Unique identifier of the Cart from which you can create an Order.

+ *

id of the Cart used to create the Order.

* * @deprecated * @return null|string @@ -134,7 +134,8 @@ public function getId() } /** - *

ResourceIdentifier of the Cart from which the Order is created.

+ *

ResourceIdentifier to the Cart from which the Order is created.

+ *

This field is required, but is marked as optional for backwards compatibility reasons.

* * * @return null|CartResourceIdentifier @@ -155,8 +156,7 @@ public function getCart() } /** - *

Expected version of the Cart from which the Order is created. - * If the expected version does not match the actual version, a 409 Conflict error will be returned.

+ *

version of the Cart from which the Order is created.

* * * @return null|int @@ -176,11 +176,8 @@ public function getVersion() } /** - *

String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed. - * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

+ *

User-defined identifier for the Order that is unique across a Project. + * Once set, the value cannot be changed.

* * * @return null|string @@ -200,8 +197,8 @@ public function getOrderNumber() } /** - *

Identifier for a purchase order, usually in a B2B context. - * The Purchase Order Number is typically entered by the Buyer and can also be used with Quotes.

+ *

User-defined identifier for a purchase Order.

+ *

It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow.

* * * @return null|string @@ -221,7 +218,7 @@ public function getPurchaseOrderNumber() } /** - *

Payment state for the Order.

+ *

Payment status for the Order.

* * * @return null|string @@ -241,7 +238,7 @@ public function getPaymentState() } /** - *

Shipment state for the Order.

+ *

Shipment status for the Order.

* * * @return null|string @@ -261,7 +258,7 @@ public function getShipmentState() } /** - *

Order will be created with Open status by default.

+ *

Current status for the Order.

* * * @return null|string @@ -281,7 +278,7 @@ public function getOrderState() } /** - *

Reference to a State indicating the Order's state.

+ *

State for the Order in a custom workflow.

* * * @return null|StateResourceIdentifier @@ -302,9 +299,12 @@ public function getState() } /** - *

Custom Fields for the Order. The Custom Field type must match the type of the Custom Fields in the referenced Cart. - * If specified, the Custom Fields are merged with the Custom Fields on the referenced Cart and added to the Order. - * If empty, the Custom Fields on the referenced Cart are added to the Order automatically.

+ *

Custom Fields for the Order. + * The Custom Fields' type must match the Custom Fields' type in the referenced Cart.

+ *
    + *
  • If empty, the Custom Fields on the referenced Cart are added to the Order automatically.
  • + *
  • If specified, the Custom Fields are merged with the Custom Fields on the referenced Cart and added to the Order.
  • + *
* * * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraft.php b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraft.php index dd269fb9ad4..cad516125ea 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraft.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraft.php @@ -25,7 +25,8 @@ interface OrderFromQuoteDraft extends JsonObject public const FIELD_STATE = 'state'; /** - *

ResourceIdentifier of the Quote from which this Order is created. If the Quote has QuoteState in Accepted, Declined or Withdrawn then the order creation will fail. The creation will also fail if the Quote has expired (validTo check).

+ *

ResourceIdentifier to the Quote from which the Order is created. + * If the referenced Quote has expired (validTo check) or its quoteState is Accepted, Declined, or Withdrawn, the Order creation will fail.

* * @return null|QuoteResourceIdentifier @@ -33,7 +34,7 @@ interface OrderFromQuoteDraft extends JsonObject public function getQuote(); /** - *

version of the Quote from which an Order is created.

+ *

version of the Quote from which the Order is created.

* * @return null|int @@ -49,11 +50,8 @@ public function getVersion(); public function getQuoteStateToAccepted(); /** - *

String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed. - * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

+ *

User-defined identifier for the Order that is unique across a Project. + * Once set, the value cannot be changed.

* * @return null|string @@ -61,7 +59,7 @@ public function getQuoteStateToAccepted(); public function getOrderNumber(); /** - *

Payment state of the Order.

+ *

Payment status for the Order.

* * @return null|string @@ -69,7 +67,7 @@ public function getOrderNumber(); public function getPaymentState(); /** - *

Shipment state of the Order.

+ *

Shipment status for the Order.

* * @return null|string @@ -77,7 +75,7 @@ public function getPaymentState(); public function getShipmentState(); /** - *

Order will be created with Open status by default.

+ *

Current status for the Order.

* * @return null|string @@ -85,7 +83,7 @@ public function getShipmentState(); public function getOrderState(); /** - *

Reference to a State indicating the Order's state.

+ *

State of the Order in a custom workflow.

* * @return null|StateResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftBuilder.php b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftBuilder.php index 84065c49241..59204d8df2a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftBuilder.php @@ -73,7 +73,8 @@ final class OrderFromQuoteDraftBuilder implements Builder private $state; /** - *

ResourceIdentifier of the Quote from which this Order is created. If the Quote has QuoteState in Accepted, Declined or Withdrawn then the order creation will fail. The creation will also fail if the Quote has expired (validTo check).

+ *

ResourceIdentifier to the Quote from which the Order is created. + * If the referenced Quote has expired (validTo check) or its quoteState is Accepted, Declined, or Withdrawn, the Order creation will fail.

* * @return null|QuoteResourceIdentifier @@ -84,7 +85,7 @@ public function getQuote() } /** - *

version of the Quote from which an Order is created.

+ *

version of the Quote from which the Order is created.

* * @return null|int @@ -106,11 +107,8 @@ public function getQuoteStateToAccepted() } /** - *

String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed. - * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

+ *

User-defined identifier for the Order that is unique across a Project. + * Once set, the value cannot be changed.

* * @return null|string @@ -121,7 +119,7 @@ public function getOrderNumber() } /** - *

Payment state of the Order.

+ *

Payment status for the Order.

* * @return null|string @@ -132,7 +130,7 @@ public function getPaymentState() } /** - *

Shipment state of the Order.

+ *

Shipment status for the Order.

* * @return null|string @@ -143,7 +141,7 @@ public function getShipmentState() } /** - *

Order will be created with Open status by default.

+ *

Current status for the Order.

* * @return null|string @@ -154,7 +152,7 @@ public function getOrderState() } /** - *

Reference to a State indicating the Order's state.

+ *

State of the Order in a custom workflow.

* * @return null|StateResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftModel.php b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftModel.php index d13b09a93ca..eb494bfacaa 100644 --- a/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderFromQuoteDraftModel.php @@ -96,7 +96,8 @@ public function __construct( } /** - *

ResourceIdentifier of the Quote from which this Order is created. If the Quote has QuoteState in Accepted, Declined or Withdrawn then the order creation will fail. The creation will also fail if the Quote has expired (validTo check).

+ *

ResourceIdentifier to the Quote from which the Order is created. + * If the referenced Quote has expired (validTo check) or its quoteState is Accepted, Declined, or Withdrawn, the Order creation will fail.

* * * @return null|QuoteResourceIdentifier @@ -117,7 +118,7 @@ public function getQuote() } /** - *

version of the Quote from which an Order is created.

+ *

version of the Quote from which the Order is created.

* * * @return null|int @@ -157,11 +158,8 @@ public function getQuoteStateToAccepted() } /** - *

String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed. - * For easier use on Get, Update and Delete actions we suggest assigning order numbers that match the regular expression [a-z0-9_-]{2,36}.

+ *

User-defined identifier for the Order that is unique across a Project. + * Once set, the value cannot be changed.

* * * @return null|string @@ -181,7 +179,7 @@ public function getOrderNumber() } /** - *

Payment state of the Order.

+ *

Payment status for the Order.

* * * @return null|string @@ -201,7 +199,7 @@ public function getPaymentState() } /** - *

Shipment state of the Order.

+ *

Shipment status for the Order.

* * * @return null|string @@ -221,7 +219,7 @@ public function getShipmentState() } /** - *

Order will be created with Open status by default.

+ *

Current status for the Order.

* * * @return null|string @@ -241,7 +239,7 @@ public function getOrderState() } /** - *

Reference to a State indicating the Order's state.

+ *

State of the Order in a custom workflow.

* * * @return null|StateResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php index f4fe4b1a667..e0173eec29a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php @@ -17,12 +17,16 @@ interface OrderImportCustomLineItemStateAction extends OrderUpdateAction public const FIELD_STATE = 'state'; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ public function getCustomLineItemId(); /** + *

New status of the Custom Line Items.

+ * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php index ed4267b834c..f5808b17fa4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php @@ -33,6 +33,8 @@ final class OrderImportCustomLineItemStateActionBuilder implements Builder private $state; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ @@ -42,6 +44,8 @@ public function getCustomLineItemId() } /** + *

New status of the Custom Line Items.

+ * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php index e5192401f93..76fa9b7c174 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

id of the CustomLineItem to update.

+ * * * @return null|string */ @@ -89,6 +91,8 @@ public function getCustomLineItemId() } /** + *

New status of the Custom Line Items.

+ * * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraft.php b/lib/commercetools-api/src/Models/Order/OrderImportDraft.php index 97026b64eb9..d1a10b409ac 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraft.php @@ -138,7 +138,7 @@ public function getCustomerGroup(); public function getCountry(); /** - *

If not given the Open state will be assigned by default.

+ *

Current status of the Order.

* * @return null|string @@ -154,6 +154,8 @@ public function getOrderState(); public function getState(); /** + *

Shipment status of the Order.

+ * * @return null|string */ @@ -174,6 +176,8 @@ public function getPaymentState(); public function getShippingInfo(); /** + *

Payment information associated with the Order.

+ * * @return null|PaymentInfo */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php index 69ff7a4d201..9ad95fa59fe 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php @@ -310,7 +310,7 @@ public function getCountry() } /** - *

If not given the Open state will be assigned by default.

+ *

Current status of the Order.

* * @return null|string @@ -332,6 +332,8 @@ public function getState() } /** + *

Shipment status of the Order.

+ * * @return null|string */ @@ -361,6 +363,8 @@ public function getShippingInfo() } /** + *

Payment information associated with the Order.

+ * * @return null|PaymentInfo */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php b/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php index 0123995d63a..663cf832a9b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php @@ -471,7 +471,7 @@ public function getCountry() } /** - *

If not given the Open state will be assigned by default.

+ *

Current status of the Order.

* * * @return null|string @@ -512,6 +512,8 @@ public function getState() } /** + *

Shipment status of the Order.

+ * * * @return null|string */ @@ -569,6 +571,8 @@ public function getShippingInfo() } /** + *

Payment information associated with the Order.

+ * * * @return null|PaymentInfo */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php index e43b5428731..f60fa5ee286 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php @@ -17,12 +17,16 @@ interface OrderImportLineItemStateAction extends OrderUpdateAction public const FIELD_STATE = 'state'; /** + *

id of the LineItem to update.

+ * * @return null|string */ public function getLineItemId(); /** + *

New status of the Line Items.

+ * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php index 20e58e8d73f..a2ac96b9092 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php @@ -33,6 +33,8 @@ final class OrderImportLineItemStateActionBuilder implements Builder private $state; /** + *

id of the LineItem to update.

+ * * @return null|string */ @@ -42,6 +44,8 @@ public function getLineItemId() } /** + *

New status of the Line Items.

+ * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php index a3f60473283..4bef20c7443 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

id of the LineItem to update.

+ * * * @return null|string */ @@ -89,6 +91,8 @@ public function getLineItemId() } /** + *

New status of the Line Items.

+ * * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderModel.php b/lib/commercetools-api/src/Models/Order/OrderModel.php index d7d89dabbbf..a63b4583489 100644 --- a/lib/commercetools-api/src/Models/Order/OrderModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderModel.php @@ -13,6 +13,7 @@ use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceModel; use Commercetools\Api\Models\Cart\CustomLineItemCollection; +use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; use Commercetools\Api\Models\Cart\LineItemCollection; use Commercetools\Api\Models\Cart\ShippingCollection; @@ -84,39 +85,33 @@ final class OrderModel extends JsonObjectModel implements Order /** * - * @var ?LastModifiedBy - */ - protected $lastModifiedBy; - - /** - * - * @var ?CreatedBy + * @var ?string */ - protected $createdBy; + protected $orderNumber; /** * - * @var ?DateTimeImmutable + * @var ?string */ - protected $completedAt; + protected $purchaseOrderNumber; /** * * @var ?string */ - protected $orderNumber; + protected $customerId; /** * * @var ?string */ - protected $customerId; + protected $customerEmail; /** * - * @var ?string + * @var ?CustomerGroupReference */ - protected $customerEmail; + protected $customerGroup; /** * @@ -168,123 +163,123 @@ final class OrderModel extends JsonObjectModel implements Order /** * - * @var ?Address + * @var ?string */ - protected $shippingAddress; + protected $taxMode; /** * - * @var ?Address + * @var ?string */ - protected $billingAddress; + protected $taxRoundingMode; /** * * @var ?string */ - protected $shippingMode; + protected $taxCalculationMode; /** * * @var ?string */ - protected $shippingKey; + protected $inventoryMode; /** * - * @var ?CustomFields + * @var ?Address */ - protected $shippingCustomFields; + protected $billingAddress; /** * - * @var ?ShippingCollection + * @var ?Address */ - protected $shipping; + protected $shippingAddress; /** * * @var ?string */ - protected $taxMode; + protected $shippingMode; /** * * @var ?string */ - protected $taxRoundingMode; + protected $shippingKey; /** * - * @var ?CustomerGroupReference + * @var ?ShippingInfo */ - protected $customerGroup; + protected $shippingInfo; /** * - * @var ?string + * @var ?ShippingRateInput */ - protected $country; + protected $shippingRateInput; /** * - * @var ?string + * @var ?CustomFields */ - protected $orderState; + protected $shippingCustomFields; /** * - * @var ?StateReference + * @var ?ShippingCollection */ - protected $state; + protected $shipping; /** * - * @var ?string + * @var ?AddressCollection */ - protected $shipmentState; + protected $itemShippingAddresses; /** * - * @var ?string + * @var ?DiscountCodeInfoCollection */ - protected $paymentState; + protected $discountCodes; /** * - * @var ?ShippingInfo + * @var ?DirectDiscountCollection */ - protected $shippingInfo; + protected $directDiscounts; /** * - * @var ?SyncInfoCollection + * @var ?CartDiscountReferenceCollection */ - protected $syncInfo; + protected $refusedGifts; /** * - * @var ?ReturnInfoCollection + * @var ?PaymentInfo */ - protected $returnInfo; + protected $paymentInfo; /** * * @var ?string */ - protected $purchaseOrderNumber; + protected $country; /** * - * @var ?DiscountCodeInfoCollection + * @var ?string */ - protected $discountCodes; + protected $locale; /** - * @deprecated - * @var ?int + * + * @var ?string */ - protected $lastMessageSequenceNumber; + protected $origin; /** * @@ -300,57 +295,69 @@ final class OrderModel extends JsonObjectModel implements Order /** * - * @var ?CustomFields + * @var ?string */ - protected $custom; + protected $orderState; /** * - * @var ?PaymentInfo + * @var ?string */ - protected $paymentInfo; + protected $shipmentState; /** * * @var ?string */ - protected $locale; + protected $paymentState; /** * - * @var ?string + * @var ?StateReference */ - protected $inventoryMode; + protected $state; /** * - * @var ?string + * @var ?SyncInfoCollection */ - protected $origin; + protected $syncInfo; /** * - * @var ?string + * @var ?ReturnInfoCollection */ - protected $taxCalculationMode; + protected $returnInfo; + + /** + * @deprecated + * @var ?int + */ + protected $lastMessageSequenceNumber; /** * - * @var ?ShippingRateInput + * @var ?CustomFields */ - protected $shippingRateInput; + protected $custom; /** * - * @var ?AddressCollection + * @var ?DateTimeImmutable */ - protected $itemShippingAddresses; + protected $completedAt; /** * - * @var ?CartDiscountReferenceCollection + * @var ?LastModifiedBy */ - protected $refusedGifts; + protected $lastModifiedBy; + + /** + * + * @var ?CreatedBy + */ + protected $createdBy; /** @@ -361,12 +368,11 @@ public function __construct( ?int $version = null, ?DateTimeImmutable $createdAt = null, ?DateTimeImmutable $lastModifiedAt = null, - ?LastModifiedBy $lastModifiedBy = null, - ?CreatedBy $createdBy = null, - ?DateTimeImmutable $completedAt = null, ?string $orderNumber = null, + ?string $purchaseOrderNumber = null, ?string $customerId = null, ?string $customerEmail = null, + ?CustomerGroupReference $customerGroup = null, ?string $anonymousId = null, ?BusinessUnitKeyReference $businessUnit = null, ?StoreKeyReference $store = null, @@ -375,48 +381,49 @@ public function __construct( ?TypedMoney $totalPrice = null, ?TaxedPrice $taxedPrice = null, ?TaxedPrice $taxedShippingPrice = null, - ?Address $shippingAddress = null, + ?string $taxMode = null, + ?string $taxRoundingMode = null, + ?string $taxCalculationMode = null, + ?string $inventoryMode = null, ?Address $billingAddress = null, + ?Address $shippingAddress = null, ?string $shippingMode = null, ?string $shippingKey = null, + ?ShippingInfo $shippingInfo = null, + ?ShippingRateInput $shippingRateInput = null, ?CustomFields $shippingCustomFields = null, ?ShippingCollection $shipping = null, - ?string $taxMode = null, - ?string $taxRoundingMode = null, - ?CustomerGroupReference $customerGroup = null, + ?AddressCollection $itemShippingAddresses = null, + ?DiscountCodeInfoCollection $discountCodes = null, + ?DirectDiscountCollection $directDiscounts = null, + ?CartDiscountReferenceCollection $refusedGifts = null, + ?PaymentInfo $paymentInfo = null, ?string $country = null, + ?string $locale = null, + ?string $origin = null, + ?CartReference $cart = null, + ?QuoteReference $quote = null, ?string $orderState = null, - ?StateReference $state = null, ?string $shipmentState = null, ?string $paymentState = null, - ?ShippingInfo $shippingInfo = null, + ?StateReference $state = null, ?SyncInfoCollection $syncInfo = null, ?ReturnInfoCollection $returnInfo = null, - ?string $purchaseOrderNumber = null, - ?DiscountCodeInfoCollection $discountCodes = null, ?int $lastMessageSequenceNumber = null, - ?CartReference $cart = null, - ?QuoteReference $quote = null, ?CustomFields $custom = null, - ?PaymentInfo $paymentInfo = null, - ?string $locale = null, - ?string $inventoryMode = null, - ?string $origin = null, - ?string $taxCalculationMode = null, - ?ShippingRateInput $shippingRateInput = null, - ?AddressCollection $itemShippingAddresses = null, - ?CartDiscountReferenceCollection $refusedGifts = null + ?DateTimeImmutable $completedAt = null, + ?LastModifiedBy $lastModifiedBy = null, + ?CreatedBy $createdBy = null ) { $this->id = $id; $this->version = $version; $this->createdAt = $createdAt; $this->lastModifiedAt = $lastModifiedAt; - $this->lastModifiedBy = $lastModifiedBy; - $this->createdBy = $createdBy; - $this->completedAt = $completedAt; $this->orderNumber = $orderNumber; + $this->purchaseOrderNumber = $purchaseOrderNumber; $this->customerId = $customerId; $this->customerEmail = $customerEmail; + $this->customerGroup = $customerGroup; $this->anonymousId = $anonymousId; $this->businessUnit = $businessUnit; $this->store = $store; @@ -425,37 +432,39 @@ public function __construct( $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; $this->taxedShippingPrice = $taxedShippingPrice; - $this->shippingAddress = $shippingAddress; + $this->taxMode = $taxMode; + $this->taxRoundingMode = $taxRoundingMode; + $this->taxCalculationMode = $taxCalculationMode; + $this->inventoryMode = $inventoryMode; $this->billingAddress = $billingAddress; + $this->shippingAddress = $shippingAddress; $this->shippingMode = $shippingMode; $this->shippingKey = $shippingKey; + $this->shippingInfo = $shippingInfo; + $this->shippingRateInput = $shippingRateInput; $this->shippingCustomFields = $shippingCustomFields; $this->shipping = $shipping; - $this->taxMode = $taxMode; - $this->taxRoundingMode = $taxRoundingMode; - $this->customerGroup = $customerGroup; + $this->itemShippingAddresses = $itemShippingAddresses; + $this->discountCodes = $discountCodes; + $this->directDiscounts = $directDiscounts; + $this->refusedGifts = $refusedGifts; + $this->paymentInfo = $paymentInfo; $this->country = $country; + $this->locale = $locale; + $this->origin = $origin; + $this->cart = $cart; + $this->quote = $quote; $this->orderState = $orderState; - $this->state = $state; $this->shipmentState = $shipmentState; $this->paymentState = $paymentState; - $this->shippingInfo = $shippingInfo; + $this->state = $state; $this->syncInfo = $syncInfo; $this->returnInfo = $returnInfo; - $this->purchaseOrderNumber = $purchaseOrderNumber; - $this->discountCodes = $discountCodes; $this->lastMessageSequenceNumber = $lastMessageSequenceNumber; - $this->cart = $cart; - $this->quote = $quote; $this->custom = $custom; - $this->paymentInfo = $paymentInfo; - $this->locale = $locale; - $this->inventoryMode = $inventoryMode; - $this->origin = $origin; - $this->taxCalculationMode = $taxCalculationMode; - $this->shippingRateInput = $shippingRateInput; - $this->itemShippingAddresses = $itemShippingAddresses; - $this->refusedGifts = $refusedGifts; + $this->completedAt = $completedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; } /** @@ -479,7 +488,7 @@ public function getId() } /** - *

The current version of the order.

+ *

Current version of the Order.

* * * @return null|int @@ -499,6 +508,8 @@ public function getVersion() } /** + *

Date and time (UTC) the Order was initially created.

+ * * * @return null|DateTimeImmutable */ @@ -521,6 +532,8 @@ public function getCreatedAt() } /** + *

Date and time (UTC) the Order was last updated.

+ * * * @return null|DateTimeImmutable */ @@ -543,132 +556,110 @@ public function getLastModifiedAt() } /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

User-defined identifier of the Order that is unique across a Project.

* * - * @return null|LastModifiedBy + * @return null|string */ - public function getLastModifiedBy() + public function getOrderNumber() { - if (is_null($this->lastModifiedBy)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($this->orderNumber)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ORDER_NUMBER); if (is_null($data)) { return null; } - - $this->lastModifiedBy = LastModifiedByModel::of($data); + $this->orderNumber = (string) $data; } - return $this->lastModifiedBy; + return $this->orderNumber; } /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

User-defined identifier of a purchase Order.

+ *

It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow.

* * - * @return null|CreatedBy + * @return null|string */ - public function getCreatedBy() + public function getPurchaseOrderNumber() { - if (is_null($this->createdBy)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($this->purchaseOrderNumber)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PURCHASE_ORDER_NUMBER); if (is_null($data)) { return null; } - - $this->createdBy = CreatedByModel::of($data); + $this->purchaseOrderNumber = (string) $data; } - return $this->createdBy; + return $this->purchaseOrderNumber; } /** - *

This field will only be present if it was set for Order Import

+ *

id of the Customer that the Order belongs to.

* * - * @return null|DateTimeImmutable + * @return null|string */ - public function getCompletedAt() + public function getCustomerId() { - if (is_null($this->completedAt)) { + if (is_null($this->customerId)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_COMPLETED_AT); + $data = $this->raw(self::FIELD_CUSTOMER_ID); if (is_null($data)) { return null; } - $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); - if (false === $data) { - return null; - } - $this->completedAt = $data; + $this->customerId = (string) $data; } - return $this->completedAt; + return $this->customerId; } /** - *

String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed.

+ *

Email address of the Customer that the Order belongs to.

* * * @return null|string */ - public function getOrderNumber() + public function getCustomerEmail() { - if (is_null($this->orderNumber)) { + if (is_null($this->customerEmail)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ORDER_NUMBER); + $data = $this->raw(self::FIELD_CUSTOMER_EMAIL); if (is_null($data)) { return null; } - $this->orderNumber = (string) $data; + $this->customerEmail = (string) $data; } - return $this->orderNumber; + return $this->customerEmail; } /** + *

Reference to the Customer Group of the Customer that the Order belongs to. + * Used for LineItem Price selection.

* - * @return null|string - */ - public function getCustomerId() - { - if (is_null($this->customerId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_CUSTOMER_ID); - if (is_null($data)) { - return null; - } - $this->customerId = (string) $data; - } - - return $this->customerId; - } - - /** * - * @return null|string + * @return null|CustomerGroupReference */ - public function getCustomerEmail() + public function getCustomerGroup() { - if (is_null($this->customerEmail)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_CUSTOMER_EMAIL); + if (is_null($this->customerGroup)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP); if (is_null($data)) { return null; } - $this->customerEmail = (string) $data; + + $this->customerGroup = CustomerGroupReferenceModel::of($data); } - return $this->customerEmail; + return $this->customerGroup; } /** - *

Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

+ *

Anonymous session associated with the Order.

* * * @return null|string @@ -688,7 +679,7 @@ public function getAnonymousId() } /** - *

The Business Unit the Order belongs to.

+ *

Reference to a Business Unit the Order belongs to.

* * * @return null|BusinessUnitKeyReference @@ -709,6 +700,8 @@ public function getBusinessUnit() } /** + *

Reference to a Store the Order belongs to.

+ * * * @return null|StoreKeyReference */ @@ -728,6 +721,8 @@ public function getStore() } /** + *

Line Items that are part of the Order.

+ * * * @return null|LineItemCollection */ @@ -746,6 +741,8 @@ public function getLineItems() } /** + *

Custom Line Items that are part of the Order.

+ * * * @return null|CustomLineItemCollection */ @@ -764,6 +761,9 @@ public function getCustomLineItems() } /** + *

Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo. + * Taxes are included if TaxRate includedInPrice is true for each price.

+ * * * @return null|TypedMoney */ @@ -783,7 +783,10 @@ public function getTotalPrice() } /** - *

The taxes are calculated based on the shipping address.

+ *
    + *
  • For Platform TaxMode, it is automatically set when a shipping address is set.
  • + *
  • For External TaxMode, it is automatically set when the external Tax Rate for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.
  • + *
* * * @return null|TaxedPrice @@ -804,8 +807,7 @@ public function getTaxedPrice() } /** - *

Sum of taxedPrice of ShippingInfo across all Shipping Methods. - * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

+ *

Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

* * * @return null|TaxedPrice @@ -826,405 +828,427 @@ public function getTaxedShippingPrice() } /** - *

Holds all shipping-related information per Shipping Method.

- *

For Multiple ShippingMode, it is updated automatically after the Shipping Methods are added.

+ *

Indicates how Tax Rates are set.

* * - * @return null|Address + * @return null|string */ - public function getShippingAddress() + public function getTaxMode() { - if (is_null($this->shippingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); + if (is_null($this->taxMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TAX_MODE); if (is_null($data)) { return null; } - - $this->shippingAddress = AddressModel::of($data); + $this->taxMode = (string) $data; } - return $this->shippingAddress; + return $this->taxMode; } /** + *

Indicates how monetary values are rounded when calculating taxes for taxedPrice.

* - * @return null|Address + * + * @return null|string */ - public function getBillingAddress() + public function getTaxRoundingMode() { - if (is_null($this->billingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_BILLING_ADDRESS); + if (is_null($this->taxRoundingMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE); if (is_null($data)) { return null; } - - $this->billingAddress = AddressModel::of($data); + $this->taxRoundingMode = (string) $data; } - return $this->billingAddress; + return $this->taxRoundingMode; } /** - *

Indicates whether one or multiple Shipping Methods are added to the Cart.

+ *

Indicates how taxes are calculated when calculating taxes for taxedPrice.

* * * @return null|string */ - public function getShippingMode() + public function getTaxCalculationMode() { - if (is_null($this->shippingMode)) { + if (is_null($this->taxCalculationMode)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SHIPPING_MODE); + $data = $this->raw(self::FIELD_TAX_CALCULATION_MODE); if (is_null($data)) { return null; } - $this->shippingMode = (string) $data; + $this->taxCalculationMode = (string) $data; } - return $this->shippingMode; + return $this->taxCalculationMode; } /** - *

key of the ShippingMethod for Single ShippingMode.

+ *

Indicates how stock quantities are tracked for Line Items in the Order.

* * * @return null|string */ - public function getShippingKey() + public function getInventoryMode() { - if (is_null($this->shippingKey)) { + if (is_null($this->inventoryMode)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SHIPPING_KEY); + $data = $this->raw(self::FIELD_INVENTORY_MODE); if (is_null($data)) { return null; } - $this->shippingKey = (string) $data; + $this->inventoryMode = (string) $data; } - return $this->shippingKey; + return $this->inventoryMode; } /** - *

Custom Fields of the Shipping Method for Single ShippingMode.

+ *

Billing address associated with the Order.

* * - * @return null|CustomFields + * @return null|Address */ - public function getShippingCustomFields() + public function getBillingAddress() { - if (is_null($this->shippingCustomFields)) { + if (is_null($this->billingAddress)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_CUSTOM_FIELDS); + $data = $this->raw(self::FIELD_BILLING_ADDRESS); if (is_null($data)) { return null; } - $this->shippingCustomFields = CustomFieldsModel::of($data); + $this->billingAddress = AddressModel::of($data); } - return $this->shippingCustomFields; + return $this->billingAddress; } /** - *

Holds all shipping-related information per Shipping Method for Multiple ShippingMode.

- *

It is updated automatically after the Shipping Method is added.

+ *

Shipping address associated with the Order. + * Determines eligible ShippingMethod rates and Tax Rates of Line Items.

* * - * @return null|ShippingCollection + * @return null|Address */ - public function getShipping() + public function getShippingAddress() { - if (is_null($this->shipping)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_SHIPPING); + if (is_null($this->shippingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); if (is_null($data)) { return null; } - $this->shipping = ShippingCollection::fromArray($data); + + $this->shippingAddress = AddressModel::of($data); } - return $this->shipping; + return $this->shippingAddress; } /** + *

Indicates whether there can be one or multiple Shipping Methods.

+ * * * @return null|string */ - public function getTaxMode() + public function getShippingMode() { - if (is_null($this->taxMode)) { + if (is_null($this->shippingMode)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_MODE); + $data = $this->raw(self::FIELD_SHIPPING_MODE); if (is_null($data)) { return null; } - $this->taxMode = (string) $data; + $this->shippingMode = (string) $data; } - return $this->taxMode; + return $this->shippingMode; } /** - *

When calculating taxes for taxedPrice, the selected mode is used for rouding.

+ *

key of the ShippingMethod for Single ShippingMode.

* * * @return null|string */ - public function getTaxRoundingMode() + public function getShippingKey() { - if (is_null($this->taxRoundingMode)) { + if (is_null($this->shippingKey)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE); + $data = $this->raw(self::FIELD_SHIPPING_KEY); if (is_null($data)) { return null; } - $this->taxRoundingMode = (string) $data; + $this->shippingKey = (string) $data; } - return $this->taxRoundingMode; + return $this->shippingKey; } /** - *

Set when the customer is set and the customer is a member of a customer group. - * Used for product variant price selection.

+ *

Shipping-related information for Single ShippingMode. + * Automatically set when a Shipping Method is set.

* * - * @return null|CustomerGroupReference + * @return null|ShippingInfo */ - public function getCustomerGroup() + public function getShippingInfo() { - if (is_null($this->customerGroup)) { + if (is_null($this->shippingInfo)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOMER_GROUP); + $data = $this->raw(self::FIELD_SHIPPING_INFO); if (is_null($data)) { return null; } - $this->customerGroup = CustomerGroupReferenceModel::of($data); + $this->shippingInfo = ShippingInfoModel::of($data); } - return $this->customerGroup; + return $this->shippingInfo; } /** - *

A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

+ *

Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

+ * * * - * @return null|string + * @return null|ShippingRateInput */ - public function getCountry() + public function getShippingRateInput() { - if (is_null($this->country)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_COUNTRY); + if (is_null($this->shippingRateInput)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); if (is_null($data)) { return null; } - $this->country = (string) $data; + $className = ShippingRateInputModel::resolveDiscriminatorClass($data); + $this->shippingRateInput = $className::of($data); } - return $this->country; + return $this->shippingRateInput; } /** - *

One of the four predefined OrderStates.

+ *

Custom Fields of the Shipping Method for Single ShippingMode.

* * - * @return null|string + * @return null|CustomFields */ - public function getOrderState() + public function getShippingCustomFields() { - if (is_null($this->orderState)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ORDER_STATE); + if (is_null($this->shippingCustomFields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_CUSTOM_FIELDS); if (is_null($data)) { return null; } - $this->orderState = (string) $data; + + $this->shippingCustomFields = CustomFieldsModel::of($data); } - return $this->orderState; + return $this->shippingCustomFields; } /** - *

This reference can point to a state in a custom workflow.

+ *

Shipping-related information for Multiple ShippingMode. + * Updated automatically each time a new Shipping Method is added.

* * - * @return null|StateReference + * @return null|ShippingCollection */ - public function getState() + public function getShipping() { - if (is_null($this->state)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_STATE); + if (is_null($this->shipping)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING); if (is_null($data)) { return null; } - - $this->state = StateReferenceModel::of($data); + $this->shipping = ShippingCollection::fromArray($data); } - return $this->state; + return $this->shipping; } /** + *

Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. + * Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

* - * @return null|string + * + * @return null|AddressCollection */ - public function getShipmentState() + public function getItemShippingAddresses() { - if (is_null($this->shipmentState)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SHIPMENT_STATE); + if (is_null($this->itemShippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); if (is_null($data)) { return null; } - $this->shipmentState = (string) $data; + $this->itemShippingAddresses = AddressCollection::fromArray($data); } - return $this->shipmentState; + return $this->itemShippingAddresses; } /** + *

Discount Codes added to the Order. + * An Order that has directDiscounts cannot have discountCodes.

* - * @return null|string + * + * @return null|DiscountCodeInfoCollection */ - public function getPaymentState() + public function getDiscountCodes() { - if (is_null($this->paymentState)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_PAYMENT_STATE); + if (is_null($this->discountCodes)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DISCOUNT_CODES); if (is_null($data)) { return null; } - $this->paymentState = (string) $data; + $this->discountCodes = DiscountCodeInfoCollection::fromArray($data); } - return $this->paymentState; + return $this->discountCodes; } /** - *

Set if the ShippingMethod is set.

+ *

Direct Discounts added to the Order. + * An Order that has discountCodes cannot have directDiscounts.

* * - * @return null|ShippingInfo + * @return null|DirectDiscountCollection */ - public function getShippingInfo() + public function getDirectDiscounts() { - if (is_null($this->shippingInfo)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_INFO); + if (is_null($this->directDiscounts)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DIRECT_DISCOUNTS); if (is_null($data)) { return null; } - - $this->shippingInfo = ShippingInfoModel::of($data); + $this->directDiscounts = DirectDiscountCollection::fromArray($data); } - return $this->shippingInfo; + return $this->directDiscounts; } /** + *

Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

* - * @return null|SyncInfoCollection + * + * @return null|CartDiscountReferenceCollection */ - public function getSyncInfo() + public function getRefusedGifts() { - if (is_null($this->syncInfo)) { + if (is_null($this->refusedGifts)) { /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_SYNC_INFO); + $data = $this->raw(self::FIELD_REFUSED_GIFTS); if (is_null($data)) { return null; } - $this->syncInfo = SyncInfoCollection::fromArray($data); + $this->refusedGifts = CartDiscountReferenceCollection::fromArray($data); } - return $this->syncInfo; + return $this->refusedGifts; } /** + *

Payment information related to the Order.

* - * @return null|ReturnInfoCollection + * + * @return null|PaymentInfo */ - public function getReturnInfo() + public function getPaymentInfo() { - if (is_null($this->returnInfo)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_RETURN_INFO); + if (is_null($this->paymentInfo)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PAYMENT_INFO); if (is_null($data)) { return null; } - $this->returnInfo = ReturnInfoCollection::fromArray($data); + + $this->paymentInfo = PaymentInfoModel::of($data); } - return $this->returnInfo; + return $this->paymentInfo; } /** - *

The Purchase Order Number is typically set by the Buyer on a QuoteRequest to - * track the purchase order during the quote and order flow.

+ *

Used for LineItem Price selection.

* * * @return null|string */ - public function getPurchaseOrderNumber() + public function getCountry() { - if (is_null($this->purchaseOrderNumber)) { + if (is_null($this->country)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_PURCHASE_ORDER_NUMBER); + $data = $this->raw(self::FIELD_COUNTRY); if (is_null($data)) { return null; } - $this->purchaseOrderNumber = (string) $data; + $this->country = (string) $data; } - return $this->purchaseOrderNumber; + return $this->country; } /** + *

Languages of the Order. + * Can only contain languages supported by the Project.

* - * @return null|DiscountCodeInfoCollection + * + * @return null|string */ - public function getDiscountCodes() + public function getLocale() { - if (is_null($this->discountCodes)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_DISCOUNT_CODES); + if (is_null($this->locale)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LOCALE); if (is_null($data)) { return null; } - $this->discountCodes = DiscountCodeInfoCollection::fromArray($data); + $this->locale = (string) $data; } - return $this->discountCodes; + return $this->locale; } /** - *

Internal-only field.

+ *

Indicates the origin of the Cart from which the Order was created.

* - * @deprecated - * @return null|int + * + * @return null|string */ - public function getLastMessageSequenceNumber() + public function getOrigin() { - if (is_null($this->lastMessageSequenceNumber)) { - /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_LAST_MESSAGE_SEQUENCE_NUMBER); + if (is_null($this->origin)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ORIGIN); if (is_null($data)) { return null; } - $this->lastMessageSequenceNumber = (int) $data; + $this->origin = (string) $data; } - return $this->lastMessageSequenceNumber; + return $this->origin; } /** - *

Set when this order was created from a cart. - * The cart will have the state Ordered.

+ *

Reference to the Cart for an Order created from Cart. + * The referenced Cart will have the Ordered CartState.

* * * @return null|CartReference @@ -1245,7 +1269,7 @@ public function getCart() } /** - *

Set when this order was created from a quote.

+ *

Reference to the Quote for an Order created from Quote.

* * * @return null|QuoteReference @@ -1266,182 +1290,234 @@ public function getQuote() } /** + *

Current status of the Order.

* - * @return null|CustomFields + * + * @return null|string */ - public function getCustom() + public function getOrderState() { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($this->orderState)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ORDER_STATE); if (is_null($data)) { return null; } - - $this->custom = CustomFieldsModel::of($data); + $this->orderState = (string) $data; } - return $this->custom; + return $this->orderState; } /** + *

Shipment status of the Order.

* - * @return null|PaymentInfo + * + * @return null|string */ - public function getPaymentInfo() + public function getShipmentState() { - if (is_null($this->paymentInfo)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_PAYMENT_INFO); + if (is_null($this->shipmentState)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPMENT_STATE); if (is_null($data)) { return null; } - - $this->paymentInfo = PaymentInfoModel::of($data); + $this->shipmentState = (string) $data; } - return $this->paymentInfo; + return $this->shipmentState; } /** + *

Payment status of the Order.

+ * * * @return null|string */ - public function getLocale() + public function getPaymentState() { - if (is_null($this->locale)) { + if (is_null($this->paymentState)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_LOCALE); + $data = $this->raw(self::FIELD_PAYMENT_STATE); if (is_null($data)) { return null; } - $this->locale = (string) $data; + $this->paymentState = (string) $data; } - return $this->locale; + return $this->paymentState; } /** + *

State of the Order. + * This reference can point to a State in a custom workflow.

* - * @return null|string + * + * @return null|StateReference */ - public function getInventoryMode() + public function getState() { - if (is_null($this->inventoryMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_INVENTORY_MODE); + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); if (is_null($data)) { return null; } - $this->inventoryMode = (string) $data; + + $this->state = StateReferenceModel::of($data); } - return $this->inventoryMode; + return $this->state; } /** + *

Contains synchronization activity information of the Order (like export or import). + * Can only be set with Update SyncInfo update action.

* - * @return null|string + * + * @return null|SyncInfoCollection */ - public function getOrigin() + public function getSyncInfo() { - if (is_null($this->origin)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ORIGIN); + if (is_null($this->syncInfo)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SYNC_INFO); if (is_null($data)) { return null; } - $this->origin = (string) $data; + $this->syncInfo = SyncInfoCollection::fromArray($data); } - return $this->origin; + return $this->syncInfo; } /** - *

When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

+ *

Contains information regarding the returns associated with the Order.

* * - * @return null|string + * @return null|ReturnInfoCollection */ - public function getTaxCalculationMode() + public function getReturnInfo() { - if (is_null($this->taxCalculationMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_CALCULATION_MODE); + if (is_null($this->returnInfo)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_RETURN_INFO); if (is_null($data)) { return null; } - $this->taxCalculationMode = (string) $data; + $this->returnInfo = ReturnInfoCollection::fromArray($data); } - return $this->taxCalculationMode; + return $this->returnInfo; } /** - *

Input used to select a ShippingRatePriceTier. - * The data type of this field depends on the shippingRateInputType.type configured in the Project:

- * + *

Internal-only field.

* + * @deprecated + * @return null|int + */ + public function getLastMessageSequenceNumber() + { + if (is_null($this->lastMessageSequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_LAST_MESSAGE_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->lastMessageSequenceNumber = (int) $data; + } + + return $this->lastMessageSequenceNumber; + } + + /** + *

Custom Fields of the Order.

* - * @return null|ShippingRateInput + * + * @return null|CustomFields */ - public function getShippingRateInput() + public function getCustom() { - if (is_null($this->shippingRateInput)) { + if (is_null($this->custom)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); + $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $className = ShippingRateInputModel::resolveDiscriminatorClass($data); - $this->shippingRateInput = $className::of($data); + + $this->custom = CustomFieldsModel::of($data); } - return $this->shippingRateInput; + return $this->custom; } /** - *

Contains addresses for orders with multiple shipping addresses.

+ *

User-defined date and time (UTC) of the Order. + * Present only on an Order created using Order Import.

* * - * @return null|AddressCollection + * @return null|DateTimeImmutable */ - public function getItemShippingAddresses() + public function getCompletedAt() { - if (is_null($this->itemShippingAddresses)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); + if (is_null($this->completedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_COMPLETED_AT); if (is_null($data)) { return null; } - $this->itemShippingAddresses = AddressCollection::fromArray($data); + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->completedAt = $data; } - return $this->itemShippingAddresses; + return $this->completedAt; } /** - *

Automatically filled when a line item with LineItemMode GiftLineItem is removed from this order.

+ *

Present on resources created after 1 February 2019 except for events not tracked.

* * - * @return null|CartDiscountReferenceCollection + * @return null|LastModifiedBy */ - public function getRefusedGifts() + public function getLastModifiedBy() { - if (is_null($this->refusedGifts)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_REFUSED_GIFTS); + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); if (is_null($data)) { return null; } - $this->refusedGifts = CartDiscountReferenceCollection::fromArray($data); + + $this->lastModifiedBy = LastModifiedByModel::of($data); } - return $this->refusedGifts; + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; } @@ -1478,35 +1554,19 @@ public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void } /** - * @param ?LastModifiedBy $lastModifiedBy - */ - public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void - { - $this->lastModifiedBy = $lastModifiedBy; - } - - /** - * @param ?CreatedBy $createdBy - */ - public function setCreatedBy(?CreatedBy $createdBy): void - { - $this->createdBy = $createdBy; - } - - /** - * @param ?DateTimeImmutable $completedAt + * @param ?string $orderNumber */ - public function setCompletedAt(?DateTimeImmutable $completedAt): void + public function setOrderNumber(?string $orderNumber): void { - $this->completedAt = $completedAt; + $this->orderNumber = $orderNumber; } /** - * @param ?string $orderNumber + * @param ?string $purchaseOrderNumber */ - public function setOrderNumber(?string $orderNumber): void + public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void { - $this->orderNumber = $orderNumber; + $this->purchaseOrderNumber = $purchaseOrderNumber; } /** @@ -1525,6 +1585,14 @@ public function setCustomerEmail(?string $customerEmail): void $this->customerEmail = $customerEmail; } + /** + * @param ?CustomerGroupReference $customerGroup + */ + public function setCustomerGroup(?CustomerGroupReference $customerGroup): void + { + $this->customerGroup = $customerGroup; + } + /** * @param ?string $anonymousId */ @@ -1590,163 +1658,163 @@ public function setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice): void } /** - * @param ?Address $shippingAddress + * @param ?string $taxMode */ - public function setShippingAddress(?Address $shippingAddress): void + public function setTaxMode(?string $taxMode): void { - $this->shippingAddress = $shippingAddress; + $this->taxMode = $taxMode; } /** - * @param ?Address $billingAddress + * @param ?string $taxRoundingMode */ - public function setBillingAddress(?Address $billingAddress): void + public function setTaxRoundingMode(?string $taxRoundingMode): void { - $this->billingAddress = $billingAddress; + $this->taxRoundingMode = $taxRoundingMode; } /** - * @param ?string $shippingMode + * @param ?string $taxCalculationMode */ - public function setShippingMode(?string $shippingMode): void + public function setTaxCalculationMode(?string $taxCalculationMode): void { - $this->shippingMode = $shippingMode; + $this->taxCalculationMode = $taxCalculationMode; } /** - * @param ?string $shippingKey + * @param ?string $inventoryMode */ - public function setShippingKey(?string $shippingKey): void + public function setInventoryMode(?string $inventoryMode): void { - $this->shippingKey = $shippingKey; + $this->inventoryMode = $inventoryMode; } /** - * @param ?CustomFields $shippingCustomFields + * @param ?Address $billingAddress */ - public function setShippingCustomFields(?CustomFields $shippingCustomFields): void + public function setBillingAddress(?Address $billingAddress): void { - $this->shippingCustomFields = $shippingCustomFields; + $this->billingAddress = $billingAddress; } /** - * @param ?ShippingCollection $shipping + * @param ?Address $shippingAddress */ - public function setShipping(?ShippingCollection $shipping): void + public function setShippingAddress(?Address $shippingAddress): void { - $this->shipping = $shipping; + $this->shippingAddress = $shippingAddress; } /** - * @param ?string $taxMode + * @param ?string $shippingMode */ - public function setTaxMode(?string $taxMode): void + public function setShippingMode(?string $shippingMode): void { - $this->taxMode = $taxMode; + $this->shippingMode = $shippingMode; } /** - * @param ?string $taxRoundingMode + * @param ?string $shippingKey */ - public function setTaxRoundingMode(?string $taxRoundingMode): void + public function setShippingKey(?string $shippingKey): void { - $this->taxRoundingMode = $taxRoundingMode; + $this->shippingKey = $shippingKey; } /** - * @param ?CustomerGroupReference $customerGroup + * @param ?ShippingInfo $shippingInfo */ - public function setCustomerGroup(?CustomerGroupReference $customerGroup): void + public function setShippingInfo(?ShippingInfo $shippingInfo): void { - $this->customerGroup = $customerGroup; + $this->shippingInfo = $shippingInfo; } /** - * @param ?string $country + * @param ?ShippingRateInput $shippingRateInput */ - public function setCountry(?string $country): void + public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void { - $this->country = $country; + $this->shippingRateInput = $shippingRateInput; } /** - * @param ?string $orderState + * @param ?CustomFields $shippingCustomFields */ - public function setOrderState(?string $orderState): void + public function setShippingCustomFields(?CustomFields $shippingCustomFields): void { - $this->orderState = $orderState; + $this->shippingCustomFields = $shippingCustomFields; } /** - * @param ?StateReference $state + * @param ?ShippingCollection $shipping */ - public function setState(?StateReference $state): void + public function setShipping(?ShippingCollection $shipping): void { - $this->state = $state; + $this->shipping = $shipping; } /** - * @param ?string $shipmentState + * @param ?AddressCollection $itemShippingAddresses */ - public function setShipmentState(?string $shipmentState): void + public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void { - $this->shipmentState = $shipmentState; + $this->itemShippingAddresses = $itemShippingAddresses; } /** - * @param ?string $paymentState + * @param ?DiscountCodeInfoCollection $discountCodes */ - public function setPaymentState(?string $paymentState): void + public function setDiscountCodes(?DiscountCodeInfoCollection $discountCodes): void { - $this->paymentState = $paymentState; + $this->discountCodes = $discountCodes; } /** - * @param ?ShippingInfo $shippingInfo + * @param ?DirectDiscountCollection $directDiscounts */ - public function setShippingInfo(?ShippingInfo $shippingInfo): void + public function setDirectDiscounts(?DirectDiscountCollection $directDiscounts): void { - $this->shippingInfo = $shippingInfo; + $this->directDiscounts = $directDiscounts; } /** - * @param ?SyncInfoCollection $syncInfo + * @param ?CartDiscountReferenceCollection $refusedGifts */ - public function setSyncInfo(?SyncInfoCollection $syncInfo): void + public function setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts): void { - $this->syncInfo = $syncInfo; + $this->refusedGifts = $refusedGifts; } /** - * @param ?ReturnInfoCollection $returnInfo + * @param ?PaymentInfo $paymentInfo */ - public function setReturnInfo(?ReturnInfoCollection $returnInfo): void + public function setPaymentInfo(?PaymentInfo $paymentInfo): void { - $this->returnInfo = $returnInfo; + $this->paymentInfo = $paymentInfo; } /** - * @param ?string $purchaseOrderNumber + * @param ?string $country */ - public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void + public function setCountry(?string $country): void { - $this->purchaseOrderNumber = $purchaseOrderNumber; + $this->country = $country; } /** - * @param ?DiscountCodeInfoCollection $discountCodes + * @param ?string $locale */ - public function setDiscountCodes(?DiscountCodeInfoCollection $discountCodes): void + public function setLocale(?string $locale): void { - $this->discountCodes = $discountCodes; + $this->locale = $locale; } /** - * @param ?int $lastMessageSequenceNumber + * @param ?string $origin */ - public function setLastMessageSequenceNumber(?int $lastMessageSequenceNumber): void + public function setOrigin(?string $origin): void { - $this->lastMessageSequenceNumber = $lastMessageSequenceNumber; + $this->origin = $origin; } /** @@ -1766,75 +1834,91 @@ public function setQuote(?QuoteReference $quote): void } /** - * @param ?CustomFields $custom + * @param ?string $orderState */ - public function setCustom(?CustomFields $custom): void + public function setOrderState(?string $orderState): void { - $this->custom = $custom; + $this->orderState = $orderState; } /** - * @param ?PaymentInfo $paymentInfo + * @param ?string $shipmentState */ - public function setPaymentInfo(?PaymentInfo $paymentInfo): void + public function setShipmentState(?string $shipmentState): void { - $this->paymentInfo = $paymentInfo; + $this->shipmentState = $shipmentState; } /** - * @param ?string $locale + * @param ?string $paymentState */ - public function setLocale(?string $locale): void + public function setPaymentState(?string $paymentState): void { - $this->locale = $locale; + $this->paymentState = $paymentState; } /** - * @param ?string $inventoryMode + * @param ?StateReference $state */ - public function setInventoryMode(?string $inventoryMode): void + public function setState(?StateReference $state): void { - $this->inventoryMode = $inventoryMode; + $this->state = $state; } /** - * @param ?string $origin + * @param ?SyncInfoCollection $syncInfo */ - public function setOrigin(?string $origin): void + public function setSyncInfo(?SyncInfoCollection $syncInfo): void { - $this->origin = $origin; + $this->syncInfo = $syncInfo; } /** - * @param ?string $taxCalculationMode + * @param ?ReturnInfoCollection $returnInfo */ - public function setTaxCalculationMode(?string $taxCalculationMode): void + public function setReturnInfo(?ReturnInfoCollection $returnInfo): void { - $this->taxCalculationMode = $taxCalculationMode; + $this->returnInfo = $returnInfo; } /** - * @param ?ShippingRateInput $shippingRateInput + * @param ?int $lastMessageSequenceNumber */ - public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void + public function setLastMessageSequenceNumber(?int $lastMessageSequenceNumber): void { - $this->shippingRateInput = $shippingRateInput; + $this->lastMessageSequenceNumber = $lastMessageSequenceNumber; } /** - * @param ?AddressCollection $itemShippingAddresses + * @param ?CustomFields $custom */ - public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void + public function setCustom(?CustomFields $custom): void { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->custom = $custom; } /** - * @param ?CartDiscountReferenceCollection $refusedGifts + * @param ?DateTimeImmutable $completedAt */ - public function setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts): void + public function setCompletedAt(?DateTimeImmutable $completedAt): void { - $this->refusedGifts = $refusedGifts; + $this->completedAt = $completedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; } diff --git a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponse.php b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponse.php index e17e93a0fe5..d43f25c7467 100644 --- a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponse.php @@ -14,9 +14,9 @@ interface OrderPagedQueryResponse extends JsonObject { public const FIELD_LIMIT = 'limit'; + public const FIELD_OFFSET = 'offset'; public const FIELD_COUNT = 'count'; public const FIELD_TOTAL = 'total'; - public const FIELD_OFFSET = 'offset'; public const FIELD_RESULTS = 'results'; /** @@ -28,26 +28,36 @@ interface OrderPagedQueryResponse extends JsonObject public function getLimit(); /** + *

Number of elements skipped.

+ * * @return null|int */ - public function getCount(); + public function getOffset(); /** + *

Actual number of results returned.

+ * * @return null|int */ - public function getTotal(); + public function getCount(); /** - *

Number of elements skipped.

+ *

Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

* * @return null|int */ - public function getOffset(); + public function getTotal(); /** + *

Orders matching the query.

+ * * @return null|OrderCollection */ @@ -58,6 +68,11 @@ public function getResults(); */ public function setLimit(?int $limit): void; + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void; + /** * @param ?int $count */ @@ -68,11 +83,6 @@ public function setCount(?int $count): void; */ public function setTotal(?int $total): void; - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void; - /** * @param ?OrderCollection $results */ diff --git a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseBuilder.php index fc2a10893ac..eea1efe4c52 100644 --- a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseBuilder.php @@ -30,19 +30,19 @@ final class OrderPagedQueryResponseBuilder implements Builder * @var ?int */ - private $count; + private $offset; /** * @var ?int */ - private $total; + private $count; /** * @var ?int */ - private $offset; + private $total; /** @@ -62,35 +62,45 @@ public function getLimit() } /** + *

Number of elements skipped.

+ * * @return null|int */ - public function getCount() + public function getOffset() { - return $this->count; + return $this->offset; } /** + *

Actual number of results returned.

+ * * @return null|int */ - public function getTotal() + public function getCount() { - return $this->total; + return $this->count; } /** - *

Number of elements skipped.

+ *

Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

* * @return null|int */ - public function getOffset() + public function getTotal() { - return $this->offset; + return $this->total; } /** + *

Orders matching the query.

+ * * @return null|OrderCollection */ @@ -111,34 +121,34 @@ public function withLimit(?int $limit) } /** - * @param ?int $count + * @param ?int $offset * @return $this */ - public function withCount(?int $count) + public function withOffset(?int $offset) { - $this->count = $count; + $this->offset = $offset; return $this; } /** - * @param ?int $total + * @param ?int $count * @return $this */ - public function withTotal(?int $total) + public function withCount(?int $count) { - $this->total = $total; + $this->count = $count; return $this; } /** - * @param ?int $offset + * @param ?int $total * @return $this */ - public function withOffset(?int $offset) + public function withTotal(?int $total) { - $this->offset = $offset; + $this->total = $total; return $this; } @@ -159,9 +169,9 @@ public function build(): OrderPagedQueryResponse { return new OrderPagedQueryResponseModel( $this->limit, + $this->offset, $this->count, $this->total, - $this->offset, $this->results ); } diff --git a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseModel.php index 8d863fd0bc2..7ba942c98d5 100644 --- a/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderPagedQueryResponseModel.php @@ -29,19 +29,19 @@ final class OrderPagedQueryResponseModel extends JsonObjectModel implements Orde * * @var ?int */ - protected $count; + protected $offset; /** * * @var ?int */ - protected $total; + protected $count; /** * * @var ?int */ - protected $offset; + protected $total; /** * @@ -55,15 +55,15 @@ final class OrderPagedQueryResponseModel extends JsonObjectModel implements Orde */ public function __construct( ?int $limit = null, + ?int $offset = null, ?int $count = null, ?int $total = null, - ?int $offset = null, ?OrderCollection $results = null ) { $this->limit = $limit; + $this->offset = $offset; $this->count = $count; $this->total = $total; - $this->offset = $offset; $this->results = $results; } @@ -88,62 +88,72 @@ public function getLimit() } /** + *

Number of elements skipped.

+ * * * @return null|int */ - public function getCount() + public function getOffset() { - if (is_null($this->count)) { + if (is_null($this->offset)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_COUNT); + $data = $this->raw(self::FIELD_OFFSET); if (is_null($data)) { return null; } - $this->count = (int) $data; + $this->offset = (int) $data; } - return $this->count; + return $this->offset; } /** + *

Actual number of results returned.

+ * * * @return null|int */ - public function getTotal() + public function getCount() { - if (is_null($this->total)) { + if (is_null($this->count)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_TOTAL); + $data = $this->raw(self::FIELD_COUNT); if (is_null($data)) { return null; } - $this->total = (int) $data; + $this->count = (int) $data; } - return $this->total; + return $this->count; } /** - *

Number of elements skipped.

+ *

Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

* * * @return null|int */ - public function getOffset() + public function getTotal() { - if (is_null($this->offset)) { + if (is_null($this->total)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_OFFSET); + $data = $this->raw(self::FIELD_TOTAL); if (is_null($data)) { return null; } - $this->offset = (int) $data; + $this->total = (int) $data; } - return $this->offset; + return $this->total; } /** + *

Orders matching the query.

+ * * * @return null|OrderCollection */ @@ -170,6 +180,14 @@ public function setLimit(?int $limit): void $this->limit = $limit; } + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void + { + $this->offset = $offset; + } + /** * @param ?int $count */ @@ -186,14 +204,6 @@ public function setTotal(?int $total): void $this->total = $total; } - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void - { - $this->offset = $offset; - } - /** * @param ?OrderCollection $results */ diff --git a/lib/commercetools-api/src/Models/Order/OrderReference.php b/lib/commercetools-api/src/Models/Order/OrderReference.php index 271aa879b0c..1f86e013be6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderReference.php +++ b/lib/commercetools-api/src/Models/Order/OrderReference.php @@ -17,13 +17,28 @@ interface OrderReference extends Reference public const FIELD_OBJ = 'obj'; /** + *

Contains the representation of the expanded Order. Only present in responses to requests with Reference Expansion for Orders.

+ * * @return null|Order */ public function getObj(); + /** + *

Unique identifier of the referenced Order.

+ * + + * @return null|string + */ + public function getId(); + /** * @param ?Order $obj */ public function setObj(?Order $obj): void; + + /** + * @param ?string $id + */ + public function setId(?string $id): void; } diff --git a/lib/commercetools-api/src/Models/Order/OrderReferenceBuilder.php b/lib/commercetools-api/src/Models/Order/OrderReferenceBuilder.php index dd6cd5fed79..0e166c3b8e6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderReferenceBuilder.php @@ -35,7 +35,7 @@ final class OrderReferenceBuilder implements Builder private $obj; /** - *

Unique ID of the referenced resource.

+ *

Unique identifier of the referenced Order.

* * @return null|string @@ -46,6 +46,8 @@ public function getId() } /** + *

Contains the representation of the expanded Order. Only present in responses to requests with Reference Expansion for Orders.

+ * * @return null|Order */ diff --git a/lib/commercetools-api/src/Models/Order/OrderReferenceModel.php b/lib/commercetools-api/src/Models/Order/OrderReferenceModel.php index 70a0c625fa9..c785cbfc62d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderReferenceModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderReferenceModel.php @@ -75,7 +75,7 @@ public function getTypeId() } /** - *

Unique ID of the referenced resource.

+ *

Unique identifier of the referenced Order.

* * * @return null|string @@ -95,6 +95,8 @@ public function getId() } /** + *

Contains the representation of the expanded Order. Only present in responses to requests with Reference Expansion for Orders.

+ * * * @return null|Order */ diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryAction.php b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryAction.php index 040203598f1..ce448be51b4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryAction.php @@ -17,7 +17,8 @@ interface OrderRemoveDeliveryAction extends OrderUpdateAction public const FIELD_DELIVERY_KEY = 'deliveryKey'; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -25,7 +26,8 @@ interface OrderRemoveDeliveryAction extends OrderUpdateAction public function getDeliveryId(); /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionBuilder.php index ca02c9cb1d9..03cf14fe676 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionBuilder.php @@ -33,7 +33,8 @@ final class OrderRemoveDeliveryActionBuilder implements Builder private $deliveryKey; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -44,7 +45,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionModel.php b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionModel.php index 0ca2437e6b8..f3890330307 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveDeliveryActionModel.php @@ -71,7 +71,8 @@ public function getAction() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -91,7 +92,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressAction.php index 500f7474732..71cd1d43961 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressAction.php @@ -16,6 +16,8 @@ interface OrderRemoveItemShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

key of the Address to remove from itemShippingAddresses.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionBuilder.php index c985bce43ab..f89f970822a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionBuilder.php @@ -27,6 +27,8 @@ final class OrderRemoveItemShippingAddressActionBuilder implements Builder private $addressKey; /** + *

key of the Address to remove from itemShippingAddresses.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionModel.php index faae6e4fc6c..4efa37812c6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveItemShippingAddressActionModel.php @@ -63,6 +63,8 @@ public function getAction() } /** + *

key of the Address to remove from itemShippingAddresses.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryAction.php b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryAction.php index 9872e211283..8e168d7acd5 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryAction.php @@ -17,7 +17,8 @@ interface OrderRemoveParcelFromDeliveryAction extends OrderUpdateAction public const FIELD_PARCEL_KEY = 'parcelKey'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -25,7 +26,8 @@ interface OrderRemoveParcelFromDeliveryAction extends OrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionBuilder.php index e7ce9b1bdb5..c1bcfdc7a0f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionBuilder.php @@ -33,7 +33,8 @@ final class OrderRemoveParcelFromDeliveryActionBuilder implements Builder private $parcelKey; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -44,7 +45,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionModel.php b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionModel.php index a217628581f..08fb7a52abf 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemoveParcelFromDeliveryActionModel.php @@ -71,7 +71,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -91,7 +92,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentAction.php b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentAction.php index 91eea287725..19fcb7677b6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentAction.php @@ -17,7 +17,7 @@ interface OrderRemovePaymentAction extends OrderUpdateAction public const FIELD_PAYMENT = 'payment'; /** - *

ResourceIdentifier of a Payment.

+ *

Payment to remove from the PaymentInfo.

* * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionBuilder.php index 7c7bc5b3472..80b78024edc 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionBuilder.php @@ -29,7 +29,7 @@ final class OrderRemovePaymentActionBuilder implements Builder private $payment; /** - *

ResourceIdentifier of a Payment.

+ *

Payment to remove from the PaymentInfo.

* * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionModel.php b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionModel.php index 6235283fe8f..fb46d3d9230 100644 --- a/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderRemovePaymentActionModel.php @@ -65,7 +65,7 @@ public function getAction() } /** - *

ResourceIdentifier of a Payment.

+ *

Payment to remove from the PaymentInfo.

* * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifier.php b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifier.php index 42d2c44eaad..7c4679796ca 100644 --- a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifier.php @@ -14,4 +14,29 @@ interface OrderResourceIdentifier extends ResourceIdentifier { + /** + *

Unique identifier of the referenced Order.

+ * + + * @return null|string + */ + public function getId(); + + /** + *

User-defined unique identifier of the referenced Order.

+ * + + * @return null|string + */ + public function getKey(); + + /** + * @param ?string $id + */ + public function setId(?string $id): void; + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; } diff --git a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php index 7dce089bfad..8bc192164e6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php @@ -35,7 +35,7 @@ final class OrderResourceIdentifierBuilder implements Builder private $key; /** - *

Unique identifier of the referenced resource. Required if key is absent.

+ *

Unique identifier of the referenced Order.

* * @return null|string @@ -46,7 +46,7 @@ public function getId() } /** - *

User-defined unique identifier of the referenced resource. Required if id is absent.

+ *

User-defined unique identifier of the referenced Order.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php index 7dff591895a..c3eaedf0d78 100644 --- a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php @@ -75,7 +75,7 @@ public function getTypeId() } /** - *

Unique identifier of the referenced resource. Required if key is absent.

+ *

Unique identifier of the referenced Order.

* * * @return null|string @@ -95,7 +95,7 @@ public function getId() } /** - *

User-defined unique identifier of the referenced resource. Required if id is absent.

+ *

User-defined unique identifier of the referenced Order.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressAction.php index bc94493608a..e6de2794038 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressAction.php @@ -17,9 +17,8 @@ interface OrderSetBillingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionBuilder.php index c019967778c..1d0ca9edf76 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionBuilder.php @@ -29,9 +29,8 @@ final class OrderSetBillingAddressActionBuilder implements Builder private $address; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionModel.php index 1a5b0b17b06..0d94c77077f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetBillingAddressActionModel.php @@ -65,9 +65,8 @@ public function getAction() } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php index d374b45a9f3..217bc2dfa67 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php @@ -18,6 +18,8 @@ interface OrderSetCustomLineItemCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php index ec5a194a700..f8edeafdb6b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php @@ -39,6 +39,8 @@ final class OrderSetCustomLineItemCustomFieldActionBuilder implements Builder private $value; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php index 45eb44de895..d3779b6da6a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php @@ -79,6 +79,8 @@ public function getAction() } /** + *

id of the CustomLineItem to update.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php index 1aef92dbf35..2758baf5ad4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php @@ -20,14 +20,16 @@ interface OrderSetCustomLineItemCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ public function getCustomLineItemId(); /** - *

Defines the Type that extends the CustomLineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

+ *

Defines the Type that extends the Custom Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

* * @return null|TypeResourceIdentifier @@ -35,7 +37,7 @@ public function getCustomLineItemId(); public function getType(); /** - *

Sets the Custom Fields fields for the CustomLineItem.

+ *

Sets the Custom Fields fields for the Custom Line Item.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php index 646e5c18b9b..39e6a7ae20a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php @@ -43,6 +43,8 @@ final class OrderSetCustomLineItemCustomTypeActionBuilder implements Builder private $fields; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ @@ -52,8 +54,8 @@ public function getCustomLineItemId() } /** - *

Defines the Type that extends the CustomLineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

+ *

Defines the Type that extends the Custom Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

* * @return null|TypeResourceIdentifier @@ -64,7 +66,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the CustomLineItem.

+ *

Sets the Custom Fields fields for the Custom Line Item.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php index fd576964670..ebaa6dddeee 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php @@ -83,6 +83,8 @@ public function getAction() } /** + *

id of the CustomLineItem to update.

+ * * * @return null|string */ @@ -101,8 +103,8 @@ public function getCustomLineItemId() } /** - *

Defines the Type that extends the CustomLineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

+ *

Defines the Type that extends the Custom Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

* * * @return null|TypeResourceIdentifier @@ -123,7 +125,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the CustomLineItem.

+ *

Sets the Custom Fields fields for the Custom Line Item.

* * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php index 3565bb3510a..3277b426414 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php @@ -18,13 +18,16 @@ interface OrderSetCustomLineItemShippingDetailsAction extends OrderUpdateAction public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ public function getCustomLineItemId(); /** - *

For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php index a2b83b26dbe..4bee7247d20 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php @@ -35,6 +35,8 @@ final class OrderSetCustomLineItemShippingDetailsActionBuilder implements Builde private $shippingDetails; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ @@ -44,7 +46,8 @@ public function getCustomLineItemId() } /** - *

For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php index bcbf8177ca9..27a86378da5 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

id of the CustomLineItem to update.

+ * * * @return null|string */ @@ -91,7 +93,8 @@ public function getCustomLineItemId() } /** - *

For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

+ *

Value to set. + * If empty, any existing value is removed.

* * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailAction.php index ced6ddf5653..2d67506f7d1 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailAction.php @@ -16,6 +16,9 @@ interface OrderSetCustomerEmailAction extends OrderUpdateAction public const FIELD_EMAIL = 'email'; /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionBuilder.php index 64a18a75c3d..f337d76576b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionBuilder.php @@ -27,6 +27,9 @@ final class OrderSetCustomerEmailActionBuilder implements Builder private $email; /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionModel.php index 2067dc6eb61..e1ead9bd3cd 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerEmailActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

Value to set. + * If empty, any existing value is removed.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdAction.php index 2c71c305a62..15d3cf2ee36 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdAction.php @@ -16,6 +16,9 @@ interface OrderSetCustomerIdAction extends OrderUpdateAction public const FIELD_CUSTOMER_ID = 'customerId'; /** + *

id of an existing Customer. + * If empty, any existing value is removed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionBuilder.php index 74ab4af5ee8..ccc854d1676 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionBuilder.php @@ -27,6 +27,9 @@ final class OrderSetCustomerIdActionBuilder implements Builder private $customerId; /** + *

id of an existing Customer. + * If empty, any existing value is removed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionModel.php index b35c6923ea5..b4c02d7c036 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomerIdActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

id of an existing Customer. + * If empty, any existing value is removed.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php index b8d8df13b24..bfb564a1ad2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressAction.php @@ -19,7 +19,8 @@ interface OrderSetDeliveryAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -27,7 +28,8 @@ interface OrderSetDeliveryAddressAction extends OrderUpdateAction public function getDeliveryId(); /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -35,9 +37,8 @@ public function getDeliveryId(); public function getDeliveryKey(); /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php index fb5350d08fb..750bd2b0ee1 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionBuilder.php @@ -41,7 +41,8 @@ final class OrderSetDeliveryAddressActionBuilder implements Builder private $address; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -52,7 +53,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -63,9 +65,8 @@ public function getDeliveryKey() } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php index 919bf634f70..83fb00e0291 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressActionModel.php @@ -81,7 +81,8 @@ public function getAction() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -101,7 +102,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -121,9 +123,8 @@ public function getDeliveryKey() } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldAction.php index a60c12f2baf..a610c185ecc 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldAction.php @@ -19,7 +19,8 @@ interface OrderSetDeliveryAddressCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -27,7 +28,8 @@ interface OrderSetDeliveryAddressCustomFieldAction extends OrderUpdateAction public function getDeliveryId(); /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionBuilder.php index ea8bb7bcd9f..dafc66d32cd 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionBuilder.php @@ -45,7 +45,8 @@ final class OrderSetDeliveryAddressCustomFieldActionBuilder implements Builder private $value; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -56,7 +57,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionModel.php index 3f98fea9044..08188194b36 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomFieldActionModel.php @@ -87,7 +87,8 @@ public function getAction() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -107,7 +108,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeAction.php index fdd10736d40..7fac2559a55 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeAction.php @@ -21,7 +21,8 @@ interface OrderSetDeliveryAddressCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -29,7 +30,8 @@ interface OrderSetDeliveryAddressCustomTypeAction extends OrderUpdateAction public function getDeliveryId(); /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -37,8 +39,8 @@ public function getDeliveryId(); public function getDeliveryKey(); /** - *

Defines the Type that extends the address in a Delivery with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

+ *

Defines the Type that extends the Delivery address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Delivery address.

* * @return null|TypeResourceIdentifier @@ -46,7 +48,7 @@ public function getDeliveryKey(); public function getType(); /** - *

Sets the Custom Fields fields for the address in a Delivery.

+ *

Sets the Custom Fields fields for the Delivery address.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionBuilder.php index c8304f850ee..33704ccd3d6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionBuilder.php @@ -49,7 +49,8 @@ final class OrderSetDeliveryAddressCustomTypeActionBuilder implements Builder private $fields; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -60,7 +61,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -71,8 +73,8 @@ public function getDeliveryKey() } /** - *

Defines the Type that extends the address in a Delivery with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

+ *

Defines the Type that extends the Delivery address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Delivery address.

* * @return null|TypeResourceIdentifier @@ -83,7 +85,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the address in a Delivery.

+ *

Sets the Custom Fields fields for the Delivery address.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionModel.php index c9148ff5b3f..5688441b1f3 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryAddressCustomTypeActionModel.php @@ -91,7 +91,8 @@ public function getAction() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -111,7 +112,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -131,8 +133,8 @@ public function getDeliveryKey() } /** - *

Defines the Type that extends the address in a Delivery with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

+ *

Defines the Type that extends the Delivery address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Delivery address.

* * * @return null|TypeResourceIdentifier @@ -153,7 +155,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the address in a Delivery.

+ *

Sets the Custom Fields fields for the Delivery address.

* * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldAction.php index fe01ec96f8e..fc73b4cac44 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldAction.php @@ -19,7 +19,8 @@ interface OrderSetDeliveryCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -27,7 +28,8 @@ interface OrderSetDeliveryCustomFieldAction extends OrderUpdateAction public function getDeliveryId(); /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionBuilder.php index 3da33577645..c010cba549f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionBuilder.php @@ -45,7 +45,8 @@ final class OrderSetDeliveryCustomFieldActionBuilder implements Builder private $value; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -56,7 +57,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionModel.php index 3516452426c..a58a3fbb418 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomFieldActionModel.php @@ -87,7 +87,8 @@ public function getAction() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -107,7 +108,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeAction.php index 351d845c3d3..e6b291704bf 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeAction.php @@ -21,7 +21,8 @@ interface OrderSetDeliveryCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -29,7 +30,8 @@ interface OrderSetDeliveryCustomTypeAction extends OrderUpdateAction public function getDeliveryId(); /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionBuilder.php index 912f3a500ed..ea6f92a94ed 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionBuilder.php @@ -49,7 +49,8 @@ final class OrderSetDeliveryCustomTypeActionBuilder implements Builder private $fields; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -60,7 +61,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionModel.php index c104309bfb8..ad7336a66fd 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryCustomTypeActionModel.php @@ -91,7 +91,8 @@ public function getAction() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -111,7 +112,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsAction.php index e91825335bc..e0a62227eb1 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsAction.php @@ -18,7 +18,8 @@ interface OrderSetDeliveryItemsAction extends OrderUpdateAction public const FIELD_ITEMS = 'items'; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -26,7 +27,8 @@ interface OrderSetDeliveryItemsAction extends OrderUpdateAction public function getDeliveryId(); /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -34,6 +36,9 @@ public function getDeliveryId(); public function getDeliveryKey(); /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionBuilder.php index c21236193d2..491d6be3970 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionBuilder.php @@ -39,7 +39,8 @@ final class OrderSetDeliveryItemsActionBuilder implements Builder private $items; /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -50,7 +51,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * @return null|string @@ -61,6 +63,9 @@ public function getDeliveryKey() } /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionModel.php index 59bad4297d7..fd4203129d6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetDeliveryItemsActionModel.php @@ -79,7 +79,8 @@ public function getAction() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

id of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -99,7 +100,8 @@ public function getDeliveryId() } /** - *

Either deliveryId or deliveryKey is required for this update action.

+ *

key of an existing Delivery.

+ *

Either deliveryId or deliveryKey must be provided.

* * * @return null|string @@ -119,6 +121,9 @@ public function getDeliveryKey() } /** + *

Value to set. + * If empty, any existing value is removed.

+ * * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldAction.php index a827ef13486..3b04e0346c7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldAction.php @@ -18,6 +18,8 @@ interface OrderSetItemShippingAddressCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** + *

key of the Address in itemShippingAddresses.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionBuilder.php index a2e7a634ade..c048e85b525 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionBuilder.php @@ -39,6 +39,8 @@ final class OrderSetItemShippingAddressCustomFieldActionBuilder implements Build private $value; /** + *

key of the Address in itemShippingAddresses.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionModel.php index efa150da3d2..a731c4459f4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomFieldActionModel.php @@ -79,6 +79,8 @@ public function getAction() } /** + *

key of the Address in itemShippingAddresses.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeAction.php index c2040fcbe85..229bd82a523 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeAction.php @@ -20,6 +20,8 @@ interface OrderSetItemShippingAddressCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + *

key of the Address in itemShippingAddresses.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionBuilder.php index 2eaf2e0360e..ed0389402a5 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionBuilder.php @@ -43,6 +43,8 @@ final class OrderSetItemShippingAddressCustomTypeActionBuilder implements Builde private $fields; /** + *

key of the Address in itemShippingAddresses.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionModel.php index 080f00c82fa..999a7157bc0 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetItemShippingAddressCustomTypeActionModel.php @@ -83,6 +83,8 @@ public function getAction() } /** + *

key of the Address in itemShippingAddresses.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeAction.php index 5f559d68048..85d0c3b7760 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeAction.php @@ -37,8 +37,8 @@ public function getLineItemId(); public function getLineItemKey(); /** - *

Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

+ *

Defines the Type that extends the Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Line Item.

* * @return null|TypeResourceIdentifier @@ -46,7 +46,7 @@ public function getLineItemKey(); public function getType(); /** - *

Sets the Custom Fields fields for the LineItem.

+ *

Sets the Custom Fields fields for the Line Item.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionBuilder.php index 87dc182e0f2..af536a33d6d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionBuilder.php @@ -71,8 +71,8 @@ public function getLineItemKey() } /** - *

Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

+ *

Defines the Type that extends the Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Line Item.

* * @return null|TypeResourceIdentifier @@ -83,7 +83,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the LineItem.

+ *

Sets the Custom Fields fields for the Line Item.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionModel.php index 324002a5494..009af51ee8a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemCustomTypeActionModel.php @@ -131,8 +131,8 @@ public function getLineItemKey() } /** - *

Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

+ *

Defines the Type that extends the Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Line Item.

* * * @return null|TypeResourceIdentifier @@ -153,7 +153,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the LineItem.

+ *

Sets the Custom Fields fields for the Line Item.

* * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php index bd424a84418..a9543635166 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsAction.php @@ -35,7 +35,8 @@ public function getLineItemId(); public function getLineItemKey(); /** - *

For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

+ *

Value to set. + * If empty, the existing value is removed.

* * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php index 5bc95c528f5..84b60cfb95b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionBuilder.php @@ -63,7 +63,8 @@ public function getLineItemKey() } /** - *

For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

+ *

Value to set. + * If empty, the existing value is removed.

* * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php index 651faca609c..0b3ec385119 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLineItemShippingDetailsActionModel.php @@ -121,7 +121,8 @@ public function getLineItemKey() } /** - *

For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

+ *

Value to set. + * If empty, the existing value is removed.

* * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLocaleAction.php b/lib/commercetools-api/src/Models/Order/OrderSetLocaleAction.php index 261dd4c019d..b3e685e1daf 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLocaleAction.php @@ -16,6 +16,10 @@ interface OrderSetLocaleAction extends OrderUpdateAction public const FIELD_LOCALE = 'locale'; /** + *

Value to set. + * Must be one of the Project's languages. + * If empty, any existing value is removed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionBuilder.php index 1a8d60114f9..e095f4ffbe8 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionBuilder.php @@ -27,6 +27,10 @@ final class OrderSetLocaleActionBuilder implements Builder private $locale; /** + *

Value to set. + * Must be one of the Project's languages. + * If empty, any existing value is removed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionModel.php index 7c349854896..fa0e7f9125b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetLocaleActionModel.php @@ -63,6 +63,10 @@ public function getAction() } /** + *

Value to set. + * Must be one of the Project's languages. + * If empty, any existing value is removed.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberAction.php b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberAction.php index 04e7c464b57..6bc31282f1e 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberAction.php @@ -16,6 +16,10 @@ interface OrderSetOrderNumberAction extends OrderUpdateAction public const FIELD_ORDER_NUMBER = 'orderNumber'; /** + *

Value to set. + * Must be unique across a Project. + * Once set, the value cannot be changed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionBuilder.php index 9f194dd7e3f..b21b333de19 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionBuilder.php @@ -27,6 +27,10 @@ final class OrderSetOrderNumberActionBuilder implements Builder private $orderNumber; /** + *

Value to set. + * Must be unique across a Project. + * Once set, the value cannot be changed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionModel.php index 3453ae61ff3..91a0e765b4c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetOrderNumberActionModel.php @@ -63,6 +63,10 @@ public function getAction() } /** + *

Value to set. + * Must be unique across a Project. + * Once set, the value cannot be changed.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldAction.php index 283b4176d02..5ad94657054 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldAction.php @@ -19,7 +19,8 @@ interface OrderSetParcelCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -27,7 +28,8 @@ interface OrderSetParcelCustomFieldAction extends OrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionBuilder.php index cffe1c95571..f7dcf5d68e2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionBuilder.php @@ -45,7 +45,8 @@ final class OrderSetParcelCustomFieldActionBuilder implements Builder private $value; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -56,7 +57,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionModel.php index 2dc58ccb4bb..3c5c61a11cc 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomFieldActionModel.php @@ -87,7 +87,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -107,7 +108,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeAction.php index bdf2f39e1f4..3ff5c9d77da 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeAction.php @@ -21,7 +21,8 @@ interface OrderSetParcelCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -29,7 +30,8 @@ interface OrderSetParcelCustomTypeAction extends OrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionBuilder.php index eb432492c09..52ee3efb11a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionBuilder.php @@ -49,7 +49,8 @@ final class OrderSetParcelCustomTypeActionBuilder implements Builder private $fields; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -60,7 +61,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionModel.php index 57fa9ea0659..ea5503880a8 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelCustomTypeActionModel.php @@ -91,7 +91,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -111,7 +112,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsAction.php index 46d005ad479..5babb7c5610 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsAction.php @@ -18,7 +18,8 @@ interface OrderSetParcelItemsAction extends OrderUpdateAction public const FIELD_ITEMS = 'items'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -26,7 +27,8 @@ interface OrderSetParcelItemsAction extends OrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -34,6 +36,9 @@ public function getParcelId(); public function getParcelKey(); /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionBuilder.php index 18d90f441a8..6627aa051fb 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionBuilder.php @@ -39,7 +39,8 @@ final class OrderSetParcelItemsActionBuilder implements Builder private $items; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -50,7 +51,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -61,6 +63,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionModel.php index c920d82b2d3..3d35ab1f3fc 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelItemsActionModel.php @@ -79,7 +79,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -99,7 +100,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -119,6 +121,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value is removed.

+ * * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsAction.php index 534d6a902fb..9d437333e01 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsAction.php @@ -18,7 +18,8 @@ interface OrderSetParcelMeasurementsAction extends OrderUpdateAction public const FIELD_MEASUREMENTS = 'measurements'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -26,7 +27,8 @@ interface OrderSetParcelMeasurementsAction extends OrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -34,6 +36,9 @@ public function getParcelId(); public function getParcelKey(); /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|ParcelMeasurements */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionBuilder.php index 45749b63f78..c0000667a9c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionBuilder.php @@ -39,7 +39,8 @@ final class OrderSetParcelMeasurementsActionBuilder implements Builder private $measurements; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -50,7 +51,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -61,6 +63,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|ParcelMeasurements */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionModel.php index 309f164571e..d07366bd93b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelMeasurementsActionModel.php @@ -79,7 +79,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -99,7 +100,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -119,6 +121,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value is removed.

+ * * * @return null|ParcelMeasurements */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataAction.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataAction.php index 3a90e4dc973..66db8db3ff3 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataAction.php @@ -18,7 +18,8 @@ interface OrderSetParcelTrackingDataAction extends OrderUpdateAction public const FIELD_TRACKING_DATA = 'trackingData'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -26,7 +27,8 @@ interface OrderSetParcelTrackingDataAction extends OrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -34,6 +36,9 @@ public function getParcelId(); public function getParcelKey(); /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|TrackingData */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionBuilder.php index 3843253414c..bde3f9e6f64 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionBuilder.php @@ -39,7 +39,8 @@ final class OrderSetParcelTrackingDataActionBuilder implements Builder private $trackingData; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -50,7 +51,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -61,6 +63,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|TrackingData */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionModel.php index 2cfceb87b4e..4d0358b27a7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetParcelTrackingDataActionModel.php @@ -79,7 +79,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -99,7 +100,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -119,6 +121,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value is removed.

+ * * * @return null|TrackingData */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberAction.php b/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberAction.php index 89add1abb82..ec28c112a26 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberAction.php @@ -16,8 +16,8 @@ interface OrderSetPurchaseOrderNumberAction extends OrderUpdateAction public const FIELD_PURCHASE_ORDER_NUMBER = 'purchaseOrderNumber'; /** - *

Identifier for a purchase order, usually in a B2B context. - * The Purchase Order Number is typically entered by the Buyer and can also be used with Quotes.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberActionBuilder.php index 5221c36f26c..fe5c1098183 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberActionBuilder.php @@ -27,8 +27,8 @@ final class OrderSetPurchaseOrderNumberActionBuilder implements Builder private $purchaseOrderNumber; /** - *

Identifier for a purchase order, usually in a B2B context. - * The Purchase Order Number is typically entered by the Buyer and can also be used with Quotes.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberActionModel.php index 8653179dc85..4161a854a08 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetPurchaseOrderNumberActionModel.php @@ -63,8 +63,8 @@ public function getAction() } /** - *

Identifier for a purchase order, usually in a B2B context. - * The Purchase Order Number is typically entered by the Buyer and can also be used with Quotes.

+ *

Value to set. + * If empty, any existing value is removed.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoAction.php index b57500faa85..8312215c88f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoAction.php @@ -16,6 +16,9 @@ interface OrderSetReturnInfoAction extends OrderUpdateAction public const FIELD_ITEMS = 'items'; /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|ReturnInfoDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionBuilder.php index 56f3c920ae5..f12d1589897 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionBuilder.php @@ -27,6 +27,9 @@ final class OrderSetReturnInfoActionBuilder implements Builder private $items; /** + *

Value to set. + * If empty, any existing value is removed.

+ * * @return null|ReturnInfoDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionModel.php index 3673b9294b9..798d0137ba9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnInfoActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

Value to set. + * If empty, any existing value is removed.

+ * * * @return null|ReturnInfoDraftCollection */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php index 5e4dd705794..980ef4a5e2d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php @@ -18,6 +18,8 @@ interface OrderSetReturnItemCustomFieldAction extends OrderUpdateAction public const FIELD_VALUE = 'value'; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php index 77c340e49af..26773ac5de0 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php @@ -39,6 +39,8 @@ final class OrderSetReturnItemCustomFieldActionBuilder implements Builder private $value; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php index 52b1cca9cca..dcf5346ee6e 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php @@ -79,6 +79,8 @@ public function getAction() } /** + *

id of the ReturnItem to update.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php index e27af1d1d4d..2eed3a5778d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php @@ -20,14 +20,16 @@ interface OrderSetReturnItemCustomTypeAction extends OrderUpdateAction public const FIELD_FIELDS = 'fields'; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ public function getReturnItemId(); /** - *

Defines the Type that extends the ReturnItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

+ *

Defines the Type that extends the Return Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Return Item.

* * @return null|TypeResourceIdentifier @@ -35,7 +37,7 @@ public function getReturnItemId(); public function getType(); /** - *

Sets the Custom Fields fields for the ReturnItem.

+ *

Sets the Custom Fields fields for the Return Item.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php index 2347b564b64..bfeb53ab507 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php @@ -43,6 +43,8 @@ final class OrderSetReturnItemCustomTypeActionBuilder implements Builder private $fields; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ @@ -52,8 +54,8 @@ public function getReturnItemId() } /** - *

Defines the Type that extends the ReturnItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

+ *

Defines the Type that extends the Return Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Return Item.

* * @return null|TypeResourceIdentifier @@ -64,7 +66,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the ReturnItem.

+ *

Sets the Custom Fields fields for the Return Item.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php index fd044caed9a..ff010648f0a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php @@ -83,6 +83,8 @@ public function getAction() } /** + *

id of the ReturnItem to update.

+ * * * @return null|string */ @@ -101,8 +103,8 @@ public function getReturnItemId() } /** - *

Defines the Type that extends the ReturnItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

+ *

Defines the Type that extends the Return Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Return Item.

* * * @return null|TypeResourceIdentifier @@ -123,7 +125,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the ReturnItem.

+ *

Sets the Custom Fields fields for the Return Item.

* * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php index 7a57bdb3e5c..6ae54daa461 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php @@ -17,12 +17,16 @@ interface OrderSetReturnPaymentStateAction extends OrderUpdateAction public const FIELD_PAYMENT_STATE = 'paymentState'; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ public function getReturnItemId(); /** + *

New Payment status of the ReturnItem.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php index 6636630d52b..6d127eb73c9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php @@ -33,6 +33,8 @@ final class OrderSetReturnPaymentStateActionBuilder implements Builder private $paymentState; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ @@ -42,6 +44,8 @@ public function getReturnItemId() } /** + *

New Payment status of the ReturnItem.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php index bf015e38090..73a13bfe884 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

id of the ReturnItem to update.

+ * * * @return null|string */ @@ -89,6 +91,8 @@ public function getReturnItemId() } /** + *

New Payment status of the ReturnItem.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php index 72821bd3416..e912725f511 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php @@ -17,12 +17,16 @@ interface OrderSetReturnShipmentStateAction extends OrderUpdateAction public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ public function getReturnItemId(); /** + *

New shipment state of the ReturnItem.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php index 901056a5373..e3519b76b87 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php @@ -33,6 +33,8 @@ final class OrderSetReturnShipmentStateActionBuilder implements Builder private $shipmentState; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ @@ -42,6 +44,8 @@ public function getReturnItemId() } /** + *

New shipment state of the ReturnItem.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php index 274be5de398..d30c771c915 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php @@ -71,6 +71,8 @@ public function getAction() } /** + *

id of the ReturnItem to update.

+ * * * @return null|string */ @@ -89,6 +91,8 @@ public function getReturnItemId() } /** + *

New shipment state of the ReturnItem.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php index 7972cb35a0e..d2109c5efa4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressAction.php @@ -17,9 +17,8 @@ interface OrderSetShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php index 10107a9f5b2..24e60ad86d7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionBuilder.php @@ -29,9 +29,8 @@ final class OrderSetShippingAddressActionBuilder implements Builder private $address; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php index c26bb94ebcb..03c0493a579 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetShippingAddressActionModel.php @@ -65,9 +65,8 @@ public function getAction() } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderSetStoreAction.php b/lib/commercetools-api/src/Models/Order/OrderSetStoreAction.php index 67cb8b71daa..23bfe7f8bd8 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetStoreAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetStoreAction.php @@ -17,7 +17,9 @@ interface OrderSetStoreAction extends OrderUpdateAction public const FIELD_STORE = 'store'; /** - *

ResourceIdentifier to a Store.

+ *

Value to set. + * If empty, any existing value is removed.

+ *

If store references the same Store the Order is currently assigned to or if you try to remove the value when no Store is currently assigned, a 400 error is returned.

* * @return null|StoreResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderSetStoreActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetStoreActionBuilder.php index 1be99bf9701..ba58ba43539 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetStoreActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetStoreActionBuilder.php @@ -29,7 +29,9 @@ final class OrderSetStoreActionBuilder implements Builder private $store; /** - *

ResourceIdentifier to a Store.

+ *

Value to set. + * If empty, any existing value is removed.

+ *

If store references the same Store the Order is currently assigned to or if you try to remove the value when no Store is currently assigned, a 400 error is returned.

* * @return null|StoreResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderSetStoreActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetStoreActionModel.php index 6c9f6a9721b..d81527bdaa8 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetStoreActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetStoreActionModel.php @@ -65,7 +65,9 @@ public function getAction() } /** - *

ResourceIdentifier to a Store.

+ *

Value to set. + * If empty, any existing value is removed.

+ *

If store references the same Store the Order is currently assigned to or if you try to remove the value when no Store is currently assigned, a 400 error is returned.

* * * @return null|StoreResourceIdentifier diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php index 7614b7a536a..0599639e81d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php @@ -22,19 +22,23 @@ interface OrderTransitionCustomLineItemStateAction extends OrderUpdateAction public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ public function getCustomLineItemId(); /** + *

Number of Custom Line Items that should transition State.

+ * * @return null|int */ public function getQuantity(); /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition from.

* * @return null|StateResourceIdentifier @@ -42,7 +46,7 @@ public function getQuantity(); public function getFromState(); /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition to.

* * @return null|StateResourceIdentifier @@ -50,6 +54,8 @@ public function getFromState(); public function getToState(); /** + *

Date and time (UTC) to perform the State transition.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php index 9ac69a8405a..cd60789d03d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php @@ -54,6 +54,8 @@ final class OrderTransitionCustomLineItemStateActionBuilder implements Builder private $actualTransitionDate; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ @@ -63,6 +65,8 @@ public function getCustomLineItemId() } /** + *

Number of Custom Line Items that should transition State.

+ * * @return null|int */ @@ -72,7 +76,7 @@ public function getQuantity() } /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition from.

* * @return null|StateResourceIdentifier @@ -83,7 +87,7 @@ public function getFromState() } /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition to.

* * @return null|StateResourceIdentifier @@ -94,6 +98,8 @@ public function getToState() } /** + *

Date and time (UTC) to perform the State transition.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php index 37f1a579d0b..0003d2fc9a9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php @@ -98,6 +98,8 @@ public function getAction() } /** + *

id of the CustomLineItem to update.

+ * * * @return null|string */ @@ -116,6 +118,8 @@ public function getCustomLineItemId() } /** + *

Number of Custom Line Items that should transition State.

+ * * * @return null|int */ @@ -134,7 +138,7 @@ public function getQuantity() } /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition from.

* * * @return null|StateResourceIdentifier @@ -155,7 +159,7 @@ public function getFromState() } /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition to.

* * * @return null|StateResourceIdentifier @@ -176,6 +180,8 @@ public function getToState() } /** + *

Date and time (UTC) to perform the State transition.

+ * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php index e553f8ec86b..ccda9a71903 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php @@ -22,19 +22,23 @@ interface OrderTransitionLineItemStateAction extends OrderUpdateAction public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** + *

id of the LineItem to update.

+ * * @return null|string */ public function getLineItemId(); /** + *

Number of Line Items that should transition State.

+ * * @return null|int */ public function getQuantity(); /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition from.

* * @return null|StateResourceIdentifier @@ -42,7 +46,7 @@ public function getQuantity(); public function getFromState(); /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition to.

* * @return null|StateResourceIdentifier @@ -50,6 +54,8 @@ public function getFromState(); public function getToState(); /** + *

Date and time (UTC) to perform the State transition.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php index 419cdacfa46..9c4b1769067 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php @@ -54,6 +54,8 @@ final class OrderTransitionLineItemStateActionBuilder implements Builder private $actualTransitionDate; /** + *

id of the LineItem to update.

+ * * @return null|string */ @@ -63,6 +65,8 @@ public function getLineItemId() } /** + *

Number of Line Items that should transition State.

+ * * @return null|int */ @@ -72,7 +76,7 @@ public function getQuantity() } /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition from.

* * @return null|StateResourceIdentifier @@ -83,7 +87,7 @@ public function getFromState() } /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition to.

* * @return null|StateResourceIdentifier @@ -94,6 +98,8 @@ public function getToState() } /** + *

Date and time (UTC) to perform the State transition.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php index e9d0d19a5f2..f817ba21ec4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php @@ -98,6 +98,8 @@ public function getAction() } /** + *

id of the LineItem to update.

+ * * * @return null|string */ @@ -116,6 +118,8 @@ public function getLineItemId() } /** + *

Number of Line Items that should transition State.

+ * * * @return null|int */ @@ -134,7 +138,7 @@ public function getQuantity() } /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition from.

* * * @return null|StateResourceIdentifier @@ -155,7 +159,7 @@ public function getFromState() } /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition to.

* * * @return null|StateResourceIdentifier @@ -176,6 +180,8 @@ public function getToState() } /** + *

Date and time (UTC) to perform the State transition.

+ * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionStateAction.php b/lib/commercetools-api/src/Models/Order/OrderTransitionStateAction.php index 7ae0c579dab..89b0af0a714 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionStateAction.php @@ -18,7 +18,8 @@ interface OrderTransitionStateAction extends OrderUpdateAction public const FIELD_FORCE = 'force'; /** - *

ResourceIdentifier to a State.

+ *

Value to set. + * If there is no State yet, the new State must be an initial State.

* * @return null|StateResourceIdentifier @@ -26,6 +27,8 @@ interface OrderTransitionStateAction extends OrderUpdateAction public function getState(); /** + *

Set to true to turn off validation.

+ * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionBuilder.php index ec6e00a12e6..3764bb9375d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionBuilder.php @@ -35,7 +35,8 @@ final class OrderTransitionStateActionBuilder implements Builder private $force; /** - *

ResourceIdentifier to a State.

+ *

Value to set. + * If there is no State yet, the new State must be an initial State.

* * @return null|StateResourceIdentifier @@ -46,6 +47,8 @@ public function getState() } /** + *

Set to true to turn off validation.

+ * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionModel.php index 710d342b868..8edf2ba57db 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionStateActionModel.php @@ -73,7 +73,8 @@ public function getAction() } /** - *

ResourceIdentifier to a State.

+ *

Value to set. + * If there is no State yet, the new State must be an initial State.

* * * @return null|StateResourceIdentifier @@ -94,6 +95,8 @@ public function getState() } /** + *

Set to true to turn off validation.

+ * * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdate.php b/lib/commercetools-api/src/Models/Order/OrderUpdate.php index 7700b8d0177..3d0ba73a553 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdate.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdate.php @@ -18,7 +18,7 @@ interface OrderUpdate extends JsonObject /** *

Expected version of the Order on which the changes should be applied. - * If the expected version does not match the actual version, a 409 Conflict error will be returned.

+ * If the expected version does not match the actual version, a 409 Conflict will be returned.

* * @return null|int diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateBuilder.php b/lib/commercetools-api/src/Models/Order/OrderUpdateBuilder.php index 9804ec1649b..95a9d1277e6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateBuilder.php @@ -34,7 +34,7 @@ final class OrderUpdateBuilder implements Builder /** *

Expected version of the Order on which the changes should be applied. - * If the expected version does not match the actual version, a 409 Conflict error will be returned.

+ * If the expected version does not match the actual version, a 409 Conflict will be returned.

* * @return null|int diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php index d6f9264a917..89fcb7c2ea1 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressAction.php @@ -17,9 +17,7 @@ interface OrderUpdateItemShippingAddressAction extends OrderUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

The new Address with the same key as the Address it will replace.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php index 2c3af8537d1..85cbeec01b7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionBuilder.php @@ -29,9 +29,7 @@ final class OrderUpdateItemShippingAddressActionBuilder implements Builder private $address; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

The new Address with the same key as the Address it will replace.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php index 2f4f092559b..e905e165842 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateItemShippingAddressActionModel.php @@ -65,9 +65,7 @@ public function getAction() } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

The new Address with the same key as the Address it will replace.

* * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateModel.php b/lib/commercetools-api/src/Models/Order/OrderUpdateModel.php index 04c544a55eb..328251a0b53 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateModel.php @@ -45,7 +45,7 @@ public function __construct( /** *

Expected version of the Order on which the changes should be applied. - * If the expected version does not match the actual version, a 409 Conflict error will be returned.

+ * If the expected version does not match the actual version, a 409 Conflict will be returned.

* * * @return null|int diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoAction.php b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoAction.php index f8315da3376..ddd6d80636a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoAction.php @@ -15,39 +15,45 @@ interface OrderUpdateSyncInfoAction extends OrderUpdateAction { - public const FIELD_CHANNEL = 'channel'; public const FIELD_EXTERNAL_ID = 'externalId'; + public const FIELD_CHANNEL = 'channel'; public const FIELD_SYNCED_AT = 'syncedAt'; /** - *

ResourceIdentifier to a Channel.

+ *

Set this to identify an external order instance, file, or other resource.

* - * @return null|ChannelResourceIdentifier + * @return null|string */ - public function getChannel(); + public function getExternalId(); /** + *

The synchronization destination to set. Must not be empty. + * The referenced Channel must have the Channel Role OrderExport or OrderImport. + * Otherwise this update action returns an InvalidInput error.

+ * - * @return null|string + * @return null|ChannelResourceIdentifier */ - public function getExternalId(); + public function getChannel(); /** + *

If not set, it defaults to the current date and time.

+ * * @return null|DateTimeImmutable */ public function getSyncedAt(); /** - * @param ?ChannelResourceIdentifier $channel + * @param ?string $externalId */ - public function setChannel(?ChannelResourceIdentifier $channel): void; + public function setExternalId(?string $externalId): void; /** - * @param ?string $externalId + * @param ?ChannelResourceIdentifier $channel */ - public function setExternalId(?string $externalId): void; + public function setChannel(?ChannelResourceIdentifier $channel): void; /** * @param ?DateTimeImmutable $syncedAt diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionBuilder.php index 97e5b18c262..0e2e811506a 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionBuilder.php @@ -25,15 +25,15 @@ final class OrderUpdateSyncInfoActionBuilder implements Builder { /** - * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder + * @var ?string */ - private $channel; + private $externalId; /** - * @var ?string + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ - private $externalId; + private $channel; /** @@ -42,26 +42,32 @@ final class OrderUpdateSyncInfoActionBuilder implements Builder private $syncedAt; /** - *

ResourceIdentifier to a Channel.

+ *

Set this to identify an external order instance, file, or other resource.

* - * @return null|ChannelResourceIdentifier + * @return null|string */ - public function getChannel() + public function getExternalId() { - return $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel; + return $this->externalId; } /** + *

The synchronization destination to set. Must not be empty. + * The referenced Channel must have the Channel Role OrderExport or OrderImport. + * Otherwise this update action returns an InvalidInput error.

+ * - * @return null|string + * @return null|ChannelResourceIdentifier */ - public function getExternalId() + public function getChannel() { - return $this->externalId; + return $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel; } /** + *

If not set, it defaults to the current date and time.

+ * * @return null|DateTimeImmutable */ @@ -71,23 +77,23 @@ public function getSyncedAt() } /** - * @param ?ChannelResourceIdentifier $channel + * @param ?string $externalId * @return $this */ - public function withChannel(?ChannelResourceIdentifier $channel) + public function withExternalId(?string $externalId) { - $this->channel = $channel; + $this->externalId = $externalId; return $this; } /** - * @param ?string $externalId + * @param ?ChannelResourceIdentifier $channel * @return $this */ - public function withExternalId(?string $externalId) + public function withChannel(?ChannelResourceIdentifier $channel) { - $this->externalId = $externalId; + $this->channel = $channel; return $this; } @@ -117,8 +123,8 @@ public function withChannelBuilder(?ChannelResourceIdentifierBuilder $channel) public function build(): OrderUpdateSyncInfoAction { return new OrderUpdateSyncInfoActionModel( - $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel, $this->externalId, + $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel, $this->syncedAt ); } diff --git a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionModel.php b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionModel.php index 5f5e3b0f59c..d762b37c731 100644 --- a/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderUpdateSyncInfoActionModel.php @@ -31,15 +31,15 @@ final class OrderUpdateSyncInfoActionModel extends JsonObjectModel implements Or /** * - * @var ?ChannelResourceIdentifier + * @var ?string */ - protected $channel; + protected $externalId; /** * - * @var ?string + * @var ?ChannelResourceIdentifier */ - protected $externalId; + protected $channel; /** * @@ -52,13 +52,13 @@ final class OrderUpdateSyncInfoActionModel extends JsonObjectModel implements Or * @psalm-suppress MissingParamType */ public function __construct( - ?ChannelResourceIdentifier $channel = null, ?string $externalId = null, + ?ChannelResourceIdentifier $channel = null, ?DateTimeImmutable $syncedAt = null, ?string $action = null ) { - $this->channel = $channel; $this->externalId = $externalId; + $this->channel = $channel; $this->syncedAt = $syncedAt; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -82,45 +82,51 @@ public function getAction() } /** - *

ResourceIdentifier to a Channel.

+ *

Set this to identify an external order instance, file, or other resource.

* * - * @return null|ChannelResourceIdentifier + * @return null|string */ - public function getChannel() + public function getExternalId() { - if (is_null($this->channel)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CHANNEL); + if (is_null($this->externalId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_EXTERNAL_ID); if (is_null($data)) { return null; } - - $this->channel = ChannelResourceIdentifierModel::of($data); + $this->externalId = (string) $data; } - return $this->channel; + return $this->externalId; } /** + *

The synchronization destination to set. Must not be empty. + * The referenced Channel must have the Channel Role OrderExport or OrderImport. + * Otherwise this update action returns an InvalidInput error.

* - * @return null|string + * + * @return null|ChannelResourceIdentifier */ - public function getExternalId() + public function getChannel() { - if (is_null($this->externalId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_EXTERNAL_ID); + if (is_null($this->channel)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CHANNEL); if (is_null($data)) { return null; } - $this->externalId = (string) $data; + + $this->channel = ChannelResourceIdentifierModel::of($data); } - return $this->externalId; + return $this->channel; } /** + *

If not set, it defaults to the current date and time.

+ * * * @return null|DateTimeImmutable */ @@ -144,19 +150,19 @@ public function getSyncedAt() /** - * @param ?ChannelResourceIdentifier $channel + * @param ?string $externalId */ - public function setChannel(?ChannelResourceIdentifier $channel): void + public function setExternalId(?string $externalId): void { - $this->channel = $channel; + $this->externalId = $externalId; } /** - * @param ?string $externalId + * @param ?ChannelResourceIdentifier $channel */ - public function setExternalId(?string $externalId): void + public function setChannel(?ChannelResourceIdentifier $channel): void { - $this->externalId = $externalId; + $this->channel = $channel; } /** diff --git a/lib/commercetools-api/src/Models/Order/Parcel.php b/lib/commercetools-api/src/Models/Order/Parcel.php index 8ac65487dca..fd7c4e3c505 100644 --- a/lib/commercetools-api/src/Models/Order/Parcel.php +++ b/lib/commercetools-api/src/Models/Order/Parcel.php @@ -40,25 +40,31 @@ public function getId(); public function getKey(); /** + *

Date and time (UTC) the Parcel was created.

+ * * @return null|DateTimeImmutable */ public function getCreatedAt(); /** + *

Information about the dimensions of the Parcel.

+ * * @return null|ParcelMeasurements */ public function getMeasurements(); /** + *

Shipment tracking information of the Parcel.

+ * * @return null|TrackingData */ public function getTrackingData(); /** - *

The delivery items contained in this parcel.

+ *

Line Items or Custom Line Items delivered in this Parcel.

* * @return null|DeliveryItemCollection @@ -66,7 +72,7 @@ public function getTrackingData(); public function getItems(); /** - *

Custom Fields of this parcel.

+ *

Custom Fields of the Parcel.

* * @return null|CustomFields diff --git a/lib/commercetools-api/src/Models/Order/ParcelBuilder.php b/lib/commercetools-api/src/Models/Order/ParcelBuilder.php index c1821f70ce5..e36e1cd6db0 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ParcelBuilder.php @@ -88,6 +88,8 @@ public function getKey() } /** + *

Date and time (UTC) the Parcel was created.

+ * * @return null|DateTimeImmutable */ @@ -97,6 +99,8 @@ public function getCreatedAt() } /** + *

Information about the dimensions of the Parcel.

+ * * @return null|ParcelMeasurements */ @@ -106,6 +110,8 @@ public function getMeasurements() } /** + *

Shipment tracking information of the Parcel.

+ * * @return null|TrackingData */ @@ -115,7 +121,7 @@ public function getTrackingData() } /** - *

The delivery items contained in this parcel.

+ *

Line Items or Custom Line Items delivered in this Parcel.

* * @return null|DeliveryItemCollection @@ -126,7 +132,7 @@ public function getItems() } /** - *

Custom Fields of this parcel.

+ *

Custom Fields of the Parcel.

* * @return null|CustomFields diff --git a/lib/commercetools-api/src/Models/Order/ParcelDraft.php b/lib/commercetools-api/src/Models/Order/ParcelDraft.php index 43596960c12..702e676fccd 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelDraft.php +++ b/lib/commercetools-api/src/Models/Order/ParcelDraft.php @@ -29,19 +29,23 @@ interface ParcelDraft extends JsonObject public function getKey(); /** + *

Information about the dimensions for the Parcel.

+ * * @return null|ParcelMeasurements */ public function getMeasurements(); /** + *

Shipment tracking information for the Parcel.

+ * * @return null|TrackingData */ public function getTrackingData(); /** - *

The delivery items contained in this parcel.

+ *

Line Items or Custom Line Items delivered in this Parcel.

* * @return null|DeliveryItemCollection @@ -49,7 +53,7 @@ public function getTrackingData(); public function getItems(); /** - *

Custom Fields of this parcel.

+ *

Custom Fields for the Parcel.

* * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/ParcelDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ParcelDraftBuilder.php index 22f1b5e4438..6692883b3fc 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ParcelDraftBuilder.php @@ -64,6 +64,8 @@ public function getKey() } /** + *

Information about the dimensions for the Parcel.

+ * * @return null|ParcelMeasurements */ @@ -73,6 +75,8 @@ public function getMeasurements() } /** + *

Shipment tracking information for the Parcel.

+ * * @return null|TrackingData */ @@ -82,7 +86,7 @@ public function getTrackingData() } /** - *

The delivery items contained in this parcel.

+ *

Line Items or Custom Line Items delivered in this Parcel.

* * @return null|DeliveryItemCollection @@ -93,7 +97,7 @@ public function getItems() } /** - *

Custom Fields of this parcel.

+ *

Custom Fields for the Parcel.

* * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/ParcelDraftModel.php b/lib/commercetools-api/src/Models/Order/ParcelDraftModel.php index 16ddc49f78f..85c62e2a0ac 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ParcelDraftModel.php @@ -90,6 +90,8 @@ public function getKey() } /** + *

Information about the dimensions for the Parcel.

+ * * * @return null|ParcelMeasurements */ @@ -109,6 +111,8 @@ public function getMeasurements() } /** + *

Shipment tracking information for the Parcel.

+ * * * @return null|TrackingData */ @@ -128,7 +132,7 @@ public function getTrackingData() } /** - *

The delivery items contained in this parcel.

+ *

Line Items or Custom Line Items delivered in this Parcel.

* * * @return null|DeliveryItemCollection @@ -148,7 +152,7 @@ public function getItems() } /** - *

Custom Fields of this parcel.

+ *

Custom Fields for the Parcel.

* * * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/ParcelMeasurements.php b/lib/commercetools-api/src/Models/Order/ParcelMeasurements.php index 645812c359a..97c296d05cb 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelMeasurements.php +++ b/lib/commercetools-api/src/Models/Order/ParcelMeasurements.php @@ -19,24 +19,32 @@ interface ParcelMeasurements extends JsonObject public const FIELD_WEIGHT_IN_GRAM = 'weightInGram'; /** + *

Height of the Parcel.

+ * * @return null|int */ public function getHeightInMillimeter(); /** + *

Length of the Parcel.

+ * * @return null|int */ public function getLengthInMillimeter(); /** + *

Width of the Parcel.

+ * * @return null|int */ public function getWidthInMillimeter(); /** + *

Weight of the Parcel.

+ * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Order/ParcelMeasurementsBuilder.php b/lib/commercetools-api/src/Models/Order/ParcelMeasurementsBuilder.php index e0bdb540129..64e8ce0bc9a 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelMeasurementsBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ParcelMeasurementsBuilder.php @@ -45,6 +45,8 @@ final class ParcelMeasurementsBuilder implements Builder private $weightInGram; /** + *

Height of the Parcel.

+ * * @return null|int */ @@ -54,6 +56,8 @@ public function getHeightInMillimeter() } /** + *

Length of the Parcel.

+ * * @return null|int */ @@ -63,6 +67,8 @@ public function getLengthInMillimeter() } /** + *

Width of the Parcel.

+ * * @return null|int */ @@ -72,6 +78,8 @@ public function getWidthInMillimeter() } /** + *

Weight of the Parcel.

+ * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Order/ParcelMeasurementsModel.php b/lib/commercetools-api/src/Models/Order/ParcelMeasurementsModel.php index 788e7b9cf61..402f6ca8455 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelMeasurementsModel.php +++ b/lib/commercetools-api/src/Models/Order/ParcelMeasurementsModel.php @@ -60,6 +60,8 @@ public function __construct( } /** + *

Height of the Parcel.

+ * * * @return null|int */ @@ -78,6 +80,8 @@ public function getHeightInMillimeter() } /** + *

Length of the Parcel.

+ * * * @return null|int */ @@ -96,6 +100,8 @@ public function getLengthInMillimeter() } /** + *

Width of the Parcel.

+ * * * @return null|int */ @@ -114,6 +120,8 @@ public function getWidthInMillimeter() } /** + *

Weight of the Parcel.

+ * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/Order/ParcelModel.php b/lib/commercetools-api/src/Models/Order/ParcelModel.php index 0e2d3d5fba6..0c8692c5e50 100644 --- a/lib/commercetools-api/src/Models/Order/ParcelModel.php +++ b/lib/commercetools-api/src/Models/Order/ParcelModel.php @@ -127,6 +127,8 @@ public function getKey() } /** + *

Date and time (UTC) the Parcel was created.

+ * * * @return null|DateTimeImmutable */ @@ -149,6 +151,8 @@ public function getCreatedAt() } /** + *

Information about the dimensions of the Parcel.

+ * * * @return null|ParcelMeasurements */ @@ -168,6 +172,8 @@ public function getMeasurements() } /** + *

Shipment tracking information of the Parcel.

+ * * * @return null|TrackingData */ @@ -187,7 +193,7 @@ public function getTrackingData() } /** - *

The delivery items contained in this parcel.

+ *

Line Items or Custom Line Items delivered in this Parcel.

* * * @return null|DeliveryItemCollection @@ -207,7 +213,7 @@ public function getItems() } /** - *

Custom Fields of this parcel.

+ *

Custom Fields of the Parcel.

* * * @return null|CustomFields diff --git a/lib/commercetools-api/src/Models/Order/PaymentInfo.php b/lib/commercetools-api/src/Models/Order/PaymentInfo.php index b5200167659..d274af7305e 100644 --- a/lib/commercetools-api/src/Models/Order/PaymentInfo.php +++ b/lib/commercetools-api/src/Models/Order/PaymentInfo.php @@ -17,6 +17,8 @@ interface PaymentInfo extends JsonObject public const FIELD_PAYMENTS = 'payments'; /** + *

References to the Payments associated with the Order.

+ * * @return null|PaymentReferenceCollection */ diff --git a/lib/commercetools-api/src/Models/Order/PaymentInfoBuilder.php b/lib/commercetools-api/src/Models/Order/PaymentInfoBuilder.php index 0a64ff2d977..b5fd92c1d5c 100644 --- a/lib/commercetools-api/src/Models/Order/PaymentInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Order/PaymentInfoBuilder.php @@ -28,6 +28,8 @@ final class PaymentInfoBuilder implements Builder private $payments; /** + *

References to the Payments associated with the Order.

+ * * @return null|PaymentReferenceCollection */ diff --git a/lib/commercetools-api/src/Models/Order/PaymentInfoModel.php b/lib/commercetools-api/src/Models/Order/PaymentInfoModel.php index 36d5cf7e31d..edfbb3c9859 100644 --- a/lib/commercetools-api/src/Models/Order/PaymentInfoModel.php +++ b/lib/commercetools-api/src/Models/Order/PaymentInfoModel.php @@ -37,6 +37,8 @@ public function __construct( } /** + *

References to the Payments associated with the Order.

+ * * * @return null|PaymentReferenceCollection */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfo.php b/lib/commercetools-api/src/Models/Order/ReturnInfo.php index 3dc3ecc085e..97973842dc2 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfo.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfo.php @@ -19,13 +19,15 @@ interface ReturnInfo extends JsonObject public const FIELD_RETURN_DATE = 'returnDate'; /** + *

Information on the Line Items or Custom Line Items returned.

+ * * @return null|ReturnItemCollection */ public function getItems(); /** - *

Identifies, which return tracking ID is connected to this particular return.

+ *

User-defined identifier to track the return.

* * @return null|string @@ -33,6 +35,8 @@ public function getItems(); public function getReturnTrackingId(); /** + *

Date and time (UTC) the return is initiated.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfoBuilder.php b/lib/commercetools-api/src/Models/Order/ReturnInfoBuilder.php index 0ecb814a293..dd4d8296785 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfoBuilder.php @@ -40,6 +40,8 @@ final class ReturnInfoBuilder implements Builder private $returnDate; /** + *

Information on the Line Items or Custom Line Items returned.

+ * * @return null|ReturnItemCollection */ @@ -49,7 +51,7 @@ public function getItems() } /** - *

Identifies, which return tracking ID is connected to this particular return.

+ *

User-defined identifier to track the return.

* * @return null|string @@ -60,6 +62,8 @@ public function getReturnTrackingId() } /** + *

Date and time (UTC) the return is initiated.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfoDraft.php b/lib/commercetools-api/src/Models/Order/ReturnInfoDraft.php index ceff35c3023..dae0b84958d 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfoDraft.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfoDraft.php @@ -19,13 +19,15 @@ interface ReturnInfoDraft extends JsonObject public const FIELD_RETURN_DATE = 'returnDate'; /** + *

Information on the Line Items or Custom Line Items returned.

+ * * @return null|ReturnItemDraftCollection */ public function getItems(); /** - *

Identifies, which return tracking ID is connected to this particular return.

+ *

User-defined identifier for tracking the return.

* * @return null|string @@ -33,6 +35,8 @@ public function getItems(); public function getReturnTrackingId(); /** + *

Date and time (UTC) the return is initiated.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfoDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ReturnInfoDraftBuilder.php index 5d906d2c85a..b079a796017 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfoDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfoDraftBuilder.php @@ -40,6 +40,8 @@ final class ReturnInfoDraftBuilder implements Builder private $returnDate; /** + *

Information on the Line Items or Custom Line Items returned.

+ * * @return null|ReturnItemDraftCollection */ @@ -49,7 +51,7 @@ public function getItems() } /** - *

Identifies, which return tracking ID is connected to this particular return.

+ *

User-defined identifier for tracking the return.

* * @return null|string @@ -60,6 +62,8 @@ public function getReturnTrackingId() } /** + *

Date and time (UTC) the return is initiated.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfoDraftModel.php b/lib/commercetools-api/src/Models/Order/ReturnInfoDraftModel.php index 3f008b18b2c..3f3baa64a8f 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfoDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfoDraftModel.php @@ -53,6 +53,8 @@ public function __construct( } /** + *

Information on the Line Items or Custom Line Items returned.

+ * * * @return null|ReturnItemDraftCollection */ @@ -71,7 +73,7 @@ public function getItems() } /** - *

Identifies, which return tracking ID is connected to this particular return.

+ *

User-defined identifier for tracking the return.

* * * @return null|string @@ -91,6 +93,8 @@ public function getReturnTrackingId() } /** + *

Date and time (UTC) the return is initiated.

+ * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnInfoModel.php b/lib/commercetools-api/src/Models/Order/ReturnInfoModel.php index f434964ffb3..61b306c4437 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnInfoModel.php +++ b/lib/commercetools-api/src/Models/Order/ReturnInfoModel.php @@ -53,6 +53,8 @@ public function __construct( } /** + *

Information on the Line Items or Custom Line Items returned.

+ * * * @return null|ReturnItemCollection */ @@ -71,7 +73,7 @@ public function getItems() } /** - *

Identifies, which return tracking ID is connected to this particular return.

+ *

User-defined identifier to track the return.

* * * @return null|string @@ -91,6 +93,8 @@ public function getReturnTrackingId() } /** + *

Date and time (UTC) the return is initiated.

+ * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnItem.php b/lib/commercetools-api/src/Models/Order/ReturnItem.php index 00684a3cb58..50dbb7afe51 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItem.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItem.php @@ -27,7 +27,7 @@ interface ReturnItem extends JsonObject public const FIELD_CREATED_AT = 'createdAt'; /** - *

Unique identifier of the ReturnItem.

+ *

Unique identifier of the Return Item.

* * @return null|string @@ -35,6 +35,8 @@ interface ReturnItem extends JsonObject public function getId(); /** + *

Number of Line Items or Custom Line Items returned.

+ * * @return null|int */ @@ -47,25 +49,35 @@ public function getQuantity(); public function getType(); /** + *

User-defined description for the return.

+ * * @return null|string */ public function getComment(); /** + *

Shipment status of the Return Item.

+ * * @return null|string */ public function getShipmentState(); /** + *

Payment status of the Return Item:

+ * + * * @return null|string */ public function getPaymentState(); /** - *

Custom Fields of this return item.

+ *

Custom Fields of the Return Item.

* * @return null|CustomFields @@ -73,12 +85,16 @@ public function getPaymentState(); public function getCustom(); /** + *

Date and time (UTC) the Return Item was last updated.

+ * * @return null|DateTimeImmutable */ public function getLastModifiedAt(); /** + *

Date and time (UTC) the Return Item was intitially created.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php b/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php index bc7402cf533..7c62da26167 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php @@ -72,7 +72,7 @@ final class ReturnItemBuilder implements Builder private $createdAt; /** - *

Unique identifier of the ReturnItem.

+ *

Unique identifier of the Return Item.

* * @return null|string @@ -83,6 +83,8 @@ public function getId() } /** + *

Number of Line Items or Custom Line Items returned.

+ * * @return null|int */ @@ -92,6 +94,8 @@ public function getQuantity() } /** + *

User-defined description for the return.

+ * * @return null|string */ @@ -101,6 +105,8 @@ public function getComment() } /** + *

Shipment status of the Return Item.

+ * * @return null|string */ @@ -110,6 +116,12 @@ public function getShipmentState() } /** + *

Payment status of the Return Item:

+ * + * * @return null|string */ @@ -119,7 +131,7 @@ public function getPaymentState() } /** - *

Custom Fields of this return item.

+ *

Custom Fields of the Return Item.

* * @return null|CustomFields @@ -130,6 +142,8 @@ public function getCustom() } /** + *

Date and time (UTC) the Return Item was last updated.

+ * * @return null|DateTimeImmutable */ @@ -139,6 +153,8 @@ public function getLastModifiedAt() } /** + *

Date and time (UTC) the Return Item was intitially created.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php b/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php index dbd12bd831d..ddb55011e6c 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php @@ -22,37 +22,50 @@ interface ReturnItemDraft extends JsonObject public const FIELD_CUSTOM = 'custom'; /** + *

Number of Line Items or Custom Line Items to return.

+ * * @return null|int */ public function getQuantity(); /** + *

id of the LineItem to return.

+ *

Required if Line Items are returned, to create a LineItemReturnItem.

+ * * @return null|string */ public function getLineItemId(); /** + *

id of the CustomLineItem to return.

+ *

Required if Custom Line Items are returned, to create a CustomLineItemReturnItem.

+ * * @return null|string */ public function getCustomLineItemId(); /** + *

User-defined description for the return.

+ * * @return null|string */ public function getComment(); /** + *

Shipment status of the item to be returned. + * Can either be Advised or Returned only.

+ * * @return null|string */ public function getShipmentState(); /** - *

Custom Fields of this return item.

+ *

Custom Fields for the Return Item.

* * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php index 244f66b24aa..016ab8d501f 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php @@ -59,6 +59,8 @@ final class ReturnItemDraftBuilder implements Builder private $custom; /** + *

Number of Line Items or Custom Line Items to return.

+ * * @return null|int */ @@ -68,6 +70,9 @@ public function getQuantity() } /** + *

id of the LineItem to return.

+ *

Required if Line Items are returned, to create a LineItemReturnItem.

+ * * @return null|string */ @@ -77,6 +82,9 @@ public function getLineItemId() } /** + *

id of the CustomLineItem to return.

+ *

Required if Custom Line Items are returned, to create a CustomLineItemReturnItem.

+ * * @return null|string */ @@ -86,6 +94,8 @@ public function getCustomLineItemId() } /** + *

User-defined description for the return.

+ * * @return null|string */ @@ -95,6 +105,9 @@ public function getComment() } /** + *

Shipment status of the item to be returned. + * Can either be Advised or Returned only.

+ * * @return null|string */ @@ -104,7 +117,7 @@ public function getShipmentState() } /** - *

Custom Fields of this return item.

+ *

Custom Fields for the Return Item.

* * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php b/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php index 999e70daf39..ec67b8662b1 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php @@ -78,6 +78,8 @@ public function __construct( } /** + *

Number of Line Items or Custom Line Items to return.

+ * * * @return null|int */ @@ -96,6 +98,9 @@ public function getQuantity() } /** + *

id of the LineItem to return.

+ *

Required if Line Items are returned, to create a LineItemReturnItem.

+ * * * @return null|string */ @@ -114,6 +119,9 @@ public function getLineItemId() } /** + *

id of the CustomLineItem to return.

+ *

Required if Custom Line Items are returned, to create a CustomLineItemReturnItem.

+ * * * @return null|string */ @@ -132,6 +140,8 @@ public function getCustomLineItemId() } /** + *

User-defined description for the return.

+ * * * @return null|string */ @@ -150,6 +160,9 @@ public function getComment() } /** + *

Shipment status of the item to be returned. + * Can either be Advised or Returned only.

+ * * * @return null|string */ @@ -168,7 +181,7 @@ public function getShipmentState() } /** - *

Custom Fields of this return item.

+ *

Custom Fields for the Return Item.

* * * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemModel.php b/lib/commercetools-api/src/Models/Order/ReturnItemModel.php index 4c33ed246c5..96906c99c1a 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemModel.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemModel.php @@ -112,7 +112,7 @@ public function __construct( } /** - *

Unique identifier of the ReturnItem.

+ *

Unique identifier of the Return Item.

* * * @return null|string @@ -132,6 +132,8 @@ public function getId() } /** + *

Number of Line Items or Custom Line Items returned.

+ * * * @return null|int */ @@ -168,6 +170,8 @@ public function getType() } /** + *

User-defined description for the return.

+ * * * @return null|string */ @@ -186,6 +190,8 @@ public function getComment() } /** + *

Shipment status of the Return Item.

+ * * * @return null|string */ @@ -204,6 +210,12 @@ public function getShipmentState() } /** + *

Payment status of the Return Item:

+ * + * * * @return null|string */ @@ -222,7 +234,7 @@ public function getPaymentState() } /** - *

Custom Fields of this return item.

+ *

Custom Fields of the Return Item.

* * * @return null|CustomFields @@ -243,6 +255,8 @@ public function getCustom() } /** + *

Date and time (UTC) the Return Item was last updated.

+ * * * @return null|DateTimeImmutable */ @@ -265,6 +279,8 @@ public function getLastModifiedAt() } /** + *

Date and time (UTC) the Return Item was intitially created.

+ * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/StagedOrderUpdateAction.php b/lib/commercetools-api/src/Models/Order/StagedOrderUpdateAction.php index 585baa0a746..d32257ef723 100644 --- a/lib/commercetools-api/src/Models/Order/StagedOrderUpdateAction.php +++ b/lib/commercetools-api/src/Models/Order/StagedOrderUpdateAction.php @@ -56,6 +56,7 @@ use Commercetools\Api\Models\OrderEdit\StagedOrderSetDeliveryCustomFieldAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetDeliveryCustomTypeAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetDeliveryItemsAction; +use Commercetools\Api\Models\OrderEdit\StagedOrderSetDirectDiscountsAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetItemShippingAddressCustomFieldAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetItemShippingAddressCustomTypeAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetLineItemCustomFieldAction; @@ -89,6 +90,7 @@ use Commercetools\Api\Models\OrderEdit\StagedOrderSetShippingMethodTaxAmountAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetShippingMethodTaxRateAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetShippingRateInputAction; +use Commercetools\Api\Models\OrderEdit\StagedOrderSetStoreAction; use Commercetools\Api\Models\OrderEdit\StagedOrderTransitionCustomLineItemStateAction; use Commercetools\Api\Models\OrderEdit\StagedOrderTransitionLineItemStateAction; use Commercetools\Api\Models\OrderEdit\StagedOrderTransitionStateAction; diff --git a/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionBuilder.php b/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionBuilder.php index 9776a9f528b..f3c6ceac1c1 100644 --- a/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionBuilder.php @@ -104,6 +104,8 @@ use Commercetools\Api\Models\OrderEdit\StagedOrderSetDeliveryCustomTypeActionBuilder; use Commercetools\Api\Models\OrderEdit\StagedOrderSetDeliveryItemsAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetDeliveryItemsActionBuilder; +use Commercetools\Api\Models\OrderEdit\StagedOrderSetDirectDiscountsAction; +use Commercetools\Api\Models\OrderEdit\StagedOrderSetDirectDiscountsActionBuilder; use Commercetools\Api\Models\OrderEdit\StagedOrderSetItemShippingAddressCustomFieldAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetItemShippingAddressCustomFieldActionBuilder; use Commercetools\Api\Models\OrderEdit\StagedOrderSetItemShippingAddressCustomTypeAction; @@ -170,6 +172,8 @@ use Commercetools\Api\Models\OrderEdit\StagedOrderSetShippingMethodTaxRateActionBuilder; use Commercetools\Api\Models\OrderEdit\StagedOrderSetShippingRateInputAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetShippingRateInputActionBuilder; +use Commercetools\Api\Models\OrderEdit\StagedOrderSetStoreAction; +use Commercetools\Api\Models\OrderEdit\StagedOrderSetStoreActionBuilder; use Commercetools\Api\Models\OrderEdit\StagedOrderTransitionCustomLineItemStateAction; use Commercetools\Api\Models\OrderEdit\StagedOrderTransitionCustomLineItemStateActionBuilder; use Commercetools\Api\Models\OrderEdit\StagedOrderTransitionLineItemStateAction; diff --git a/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionModel.php b/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionModel.php index 0e5ba6046f6..b7dd91dc37e 100644 --- a/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/StagedOrderUpdateActionModel.php @@ -104,6 +104,8 @@ use Commercetools\Api\Models\OrderEdit\StagedOrderSetDeliveryCustomTypeActionModel; use Commercetools\Api\Models\OrderEdit\StagedOrderSetDeliveryItemsAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetDeliveryItemsActionModel; +use Commercetools\Api\Models\OrderEdit\StagedOrderSetDirectDiscountsAction; +use Commercetools\Api\Models\OrderEdit\StagedOrderSetDirectDiscountsActionModel; use Commercetools\Api\Models\OrderEdit\StagedOrderSetItemShippingAddressCustomFieldAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetItemShippingAddressCustomFieldActionModel; use Commercetools\Api\Models\OrderEdit\StagedOrderSetItemShippingAddressCustomTypeAction; @@ -170,6 +172,8 @@ use Commercetools\Api\Models\OrderEdit\StagedOrderSetShippingMethodTaxRateActionModel; use Commercetools\Api\Models\OrderEdit\StagedOrderSetShippingRateInputAction; use Commercetools\Api\Models\OrderEdit\StagedOrderSetShippingRateInputActionModel; +use Commercetools\Api\Models\OrderEdit\StagedOrderSetStoreAction; +use Commercetools\Api\Models\OrderEdit\StagedOrderSetStoreActionModel; use Commercetools\Api\Models\OrderEdit\StagedOrderTransitionCustomLineItemStateAction; use Commercetools\Api\Models\OrderEdit\StagedOrderTransitionCustomLineItemStateActionModel; use Commercetools\Api\Models\OrderEdit\StagedOrderTransitionLineItemStateAction; @@ -251,6 +255,7 @@ final class StagedOrderUpdateActionModel extends JsonObjectModel implements Stag 'setDeliveryCustomField' => StagedOrderSetDeliveryCustomFieldActionModel::class, 'setDeliveryCustomType' => StagedOrderSetDeliveryCustomTypeActionModel::class, 'setDeliveryItems' => StagedOrderSetDeliveryItemsActionModel::class, + 'setDirectDiscounts' => StagedOrderSetDirectDiscountsActionModel::class, 'setItemShippingAddressCustomField' => StagedOrderSetItemShippingAddressCustomFieldActionModel::class, 'setItemShippingAddressCustomType' => StagedOrderSetItemShippingAddressCustomTypeActionModel::class, 'setLineItemCustomField' => StagedOrderSetLineItemCustomFieldActionModel::class, @@ -284,6 +289,7 @@ final class StagedOrderUpdateActionModel extends JsonObjectModel implements Stag 'setShippingMethodTaxAmount' => StagedOrderSetShippingMethodTaxAmountActionModel::class, 'setShippingMethodTaxRate' => StagedOrderSetShippingMethodTaxRateActionModel::class, 'setShippingRateInput' => StagedOrderSetShippingRateInputActionModel::class, + 'setStore' => StagedOrderSetStoreActionModel::class, 'transitionCustomLineItemState' => StagedOrderTransitionCustomLineItemStateActionModel::class, 'transitionLineItemState' => StagedOrderTransitionLineItemStateActionModel::class, 'transitionState' => StagedOrderTransitionStateActionModel::class, diff --git a/lib/commercetools-api/src/Models/Order/SyncInfo.php b/lib/commercetools-api/src/Models/Order/SyncInfo.php index 1dbf7ba85b4..5bc7d38c8e9 100644 --- a/lib/commercetools-api/src/Models/Order/SyncInfo.php +++ b/lib/commercetools-api/src/Models/Order/SyncInfo.php @@ -20,7 +20,7 @@ interface SyncInfo extends JsonObject public const FIELD_SYNCED_AT = 'syncedAt'; /** - *

Connection to a particular synchronization destination.

+ *

Connection to a synchronization destination.

* * @return null|ChannelReference @@ -28,7 +28,7 @@ interface SyncInfo extends JsonObject public function getChannel(); /** - *

Can be used to reference an external order instance, file etc.

+ *

Identifier of an external order instance, file, or other resource.

* * @return null|string @@ -36,6 +36,8 @@ public function getChannel(); public function getExternalId(); /** + *

Date and time (UTC) the information was synced.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/SyncInfoBuilder.php b/lib/commercetools-api/src/Models/Order/SyncInfoBuilder.php index dc0bf11ea3b..8832e5db8c2 100644 --- a/lib/commercetools-api/src/Models/Order/SyncInfoBuilder.php +++ b/lib/commercetools-api/src/Models/Order/SyncInfoBuilder.php @@ -42,7 +42,7 @@ final class SyncInfoBuilder implements Builder private $syncedAt; /** - *

Connection to a particular synchronization destination.

+ *

Connection to a synchronization destination.

* * @return null|ChannelReference @@ -53,7 +53,7 @@ public function getChannel() } /** - *

Can be used to reference an external order instance, file etc.

+ *

Identifier of an external order instance, file, or other resource.

* * @return null|string @@ -64,6 +64,8 @@ public function getExternalId() } /** + *

Date and time (UTC) the information was synced.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/SyncInfoModel.php b/lib/commercetools-api/src/Models/Order/SyncInfoModel.php index db518a30e94..cdbcc02688d 100644 --- a/lib/commercetools-api/src/Models/Order/SyncInfoModel.php +++ b/lib/commercetools-api/src/Models/Order/SyncInfoModel.php @@ -55,7 +55,7 @@ public function __construct( } /** - *

Connection to a particular synchronization destination.

+ *

Connection to a synchronization destination.

* * * @return null|ChannelReference @@ -76,7 +76,7 @@ public function getChannel() } /** - *

Can be used to reference an external order instance, file etc.

+ *

Identifier of an external order instance, file, or other resource.

* * * @return null|string @@ -96,6 +96,8 @@ public function getExternalId() } /** + *

Date and time (UTC) the information was synced.

+ * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/Order/TrackingData.php b/lib/commercetools-api/src/Models/Order/TrackingData.php index 6951988a7fa..7f1ff0a2c00 100644 --- a/lib/commercetools-api/src/Models/Order/TrackingData.php +++ b/lib/commercetools-api/src/Models/Order/TrackingData.php @@ -20,7 +20,7 @@ interface TrackingData extends JsonObject public const FIELD_IS_RETURN = 'isReturn'; /** - *

The ID to track one parcel.

+ *

Identifier to track the Parcel.

* * @return null|string @@ -28,7 +28,7 @@ interface TrackingData extends JsonObject public function getTrackingId(); /** - *

The carrier that delivers the parcel.

+ *

Name of the carrier that delivers the Parcel.

* * @return null|string @@ -36,19 +36,26 @@ public function getTrackingId(); public function getCarrier(); /** + *

Name of the provider that serves as facade to several carriers.

+ * * @return null|string */ public function getProvider(); /** + *

Transaction identifier with the provider.

+ * * @return null|string */ public function getProviderTransaction(); /** - *

Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

+ *
    + *
  • If true, the Parcel is being returned.
  • + *
  • If false, the Parcel is being delivered to the customer.
  • + *
* * @return null|bool diff --git a/lib/commercetools-api/src/Models/Order/TrackingDataBuilder.php b/lib/commercetools-api/src/Models/Order/TrackingDataBuilder.php index 0a6c2258f57..4d59d9760a2 100644 --- a/lib/commercetools-api/src/Models/Order/TrackingDataBuilder.php +++ b/lib/commercetools-api/src/Models/Order/TrackingDataBuilder.php @@ -51,7 +51,7 @@ final class TrackingDataBuilder implements Builder private $isReturn; /** - *

The ID to track one parcel.

+ *

Identifier to track the Parcel.

* * @return null|string @@ -62,7 +62,7 @@ public function getTrackingId() } /** - *

The carrier that delivers the parcel.

+ *

Name of the carrier that delivers the Parcel.

* * @return null|string @@ -73,6 +73,8 @@ public function getCarrier() } /** + *

Name of the provider that serves as facade to several carriers.

+ * * @return null|string */ @@ -82,6 +84,8 @@ public function getProvider() } /** + *

Transaction identifier with the provider.

+ * * @return null|string */ @@ -91,7 +95,10 @@ public function getProviderTransaction() } /** - *

Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

+ *
    + *
  • If true, the Parcel is being returned.
  • + *
  • If false, the Parcel is being delivered to the customer.
  • + *
* * @return null|bool diff --git a/lib/commercetools-api/src/Models/Order/TrackingDataModel.php b/lib/commercetools-api/src/Models/Order/TrackingDataModel.php index 8c70e540492..2cbfca27617 100644 --- a/lib/commercetools-api/src/Models/Order/TrackingDataModel.php +++ b/lib/commercetools-api/src/Models/Order/TrackingDataModel.php @@ -68,7 +68,7 @@ public function __construct( } /** - *

The ID to track one parcel.

+ *

Identifier to track the Parcel.

* * * @return null|string @@ -88,7 +88,7 @@ public function getTrackingId() } /** - *

The carrier that delivers the parcel.

+ *

Name of the carrier that delivers the Parcel.

* * * @return null|string @@ -108,6 +108,8 @@ public function getCarrier() } /** + *

Name of the provider that serves as facade to several carriers.

+ * * * @return null|string */ @@ -126,6 +128,8 @@ public function getProvider() } /** + *

Transaction identifier with the provider.

+ * * * @return null|string */ @@ -144,7 +148,10 @@ public function getProviderTransaction() } /** - *

Flag to distinguish if the parcel is on the way to the customer (false) or on the way back (true).

+ *
    + *
  • If true, the Parcel is being returned.
  • + *
  • If false, the Parcel is being delivered to the customer.
  • + *
* * * @return null|bool diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEdit.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEdit.php index 9ff87e75bff..36ef5437f8b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEdit.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEdit.php @@ -20,17 +20,17 @@ interface OrderEdit extends BaseResource { - public const FIELD_LAST_MODIFIED_BY = 'lastModifiedBy'; - public const FIELD_CREATED_BY = 'createdBy'; public const FIELD_KEY = 'key'; public const FIELD_RESOURCE = 'resource'; public const FIELD_STAGED_ACTIONS = 'stagedActions'; - public const FIELD_CUSTOM = 'custom'; public const FIELD_RESULT = 'result'; public const FIELD_COMMENT = 'comment'; + public const FIELD_CUSTOM = 'custom'; + public const FIELD_LAST_MODIFIED_BY = 'lastModifiedBy'; + public const FIELD_CREATED_BY = 'createdBy'; /** - *

Unique identifier of the OrderEdit.

+ *

Unique identifier of the Order Edit.

* * @return null|string @@ -38,7 +38,7 @@ interface OrderEdit extends BaseResource public function getId(); /** - *

The current version of the OrderEdit.

+ *

Current version of the Order Edit.

* * @return null|int @@ -46,80 +46,85 @@ public function getId(); public function getVersion(); /** + *

User-defined unique identifier of the Order Edit.

+ * - * @return null|DateTimeImmutable + * @return null|string */ - public function getCreatedAt(); + public function getKey(); /** + *

Reference to the Order updated with this edit.

+ * - * @return null|DateTimeImmutable + * @return null|OrderReference */ - public function getLastModifiedAt(); + public function getResource(); /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

Update actions applied to the Order referenced by resource.

* - * @return null|LastModifiedBy + * @return null|StagedOrderUpdateActionCollection */ - public function getLastModifiedBy(); + public function getStagedActions(); /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

For applied edits, it's a summary of the changes on the Order. + * For unapplied edits, it's a preview of the changes.

* - * @return null|CreatedBy + * @return null|OrderEditResult */ - public function getCreatedBy(); + public function getResult(); /** - *

User-defined unique identifier of the OrderEdit.

+ *

User-defined information regarding the Order Edit.

* * @return null|string */ - public function getKey(); + public function getComment(); /** - *

The order to be updated with this edit.

+ *

Custom Fields of the Order Edit.

* - * @return null|OrderReference + * @return null|CustomFields */ - public function getResource(); + public function getCustom(); /** - *

The actions to apply to the Order. - * Cannot be updated after the edit has been applied.

+ *

Date and time (UTC) the Order Edit was initially created.

* - * @return null|StagedOrderUpdateActionCollection + * @return null|DateTimeImmutable */ - public function getStagedActions(); + public function getCreatedAt(); /** + *

Date and time (UTC) the Order Edit was last updated.

+ * - * @return null|CustomFields + * @return null|DateTimeImmutable */ - public function getCustom(); + public function getLastModifiedAt(); /** - *

Contains a preview of the changes in case of unapplied edit. - * For applied edits, it contains the summary of the changes.

+ *

Present on resources created after 1 February 2019 except for events not tracked.

* - * @return null|OrderEditResult + * @return null|LastModifiedBy */ - public function getResult(); + public function getLastModifiedBy(); /** - *

This field can be used to add textual information regarding the edit.

+ *

Present on resources created after 1 February 2019 except for events not tracked.

* - * @return null|string + * @return null|CreatedBy */ - public function getComment(); + public function getCreatedBy(); /** * @param ?string $id @@ -132,52 +137,52 @@ public function setId(?string $id): void; public function setVersion(?int $version): void; /** - * @param ?DateTimeImmutable $createdAt + * @param ?string $key */ - public function setCreatedAt(?DateTimeImmutable $createdAt): void; + public function setKey(?string $key): void; /** - * @param ?DateTimeImmutable $lastModifiedAt + * @param ?OrderReference $resource */ - public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void; + public function setResource(?OrderReference $resource): void; /** - * @param ?LastModifiedBy $lastModifiedBy + * @param ?StagedOrderUpdateActionCollection $stagedActions */ - public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void; + public function setStagedActions(?StagedOrderUpdateActionCollection $stagedActions): void; /** - * @param ?CreatedBy $createdBy + * @param ?OrderEditResult $result */ - public function setCreatedBy(?CreatedBy $createdBy): void; + public function setResult(?OrderEditResult $result): void; /** - * @param ?string $key + * @param ?string $comment */ - public function setKey(?string $key): void; + public function setComment(?string $comment): void; /** - * @param ?OrderReference $resource + * @param ?CustomFields $custom */ - public function setResource(?OrderReference $resource): void; + public function setCustom(?CustomFields $custom): void; /** - * @param ?StagedOrderUpdateActionCollection $stagedActions + * @param ?DateTimeImmutable $createdAt */ - public function setStagedActions(?StagedOrderUpdateActionCollection $stagedActions): void; + public function setCreatedAt(?DateTimeImmutable $createdAt): void; /** - * @param ?CustomFields $custom + * @param ?DateTimeImmutable $lastModifiedAt */ - public function setCustom(?CustomFields $custom): void; + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void; /** - * @param ?OrderEditResult $result + * @param ?LastModifiedBy $lastModifiedBy */ - public function setResult(?OrderEditResult $result): void; + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void; /** - * @param ?string $comment + * @param ?CreatedBy $createdBy */ - public function setComment(?string $comment): void; + public function setCreatedBy(?CreatedBy $createdBy): void; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionAction.php index abe8d426b8e..c8fe77bf0b5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionAction.php @@ -17,6 +17,8 @@ interface OrderEditAddStagedActionAction extends OrderEditUpdateAction public const FIELD_STAGED_ACTION = 'stagedAction'; /** + *

Order update action to append to the stagedActions array.

+ * * @return null|StagedOrderUpdateAction */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionBuilder.php index 2c32d93f4aa..395c1267a67 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionBuilder.php @@ -29,6 +29,8 @@ final class OrderEditAddStagedActionActionBuilder implements Builder private $stagedAction; /** + *

Order update action to append to the stagedActions array.

+ * * @return null|StagedOrderUpdateAction */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionModel.php index 2a39f112769..807abea2a5f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAddStagedActionActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

Order update action to append to the stagedActions array.

+ * * * @return null|StagedOrderUpdateAction */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplied.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplied.php index 24db5efdf24..69aff0a67cf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplied.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplied.php @@ -19,18 +19,32 @@ interface OrderEditApplied extends OrderEditResult public const FIELD_EXCERPT_AFTER_EDIT = 'excerptAfterEdit'; /** + *

This field is queryable.

+ * + + * @return null|string + */ + public function getType(); + + /** + *

Date and time (UTC) the Order was edited.

+ * * @return null|DateTimeImmutable */ public function getAppliedAt(); /** + *

Prices of the Order before the edit.

+ * * @return null|OrderExcerpt */ public function getExcerptBeforeEdit(); /** + *

Prices of the Order after the edit.

+ * * @return null|OrderExcerpt */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedBuilder.php index af985542489..c5015a9c6bd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedBuilder.php @@ -40,6 +40,8 @@ final class OrderEditAppliedBuilder implements Builder private $excerptAfterEdit; /** + *

Date and time (UTC) the Order was edited.

+ * * @return null|DateTimeImmutable */ @@ -49,6 +51,8 @@ public function getAppliedAt() } /** + *

Prices of the Order before the edit.

+ * * @return null|OrderExcerpt */ @@ -58,6 +62,8 @@ public function getExcerptBeforeEdit() } /** + *

Prices of the Order after the edit.

+ * * @return null|OrderExcerpt */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedModel.php index aa0564c121f..618c4d3a91d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditAppliedModel.php @@ -62,6 +62,8 @@ public function __construct( } /** + *

This field is queryable.

+ * * * @return null|string */ @@ -80,6 +82,8 @@ public function getType() } /** + *

Date and time (UTC) the Order was edited.

+ * * * @return null|DateTimeImmutable */ @@ -102,6 +106,8 @@ public function getAppliedAt() } /** + *

Prices of the Order before the edit.

+ * * * @return null|OrderExcerpt */ @@ -121,6 +127,8 @@ public function getExcerptBeforeEdit() } /** + *

Prices of the Order after the edit.

+ * * * @return null|OrderExcerpt */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApply.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApply.php index b926f385c87..a336c04a038 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApply.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApply.php @@ -17,12 +17,16 @@ interface OrderEditApply extends JsonObject public const FIELD_RESOURCE_VERSION = 'resourceVersion'; /** + *

Current version of the OrderEdit to be applied.

+ * * @return null|int */ public function getEditVersion(); /** + *

Current version of the Order to which the OrderEdit is applied.

+ * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyBuilder.php index cce3cb6a320..460c75b9617 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyBuilder.php @@ -33,6 +33,8 @@ final class OrderEditApplyBuilder implements Builder private $resourceVersion; /** + *

Current version of the OrderEdit to be applied.

+ * * @return null|int */ @@ -42,6 +44,8 @@ public function getEditVersion() } /** + *

Current version of the Order to which the OrderEdit is applied.

+ * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyModel.php index 3365fc9fcd0..7c15418f28b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditApplyModel.php @@ -44,6 +44,8 @@ public function __construct( } /** + *

Current version of the OrderEdit to be applied.

+ * * * @return null|int */ @@ -62,6 +64,8 @@ public function getEditVersion() } /** + *

Current version of the Order to which the OrderEdit is applied.

+ * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditBuilder.php index 5f3a0aa7021..bca6ea4a4b4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditBuilder.php @@ -58,33 +58,33 @@ final class OrderEditBuilder implements Builder /** - * @var null|LastModifiedBy|LastModifiedByBuilder + * @var ?string */ - private $lastModifiedBy; + private $key; /** - * @var null|CreatedBy|CreatedByBuilder + * @var null|OrderReference|OrderReferenceBuilder */ - private $createdBy; + private $resource; /** - * @var ?string + * @var ?StagedOrderUpdateActionCollection */ - private $key; + private $stagedActions; /** - * @var null|OrderReference|OrderReferenceBuilder + * @var null|OrderEditResult|OrderEditResultBuilder */ - private $resource; + private $result; /** - * @var ?StagedOrderUpdateActionCollection + * @var ?string */ - private $stagedActions; + private $comment; /** @@ -94,18 +94,18 @@ final class OrderEditBuilder implements Builder /** - * @var null|OrderEditResult|OrderEditResultBuilder + * @var null|LastModifiedBy|LastModifiedByBuilder */ - private $result; + private $lastModifiedBy; /** - * @var ?string + * @var null|CreatedBy|CreatedByBuilder */ - private $comment; + private $createdBy; /** - *

Unique identifier of the OrderEdit.

+ *

Unique identifier of the Order Edit.

* * @return null|string @@ -116,7 +116,7 @@ public function getId() } /** - *

The current version of the OrderEdit.

+ *

Current version of the Order Edit.

* * @return null|int @@ -127,6 +127,8 @@ public function getVersion() } /** + *

Date and time (UTC) the Order Edit was initially created.

+ * * @return null|DateTimeImmutable */ @@ -136,6 +138,8 @@ public function getCreatedAt() } /** + *

Date and time (UTC) the Order Edit was last updated.

+ * * @return null|DateTimeImmutable */ @@ -145,62 +149,64 @@ public function getLastModifiedAt() } /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

User-defined unique identifier of the Order Edit.

* - * @return null|LastModifiedBy + * @return null|string */ - public function getLastModifiedBy() + public function getKey() { - return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + return $this->key; } /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

Reference to the Order updated with this edit.

* - * @return null|CreatedBy + * @return null|OrderReference */ - public function getCreatedBy() + public function getResource() { - return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + return $this->resource instanceof OrderReferenceBuilder ? $this->resource->build() : $this->resource; } /** - *

User-defined unique identifier of the OrderEdit.

+ *

Update actions applied to the Order referenced by resource.

* - * @return null|string + * @return null|StagedOrderUpdateActionCollection */ - public function getKey() + public function getStagedActions() { - return $this->key; + return $this->stagedActions; } /** - *

The order to be updated with this edit.

+ *

For applied edits, it's a summary of the changes on the Order. + * For unapplied edits, it's a preview of the changes.

* - * @return null|OrderReference + * @return null|OrderEditResult */ - public function getResource() + public function getResult() { - return $this->resource instanceof OrderReferenceBuilder ? $this->resource->build() : $this->resource; + return $this->result instanceof OrderEditResultBuilder ? $this->result->build() : $this->result; } /** - *

The actions to apply to the Order. - * Cannot be updated after the edit has been applied.

+ *

User-defined information regarding the Order Edit.

* - * @return null|StagedOrderUpdateActionCollection + * @return null|string */ - public function getStagedActions() + public function getComment() { - return $this->stagedActions; + return $this->comment; } /** + *

Custom Fields of the Order Edit.

+ * * @return null|CustomFields */ @@ -210,26 +216,25 @@ public function getCustom() } /** - *

Contains a preview of the changes in case of unapplied edit. - * For applied edits, it contains the summary of the changes.

+ *

Present on resources created after 1 February 2019 except for events not tracked.

* - * @return null|OrderEditResult + * @return null|LastModifiedBy */ - public function getResult() + public function getLastModifiedBy() { - return $this->result instanceof OrderEditResultBuilder ? $this->result->build() : $this->result; + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; } /** - *

This field can be used to add textual information regarding the edit.

+ *

Present on resources created after 1 February 2019 except for events not tracked.

* - * @return null|string + * @return null|CreatedBy */ - public function getComment() + public function getCreatedBy() { - return $this->comment; + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; } /** @@ -277,56 +282,56 @@ public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) } /** - * @param ?LastModifiedBy $lastModifiedBy + * @param ?string $key * @return $this */ - public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + public function withKey(?string $key) { - $this->lastModifiedBy = $lastModifiedBy; + $this->key = $key; return $this; } /** - * @param ?CreatedBy $createdBy + * @param ?OrderReference $resource * @return $this */ - public function withCreatedBy(?CreatedBy $createdBy) + public function withResource(?OrderReference $resource) { - $this->createdBy = $createdBy; + $this->resource = $resource; return $this; } /** - * @param ?string $key + * @param ?StagedOrderUpdateActionCollection $stagedActions * @return $this */ - public function withKey(?string $key) + public function withStagedActions(?StagedOrderUpdateActionCollection $stagedActions) { - $this->key = $key; + $this->stagedActions = $stagedActions; return $this; } /** - * @param ?OrderReference $resource + * @param ?OrderEditResult $result * @return $this */ - public function withResource(?OrderReference $resource) + public function withResult(?OrderEditResult $result) { - $this->resource = $resource; + $this->result = $result; return $this; } /** - * @param ?StagedOrderUpdateActionCollection $stagedActions + * @param ?string $comment * @return $this */ - public function withStagedActions(?StagedOrderUpdateActionCollection $stagedActions) + public function withComment(?string $comment) { - $this->stagedActions = $stagedActions; + $this->comment = $comment; return $this; } @@ -343,78 +348,78 @@ public function withCustom(?CustomFields $custom) } /** - * @param ?OrderEditResult $result + * @param ?LastModifiedBy $lastModifiedBy * @return $this */ - public function withResult(?OrderEditResult $result) + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) { - $this->result = $result; + $this->lastModifiedBy = $lastModifiedBy; return $this; } /** - * @param ?string $comment + * @param ?CreatedBy $createdBy * @return $this */ - public function withComment(?string $comment) + public function withCreatedBy(?CreatedBy $createdBy) { - $this->comment = $comment; + $this->createdBy = $createdBy; return $this; } /** - * @deprecated use withLastModifiedBy() instead + * @deprecated use withResource() instead * @return $this */ - public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + public function withResourceBuilder(?OrderReferenceBuilder $resource) { - $this->lastModifiedBy = $lastModifiedBy; + $this->resource = $resource; return $this; } /** - * @deprecated use withCreatedBy() instead + * @deprecated use withResult() instead * @return $this */ - public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + public function withResultBuilder(?OrderEditResultBuilder $result) { - $this->createdBy = $createdBy; + $this->result = $result; return $this; } /** - * @deprecated use withResource() instead + * @deprecated use withCustom() instead * @return $this */ - public function withResourceBuilder(?OrderReferenceBuilder $resource) + public function withCustomBuilder(?CustomFieldsBuilder $custom) { - $this->resource = $resource; + $this->custom = $custom; return $this; } /** - * @deprecated use withCustom() instead + * @deprecated use withLastModifiedBy() instead * @return $this */ - public function withCustomBuilder(?CustomFieldsBuilder $custom) + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) { - $this->custom = $custom; + $this->lastModifiedBy = $lastModifiedBy; return $this; } /** - * @deprecated use withResult() instead + * @deprecated use withCreatedBy() instead * @return $this */ - public function withResultBuilder(?OrderEditResultBuilder $result) + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) { - $this->result = $result; + $this->createdBy = $createdBy; return $this; } @@ -426,14 +431,14 @@ public function build(): OrderEdit $this->version, $this->createdAt, $this->lastModifiedAt, - $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, - $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, $this->key, $this->resource instanceof OrderReferenceBuilder ? $this->resource->build() : $this->resource, $this->stagedActions, - $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, $this->result instanceof OrderEditResultBuilder ? $this->result->build() : $this->result, - $this->comment + $this->comment, + $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraft.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraft.php index 910464f5daf..8ad3eb7dcf3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraft.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraft.php @@ -24,7 +24,7 @@ interface OrderEditDraft extends JsonObject public const FIELD_DRY_RUN = 'dryRun'; /** - *

User-defined unique identifier for the OrderEdit.

+ *

User-defined unique identifier for the Order Edit.

* * @return null|string @@ -32,7 +32,7 @@ interface OrderEditDraft extends JsonObject public function getKey(); /** - *

The order to be updated with this edit.

+ *

Reference to the Order updated with this edit.

* * @return null|OrderReference @@ -40,7 +40,8 @@ public function getKey(); public function getResource(); /** - *

The actions to apply to resource.

+ *

Update actions to apply to the Order referenced in resource. + * Cannot be updated if the edit has been applied.

* * @return null|StagedOrderUpdateActionCollection @@ -48,7 +49,7 @@ public function getResource(); public function getStagedActions(); /** - *

The custom fields.

+ *

Custom Fields for the Order Edit.

* * @return null|CustomFieldsDraft @@ -56,7 +57,7 @@ public function getStagedActions(); public function getCustom(); /** - *

This field can be used to add additional textual information regarding the edit.

+ *

User-defined description regarding the Order Edit.

* * @return null|string @@ -64,7 +65,9 @@ public function getCustom(); public function getComment(); /** - *

When set to true the edit is applied on the Order without persisting it.

+ *

Set to true if you want to peview the edited Order first without persisting it (dry run). + * A dry run allows checking for potential errors when trying to apply the stagedActions.

+ *

Order API Extensions, if any, are also called in dry runs.

* * @return null|bool diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftBuilder.php index fa5527706ee..327023715a8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftBuilder.php @@ -62,7 +62,7 @@ final class OrderEditDraftBuilder implements Builder private $dryRun; /** - *

User-defined unique identifier for the OrderEdit.

+ *

User-defined unique identifier for the Order Edit.

* * @return null|string @@ -73,7 +73,7 @@ public function getKey() } /** - *

The order to be updated with this edit.

+ *

Reference to the Order updated with this edit.

* * @return null|OrderReference @@ -84,7 +84,8 @@ public function getResource() } /** - *

The actions to apply to resource.

+ *

Update actions to apply to the Order referenced in resource. + * Cannot be updated if the edit has been applied.

* * @return null|StagedOrderUpdateActionCollection @@ -95,7 +96,7 @@ public function getStagedActions() } /** - *

The custom fields.

+ *

Custom Fields for the Order Edit.

* * @return null|CustomFieldsDraft @@ -106,7 +107,7 @@ public function getCustom() } /** - *

This field can be used to add additional textual information regarding the edit.

+ *

User-defined description regarding the Order Edit.

* * @return null|string @@ -117,7 +118,9 @@ public function getComment() } /** - *

When set to true the edit is applied on the Order without persisting it.

+ *

Set to true if you want to peview the edited Order first without persisting it (dry run). + * A dry run allows checking for potential errors when trying to apply the stagedActions.

+ *

Order API Extensions, if any, are also called in dry runs.

* * @return null|bool diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftModel.php index 322e3c0cbbf..3743209a70a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditDraftModel.php @@ -81,7 +81,7 @@ public function __construct( } /** - *

User-defined unique identifier for the OrderEdit.

+ *

User-defined unique identifier for the Order Edit.

* * * @return null|string @@ -101,7 +101,7 @@ public function getKey() } /** - *

The order to be updated with this edit.

+ *

Reference to the Order updated with this edit.

* * * @return null|OrderReference @@ -122,7 +122,8 @@ public function getResource() } /** - *

The actions to apply to resource.

+ *

Update actions to apply to the Order referenced in resource. + * Cannot be updated if the edit has been applied.

* * * @return null|StagedOrderUpdateActionCollection @@ -142,7 +143,7 @@ public function getStagedActions() } /** - *

The custom fields.

+ *

Custom Fields for the Order Edit.

* * * @return null|CustomFieldsDraft @@ -163,7 +164,7 @@ public function getCustom() } /** - *

This field can be used to add additional textual information regarding the edit.

+ *

User-defined description regarding the Order Edit.

* * * @return null|string @@ -183,7 +184,9 @@ public function getComment() } /** - *

When set to true the edit is applied on the Order without persisting it.

+ *

Set to true if you want to peview the edited Order first without persisting it (dry run). + * A dry run allows checking for potential errors when trying to apply the stagedActions.

+ *

Order API Extensions, if any, are also called in dry runs.

* * * @return null|bool diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php index d5d9eedbfb7..43087633ee2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditModel.php @@ -57,33 +57,33 @@ final class OrderEditModel extends JsonObjectModel implements OrderEdit /** * - * @var ?LastModifiedBy + * @var ?string */ - protected $lastModifiedBy; + protected $key; /** * - * @var ?CreatedBy + * @var ?OrderReference */ - protected $createdBy; + protected $resource; /** * - * @var ?string + * @var ?StagedOrderUpdateActionCollection */ - protected $key; + protected $stagedActions; /** * - * @var ?OrderReference + * @var ?OrderEditResult */ - protected $resource; + protected $result; /** * - * @var ?StagedOrderUpdateActionCollection + * @var ?string */ - protected $stagedActions; + protected $comment; /** * @@ -93,15 +93,15 @@ final class OrderEditModel extends JsonObjectModel implements OrderEdit /** * - * @var ?OrderEditResult + * @var ?LastModifiedBy */ - protected $result; + protected $lastModifiedBy; /** * - * @var ?string + * @var ?CreatedBy */ - protected $comment; + protected $createdBy; /** @@ -112,31 +112,31 @@ public function __construct( ?int $version = null, ?DateTimeImmutable $createdAt = null, ?DateTimeImmutable $lastModifiedAt = null, - ?LastModifiedBy $lastModifiedBy = null, - ?CreatedBy $createdBy = null, ?string $key = null, ?OrderReference $resource = null, ?StagedOrderUpdateActionCollection $stagedActions = null, - ?CustomFields $custom = null, ?OrderEditResult $result = null, - ?string $comment = null + ?string $comment = null, + ?CustomFields $custom = null, + ?LastModifiedBy $lastModifiedBy = null, + ?CreatedBy $createdBy = null ) { $this->id = $id; $this->version = $version; $this->createdAt = $createdAt; $this->lastModifiedAt = $lastModifiedAt; - $this->lastModifiedBy = $lastModifiedBy; - $this->createdBy = $createdBy; $this->key = $key; $this->resource = $resource; $this->stagedActions = $stagedActions; - $this->custom = $custom; $this->result = $result; $this->comment = $comment; + $this->custom = $custom; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; } /** - *

Unique identifier of the OrderEdit.

+ *

Unique identifier of the Order Edit.

* * * @return null|string @@ -156,7 +156,7 @@ public function getId() } /** - *

The current version of the OrderEdit.

+ *

Current version of the Order Edit.

* * * @return null|int @@ -176,6 +176,8 @@ public function getVersion() } /** + *

Date and time (UTC) the Order Edit was initially created.

+ * * * @return null|DateTimeImmutable */ @@ -198,6 +200,8 @@ public function getCreatedAt() } /** + *

Date and time (UTC) the Order Edit was last updated.

+ * * * @return null|DateTimeImmutable */ @@ -220,110 +224,111 @@ public function getLastModifiedAt() } /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

User-defined unique identifier of the Order Edit.

* * - * @return null|LastModifiedBy + * @return null|string */ - public function getLastModifiedBy() + public function getKey() { - if (is_null($this->lastModifiedBy)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); if (is_null($data)) { return null; } - - $this->lastModifiedBy = LastModifiedByModel::of($data); + $this->key = (string) $data; } - return $this->lastModifiedBy; + return $this->key; } /** - *

Present on resources created after 1 February 2019 except for events not tracked.

+ *

Reference to the Order updated with this edit.

* * - * @return null|CreatedBy + * @return null|OrderReference */ - public function getCreatedBy() + public function getResource() { - if (is_null($this->createdBy)) { + if (is_null($this->resource)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CREATED_BY); + $data = $this->raw(self::FIELD_RESOURCE); if (is_null($data)) { return null; } - $this->createdBy = CreatedByModel::of($data); + $this->resource = OrderReferenceModel::of($data); } - return $this->createdBy; + return $this->resource; } /** - *

User-defined unique identifier of the OrderEdit.

+ *

Update actions applied to the Order referenced by resource.

* * - * @return null|string + * @return null|StagedOrderUpdateActionCollection */ - public function getKey() + public function getStagedActions() { - if (is_null($this->key)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_KEY); + if (is_null($this->stagedActions)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STAGED_ACTIONS); if (is_null($data)) { return null; } - $this->key = (string) $data; + $this->stagedActions = StagedOrderUpdateActionCollection::fromArray($data); } - return $this->key; + return $this->stagedActions; } /** - *

The order to be updated with this edit.

+ *

For applied edits, it's a summary of the changes on the Order. + * For unapplied edits, it's a preview of the changes.

* * - * @return null|OrderReference + * @return null|OrderEditResult */ - public function getResource() + public function getResult() { - if (is_null($this->resource)) { + if (is_null($this->result)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_RESOURCE); + $data = $this->raw(self::FIELD_RESULT); if (is_null($data)) { return null; } - $this->resource = OrderReferenceModel::of($data); + $this->result = OrderEditResultModel::of($data); } - return $this->resource; + return $this->result; } /** - *

The actions to apply to the Order. - * Cannot be updated after the edit has been applied.

+ *

User-defined information regarding the Order Edit.

* * - * @return null|StagedOrderUpdateActionCollection + * @return null|string */ - public function getStagedActions() + public function getComment() { - if (is_null($this->stagedActions)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_STAGED_ACTIONS); + if (is_null($this->comment)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_COMMENT); if (is_null($data)) { return null; } - $this->stagedActions = StagedOrderUpdateActionCollection::fromArray($data); + $this->comment = (string) $data; } - return $this->stagedActions; + return $this->comment; } /** + *

Custom Fields of the Order Edit.

+ * * * @return null|CustomFields */ @@ -343,45 +348,45 @@ public function getCustom() } /** - *

Contains a preview of the changes in case of unapplied edit. - * For applied edits, it contains the summary of the changes.

+ *

Present on resources created after 1 February 2019 except for events not tracked.

* * - * @return null|OrderEditResult + * @return null|LastModifiedBy */ - public function getResult() + public function getLastModifiedBy() { - if (is_null($this->result)) { + if (is_null($this->lastModifiedBy)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_RESULT); + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); if (is_null($data)) { return null; } - $this->result = OrderEditResultModel::of($data); + $this->lastModifiedBy = LastModifiedByModel::of($data); } - return $this->result; + return $this->lastModifiedBy; } /** - *

This field can be used to add textual information regarding the edit.

+ *

Present on resources created after 1 February 2019 except for events not tracked.

* * - * @return null|string + * @return null|CreatedBy */ - public function getComment() + public function getCreatedBy() { - if (is_null($this->comment)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_COMMENT); + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); if (is_null($data)) { return null; } - $this->comment = (string) $data; + + $this->createdBy = CreatedByModel::of($data); } - return $this->comment; + return $this->createdBy; } @@ -418,43 +423,43 @@ public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void } /** - * @param ?LastModifiedBy $lastModifiedBy + * @param ?string $key */ - public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + public function setKey(?string $key): void { - $this->lastModifiedBy = $lastModifiedBy; + $this->key = $key; } /** - * @param ?CreatedBy $createdBy + * @param ?OrderReference $resource */ - public function setCreatedBy(?CreatedBy $createdBy): void + public function setResource(?OrderReference $resource): void { - $this->createdBy = $createdBy; + $this->resource = $resource; } /** - * @param ?string $key + * @param ?StagedOrderUpdateActionCollection $stagedActions */ - public function setKey(?string $key): void + public function setStagedActions(?StagedOrderUpdateActionCollection $stagedActions): void { - $this->key = $key; + $this->stagedActions = $stagedActions; } /** - * @param ?OrderReference $resource + * @param ?OrderEditResult $result */ - public function setResource(?OrderReference $resource): void + public function setResult(?OrderEditResult $result): void { - $this->resource = $resource; + $this->result = $result; } /** - * @param ?StagedOrderUpdateActionCollection $stagedActions + * @param ?string $comment */ - public function setStagedActions(?StagedOrderUpdateActionCollection $stagedActions): void + public function setComment(?string $comment): void { - $this->stagedActions = $stagedActions; + $this->comment = $comment; } /** @@ -466,19 +471,19 @@ public function setCustom(?CustomFields $custom): void } /** - * @param ?OrderEditResult $result + * @param ?LastModifiedBy $lastModifiedBy */ - public function setResult(?OrderEditResult $result): void + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void { - $this->result = $result; + $this->lastModifiedBy = $lastModifiedBy; } /** - * @param ?string $comment + * @param ?CreatedBy $createdBy */ - public function setComment(?string $comment): void + public function setCreatedBy(?CreatedBy $createdBy): void { - $this->comment = $comment; + $this->createdBy = $createdBy; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessed.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessed.php index af1cb140234..7d87710381f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessed.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessed.php @@ -13,4 +13,11 @@ interface OrderEditNotProcessed extends OrderEditResult { + /** + *

This field is queryable.

+ * + + * @return null|string + */ + public function getType(); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessedModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessedModel.php index 8de6b80c751..160cb17f3a8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessedModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditNotProcessedModel.php @@ -37,6 +37,8 @@ public function __construct( } /** + *

This field is queryable.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponse.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponse.php index edeb5b11d38..7ec82a37f4a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponse.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponse.php @@ -14,9 +14,9 @@ interface OrderEditPagedQueryResponse extends JsonObject { public const FIELD_LIMIT = 'limit'; + public const FIELD_OFFSET = 'offset'; public const FIELD_COUNT = 'count'; public const FIELD_TOTAL = 'total'; - public const FIELD_OFFSET = 'offset'; public const FIELD_RESULTS = 'results'; /** @@ -28,26 +28,36 @@ interface OrderEditPagedQueryResponse extends JsonObject public function getLimit(); /** + *

Number of elements skipped.

+ * * @return null|int */ - public function getCount(); + public function getOffset(); /** + *

Actual number of results returned.

+ * * @return null|int */ - public function getTotal(); + public function getCount(); /** - *

Number of elements skipped.

+ *

Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

* * @return null|int */ - public function getOffset(); + public function getTotal(); /** + *

OrderEdits matching the query.

+ * * @return null|OrderEditCollection */ @@ -58,6 +68,11 @@ public function getResults(); */ public function setLimit(?int $limit): void; + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void; + /** * @param ?int $count */ @@ -68,11 +83,6 @@ public function setCount(?int $count): void; */ public function setTotal(?int $total): void; - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void; - /** * @param ?OrderEditCollection $results */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseBuilder.php index 968e4b8cf0f..9e69c225e7f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseBuilder.php @@ -30,19 +30,19 @@ final class OrderEditPagedQueryResponseBuilder implements Builder * @var ?int */ - private $count; + private $offset; /** * @var ?int */ - private $total; + private $count; /** * @var ?int */ - private $offset; + private $total; /** @@ -62,35 +62,45 @@ public function getLimit() } /** + *

Number of elements skipped.

+ * * @return null|int */ - public function getCount() + public function getOffset() { - return $this->count; + return $this->offset; } /** + *

Actual number of results returned.

+ * * @return null|int */ - public function getTotal() + public function getCount() { - return $this->total; + return $this->count; } /** - *

Number of elements skipped.

+ *

Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

* * @return null|int */ - public function getOffset() + public function getTotal() { - return $this->offset; + return $this->total; } /** + *

OrderEdits matching the query.

+ * * @return null|OrderEditCollection */ @@ -111,34 +121,34 @@ public function withLimit(?int $limit) } /** - * @param ?int $count + * @param ?int $offset * @return $this */ - public function withCount(?int $count) + public function withOffset(?int $offset) { - $this->count = $count; + $this->offset = $offset; return $this; } /** - * @param ?int $total + * @param ?int $count * @return $this */ - public function withTotal(?int $total) + public function withCount(?int $count) { - $this->total = $total; + $this->count = $count; return $this; } /** - * @param ?int $offset + * @param ?int $total * @return $this */ - public function withOffset(?int $offset) + public function withTotal(?int $total) { - $this->offset = $offset; + $this->total = $total; return $this; } @@ -159,9 +169,9 @@ public function build(): OrderEditPagedQueryResponse { return new OrderEditPagedQueryResponseModel( $this->limit, + $this->offset, $this->count, $this->total, - $this->offset, $this->results ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseModel.php index b962e601b3d..9760192a97b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPagedQueryResponseModel.php @@ -29,19 +29,19 @@ final class OrderEditPagedQueryResponseModel extends JsonObjectModel implements * * @var ?int */ - protected $count; + protected $offset; /** * * @var ?int */ - protected $total; + protected $count; /** * * @var ?int */ - protected $offset; + protected $total; /** * @@ -55,15 +55,15 @@ final class OrderEditPagedQueryResponseModel extends JsonObjectModel implements */ public function __construct( ?int $limit = null, + ?int $offset = null, ?int $count = null, ?int $total = null, - ?int $offset = null, ?OrderEditCollection $results = null ) { $this->limit = $limit; + $this->offset = $offset; $this->count = $count; $this->total = $total; - $this->offset = $offset; $this->results = $results; } @@ -88,62 +88,72 @@ public function getLimit() } /** + *

Number of elements skipped.

+ * * * @return null|int */ - public function getCount() + public function getOffset() { - if (is_null($this->count)) { + if (is_null($this->offset)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_COUNT); + $data = $this->raw(self::FIELD_OFFSET); if (is_null($data)) { return null; } - $this->count = (int) $data; + $this->offset = (int) $data; } - return $this->count; + return $this->offset; } /** + *

Actual number of results returned.

+ * * * @return null|int */ - public function getTotal() + public function getCount() { - if (is_null($this->total)) { + if (is_null($this->count)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_TOTAL); + $data = $this->raw(self::FIELD_COUNT); if (is_null($data)) { return null; } - $this->total = (int) $data; + $this->count = (int) $data; } - return $this->total; + return $this->count; } /** - *

Number of elements skipped.

+ *

Total number of results matching the query. + * This number is an estimation that is not strongly consistent. + * This field is returned by default. + * For improved performance, calculating this field can be deactivated by using the query parameter withTotal=false. + * When the results are filtered with a Query Predicate, total is subject to a limit.

* * * @return null|int */ - public function getOffset() + public function getTotal() { - if (is_null($this->offset)) { + if (is_null($this->total)) { /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_OFFSET); + $data = $this->raw(self::FIELD_TOTAL); if (is_null($data)) { return null; } - $this->offset = (int) $data; + $this->total = (int) $data; } - return $this->offset; + return $this->total; } /** + *

OrderEdits matching the query.

+ * * * @return null|OrderEditCollection */ @@ -170,6 +180,14 @@ public function setLimit(?int $limit): void $this->limit = $limit; } + /** + * @param ?int $offset + */ + public function setOffset(?int $offset): void + { + $this->offset = $offset; + } + /** * @param ?int $count */ @@ -186,14 +204,6 @@ public function setTotal(?int $total): void $this->total = $total; } - /** - * @param ?int $offset - */ - public function setOffset(?int $offset): void - { - $this->offset = $offset; - } - /** * @param ?OrderEditCollection $results */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailure.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailure.php index 329fa1d3b3f..85714bc8495 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailure.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailure.php @@ -17,6 +17,8 @@ interface OrderEditPreviewFailure extends OrderEditResult public const FIELD_ERRORS = 'errors'; /** + *

Errors returned.

+ * * @return null|ErrorObjectCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureBuilder.php index bb3a84ffeac..22334b94fe3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureBuilder.php @@ -28,6 +28,8 @@ final class OrderEditPreviewFailureBuilder implements Builder private $errors; /** + *

Errors returned.

+ * * @return null|ErrorObjectCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureModel.php index ab4c72d89e3..160983ed645 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewFailureModel.php @@ -64,6 +64,8 @@ public function getType() } /** + *

Errors returned.

+ * * * @return null|ErrorObjectCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccess.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccess.php index e395a1e4582..c4e4d340476 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccess.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccess.php @@ -18,12 +18,16 @@ interface OrderEditPreviewSuccess extends OrderEditResult public const FIELD_MESSAGE_PAYLOADS = 'messagePayloads'; /** + *

A preview of the edited Order as it will be after all stagedActions (incl. optional Order API Extensions) are applied.

+ * * @return null|StagedOrder */ public function getPreview(); /** + *

Messages that will be generated if the edit is applied.

+ * * @return null|MessagePayloadCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessBuilder.php index c3c910f1999..f63c601ec43 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessBuilder.php @@ -34,6 +34,8 @@ final class OrderEditPreviewSuccessBuilder implements Builder private $messagePayloads; /** + *

A preview of the edited Order as it will be after all stagedActions (incl. optional Order API Extensions) are applied.

+ * * @return null|StagedOrder */ @@ -43,6 +45,8 @@ public function getPreview() } /** + *

Messages that will be generated if the edit is applied.

+ * * @return null|MessagePayloadCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessModel.php index 95338c6eddf..20fd6194a79 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditPreviewSuccessModel.php @@ -72,6 +72,8 @@ public function getType() } /** + *

A preview of the edited Order as it will be after all stagedActions (incl. optional Order API Extensions) are applied.

+ * * * @return null|StagedOrder */ @@ -91,6 +93,8 @@ public function getPreview() } /** + *

Messages that will be generated if the edit is applied.

+ * * * @return null|MessagePayloadCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReference.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReference.php index aa0561376ed..34bde74d14e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReference.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReference.php @@ -17,7 +17,7 @@ interface OrderEditReference extends Reference public const FIELD_OBJ = 'obj'; /** - *

Contains the representation of the expanded OrderEdit. Only present in responses to requests with Reference Expansion for OrderEdits.

+ *

Contains the representation of the expanded Order Edit. Only present in responses to requests with Reference Expansion for Order Edits.

* * @return null|OrderEdit diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceBuilder.php index 1d43e1345bf..6d08bff6c58 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceBuilder.php @@ -46,7 +46,7 @@ public function getId() } /** - *

Contains the representation of the expanded OrderEdit. Only present in responses to requests with Reference Expansion for OrderEdits.

+ *

Contains the representation of the expanded Order Edit. Only present in responses to requests with Reference Expansion for Order Edits.

* * @return null|OrderEdit diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceModel.php index b86801a710a..ffb28450cd8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditReferenceModel.php @@ -95,7 +95,7 @@ public function getId() } /** - *

Contains the representation of the expanded OrderEdit. Only present in responses to requests with Reference Expansion for OrderEdits.

+ *

Contains the representation of the expanded Order Edit. Only present in responses to requests with Reference Expansion for Order Edits.

* * * @return null|OrderEdit diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifier.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifier.php index 6fd85a63d17..51851b0f49d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifier.php @@ -15,7 +15,7 @@ interface OrderEditResourceIdentifier extends ResourceIdentifier { /** - *

Unique identifier of the referenced OrderEdit. Either id or key is required.

+ *

Unique identifier of the referenced OrderEdit.

* * @return null|string @@ -23,7 +23,7 @@ interface OrderEditResourceIdentifier extends ResourceIdentifier public function getId(); /** - *

User-defined unique identifier of the referenced OrderEdit. Either id or key is required.

+ *

User-defined unique identifier of the referenced OrderEdit.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierBuilder.php index 4e3dcce67ec..c9af31443f2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierBuilder.php @@ -35,7 +35,7 @@ final class OrderEditResourceIdentifierBuilder implements Builder private $key; /** - *

Unique identifier of the referenced OrderEdit. Either id or key is required.

+ *

Unique identifier of the referenced OrderEdit.

* * @return null|string @@ -46,7 +46,7 @@ public function getId() } /** - *

User-defined unique identifier of the referenced OrderEdit. Either id or key is required.

+ *

User-defined unique identifier of the referenced OrderEdit.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierModel.php index 25dfce54861..708cb6200bf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditResourceIdentifierModel.php @@ -75,7 +75,7 @@ public function getTypeId() } /** - *

Unique identifier of the referenced OrderEdit. Either id or key is required.

+ *

Unique identifier of the referenced OrderEdit.

* * * @return null|string @@ -95,7 +95,7 @@ public function getId() } /** - *

User-defined unique identifier of the referenced OrderEdit. Either id or key is required.

+ *

User-defined unique identifier of the referenced OrderEdit.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentAction.php index 36a6b5d5319..fb3c299b21c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentAction.php @@ -16,6 +16,9 @@ interface OrderEditSetCommentAction extends OrderEditUpdateAction public const FIELD_COMMENT = 'comment'; /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionBuilder.php index 1edc4c9ca72..5cf9280b8d2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionBuilder.php @@ -27,6 +27,9 @@ final class OrderEditSetCommentActionBuilder implements Builder private $comment; /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionModel.php index e20b40c45b2..9ee4f2e0a91 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCommentActionModel.php @@ -63,6 +63,9 @@ public function getAction() } /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeAction.php index 5de0628cb06..a3f20a6e3a9 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeAction.php @@ -19,8 +19,8 @@ interface OrderEditSetCustomTypeAction extends OrderEditUpdateAction public const FIELD_FIELDS = 'fields'; /** - *

Defines the Type that extends the OrderEdit with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the OrderEdit.

+ *

Defines the Type that extends the Order Edit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Order Edit.

* * @return null|TypeResourceIdentifier @@ -28,7 +28,7 @@ interface OrderEditSetCustomTypeAction extends OrderEditUpdateAction public function getType(); /** - *

Sets the Custom Fields fields for the OrderEdit.

+ *

Sets the Custom Fields fields for the Order Edit.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionBuilder.php index 8a28e07cb79..b14c623ff23 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionBuilder.php @@ -37,8 +37,8 @@ final class OrderEditSetCustomTypeActionBuilder implements Builder private $fields; /** - *

Defines the Type that extends the OrderEdit with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the OrderEdit.

+ *

Defines the Type that extends the Order Edit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Order Edit.

* * @return null|TypeResourceIdentifier @@ -49,7 +49,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the OrderEdit.

+ *

Sets the Custom Fields fields for the Order Edit.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionModel.php index 0b9eb0c7ae4..c973ecce326 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetCustomTypeActionModel.php @@ -75,8 +75,8 @@ public function getAction() } /** - *

Defines the Type that extends the OrderEdit with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the OrderEdit.

+ *

Defines the Type that extends the Order Edit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Order Edit.

* * * @return null|TypeResourceIdentifier @@ -97,7 +97,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the OrderEdit.

+ *

Sets the Custom Fields fields for the Order Edit.

* * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyAction.php index 6fd53e4b8d5..9c052aedf25 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyAction.php @@ -16,7 +16,8 @@ interface OrderEditSetKeyAction extends OrderEditUpdateAction public const FIELD_KEY = 'key'; /** - *

If key is absent or null, this field will be removed if it exists.

+ *

Value to set. + * If empty, any existing value will be removed.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionBuilder.php index 5dc99c9b0af..7f87fa53516 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionBuilder.php @@ -27,7 +27,8 @@ final class OrderEditSetKeyActionBuilder implements Builder private $key; /** - *

If key is absent or null, this field will be removed if it exists.

+ *

Value to set. + * If empty, any existing value will be removed.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionModel.php index f3a9281c750..5c3fb3b746d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetKeyActionModel.php @@ -63,7 +63,8 @@ public function getAction() } /** - *

If key is absent or null, this field will be removed if it exists.

+ *

Value to set. + * If empty, any existing value will be removed.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsAction.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsAction.php index a5864c5d654..dfe13f7143c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsAction.php @@ -17,7 +17,7 @@ interface OrderEditSetStagedActionsAction extends OrderEditUpdateAction public const FIELD_STAGED_ACTIONS = 'stagedActions'; /** - *

The actions to edit the resource.

+ *

Value to replace the stagedActions of the Order Edit.

* * @return null|StagedOrderUpdateActionCollection diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionBuilder.php index e894b1df871..6b186b33a02 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionBuilder.php @@ -28,7 +28,7 @@ final class OrderEditSetStagedActionsActionBuilder implements Builder private $stagedActions; /** - *

The actions to edit the resource.

+ *

Value to replace the stagedActions of the Order Edit.

* * @return null|StagedOrderUpdateActionCollection diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionModel.php index c7d19d029a0..ea0b1ae2d44 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditSetStagedActionsActionModel.php @@ -64,7 +64,7 @@ public function getAction() } /** - *

The actions to edit the resource.

+ *

Value to replace the stagedActions of the Order Edit.

* * * @return null|StagedOrderUpdateActionCollection diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdate.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdate.php index c16a5edbb28..9f4955f3f1c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdate.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdate.php @@ -18,18 +18,25 @@ interface OrderEditUpdate extends JsonObject public const FIELD_DRY_RUN = 'dryRun'; /** + *

Expected version of the Order Edit on which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict will be returned.

+ * * @return null|int */ public function getVersion(); /** + *

Update actions to be performed on the Order Edit.

+ * * @return null|OrderEditUpdateActionCollection */ public function getActions(); /** + *

If set to true, the Order Edit is applied on the Order without persisting it.

+ * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateBuilder.php index 1f6ae3d687f..6654750920a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateBuilder.php @@ -39,6 +39,9 @@ final class OrderEditUpdateBuilder implements Builder private $dryRun; /** + *

Expected version of the Order Edit on which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict will be returned.

+ * * @return null|int */ @@ -48,6 +51,8 @@ public function getVersion() } /** + *

Update actions to be performed on the Order Edit.

+ * * @return null|OrderEditUpdateActionCollection */ @@ -57,6 +62,8 @@ public function getActions() } /** + *

If set to true, the Order Edit is applied on the Order without persisting it.

+ * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateModel.php index 09c9ba057ef..59f106d66d0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderEditUpdateModel.php @@ -52,6 +52,9 @@ public function __construct( } /** + *

Expected version of the Order Edit on which the changes should be applied. + * If the expected version does not match the actual version, a 409 Conflict will be returned.

+ * * * @return null|int */ @@ -70,6 +73,8 @@ public function getVersion() } /** + *

Update actions to be performed on the Order Edit.

+ * * * @return null|OrderEditUpdateActionCollection */ @@ -88,6 +93,8 @@ public function getActions() } /** + *

If set to true, the Order Edit is applied on the Order without persisting it.

+ * * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerpt.php b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerpt.php index 6eec4800d20..9fb8b4491b3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerpt.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerpt.php @@ -20,18 +20,24 @@ interface OrderExcerpt extends JsonObject public const FIELD_VERSION = 'version'; /** + *

Total price of the Order.

+ * * @return null|TypedMoney */ public function getTotalPrice(); /** + *

Taxed price of the Order.

+ * * @return null|TaxedPrice */ public function getTaxedPrice(); /** + *

Current version of the Order.

+ * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptBuilder.php index 0c5dd041eb0..8fda0cbd9d7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptBuilder.php @@ -43,6 +43,8 @@ final class OrderExcerptBuilder implements Builder private $version; /** + *

Total price of the Order.

+ * * @return null|TypedMoney */ @@ -52,6 +54,8 @@ public function getTotalPrice() } /** + *

Taxed price of the Order.

+ * * @return null|TaxedPrice */ @@ -61,6 +65,8 @@ public function getTaxedPrice() } /** + *

Current version of the Order.

+ * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptModel.php b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptModel.php index 0b204913517..e81bc3fedec 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/OrderExcerptModel.php @@ -56,6 +56,8 @@ public function __construct( } /** + *

Total price of the Order.

+ * * * @return null|TypedMoney */ @@ -75,6 +77,8 @@ public function getTotalPrice() } /** + *

Taxed price of the Order.

+ * * * @return null|TaxedPrice */ @@ -94,6 +98,8 @@ public function getTaxedPrice() } /** + *

Current version of the Order.

+ * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php index 738d066c327..b87c0c3aa8b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemAction.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\OrderEdit; use Commercetools\Api\Models\Cart\ExternalTaxRateDraft; +use Commercetools\Api\Models\Cart\ItemShippingDetailsDraft; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\Money; use Commercetools\Api\Models\Order\StagedOrderUpdateAction; @@ -25,12 +26,13 @@ interface StagedOrderAddCustomLineItemAction extends StagedOrderUpdateAction public const FIELD_QUANTITY = 'quantity'; public const FIELD_SLUG = 'slug'; public const FIELD_TAX_CATEGORY = 'taxCategory'; - public const FIELD_CUSTOM = 'custom'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; public const FIELD_PRICE_MODE = 'priceMode'; + public const FIELD_CUSTOM = 'custom'; /** - *

Draft type that stores amounts only in cent precision for the specified currency.

+ *

Money value of the Custom Line Item. The value can be negative.

* * @return null|Money @@ -38,7 +40,7 @@ interface StagedOrderAddCustomLineItemAction extends StagedOrderUpdateAction public function getMoney(); /** - *

JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

+ *

Name of the Custom Line Item.

* * @return null|LocalizedString @@ -54,19 +56,24 @@ public function getName(); public function getKey(); /** + *

Number of Custom Line Items to add to the Cart.

+ * * @return null|int */ public function getQuantity(); /** + *

User-defined identifier used in a deep-link URL for the Custom Line Item. It must match the pattern [a-zA-Z0-9_-]{2,256}.

+ * * @return null|string */ public function getSlug(); /** - *

ResourceIdentifier to a TaxCategory.

+ *

Used to select a Tax Rate when a Cart has the Platform TaxMode. + * If TaxMode is Platform, this field must not be empty.

* * @return null|TaxCategoryResourceIdentifier @@ -74,20 +81,20 @@ public function getSlug(); public function getTaxCategory(); /** - *

The representation used when creating or updating a customizable data type with Custom Fields.

+ *

An external Tax Rate can be set if the Cart has the External TaxMode.

* - * @return null|CustomFieldsDraft + * @return null|ExternalTaxRateDraft */ - public function getCustom(); + public function getExternalTaxRate(); /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

Container for Custom Line Item-specific addresses.

* - * @return null|ExternalTaxRateDraft + * @return null|ItemShippingDetailsDraft */ - public function getExternalTaxRate(); + public function getShippingDetails(); /** *
    @@ -101,6 +108,14 @@ public function getExternalTaxRate(); */ public function getPriceMode(); + /** + *

    Custom Fields for the Custom Line Item.

    + * + + * @return null|CustomFieldsDraft + */ + public function getCustom(); + /** * @param ?Money $money */ @@ -132,17 +147,22 @@ public function setSlug(?string $slug): void; public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): void; /** - * @param ?CustomFieldsDraft $custom + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setCustom(?CustomFieldsDraft $custom): void; + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?ItemShippingDetailsDraft $shippingDetails */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; /** * @param ?string $priceMode */ public function setPriceMode(?string $priceMode): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php index e661f2fecf6..1b49d6471ed 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionBuilder.php @@ -10,6 +10,8 @@ use Commercetools\Api\Models\Cart\ExternalTaxRateDraft; use Commercetools\Api\Models\Cart\ExternalTaxRateDraftBuilder; +use Commercetools\Api\Models\Cart\ItemShippingDetailsDraft; +use Commercetools\Api\Models\Cart\ItemShippingDetailsDraftBuilder; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringBuilder; use Commercetools\Api\Models\Common\Money; @@ -70,15 +72,15 @@ final class StagedOrderAddCustomLineItemActionBuilder implements Builder /** - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ - private $custom; + private $externalTaxRate; /** - * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ - private $externalTaxRate; + private $shippingDetails; /** @@ -87,7 +89,13 @@ final class StagedOrderAddCustomLineItemActionBuilder implements Builder private $priceMode; /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; + + /** + *

    Money value of the Custom Line Item. The value can be negative.

    * * @return null|Money @@ -98,7 +106,7 @@ public function getMoney() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Name of the Custom Line Item.

    * * @return null|LocalizedString @@ -120,6 +128,8 @@ public function getKey() } /** + *

    Number of Custom Line Items to add to the Cart.

    + * * @return null|int */ @@ -129,6 +139,8 @@ public function getQuantity() } /** + *

    User-defined identifier used in a deep-link URL for the Custom Line Item. It must match the pattern [a-zA-Z0-9_-]{2,256}.

    + * * @return null|string */ @@ -138,7 +150,8 @@ public function getSlug() } /** - *

    ResourceIdentifier to a TaxCategory.

    + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode. + * If TaxMode is Platform, this field must not be empty.

    * * @return null|TaxCategoryResourceIdentifier @@ -149,25 +162,25 @@ public function getTaxCategory() } /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    + *

    An external Tax Rate can be set if the Cart has the External TaxMode.

    * - * @return null|CustomFieldsDraft + * @return null|ExternalTaxRateDraft */ - public function getCustom() + public function getExternalTaxRate() { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + *

    Container for Custom Line Item-specific addresses.

    * - * @return null|ExternalTaxRateDraft + * @return null|ItemShippingDetailsDraft */ - public function getExternalTaxRate() + public function getShippingDetails() { - return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; + return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; } /** @@ -185,6 +198,17 @@ public function getPriceMode() return $this->priceMode; } + /** + *

    Custom Fields for the Custom Line Item.

    + * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + } + /** * @param ?Money $money * @return $this @@ -252,23 +276,23 @@ public function withTaxCategory(?TaxCategoryResourceIdentifier $taxCategory) } /** - * @param ?CustomFieldsDraft $custom + * @param ?ExternalTaxRateDraft $externalTaxRate * @return $this */ - public function withCustom(?CustomFieldsDraft $custom) + public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) { - $this->custom = $custom; + $this->externalTaxRate = $externalTaxRate; return $this; } /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this */ - public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) + public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) { - $this->externalTaxRate = $externalTaxRate; + $this->shippingDetails = $shippingDetails; return $this; } @@ -284,6 +308,17 @@ public function withPriceMode(?string $priceMode) return $this; } + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; + + return $this; + } + /** * @deprecated use withMoney() instead * @return $this @@ -318,23 +353,34 @@ public function withTaxCategoryBuilder(?TaxCategoryResourceIdentifierBuilder $ta } /** - * @deprecated use withCustom() instead + * @deprecated use withExternalTaxRate() instead * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) { - $this->custom = $custom; + $this->externalTaxRate = $externalTaxRate; return $this; } /** - * @deprecated use withExternalTaxRate() instead + * @deprecated use withShippingDetails() instead * @return $this */ - public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shippingDetails) { - $this->externalTaxRate = $externalTaxRate; + $this->shippingDetails = $shippingDetails; + + return $this; + } + + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; return $this; } @@ -348,9 +394,10 @@ public function build(): StagedOrderAddCustomLineItemAction $this->quantity, $this->slug, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, - $this->priceMode + $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->priceMode, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php index fb016514ff5..66cdfe44d44 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddCustomLineItemActionModel.php @@ -10,6 +10,8 @@ use Commercetools\Api\Models\Cart\ExternalTaxRateDraft; use Commercetools\Api\Models\Cart\ExternalTaxRateDraftModel; +use Commercetools\Api\Models\Cart\ItemShippingDetailsDraft; +use Commercetools\Api\Models\Cart\ItemShippingDetailsDraftModel; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringModel; use Commercetools\Api\Models\Common\Money; @@ -76,15 +78,15 @@ final class StagedOrderAddCustomLineItemActionModel extends JsonObjectModel impl /** * - * @var ?CustomFieldsDraft + * @var ?ExternalTaxRateDraft */ - protected $custom; + protected $externalTaxRate; /** * - * @var ?ExternalTaxRateDraft + * @var ?ItemShippingDetailsDraft */ - protected $externalTaxRate; + protected $shippingDetails; /** * @@ -92,6 +94,12 @@ final class StagedOrderAddCustomLineItemActionModel extends JsonObjectModel impl */ protected $priceMode; + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; + /** * @psalm-suppress MissingParamType @@ -103,9 +111,10 @@ public function __construct( ?int $quantity = null, ?string $slug = null, ?TaxCategoryResourceIdentifier $taxCategory = null, - ?CustomFieldsDraft $custom = null, ?ExternalTaxRateDraft $externalTaxRate = null, + ?ItemShippingDetailsDraft $shippingDetails = null, ?string $priceMode = null, + ?CustomFieldsDraft $custom = null, ?string $action = null ) { $this->money = $money; @@ -114,9 +123,10 @@ public function __construct( $this->quantity = $quantity; $this->slug = $slug; $this->taxCategory = $taxCategory; - $this->custom = $custom; $this->externalTaxRate = $externalTaxRate; + $this->shippingDetails = $shippingDetails; $this->priceMode = $priceMode; + $this->custom = $custom; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -139,7 +149,7 @@ public function getAction() } /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Money value of the Custom Line Item. The value can be negative.

    * * * @return null|Money @@ -160,7 +170,7 @@ public function getMoney() } /** - *

    JSON object where the keys are of type Locale, and the values are the strings used for the corresponding language.

    + *

    Name of the Custom Line Item.

    * * * @return null|LocalizedString @@ -201,6 +211,8 @@ public function getKey() } /** + *

    Number of Custom Line Items to add to the Cart.

    + * * * @return null|int */ @@ -219,6 +231,8 @@ public function getQuantity() } /** + *

    User-defined identifier used in a deep-link URL for the Custom Line Item. It must match the pattern [a-zA-Z0-9_-]{2,256}.

    + * * * @return null|string */ @@ -237,7 +251,8 @@ public function getSlug() } /** - *

    ResourceIdentifier to a TaxCategory.

    + *

    Used to select a Tax Rate when a Cart has the Platform TaxMode. + * If TaxMode is Platform, this field must not be empty.

    * * * @return null|TaxCategoryResourceIdentifier @@ -258,45 +273,45 @@ public function getTaxCategory() } /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    + *

    An external Tax Rate can be set if the Cart has the External TaxMode.

    * * - * @return null|CustomFieldsDraft + * @return null|ExternalTaxRateDraft */ - public function getCustom() + public function getExternalTaxRate() { - if (is_null($this->custom)) { + if (is_null($this->externalTaxRate)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); if (is_null($data)) { return null; } - $this->custom = CustomFieldsDraftModel::of($data); + $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); } - return $this->custom; + return $this->externalTaxRate; } /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + *

    Container for Custom Line Item-specific addresses.

    * * - * @return null|ExternalTaxRateDraft + * @return null|ItemShippingDetailsDraft */ - public function getExternalTaxRate() + public function getShippingDetails() { - if (is_null($this->externalTaxRate)) { + if (is_null($this->shippingDetails)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); + $data = $this->raw(self::FIELD_SHIPPING_DETAILS); if (is_null($data)) { return null; } - $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); + $this->shippingDetails = ItemShippingDetailsDraftModel::of($data); } - return $this->externalTaxRate; + return $this->shippingDetails; } /** @@ -323,6 +338,27 @@ public function getPriceMode() return $this->priceMode; } + /** + *

    Custom Fields for the Custom Line Item.

    + * + * + * @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 ?Money $money @@ -373,19 +409,19 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi } /** - * @param ?CustomFieldsDraft $custom + * @param ?ExternalTaxRateDraft $externalTaxRate */ - public function setCustom(?CustomFieldsDraft $custom): void + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { - $this->custom = $custom; + $this->externalTaxRate = $externalTaxRate; } /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?ItemShippingDetailsDraft $shippingDetails */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void + public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void { - $this->externalTaxRate = $externalTaxRate; + $this->shippingDetails = $shippingDetails; } /** @@ -395,4 +431,12 @@ public function setPriceMode(?string $priceMode): void { $this->priceMode = $priceMode; } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php index e55e1f21e42..7a89349bc6a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryAction.php @@ -26,7 +26,7 @@ interface StagedOrderAddDeliveryAction extends StagedOrderUpdateAction public const FIELD_CUSTOM = 'custom'; /** - *

    User-defined unique identifier of a Delivery.

    + *

    key of an existing Delivery.

    * * @return null|string @@ -34,7 +34,7 @@ interface StagedOrderAddDeliveryAction extends StagedOrderUpdateAction public function getDeliveryKey(); /** - *

    key of the ShippingMethod,required for Multiple ShippingMode.

    + *

    key of the ShippingMethod, required for Multiple ShippingMode.

    * * @return null|string @@ -42,15 +42,15 @@ public function getDeliveryKey(); public function getShippingKey(); /** + *

    Items to be included in the Delivery.

    + * * @return null|DeliveryItemCollection */ public function getItems(); /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address the parcels should be delivered to.

    * * @return null|BaseAddress @@ -58,13 +58,16 @@ public function getItems(); public function getAddress(); /** + *

    Parcels of the Delivery.

    + *

    If provided, this update action also produces the Parcel Added To Delivery Message.

    + * * @return null|ParcelDraftCollection */ public function getParcels(); /** - *

    Custom Fields for the Transaction.

    + *

    Custom Fields for the Delivery.

    * * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php index 67b40ba6db1..8a878dee2fb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionBuilder.php @@ -65,7 +65,7 @@ final class StagedOrderAddDeliveryActionBuilder implements Builder private $custom; /** - *

    User-defined unique identifier of a Delivery.

    + *

    key of an existing Delivery.

    * * @return null|string @@ -76,7 +76,7 @@ public function getDeliveryKey() } /** - *

    key of the ShippingMethod,required for Multiple ShippingMode.

    + *

    key of the ShippingMethod, required for Multiple ShippingMode.

    * * @return null|string @@ -87,6 +87,8 @@ public function getShippingKey() } /** + *

    Items to be included in the Delivery.

    + * * @return null|DeliveryItemCollection */ @@ -96,9 +98,7 @@ public function getItems() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address the parcels should be delivered to.

    * * @return null|BaseAddress @@ -109,6 +109,9 @@ public function getAddress() } /** + *

    Parcels of the Delivery.

    + *

    If provided, this update action also produces the Parcel Added To Delivery Message.

    + * * @return null|ParcelDraftCollection */ @@ -118,7 +121,7 @@ public function getParcels() } /** - *

    Custom Fields for the Transaction.

    + *

    Custom Fields for the Delivery.

    * * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php index 2a1d5022d78..83531d1cc42 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDeliveryActionModel.php @@ -111,7 +111,7 @@ public function getAction() } /** - *

    User-defined unique identifier of a Delivery.

    + *

    key of an existing Delivery.

    * * * @return null|string @@ -131,7 +131,7 @@ public function getDeliveryKey() } /** - *

    key of the ShippingMethod,required for Multiple ShippingMode.

    + *

    key of the ShippingMethod, required for Multiple ShippingMode.

    * * * @return null|string @@ -151,6 +151,8 @@ public function getShippingKey() } /** + *

    Items to be included in the Delivery.

    + * * * @return null|DeliveryItemCollection */ @@ -169,9 +171,7 @@ public function getItems() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address the parcels should be delivered to.

    * * * @return null|BaseAddress @@ -192,6 +192,9 @@ public function getAddress() } /** + *

    Parcels of the Delivery.

    + *

    If provided, this update action also produces the Parcel Added To Delivery Message.

    + * * * @return null|ParcelDraftCollection */ @@ -210,7 +213,7 @@ public function getParcels() } /** - *

    Custom Fields for the Transaction.

    + *

    Custom Fields for the Delivery.

    * * * @return null|CustomFieldsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeAction.php index 97d46e51838..5a57b881472 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeAction.php @@ -17,6 +17,8 @@ interface StagedOrderAddDiscountCodeAction extends StagedOrderUpdateAction public const FIELD_CODE = 'code'; /** + *

    code of a DiscountCode.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionBuilder.php index febd203d3d2..f363ebbdd65 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionBuilder.php @@ -29,6 +29,8 @@ final class StagedOrderAddDiscountCodeActionBuilder implements Builder private $code; /** + *

    code of a DiscountCode.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionModel.php index 6659b27bc7a..3a30d90e2f4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddDiscountCodeActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

    code of a DiscountCode.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php index b13489f8f0d..49d9142a95d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressAction.php @@ -18,9 +18,8 @@ interface StagedOrderAddItemShippingAddressAction extends StagedOrderUpdateActio public const FIELD_ADDRESS = 'address'; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address to append to itemShippingAddresses. + * The new Address must have a key that is unique across this Order.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php index 10480817cee..f986b0d1837 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionBuilder.php @@ -31,9 +31,8 @@ final class StagedOrderAddItemShippingAddressActionBuilder implements Builder private $address; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address to append to itemShippingAddresses. + * The new Address must have a key that is unique across this Order.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php index 9ad5432b75d..c1945e6f8d5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddItemShippingAddressActionModel.php @@ -67,9 +67,8 @@ public function getAction() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Address to append to itemShippingAddresses. + * The new Address must have a key that is unique across this Order.

    * * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php index ed1f930a6f8..1b89f7d22f6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemAction.php @@ -22,18 +22,19 @@ interface StagedOrderAddLineItemAction extends StagedOrderUpdateAction { public const FIELD_KEY = 'key'; - public const FIELD_CUSTOM = 'custom'; - public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; - public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_VARIANT_ID = 'variantId'; public const FIELD_SKU = 'sku'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_ADDED_AT = 'addedAt'; + public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_EXTERNAL_PRICE = 'externalPrice'; public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; + public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_CUSTOM = 'custom'; /** *

    User-defined unique identifier of the LineItem.

    @@ -44,61 +45,64 @@ interface StagedOrderAddLineItemAction extends StagedOrderUpdateAction public function getKey(); /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    + *

    id of the published Product.

    + *

    Either the productId and variantId, or sku must be provided.

    * - * @return null|CustomFieldsDraft - */ - public function getCustom(); - - /** - *

    ResourceIdentifier to a Channel.

    - * - - * @return null|ChannelResourceIdentifier - */ - public function getDistributionChannel(); - - /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    - * - - * @return null|ExternalTaxRateDraft - */ - public function getExternalTaxRate(); - - /** - * @return null|string */ public function getProductId(); /** + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|int */ public function getVariantId(); /** + *

    SKU of the ProductVariant.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|string */ public function getSku(); /** + *

    Quantity of the Product Variant to add to the Cart.

    + * * @return null|int */ public function getQuantity(); /** + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * * @return null|DateTimeImmutable */ public function getAddedAt(); /** - *

    ResourceIdentifier to a Channel.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum. + * If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

    + * + + * @return null|ChannelResourceIdentifier + */ + public function getDistributionChannel(); + + /** + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier @@ -106,7 +110,7 @@ public function getAddedAt(); public function getSupplyChannel(); /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -114,38 +118,50 @@ public function getSupplyChannel(); public function getExternalPrice(); /** + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** - *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    * - * @return null|ItemShippingDetailsDraft + * @return null|ExternalTaxRateDraft */ - public function getShippingDetails(); + public function getExternalTaxRate(); /** - * @param ?string $key + *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. + * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    + * + + * @return null|string */ - public function setKey(?string $key): void; + public function getInventoryMode(); /** - * @param ?CustomFieldsDraft $custom + *

    Container for Line Item-specific addresses.

    + * + + * @return null|ItemShippingDetailsDraft */ - public function setCustom(?CustomFieldsDraft $custom): void; + public function getShippingDetails(); /** - * @param ?ChannelResourceIdentifier $distributionChannel + *

    Custom Fields for the Line Item.

    + * + + * @return null|CustomFieldsDraft */ - public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; + public function getCustom(); /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?string $key */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + public function setKey(?string $key): void; /** * @param ?string $productId @@ -172,6 +188,11 @@ public function setQuantity(?int $quantity): void; */ public function setAddedAt(?DateTimeImmutable $addedAt): void; + /** + * @param ?ChannelResourceIdentifier $distributionChannel + */ + public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; + /** * @param ?ChannelResourceIdentifier $supplyChannel */ @@ -187,8 +208,23 @@ public function setExternalPrice(?Money $externalPrice): void; */ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice): void; + /** + * @param ?ExternalTaxRateDraft $externalTaxRate + */ + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void; + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php index 05d42395903..3c765a501be 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionBuilder.php @@ -41,24 +41,6 @@ final class StagedOrderAddLineItemActionBuilder implements Builder */ private $key; - /** - - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder - */ - private $custom; - - /** - - * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder - */ - private $distributionChannel; - - /** - - * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder - */ - private $externalTaxRate; - /** * @var ?string @@ -89,6 +71,12 @@ final class StagedOrderAddLineItemActionBuilder implements Builder */ private $addedAt; + /** + + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder + */ + private $distributionChannel; + /** * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder @@ -109,55 +97,43 @@ final class StagedOrderAddLineItemActionBuilder implements Builder /** - * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder */ - private $shippingDetails; + private $externalTaxRate; /** - *

    User-defined unique identifier of the LineItem.

    - * - * @return null|string + * @var ?string */ - public function getKey() - { - return $this->key; - } + private $inventoryMode; /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    - * - * @return null|CustomFieldsDraft + * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder */ - public function getCustom() - { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; - } + private $shippingDetails; /** - *

    ResourceIdentifier to a Channel.

    - * - * @return null|ChannelResourceIdentifier + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ - public function getDistributionChannel() - { - return $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel; - } + private $custom; /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + *

    User-defined unique identifier of the LineItem.

    * - * @return null|ExternalTaxRateDraft + * @return null|string */ - public function getExternalTaxRate() + public function getKey() { - return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; + return $this->key; } /** + *

    id of the published Product.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|string */ @@ -167,6 +143,10 @@ public function getProductId() } /** + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|int */ @@ -176,6 +156,9 @@ public function getVariantId() } /** + *

    SKU of the ProductVariant.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * @return null|string */ @@ -185,6 +168,8 @@ public function getSku() } /** + *

    Quantity of the Product Variant to add to the Cart.

    + * * @return null|int */ @@ -194,6 +179,10 @@ public function getQuantity() } /** + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * * @return null|DateTimeImmutable */ @@ -203,7 +192,21 @@ public function getAddedAt() } /** - *

    ResourceIdentifier to a Channel.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum. + * If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

    + * + + * @return null|ChannelResourceIdentifier + */ + public function getDistributionChannel() + { + return $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel; + } + + /** + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier @@ -214,7 +217,7 @@ public function getSupplyChannel() } /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -225,6 +228,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ @@ -234,56 +239,57 @@ public function getExternalTotalPrice() } /** - *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    * - * @return null|ItemShippingDetailsDraft + * @return null|ExternalTaxRateDraft */ - public function getShippingDetails() + public function getExternalTaxRate() { - return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; + return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } /** - * @param ?string $key - * @return $this + *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. + * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    + * + + * @return null|string */ - public function withKey(?string $key) + public function getInventoryMode() { - $this->key = $key; - - return $this; + return $this->inventoryMode; } /** - * @param ?CustomFieldsDraft $custom - * @return $this + *

    Container for Line Item-specific addresses.

    + * + + * @return null|ItemShippingDetailsDraft */ - public function withCustom(?CustomFieldsDraft $custom) + public function getShippingDetails() { - $this->custom = $custom; - - return $this; + return $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails; } /** - * @param ?ChannelResourceIdentifier $distributionChannel - * @return $this + *

    Custom Fields for the Line Item.

    + * + + * @return null|CustomFieldsDraft */ - public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) + public function getCustom() { - $this->distributionChannel = $distributionChannel; - - return $this; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** - * @param ?ExternalTaxRateDraft $externalTaxRate + * @param ?string $key * @return $this */ - public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) + public function withKey(?string $key) { - $this->externalTaxRate = $externalTaxRate; + $this->key = $key; return $this; } @@ -343,6 +349,17 @@ public function withAddedAt(?DateTimeImmutable $addedAt) return $this; } + /** + * @param ?ChannelResourceIdentifier $distributionChannel + * @return $this + */ + public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) + { + $this->distributionChannel = $distributionChannel; + + return $this; + } + /** * @param ?ChannelResourceIdentifier $supplyChannel * @return $this @@ -377,45 +394,56 @@ public function withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTota } /** - * @param ?ItemShippingDetailsDraft $shippingDetails + * @param ?ExternalTaxRateDraft $externalTaxRate * @return $this */ - public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) + public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) { - $this->shippingDetails = $shippingDetails; + $this->externalTaxRate = $externalTaxRate; return $this; } /** - * @deprecated use withCustom() instead + * @param ?string $inventoryMode * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withInventoryMode(?string $inventoryMode) { - $this->custom = $custom; + $this->inventoryMode = $inventoryMode; return $this; } /** - * @deprecated use withDistributionChannel() instead + * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this */ - public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder $distributionChannel) + public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) { - $this->distributionChannel = $distributionChannel; + $this->shippingDetails = $shippingDetails; return $this; } /** - * @deprecated use withExternalTaxRate() instead + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + public function withCustom(?CustomFieldsDraft $custom) { - $this->externalTaxRate = $externalTaxRate; + $this->custom = $custom; + + return $this; + } + + /** + * @deprecated use withDistributionChannel() instead + * @return $this + */ + public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder $distributionChannel) + { + $this->distributionChannel = $distributionChannel; return $this; } @@ -453,6 +481,17 @@ public function withExternalTotalPriceBuilder(?ExternalLineItemTotalPriceBuilder return $this; } + /** + * @deprecated use withExternalTaxRate() instead + * @return $this + */ + public function withExternalTaxRateBuilder(?ExternalTaxRateDraftBuilder $externalTaxRate) + { + $this->externalTaxRate = $externalTaxRate; + + return $this; + } + /** * @deprecated use withShippingDetails() instead * @return $this @@ -464,22 +503,34 @@ public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shi return $this; } + /** + * @deprecated use withCustom() instead + * @return $this + */ + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + { + $this->custom = $custom; + + return $this; + } + public function build(): StagedOrderAddLineItemAction { return new StagedOrderAddLineItemActionModel( $this->key, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, - $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, $this->productId, $this->variantId, $this->sku, $this->quantity, $this->addedAt, + $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice, $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice, - $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->inventoryMode, + $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php index adb430c0ef0..8822334e991 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddLineItemActionModel.php @@ -47,24 +47,6 @@ final class StagedOrderAddLineItemActionModel extends JsonObjectModel implements */ protected $key; - /** - * - * @var ?CustomFieldsDraft - */ - protected $custom; - - /** - * - * @var ?ChannelResourceIdentifier - */ - protected $distributionChannel; - - /** - * - * @var ?ExternalTaxRateDraft - */ - protected $externalTaxRate; - /** * * @var ?string @@ -95,6 +77,12 @@ final class StagedOrderAddLineItemActionModel extends JsonObjectModel implements */ protected $addedAt; + /** + * + * @var ?ChannelResourceIdentifier + */ + protected $distributionChannel; + /** * * @var ?ChannelResourceIdentifier @@ -113,45 +101,65 @@ final class StagedOrderAddLineItemActionModel extends JsonObjectModel implements */ protected $externalTotalPrice; + /** + * + * @var ?ExternalTaxRateDraft + */ + protected $externalTaxRate; + + /** + * + * @var ?string + */ + protected $inventoryMode; + /** * * @var ?ItemShippingDetailsDraft */ protected $shippingDetails; + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; + /** * @psalm-suppress MissingParamType */ public function __construct( ?string $key = null, - ?CustomFieldsDraft $custom = null, - ?ChannelResourceIdentifier $distributionChannel = null, - ?ExternalTaxRateDraft $externalTaxRate = null, ?string $productId = null, ?int $variantId = null, ?string $sku = null, ?int $quantity = null, ?DateTimeImmutable $addedAt = null, + ?ChannelResourceIdentifier $distributionChannel = null, ?ChannelResourceIdentifier $supplyChannel = null, ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, + ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $inventoryMode = null, ?ItemShippingDetailsDraft $shippingDetails = null, + ?CustomFieldsDraft $custom = null, ?string $action = null ) { $this->key = $key; - $this->custom = $custom; - $this->distributionChannel = $distributionChannel; - $this->externalTaxRate = $externalTaxRate; $this->productId = $productId; $this->variantId = $variantId; $this->sku = $sku; $this->quantity = $quantity; $this->addedAt = $addedAt; + $this->distributionChannel = $distributionChannel; $this->supplyChannel = $supplyChannel; $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; + $this->externalTaxRate = $externalTaxRate; + $this->inventoryMode = $inventoryMode; $this->shippingDetails = $shippingDetails; + $this->custom = $custom; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -194,69 +202,9 @@ public function getKey() } /** - *

    The representation used when creating or updating a customizable data type with Custom Fields.

    + *

    id of the published Product.

    + *

    Either the productId and variantId, or sku must be provided.

    * - * - * @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; - } - - /** - *

    ResourceIdentifier to a Channel.

    - * - * - * @return null|ChannelResourceIdentifier - */ - public function getDistributionChannel() - { - if (is_null($this->distributionChannel)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL); - if (is_null($data)) { - return null; - } - - $this->distributionChannel = ChannelResourceIdentifierModel::of($data); - } - - return $this->distributionChannel; - } - - /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    - * - * - * @return null|ExternalTaxRateDraft - */ - public function getExternalTaxRate() - { - if (is_null($this->externalTaxRate)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); - if (is_null($data)) { - return null; - } - - $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); - } - - return $this->externalTaxRate; - } - - /** * * @return null|string */ @@ -275,6 +223,10 @@ public function getProductId() } /** + *

    id of the ProductVariant in the Product. + * If not provided, the Master Variant is used.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * * @return null|int */ @@ -293,6 +245,9 @@ public function getVariantId() } /** + *

    SKU of the ProductVariant.

    + *

    Either the productId and variantId, or sku must be provided.

    + * * * @return null|string */ @@ -311,6 +266,8 @@ public function getSku() } /** + *

    Quantity of the Product Variant to add to the Cart.

    + * * * @return null|int */ @@ -329,6 +286,10 @@ public function getQuantity() } /** + *

    Date and time (UTC) the Product Variant is added to the Cart. + * If not set, it defaults to the current date and time.

    + *

    Optional for backwards compatibility reasons.

    + * * * @return null|DateTimeImmutable */ @@ -351,7 +312,31 @@ public function getAddedAt() } /** - *

    ResourceIdentifier to a Channel.

    + *

    Used to select a Product Price. + * The Channel must have the ProductDistribution ChannelRoleEnum. + * If the Cart is bound to a Store with distributionChannels set, the Channel must match one of the Store's distribution channels.

    + * + * + * @return null|ChannelResourceIdentifier + */ + public function getDistributionChannel() + { + if (is_null($this->distributionChannel)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL); + if (is_null($data)) { + return null; + } + + $this->distributionChannel = ChannelResourceIdentifierModel::of($data); + } + + return $this->distributionChannel; + } + + /** + *

    Used to identify Inventory entries that must be reserved. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * * @return null|ChannelResourceIdentifier @@ -372,7 +357,7 @@ public function getSupplyChannel() } /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Sets the LineItem price value, and the priceMode to ExternalPrice LineItemPriceMode.

    * * * @return null|Money @@ -393,6 +378,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice values, and the priceMode to ExternalTotal LineItemPriceMode.

    + * * * @return null|ExternalLineItemTotalPrice */ @@ -412,57 +399,96 @@ public function getExternalTotalPrice() } /** - *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + *

    External Tax Rate for the Line Item, if the Cart has the External TaxMode.

    * * - * @return null|ItemShippingDetailsDraft + * @return null|ExternalTaxRateDraft */ - public function getShippingDetails() + public function getExternalTaxRate() { - if (is_null($this->shippingDetails)) { + if (is_null($this->externalTaxRate)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_DETAILS); + $data = $this->raw(self::FIELD_EXTERNAL_TAX_RATE); if (is_null($data)) { return null; } - $this->shippingDetails = ItemShippingDetailsDraftModel::of($data); + $this->externalTaxRate = ExternalTaxRateDraftModel::of($data); } - return $this->shippingDetails; + return $this->externalTaxRate; } - /** - * @param ?string $key + *

    Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. + * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

    + * + * + * @return null|string */ - public function setKey(?string $key): void + public function getInventoryMode() { - $this->key = $key; + if (is_null($this->inventoryMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_INVENTORY_MODE); + if (is_null($data)) { + return null; + } + $this->inventoryMode = (string) $data; + } + + return $this->inventoryMode; } /** - * @param ?CustomFieldsDraft $custom + *

    Container for Line Item-specific addresses.

    + * + * + * @return null|ItemShippingDetailsDraft */ - public function setCustom(?CustomFieldsDraft $custom): void + public function getShippingDetails() { - $this->custom = $custom; + if (is_null($this->shippingDetails)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_DETAILS); + if (is_null($data)) { + return null; + } + + $this->shippingDetails = ItemShippingDetailsDraftModel::of($data); + } + + return $this->shippingDetails; } /** - * @param ?ChannelResourceIdentifier $distributionChannel + *

    Custom Fields for the Line Item.

    + * + * + * @return null|CustomFieldsDraft */ - public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void + public function getCustom() { - $this->distributionChannel = $distributionChannel; + 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 ?ExternalTaxRateDraft $externalTaxRate + * @param ?string $key */ - public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void + public function setKey(?string $key): void { - $this->externalTaxRate = $externalTaxRate; + $this->key = $key; } /** @@ -505,6 +531,14 @@ public function setAddedAt(?DateTimeImmutable $addedAt): void $this->addedAt = $addedAt; } + /** + * @param ?ChannelResourceIdentifier $distributionChannel + */ + public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void + { + $this->distributionChannel = $distributionChannel; + } + /** * @param ?ChannelResourceIdentifier $supplyChannel */ @@ -529,6 +563,22 @@ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotal $this->externalTotalPrice = $externalTotalPrice; } + /** + * @param ?ExternalTaxRateDraft $externalTaxRate + */ + public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void + { + $this->externalTaxRate = $externalTaxRate; + } + + /** + * @param ?string $inventoryMode + */ + public function setInventoryMode(?string $inventoryMode): void + { + $this->inventoryMode = $inventoryMode; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ @@ -537,6 +587,14 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): $this->shippingDetails = $shippingDetails; } + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } + #[\ReturnTypeWillChange] public function jsonSerialize() diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryAction.php index fb5e4d0510a..d71161ec584 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryAction.php @@ -25,7 +25,8 @@ interface StagedOrderAddParcelToDeliveryAction extends StagedOrderUpdateAction public const FIELD_ITEMS = 'items'; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -33,7 +34,8 @@ interface StagedOrderAddParcelToDeliveryAction extends StagedOrderUpdateAction public function getDeliveryId(); /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -41,24 +43,32 @@ public function getDeliveryId(); public function getDeliveryKey(); /** + *

    key of an existing Parcel.

    + * * @return null|string */ public function getParcelKey(); /** + *

    Value to set.

    + * * @return null|ParcelMeasurements */ public function getMeasurements(); /** + *

    Value to set.

    + * * @return null|TrackingData */ public function getTrackingData(); /** + *

    Value to set.

    + * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionBuilder.php index 0e969f8f5ff..e4b7b6a7101 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionBuilder.php @@ -64,7 +64,8 @@ final class StagedOrderAddParcelToDeliveryActionBuilder implements Builder private $items; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -75,7 +76,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -86,6 +88,8 @@ public function getDeliveryKey() } /** + *

    key of an existing Parcel.

    + * * @return null|string */ @@ -95,6 +99,8 @@ public function getParcelKey() } /** + *

    Value to set.

    + * * @return null|ParcelMeasurements */ @@ -104,6 +110,8 @@ public function getMeasurements() } /** + *

    Value to set.

    + * * @return null|TrackingData */ @@ -113,6 +121,8 @@ public function getTrackingData() } /** + *

    Value to set.

    + * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionModel.php index e82ca63baa0..db17cde6a6d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddParcelToDeliveryActionModel.php @@ -110,7 +110,8 @@ public function getAction() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -130,7 +131,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -150,6 +152,8 @@ public function getDeliveryKey() } /** + *

    key of an existing Parcel.

    + * * * @return null|string */ @@ -168,6 +172,8 @@ public function getParcelKey() } /** + *

    Value to set.

    + * * * @return null|ParcelMeasurements */ @@ -187,6 +193,8 @@ public function getMeasurements() } /** + *

    Value to set.

    + * * * @return null|TrackingData */ @@ -206,6 +214,8 @@ public function getTrackingData() } /** + *

    Value to set.

    + * * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentAction.php index abc2144c6c4..cf6cf33b710 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentAction.php @@ -18,7 +18,8 @@ interface StagedOrderAddPaymentAction extends StagedOrderUpdateAction public const FIELD_PAYMENT = 'payment'; /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to add to the PaymentInfo. + * Must not be assigned to another Order or active Cart already.

    * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionBuilder.php index af4bd528cfe..2f58b80a277 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionBuilder.php @@ -31,7 +31,8 @@ final class StagedOrderAddPaymentActionBuilder implements Builder private $payment; /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to add to the PaymentInfo. + * Must not be assigned to another Order or active Cart already.

    * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionModel.php index c4de39c3f15..6c493f9d837 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddPaymentActionModel.php @@ -67,7 +67,8 @@ public function getAction() } /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to add to the PaymentInfo. + * Must not be assigned to another Order or active Cart already.

    * * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoAction.php index 72c672e7bfb..9fc90f9a87c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoAction.php @@ -21,18 +21,26 @@ interface StagedOrderAddReturnInfoAction extends StagedOrderUpdateAction public const FIELD_RETURN_DATE = 'returnDate'; /** + *

    Value to set.

    + * * @return null|string */ public function getReturnTrackingId(); /** + *

    Items to be returned. + * Must not be empty.

    + * * @return null|ReturnItemDraftCollection */ public function getItems(); /** + *

    Value to set. + * If not set, it defaults to the current date and time.

    + * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionBuilder.php index dee4c41c7b2..8e4239db223 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionBuilder.php @@ -43,6 +43,8 @@ final class StagedOrderAddReturnInfoActionBuilder implements Builder private $returnDate; /** + *

    Value to set.

    + * * @return null|string */ @@ -52,6 +54,9 @@ public function getReturnTrackingId() } /** + *

    Items to be returned. + * Must not be empty.

    + * * @return null|ReturnItemDraftCollection */ @@ -61,6 +66,9 @@ public function getItems() } /** + *

    Value to set. + * If not set, it defaults to the current date and time.

    + * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionModel.php index 7dc8b7ee134..566cc06b5e9 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddReturnInfoActionModel.php @@ -83,6 +83,8 @@ public function getAction() } /** + *

    Value to set.

    + * * * @return null|string */ @@ -101,6 +103,9 @@ public function getReturnTrackingId() } /** + *

    Items to be returned. + * Must not be empty.

    + * * * @return null|ReturnItemDraftCollection */ @@ -119,6 +124,9 @@ public function getItems() } /** + *

    Value to set. + * If not set, it defaults to the current date and time.

    + * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListAction.php index 7999a3f66d6..c17de2ffca8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListAction.php @@ -17,11 +17,11 @@ interface StagedOrderAddShoppingListAction extends StagedOrderUpdateAction { public const FIELD_SHOPPING_LIST = 'shoppingList'; - public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; + public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; /** - *

    ResourceIdentifier to a ShoppingList.

    + *

    Shopping List that contains the Line Items to be added.

    * * @return null|ShoppingListResourceIdentifier @@ -29,20 +29,22 @@ interface StagedOrderAddShoppingListAction extends StagedOrderUpdateAction public function getShoppingList(); /** - *

    ResourceIdentifier to a Channel.

    + *

    distributionChannel to set for all LineItems that are added to the Cart. + * The Channel must have the ProductDistribution ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier */ - public function getSupplyChannel(); + public function getDistributionChannel(); /** - *

    ResourceIdentifier to a Channel.

    + *

    supplyChannel to set for all LineItems that are added to the Cart. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier */ - public function getDistributionChannel(); + public function getSupplyChannel(); /** * @param ?ShoppingListResourceIdentifier $shoppingList @@ -50,12 +52,12 @@ public function getDistributionChannel(); public function setShoppingList(?ShoppingListResourceIdentifier $shoppingList): void; /** - * @param ?ChannelResourceIdentifier $supplyChannel + * @param ?ChannelResourceIdentifier $distributionChannel */ - public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void; + public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; /** - * @param ?ChannelResourceIdentifier $distributionChannel + * @param ?ChannelResourceIdentifier $supplyChannel */ - public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; + public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionBuilder.php index d292097b1d1..5a76d784388 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionBuilder.php @@ -36,16 +36,16 @@ final class StagedOrderAddShoppingListActionBuilder implements Builder * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ - private $supplyChannel; + private $distributionChannel; /** * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ - private $distributionChannel; + private $supplyChannel; /** - *

    ResourceIdentifier to a ShoppingList.

    + *

    Shopping List that contains the Line Items to be added.

    * * @return null|ShoppingListResourceIdentifier @@ -56,25 +56,27 @@ public function getShoppingList() } /** - *

    ResourceIdentifier to a Channel.

    + *

    distributionChannel to set for all LineItems that are added to the Cart. + * The Channel must have the ProductDistribution ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier */ - public function getSupplyChannel() + public function getDistributionChannel() { - return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel; + return $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel; } /** - *

    ResourceIdentifier to a Channel.

    + *

    supplyChannel to set for all LineItems that are added to the Cart. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * @return null|ChannelResourceIdentifier */ - public function getDistributionChannel() + public function getSupplyChannel() { - return $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel; + return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel; } /** @@ -89,23 +91,23 @@ public function withShoppingList(?ShoppingListResourceIdentifier $shoppingList) } /** - * @param ?ChannelResourceIdentifier $supplyChannel + * @param ?ChannelResourceIdentifier $distributionChannel * @return $this */ - public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel) + public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) { - $this->supplyChannel = $supplyChannel; + $this->distributionChannel = $distributionChannel; return $this; } /** - * @param ?ChannelResourceIdentifier $distributionChannel + * @param ?ChannelResourceIdentifier $supplyChannel * @return $this */ - public function withDistributionChannel(?ChannelResourceIdentifier $distributionChannel) + public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel) { - $this->distributionChannel = $distributionChannel; + $this->supplyChannel = $supplyChannel; return $this; } @@ -122,23 +124,23 @@ public function withShoppingListBuilder(?ShoppingListResourceIdentifierBuilder $ } /** - * @deprecated use withSupplyChannel() instead + * @deprecated use withDistributionChannel() instead * @return $this */ - public function withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel) + public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder $distributionChannel) { - $this->supplyChannel = $supplyChannel; + $this->distributionChannel = $distributionChannel; return $this; } /** - * @deprecated use withDistributionChannel() instead + * @deprecated use withSupplyChannel() instead * @return $this */ - public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder $distributionChannel) + public function withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel) { - $this->distributionChannel = $distributionChannel; + $this->supplyChannel = $supplyChannel; return $this; } @@ -147,8 +149,8 @@ public function build(): StagedOrderAddShoppingListAction { return new StagedOrderAddShoppingListActionModel( $this->shoppingList instanceof ShoppingListResourceIdentifierBuilder ? $this->shoppingList->build() : $this->shoppingList, - $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, - $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel + $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, + $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionModel.php index 1d22d3e3a3f..bbc495760f0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderAddShoppingListActionModel.php @@ -42,13 +42,13 @@ final class StagedOrderAddShoppingListActionModel extends JsonObjectModel implem * * @var ?ChannelResourceIdentifier */ - protected $supplyChannel; + protected $distributionChannel; /** * * @var ?ChannelResourceIdentifier */ - protected $distributionChannel; + protected $supplyChannel; /** @@ -56,13 +56,13 @@ final class StagedOrderAddShoppingListActionModel extends JsonObjectModel implem */ public function __construct( ?ShoppingListResourceIdentifier $shoppingList = null, - ?ChannelResourceIdentifier $supplyChannel = null, ?ChannelResourceIdentifier $distributionChannel = null, + ?ChannelResourceIdentifier $supplyChannel = null, ?string $action = null ) { $this->shoppingList = $shoppingList; - $this->supplyChannel = $supplyChannel; $this->distributionChannel = $distributionChannel; + $this->supplyChannel = $supplyChannel; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -85,7 +85,7 @@ public function getAction() } /** - *

    ResourceIdentifier to a ShoppingList.

    + *

    Shopping List that contains the Line Items to be added.

    * * * @return null|ShoppingListResourceIdentifier @@ -106,45 +106,47 @@ public function getShoppingList() } /** - *

    ResourceIdentifier to a Channel.

    + *

    distributionChannel to set for all LineItems that are added to the Cart. + * The Channel must have the ProductDistribution ChannelRoleEnum.

    * * * @return null|ChannelResourceIdentifier */ - public function getSupplyChannel() + public function getDistributionChannel() { - if (is_null($this->supplyChannel)) { + if (is_null($this->distributionChannel)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SUPPLY_CHANNEL); + $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL); if (is_null($data)) { return null; } - $this->supplyChannel = ChannelResourceIdentifierModel::of($data); + $this->distributionChannel = ChannelResourceIdentifierModel::of($data); } - return $this->supplyChannel; + return $this->distributionChannel; } /** - *

    ResourceIdentifier to a Channel.

    + *

    supplyChannel to set for all LineItems that are added to the Cart. + * The Channel must have the InventorySupply ChannelRoleEnum.

    * * * @return null|ChannelResourceIdentifier */ - public function getDistributionChannel() + public function getSupplyChannel() { - if (is_null($this->distributionChannel)) { + if (is_null($this->supplyChannel)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_DISTRIBUTION_CHANNEL); + $data = $this->raw(self::FIELD_SUPPLY_CHANNEL); if (is_null($data)) { return null; } - $this->distributionChannel = ChannelResourceIdentifierModel::of($data); + $this->supplyChannel = ChannelResourceIdentifierModel::of($data); } - return $this->distributionChannel; + return $this->supplyChannel; } @@ -157,18 +159,18 @@ public function setShoppingList(?ShoppingListResourceIdentifier $shoppingList): } /** - * @param ?ChannelResourceIdentifier $supplyChannel + * @param ?ChannelResourceIdentifier $distributionChannel */ - public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void + public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void { - $this->supplyChannel = $supplyChannel; + $this->distributionChannel = $distributionChannel; } /** - * @param ?ChannelResourceIdentifier $distributionChannel + * @param ?ChannelResourceIdentifier $supplyChannel */ - public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void + public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void { - $this->distributionChannel = $distributionChannel; + $this->supplyChannel = $supplyChannel; } } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php index 37472b2b84e..5a4a1b5801f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderBuilder.php @@ -13,6 +13,7 @@ use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceBuilder; use Commercetools\Api\Models\Cart\CustomLineItemCollection; +use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; use Commercetools\Api\Models\Cart\LineItemCollection; use Commercetools\Api\Models\Cart\ShippingCollection; @@ -87,39 +88,33 @@ final class StagedOrderBuilder implements Builder /** - * @var null|LastModifiedBy|LastModifiedByBuilder - */ - private $lastModifiedBy; - - /** - - * @var null|CreatedBy|CreatedByBuilder + * @var ?string */ - private $createdBy; + private $orderNumber; /** - * @var ?DateTimeImmutable + * @var ?string */ - private $completedAt; + private $purchaseOrderNumber; /** * @var ?string */ - private $orderNumber; + private $customerId; /** * @var ?string */ - private $customerId; + private $customerEmail; /** - * @var ?string + * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder */ - private $customerEmail; + private $customerGroup; /** @@ -171,123 +166,123 @@ final class StagedOrderBuilder implements Builder /** - * @var null|Address|AddressBuilder + * @var ?string */ - private $shippingAddress; + private $taxMode; /** - * @var null|Address|AddressBuilder + * @var ?string */ - private $billingAddress; + private $taxRoundingMode; /** * @var ?string */ - private $shippingMode; + private $taxCalculationMode; /** * @var ?string */ - private $shippingKey; + private $inventoryMode; /** - * @var null|CustomFields|CustomFieldsBuilder + * @var null|Address|AddressBuilder */ - private $shippingCustomFields; + private $billingAddress; /** - * @var ?ShippingCollection + * @var null|Address|AddressBuilder */ - private $shipping; + private $shippingAddress; /** * @var ?string */ - private $taxMode; + private $shippingMode; /** * @var ?string */ - private $taxRoundingMode; + private $shippingKey; /** - * @var null|CustomerGroupReference|CustomerGroupReferenceBuilder + * @var null|ShippingInfo|ShippingInfoBuilder */ - private $customerGroup; + private $shippingInfo; /** - * @var ?string + * @var null|ShippingRateInput|ShippingRateInputBuilder */ - private $country; + private $shippingRateInput; /** - * @var ?string + * @var null|CustomFields|CustomFieldsBuilder */ - private $orderState; + private $shippingCustomFields; /** - * @var null|StateReference|StateReferenceBuilder + * @var ?ShippingCollection */ - private $state; + private $shipping; /** - * @var ?string + * @var ?AddressCollection */ - private $shipmentState; + private $itemShippingAddresses; /** - * @var ?string + * @var ?DiscountCodeInfoCollection */ - private $paymentState; + private $discountCodes; /** - * @var null|ShippingInfo|ShippingInfoBuilder + * @var ?DirectDiscountCollection */ - private $shippingInfo; + private $directDiscounts; /** - * @var ?SyncInfoCollection + * @var ?CartDiscountReferenceCollection */ - private $syncInfo; + private $refusedGifts; /** - * @var ?ReturnInfoCollection + * @var null|PaymentInfo|PaymentInfoBuilder */ - private $returnInfo; + private $paymentInfo; /** * @var ?string */ - private $purchaseOrderNumber; + private $country; /** - * @var ?DiscountCodeInfoCollection + * @var ?string */ - private $discountCodes; + private $locale; /** - * @deprecated - * @var ?int + + * @var ?string */ - private $lastMessageSequenceNumber; + private $origin; /** @@ -303,57 +298,69 @@ final class StagedOrderBuilder implements Builder /** - * @var null|CustomFields|CustomFieldsBuilder + * @var ?string */ - private $custom; + private $orderState; /** - * @var null|PaymentInfo|PaymentInfoBuilder + * @var ?string */ - private $paymentInfo; + private $shipmentState; /** * @var ?string */ - private $locale; + private $paymentState; /** - * @var ?string + * @var null|StateReference|StateReferenceBuilder */ - private $inventoryMode; + private $state; /** - * @var ?string + * @var ?SyncInfoCollection */ - private $origin; + private $syncInfo; /** - * @var ?string + * @var ?ReturnInfoCollection */ - private $taxCalculationMode; + private $returnInfo; /** + * @deprecated + * @var ?int + */ + private $lastMessageSequenceNumber; - * @var null|ShippingRateInput|ShippingRateInputBuilder + /** + + * @var null|CustomFields|CustomFieldsBuilder */ - private $shippingRateInput; + private $custom; /** - * @var ?AddressCollection + * @var ?DateTimeImmutable */ - private $itemShippingAddresses; + private $completedAt; /** - * @var ?CartDiscountReferenceCollection + * @var null|LastModifiedBy|LastModifiedByBuilder */ - private $refusedGifts; + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; /** *

    Unique identifier of the Order.

    @@ -367,7 +374,7 @@ public function getId() } /** - *

    The current version of the order.

    + *

    Current version of the Order.

    * * @return null|int @@ -378,6 +385,8 @@ public function getVersion() } /** + *

    Date and time (UTC) the Order was initially created.

    + * * @return null|DateTimeImmutable */ @@ -387,6 +396,8 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Order was last updated.

    + * * @return null|DateTimeImmutable */ @@ -396,72 +407,64 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    - * - - * @return null|LastModifiedBy - */ - public function getLastModifiedBy() - { - return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; - } - - /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    User-defined identifier of the Order that is unique across a Project.

    * - * @return null|CreatedBy + * @return null|string */ - public function getCreatedBy() + public function getOrderNumber() { - return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + return $this->orderNumber; } /** - *

    This field will only be present if it was set for Order Import

    + *

    User-defined identifier of a purchase Order.

    + *

    It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow.

    * - * @return null|DateTimeImmutable + * @return null|string */ - public function getCompletedAt() + public function getPurchaseOrderNumber() { - return $this->completedAt; + return $this->purchaseOrderNumber; } /** - *

    String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed.

    + *

    id of the Customer that the Order belongs to.

    * * @return null|string */ - public function getOrderNumber() + public function getCustomerId() { - return $this->orderNumber; + return $this->customerId; } /** + *

    Email address of the Customer that the Order belongs to.

    + * * @return null|string */ - public function getCustomerId() + public function getCustomerEmail() { - return $this->customerId; + return $this->customerEmail; } /** + *

    Reference to the Customer Group of the Customer that the Order belongs to. + * Used for LineItem Price selection.

    + * - * @return null|string + * @return null|CustomerGroupReference */ - public function getCustomerEmail() + public function getCustomerGroup() { - return $this->customerEmail; + return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup; } /** - *

    Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

    + *

    Anonymous session associated with the Order.

    * * @return null|string @@ -472,7 +475,7 @@ public function getAnonymousId() } /** - *

    The Business Unit the Order belongs to.

    + *

    Reference to a Business Unit the Order belongs to.

    * * @return null|BusinessUnitKeyReference @@ -483,6 +486,8 @@ public function getBusinessUnit() } /** + *

    Reference to a Store the Order belongs to.

    + * * @return null|StoreKeyReference */ @@ -492,6 +497,8 @@ public function getStore() } /** + *

    Line Items that are part of the Order.

    + * * @return null|LineItemCollection */ @@ -501,6 +508,8 @@ public function getLineItems() } /** + *

    Custom Line Items that are part of the Order.

    + * * @return null|CustomLineItemCollection */ @@ -510,6 +519,9 @@ public function getCustomLineItems() } /** + *

    Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo. + * Taxes are included if TaxRate includedInPrice is true for each price.

    + * * @return null|TypedMoney */ @@ -519,7 +531,10 @@ public function getTotalPrice() } /** - *

    The taxes are calculated based on the shipping address.

    + *
      + *
    • For Platform TaxMode, it is automatically set when a shipping address is set.
    • + *
    • For External TaxMode, it is automatically set when the external Tax Rate for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.
    • + *
    * * @return null|TaxedPrice @@ -530,8 +545,7 @@ public function getTaxedPrice() } /** - *

    Sum of taxedPrice of ShippingInfo across all Shipping Methods. - * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

    + *

    Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

    * * @return null|TaxedPrice @@ -542,219 +556,241 @@ public function getTaxedShippingPrice() } /** - *

    Holds all shipping-related information per Shipping Method.

    - *

    For Multiple ShippingMode, it is updated automatically after the Shipping Methods are added.

    + *

    Indicates how Tax Rates are set.

    * - * @return null|Address + * @return null|string */ - public function getShippingAddress() + public function getTaxMode() { - return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + return $this->taxMode; } /** + *

    Indicates how monetary values are rounded when calculating taxes for taxedPrice.

    + * - * @return null|Address + * @return null|string */ - public function getBillingAddress() + public function getTaxRoundingMode() { - return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress; + return $this->taxRoundingMode; } /** - *

    Indicates whether one or multiple Shipping Methods are added to the Cart.

    + *

    Indicates how taxes are calculated when calculating taxes for taxedPrice.

    * * @return null|string */ - public function getShippingMode() + public function getTaxCalculationMode() { - return $this->shippingMode; + return $this->taxCalculationMode; } /** - *

    key of the ShippingMethod for Single ShippingMode.

    + *

    Indicates how stock quantities are tracked for Line Items in the Order.

    * * @return null|string */ - public function getShippingKey() + public function getInventoryMode() { - return $this->shippingKey; + return $this->inventoryMode; } /** - *

    Custom Fields of the Shipping Method for Single ShippingMode.

    + *

    Billing address associated with the Order.

    * - * @return null|CustomFields + * @return null|Address */ - public function getShippingCustomFields() + public function getBillingAddress() { - return $this->shippingCustomFields instanceof CustomFieldsBuilder ? $this->shippingCustomFields->build() : $this->shippingCustomFields; + return $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress; } /** - *

    Holds all shipping-related information per Shipping Method for Multiple ShippingMode.

    - *

    It is updated automatically after the Shipping Method is added.

    + *

    Shipping address associated with the Order. + * Determines eligible ShippingMethod rates and Tax Rates of Line Items.

    * - * @return null|ShippingCollection + * @return null|Address */ - public function getShipping() + public function getShippingAddress() { - return $this->shipping; + return $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; } /** + *

    Indicates whether there can be one or multiple Shipping Methods.

    + * * @return null|string */ - public function getTaxMode() + public function getShippingMode() { - return $this->taxMode; + return $this->shippingMode; } /** - *

    When calculating taxes for taxedPrice, the selected mode is used for rouding.

    + *

    key of the ShippingMethod for Single ShippingMode.

    * * @return null|string */ - public function getTaxRoundingMode() + public function getShippingKey() { - return $this->taxRoundingMode; + return $this->shippingKey; } /** - *

    Set when the customer is set and the customer is a member of a customer group. - * Used for product variant price selection.

    + *

    Shipping-related information for Single ShippingMode. + * Automatically set when a Shipping Method is set.

    * - * @return null|CustomerGroupReference + * @return null|ShippingInfo */ - public function getCustomerGroup() + public function getShippingInfo() { - return $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup; + return $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo; } /** - *

    A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * - * @return null|string + * @return null|ShippingRateInput */ - public function getCountry() + public function getShippingRateInput() { - return $this->country; + return $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; } /** - *

    One of the four predefined OrderStates.

    + *

    Custom Fields of the Shipping Method for Single ShippingMode.

    * - * @return null|string + * @return null|CustomFields */ - public function getOrderState() + public function getShippingCustomFields() { - return $this->orderState; + return $this->shippingCustomFields instanceof CustomFieldsBuilder ? $this->shippingCustomFields->build() : $this->shippingCustomFields; } /** - *

    This reference can point to a state in a custom workflow.

    + *

    Shipping-related information for Multiple ShippingMode. + * Updated automatically each time a new Shipping Method is added.

    * - * @return null|StateReference + * @return null|ShippingCollection */ - public function getState() + public function getShipping() { - return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + return $this->shipping; } /** + *

    Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. + * Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

    + * - * @return null|string + * @return null|AddressCollection */ - public function getShipmentState() + public function getItemShippingAddresses() { - return $this->shipmentState; + return $this->itemShippingAddresses; } /** + *

    Discount Codes added to the Order. + * An Order that has directDiscounts cannot have discountCodes.

    + * - * @return null|string + * @return null|DiscountCodeInfoCollection */ - public function getPaymentState() + public function getDiscountCodes() { - return $this->paymentState; + return $this->discountCodes; } /** - *

    Set if the ShippingMethod is set.

    + *

    Direct Discounts added to the Order. + * An Order that has discountCodes cannot have directDiscounts.

    * - * @return null|ShippingInfo + * @return null|DirectDiscountCollection */ - public function getShippingInfo() + public function getDirectDiscounts() { - return $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo; + return $this->directDiscounts; } /** + *

    Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

    + * - * @return null|SyncInfoCollection + * @return null|CartDiscountReferenceCollection */ - public function getSyncInfo() + public function getRefusedGifts() { - return $this->syncInfo; + return $this->refusedGifts; } /** + *

    Payment information related to the Order.

    + * - * @return null|ReturnInfoCollection + * @return null|PaymentInfo */ - public function getReturnInfo() + public function getPaymentInfo() { - return $this->returnInfo; + return $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo; } /** - *

    The Purchase Order Number is typically set by the Buyer on a QuoteRequest to - * track the purchase order during the quote and order flow.

    + *

    Used for LineItem Price selection.

    * * @return null|string */ - public function getPurchaseOrderNumber() + public function getCountry() { - return $this->purchaseOrderNumber; + return $this->country; } /** + *

    Languages of the Order. + * Can only contain languages supported by the Project.

    + * - * @return null|DiscountCodeInfoCollection + * @return null|string */ - public function getDiscountCodes() + public function getLocale() { - return $this->discountCodes; + return $this->locale; } /** - *

    Internal-only field.

    + *

    Indicates the origin of the Cart from which the Order was created.

    * - * @deprecated - * @return null|int + + * @return null|string */ - public function getLastMessageSequenceNumber() + public function getOrigin() { - return $this->lastMessageSequenceNumber; + return $this->origin; } /** - *

    Set when this order was created from a cart. - * The cart will have the state Ordered.

    + *

    Reference to the Cart for an Order created from Cart. + * The referenced Cart will have the Ordered CartState.

    * * @return null|CartReference @@ -765,7 +801,7 @@ public function getCart() } /** - *

    Set when this order was created from a quote.

    + *

    Reference to the Quote for an Order created from Quote.

    * * @return null|QuoteReference @@ -776,98 +812,127 @@ public function getQuote() } /** + *

    Current status of the Order.

    + * - * @return null|CustomFields + * @return null|string */ - public function getCustom() + public function getOrderState() { - return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; + return $this->orderState; } /** + *

    Shipment status of the Order.

    + * - * @return null|PaymentInfo + * @return null|string */ - public function getPaymentInfo() + public function getShipmentState() { - return $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo; + return $this->shipmentState; } /** + *

    Payment status of the Order.

    + * * @return null|string */ - public function getLocale() + public function getPaymentState() { - return $this->locale; + return $this->paymentState; } /** + *

    State of the Order. + * This reference can point to a State in a custom workflow.

    + * - * @return null|string + * @return null|StateReference */ - public function getInventoryMode() + public function getState() { - return $this->inventoryMode; + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; } /** + *

    Contains synchronization activity information of the Order (like export or import). + * Can only be set with Update SyncInfo update action.

    + * - * @return null|string + * @return null|SyncInfoCollection */ - public function getOrigin() + public function getSyncInfo() { - return $this->origin; + return $this->syncInfo; } /** - *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    + *

    Contains information regarding the returns associated with the Order.

    * - * @return null|string + * @return null|ReturnInfoCollection */ - public function getTaxCalculationMode() + public function getReturnInfo() { - return $this->taxCalculationMode; + return $this->returnInfo; } /** - *

    Input used to select a ShippingRatePriceTier. - * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    - * + *

    Internal-only field.

    * + * @deprecated + * @return null|int + */ + public function getLastMessageSequenceNumber() + { + return $this->lastMessageSequenceNumber; + } - * @return null|ShippingRateInput + /** + *

    Custom Fields of the Order.

    + * + + * @return null|CustomFields */ - public function getShippingRateInput() + public function getCustom() { - return $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput; + return $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom; } /** - *

    Contains addresses for orders with multiple shipping addresses.

    + *

    User-defined date and time (UTC) of the Order. + * Present only on an Order created using Order Import.

    * - * @return null|AddressCollection + * @return null|DateTimeImmutable */ - public function getItemShippingAddresses() + public function getCompletedAt() { - return $this->itemShippingAddresses; + return $this->completedAt; } /** - *

    Automatically filled when a line item with LineItemMode GiftLineItem is removed from this order.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * - * @return null|CartDiscountReferenceCollection + * @return null|LastModifiedBy */ - public function getRefusedGifts() + public function getLastModifiedBy() { - return $this->refusedGifts; + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; } /** @@ -915,67 +980,56 @@ public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) } /** - * @param ?LastModifiedBy $lastModifiedBy - * @return $this - */ - public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) - { - $this->lastModifiedBy = $lastModifiedBy; - - return $this; - } - - /** - * @param ?CreatedBy $createdBy + * @param ?string $orderNumber * @return $this */ - public function withCreatedBy(?CreatedBy $createdBy) + public function withOrderNumber(?string $orderNumber) { - $this->createdBy = $createdBy; + $this->orderNumber = $orderNumber; return $this; } /** - * @param ?DateTimeImmutable $completedAt + * @param ?string $purchaseOrderNumber * @return $this */ - public function withCompletedAt(?DateTimeImmutable $completedAt) + public function withPurchaseOrderNumber(?string $purchaseOrderNumber) { - $this->completedAt = $completedAt; + $this->purchaseOrderNumber = $purchaseOrderNumber; return $this; } /** - * @param ?string $orderNumber + * @param ?string $customerId * @return $this */ - public function withOrderNumber(?string $orderNumber) + public function withCustomerId(?string $customerId) { - $this->orderNumber = $orderNumber; + $this->customerId = $customerId; return $this; } /** - * @param ?string $customerId + * @param ?string $customerEmail * @return $this */ - public function withCustomerId(?string $customerId) + public function withCustomerEmail(?string $customerEmail) { - $this->customerId = $customerId; + $this->customerEmail = $customerEmail; return $this; } /** - * @param ?string $customerEmail + * @param ?CustomerGroupReference $customerGroup * @return $this */ - public function withCustomerEmail(?string $customerEmail) + public function withCustomerGroup(?CustomerGroupReference $customerGroup) { - $this->customerEmail = $customerEmail; + $this->customerGroup = $customerGroup; return $this; } @@ -1069,221 +1123,221 @@ public function withTaxedShippingPrice(?TaxedPrice $taxedShippingPrice) } /** - * @param ?Address $shippingAddress + * @param ?string $taxMode * @return $this */ - public function withShippingAddress(?Address $shippingAddress) + public function withTaxMode(?string $taxMode) { - $this->shippingAddress = $shippingAddress; + $this->taxMode = $taxMode; return $this; } /** - * @param ?Address $billingAddress + * @param ?string $taxRoundingMode * @return $this */ - public function withBillingAddress(?Address $billingAddress) + public function withTaxRoundingMode(?string $taxRoundingMode) { - $this->billingAddress = $billingAddress; + $this->taxRoundingMode = $taxRoundingMode; return $this; } /** - * @param ?string $shippingMode + * @param ?string $taxCalculationMode * @return $this */ - public function withShippingMode(?string $shippingMode) + public function withTaxCalculationMode(?string $taxCalculationMode) { - $this->shippingMode = $shippingMode; + $this->taxCalculationMode = $taxCalculationMode; return $this; } /** - * @param ?string $shippingKey + * @param ?string $inventoryMode * @return $this */ - public function withShippingKey(?string $shippingKey) + public function withInventoryMode(?string $inventoryMode) { - $this->shippingKey = $shippingKey; + $this->inventoryMode = $inventoryMode; return $this; } /** - * @param ?CustomFields $shippingCustomFields + * @param ?Address $billingAddress * @return $this */ - public function withShippingCustomFields(?CustomFields $shippingCustomFields) + public function withBillingAddress(?Address $billingAddress) { - $this->shippingCustomFields = $shippingCustomFields; + $this->billingAddress = $billingAddress; return $this; } /** - * @param ?ShippingCollection $shipping + * @param ?Address $shippingAddress * @return $this */ - public function withShipping(?ShippingCollection $shipping) + public function withShippingAddress(?Address $shippingAddress) { - $this->shipping = $shipping; + $this->shippingAddress = $shippingAddress; return $this; } /** - * @param ?string $taxMode + * @param ?string $shippingMode * @return $this */ - public function withTaxMode(?string $taxMode) + public function withShippingMode(?string $shippingMode) { - $this->taxMode = $taxMode; + $this->shippingMode = $shippingMode; return $this; } /** - * @param ?string $taxRoundingMode + * @param ?string $shippingKey * @return $this */ - public function withTaxRoundingMode(?string $taxRoundingMode) + public function withShippingKey(?string $shippingKey) { - $this->taxRoundingMode = $taxRoundingMode; + $this->shippingKey = $shippingKey; return $this; } /** - * @param ?CustomerGroupReference $customerGroup + * @param ?ShippingInfo $shippingInfo * @return $this */ - public function withCustomerGroup(?CustomerGroupReference $customerGroup) + public function withShippingInfo(?ShippingInfo $shippingInfo) { - $this->customerGroup = $customerGroup; + $this->shippingInfo = $shippingInfo; return $this; } /** - * @param ?string $country + * @param ?ShippingRateInput $shippingRateInput * @return $this */ - public function withCountry(?string $country) + public function withShippingRateInput(?ShippingRateInput $shippingRateInput) { - $this->country = $country; + $this->shippingRateInput = $shippingRateInput; return $this; } /** - * @param ?string $orderState + * @param ?CustomFields $shippingCustomFields * @return $this */ - public function withOrderState(?string $orderState) + public function withShippingCustomFields(?CustomFields $shippingCustomFields) { - $this->orderState = $orderState; + $this->shippingCustomFields = $shippingCustomFields; return $this; } /** - * @param ?StateReference $state + * @param ?ShippingCollection $shipping * @return $this */ - public function withState(?StateReference $state) + public function withShipping(?ShippingCollection $shipping) { - $this->state = $state; + $this->shipping = $shipping; return $this; } /** - * @param ?string $shipmentState + * @param ?AddressCollection $itemShippingAddresses * @return $this */ - public function withShipmentState(?string $shipmentState) + public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses) { - $this->shipmentState = $shipmentState; + $this->itemShippingAddresses = $itemShippingAddresses; return $this; } /** - * @param ?string $paymentState + * @param ?DiscountCodeInfoCollection $discountCodes * @return $this */ - public function withPaymentState(?string $paymentState) + public function withDiscountCodes(?DiscountCodeInfoCollection $discountCodes) { - $this->paymentState = $paymentState; + $this->discountCodes = $discountCodes; return $this; } /** - * @param ?ShippingInfo $shippingInfo + * @param ?DirectDiscountCollection $directDiscounts * @return $this */ - public function withShippingInfo(?ShippingInfo $shippingInfo) + public function withDirectDiscounts(?DirectDiscountCollection $directDiscounts) { - $this->shippingInfo = $shippingInfo; + $this->directDiscounts = $directDiscounts; return $this; } /** - * @param ?SyncInfoCollection $syncInfo + * @param ?CartDiscountReferenceCollection $refusedGifts * @return $this */ - public function withSyncInfo(?SyncInfoCollection $syncInfo) + public function withRefusedGifts(?CartDiscountReferenceCollection $refusedGifts) { - $this->syncInfo = $syncInfo; + $this->refusedGifts = $refusedGifts; return $this; } /** - * @param ?ReturnInfoCollection $returnInfo + * @param ?PaymentInfo $paymentInfo * @return $this */ - public function withReturnInfo(?ReturnInfoCollection $returnInfo) + public function withPaymentInfo(?PaymentInfo $paymentInfo) { - $this->returnInfo = $returnInfo; + $this->paymentInfo = $paymentInfo; return $this; } /** - * @param ?string $purchaseOrderNumber + * @param ?string $country * @return $this */ - public function withPurchaseOrderNumber(?string $purchaseOrderNumber) + public function withCountry(?string $country) { - $this->purchaseOrderNumber = $purchaseOrderNumber; + $this->country = $country; return $this; } /** - * @param ?DiscountCodeInfoCollection $discountCodes + * @param ?string $locale * @return $this */ - public function withDiscountCodes(?DiscountCodeInfoCollection $discountCodes) + public function withLocale(?string $locale) { - $this->discountCodes = $discountCodes; + $this->locale = $locale; return $this; } /** - * @param ?int $lastMessageSequenceNumber + * @param ?string $origin * @return $this */ - public function withLastMessageSequenceNumber(?int $lastMessageSequenceNumber) + public function withOrigin(?string $origin) { - $this->lastMessageSequenceNumber = $lastMessageSequenceNumber; + $this->origin = $origin; return $this; } @@ -1311,109 +1365,109 @@ public function withQuote(?QuoteReference $quote) } /** - * @param ?CustomFields $custom + * @param ?string $orderState * @return $this */ - public function withCustom(?CustomFields $custom) + public function withOrderState(?string $orderState) { - $this->custom = $custom; + $this->orderState = $orderState; return $this; } /** - * @param ?PaymentInfo $paymentInfo + * @param ?string $shipmentState * @return $this */ - public function withPaymentInfo(?PaymentInfo $paymentInfo) + public function withShipmentState(?string $shipmentState) { - $this->paymentInfo = $paymentInfo; + $this->shipmentState = $shipmentState; return $this; } /** - * @param ?string $locale + * @param ?string $paymentState * @return $this */ - public function withLocale(?string $locale) + public function withPaymentState(?string $paymentState) { - $this->locale = $locale; + $this->paymentState = $paymentState; return $this; } /** - * @param ?string $inventoryMode + * @param ?StateReference $state * @return $this */ - public function withInventoryMode(?string $inventoryMode) + public function withState(?StateReference $state) { - $this->inventoryMode = $inventoryMode; + $this->state = $state; return $this; } /** - * @param ?string $origin + * @param ?SyncInfoCollection $syncInfo * @return $this */ - public function withOrigin(?string $origin) + public function withSyncInfo(?SyncInfoCollection $syncInfo) { - $this->origin = $origin; + $this->syncInfo = $syncInfo; return $this; } /** - * @param ?string $taxCalculationMode + * @param ?ReturnInfoCollection $returnInfo * @return $this */ - public function withTaxCalculationMode(?string $taxCalculationMode) + public function withReturnInfo(?ReturnInfoCollection $returnInfo) { - $this->taxCalculationMode = $taxCalculationMode; + $this->returnInfo = $returnInfo; return $this; } /** - * @param ?ShippingRateInput $shippingRateInput + * @param ?int $lastMessageSequenceNumber * @return $this */ - public function withShippingRateInput(?ShippingRateInput $shippingRateInput) + public function withLastMessageSequenceNumber(?int $lastMessageSequenceNumber) { - $this->shippingRateInput = $shippingRateInput; + $this->lastMessageSequenceNumber = $lastMessageSequenceNumber; return $this; } /** - * @param ?AddressCollection $itemShippingAddresses + * @param ?CustomFields $custom * @return $this */ - public function withItemShippingAddresses(?AddressCollection $itemShippingAddresses) + public function withCustom(?CustomFields $custom) { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->custom = $custom; return $this; } /** - * @param ?CartDiscountReferenceCollection $refusedGifts + * @param ?DateTimeImmutable $completedAt * @return $this */ - public function withRefusedGifts(?CartDiscountReferenceCollection $refusedGifts) + public function withCompletedAt(?DateTimeImmutable $completedAt) { - $this->refusedGifts = $refusedGifts; + $this->completedAt = $completedAt; return $this; } /** - * @deprecated use withLastModifiedBy() instead + * @param ?LastModifiedBy $lastModifiedBy * @return $this */ - public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) { $this->lastModifiedBy = $lastModifiedBy; @@ -1421,16 +1475,27 @@ public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy } /** - * @deprecated use withCreatedBy() instead + * @param ?CreatedBy $createdBy * @return $this */ - public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + public function withCreatedBy(?CreatedBy $createdBy) { $this->createdBy = $createdBy; return $this; } + /** + * @deprecated use withCustomerGroup() instead + * @return $this + */ + public function withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup) + { + $this->customerGroup = $customerGroup; + + return $this; + } + /** * @deprecated use withBusinessUnit() instead * @return $this @@ -1487,67 +1552,67 @@ public function withTaxedShippingPriceBuilder(?TaxedPriceBuilder $taxedShippingP } /** - * @deprecated use withShippingAddress() instead + * @deprecated use withBillingAddress() instead * @return $this */ - public function withShippingAddressBuilder(?AddressBuilder $shippingAddress) + public function withBillingAddressBuilder(?AddressBuilder $billingAddress) { - $this->shippingAddress = $shippingAddress; + $this->billingAddress = $billingAddress; return $this; } /** - * @deprecated use withBillingAddress() instead + * @deprecated use withShippingAddress() instead * @return $this */ - public function withBillingAddressBuilder(?AddressBuilder $billingAddress) + public function withShippingAddressBuilder(?AddressBuilder $shippingAddress) { - $this->billingAddress = $billingAddress; + $this->shippingAddress = $shippingAddress; return $this; } /** - * @deprecated use withShippingCustomFields() instead + * @deprecated use withShippingInfo() instead * @return $this */ - public function withShippingCustomFieldsBuilder(?CustomFieldsBuilder $shippingCustomFields) + public function withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo) { - $this->shippingCustomFields = $shippingCustomFields; + $this->shippingInfo = $shippingInfo; return $this; } /** - * @deprecated use withCustomerGroup() instead + * @deprecated use withShippingRateInput() instead * @return $this */ - public function withCustomerGroupBuilder(?CustomerGroupReferenceBuilder $customerGroup) + public function withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput) { - $this->customerGroup = $customerGroup; + $this->shippingRateInput = $shippingRateInput; return $this; } /** - * @deprecated use withState() instead + * @deprecated use withShippingCustomFields() instead * @return $this */ - public function withStateBuilder(?StateReferenceBuilder $state) + public function withShippingCustomFieldsBuilder(?CustomFieldsBuilder $shippingCustomFields) { - $this->state = $state; + $this->shippingCustomFields = $shippingCustomFields; return $this; } /** - * @deprecated use withShippingInfo() instead + * @deprecated use withPaymentInfo() instead * @return $this */ - public function withShippingInfoBuilder(?ShippingInfoBuilder $shippingInfo) + public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo) { - $this->shippingInfo = $shippingInfo; + $this->paymentInfo = $paymentInfo; return $this; } @@ -1574,6 +1639,17 @@ public function withQuoteBuilder(?QuoteReferenceBuilder $quote) return $this; } + /** + * @deprecated use withState() instead + * @return $this + */ + public function withStateBuilder(?StateReferenceBuilder $state) + { + $this->state = $state; + + return $this; + } + /** * @deprecated use withCustom() instead * @return $this @@ -1586,23 +1662,23 @@ public function withCustomBuilder(?CustomFieldsBuilder $custom) } /** - * @deprecated use withPaymentInfo() instead + * @deprecated use withLastModifiedBy() instead * @return $this */ - public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo) + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) { - $this->paymentInfo = $paymentInfo; + $this->lastModifiedBy = $lastModifiedBy; return $this; } /** - * @deprecated use withShippingRateInput() instead + * @deprecated use withCreatedBy() instead * @return $this */ - public function withShippingRateInputBuilder(?ShippingRateInputBuilder $shippingRateInput) + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) { - $this->shippingRateInput = $shippingRateInput; + $this->createdBy = $createdBy; return $this; } @@ -1614,12 +1690,11 @@ public function build(): StagedOrder $this->version, $this->createdAt, $this->lastModifiedAt, - $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, - $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, - $this->completedAt, $this->orderNumber, + $this->purchaseOrderNumber, $this->customerId, $this->customerEmail, + $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, $this->anonymousId, $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit, $this->store instanceof StoreKeyReferenceBuilder ? $this->store->build() : $this->store, @@ -1628,37 +1703,39 @@ public function build(): StagedOrder $this->totalPrice instanceof TypedMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->taxedPrice instanceof TaxedPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, $this->taxedShippingPrice instanceof TaxedPriceBuilder ? $this->taxedShippingPrice->build() : $this->taxedShippingPrice, - $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->taxMode, + $this->taxRoundingMode, + $this->taxCalculationMode, + $this->inventoryMode, $this->billingAddress instanceof AddressBuilder ? $this->billingAddress->build() : $this->billingAddress, + $this->shippingAddress instanceof AddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, $this->shippingMode, $this->shippingKey, + $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo, + $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, $this->shippingCustomFields instanceof CustomFieldsBuilder ? $this->shippingCustomFields->build() : $this->shippingCustomFields, $this->shipping, - $this->taxMode, - $this->taxRoundingMode, - $this->customerGroup instanceof CustomerGroupReferenceBuilder ? $this->customerGroup->build() : $this->customerGroup, + $this->itemShippingAddresses, + $this->discountCodes, + $this->directDiscounts, + $this->refusedGifts, + $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo, $this->country, + $this->locale, + $this->origin, + $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart, + $this->quote instanceof QuoteReferenceBuilder ? $this->quote->build() : $this->quote, $this->orderState, - $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, $this->shipmentState, $this->paymentState, - $this->shippingInfo instanceof ShippingInfoBuilder ? $this->shippingInfo->build() : $this->shippingInfo, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, $this->syncInfo, $this->returnInfo, - $this->purchaseOrderNumber, - $this->discountCodes, $this->lastMessageSequenceNumber, - $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart, - $this->quote instanceof QuoteReferenceBuilder ? $this->quote->build() : $this->quote, $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, - $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo, - $this->locale, - $this->inventoryMode, - $this->origin, - $this->taxCalculationMode, - $this->shippingRateInput instanceof ShippingRateInputBuilder ? $this->shippingRateInput->build() : $this->shippingRateInput, - $this->itemShippingAddresses, - $this->refusedGifts + $this->completedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php index 6fa67b27a0f..d7cb0e7fc9b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php @@ -19,13 +19,17 @@ interface StagedOrderChangeCustomLineItemMoneyAction extends StagedOrderUpdateAc public const FIELD_MONEY = 'money'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Value to set. + * Must not be empty. + * Can be a negative amount.

    * * @return null|Money diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php index 030677c8cfa..a660b40ba9a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php @@ -37,6 +37,8 @@ final class StagedOrderChangeCustomLineItemMoneyActionBuilder implements Builder private $money; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -46,7 +48,9 @@ public function getCustomLineItemId() } /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Value to set. + * Must not be empty. + * Can be a negative amount.

    * * @return null|Money diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php index a480349c7fb..3428966ca7d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php @@ -75,6 +75,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -93,7 +95,9 @@ public function getCustomLineItemId() } /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Value to set. + * Must not be empty. + * Can be a negative amount.

    * * * @return null|Money diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php index 9de14ea3c42..8b485e18764 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php @@ -18,12 +18,17 @@ interface StagedOrderChangeCustomLineItemQuantityAction extends StagedOrderUpdat public const FIELD_QUANTITY = 'quantity'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** + *

    New value to set. + * If 0, the Custom Line Item is removed from the Order.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php index f6229755ea8..1b3fef1541a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php @@ -35,6 +35,8 @@ final class StagedOrderChangeCustomLineItemQuantityActionBuilder implements Buil private $quantity; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -44,6 +46,9 @@ public function getCustomLineItemId() } /** + *

    New value to set. + * If 0, the Custom Line Item is removed from the Order.

    + * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php index bade52b5e26..07edb3fb033 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -91,6 +93,9 @@ public function getCustomLineItemId() } /** + *

    New value to set. + * If 0, the Custom Line Item is removed from the Order.

    + * * * @return null|int */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityAction.php index 77cf9f12648..71d7bcb90a2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityAction.php @@ -39,13 +39,17 @@ public function getLineItemId(); public function getLineItemKey(); /** + *

    New value to set. + * If 0, the LineItem is removed from the Order.

    + * * @return null|int */ public function getQuantity(); /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    + *

    The LineItem price is updated as described in LineItem Price selection.

    * * @return null|Money @@ -53,6 +57,8 @@ public function getQuantity(); public function getExternalPrice(); /** + *

    Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionBuilder.php index a30017c5896..de21e5624be 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionBuilder.php @@ -79,6 +79,9 @@ public function getLineItemKey() } /** + *

    New value to set. + * If 0, the LineItem is removed from the Order.

    + * * @return null|int */ @@ -88,7 +91,8 @@ public function getQuantity() } /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    + *

    The LineItem price is updated as described in LineItem Price selection.

    * * @return null|Money @@ -99,6 +103,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionModel.php index ccf70f7bca9..a0019183360 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeLineItemQuantityActionModel.php @@ -141,6 +141,9 @@ public function getLineItemKey() } /** + *

    New value to set. + * If 0, the LineItem is removed from the Order.

    + * * * @return null|int */ @@ -159,7 +162,8 @@ public function getQuantity() } /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Sets the LineItem price to the given value when changing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    + *

    The LineItem price is updated as described in LineItem Price selection.

    * * * @return null|Money @@ -180,6 +184,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when changing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateAction.php index befaea14785..2d6b92d7943 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateAction.php @@ -17,6 +17,8 @@ interface StagedOrderChangeOrderStateAction extends StagedOrderUpdateAction public const FIELD_ORDER_STATE = 'orderState'; /** + *

    New status of the Order.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionBuilder.php index 12529ee2979..9e1b6c02162 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionBuilder.php @@ -29,6 +29,8 @@ final class StagedOrderChangeOrderStateActionBuilder implements Builder private $orderState; /** + *

    New status of the Order.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionModel.php index e7ca59b3b8d..96e1ede61ba 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeOrderStateActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

    New status of the Order.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateAction.php index eedbbed6479..fd2b2819f3d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateAction.php @@ -17,6 +17,8 @@ interface StagedOrderChangePaymentStateAction extends StagedOrderUpdateAction public const FIELD_PAYMENT_STATE = 'paymentState'; /** + *

    New payment status of the Order.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionBuilder.php index 810264ddced..727b78e8ef6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionBuilder.php @@ -29,6 +29,8 @@ final class StagedOrderChangePaymentStateActionBuilder implements Builder private $paymentState; /** + *

    New payment status of the Order.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionModel.php index fbbb0e823dc..6da45db6a6a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangePaymentStateActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

    New payment status of the Order.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateAction.php index a8ca0162111..e227e2c0df4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateAction.php @@ -17,6 +17,8 @@ interface StagedOrderChangeShipmentStateAction extends StagedOrderUpdateAction public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** + *

    New shipment status of the Order.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionBuilder.php index 4792b02197c..126c72b8467 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionBuilder.php @@ -29,6 +29,8 @@ final class StagedOrderChangeShipmentStateActionBuilder implements Builder private $shipmentState; /** + *

    New shipment status of the Order.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionModel.php index 3603a158a7e..869c59d369c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeShipmentStateActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

    New shipment status of the Order.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php index 782d626f32b..4d83338b7a3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeAction.php @@ -17,7 +17,7 @@ interface StagedOrderChangeTaxCalculationModeAction extends StagedOrderUpdateAct public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; /** - *

    Determines in which Tax calculation mode taxed prices are calculated.

    + *

    New value to set.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php index 2cf2eed242c..b6366cde32c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionBuilder.php @@ -29,7 +29,7 @@ final class StagedOrderChangeTaxCalculationModeActionBuilder implements Builder private $taxCalculationMode; /** - *

    Determines in which Tax calculation mode taxed prices are calculated.

    + *

    New value to set.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php index 0acb6b71b37..51983ef3647 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxCalculationModeActionModel.php @@ -65,7 +65,7 @@ public function getAction() } /** - *

    Determines in which Tax calculation mode taxed prices are calculated.

    + *

    New value to set.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php index 04dd4a1befa..abba661c448 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeAction.php @@ -17,7 +17,7 @@ interface StagedOrderChangeTaxModeAction extends StagedOrderUpdateAction public const FIELD_TAX_MODE = 'taxMode'; /** - *

    Indicates how taxes are set on the Cart.

    + *

    The new TaxMode.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php index 80b68f8ae48..af43d1a2903 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionBuilder.php @@ -29,7 +29,7 @@ final class StagedOrderChangeTaxModeActionBuilder implements Builder private $taxMode; /** - *

    Indicates how taxes are set on the Cart.

    + *

    The new TaxMode.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php index 897d02b4b9b..f3bb0d0dc9a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxModeActionModel.php @@ -65,7 +65,7 @@ public function getAction() } /** - *

    Indicates how taxes are set on the Cart.

    + *

    The new TaxMode.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php index 851b04ab326..c52250475f6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeAction.php @@ -17,7 +17,7 @@ interface StagedOrderChangeTaxRoundingModeAction extends StagedOrderUpdateAction public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; /** - *

    Determines how monetary values are rounded.

    + *

    New value to set.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php index 12f4024f783..f1c4d98300a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionBuilder.php @@ -29,7 +29,7 @@ final class StagedOrderChangeTaxRoundingModeActionBuilder implements Builder private $taxRoundingMode; /** - *

    Determines how monetary values are rounded.

    + *

    New value to set.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php index 898e2f337b2..62321ae4f7e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeTaxRoundingModeActionModel.php @@ -65,7 +65,7 @@ public function getAction() } /** - *

    Determines how monetary values are rounded.

    + *

    New value to set.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php index 133dd1590c2..e40934c90ae 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php @@ -19,12 +19,16 @@ interface StagedOrderImportCustomLineItemStateAction extends StagedOrderUpdateAc public const FIELD_STATE = 'state'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** + *

    New status of the Custom Line Items.

    + * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php index 2429fb6e6d3..4b187ce393e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php @@ -36,6 +36,8 @@ final class StagedOrderImportCustomLineItemStateActionBuilder implements Builder private $state; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -45,6 +47,8 @@ public function getCustomLineItemId() } /** + *

    New status of the Custom Line Items.

    + * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php index a95a4e474f8..92794b02dec 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php @@ -74,6 +74,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -92,6 +94,8 @@ public function getCustomLineItemId() } /** + *

    New status of the Custom Line Items.

    + * * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php index b108d958047..2cf4ac3c145 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php @@ -19,12 +19,16 @@ interface StagedOrderImportLineItemStateAction extends StagedOrderUpdateAction public const FIELD_STATE = 'state'; /** + *

    id of the LineItem to update.

    + * * @return null|string */ public function getLineItemId(); /** + *

    New status of the Line Items.

    + * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php index 6cdc27fced5..822ca2a0bb0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php @@ -36,6 +36,8 @@ final class StagedOrderImportLineItemStateActionBuilder implements Builder private $state; /** + *

    id of the LineItem to update.

    + * * @return null|string */ @@ -45,6 +47,8 @@ public function getLineItemId() } /** + *

    New status of the Line Items.

    + * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php index 32e803b8110..aaf5c30e94d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php @@ -74,6 +74,8 @@ public function getAction() } /** + *

    id of the LineItem to update.

    + * * * @return null|string */ @@ -92,6 +94,8 @@ public function getLineItemId() } /** + *

    New status of the Line Items.

    + * * * @return null|ItemStateCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php index 30374bf9976..b6b0ffd5969 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderModel.php @@ -13,6 +13,7 @@ use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CartReferenceModel; use Commercetools\Api\Models\Cart\CustomLineItemCollection; +use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\DiscountCodeInfoCollection; use Commercetools\Api\Models\Cart\LineItemCollection; use Commercetools\Api\Models\Cart\ShippingCollection; @@ -86,39 +87,33 @@ final class StagedOrderModel extends JsonObjectModel implements StagedOrder /** * - * @var ?LastModifiedBy - */ - protected $lastModifiedBy; - - /** - * - * @var ?CreatedBy + * @var ?string */ - protected $createdBy; + protected $orderNumber; /** * - * @var ?DateTimeImmutable + * @var ?string */ - protected $completedAt; + protected $purchaseOrderNumber; /** * * @var ?string */ - protected $orderNumber; + protected $customerId; /** * * @var ?string */ - protected $customerId; + protected $customerEmail; /** * - * @var ?string + * @var ?CustomerGroupReference */ - protected $customerEmail; + protected $customerGroup; /** * @@ -170,123 +165,123 @@ final class StagedOrderModel extends JsonObjectModel implements StagedOrder /** * - * @var ?Address + * @var ?string */ - protected $shippingAddress; + protected $taxMode; /** * - * @var ?Address + * @var ?string */ - protected $billingAddress; + protected $taxRoundingMode; /** * * @var ?string */ - protected $shippingMode; + protected $taxCalculationMode; /** * * @var ?string */ - protected $shippingKey; + protected $inventoryMode; /** * - * @var ?CustomFields + * @var ?Address */ - protected $shippingCustomFields; + protected $billingAddress; /** * - * @var ?ShippingCollection + * @var ?Address */ - protected $shipping; + protected $shippingAddress; /** * * @var ?string */ - protected $taxMode; + protected $shippingMode; /** * * @var ?string */ - protected $taxRoundingMode; + protected $shippingKey; /** * - * @var ?CustomerGroupReference + * @var ?ShippingInfo */ - protected $customerGroup; + protected $shippingInfo; /** * - * @var ?string + * @var ?ShippingRateInput */ - protected $country; + protected $shippingRateInput; /** * - * @var ?string + * @var ?CustomFields */ - protected $orderState; + protected $shippingCustomFields; /** * - * @var ?StateReference + * @var ?ShippingCollection */ - protected $state; + protected $shipping; /** * - * @var ?string + * @var ?AddressCollection */ - protected $shipmentState; + protected $itemShippingAddresses; /** * - * @var ?string + * @var ?DiscountCodeInfoCollection */ - protected $paymentState; + protected $discountCodes; /** * - * @var ?ShippingInfo + * @var ?DirectDiscountCollection */ - protected $shippingInfo; + protected $directDiscounts; /** * - * @var ?SyncInfoCollection + * @var ?CartDiscountReferenceCollection */ - protected $syncInfo; + protected $refusedGifts; /** * - * @var ?ReturnInfoCollection + * @var ?PaymentInfo */ - protected $returnInfo; + protected $paymentInfo; /** * * @var ?string */ - protected $purchaseOrderNumber; + protected $country; /** * - * @var ?DiscountCodeInfoCollection + * @var ?string */ - protected $discountCodes; + protected $locale; /** - * @deprecated - * @var ?int + * + * @var ?string */ - protected $lastMessageSequenceNumber; + protected $origin; /** * @@ -302,57 +297,69 @@ final class StagedOrderModel extends JsonObjectModel implements StagedOrder /** * - * @var ?CustomFields + * @var ?string */ - protected $custom; + protected $orderState; /** * - * @var ?PaymentInfo + * @var ?string */ - protected $paymentInfo; + protected $shipmentState; /** * * @var ?string */ - protected $locale; + protected $paymentState; /** * - * @var ?string + * @var ?StateReference */ - protected $inventoryMode; + protected $state; /** * - * @var ?string + * @var ?SyncInfoCollection */ - protected $origin; + protected $syncInfo; /** * - * @var ?string + * @var ?ReturnInfoCollection */ - protected $taxCalculationMode; + protected $returnInfo; + + /** + * @deprecated + * @var ?int + */ + protected $lastMessageSequenceNumber; /** * - * @var ?ShippingRateInput + * @var ?CustomFields */ - protected $shippingRateInput; + protected $custom; /** * - * @var ?AddressCollection + * @var ?DateTimeImmutable */ - protected $itemShippingAddresses; + protected $completedAt; /** * - * @var ?CartDiscountReferenceCollection + * @var ?LastModifiedBy */ - protected $refusedGifts; + protected $lastModifiedBy; + + /** + * + * @var ?CreatedBy + */ + protected $createdBy; /** @@ -363,12 +370,11 @@ public function __construct( ?int $version = null, ?DateTimeImmutable $createdAt = null, ?DateTimeImmutable $lastModifiedAt = null, - ?LastModifiedBy $lastModifiedBy = null, - ?CreatedBy $createdBy = null, - ?DateTimeImmutable $completedAt = null, ?string $orderNumber = null, + ?string $purchaseOrderNumber = null, ?string $customerId = null, ?string $customerEmail = null, + ?CustomerGroupReference $customerGroup = null, ?string $anonymousId = null, ?BusinessUnitKeyReference $businessUnit = null, ?StoreKeyReference $store = null, @@ -377,48 +383,49 @@ public function __construct( ?TypedMoney $totalPrice = null, ?TaxedPrice $taxedPrice = null, ?TaxedPrice $taxedShippingPrice = null, - ?Address $shippingAddress = null, + ?string $taxMode = null, + ?string $taxRoundingMode = null, + ?string $taxCalculationMode = null, + ?string $inventoryMode = null, ?Address $billingAddress = null, + ?Address $shippingAddress = null, ?string $shippingMode = null, ?string $shippingKey = null, + ?ShippingInfo $shippingInfo = null, + ?ShippingRateInput $shippingRateInput = null, ?CustomFields $shippingCustomFields = null, ?ShippingCollection $shipping = null, - ?string $taxMode = null, - ?string $taxRoundingMode = null, - ?CustomerGroupReference $customerGroup = null, + ?AddressCollection $itemShippingAddresses = null, + ?DiscountCodeInfoCollection $discountCodes = null, + ?DirectDiscountCollection $directDiscounts = null, + ?CartDiscountReferenceCollection $refusedGifts = null, + ?PaymentInfo $paymentInfo = null, ?string $country = null, + ?string $locale = null, + ?string $origin = null, + ?CartReference $cart = null, + ?QuoteReference $quote = null, ?string $orderState = null, - ?StateReference $state = null, ?string $shipmentState = null, ?string $paymentState = null, - ?ShippingInfo $shippingInfo = null, + ?StateReference $state = null, ?SyncInfoCollection $syncInfo = null, ?ReturnInfoCollection $returnInfo = null, - ?string $purchaseOrderNumber = null, - ?DiscountCodeInfoCollection $discountCodes = null, ?int $lastMessageSequenceNumber = null, - ?CartReference $cart = null, - ?QuoteReference $quote = null, ?CustomFields $custom = null, - ?PaymentInfo $paymentInfo = null, - ?string $locale = null, - ?string $inventoryMode = null, - ?string $origin = null, - ?string $taxCalculationMode = null, - ?ShippingRateInput $shippingRateInput = null, - ?AddressCollection $itemShippingAddresses = null, - ?CartDiscountReferenceCollection $refusedGifts = null + ?DateTimeImmutable $completedAt = null, + ?LastModifiedBy $lastModifiedBy = null, + ?CreatedBy $createdBy = null ) { $this->id = $id; $this->version = $version; $this->createdAt = $createdAt; $this->lastModifiedAt = $lastModifiedAt; - $this->lastModifiedBy = $lastModifiedBy; - $this->createdBy = $createdBy; - $this->completedAt = $completedAt; $this->orderNumber = $orderNumber; + $this->purchaseOrderNumber = $purchaseOrderNumber; $this->customerId = $customerId; $this->customerEmail = $customerEmail; + $this->customerGroup = $customerGroup; $this->anonymousId = $anonymousId; $this->businessUnit = $businessUnit; $this->store = $store; @@ -427,37 +434,39 @@ public function __construct( $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; $this->taxedShippingPrice = $taxedShippingPrice; - $this->shippingAddress = $shippingAddress; + $this->taxMode = $taxMode; + $this->taxRoundingMode = $taxRoundingMode; + $this->taxCalculationMode = $taxCalculationMode; + $this->inventoryMode = $inventoryMode; $this->billingAddress = $billingAddress; + $this->shippingAddress = $shippingAddress; $this->shippingMode = $shippingMode; $this->shippingKey = $shippingKey; + $this->shippingInfo = $shippingInfo; + $this->shippingRateInput = $shippingRateInput; $this->shippingCustomFields = $shippingCustomFields; $this->shipping = $shipping; - $this->taxMode = $taxMode; - $this->taxRoundingMode = $taxRoundingMode; - $this->customerGroup = $customerGroup; + $this->itemShippingAddresses = $itemShippingAddresses; + $this->discountCodes = $discountCodes; + $this->directDiscounts = $directDiscounts; + $this->refusedGifts = $refusedGifts; + $this->paymentInfo = $paymentInfo; $this->country = $country; + $this->locale = $locale; + $this->origin = $origin; + $this->cart = $cart; + $this->quote = $quote; $this->orderState = $orderState; - $this->state = $state; $this->shipmentState = $shipmentState; $this->paymentState = $paymentState; - $this->shippingInfo = $shippingInfo; + $this->state = $state; $this->syncInfo = $syncInfo; $this->returnInfo = $returnInfo; - $this->purchaseOrderNumber = $purchaseOrderNumber; - $this->discountCodes = $discountCodes; $this->lastMessageSequenceNumber = $lastMessageSequenceNumber; - $this->cart = $cart; - $this->quote = $quote; $this->custom = $custom; - $this->paymentInfo = $paymentInfo; - $this->locale = $locale; - $this->inventoryMode = $inventoryMode; - $this->origin = $origin; - $this->taxCalculationMode = $taxCalculationMode; - $this->shippingRateInput = $shippingRateInput; - $this->itemShippingAddresses = $itemShippingAddresses; - $this->refusedGifts = $refusedGifts; + $this->completedAt = $completedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; } /** @@ -481,7 +490,7 @@ public function getId() } /** - *

    The current version of the order.

    + *

    Current version of the Order.

    * * * @return null|int @@ -501,6 +510,8 @@ public function getVersion() } /** + *

    Date and time (UTC) the Order was initially created.

    + * * * @return null|DateTimeImmutable */ @@ -523,6 +534,8 @@ public function getCreatedAt() } /** + *

    Date and time (UTC) the Order was last updated.

    + * * * @return null|DateTimeImmutable */ @@ -545,132 +558,110 @@ public function getLastModifiedAt() } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    User-defined identifier of the Order that is unique across a Project.

    * * - * @return null|LastModifiedBy + * @return null|string */ - public function getLastModifiedBy() + public function getOrderNumber() { - if (is_null($this->lastModifiedBy)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($this->orderNumber)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ORDER_NUMBER); if (is_null($data)) { return null; } - - $this->lastModifiedBy = LastModifiedByModel::of($data); + $this->orderNumber = (string) $data; } - return $this->lastModifiedBy; + return $this->orderNumber; } /** - *

    Present on resources created after 1 February 2019 except for events not tracked.

    + *

    User-defined identifier of a purchase Order.

    + *

    It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow.

    * * - * @return null|CreatedBy + * @return null|string */ - public function getCreatedBy() + public function getPurchaseOrderNumber() { - if (is_null($this->createdBy)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($this->purchaseOrderNumber)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PURCHASE_ORDER_NUMBER); if (is_null($data)) { return null; } - - $this->createdBy = CreatedByModel::of($data); + $this->purchaseOrderNumber = (string) $data; } - return $this->createdBy; + return $this->purchaseOrderNumber; } /** - *

    This field will only be present if it was set for Order Import

    + *

    id of the Customer that the Order belongs to.

    * * - * @return null|DateTimeImmutable + * @return null|string */ - public function getCompletedAt() + public function getCustomerId() { - if (is_null($this->completedAt)) { + if (is_null($this->customerId)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_COMPLETED_AT); + $data = $this->raw(self::FIELD_CUSTOMER_ID); if (is_null($data)) { return null; } - $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); - if (false === $data) { - return null; - } - $this->completedAt = $data; + $this->customerId = (string) $data; } - return $this->completedAt; + return $this->customerId; } /** - *

    String that uniquely identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique across a project. - * Once it's set it cannot be changed.

    + *

    Email address of the Customer that the Order belongs to.

    * * * @return null|string */ - public function getOrderNumber() + public function getCustomerEmail() { - if (is_null($this->orderNumber)) { + if (is_null($this->customerEmail)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ORDER_NUMBER); + $data = $this->raw(self::FIELD_CUSTOMER_EMAIL); if (is_null($data)) { return null; } - $this->orderNumber = (string) $data; + $this->customerEmail = (string) $data; } - return $this->orderNumber; + return $this->customerEmail; } /** + *

    Reference to the Customer Group of the Customer that the Order belongs to. + * Used for LineItem Price selection.

    * - * @return null|string - */ - public function getCustomerId() - { - if (is_null($this->customerId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_CUSTOMER_ID); - if (is_null($data)) { - return null; - } - $this->customerId = (string) $data; - } - - return $this->customerId; - } - - /** * - * @return null|string + * @return null|CustomerGroupReference */ - public function getCustomerEmail() + public function getCustomerGroup() { - if (is_null($this->customerEmail)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_CUSTOMER_EMAIL); + if (is_null($this->customerGroup)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP); if (is_null($data)) { return null; } - $this->customerEmail = (string) $data; + + $this->customerGroup = CustomerGroupReferenceModel::of($data); } - return $this->customerEmail; + return $this->customerGroup; } /** - *

    Identifies carts and orders belonging to an anonymous session (the customer has not signed up/in yet).

    + *

    Anonymous session associated with the Order.

    * * * @return null|string @@ -690,7 +681,7 @@ public function getAnonymousId() } /** - *

    The Business Unit the Order belongs to.

    + *

    Reference to a Business Unit the Order belongs to.

    * * * @return null|BusinessUnitKeyReference @@ -711,6 +702,8 @@ public function getBusinessUnit() } /** + *

    Reference to a Store the Order belongs to.

    + * * * @return null|StoreKeyReference */ @@ -730,6 +723,8 @@ public function getStore() } /** + *

    Line Items that are part of the Order.

    + * * * @return null|LineItemCollection */ @@ -748,6 +743,8 @@ public function getLineItems() } /** + *

    Custom Line Items that are part of the Order.

    + * * * @return null|CustomLineItemCollection */ @@ -766,6 +763,9 @@ public function getCustomLineItems() } /** + *

    Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo. + * Taxes are included if TaxRate includedInPrice is true for each price.

    + * * * @return null|TypedMoney */ @@ -785,7 +785,10 @@ public function getTotalPrice() } /** - *

    The taxes are calculated based on the shipping address.

    + *
      + *
    • For Platform TaxMode, it is automatically set when a shipping address is set.
    • + *
    • For External TaxMode, it is automatically set when the external Tax Rate for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.
    • + *
    * * * @return null|TaxedPrice @@ -806,8 +809,7 @@ public function getTaxedPrice() } /** - *

    Sum of taxedPrice of ShippingInfo across all Shipping Methods. - * For Platform TaxMode, it is set automatically only if shipping address is set or Shipping Method is added to the Cart.

    + *

    Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

    * * * @return null|TaxedPrice @@ -828,405 +830,427 @@ public function getTaxedShippingPrice() } /** - *

    Holds all shipping-related information per Shipping Method.

    - *

    For Multiple ShippingMode, it is updated automatically after the Shipping Methods are added.

    + *

    Indicates how Tax Rates are set.

    * * - * @return null|Address + * @return null|string */ - public function getShippingAddress() + public function getTaxMode() { - if (is_null($this->shippingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); + if (is_null($this->taxMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TAX_MODE); if (is_null($data)) { return null; } - - $this->shippingAddress = AddressModel::of($data); + $this->taxMode = (string) $data; } - return $this->shippingAddress; + return $this->taxMode; } /** + *

    Indicates how monetary values are rounded when calculating taxes for taxedPrice.

    * - * @return null|Address + * + * @return null|string */ - public function getBillingAddress() + public function getTaxRoundingMode() { - if (is_null($this->billingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_BILLING_ADDRESS); + if (is_null($this->taxRoundingMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE); if (is_null($data)) { return null; } - - $this->billingAddress = AddressModel::of($data); + $this->taxRoundingMode = (string) $data; } - return $this->billingAddress; + return $this->taxRoundingMode; } /** - *

    Indicates whether one or multiple Shipping Methods are added to the Cart.

    + *

    Indicates how taxes are calculated when calculating taxes for taxedPrice.

    * * * @return null|string */ - public function getShippingMode() + public function getTaxCalculationMode() { - if (is_null($this->shippingMode)) { + if (is_null($this->taxCalculationMode)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SHIPPING_MODE); + $data = $this->raw(self::FIELD_TAX_CALCULATION_MODE); if (is_null($data)) { return null; } - $this->shippingMode = (string) $data; + $this->taxCalculationMode = (string) $data; } - return $this->shippingMode; + return $this->taxCalculationMode; } /** - *

    key of the ShippingMethod for Single ShippingMode.

    + *

    Indicates how stock quantities are tracked for Line Items in the Order.

    * * * @return null|string */ - public function getShippingKey() + public function getInventoryMode() { - if (is_null($this->shippingKey)) { + if (is_null($this->inventoryMode)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SHIPPING_KEY); + $data = $this->raw(self::FIELD_INVENTORY_MODE); if (is_null($data)) { return null; } - $this->shippingKey = (string) $data; + $this->inventoryMode = (string) $data; } - return $this->shippingKey; + return $this->inventoryMode; } /** - *

    Custom Fields of the Shipping Method for Single ShippingMode.

    + *

    Billing address associated with the Order.

    * * - * @return null|CustomFields + * @return null|Address */ - public function getShippingCustomFields() + public function getBillingAddress() { - if (is_null($this->shippingCustomFields)) { + if (is_null($this->billingAddress)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_CUSTOM_FIELDS); + $data = $this->raw(self::FIELD_BILLING_ADDRESS); if (is_null($data)) { return null; } - $this->shippingCustomFields = CustomFieldsModel::of($data); + $this->billingAddress = AddressModel::of($data); } - return $this->shippingCustomFields; + return $this->billingAddress; } /** - *

    Holds all shipping-related information per Shipping Method for Multiple ShippingMode.

    - *

    It is updated automatically after the Shipping Method is added.

    + *

    Shipping address associated with the Order. + * Determines eligible ShippingMethod rates and Tax Rates of Line Items.

    * * - * @return null|ShippingCollection + * @return null|Address */ - public function getShipping() + public function getShippingAddress() { - if (is_null($this->shipping)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_SHIPPING); + if (is_null($this->shippingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); if (is_null($data)) { return null; } - $this->shipping = ShippingCollection::fromArray($data); + + $this->shippingAddress = AddressModel::of($data); } - return $this->shipping; + return $this->shippingAddress; } /** + *

    Indicates whether there can be one or multiple Shipping Methods.

    + * * * @return null|string */ - public function getTaxMode() + public function getShippingMode() { - if (is_null($this->taxMode)) { + if (is_null($this->shippingMode)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_MODE); + $data = $this->raw(self::FIELD_SHIPPING_MODE); if (is_null($data)) { return null; } - $this->taxMode = (string) $data; + $this->shippingMode = (string) $data; } - return $this->taxMode; + return $this->shippingMode; } /** - *

    When calculating taxes for taxedPrice, the selected mode is used for rouding.

    + *

    key of the ShippingMethod for Single ShippingMode.

    * * * @return null|string */ - public function getTaxRoundingMode() + public function getShippingKey() { - if (is_null($this->taxRoundingMode)) { + if (is_null($this->shippingKey)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE); + $data = $this->raw(self::FIELD_SHIPPING_KEY); if (is_null($data)) { return null; } - $this->taxRoundingMode = (string) $data; + $this->shippingKey = (string) $data; } - return $this->taxRoundingMode; + return $this->shippingKey; } /** - *

    Set when the customer is set and the customer is a member of a customer group. - * Used for product variant price selection.

    + *

    Shipping-related information for Single ShippingMode. + * Automatically set when a Shipping Method is set.

    * * - * @return null|CustomerGroupReference + * @return null|ShippingInfo */ - public function getCustomerGroup() + public function getShippingInfo() { - if (is_null($this->customerGroup)) { + if (is_null($this->shippingInfo)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOMER_GROUP); + $data = $this->raw(self::FIELD_SHIPPING_INFO); if (is_null($data)) { return null; } - $this->customerGroup = CustomerGroupReferenceModel::of($data); + $this->shippingInfo = ShippingInfoModel::of($data); } - return $this->customerGroup; + return $this->shippingInfo; } /** - *

    A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

    + *

    Input used to select a ShippingRatePriceTier. + * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    + * * * - * @return null|string + * @return null|ShippingRateInput */ - public function getCountry() + public function getShippingRateInput() { - if (is_null($this->country)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_COUNTRY); + if (is_null($this->shippingRateInput)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); if (is_null($data)) { return null; } - $this->country = (string) $data; + $className = ShippingRateInputModel::resolveDiscriminatorClass($data); + $this->shippingRateInput = $className::of($data); } - return $this->country; + return $this->shippingRateInput; } /** - *

    One of the four predefined OrderStates.

    + *

    Custom Fields of the Shipping Method for Single ShippingMode.

    * * - * @return null|string + * @return null|CustomFields */ - public function getOrderState() + public function getShippingCustomFields() { - if (is_null($this->orderState)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ORDER_STATE); + if (is_null($this->shippingCustomFields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SHIPPING_CUSTOM_FIELDS); if (is_null($data)) { return null; } - $this->orderState = (string) $data; + + $this->shippingCustomFields = CustomFieldsModel::of($data); } - return $this->orderState; + return $this->shippingCustomFields; } /** - *

    This reference can point to a state in a custom workflow.

    + *

    Shipping-related information for Multiple ShippingMode. + * Updated automatically each time a new Shipping Method is added.

    * * - * @return null|StateReference + * @return null|ShippingCollection */ - public function getState() + public function getShipping() { - if (is_null($this->state)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_STATE); + if (is_null($this->shipping)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SHIPPING); if (is_null($data)) { return null; } - - $this->state = StateReferenceModel::of($data); + $this->shipping = ShippingCollection::fromArray($data); } - return $this->state; + return $this->shipping; } /** + *

    Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. + * Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

    * - * @return null|string + * + * @return null|AddressCollection */ - public function getShipmentState() + public function getItemShippingAddresses() { - if (is_null($this->shipmentState)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SHIPMENT_STATE); + if (is_null($this->itemShippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); if (is_null($data)) { return null; } - $this->shipmentState = (string) $data; + $this->itemShippingAddresses = AddressCollection::fromArray($data); } - return $this->shipmentState; + return $this->itemShippingAddresses; } /** + *

    Discount Codes added to the Order. + * An Order that has directDiscounts cannot have discountCodes.

    * - * @return null|string + * + * @return null|DiscountCodeInfoCollection */ - public function getPaymentState() + public function getDiscountCodes() { - if (is_null($this->paymentState)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_PAYMENT_STATE); + if (is_null($this->discountCodes)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DISCOUNT_CODES); if (is_null($data)) { return null; } - $this->paymentState = (string) $data; + $this->discountCodes = DiscountCodeInfoCollection::fromArray($data); } - return $this->paymentState; + return $this->discountCodes; } /** - *

    Set if the ShippingMethod is set.

    + *

    Direct Discounts added to the Order. + * An Order that has discountCodes cannot have directDiscounts.

    * * - * @return null|ShippingInfo + * @return null|DirectDiscountCollection */ - public function getShippingInfo() + public function getDirectDiscounts() { - if (is_null($this->shippingInfo)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_INFO); + if (is_null($this->directDiscounts)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DIRECT_DISCOUNTS); if (is_null($data)) { return null; } - - $this->shippingInfo = ShippingInfoModel::of($data); + $this->directDiscounts = DirectDiscountCollection::fromArray($data); } - return $this->shippingInfo; + return $this->directDiscounts; } /** + *

    Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

    * - * @return null|SyncInfoCollection + * + * @return null|CartDiscountReferenceCollection */ - public function getSyncInfo() + public function getRefusedGifts() { - if (is_null($this->syncInfo)) { + if (is_null($this->refusedGifts)) { /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_SYNC_INFO); + $data = $this->raw(self::FIELD_REFUSED_GIFTS); if (is_null($data)) { return null; } - $this->syncInfo = SyncInfoCollection::fromArray($data); + $this->refusedGifts = CartDiscountReferenceCollection::fromArray($data); } - return $this->syncInfo; + return $this->refusedGifts; } /** + *

    Payment information related to the Order.

    * - * @return null|ReturnInfoCollection + * + * @return null|PaymentInfo */ - public function getReturnInfo() + public function getPaymentInfo() { - if (is_null($this->returnInfo)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_RETURN_INFO); + if (is_null($this->paymentInfo)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PAYMENT_INFO); if (is_null($data)) { return null; } - $this->returnInfo = ReturnInfoCollection::fromArray($data); + + $this->paymentInfo = PaymentInfoModel::of($data); } - return $this->returnInfo; + return $this->paymentInfo; } /** - *

    The Purchase Order Number is typically set by the Buyer on a QuoteRequest to - * track the purchase order during the quote and order flow.

    + *

    Used for LineItem Price selection.

    * * * @return null|string */ - public function getPurchaseOrderNumber() + public function getCountry() { - if (is_null($this->purchaseOrderNumber)) { + if (is_null($this->country)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_PURCHASE_ORDER_NUMBER); + $data = $this->raw(self::FIELD_COUNTRY); if (is_null($data)) { return null; } - $this->purchaseOrderNumber = (string) $data; + $this->country = (string) $data; } - return $this->purchaseOrderNumber; + return $this->country; } /** + *

    Languages of the Order. + * Can only contain languages supported by the Project.

    * - * @return null|DiscountCodeInfoCollection + * + * @return null|string */ - public function getDiscountCodes() + public function getLocale() { - if (is_null($this->discountCodes)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_DISCOUNT_CODES); + if (is_null($this->locale)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LOCALE); if (is_null($data)) { return null; } - $this->discountCodes = DiscountCodeInfoCollection::fromArray($data); + $this->locale = (string) $data; } - return $this->discountCodes; + return $this->locale; } /** - *

    Internal-only field.

    + *

    Indicates the origin of the Cart from which the Order was created.

    * - * @deprecated - * @return null|int + * + * @return null|string */ - public function getLastMessageSequenceNumber() + public function getOrigin() { - if (is_null($this->lastMessageSequenceNumber)) { - /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_LAST_MESSAGE_SEQUENCE_NUMBER); + if (is_null($this->origin)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ORIGIN); if (is_null($data)) { return null; } - $this->lastMessageSequenceNumber = (int) $data; + $this->origin = (string) $data; } - return $this->lastMessageSequenceNumber; + return $this->origin; } /** - *

    Set when this order was created from a cart. - * The cart will have the state Ordered.

    + *

    Reference to the Cart for an Order created from Cart. + * The referenced Cart will have the Ordered CartState.

    * * * @return null|CartReference @@ -1247,7 +1271,7 @@ public function getCart() } /** - *

    Set when this order was created from a quote.

    + *

    Reference to the Quote for an Order created from Quote.

    * * * @return null|QuoteReference @@ -1268,182 +1292,234 @@ public function getQuote() } /** + *

    Current status of the Order.

    * - * @return null|CustomFields + * + * @return null|string */ - public function getCustom() + public function getOrderState() { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($this->orderState)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ORDER_STATE); if (is_null($data)) { return null; } - - $this->custom = CustomFieldsModel::of($data); + $this->orderState = (string) $data; } - return $this->custom; + return $this->orderState; } /** + *

    Shipment status of the Order.

    * - * @return null|PaymentInfo + * + * @return null|string */ - public function getPaymentInfo() + public function getShipmentState() { - if (is_null($this->paymentInfo)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_PAYMENT_INFO); + if (is_null($this->shipmentState)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPMENT_STATE); if (is_null($data)) { return null; } - - $this->paymentInfo = PaymentInfoModel::of($data); + $this->shipmentState = (string) $data; } - return $this->paymentInfo; + return $this->shipmentState; } /** + *

    Payment status of the Order.

    + * * * @return null|string */ - public function getLocale() + public function getPaymentState() { - if (is_null($this->locale)) { + if (is_null($this->paymentState)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_LOCALE); + $data = $this->raw(self::FIELD_PAYMENT_STATE); if (is_null($data)) { return null; } - $this->locale = (string) $data; + $this->paymentState = (string) $data; } - return $this->locale; + return $this->paymentState; } /** + *

    State of the Order. + * This reference can point to a State in a custom workflow.

    * - * @return null|string + * + * @return null|StateReference */ - public function getInventoryMode() + public function getState() { - if (is_null($this->inventoryMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_INVENTORY_MODE); + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); if (is_null($data)) { return null; } - $this->inventoryMode = (string) $data; + + $this->state = StateReferenceModel::of($data); } - return $this->inventoryMode; + return $this->state; } /** + *

    Contains synchronization activity information of the Order (like export or import). + * Can only be set with Update SyncInfo update action.

    * - * @return null|string + * + * @return null|SyncInfoCollection */ - public function getOrigin() + public function getSyncInfo() { - if (is_null($this->origin)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ORIGIN); + if (is_null($this->syncInfo)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_SYNC_INFO); if (is_null($data)) { return null; } - $this->origin = (string) $data; + $this->syncInfo = SyncInfoCollection::fromArray($data); } - return $this->origin; + return $this->syncInfo; } /** - *

    When calculating taxes for taxedPrice, the selected mode is used for calculating the price with LineItemLevel (horizontally) or UnitPriceLevel (vertically) calculation mode.

    + *

    Contains information regarding the returns associated with the Order.

    * * - * @return null|string + * @return null|ReturnInfoCollection */ - public function getTaxCalculationMode() + public function getReturnInfo() { - if (is_null($this->taxCalculationMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_CALCULATION_MODE); + if (is_null($this->returnInfo)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_RETURN_INFO); if (is_null($data)) { return null; } - $this->taxCalculationMode = (string) $data; + $this->returnInfo = ReturnInfoCollection::fromArray($data); } - return $this->taxCalculationMode; + return $this->returnInfo; } /** - *

    Input used to select a ShippingRatePriceTier. - * The data type of this field depends on the shippingRateInputType.type configured in the Project:

    - * + *

    Internal-only field.

    * + * @deprecated + * @return null|int + */ + public function getLastMessageSequenceNumber() + { + if (is_null($this->lastMessageSequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_LAST_MESSAGE_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->lastMessageSequenceNumber = (int) $data; + } + + return $this->lastMessageSequenceNumber; + } + + /** + *

    Custom Fields of the Order.

    * - * @return null|ShippingRateInput + * + * @return null|CustomFields */ - public function getShippingRateInput() + public function getCustom() { - if (is_null($this->shippingRateInput)) { + if (is_null($this->custom)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_RATE_INPUT); + $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $className = ShippingRateInputModel::resolveDiscriminatorClass($data); - $this->shippingRateInput = $className::of($data); + + $this->custom = CustomFieldsModel::of($data); } - return $this->shippingRateInput; + return $this->custom; } /** - *

    Contains addresses for orders with multiple shipping addresses.

    + *

    User-defined date and time (UTC) of the Order. + * Present only on an Order created using Order Import.

    * * - * @return null|AddressCollection + * @return null|DateTimeImmutable */ - public function getItemShippingAddresses() + public function getCompletedAt() { - if (is_null($this->itemShippingAddresses)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); + if (is_null($this->completedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_COMPLETED_AT); if (is_null($data)) { return null; } - $this->itemShippingAddresses = AddressCollection::fromArray($data); + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->completedAt = $data; } - return $this->itemShippingAddresses; + return $this->completedAt; } /** - *

    Automatically filled when a line item with LineItemMode GiftLineItem is removed from this order.

    + *

    Present on resources created after 1 February 2019 except for events not tracked.

    * * - * @return null|CartDiscountReferenceCollection + * @return null|LastModifiedBy */ - public function getRefusedGifts() + public function getLastModifiedBy() { - if (is_null($this->refusedGifts)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_REFUSED_GIFTS); + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); if (is_null($data)) { return null; } - $this->refusedGifts = CartDiscountReferenceCollection::fromArray($data); + + $this->lastModifiedBy = LastModifiedByModel::of($data); } - return $this->refusedGifts; + return $this->lastModifiedBy; + } + + /** + *

    Present on resources created after 1 February 2019 except for events not tracked.

    + * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; } @@ -1480,35 +1556,19 @@ public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void } /** - * @param ?LastModifiedBy $lastModifiedBy - */ - public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void - { - $this->lastModifiedBy = $lastModifiedBy; - } - - /** - * @param ?CreatedBy $createdBy - */ - public function setCreatedBy(?CreatedBy $createdBy): void - { - $this->createdBy = $createdBy; - } - - /** - * @param ?DateTimeImmutable $completedAt + * @param ?string $orderNumber */ - public function setCompletedAt(?DateTimeImmutable $completedAt): void + public function setOrderNumber(?string $orderNumber): void { - $this->completedAt = $completedAt; + $this->orderNumber = $orderNumber; } /** - * @param ?string $orderNumber + * @param ?string $purchaseOrderNumber */ - public function setOrderNumber(?string $orderNumber): void + public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void { - $this->orderNumber = $orderNumber; + $this->purchaseOrderNumber = $purchaseOrderNumber; } /** @@ -1527,6 +1587,14 @@ public function setCustomerEmail(?string $customerEmail): void $this->customerEmail = $customerEmail; } + /** + * @param ?CustomerGroupReference $customerGroup + */ + public function setCustomerGroup(?CustomerGroupReference $customerGroup): void + { + $this->customerGroup = $customerGroup; + } + /** * @param ?string $anonymousId */ @@ -1592,163 +1660,163 @@ public function setTaxedShippingPrice(?TaxedPrice $taxedShippingPrice): void } /** - * @param ?Address $shippingAddress + * @param ?string $taxMode */ - public function setShippingAddress(?Address $shippingAddress): void + public function setTaxMode(?string $taxMode): void { - $this->shippingAddress = $shippingAddress; + $this->taxMode = $taxMode; } /** - * @param ?Address $billingAddress + * @param ?string $taxRoundingMode */ - public function setBillingAddress(?Address $billingAddress): void + public function setTaxRoundingMode(?string $taxRoundingMode): void { - $this->billingAddress = $billingAddress; + $this->taxRoundingMode = $taxRoundingMode; } /** - * @param ?string $shippingMode + * @param ?string $taxCalculationMode */ - public function setShippingMode(?string $shippingMode): void + public function setTaxCalculationMode(?string $taxCalculationMode): void { - $this->shippingMode = $shippingMode; + $this->taxCalculationMode = $taxCalculationMode; } /** - * @param ?string $shippingKey + * @param ?string $inventoryMode */ - public function setShippingKey(?string $shippingKey): void + public function setInventoryMode(?string $inventoryMode): void { - $this->shippingKey = $shippingKey; + $this->inventoryMode = $inventoryMode; } /** - * @param ?CustomFields $shippingCustomFields + * @param ?Address $billingAddress */ - public function setShippingCustomFields(?CustomFields $shippingCustomFields): void + public function setBillingAddress(?Address $billingAddress): void { - $this->shippingCustomFields = $shippingCustomFields; + $this->billingAddress = $billingAddress; } /** - * @param ?ShippingCollection $shipping + * @param ?Address $shippingAddress */ - public function setShipping(?ShippingCollection $shipping): void + public function setShippingAddress(?Address $shippingAddress): void { - $this->shipping = $shipping; + $this->shippingAddress = $shippingAddress; } /** - * @param ?string $taxMode + * @param ?string $shippingMode */ - public function setTaxMode(?string $taxMode): void + public function setShippingMode(?string $shippingMode): void { - $this->taxMode = $taxMode; + $this->shippingMode = $shippingMode; } /** - * @param ?string $taxRoundingMode + * @param ?string $shippingKey */ - public function setTaxRoundingMode(?string $taxRoundingMode): void + public function setShippingKey(?string $shippingKey): void { - $this->taxRoundingMode = $taxRoundingMode; + $this->shippingKey = $shippingKey; } /** - * @param ?CustomerGroupReference $customerGroup + * @param ?ShippingInfo $shippingInfo */ - public function setCustomerGroup(?CustomerGroupReference $customerGroup): void + public function setShippingInfo(?ShippingInfo $shippingInfo): void { - $this->customerGroup = $customerGroup; + $this->shippingInfo = $shippingInfo; } /** - * @param ?string $country + * @param ?ShippingRateInput $shippingRateInput */ - public function setCountry(?string $country): void + public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void { - $this->country = $country; + $this->shippingRateInput = $shippingRateInput; } /** - * @param ?string $orderState + * @param ?CustomFields $shippingCustomFields */ - public function setOrderState(?string $orderState): void + public function setShippingCustomFields(?CustomFields $shippingCustomFields): void { - $this->orderState = $orderState; + $this->shippingCustomFields = $shippingCustomFields; } /** - * @param ?StateReference $state + * @param ?ShippingCollection $shipping */ - public function setState(?StateReference $state): void + public function setShipping(?ShippingCollection $shipping): void { - $this->state = $state; + $this->shipping = $shipping; } /** - * @param ?string $shipmentState + * @param ?AddressCollection $itemShippingAddresses */ - public function setShipmentState(?string $shipmentState): void + public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void { - $this->shipmentState = $shipmentState; + $this->itemShippingAddresses = $itemShippingAddresses; } /** - * @param ?string $paymentState + * @param ?DiscountCodeInfoCollection $discountCodes */ - public function setPaymentState(?string $paymentState): void + public function setDiscountCodes(?DiscountCodeInfoCollection $discountCodes): void { - $this->paymentState = $paymentState; + $this->discountCodes = $discountCodes; } /** - * @param ?ShippingInfo $shippingInfo + * @param ?DirectDiscountCollection $directDiscounts */ - public function setShippingInfo(?ShippingInfo $shippingInfo): void + public function setDirectDiscounts(?DirectDiscountCollection $directDiscounts): void { - $this->shippingInfo = $shippingInfo; + $this->directDiscounts = $directDiscounts; } /** - * @param ?SyncInfoCollection $syncInfo + * @param ?CartDiscountReferenceCollection $refusedGifts */ - public function setSyncInfo(?SyncInfoCollection $syncInfo): void + public function setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts): void { - $this->syncInfo = $syncInfo; + $this->refusedGifts = $refusedGifts; } /** - * @param ?ReturnInfoCollection $returnInfo + * @param ?PaymentInfo $paymentInfo */ - public function setReturnInfo(?ReturnInfoCollection $returnInfo): void + public function setPaymentInfo(?PaymentInfo $paymentInfo): void { - $this->returnInfo = $returnInfo; + $this->paymentInfo = $paymentInfo; } /** - * @param ?string $purchaseOrderNumber + * @param ?string $country */ - public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void + public function setCountry(?string $country): void { - $this->purchaseOrderNumber = $purchaseOrderNumber; + $this->country = $country; } /** - * @param ?DiscountCodeInfoCollection $discountCodes + * @param ?string $locale */ - public function setDiscountCodes(?DiscountCodeInfoCollection $discountCodes): void + public function setLocale(?string $locale): void { - $this->discountCodes = $discountCodes; + $this->locale = $locale; } /** - * @param ?int $lastMessageSequenceNumber + * @param ?string $origin */ - public function setLastMessageSequenceNumber(?int $lastMessageSequenceNumber): void + public function setOrigin(?string $origin): void { - $this->lastMessageSequenceNumber = $lastMessageSequenceNumber; + $this->origin = $origin; } /** @@ -1768,75 +1836,91 @@ public function setQuote(?QuoteReference $quote): void } /** - * @param ?CustomFields $custom + * @param ?string $orderState */ - public function setCustom(?CustomFields $custom): void + public function setOrderState(?string $orderState): void { - $this->custom = $custom; + $this->orderState = $orderState; } /** - * @param ?PaymentInfo $paymentInfo + * @param ?string $shipmentState */ - public function setPaymentInfo(?PaymentInfo $paymentInfo): void + public function setShipmentState(?string $shipmentState): void { - $this->paymentInfo = $paymentInfo; + $this->shipmentState = $shipmentState; } /** - * @param ?string $locale + * @param ?string $paymentState */ - public function setLocale(?string $locale): void + public function setPaymentState(?string $paymentState): void { - $this->locale = $locale; + $this->paymentState = $paymentState; } /** - * @param ?string $inventoryMode + * @param ?StateReference $state */ - public function setInventoryMode(?string $inventoryMode): void + public function setState(?StateReference $state): void { - $this->inventoryMode = $inventoryMode; + $this->state = $state; } /** - * @param ?string $origin + * @param ?SyncInfoCollection $syncInfo */ - public function setOrigin(?string $origin): void + public function setSyncInfo(?SyncInfoCollection $syncInfo): void { - $this->origin = $origin; + $this->syncInfo = $syncInfo; } /** - * @param ?string $taxCalculationMode + * @param ?ReturnInfoCollection $returnInfo */ - public function setTaxCalculationMode(?string $taxCalculationMode): void + public function setReturnInfo(?ReturnInfoCollection $returnInfo): void { - $this->taxCalculationMode = $taxCalculationMode; + $this->returnInfo = $returnInfo; } /** - * @param ?ShippingRateInput $shippingRateInput + * @param ?int $lastMessageSequenceNumber */ - public function setShippingRateInput(?ShippingRateInput $shippingRateInput): void + public function setLastMessageSequenceNumber(?int $lastMessageSequenceNumber): void { - $this->shippingRateInput = $shippingRateInput; + $this->lastMessageSequenceNumber = $lastMessageSequenceNumber; } /** - * @param ?AddressCollection $itemShippingAddresses + * @param ?CustomFields $custom */ - public function setItemShippingAddresses(?AddressCollection $itemShippingAddresses): void + public function setCustom(?CustomFields $custom): void { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->custom = $custom; } /** - * @param ?CartDiscountReferenceCollection $refusedGifts + * @param ?DateTimeImmutable $completedAt */ - public function setRefusedGifts(?CartDiscountReferenceCollection $refusedGifts): void + public function setCompletedAt(?DateTimeImmutable $completedAt): void { - $this->refusedGifts = $refusedGifts; + $this->completedAt = $completedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php index a3b41650d9d..f0d25f5962f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php @@ -17,6 +17,8 @@ interface StagedOrderRemoveCustomLineItemAction extends StagedOrderUpdateAction public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; /** + *

    id of the Custom Line Item to remove.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php index 7cdf5120a39..ade405e1a10 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php @@ -29,6 +29,8 @@ final class StagedOrderRemoveCustomLineItemActionBuilder implements Builder private $customLineItemId; /** + *

    id of the Custom Line Item to remove.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php index 96207d0c035..5824e401a1c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

    id of the Custom Line Item to remove.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryAction.php index 084fabe0317..987cf0bafc0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryAction.php @@ -18,7 +18,8 @@ interface StagedOrderRemoveDeliveryAction extends StagedOrderUpdateAction public const FIELD_DELIVERY_KEY = 'deliveryKey'; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -26,7 +27,8 @@ interface StagedOrderRemoveDeliveryAction extends StagedOrderUpdateAction public function getDeliveryId(); /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionBuilder.php index 4bdebe45bbb..dfe24ef7af6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionBuilder.php @@ -35,7 +35,8 @@ final class StagedOrderRemoveDeliveryActionBuilder implements Builder private $deliveryKey; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -46,7 +47,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionModel.php index 78d139b4acf..8626b896e18 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDeliveryActionModel.php @@ -73,7 +73,8 @@ public function getAction() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -93,7 +94,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeAction.php index d46d3522624..82af1047675 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeAction.php @@ -18,7 +18,7 @@ interface StagedOrderRemoveDiscountCodeAction extends StagedOrderUpdateAction public const FIELD_DISCOUNT_CODE = 'discountCode'; /** - *

    Reference to a DiscountCode.

    + *

    Discount Code to remove from the Cart.

    * * @return null|DiscountCodeReference diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionBuilder.php index 28b4170d3e1..5c1e38204d3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionBuilder.php @@ -31,7 +31,7 @@ final class StagedOrderRemoveDiscountCodeActionBuilder implements Builder private $discountCode; /** - *

    Reference to a DiscountCode.

    + *

    Discount Code to remove from the Cart.

    * * @return null|DiscountCodeReference diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionModel.php index cc2c8078c51..411b9f47497 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveDiscountCodeActionModel.php @@ -67,7 +67,7 @@ public function getAction() } /** - *

    Reference to a DiscountCode.

    + *

    Discount Code to remove from the Cart.

    * * * @return null|DiscountCodeReference diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressAction.php index 8468d5d1e4b..3e6720ddf62 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressAction.php @@ -17,6 +17,8 @@ interface StagedOrderRemoveItemShippingAddressAction extends StagedOrderUpdateAc public const FIELD_ADDRESS_KEY = 'addressKey'; /** + *

    key of the Address to remove from itemShippingAddresses.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionBuilder.php index ce1cefe386f..0e2bed962e1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionBuilder.php @@ -29,6 +29,8 @@ final class StagedOrderRemoveItemShippingAddressActionBuilder implements Builder private $addressKey; /** + *

    key of the Address to remove from itemShippingAddresses.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionModel.php index 01e2cd4fa71..fdfcc64e5c2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveItemShippingAddressActionModel.php @@ -65,6 +65,8 @@ public function getAction() } /** + *

    key of the Address to remove from itemShippingAddresses.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php index 6ea6b315f3f..59e5b9fc212 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemAction.php @@ -41,13 +41,16 @@ public function getLineItemId(); public function getLineItemKey(); /** + *

    New value to set. + * If absent or 0, the Line Item is removed from the Cart.

    + * * @return null|int */ public function getQuantity(); /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Sets the LineItem price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -55,13 +58,15 @@ public function getQuantity(); public function getExternalPrice(); /** + *

    Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ public function getExternalTotalPrice(); /** - *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + *

    Container for Line Item-specific addresses to remove.

    * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php index d3ea48db9c4..b90505bc399 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionBuilder.php @@ -87,6 +87,9 @@ public function getLineItemKey() } /** + *

    New value to set. + * If absent or 0, the Line Item is removed from the Cart.

    + * * @return null|int */ @@ -96,7 +99,7 @@ public function getQuantity() } /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Sets the LineItem price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    * * @return null|Money @@ -107,6 +110,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * @return null|ExternalLineItemTotalPrice */ @@ -116,7 +121,7 @@ public function getExternalTotalPrice() } /** - *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + *

    Container for Line Item-specific addresses to remove.

    * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php index 01ba6586045..d6edf131ddb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveLineItemActionModel.php @@ -151,6 +151,9 @@ public function getLineItemKey() } /** + *

    New value to set. + * If absent or 0, the Line Item is removed from the Cart.

    + * * * @return null|int */ @@ -169,7 +172,7 @@ public function getQuantity() } /** - *

    Draft type that stores amounts only in cent precision for the specified currency.

    + *

    Sets the LineItem price to the given value when decreasing the quantity of a Line Item with the ExternalPrice LineItemPriceMode.

    * * * @return null|Money @@ -190,6 +193,8 @@ public function getExternalPrice() } /** + *

    Sets the LineItem price and totalPrice to the given value when decreasing the quantity of a Line Item with the ExternalTotal LineItemPriceMode.

    + * * * @return null|ExternalLineItemTotalPrice */ @@ -209,7 +214,7 @@ public function getExternalTotalPrice() } /** - *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + *

    Container for Line Item-specific addresses to remove.

    * * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryAction.php index ce310549d84..5b404b405f0 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryAction.php @@ -18,7 +18,8 @@ interface StagedOrderRemoveParcelFromDeliveryAction extends StagedOrderUpdateAct public const FIELD_PARCEL_KEY = 'parcelKey'; /** - *

    Either parcelId or parcelKey is required for this update action.

    + *

    id of an existing Parcel.

    + *

    Either parcelId or parcelKey must be provided.

    * * @return null|string @@ -26,7 +27,8 @@ interface StagedOrderRemoveParcelFromDeliveryAction extends StagedOrderUpdateAct public function getParcelId(); /** - *

    Either parcelId or parcelKey is required for this update action.

    + *

    key of an existing Parcel.

    + *

    Either parcelId or parcelKey must be provided.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionBuilder.php index e4865dabff6..7b963a706a5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionBuilder.php @@ -35,7 +35,8 @@ final class StagedOrderRemoveParcelFromDeliveryActionBuilder implements Builder private $parcelKey; /** - *

    Either parcelId or parcelKey is required for this update action.

    + *

    id of an existing Parcel.

    + *

    Either parcelId or parcelKey must be provided.

    * * @return null|string @@ -46,7 +47,8 @@ public function getParcelId() } /** - *

    Either parcelId or parcelKey is required for this update action.

    + *

    key of an existing Parcel.

    + *

    Either parcelId or parcelKey must be provided.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionModel.php index 490dafcec23..14752e82d27 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveParcelFromDeliveryActionModel.php @@ -73,7 +73,8 @@ public function getAction() } /** - *

    Either parcelId or parcelKey is required for this update action.

    + *

    id of an existing Parcel.

    + *

    Either parcelId or parcelKey must be provided.

    * * * @return null|string @@ -93,7 +94,8 @@ public function getParcelId() } /** - *

    Either parcelId or parcelKey is required for this update action.

    + *

    key of an existing Parcel.

    + *

    Either parcelId or parcelKey must be provided.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentAction.php index 560e2d22c3c..0aee3ac78ed 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentAction.php @@ -18,7 +18,7 @@ interface StagedOrderRemovePaymentAction extends StagedOrderUpdateAction public const FIELD_PAYMENT = 'payment'; /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to remove from the PaymentInfo.

    * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionBuilder.php index c1040f75c88..36e458982ae 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionBuilder.php @@ -31,7 +31,7 @@ final class StagedOrderRemovePaymentActionBuilder implements Builder private $payment; /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to remove from the PaymentInfo.

    * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionModel.php index e02c26292c5..ae0cf496d6e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemovePaymentActionModel.php @@ -67,7 +67,7 @@ public function getAction() } /** - *

    ResourceIdentifier of a Payment.

    + *

    Payment to remove from the PaymentInfo.

    * * * @return null|PaymentResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php index 278ec8be282..7dc642dbce2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressAction.php @@ -18,9 +18,8 @@ interface StagedOrderSetBillingAddressAction extends StagedOrderUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php index 813cdeea9cd..8d740ff8c07 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionBuilder.php @@ -31,9 +31,8 @@ final class StagedOrderSetBillingAddressActionBuilder implements Builder private $address; /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php index 29b4b9df4b1..5a1cfe30625 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetBillingAddressActionModel.php @@ -67,9 +67,8 @@ public function getAction() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryAction.php index 933a734a5a4..6a3ac073ae6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryAction.php @@ -17,6 +17,11 @@ interface StagedOrderSetCountryAction extends StagedOrderUpdateAction public const FIELD_COUNTRY = 'country'; /** + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the Cart is bound to a store, the provided value must be included in the Store's countries. + * Otherwise a CountryNotConfiguredInStore error is returned.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionBuilder.php index 6764c6f271b..8a1a2ba7149 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionBuilder.php @@ -29,6 +29,11 @@ final class StagedOrderSetCountryActionBuilder implements Builder private $country; /** + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the Cart is bound to a store, the provided value must be included in the Store's countries. + * Otherwise a CountryNotConfiguredInStore error is returned.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionModel.php index a3dc26781e9..ab2d2e41da5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCountryActionModel.php @@ -65,6 +65,11 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + *

    If the Cart is bound to a store, the provided value must be included in the Store's countries. + * Otherwise a CountryNotConfiguredInStore error is returned.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php index 54d3b908617..044c5776ad7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php @@ -19,6 +19,8 @@ interface StagedOrderSetCustomLineItemCustomFieldAction extends StagedOrderUpdat public const FIELD_VALUE = 'value'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php index f527ccdbdc9..4e5cd02538d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php @@ -41,6 +41,8 @@ final class StagedOrderSetCustomLineItemCustomFieldActionBuilder implements Buil private $value; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php index e9c738fb624..3b6b5636787 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php @@ -81,6 +81,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php index 4d784087a47..bb143a0e3ec 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php @@ -21,14 +21,16 @@ interface StagedOrderSetCustomLineItemCustomTypeAction extends StagedOrderUpdate public const FIELD_FIELDS = 'fields'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** - *

    Defines the Type that extends the CustomLineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

    + *

    Defines the Type that extends the Custom Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

    * * @return null|TypeResourceIdentifier @@ -36,7 +38,7 @@ public function getCustomLineItemId(); public function getType(); /** - *

    Sets the Custom Fields fields for the CustomLineItem.

    + *

    Sets the Custom Fields fields for the Custom Line Item.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php index d619022600d..6ac9ddb09bd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php @@ -45,6 +45,8 @@ final class StagedOrderSetCustomLineItemCustomTypeActionBuilder implements Build private $fields; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -54,8 +56,8 @@ public function getCustomLineItemId() } /** - *

    Defines the Type that extends the CustomLineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

    + *

    Defines the Type that extends the Custom Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

    * * @return null|TypeResourceIdentifier @@ -66,7 +68,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the CustomLineItem.

    + *

    Sets the Custom Fields fields for the Custom Line Item.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php index c47a0d3c494..dbffc0a9e97 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php @@ -85,6 +85,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -103,8 +105,8 @@ public function getCustomLineItemId() } /** - *

    Defines the Type that extends the CustomLineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

    + *

    Defines the Type that extends the Custom Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

    * * * @return null|TypeResourceIdentifier @@ -125,7 +127,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the CustomLineItem.

    + *

    Sets the Custom Fields fields for the Custom Line Item.

    * * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php index 0c699fa4aa2..c689fd3db61 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php @@ -19,13 +19,16 @@ interface StagedOrderSetCustomLineItemShippingDetailsAction extends StagedOrderU public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** - *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php index 5762f34ffd1..76cf041d506 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php @@ -37,6 +37,8 @@ final class StagedOrderSetCustomLineItemShippingDetailsActionBuilder implements private $shippingDetails; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -46,7 +48,8 @@ public function getCustomLineItemId() } /** - *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php index 75936345cc9..f583b723dba 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php @@ -75,6 +75,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -93,7 +95,8 @@ public function getCustomLineItemId() } /** - *

    For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php index 0f462bf11b1..bf4900678a1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php @@ -19,18 +19,16 @@ interface StagedOrderSetCustomLineItemTaxAmountAction extends StagedOrderUpdateA public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** - *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    - *

    Can only be set by these update actions:

    - * + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|ExternalTaxAmountDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php index c2adfbe494d..2b669cfcf8f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php @@ -37,6 +37,8 @@ final class StagedOrderSetCustomLineItemTaxAmountActionBuilder implements Builde private $externalTaxAmount; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -46,12 +48,8 @@ public function getCustomLineItemId() } /** - *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    - *

    Can only be set by these update actions:

    - * + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|ExternalTaxAmountDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php index 34e7133f119..5e72d851391 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php @@ -75,6 +75,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -93,12 +95,8 @@ public function getCustomLineItemId() } /** - *

    Cannot be used in LineItemDraft or CustomLineItemDraft.

    - *

    Can only be set by these update actions:

    - * + *

    Value to set. + * If empty, any existing value is removed.

    * * * @return null|ExternalTaxAmountDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php index 3a8855ec3d5..7935559056a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php @@ -19,13 +19,16 @@ interface StagedOrderSetCustomLineItemTaxRateAction extends StagedOrderUpdateAct public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ public function getCustomLineItemId(); /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + *

    Value to set. + * If empty, an existing value is removed.

    * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php index b4c623143ce..0d3f65b33d8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php @@ -37,6 +37,8 @@ final class StagedOrderSetCustomLineItemTaxRateActionBuilder implements Builder private $externalTaxRate; /** + *

    id of the CustomLineItem to update.

    + * * @return null|string */ @@ -46,7 +48,8 @@ public function getCustomLineItemId() } /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + *

    Value to set. + * If empty, an existing value is removed.

    * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php index 92760105b66..9bd06c69556 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php @@ -75,6 +75,8 @@ public function getAction() } /** + *

    id of the CustomLineItem to update.

    + * * * @return null|string */ @@ -93,7 +95,8 @@ public function getCustomLineItemId() } /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + *

    Value to set. + * If empty, an existing value is removed.

    * * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php index f1c78a539d5..ed47c74f202 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodAction.php @@ -23,19 +23,23 @@ interface StagedOrderSetCustomShippingMethodAction extends StagedOrderUpdateActi public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** + *

    Name of the custom Shipping Method.

    + * * @return null|string */ public function getShippingMethodName(); /** + *

    Determines the shipping price.

    + * * @return null|ShippingRateDraft */ public function getShippingRate(); /** - *

    ResourceIdentifier to a TaxCategory.

    + *

    Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

    * * @return null|TaxCategoryResourceIdentifier @@ -43,7 +47,7 @@ public function getShippingRate(); public function getTaxCategory(); /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + *

    External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

    * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php index ab88ccb6a01..7220586a5a7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionBuilder.php @@ -53,6 +53,8 @@ final class StagedOrderSetCustomShippingMethodActionBuilder implements Builder private $externalTaxRate; /** + *

    Name of the custom Shipping Method.

    + * * @return null|string */ @@ -62,6 +64,8 @@ public function getShippingMethodName() } /** + *

    Determines the shipping price.

    + * * @return null|ShippingRateDraft */ @@ -71,7 +75,7 @@ public function getShippingRate() } /** - *

    ResourceIdentifier to a TaxCategory.

    + *

    Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

    * * @return null|TaxCategoryResourceIdentifier @@ -82,7 +86,7 @@ public function getTaxCategory() } /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + *

    External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

    * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php index b7e362cc062..9734cfeca2b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomShippingMethodActionModel.php @@ -95,6 +95,8 @@ public function getAction() } /** + *

    Name of the custom Shipping Method.

    + * * * @return null|string */ @@ -113,6 +115,8 @@ public function getShippingMethodName() } /** + *

    Determines the shipping price.

    + * * * @return null|ShippingRateDraft */ @@ -132,7 +136,7 @@ public function getShippingRate() } /** - *

    ResourceIdentifier to a TaxCategory.

    + *

    Tax Category used to determine the Tax Rate when the Cart has the Platform TaxMode.

    * * * @return null|TaxCategoryResourceIdentifier @@ -153,7 +157,7 @@ public function getTaxCategory() } /** - *

    Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

    + *

    External Tax Rate for the shippingRate to be set if the Cart has the External TaxMode.

    * * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeAction.php index 72e210b89ad..f1db9ddd26a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeAction.php @@ -20,8 +20,8 @@ interface StagedOrderSetCustomTypeAction extends StagedOrderUpdateAction public const FIELD_FIELDS = 'fields'; /** - *

    Defines the Type that extends the StagedOrder with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the StagedOrder.

    + *

    Defines the Type that extends the Order Edit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Order Edit.

    * * @return null|TypeResourceIdentifier @@ -29,7 +29,7 @@ interface StagedOrderSetCustomTypeAction extends StagedOrderUpdateAction public function getType(); /** - *

    Sets the Custom Fields fields for the StagedOrder.

    + *

    Sets the Custom Fields fields for the Order Edit.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionBuilder.php index aa0ce7e9adc..eb751a13675 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionBuilder.php @@ -39,8 +39,8 @@ final class StagedOrderSetCustomTypeActionBuilder implements Builder private $fields; /** - *

    Defines the Type that extends the StagedOrder with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the StagedOrder.

    + *

    Defines the Type that extends the Order Edit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Order Edit.

    * * @return null|TypeResourceIdentifier @@ -51,7 +51,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the StagedOrder.

    + *

    Sets the Custom Fields fields for the Order Edit.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionModel.php index bc3d6f4df33..38f90911b14 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomTypeActionModel.php @@ -77,8 +77,8 @@ public function getAction() } /** - *

    Defines the Type that extends the StagedOrder with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the StagedOrder.

    + *

    Defines the Type that extends the Order Edit with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Order Edit.

    * * * @return null|TypeResourceIdentifier @@ -99,7 +99,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the StagedOrder.

    + *

    Sets the Custom Fields fields for the Order Edit.

    * * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailAction.php index 0ddafed255a..ec4f4d49693 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailAction.php @@ -17,6 +17,9 @@ interface StagedOrderSetCustomerEmailAction extends StagedOrderUpdateAction public const FIELD_EMAIL = 'email'; /** + *

    Value to set. + * If empty, any existing value will be removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionBuilder.php index b302f879ebd..5a59cf4453a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionBuilder.php @@ -29,6 +29,9 @@ final class StagedOrderSetCustomerEmailActionBuilder implements Builder private $email; /** + *

    Value to set. + * If empty, any existing value will be removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionModel.php index 9b314e4ca11..f19c8698f96 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerEmailActionModel.php @@ -65,6 +65,9 @@ public function getAction() } /** + *

    Value to set. + * If empty, any existing value will be removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupAction.php index 44bbc16cb3e..4408a3fa31f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupAction.php @@ -18,7 +18,8 @@ interface StagedOrderSetCustomerGroupAction extends StagedOrderUpdateAction public const FIELD_CUSTOMER_GROUP = 'customerGroup'; /** - *

    ResourceIdentifier to a CustomerGroup.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|CustomerGroupResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionBuilder.php index 0b3eccd0a0b..6c6b91b5d82 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionBuilder.php @@ -31,7 +31,8 @@ final class StagedOrderSetCustomerGroupActionBuilder implements Builder private $customerGroup; /** - *

    ResourceIdentifier to a CustomerGroup.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * @return null|CustomerGroupResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionModel.php index 7a742a8fc16..160b36b5a6e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerGroupActionModel.php @@ -67,7 +67,8 @@ public function getAction() } /** - *

    ResourceIdentifier to a CustomerGroup.

    + *

    Value to set. + * If empty, any existing value is removed.

    * * * @return null|CustomerGroupResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdAction.php index 4d4b1e5f93e..3fa6bdf502f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdAction.php @@ -17,6 +17,9 @@ interface StagedOrderSetCustomerIdAction extends StagedOrderUpdateAction public const FIELD_CUSTOMER_ID = 'customerId'; /** + *

    id of an existing Customer. + * If empty, any existing value is removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionBuilder.php index 8999edfe8ff..fbc469e58af 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionBuilder.php @@ -29,6 +29,9 @@ final class StagedOrderSetCustomerIdActionBuilder implements Builder private $customerId; /** + *

    id of an existing Customer. + * If empty, any existing value is removed.

    + * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionModel.php index d2f193fc12c..dc5500aab3b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomerIdActionModel.php @@ -65,6 +65,9 @@ public function getAction() } /** + *

    id of an existing Customer. + * If empty, any existing value is removed.

    + * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php index 9336a9b8322..5c3322513e5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressAction.php @@ -20,7 +20,8 @@ interface StagedOrderSetDeliveryAddressAction extends StagedOrderUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -28,7 +29,8 @@ interface StagedOrderSetDeliveryAddressAction extends StagedOrderUpdateAction public function getDeliveryId(); /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -36,9 +38,8 @@ public function getDeliveryId(); public function getDeliveryKey(); /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If empty, any existing value will be removed.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php index 1d7ade11632..4651d4af85a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionBuilder.php @@ -43,7 +43,8 @@ final class StagedOrderSetDeliveryAddressActionBuilder implements Builder private $address; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -54,7 +55,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -65,9 +67,8 @@ public function getDeliveryKey() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If empty, any existing value will be removed.

    * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php index f0cf3a918ec..1e5868ecc54 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressActionModel.php @@ -83,7 +83,8 @@ public function getAction() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -103,7 +104,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -123,9 +125,8 @@ public function getDeliveryKey() } /** - *

    Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

    + *

    Value to set. + * If empty, any existing value will be removed.

    * * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldAction.php index c7094e09f9c..34368defaf7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldAction.php @@ -20,7 +20,8 @@ interface StagedOrderSetDeliveryAddressCustomFieldAction extends StagedOrderUpda public const FIELD_VALUE = 'value'; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -28,7 +29,8 @@ interface StagedOrderSetDeliveryAddressCustomFieldAction extends StagedOrderUpda public function getDeliveryId(); /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionBuilder.php index f12c809ab47..f9d761437ca 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionBuilder.php @@ -47,7 +47,8 @@ final class StagedOrderSetDeliveryAddressCustomFieldActionBuilder implements Bui private $value; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -58,7 +59,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionModel.php index 3a60eb3650f..4a54b3a7739 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomFieldActionModel.php @@ -89,7 +89,8 @@ public function getAction() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -109,7 +110,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeAction.php index 70f97cbde2a..7cd2834869a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeAction.php @@ -22,7 +22,8 @@ interface StagedOrderSetDeliveryAddressCustomTypeAction extends StagedOrderUpdat public const FIELD_FIELDS = 'fields'; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -30,7 +31,8 @@ interface StagedOrderSetDeliveryAddressCustomTypeAction extends StagedOrderUpdat public function getDeliveryId(); /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -38,8 +40,8 @@ public function getDeliveryId(); public function getDeliveryKey(); /** - *

    Defines the Type that extends the address in a Delivery with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    + *

    Defines the Type that extends the Delivery address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Delivery address.

    * * @return null|TypeResourceIdentifier @@ -47,7 +49,7 @@ public function getDeliveryKey(); public function getType(); /** - *

    Sets the Custom Fields fields for the address in a Delivery.

    + *

    Sets the Custom Fields fields for the Delivery address.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionBuilder.php index 88ac8d4b2b6..2daf71363f4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionBuilder.php @@ -51,7 +51,8 @@ final class StagedOrderSetDeliveryAddressCustomTypeActionBuilder implements Buil private $fields; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -62,7 +63,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -73,8 +75,8 @@ public function getDeliveryKey() } /** - *

    Defines the Type that extends the address in a Delivery with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    + *

    Defines the Type that extends the Delivery address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Delivery address.

    * * @return null|TypeResourceIdentifier @@ -85,7 +87,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the address in a Delivery.

    + *

    Sets the Custom Fields fields for the Delivery address.

    * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionModel.php index 529aaf6b1f9..cb6f8edb831 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryAddressCustomTypeActionModel.php @@ -93,7 +93,8 @@ public function getAction() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -113,7 +114,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -133,8 +135,8 @@ public function getDeliveryKey() } /** - *

    Defines the Type that extends the address in a Delivery with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the address in a Delivery.

    + *

    Defines the Type that extends the Delivery address with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Delivery address.

    * * * @return null|TypeResourceIdentifier @@ -155,7 +157,7 @@ public function getType() } /** - *

    Sets the Custom Fields fields for the address in a Delivery.

    + *

    Sets the Custom Fields fields for the Delivery address.

    * * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldAction.php index 4b6eb99bd19..210107951ad 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldAction.php @@ -20,7 +20,8 @@ interface StagedOrderSetDeliveryCustomFieldAction extends StagedOrderUpdateActio public const FIELD_VALUE = 'value'; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -28,7 +29,8 @@ interface StagedOrderSetDeliveryCustomFieldAction extends StagedOrderUpdateActio public function getDeliveryId(); /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionBuilder.php index 5b80ca2b113..82777d47f96 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionBuilder.php @@ -47,7 +47,8 @@ final class StagedOrderSetDeliveryCustomFieldActionBuilder implements Builder private $value; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -58,7 +59,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionModel.php index e8699e130eb..4c9a35733be 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomFieldActionModel.php @@ -89,7 +89,8 @@ public function getAction() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -109,7 +110,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeAction.php index e818f04cf6e..4a398d20146 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeAction.php @@ -22,7 +22,8 @@ interface StagedOrderSetDeliveryCustomTypeAction extends StagedOrderUpdateAction public const FIELD_FIELDS = 'fields'; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -30,7 +31,8 @@ interface StagedOrderSetDeliveryCustomTypeAction extends StagedOrderUpdateAction public function getDeliveryId(); /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionBuilder.php index 9e9dbde0631..36b3611b696 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionBuilder.php @@ -51,7 +51,8 @@ final class StagedOrderSetDeliveryCustomTypeActionBuilder implements Builder private $fields; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -62,7 +63,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionModel.php index 7dae66082c3..89dc67fc3bc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryCustomTypeActionModel.php @@ -93,7 +93,8 @@ public function getAction() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -113,7 +114,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsAction.php index 6014a9f2ef4..539350828d8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsAction.php @@ -20,7 +20,8 @@ interface StagedOrderSetDeliveryItemsAction extends StagedOrderUpdateAction public const FIELD_ITEMS = 'items'; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -28,7 +29,8 @@ interface StagedOrderSetDeliveryItemsAction extends StagedOrderUpdateAction public function getDeliveryId(); /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -36,6 +38,9 @@ public function getDeliveryId(); public function getDeliveryKey(); /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionBuilder.php index a7ced5f4223..0cff4ff5e0f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionBuilder.php @@ -42,7 +42,8 @@ final class StagedOrderSetDeliveryItemsActionBuilder implements Builder private $items; /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -53,7 +54,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * @return null|string @@ -64,6 +66,9 @@ public function getDeliveryKey() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionModel.php index 7b078ce481b..77306567517 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDeliveryItemsActionModel.php @@ -82,7 +82,8 @@ public function getAction() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    id of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -102,7 +103,8 @@ public function getDeliveryId() } /** - *

    Either deliveryId or deliveryKey is required for this update action.

    + *

    key of an existing Delivery.

    + *

    Either deliveryId or deliveryKey must be provided.

    * * * @return null|string @@ -122,6 +124,9 @@ public function getDeliveryKey() } /** + *

    Value to set. + * If empty, any existing value is removed.

    + * * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsAction.php new file mode 100644 index 00000000000..75844f74496 --- /dev/null +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsAction.php @@ -0,0 +1,36 @@ + + *
  • If set, all existing Direct Discounts are replaced. + * The discounts apply in the order they are added to the list.
  • + *
  • If empty, all existing Direct Discounts are removed and all affected prices on the Order are recalculated.
  • + *
+ * + + * @return null|DirectDiscountDraftCollection + */ + public function getDiscounts(); + + /** + * @param ?DirectDiscountDraftCollection $discounts + */ + public function setDiscounts(?DirectDiscountDraftCollection $discounts): void; +} diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionBuilder.php new file mode 100644 index 00000000000..bffc72f8333 --- /dev/null +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionBuilder.php @@ -0,0 +1,70 @@ + + */ +final class StagedOrderSetDirectDiscountsActionBuilder implements Builder +{ + /** + + * @var ?DirectDiscountDraftCollection + */ + private $discounts; + + /** + *
    + *
  • If set, all existing Direct Discounts are replaced. + * The discounts apply in the order they are added to the list.
  • + *
  • If empty, all existing Direct Discounts are removed and all affected prices on the Order are recalculated.
  • + *
+ * + + * @return null|DirectDiscountDraftCollection + */ + public function getDiscounts() + { + return $this->discounts; + } + + /** + * @param ?DirectDiscountDraftCollection $discounts + * @return $this + */ + public function withDiscounts(?DirectDiscountDraftCollection $discounts) + { + $this->discounts = $discounts; + + return $this; + } + + + public function build(): StagedOrderSetDirectDiscountsAction + { + return new StagedOrderSetDirectDiscountsActionModel( + $this->discounts + ); + } + + public static function of(): StagedOrderSetDirectDiscountsActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionCollection.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionCollection.php new file mode 100644 index 00000000000..099a8368490 --- /dev/null +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionCollection.php @@ -0,0 +1,56 @@ + + * @method StagedOrderSetDirectDiscountsAction current() + * @method StagedOrderSetDirectDiscountsAction end() + * @method StagedOrderSetDirectDiscountsAction at($offset) + */ +class StagedOrderSetDirectDiscountsActionCollection extends StagedOrderUpdateActionCollection +{ + /** + * @psalm-assert StagedOrderSetDirectDiscountsAction $value + * @psalm-param StagedOrderSetDirectDiscountsAction|stdClass $value + * @throws InvalidArgumentException + * + * @return StagedOrderSetDirectDiscountsActionCollection + */ + public function add($value) + { + if (!$value instanceof StagedOrderSetDirectDiscountsAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StagedOrderSetDirectDiscountsAction + */ + protected function mapper() + { + return function (?int $index): ?StagedOrderSetDirectDiscountsAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StagedOrderSetDirectDiscountsAction $data */ + $data = StagedOrderSetDirectDiscountsActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionModel.php new file mode 100644 index 00000000000..6ffc0b135ca --- /dev/null +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetDirectDiscountsActionModel.php @@ -0,0 +1,100 @@ +discounts = $discounts; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *
    + *
  • If set, all existing Direct Discounts are replaced. + * The discounts apply in the order they are added to the list.
  • + *
  • If empty, all existing Direct Discounts are removed and all affected prices on the Order are recalculated.
  • + *
+ * + * + * @return null|DirectDiscountDraftCollection + */ + public function getDiscounts() + { + if (is_null($this->discounts)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_DISCOUNTS); + if (is_null($data)) { + return null; + } + $this->discounts = DirectDiscountDraftCollection::fromArray($data); + } + + return $this->discounts; + } + + + /** + * @param ?DirectDiscountDraftCollection $discounts + */ + public function setDiscounts(?DirectDiscountDraftCollection $discounts): void + { + $this->discounts = $discounts; + } +} diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldAction.php index 3a3e0e87dbc..e2974122969 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldAction.php @@ -19,6 +19,8 @@ interface StagedOrderSetItemShippingAddressCustomFieldAction extends StagedOrder public const FIELD_VALUE = 'value'; /** + *

key of the Address in itemShippingAddresses.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionBuilder.php index 817fa0f6319..b14db7ba4d5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionBuilder.php @@ -41,6 +41,8 @@ final class StagedOrderSetItemShippingAddressCustomFieldActionBuilder implements private $value; /** + *

key of the Address in itemShippingAddresses.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionModel.php index 82c31bb8f70..6e8da82a992 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomFieldActionModel.php @@ -81,6 +81,8 @@ public function getAction() } /** + *

key of the Address in itemShippingAddresses.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeAction.php index 10b0e128a5c..0658f2166cc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeAction.php @@ -21,6 +21,8 @@ interface StagedOrderSetItemShippingAddressCustomTypeAction extends StagedOrderU public const FIELD_FIELDS = 'fields'; /** + *

key of the Address in itemShippingAddresses.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionBuilder.php index 64bb5f85791..a49c7b46a78 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionBuilder.php @@ -45,6 +45,8 @@ final class StagedOrderSetItemShippingAddressCustomTypeActionBuilder implements private $fields; /** + *

key of the Address in itemShippingAddresses.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionModel.php index 5ff885c42c6..fa5b6060ef6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetItemShippingAddressCustomTypeActionModel.php @@ -85,6 +85,8 @@ public function getAction() } /** + *

key of the Address in itemShippingAddresses.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeAction.php index bc049fa0ec4..2468f10248f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeAction.php @@ -38,8 +38,8 @@ public function getLineItemId(); public function getLineItemKey(); /** - *

Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

+ *

Defines the Type that extends the Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Line Item.

* * @return null|TypeResourceIdentifier @@ -47,7 +47,7 @@ public function getLineItemKey(); public function getType(); /** - *

Sets the Custom Fields fields for the LineItem.

+ *

Sets the Custom Fields fields for the Line Item.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionBuilder.php index 04ba23bce23..820523c0709 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionBuilder.php @@ -73,8 +73,8 @@ public function getLineItemKey() } /** - *

Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

+ *

Defines the Type that extends the Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Line Item.

* * @return null|TypeResourceIdentifier @@ -85,7 +85,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the LineItem.

+ *

Sets the Custom Fields fields for the Line Item.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionModel.php index 58e58a9bf7c..606d3f30ee8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemCustomTypeActionModel.php @@ -133,8 +133,8 @@ public function getLineItemKey() } /** - *

Defines the Type that extends the LineItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the LineItem.

+ *

Defines the Type that extends the Line Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Line Item.

* * * @return null|TypeResourceIdentifier @@ -155,7 +155,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the LineItem.

+ *

Sets the Custom Fields fields for the Line Item.

* * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelAction.php index 1469b5a6555..8c594aae893 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelAction.php @@ -36,7 +36,11 @@ public function getLineItemId(); public function getLineItemKey(); /** - *

ResourceIdentifier to a Channel.

+ *
    + *
  • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
  • + *
  • If not present, the current Reference to a distribution channel is removed from the LineItem specified by lineItemId. + * The Channel must have the ProductDistribution ChannelRoleEnum.
  • + *
* * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionBuilder.php index 5d2c9c8471e..082370f7c5e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionBuilder.php @@ -65,7 +65,11 @@ public function getLineItemKey() } /** - *

ResourceIdentifier to a Channel.

+ *
    + *
  • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
  • + *
  • If not present, the current Reference to a distribution channel is removed from the LineItem specified by lineItemId. + * The Channel must have the ProductDistribution ChannelRoleEnum.
  • + *
* * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionModel.php index 041a7704f28..3cc46fd41f1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemDistributionChannelActionModel.php @@ -123,7 +123,11 @@ public function getLineItemKey() } /** - *

ResourceIdentifier to a Channel.

+ *
    + *
  • If present, a Reference to the Channel is set for the LineItem specified by lineItemId.
  • + *
  • If not present, the current Reference to a distribution channel is removed from the LineItem specified by lineItemId. + * The Channel must have the ProductDistribution ChannelRoleEnum.
  • + *
* * * @return null|ChannelResourceIdentifier diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceAction.php index f73999ab847..09bf295257c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceAction.php @@ -36,7 +36,8 @@ public function getLineItemId(); public function getLineItemKey(); /** - *

Draft type that stores amounts only in cent precision for the specified currency.

+ *

Value to set. + * If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

* * @return null|Money diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionBuilder.php index 4d8b629518e..77debb3dedc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionBuilder.php @@ -65,7 +65,8 @@ public function getLineItemKey() } /** - *

Draft type that stores amounts only in cent precision for the specified currency.

+ *

Value to set. + * If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

* * @return null|Money diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionModel.php index 37310b1b062..ad6387a294f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemPriceActionModel.php @@ -123,7 +123,8 @@ public function getLineItemKey() } /** - *

Draft type that stores amounts only in cent precision for the specified currency.

+ *

Value to set. + * If externalPrice is not given and the priceMode is ExternalPrice, the external price is unset and the priceMode is set to Platform.

* * * @return null|Money diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php index c6686c1f9c4..84acd5c7732 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsAction.php @@ -36,7 +36,8 @@ public function getLineItemId(); public function getLineItemKey(); /** - *

For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

+ *

Value to set. + * If empty, the existing value is removed.

* * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php index 9101be55f38..9c6d4885b9f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionBuilder.php @@ -65,7 +65,8 @@ public function getLineItemKey() } /** - *

For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

+ *

Value to set. + * If empty, the existing value is removed.

* * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php index 2dbe9b493d0..f52a8c362db 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemShippingDetailsActionModel.php @@ -123,7 +123,8 @@ public function getLineItemKey() } /** - *

For order creation and updates, the sum of the targets must match the quantity of the Line Items or Custom Line Items.

+ *

Value to set. + * If empty, the existing value is removed.

* * * @return null|ItemShippingDetailsDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php index ec28e258c12..e5d979e894d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountAction.php @@ -37,12 +37,8 @@ public function getLineItemId(); public function getLineItemKey(); /** - *

Cannot be used in LineItemDraft or CustomLineItemDraft.

- *

Can only be set by these update actions:

- * + *

Value to set. + * If empty, any existing value will be removed.

* * @return null|ExternalTaxAmountDraft @@ -50,7 +46,7 @@ public function getLineItemKey(); public function getExternalTaxAmount(); /** - *

key of the ShippingMethod used for this Line Item.``` + *

key of the ShippingMethod used for this Line Item. * This is required for Carts with Multiple ShippingMode.

* diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php index cdbb9f02fb4..e8ccae106e2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionBuilder.php @@ -71,12 +71,8 @@ public function getLineItemKey() } /** - *

Cannot be used in LineItemDraft or CustomLineItemDraft.

- *

Can only be set by these update actions:

- * + *

Value to set. + * If empty, any existing value will be removed.

* * @return null|ExternalTaxAmountDraft @@ -87,7 +83,7 @@ public function getExternalTaxAmount() } /** - *

key of the ShippingMethod used for this Line Item.``` + *

key of the ShippingMethod used for this Line Item. * This is required for Carts with Multiple ShippingMode.

* diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php index b171a888bf9..e57c9c46109 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxAmountActionModel.php @@ -131,12 +131,8 @@ public function getLineItemKey() } /** - *

Cannot be used in LineItemDraft or CustomLineItemDraft.

- *

Can only be set by these update actions:

- * + *

Value to set. + * If empty, any existing value will be removed.

* * * @return null|ExternalTaxAmountDraft @@ -157,7 +153,7 @@ public function getExternalTaxAmount() } /** - *

key of the ShippingMethod used for this Line Item.``` + *

key of the ShippingMethod used for this Line Item. * This is required for Carts with Multiple ShippingMode.

* * diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php index c1b3ee8a954..a723016e7fc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateAction.php @@ -37,7 +37,8 @@ public function getLineItemId(); public function getLineItemKey(); /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

Value to set. + * If empty, any existing value will be removed.

* * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php index fa88533175d..8ef010ba486 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionBuilder.php @@ -71,7 +71,8 @@ public function getLineItemKey() } /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

Value to set. + * If empty, any existing value will be removed.

* * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php index bd30c5ecd0c..0828680c48e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTaxRateActionModel.php @@ -131,7 +131,8 @@ public function getLineItemKey() } /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

Value to set. + * If empty, any existing value will be removed.

* * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceAction.php index 4e08973b25d..9c66be40808 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceAction.php @@ -36,6 +36,9 @@ public function getLineItemId(); public function getLineItemKey(); /** + *

Value to set. + * If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

+ * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionBuilder.php index 9cac5929d3d..d453b44eddd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionBuilder.php @@ -65,6 +65,9 @@ public function getLineItemKey() } /** + *

Value to set. + * If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

+ * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionModel.php index 1c40353754e..53300ff9467 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLineItemTotalPriceActionModel.php @@ -123,6 +123,9 @@ public function getLineItemKey() } /** + *

Value to set. + * If externalTotalPrice is not given and the priceMode is ExternalTotal, the external price is unset and the priceMode is set to Platform.

+ * * * @return null|ExternalLineItemTotalPrice */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleAction.php index 3e8b475cc25..f307877c4f1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleAction.php @@ -17,6 +17,10 @@ interface StagedOrderSetLocaleAction extends StagedOrderUpdateAction public const FIELD_LOCALE = 'locale'; /** + *

Value to set. + * Must be one of the Project's languages. + * If empty, any existing value is removed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionBuilder.php index 3017eeff5ea..ba29b363af7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionBuilder.php @@ -29,6 +29,10 @@ final class StagedOrderSetLocaleActionBuilder implements Builder private $locale; /** + *

Value to set. + * Must be one of the Project's languages. + * If empty, any existing value is removed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionModel.php index c4f6bc9c759..e4559ab5eec 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetLocaleActionModel.php @@ -65,6 +65,10 @@ public function getAction() } /** + *

Value to set. + * Must be one of the Project's languages. + * If empty, any existing value is removed.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberAction.php index b50da5c3bcb..ebc249560c2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberAction.php @@ -17,6 +17,9 @@ interface StagedOrderSetOrderNumberAction extends StagedOrderUpdateAction public const FIELD_ORDER_NUMBER = 'orderNumber'; /** + *

Value to set. Must be unique across a Project. + * Once set, the value cannot be changed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionBuilder.php index bbd4d4492e3..4becd2606f2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionBuilder.php @@ -29,6 +29,9 @@ final class StagedOrderSetOrderNumberActionBuilder implements Builder private $orderNumber; /** + *

Value to set. Must be unique across a Project. + * Once set, the value cannot be changed.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionModel.php index 7949830f255..164e4e91366 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderNumberActionModel.php @@ -65,6 +65,9 @@ public function getAction() } /** + *

Value to set. Must be unique across a Project. + * Once set, the value cannot be changed.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxAction.php index 4dcc2241bb4..a42a64d2823 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxAction.php @@ -20,7 +20,7 @@ interface StagedOrderSetOrderTotalTaxAction extends StagedOrderUpdateAction public const FIELD_EXTERNAL_TAX_PORTIONS = 'externalTaxPortions'; /** - *

Draft type that stores amounts only in cent precision for the specified currency.

+ *

Total gross amount of the Order (totalNet + taxes).

* * @return null|Money @@ -28,6 +28,8 @@ interface StagedOrderSetOrderTotalTaxAction extends StagedOrderUpdateAction public function getExternalTotalGross(); /** + *

Value to set.

+ * * @return null|TaxPortionDraftCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionBuilder.php index 22e861a03f5..ba4cf390083 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionBuilder.php @@ -38,7 +38,7 @@ final class StagedOrderSetOrderTotalTaxActionBuilder implements Builder private $externalTaxPortions; /** - *

Draft type that stores amounts only in cent precision for the specified currency.

+ *

Total gross amount of the Order (totalNet + taxes).

* * @return null|Money @@ -49,6 +49,8 @@ public function getExternalTotalGross() } /** + *

Value to set.

+ * * @return null|TaxPortionDraftCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionModel.php index 0defaa7908b..00713b92c2b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetOrderTotalTaxActionModel.php @@ -76,7 +76,7 @@ public function getAction() } /** - *

Draft type that stores amounts only in cent precision for the specified currency.

+ *

Total gross amount of the Order (totalNet + taxes).

* * * @return null|Money @@ -97,6 +97,8 @@ public function getExternalTotalGross() } /** + *

Value to set.

+ * * * @return null|TaxPortionDraftCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldAction.php index deb8346d68a..abf7857e89b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldAction.php @@ -20,7 +20,8 @@ interface StagedOrderSetParcelCustomFieldAction extends StagedOrderUpdateAction public const FIELD_VALUE = 'value'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -28,7 +29,8 @@ interface StagedOrderSetParcelCustomFieldAction extends StagedOrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionBuilder.php index 7173d7bf96e..4e855639fe1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionBuilder.php @@ -47,7 +47,8 @@ final class StagedOrderSetParcelCustomFieldActionBuilder implements Builder private $value; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -58,7 +59,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionModel.php index 3571337d817..5c14283433b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomFieldActionModel.php @@ -89,7 +89,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -109,7 +110,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeAction.php index 6725120bb97..becca54a0ef 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeAction.php @@ -22,7 +22,8 @@ interface StagedOrderSetParcelCustomTypeAction extends StagedOrderUpdateAction public const FIELD_FIELDS = 'fields'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -30,7 +31,8 @@ interface StagedOrderSetParcelCustomTypeAction extends StagedOrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionBuilder.php index 50b07e676ae..cda1624b6b5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionBuilder.php @@ -51,7 +51,8 @@ final class StagedOrderSetParcelCustomTypeActionBuilder implements Builder private $fields; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -62,7 +63,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionModel.php index 0739227b21c..ffa076356da 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelCustomTypeActionModel.php @@ -93,7 +93,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -113,7 +114,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsAction.php index 2febe7c8a14..7937165d098 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsAction.php @@ -20,7 +20,8 @@ interface StagedOrderSetParcelItemsAction extends StagedOrderUpdateAction public const FIELD_ITEMS = 'items'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -28,7 +29,8 @@ interface StagedOrderSetParcelItemsAction extends StagedOrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -36,6 +38,9 @@ public function getParcelId(); public function getParcelKey(); /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionBuilder.php index 968b5d6bac2..5b557d6afb3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionBuilder.php @@ -42,7 +42,8 @@ final class StagedOrderSetParcelItemsActionBuilder implements Builder private $items; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -53,7 +54,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -64,6 +66,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionModel.php index 6d88d078d48..5b97ca5d593 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelItemsActionModel.php @@ -82,7 +82,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -102,7 +103,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -122,6 +124,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * * @return null|DeliveryItemCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsAction.php index 64a273e00db..6b300d20116 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsAction.php @@ -20,7 +20,8 @@ interface StagedOrderSetParcelMeasurementsAction extends StagedOrderUpdateAction public const FIELD_MEASUREMENTS = 'measurements'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -28,7 +29,8 @@ interface StagedOrderSetParcelMeasurementsAction extends StagedOrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -36,6 +38,9 @@ public function getParcelId(); public function getParcelKey(); /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * @return null|ParcelMeasurements */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionBuilder.php index b3430d7aaf1..6478e5df636 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionBuilder.php @@ -43,7 +43,8 @@ final class StagedOrderSetParcelMeasurementsActionBuilder implements Builder private $measurements; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -54,7 +55,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -65,6 +67,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * @return null|ParcelMeasurements */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionModel.php index 1c5c8a5a4d8..16c152cfe0a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelMeasurementsActionModel.php @@ -83,7 +83,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -103,7 +104,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -123,6 +125,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * * @return null|ParcelMeasurements */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataAction.php index b214a7a73e8..6ebf3bd35fb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataAction.php @@ -20,7 +20,8 @@ interface StagedOrderSetParcelTrackingDataAction extends StagedOrderUpdateAction public const FIELD_TRACKING_DATA = 'trackingData'; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -28,7 +29,8 @@ interface StagedOrderSetParcelTrackingDataAction extends StagedOrderUpdateAction public function getParcelId(); /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -36,6 +38,9 @@ public function getParcelId(); public function getParcelKey(); /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * @return null|TrackingData */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionBuilder.php index 729bf562c5f..c684237e698 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionBuilder.php @@ -43,7 +43,8 @@ final class StagedOrderSetParcelTrackingDataActionBuilder implements Builder private $trackingData; /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -54,7 +55,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * @return null|string @@ -65,6 +67,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * @return null|TrackingData */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionModel.php index e9223145445..2fa8447b6bc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetParcelTrackingDataActionModel.php @@ -83,7 +83,8 @@ public function getAction() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

id of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -103,7 +104,8 @@ public function getParcelId() } /** - *

Either parcelId or parcelKey is required for this update action.

+ *

key of an existing Parcel.

+ *

Either parcelId or parcelKey must be provided.

* * * @return null|string @@ -123,6 +125,9 @@ public function getParcelKey() } /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * * @return null|TrackingData */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberAction.php index 6ac0221c1a5..fb522a87934 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberAction.php @@ -17,8 +17,7 @@ interface StagedOrderSetPurchaseOrderNumberAction extends StagedOrderUpdateActio public const FIELD_PURCHASE_ORDER_NUMBER = 'purchaseOrderNumber'; /** - *

Identifier for a purchase order, usually in a B2B context. - * The Purchase Order Number is typically entered by the Buyer and can also be used with Quotes.

+ *

Value to set.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberActionBuilder.php index f0b3c99124a..bc2b2c18e81 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberActionBuilder.php @@ -29,8 +29,7 @@ final class StagedOrderSetPurchaseOrderNumberActionBuilder implements Builder private $purchaseOrderNumber; /** - *

Identifier for a purchase order, usually in a B2B context. - * The Purchase Order Number is typically entered by the Buyer and can also be used with Quotes.

+ *

Value to set.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberActionModel.php index 9769bdaf851..f889163dfb2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetPurchaseOrderNumberActionModel.php @@ -65,8 +65,7 @@ public function getAction() } /** - *

Identifier for a purchase order, usually in a B2B context. - * The Purchase Order Number is typically entered by the Buyer and can also be used with Quotes.

+ *

Value to set.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoAction.php index 96afa46ceba..f04a35c0e27 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoAction.php @@ -18,6 +18,9 @@ interface StagedOrderSetReturnInfoAction extends StagedOrderUpdateAction public const FIELD_ITEMS = 'items'; /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * @return null|ReturnInfoDraftCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionBuilder.php index af094fbee12..a4131fce04e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionBuilder.php @@ -30,6 +30,9 @@ final class StagedOrderSetReturnInfoActionBuilder implements Builder private $items; /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * @return null|ReturnInfoDraftCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionModel.php index 26a87e14e22..6344c0f6542 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnInfoActionModel.php @@ -66,6 +66,9 @@ public function getAction() } /** + *

Value to set. + * If empty, any existing value will be removed.

+ * * * @return null|ReturnInfoDraftCollection */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php index 84f70709bef..67d7b9a5cd2 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php @@ -19,6 +19,8 @@ interface StagedOrderSetReturnItemCustomFieldAction extends StagedOrderUpdateAct public const FIELD_VALUE = 'value'; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php index 010b3f40492..5779c6f2be1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php @@ -41,6 +41,8 @@ final class StagedOrderSetReturnItemCustomFieldActionBuilder implements Builder private $value; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php index 00af5383a39..bba2597baa3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php @@ -81,6 +81,8 @@ public function getAction() } /** + *

id of the ReturnItem to update.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php index 149a0119469..1a4df2e5de8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php @@ -21,14 +21,16 @@ interface StagedOrderSetReturnItemCustomTypeAction extends StagedOrderUpdateActi public const FIELD_FIELDS = 'fields'; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ public function getReturnItemId(); /** - *

Defines the Type that extends the ReturnItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

+ *

Defines the Type that extends the Return Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Return Item.

* * @return null|TypeResourceIdentifier @@ -36,7 +38,7 @@ public function getReturnItemId(); public function getType(); /** - *

Sets the Custom Fields fields for the ReturnItem.

+ *

Sets the Custom Fields fields for the Return Item.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php index 3d76e782ab6..ad86a1675bf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php @@ -45,6 +45,8 @@ final class StagedOrderSetReturnItemCustomTypeActionBuilder implements Builder private $fields; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ @@ -54,8 +56,8 @@ public function getReturnItemId() } /** - *

Defines the Type that extends the ReturnItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

+ *

Defines the Type that extends the Return Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Return Item.

* * @return null|TypeResourceIdentifier @@ -66,7 +68,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the ReturnItem.

+ *

Sets the Custom Fields fields for the Return Item.

* * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php index ce39adf2088..fdb675b1508 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php @@ -85,6 +85,8 @@ public function getAction() } /** + *

id of the ReturnItem to update.

+ * * * @return null|string */ @@ -103,8 +105,8 @@ public function getReturnItemId() } /** - *

Defines the Type that extends the ReturnItem with Custom Fields. - * If absent, any existing Type and Custom Fields are removed from the ReturnItem.

+ *

Defines the Type that extends the Return Item with Custom Fields. + * If absent, any existing Type and Custom Fields are removed from the Return Item.

* * * @return null|TypeResourceIdentifier @@ -125,7 +127,7 @@ public function getType() } /** - *

Sets the Custom Fields fields for the ReturnItem.

+ *

Sets the Custom Fields fields for the Return Item.

* * * @return null|FieldContainer diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php index cce1da88191..6958328c908 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php @@ -18,12 +18,16 @@ interface StagedOrderSetReturnPaymentStateAction extends StagedOrderUpdateAction public const FIELD_PAYMENT_STATE = 'paymentState'; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ public function getReturnItemId(); /** + *

New Payment status of the ReturnItem.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php index b5ff7557bbe..7711ea8e6bb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php @@ -35,6 +35,8 @@ final class StagedOrderSetReturnPaymentStateActionBuilder implements Builder private $paymentState; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ @@ -44,6 +46,8 @@ public function getReturnItemId() } /** + *

New Payment status of the ReturnItem.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php index 026948bbc12..0a03d35e5b3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

id of the ReturnItem to update.

+ * * * @return null|string */ @@ -91,6 +93,8 @@ public function getReturnItemId() } /** + *

New Payment status of the ReturnItem.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php index aebc1c86945..116fa85ce19 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php @@ -18,12 +18,16 @@ interface StagedOrderSetReturnShipmentStateAction extends StagedOrderUpdateActio public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ public function getReturnItemId(); /** + *

New shipment state of the ReturnItem.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php index 2f94ab4d065..cdd41d2e5d1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php @@ -35,6 +35,8 @@ final class StagedOrderSetReturnShipmentStateActionBuilder implements Builder private $shipmentState; /** + *

id of the ReturnItem to update.

+ * * @return null|string */ @@ -44,6 +46,8 @@ public function getReturnItemId() } /** + *

New shipment state of the ReturnItem.

+ * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php index db07eb896a7..0e445f1b12d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php @@ -73,6 +73,8 @@ public function getAction() } /** + *

id of the ReturnItem to update.

+ * * * @return null|string */ @@ -91,6 +93,8 @@ public function getReturnItemId() } /** + *

New shipment state of the ReturnItem.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php index 710f148ce16..132cbc39ce4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAction.php @@ -18,9 +18,8 @@ interface StagedOrderSetShippingAddressAction extends StagedOrderUpdateAction public const FIELD_ADDRESS = 'address'; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php index 526c670424c..41c463a631c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionBuilder.php @@ -31,9 +31,8 @@ final class StagedOrderSetShippingAddressActionBuilder implements Builder private $address; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php index e2be7a9c8d4..d45f0029679 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressActionModel.php @@ -67,9 +67,8 @@ public function getAction() } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set. + * If empty, any existing value is removed.

* * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php index cc315177e63..e6c11729e11 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodAction.php @@ -25,9 +25,7 @@ interface StagedOrderSetShippingAddressAndCustomShippingMethodAction extends Sta public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set for shippingAddress.

* * @return null|BaseAddress @@ -35,19 +33,23 @@ interface StagedOrderSetShippingAddressAndCustomShippingMethodAction extends Sta public function getAddress(); /** + *

Value to set.

+ * * @return null|string */ public function getShippingMethodName(); /** + *

Value to set.

+ * * @return null|ShippingRateDraft */ public function getShippingRate(); /** - *

ResourceIdentifier to a TaxCategory.

+ *

Used to select a Tax Rate when the Order has the Platform TaxMode.

* * @return null|TaxCategoryResourceIdentifier @@ -55,7 +57,7 @@ public function getShippingRate(); public function getTaxCategory(); /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

An external Tax Rate can be set if the Cart has the External TaxMode.

* * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php index b2081c7d30f..f5abdbd8e21 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder.php @@ -61,9 +61,7 @@ final class StagedOrderSetShippingAddressAndCustomShippingMethodActionBuilder im private $externalTaxRate; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set for shippingAddress.

* * @return null|BaseAddress @@ -74,6 +72,8 @@ public function getAddress() } /** + *

Value to set.

+ * * @return null|string */ @@ -83,6 +83,8 @@ public function getShippingMethodName() } /** + *

Value to set.

+ * * @return null|ShippingRateDraft */ @@ -92,7 +94,7 @@ public function getShippingRate() } /** - *

ResourceIdentifier to a TaxCategory.

+ *

Used to select a Tax Rate when the Order has the Platform TaxMode.

* * @return null|TaxCategoryResourceIdentifier @@ -103,7 +105,7 @@ public function getTaxCategory() } /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

An external Tax Rate can be set if the Cart has the External TaxMode.

* * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php index 166378b9e19..33f2b5985f1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndCustomShippingMethodActionModel.php @@ -105,9 +105,7 @@ public function getAction() } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set for shippingAddress.

* * * @return null|BaseAddress @@ -128,6 +126,8 @@ public function getAddress() } /** + *

Value to set.

+ * * * @return null|string */ @@ -146,6 +146,8 @@ public function getShippingMethodName() } /** + *

Value to set.

+ * * * @return null|ShippingRateDraft */ @@ -165,7 +167,7 @@ public function getShippingRate() } /** - *

ResourceIdentifier to a TaxCategory.

+ *

Used to select a Tax Rate when the Order has the Platform TaxMode.

* * * @return null|TaxCategoryResourceIdentifier @@ -186,7 +188,7 @@ public function getTaxCategory() } /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

An external Tax Rate can be set if the Cart has the External TaxMode.

* * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php index c83db7d7337..68fb43f6afb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodAction.php @@ -22,9 +22,7 @@ interface StagedOrderSetShippingAddressAndShippingMethodAction extends StagedOrd public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set for shippingAddress.

* * @return null|BaseAddress @@ -32,7 +30,7 @@ interface StagedOrderSetShippingAddressAndShippingMethodAction extends StagedOrd public function getAddress(); /** - *

ResourceIdentifier to a ShippingMethod.

+ *

Value to set.

* * @return null|ShippingMethodResourceIdentifier @@ -40,7 +38,7 @@ public function getAddress(); public function getShippingMethod(); /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

An external Tax Rate can be set if the Cart has the External TaxMode.

* * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php index f7481ce5a78..5308d405bea 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionBuilder.php @@ -47,9 +47,7 @@ final class StagedOrderSetShippingAddressAndShippingMethodActionBuilder implemen private $externalTaxRate; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set for shippingAddress.

* * @return null|BaseAddress @@ -60,7 +58,7 @@ public function getAddress() } /** - *

ResourceIdentifier to a ShippingMethod.

+ *

Value to set.

* * @return null|ShippingMethodResourceIdentifier @@ -71,7 +69,7 @@ public function getShippingMethod() } /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

An external Tax Rate can be set if the Cart has the External TaxMode.

* * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php index 076269e30ff..922becf703e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingAddressAndShippingMethodActionModel.php @@ -87,9 +87,7 @@ public function getAction() } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

Value to set for shippingAddress.

* * * @return null|BaseAddress @@ -110,7 +108,7 @@ public function getAddress() } /** - *

ResourceIdentifier to a ShippingMethod.

+ *

Value to set.

* * * @return null|ShippingMethodResourceIdentifier @@ -131,7 +129,7 @@ public function getShippingMethod() } /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

An external Tax Rate can be set if the Cart has the External TaxMode.

* * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php index f81b3c70294..365c8ad95a4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodAction.php @@ -20,7 +20,8 @@ interface StagedOrderSetShippingMethodAction extends StagedOrderUpdateAction public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** - *

ResourceIdentifier to a ShippingMethod.

+ *

Value to set. If empty, any existing value will be removed. + * If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

* * @return null|ShippingMethodResourceIdentifier @@ -28,7 +29,7 @@ interface StagedOrderSetShippingMethodAction extends StagedOrderUpdateAction public function getShippingMethod(); /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

An external Tax Rate can be set if the Cart has the External TaxMode.

* * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php index ef914ad88a1..575fbbb1a54 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionBuilder.php @@ -39,7 +39,8 @@ final class StagedOrderSetShippingMethodActionBuilder implements Builder private $externalTaxRate; /** - *

ResourceIdentifier to a ShippingMethod.

+ *

Value to set. If empty, any existing value will be removed. + * If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

* * @return null|ShippingMethodResourceIdentifier @@ -50,7 +51,7 @@ public function getShippingMethod() } /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

An external Tax Rate can be set if the Cart has the External TaxMode.

* * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php index 8ef9d9edbde..e9f21bcd4ac 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodActionModel.php @@ -77,7 +77,8 @@ public function getAction() } /** - *

ResourceIdentifier to a ShippingMethod.

+ *

Value to set. If empty, any existing value will be removed. + * If the referenced Shipping Method has a predicate that does not match the Cart, an InvalidOperation error is returned.

* * * @return null|ShippingMethodResourceIdentifier @@ -98,7 +99,7 @@ public function getShippingMethod() } /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

An external Tax Rate can be set if the Cart has the External TaxMode.

* * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php index b8cecb8599d..290b89d00fe 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountAction.php @@ -27,12 +27,7 @@ interface StagedOrderSetShippingMethodTaxAmountAction extends StagedOrderUpdateA public function getShippingKey(); /** - *

Cannot be used in LineItemDraft or CustomLineItemDraft.

- *

Can only be set by these update actions:

- * + *

Value to set. If empty, any existing value will be removed.

* * @return null|ExternalTaxAmountDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php index 57b5b2e0cf6..0d144569818 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionBuilder.php @@ -48,12 +48,7 @@ public function getShippingKey() } /** - *

Cannot be used in LineItemDraft or CustomLineItemDraft.

- *

Can only be set by these update actions:

- * + *

Value to set. If empty, any existing value will be removed.

* * @return null|ExternalTaxAmountDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php index b47155f9c90..ec03981de8e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxAmountActionModel.php @@ -95,12 +95,7 @@ public function getShippingKey() } /** - *

Cannot be used in LineItemDraft or CustomLineItemDraft.

- *

Can only be set by these update actions:

- * + *

Value to set. If empty, any existing value will be removed.

* * * @return null|ExternalTaxAmountDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php index 575ed3b0b3f..cbd8e6f7510 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateAction.php @@ -27,7 +27,8 @@ interface StagedOrderSetShippingMethodTaxRateAction extends StagedOrderUpdateAct public function getShippingKey(); /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php index c57da509e85..f76008dd5de 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionBuilder.php @@ -48,7 +48,8 @@ public function getShippingKey() } /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

Value to set. + * If empty, any existing value is removed.

* * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php index 8107fd2a3ba..154bfddd10e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingMethodTaxRateActionModel.php @@ -95,7 +95,8 @@ public function getShippingKey() } /** - *

Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.

+ *

Value to set. + * If empty, any existing value is removed.

* * * @return null|ExternalTaxRateDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php index aa012d5164d..20cfe7ffb40 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputAction.php @@ -18,7 +18,12 @@ interface StagedOrderSetShippingRateInputAction extends StagedOrderUpdateAction public const FIELD_SHIPPING_RATE_INPUT = 'shippingRateInput'; /** - *

Generic type holding specifc ShippingRateInputDraft types.

+ *

The data type of this field depends on the shippingRateInputType.type configured in the Project:

+ * * * @return null|ShippingRateInputDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php index 60671ac7fd7..03e58f11b74 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionBuilder.php @@ -31,7 +31,12 @@ final class StagedOrderSetShippingRateInputActionBuilder implements Builder private $shippingRateInput; /** - *

Generic type holding specifc ShippingRateInputDraft types.

+ *

The data type of this field depends on the shippingRateInputType.type configured in the Project:

+ * * * @return null|ShippingRateInputDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php index 4400b42fc6b..8fd47023d3f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetShippingRateInputActionModel.php @@ -67,7 +67,12 @@ public function getAction() } /** - *

Generic type holding specifc ShippingRateInputDraft types.

+ *

The data type of this field depends on the shippingRateInputType.type configured in the Project:

+ * * * * @return null|ShippingRateInputDraft diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreAction.php new file mode 100644 index 00000000000..7d32961c8f9 --- /dev/null +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreAction.php @@ -0,0 +1,33 @@ +Value to set. If empty, any existing value will be removed.

+ *

If store references the same Store the Order is currently assigned to or if you try to remove the value when no Store is currently assigned, a 400 error is returned.

+ * + + * @return null|StoreResourceIdentifier + */ + public function getStore(); + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void; +} diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionBuilder.php new file mode 100644 index 00000000000..80e2bc5a517 --- /dev/null +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionBuilder.php @@ -0,0 +1,78 @@ + + */ +final class StagedOrderSetStoreActionBuilder implements Builder +{ + /** + + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder + */ + private $store; + + /** + *

Value to set. If empty, any existing value will be removed.

+ *

If store references the same Store the Order is currently assigned to or if you try to remove the value when no Store is currently assigned, a 400 error is returned.

+ * + + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store; + } + + /** + * @param ?StoreResourceIdentifier $store + * @return $this + */ + public function withStore(?StoreResourceIdentifier $store) + { + $this->store = $store; + + return $this; + } + + /** + * @deprecated use withStore() instead + * @return $this + */ + public function withStoreBuilder(?StoreResourceIdentifierBuilder $store) + { + $this->store = $store; + + return $this; + } + + public function build(): StagedOrderSetStoreAction + { + return new StagedOrderSetStoreActionModel( + $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store + ); + } + + public static function of(): StagedOrderSetStoreActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionCollection.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionCollection.php new file mode 100644 index 00000000000..78af3254d64 --- /dev/null +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionCollection.php @@ -0,0 +1,56 @@ + + * @method StagedOrderSetStoreAction current() + * @method StagedOrderSetStoreAction end() + * @method StagedOrderSetStoreAction at($offset) + */ +class StagedOrderSetStoreActionCollection extends StagedOrderUpdateActionCollection +{ + /** + * @psalm-assert StagedOrderSetStoreAction $value + * @psalm-param StagedOrderSetStoreAction|stdClass $value + * @throws InvalidArgumentException + * + * @return StagedOrderSetStoreActionCollection + */ + public function add($value) + { + if (!$value instanceof StagedOrderSetStoreAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StagedOrderSetStoreAction + */ + protected function mapper() + { + return function (?int $index): ?StagedOrderSetStoreAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StagedOrderSetStoreAction $data */ + $data = StagedOrderSetStoreActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionModel.php new file mode 100644 index 00000000000..ad794f935fe --- /dev/null +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetStoreActionModel.php @@ -0,0 +1,99 @@ +store = $store; + $this->action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } + + /** + *

Value to set. If empty, any existing value will be removed.

+ *

If store references the same Store the Order is currently assigned to or if you try to remove the value when no Store is currently assigned, a 400 error is returned.

+ * + * + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreResourceIdentifierModel::of($data); + } + + return $this->store; + } + + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void + { + $this->store = $store; + } +} diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php index 73e7d767b8b..a0c2497749e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php @@ -23,19 +23,23 @@ interface StagedOrderTransitionCustomLineItemStateAction extends StagedOrderUpda public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ public function getCustomLineItemId(); /** + *

Number of Custom Line Items that should transition State.

+ * * @return null|int */ public function getQuantity(); /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition from.

* * @return null|StateResourceIdentifier @@ -43,7 +47,7 @@ public function getQuantity(); public function getFromState(); /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition to.

* * @return null|StateResourceIdentifier @@ -51,6 +55,8 @@ public function getFromState(); public function getToState(); /** + *

Date and time (UTC) to perform the State transition.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php index 979f1ea6231..f00d3ab8897 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php @@ -56,6 +56,8 @@ final class StagedOrderTransitionCustomLineItemStateActionBuilder implements Bui private $actualTransitionDate; /** + *

id of the CustomLineItem to update.

+ * * @return null|string */ @@ -65,6 +67,8 @@ public function getCustomLineItemId() } /** + *

Number of Custom Line Items that should transition State.

+ * * @return null|int */ @@ -74,7 +78,7 @@ public function getQuantity() } /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition from.

* * @return null|StateResourceIdentifier @@ -85,7 +89,7 @@ public function getFromState() } /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition to.

* * @return null|StateResourceIdentifier @@ -96,6 +100,8 @@ public function getToState() } /** + *

Date and time (UTC) to perform the State transition.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php index c930d439bab..0f93e81e78a 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php @@ -100,6 +100,8 @@ public function getAction() } /** + *

id of the CustomLineItem to update.

+ * * * @return null|string */ @@ -118,6 +120,8 @@ public function getCustomLineItemId() } /** + *

Number of Custom Line Items that should transition State.

+ * * * @return null|int */ @@ -136,7 +140,7 @@ public function getQuantity() } /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition from.

* * * @return null|StateResourceIdentifier @@ -157,7 +161,7 @@ public function getFromState() } /** - *

ResourceIdentifier to a State.

+ *

State the Custom Line Item should transition to.

* * * @return null|StateResourceIdentifier @@ -178,6 +182,8 @@ public function getToState() } /** + *

Date and time (UTC) to perform the State transition.

+ * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php index d89d1839beb..cbe49ef9015 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php @@ -23,19 +23,23 @@ interface StagedOrderTransitionLineItemStateAction extends StagedOrderUpdateActi public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** + *

id of the LineItem to update.

+ * * @return null|string */ public function getLineItemId(); /** + *

Number of Line Items that should transition State.

+ * * @return null|int */ public function getQuantity(); /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition from.

* * @return null|StateResourceIdentifier @@ -43,7 +47,7 @@ public function getQuantity(); public function getFromState(); /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition to.

* * @return null|StateResourceIdentifier @@ -51,6 +55,8 @@ public function getFromState(); public function getToState(); /** + *

Date and time (UTC) to perform the State transition.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php index 045bf37714c..4c5edb5bc71 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php @@ -56,6 +56,8 @@ final class StagedOrderTransitionLineItemStateActionBuilder implements Builder private $actualTransitionDate; /** + *

id of the LineItem to update.

+ * * @return null|string */ @@ -65,6 +67,8 @@ public function getLineItemId() } /** + *

Number of Line Items that should transition State.

+ * * @return null|int */ @@ -74,7 +78,7 @@ public function getQuantity() } /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition from.

* * @return null|StateResourceIdentifier @@ -85,7 +89,7 @@ public function getFromState() } /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition to.

* * @return null|StateResourceIdentifier @@ -96,6 +100,8 @@ public function getToState() } /** + *

Date and time (UTC) to perform the State transition.

+ * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php index 5afcda79993..8e24d307a4e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php @@ -100,6 +100,8 @@ public function getAction() } /** + *

id of the LineItem to update.

+ * * * @return null|string */ @@ -118,6 +120,8 @@ public function getLineItemId() } /** + *

Number of Line Items that should transition State.

+ * * * @return null|int */ @@ -136,7 +140,7 @@ public function getQuantity() } /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition from.

* * * @return null|StateResourceIdentifier @@ -157,7 +161,7 @@ public function getFromState() } /** - *

ResourceIdentifier to a State.

+ *

State the Line Item should transition to.

* * * @return null|StateResourceIdentifier @@ -178,6 +182,8 @@ public function getToState() } /** + *

Date and time (UTC) to perform the State transition.

+ * * * @return null|DateTimeImmutable */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateAction.php index b12e3c1caee..213db8762aa 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateAction.php @@ -19,7 +19,8 @@ interface StagedOrderTransitionStateAction extends StagedOrderUpdateAction public const FIELD_FORCE = 'force'; /** - *

ResourceIdentifier to a State.

+ *

Value to set. + * If there is no State yet, the new State must be an initial State.

* * @return null|StateResourceIdentifier @@ -27,6 +28,8 @@ interface StagedOrderTransitionStateAction extends StagedOrderUpdateAction public function getState(); /** + *

Set to true to turn off validation.

+ * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionBuilder.php index 7d29cd37d62..91b8cf2c1a5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionBuilder.php @@ -37,7 +37,8 @@ final class StagedOrderTransitionStateActionBuilder implements Builder private $force; /** - *

ResourceIdentifier to a State.

+ *

Value to set. + * If there is no State yet, the new State must be an initial State.

* * @return null|StateResourceIdentifier @@ -48,6 +49,8 @@ public function getState() } /** + *

Set to true to turn off validation.

+ * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionModel.php index 2671d10fe97..4dd43255241 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionStateActionModel.php @@ -75,7 +75,8 @@ public function getAction() } /** - *

ResourceIdentifier to a State.

+ *

Value to set. + * If there is no State yet, the new State must be an initial State.

* * * @return null|StateResourceIdentifier @@ -96,6 +97,8 @@ public function getState() } /** + *

Set to true to turn off validation.

+ * * * @return null|bool */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php index e5bc8635692..7696b8444f8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressAction.php @@ -18,9 +18,7 @@ interface StagedOrderUpdateItemShippingAddressAction extends StagedOrderUpdateAc public const FIELD_ADDRESS = 'address'; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

The new Address with the same key as the Address it will replace.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php index e5b73d8eff5..749ddb9a3d1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionBuilder.php @@ -31,9 +31,7 @@ final class StagedOrderUpdateItemShippingAddressActionBuilder implements Builder private $address; /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

The new Address with the same key as the Address it will replace.

* * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php index bc65df9a36e..c0593619494 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateItemShippingAddressActionModel.php @@ -67,9 +67,7 @@ public function getAction() } /** - *

Polymorphic base type that represents a postal address and contact details. - * Depending on the read or write action, it can be either Address or AddressDraft that - * only differ in the data type for the optional custom field.

+ *

The new Address with the same key as the Address it will replace.

* * * @return null|BaseAddress diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoAction.php index d5a1dcdd0fd..b804e7051e3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoAction.php @@ -16,39 +16,45 @@ interface StagedOrderUpdateSyncInfoAction extends StagedOrderUpdateAction { - public const FIELD_CHANNEL = 'channel'; public const FIELD_EXTERNAL_ID = 'externalId'; + public const FIELD_CHANNEL = 'channel'; public const FIELD_SYNCED_AT = 'syncedAt'; /** - *

ResourceIdentifier to a Channel.

+ *

Set this to identify an external order instance, file, or other resource.

* - * @return null|ChannelResourceIdentifier + * @return null|string */ - public function getChannel(); + public function getExternalId(); /** + *

The synchronization destination to set. Must not be empty. + * The referenced Channel must have the Channel Role OrderExport or OrderImport. + * Otherwise this update action returns an InvalidInput error.

+ * - * @return null|string + * @return null|ChannelResourceIdentifier */ - public function getExternalId(); + public function getChannel(); /** + *

If not set, it defaults to the current date and time.

+ * * @return null|DateTimeImmutable */ public function getSyncedAt(); /** - * @param ?ChannelResourceIdentifier $channel + * @param ?string $externalId */ - public function setChannel(?ChannelResourceIdentifier $channel): void; + public function setExternalId(?string $externalId): void; /** - * @param ?string $externalId + * @param ?ChannelResourceIdentifier $channel */ - public function setExternalId(?string $externalId): void; + public function setChannel(?ChannelResourceIdentifier $channel): void; /** * @param ?DateTimeImmutable $syncedAt diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionBuilder.php index 91409805290..feb683543c1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionBuilder.php @@ -27,15 +27,15 @@ final class StagedOrderUpdateSyncInfoActionBuilder implements Builder { /** - * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder + * @var ?string */ - private $channel; + private $externalId; /** - * @var ?string + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ - private $externalId; + private $channel; /** @@ -44,26 +44,32 @@ final class StagedOrderUpdateSyncInfoActionBuilder implements Builder private $syncedAt; /** - *

ResourceIdentifier to a Channel.

+ *

Set this to identify an external order instance, file, or other resource.

* - * @return null|ChannelResourceIdentifier + * @return null|string */ - public function getChannel() + public function getExternalId() { - return $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel; + return $this->externalId; } /** + *

The synchronization destination to set. Must not be empty. + * The referenced Channel must have the Channel Role OrderExport or OrderImport. + * Otherwise this update action returns an InvalidInput error.

+ * - * @return null|string + * @return null|ChannelResourceIdentifier */ - public function getExternalId() + public function getChannel() { - return $this->externalId; + return $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel; } /** + *

If not set, it defaults to the current date and time.

+ * * @return null|DateTimeImmutable */ @@ -73,23 +79,23 @@ public function getSyncedAt() } /** - * @param ?ChannelResourceIdentifier $channel + * @param ?string $externalId * @return $this */ - public function withChannel(?ChannelResourceIdentifier $channel) + public function withExternalId(?string $externalId) { - $this->channel = $channel; + $this->externalId = $externalId; return $this; } /** - * @param ?string $externalId + * @param ?ChannelResourceIdentifier $channel * @return $this */ - public function withExternalId(?string $externalId) + public function withChannel(?ChannelResourceIdentifier $channel) { - $this->externalId = $externalId; + $this->channel = $channel; return $this; } @@ -119,8 +125,8 @@ public function withChannelBuilder(?ChannelResourceIdentifierBuilder $channel) public function build(): StagedOrderUpdateSyncInfoAction { return new StagedOrderUpdateSyncInfoActionModel( - $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel, $this->externalId, + $this->channel instanceof ChannelResourceIdentifierBuilder ? $this->channel->build() : $this->channel, $this->syncedAt ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionModel.php index 8c917d935d5..53878173abb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderUpdateSyncInfoActionModel.php @@ -33,15 +33,15 @@ final class StagedOrderUpdateSyncInfoActionModel extends JsonObjectModel impleme /** * - * @var ?ChannelResourceIdentifier + * @var ?string */ - protected $channel; + protected $externalId; /** * - * @var ?string + * @var ?ChannelResourceIdentifier */ - protected $externalId; + protected $channel; /** * @@ -54,13 +54,13 @@ final class StagedOrderUpdateSyncInfoActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( - ?ChannelResourceIdentifier $channel = null, ?string $externalId = null, + ?ChannelResourceIdentifier $channel = null, ?DateTimeImmutable $syncedAt = null, ?string $action = null ) { - $this->channel = $channel; $this->externalId = $externalId; + $this->channel = $channel; $this->syncedAt = $syncedAt; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -84,45 +84,51 @@ public function getAction() } /** - *

ResourceIdentifier to a Channel.

+ *

Set this to identify an external order instance, file, or other resource.

* * - * @return null|ChannelResourceIdentifier + * @return null|string */ - public function getChannel() + public function getExternalId() { - if (is_null($this->channel)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CHANNEL); + if (is_null($this->externalId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_EXTERNAL_ID); if (is_null($data)) { return null; } - - $this->channel = ChannelResourceIdentifierModel::of($data); + $this->externalId = (string) $data; } - return $this->channel; + return $this->externalId; } /** + *

The synchronization destination to set. Must not be empty. + * The referenced Channel must have the Channel Role OrderExport or OrderImport. + * Otherwise this update action returns an InvalidInput error.

* - * @return null|string + * + * @return null|ChannelResourceIdentifier */ - public function getExternalId() + public function getChannel() { - if (is_null($this->externalId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_EXTERNAL_ID); + if (is_null($this->channel)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CHANNEL); if (is_null($data)) { return null; } - $this->externalId = (string) $data; + + $this->channel = ChannelResourceIdentifierModel::of($data); } - return $this->externalId; + return $this->channel; } /** + *

If not set, it defaults to the current date and time.

+ * * * @return null|DateTimeImmutable */ @@ -146,19 +152,19 @@ public function getSyncedAt() /** - * @param ?ChannelResourceIdentifier $channel + * @param ?string $externalId */ - public function setChannel(?ChannelResourceIdentifier $channel): void + public function setExternalId(?string $externalId): void { - $this->channel = $channel; + $this->externalId = $externalId; } /** - * @param ?string $externalId + * @param ?ChannelResourceIdentifier $channel */ - public function setExternalId(?string $externalId): void + public function setChannel(?ChannelResourceIdentifier $channel): void { - $this->externalId = $externalId; + $this->channel = $channel; } /** diff --git a/references.txt b/references.txt index 7f8ab7506bd..b8aaba98d43 100644 --- a/references.txt +++ b/references.txt @@ -70,3 +70,4 @@ cf1efa8eee337b806a5a943b0e44af7d890e4802 cc581bbaa4c907418e64d72d70a1b17ef1297638 e40afdfd0ae914b593926d478cb307e9a3b7328b da31e9917b314501c2a67a8e3bc2e6dfe9c228ca +409fe5dd4ae936941f2654ae5fa5598ea983d3ac From a0d534d351f48da57bef05efdc4d10d31917fe54 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Wed, 12 Jul 2023 10:51:38 +0000 Subject: [PATCH 10/44] TASK: Updating SDK --- changes.md | 42 +++++++++++++++++++ ...omLineItemShippingDetailsTargetsAction.php | 16 ++++++- ...temShippingDetailsTargetsActionBuilder.php | 31 +++++++++++++- ...eItemShippingDetailsTargetsActionModel.php | 38 ++++++++++++++++- .../CartChangeCustomLineItemMoneyAction.php | 16 ++++++- ...ChangeCustomLineItemMoneyActionBuilder.php | 31 +++++++++++++- ...rtChangeCustomLineItemMoneyActionModel.php | 38 ++++++++++++++++- ...artChangeCustomLineItemPriceModeAction.php | 16 ++++++- ...geCustomLineItemPriceModeActionBuilder.php | 31 +++++++++++++- ...angeCustomLineItemPriceModeActionModel.php | 38 ++++++++++++++++- ...CartChangeCustomLineItemQuantityAction.php | 16 ++++++- ...ngeCustomLineItemQuantityActionBuilder.php | 31 +++++++++++++- ...hangeCustomLineItemQuantityActionModel.php | 38 ++++++++++++++++- .../Cart/CartRemoveCustomLineItemAction.php | 16 ++++++- .../CartRemoveCustomLineItemActionBuilder.php | 33 ++++++++++++++- .../CartRemoveCustomLineItemActionModel.php | 38 ++++++++++++++++- ...CartSetCustomLineItemCustomFieldAction.php | 16 ++++++- ...CustomLineItemCustomFieldActionBuilder.php | 31 +++++++++++++- ...etCustomLineItemCustomFieldActionModel.php | 38 ++++++++++++++++- .../CartSetCustomLineItemCustomTypeAction.php | 16 ++++++- ...tCustomLineItemCustomTypeActionBuilder.php | 31 +++++++++++++- ...SetCustomLineItemCustomTypeActionModel.php | 38 ++++++++++++++++- ...SetCustomLineItemShippingDetailsAction.php | 16 ++++++- ...omLineItemShippingDetailsActionBuilder.php | 31 +++++++++++++- ...stomLineItemShippingDetailsActionModel.php | 38 ++++++++++++++++- .../CartSetCustomLineItemTaxAmountAction.php | 16 ++++++- ...etCustomLineItemTaxAmountActionBuilder.php | 31 +++++++++++++- ...tSetCustomLineItemTaxAmountActionModel.php | 38 ++++++++++++++++- .../CartSetCustomLineItemTaxRateAction.php | 16 ++++++- ...tSetCustomLineItemTaxRateActionBuilder.php | 31 +++++++++++++- ...artSetCustomLineItemTaxRateActionModel.php | 38 ++++++++++++++++- ...rderSetCustomLineItemCustomFieldAction.php | 16 ++++++- ...CustomLineItemCustomFieldActionBuilder.php | 31 +++++++++++++- ...etCustomLineItemCustomFieldActionModel.php | 38 ++++++++++++++++- ...OrderSetCustomLineItemCustomTypeAction.php | 16 ++++++- ...tCustomLineItemCustomTypeActionBuilder.php | 31 +++++++++++++- ...SetCustomLineItemCustomTypeActionModel.php | 38 ++++++++++++++++- ...SetCustomLineItemShippingDetailsAction.php | 16 ++++++- ...omLineItemShippingDetailsActionBuilder.php | 31 +++++++++++++- ...stomLineItemShippingDetailsActionModel.php | 38 ++++++++++++++++- ...edOrderChangeCustomLineItemMoneyAction.php | 16 ++++++- ...ChangeCustomLineItemMoneyActionBuilder.php | 31 +++++++++++++- ...erChangeCustomLineItemMoneyActionModel.php | 38 ++++++++++++++++- ...rderChangeCustomLineItemQuantityAction.php | 16 ++++++- ...ngeCustomLineItemQuantityActionBuilder.php | 31 +++++++++++++- ...hangeCustomLineItemQuantityActionModel.php | 38 ++++++++++++++++- .../StagedOrderRemoveCustomLineItemAction.php | 16 ++++++- ...OrderRemoveCustomLineItemActionBuilder.php | 33 ++++++++++++++- ...edOrderRemoveCustomLineItemActionModel.php | 38 ++++++++++++++++- ...rderSetCustomLineItemCustomFieldAction.php | 16 ++++++- ...CustomLineItemCustomFieldActionBuilder.php | 31 +++++++++++++- ...etCustomLineItemCustomFieldActionModel.php | 38 ++++++++++++++++- ...OrderSetCustomLineItemCustomTypeAction.php | 16 ++++++- ...tCustomLineItemCustomTypeActionBuilder.php | 31 +++++++++++++- ...SetCustomLineItemCustomTypeActionModel.php | 38 ++++++++++++++++- ...SetCustomLineItemShippingDetailsAction.php | 16 ++++++- ...omLineItemShippingDetailsActionBuilder.php | 31 +++++++++++++- ...stomLineItemShippingDetailsActionModel.php | 38 ++++++++++++++++- ...dOrderSetCustomLineItemTaxAmountAction.php | 16 ++++++- ...etCustomLineItemTaxAmountActionBuilder.php | 31 +++++++++++++- ...rSetCustomLineItemTaxAmountActionModel.php | 38 ++++++++++++++++- ...gedOrderSetCustomLineItemTaxRateAction.php | 16 ++++++- ...rSetCustomLineItemTaxRateActionBuilder.php | 31 +++++++++++++- ...derSetCustomLineItemTaxRateActionModel.php | 38 ++++++++++++++++- references.txt | 1 + 65 files changed, 1767 insertions(+), 65 deletions(-) diff --git a/changes.md b/changes.md index 7fb2d322fbc..b764689cd02 100644 --- a/changes.md +++ b/changes.md @@ -14,17 +14,59 @@ - added property `stores` to type `CartDiscount` - added property `stores` to type `CartDiscountDraft` +- added property `customLineItemKey` to type `CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction` +- added property `customLineItemKey` to type `CartChangeCustomLineItemMoneyAction` +- added property `customLineItemKey` to type `CartChangeCustomLineItemPriceModeAction` +- added property `customLineItemKey` to type `CartChangeCustomLineItemQuantityAction` +- added property `customLineItemKey` to type `CartRemoveCustomLineItemAction` +- added property `customLineItemKey` to type `CartSetCustomLineItemCustomFieldAction` +- added property `customLineItemKey` to type `CartSetCustomLineItemCustomTypeAction` +- added property `customLineItemKey` to type `CartSetCustomLineItemShippingDetailsAction` +- added property `customLineItemKey` to type `CartSetCustomLineItemTaxAmountAction` +- added property `customLineItemKey` to type `CartSetCustomLineItemTaxRateAction` - added property `directDiscounts` to type `StagedOrder` - added property `shippingDetails` to type `StagedOrderAddCustomLineItemAction` - added property `shippingKey` to type `StagedOrderAddDeliveryAction` - added property `inventoryMode` to type `StagedOrderAddLineItemAction` +- added property `customLineItemKey` to type `StagedOrderChangeCustomLineItemMoneyAction` +- added property `customLineItemKey` to type `StagedOrderChangeCustomLineItemQuantityAction` +- added property `customLineItemKey` to type `StagedOrderRemoveCustomLineItemAction` +- added property `customLineItemKey` to type `StagedOrderSetCustomLineItemCustomFieldAction` +- added property `customLineItemKey` to type `StagedOrderSetCustomLineItemCustomTypeAction` +- added property `customLineItemKey` to type `StagedOrderSetCustomLineItemShippingDetailsAction` +- added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxAmountAction` +- added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxRateAction` - added property `directDiscounts` to type `Order` +- added property `customLineItemKey` to type `OrderSetCustomLineItemCustomFieldAction` +- added property `customLineItemKey` to type `OrderSetCustomLineItemCustomTypeAction` +- added property `customLineItemKey` to type `OrderSetCustomLineItemShippingDetailsAction`
Required Property(s) +- changed property `customLineItemId` of type `CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction` to be optional +- changed property `customLineItemId` of type `CartChangeCustomLineItemMoneyAction` to be optional +- changed property `customLineItemId` of type `CartChangeCustomLineItemPriceModeAction` to be optional +- changed property `customLineItemId` of type `CartChangeCustomLineItemQuantityAction` to be optional +- changed property `customLineItemId` of type `CartRemoveCustomLineItemAction` to be optional +- changed property `customLineItemId` of type `CartSetCustomLineItemCustomFieldAction` to be optional +- changed property `customLineItemId` of type `CartSetCustomLineItemCustomTypeAction` to be optional +- changed property `customLineItemId` of type `CartSetCustomLineItemShippingDetailsAction` to be optional +- changed property `customLineItemId` of type `CartSetCustomLineItemTaxAmountAction` to be optional +- changed property `customLineItemId` of type `CartSetCustomLineItemTaxRateAction` to be optional +- changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemMoneyAction` to be optional +- changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemQuantityAction` to be optional +- changed property `customLineItemId` of type `StagedOrderRemoveCustomLineItemAction` to be optional +- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemCustomFieldAction` to be optional +- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemCustomTypeAction` to be optional +- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemShippingDetailsAction` to be optional +- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxAmountAction` to be optional +- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxRateAction` to be optional +- changed property `customLineItemId` of type `OrderSetCustomLineItemCustomFieldAction` to be optional +- changed property `customLineItemId` of type `OrderSetCustomLineItemCustomTypeAction` to be optional +- changed property `customLineItemId` of type `OrderSetCustomLineItemShippingDetailsAction` to be optional - :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required - :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required - :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php index c94d22005da..0b2f27c2caa 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction.php @@ -14,16 +14,25 @@ interface CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction extends CartUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_TARGETS_DELTA = 'targetsDelta'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Using positive or negative quantities increases or decreases the number of items shipped to an address.

* @@ -37,6 +46,11 @@ public function getTargetsDelta(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?ItemShippingTargetCollection $targetsDelta */ diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php index 84c742d5a32..58d8a6e5bf7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder.php @@ -26,6 +26,12 @@ final class CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder im */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?ItemShippingTargetCollection @@ -33,7 +39,7 @@ final class CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionBuilder im private $targetsDelta; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Using positive or negative quantities increases or decreases the number of items shipped to an address.

* @@ -65,6 +82,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?ItemShippingTargetCollection $targetsDelta * @return $this @@ -81,6 +109,7 @@ public function build(): CartApplyDeltaToCustomLineItemShippingDetailsTargetsAct { return new CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->targetsDelta ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php index e98e62e768e..f6da20fdfc9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel.php @@ -32,6 +32,12 @@ final class CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel exte */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?ItemShippingTargetCollection @@ -44,10 +50,12 @@ final class CartApplyDeltaToCustomLineItemShippingDetailsTargetsActionModel exte */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?ItemShippingTargetCollection $targetsDelta = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->targetsDelta = $targetsDelta; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Using positive or negative quantities increases or decreases the number of items shipped to an address.

* @@ -119,6 +147,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?ItemShippingTargetCollection $targetsDelta */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php index 419d56d67ea..fd1119a56b5 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyAction.php @@ -15,16 +15,25 @@ interface CartChangeCustomLineItemMoneyAction extends CartUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_MONEY = 'money'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Value to set. Must not be empty. Can be a negative amount.

* @@ -38,6 +47,11 @@ public function getMoney(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?Money $money */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php index 0614170f5a8..38ca8e854bf 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionBuilder.php @@ -28,6 +28,12 @@ final class CartChangeCustomLineItemMoneyActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|Money|MoneyBuilder @@ -35,7 +41,7 @@ final class CartChangeCustomLineItemMoneyActionBuilder implements Builder private $money; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -45,6 +51,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Value to set. Must not be empty. Can be a negative amount.

* @@ -67,6 +84,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?Money $money * @return $this @@ -93,6 +121,7 @@ public function build(): CartChangeCustomLineItemMoneyAction { return new CartChangeCustomLineItemMoneyActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->money instanceof MoneyBuilder ? $this->money->build() : $this->money ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php index 0ef0a2a6cc7..bafb5858ecd 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemMoneyActionModel.php @@ -34,6 +34,12 @@ final class CartChangeCustomLineItemMoneyActionModel extends JsonObjectModel imp */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?Money @@ -46,10 +52,12 @@ final class CartChangeCustomLineItemMoneyActionModel extends JsonObjectModel imp */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?Money $money = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->money = $money; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -73,7 +81,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -92,6 +100,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Value to set. Must not be empty. Can be a negative amount.

* @@ -122,6 +150,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?Money $money */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php index 1fabc298f09..ff255dcc3a8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeAction.php @@ -14,16 +14,25 @@ interface CartChangeCustomLineItemPriceModeAction extends CartUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_MODE = 'mode'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

New value to set. Must not be empty.

* @@ -37,6 +46,11 @@ public function getMode(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?string $mode */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php index c47abdb6893..8f3c54c4b97 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionBuilder.php @@ -26,6 +26,12 @@ final class CartChangeCustomLineItemPriceModeActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?string @@ -33,7 +39,7 @@ final class CartChangeCustomLineItemPriceModeActionBuilder implements Builder private $mode; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

New value to set. Must not be empty.

* @@ -65,6 +82,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?string $mode * @return $this @@ -81,6 +109,7 @@ public function build(): CartChangeCustomLineItemPriceModeAction { return new CartChangeCustomLineItemPriceModeActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->mode ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php index db255e637eb..b8fb6af3bd8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemPriceModeActionModel.php @@ -32,6 +32,12 @@ final class CartChangeCustomLineItemPriceModeActionModel extends JsonObjectModel */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?string @@ -44,10 +50,12 @@ final class CartChangeCustomLineItemPriceModeActionModel extends JsonObjectModel */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?string $mode = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->mode = $mode; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

New value to set. Must not be empty.

* @@ -119,6 +147,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?string $mode */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php index b38fd48b565..51e610b70d9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityAction.php @@ -14,16 +14,25 @@ interface CartChangeCustomLineItemQuantityAction extends CartUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_QUANTITY = 'quantity'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

New value to set.

*

If 0, the Custom Line Item is removed from the Cart.

@@ -38,6 +47,11 @@ public function getQuantity(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php index d7e1f0612cc..55b7f9d94d7 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionBuilder.php @@ -26,6 +26,12 @@ final class CartChangeCustomLineItemQuantityActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?int @@ -33,7 +39,7 @@ final class CartChangeCustomLineItemQuantityActionBuilder implements Builder private $quantity; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

New value to set.

*

If 0, the Custom Line Item is removed from the Cart.

@@ -66,6 +83,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -82,6 +110,7 @@ public function build(): CartChangeCustomLineItemQuantityAction { return new CartChangeCustomLineItemQuantityActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->quantity ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php index f26652cec8a..61023d5d459 100644 --- a/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartChangeCustomLineItemQuantityActionModel.php @@ -32,6 +32,12 @@ final class CartChangeCustomLineItemQuantityActionModel extends JsonObjectModel */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?int @@ -44,10 +50,12 @@ final class CartChangeCustomLineItemQuantityActionModel extends JsonObjectModel */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?int $quantity = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->quantity = $quantity; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

New value to set.

*

If 0, the Custom Line Item is removed from the Cart.

@@ -120,6 +148,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php index d5b9d6109c8..9cf9db380af 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemAction.php @@ -14,17 +14,31 @@ interface CartRemoveCustomLineItemAction extends CartUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; /** - *

id of the Custom Line Item to remove.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** * @param ?string $customLineItemId */ public function setCustomLineItemId(?string $customLineItemId): void; + + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php index 7f84ab83ea5..c6694617296 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionBuilder.php @@ -27,7 +27,13 @@ final class CartRemoveCustomLineItemActionBuilder implements Builder private $customLineItemId; /** - *

id of the Custom Line Item to remove.

+ + * @var ?string + */ + private $customLineItemKey; + + /** + *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -37,6 +43,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** * @param ?string $customLineItemId * @return $this @@ -48,11 +65,23 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + public function build(): CartRemoveCustomLineItemAction { return new CartRemoveCustomLineItemActionModel( - $this->customLineItemId + $this->customLineItemId, + $this->customLineItemKey ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php index 50aa00a2a8b..ab2b3e4fe39 100644 --- a/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartRemoveCustomLineItemActionModel.php @@ -32,15 +32,23 @@ final class CartRemoveCustomLineItemActionModel extends JsonObjectModel implemen */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * @psalm-suppress MissingParamType */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -63,7 +71,7 @@ public function getAction() } /** - *

id of the Custom Line Item to remove.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -82,6 +90,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** * @param ?string $customLineItemId @@ -90,4 +118,12 @@ public function setCustomLineItemId(?string $customLineItemId): void { $this->customLineItemId = $customLineItemId; } + + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php index b12f63473c8..511b3a310eb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldAction.php @@ -14,17 +14,26 @@ interface CartSetCustomLineItemCustomFieldAction extends CartUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_NAME = 'name'; public const FIELD_VALUE = 'value'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Name of the Custom Field.

* @@ -48,6 +57,11 @@ public function getValue(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php index 6d57081bd99..602bd875f2c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionBuilder.php @@ -26,6 +26,12 @@ final class CartSetCustomLineItemCustomFieldActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?string @@ -39,7 +45,7 @@ final class CartSetCustomLineItemCustomFieldActionBuilder implements Builder private $value; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -49,6 +55,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Name of the Custom Field.

* @@ -84,6 +101,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?string $name * @return $this @@ -111,6 +139,7 @@ public function build(): CartSetCustomLineItemCustomFieldAction { return new CartSetCustomLineItemCustomFieldActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->name, $this->value ); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php index a261f3e49e0..07003e8b31a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomFieldActionModel.php @@ -32,6 +32,12 @@ final class CartSetCustomLineItemCustomFieldActionModel extends JsonObjectModel */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?string @@ -50,11 +56,13 @@ final class CartSetCustomLineItemCustomFieldActionModel extends JsonObjectModel */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?string $name = null, $value = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->name = $name; $this->value = $value; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -79,7 +87,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -98,6 +106,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Name of the Custom Field.

* @@ -149,6 +177,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php index c5434ec77d3..7c30a47ece3 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeAction.php @@ -16,17 +16,26 @@ interface CartSetCustomLineItemCustomTypeAction extends CartUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_TYPE = 'type'; public const FIELD_FIELDS = 'fields'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

@@ -49,6 +58,11 @@ public function getFields(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php index a3ac17e123a..6dd67ed3928 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionBuilder.php @@ -30,6 +30,12 @@ final class CartSetCustomLineItemCustomTypeActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder @@ -43,7 +49,7 @@ final class CartSetCustomLineItemCustomTypeActionBuilder implements Builder private $fields; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -53,6 +59,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

@@ -87,6 +104,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?TypeResourceIdentifier $type * @return $this @@ -135,6 +163,7 @@ public function build(): CartSetCustomLineItemCustomTypeAction { return new CartSetCustomLineItemCustomTypeActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields ); diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php index bdad2655931..12829c4a627 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemCustomTypeActionModel.php @@ -36,6 +36,12 @@ final class CartSetCustomLineItemCustomTypeActionModel extends JsonObjectModel i */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?TypeResourceIdentifier @@ -54,11 +60,13 @@ final class CartSetCustomLineItemCustomTypeActionModel extends JsonObjectModel i */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?TypeResourceIdentifier $type = null, ?FieldContainer $fields = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->type = $type; $this->fields = $fields; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -83,7 +91,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -102,6 +110,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Defines the Type that extends the CustomLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the CustomLineItem.

@@ -154,6 +182,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php index 8a0ba788a54..2324cca8879 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsAction.php @@ -14,16 +14,25 @@ interface CartSetCustomLineItemShippingDetailsAction extends CartUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Value to set. * If empty, any existing value is removed.

@@ -38,6 +47,11 @@ public function getShippingDetails(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php index 99064ad75c1..19ad3e87136 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionBuilder.php @@ -26,6 +26,12 @@ final class CartSetCustomLineItemShippingDetailsActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder @@ -33,7 +39,7 @@ final class CartSetCustomLineItemShippingDetailsActionBuilder implements Builder private $shippingDetails; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, any existing value is removed.

@@ -66,6 +83,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this @@ -92,6 +120,7 @@ public function build(): CartSetCustomLineItemShippingDetailsAction { return new CartSetCustomLineItemShippingDetailsActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php index 634594746b9..e275981ec95 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemShippingDetailsActionModel.php @@ -32,6 +32,12 @@ final class CartSetCustomLineItemShippingDetailsActionModel extends JsonObjectMo */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?ItemShippingDetailsDraft @@ -44,10 +50,12 @@ final class CartSetCustomLineItemShippingDetailsActionModel extends JsonObjectMo */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?ItemShippingDetailsDraft $shippingDetails = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->shippingDetails = $shippingDetails; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, any existing value is removed.

@@ -121,6 +149,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php index 4f0d377c066..6e6d2ecee6f 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php @@ -14,16 +14,25 @@ interface CartSetCustomLineItemTaxAmountAction extends CartUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Value to set. * If empty, any existing value is removed.

@@ -38,6 +47,11 @@ public function getExternalTaxAmount(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?ExternalTaxAmountDraft $externalTaxAmount */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php index e65c635fb91..4c86ed294eb 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php @@ -26,6 +26,12 @@ final class CartSetCustomLineItemTaxAmountActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|ExternalTaxAmountDraft|ExternalTaxAmountDraftBuilder @@ -33,7 +39,7 @@ final class CartSetCustomLineItemTaxAmountActionBuilder implements Builder private $externalTaxAmount; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, any existing value is removed.

@@ -66,6 +83,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?ExternalTaxAmountDraft $externalTaxAmount * @return $this @@ -92,6 +120,7 @@ public function build(): CartSetCustomLineItemTaxAmountAction { return new CartSetCustomLineItemTaxAmountActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->externalTaxAmount instanceof ExternalTaxAmountDraftBuilder ? $this->externalTaxAmount->build() : $this->externalTaxAmount ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php index 1d5c61e85a5..5745acc4691 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php @@ -32,6 +32,12 @@ final class CartSetCustomLineItemTaxAmountActionModel extends JsonObjectModel im */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?ExternalTaxAmountDraft @@ -44,10 +50,12 @@ final class CartSetCustomLineItemTaxAmountActionModel extends JsonObjectModel im */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?ExternalTaxAmountDraft $externalTaxAmount = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->externalTaxAmount = $externalTaxAmount; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, any existing value is removed.

@@ -121,6 +149,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?ExternalTaxAmountDraft $externalTaxAmount */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php index d220e6b9816..0d606fd2e78 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php @@ -14,16 +14,25 @@ interface CartSetCustomLineItemTaxRateAction extends CartUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Value to set. * If empty, an existing value is removed.

@@ -38,6 +47,11 @@ public function getExternalTaxRate(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?ExternalTaxRateDraft $externalTaxRate */ diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php index dc6c3b5434a..15936c0196a 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php @@ -26,6 +26,12 @@ final class CartSetCustomLineItemTaxRateActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder @@ -33,7 +39,7 @@ final class CartSetCustomLineItemTaxRateActionBuilder implements Builder private $externalTaxRate; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, an existing value is removed.

@@ -66,6 +83,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?ExternalTaxRateDraft $externalTaxRate * @return $this @@ -92,6 +120,7 @@ public function build(): CartSetCustomLineItemTaxRateAction { return new CartSetCustomLineItemTaxRateActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php index 0f889b57693..8787c70d6a6 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php @@ -32,6 +32,12 @@ final class CartSetCustomLineItemTaxRateActionModel extends JsonObjectModel impl */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?ExternalTaxRateDraft @@ -44,10 +50,12 @@ final class CartSetCustomLineItemTaxRateActionModel extends JsonObjectModel impl */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?ExternalTaxRateDraft $externalTaxRate = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->externalTaxRate = $externalTaxRate; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, an existing value is removed.

@@ -121,6 +149,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?ExternalTaxRateDraft $externalTaxRate */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php index 217bc2dfa67..bb1adc18c1c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldAction.php @@ -14,17 +14,26 @@ interface OrderSetCustomLineItemCustomFieldAction extends OrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_NAME = 'name'; public const FIELD_VALUE = 'value'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Name of the Custom Field.

* @@ -48,6 +57,11 @@ public function getValue(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php index f8edeafdb6b..18e6768bebd 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionBuilder.php @@ -26,6 +26,12 @@ final class OrderSetCustomLineItemCustomFieldActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?string @@ -39,7 +45,7 @@ final class OrderSetCustomLineItemCustomFieldActionBuilder implements Builder private $value; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -49,6 +55,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Name of the Custom Field.

* @@ -84,6 +101,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?string $name * @return $this @@ -111,6 +139,7 @@ public function build(): OrderSetCustomLineItemCustomFieldAction { return new OrderSetCustomLineItemCustomFieldActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->name, $this->value ); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php index d3779b6da6a..8175841573d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomFieldActionModel.php @@ -32,6 +32,12 @@ final class OrderSetCustomLineItemCustomFieldActionModel extends JsonObjectModel */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?string @@ -50,11 +56,13 @@ final class OrderSetCustomLineItemCustomFieldActionModel extends JsonObjectModel */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?string $name = null, $value = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->name = $name; $this->value = $value; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -79,7 +87,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -98,6 +106,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Name of the Custom Field.

* @@ -149,6 +177,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php index 2758baf5ad4..3c64de5031f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeAction.php @@ -16,17 +16,26 @@ interface OrderSetCustomLineItemCustomTypeAction extends OrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_TYPE = 'type'; public const FIELD_FIELDS = 'fields'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Defines the Type that extends the Custom Line Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

@@ -49,6 +58,11 @@ public function getFields(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php index 39e6a7ae20a..8869a14c0a3 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionBuilder.php @@ -30,6 +30,12 @@ final class OrderSetCustomLineItemCustomTypeActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder @@ -43,7 +49,7 @@ final class OrderSetCustomLineItemCustomTypeActionBuilder implements Builder private $fields; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -53,6 +59,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Defines the Type that extends the Custom Line Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

@@ -87,6 +104,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?TypeResourceIdentifier $type * @return $this @@ -135,6 +163,7 @@ public function build(): OrderSetCustomLineItemCustomTypeAction { return new OrderSetCustomLineItemCustomTypeActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields ); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php index ebaa6dddeee..689612ed9ab 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemCustomTypeActionModel.php @@ -36,6 +36,12 @@ final class OrderSetCustomLineItemCustomTypeActionModel extends JsonObjectModel */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?TypeResourceIdentifier @@ -54,11 +60,13 @@ final class OrderSetCustomLineItemCustomTypeActionModel extends JsonObjectModel */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?TypeResourceIdentifier $type = null, ?FieldContainer $fields = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->type = $type; $this->fields = $fields; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -83,7 +91,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -102,6 +110,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Defines the Type that extends the Custom Line Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

@@ -154,6 +182,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php index 3277b426414..88bd51208ff 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsAction.php @@ -15,16 +15,25 @@ interface OrderSetCustomLineItemShippingDetailsAction extends OrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Value to set. * If empty, any existing value is removed.

@@ -39,6 +48,11 @@ public function getShippingDetails(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php index 4bee7247d20..4d38efa558e 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionBuilder.php @@ -28,6 +28,12 @@ final class OrderSetCustomLineItemShippingDetailsActionBuilder implements Builde */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder @@ -35,7 +41,7 @@ final class OrderSetCustomLineItemShippingDetailsActionBuilder implements Builde private $shippingDetails; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -45,6 +51,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, any existing value is removed.

@@ -68,6 +85,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this @@ -94,6 +122,7 @@ public function build(): OrderSetCustomLineItemShippingDetailsAction { return new OrderSetCustomLineItemShippingDetailsActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails ); } diff --git a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php index 27a86378da5..7f25722e6d6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetCustomLineItemShippingDetailsActionModel.php @@ -34,6 +34,12 @@ final class OrderSetCustomLineItemShippingDetailsActionModel extends JsonObjectM */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?ItemShippingDetailsDraft @@ -46,10 +52,12 @@ final class OrderSetCustomLineItemShippingDetailsActionModel extends JsonObjectM */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?ItemShippingDetailsDraft $shippingDetails = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->shippingDetails = $shippingDetails; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -73,7 +81,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -92,6 +100,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, any existing value is removed.

@@ -123,6 +151,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php index d7cb0e7fc9b..e01124e5f57 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyAction.php @@ -16,16 +16,25 @@ interface StagedOrderChangeCustomLineItemMoneyAction extends StagedOrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_MONEY = 'money'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Value to set. * Must not be empty. @@ -41,6 +50,11 @@ public function getMoney(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?Money $money */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php index a660b40ba9a..121e756aabc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionBuilder.php @@ -30,6 +30,12 @@ final class StagedOrderChangeCustomLineItemMoneyActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|Money|MoneyBuilder @@ -37,7 +43,7 @@ final class StagedOrderChangeCustomLineItemMoneyActionBuilder implements Builder private $money; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -47,6 +53,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Value to set. * Must not be empty. @@ -71,6 +88,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?Money $money * @return $this @@ -97,6 +125,7 @@ public function build(): StagedOrderChangeCustomLineItemMoneyAction { return new StagedOrderChangeCustomLineItemMoneyActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->money instanceof MoneyBuilder ? $this->money->build() : $this->money ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php index 3428966ca7d..ed2c0c327a4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemMoneyActionModel.php @@ -36,6 +36,12 @@ final class StagedOrderChangeCustomLineItemMoneyActionModel extends JsonObjectMo */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?Money @@ -48,10 +54,12 @@ final class StagedOrderChangeCustomLineItemMoneyActionModel extends JsonObjectMo */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?Money $money = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->money = $money; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -75,7 +83,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -94,6 +102,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Value to set. * Must not be empty. @@ -126,6 +154,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?Money $money */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php index 8b485e18764..f82704a77eb 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityAction.php @@ -15,16 +15,25 @@ interface StagedOrderChangeCustomLineItemQuantityAction extends StagedOrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_QUANTITY = 'quantity'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

New value to set. * If 0, the Custom Line Item is removed from the Order.

@@ -39,6 +48,11 @@ public function getQuantity(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php index 1b3fef1541a..5840e8f51bc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionBuilder.php @@ -28,6 +28,12 @@ final class StagedOrderChangeCustomLineItemQuantityActionBuilder implements Buil */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?int @@ -35,7 +41,7 @@ final class StagedOrderChangeCustomLineItemQuantityActionBuilder implements Buil private $quantity; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -45,6 +51,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

New value to set. * If 0, the Custom Line Item is removed from the Order.

@@ -68,6 +85,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -84,6 +112,7 @@ public function build(): StagedOrderChangeCustomLineItemQuantityAction { return new StagedOrderChangeCustomLineItemQuantityActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->quantity ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php index 07edb3fb033..f87d97c32ff 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderChangeCustomLineItemQuantityActionModel.php @@ -34,6 +34,12 @@ final class StagedOrderChangeCustomLineItemQuantityActionModel extends JsonObjec */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?int @@ -46,10 +52,12 @@ final class StagedOrderChangeCustomLineItemQuantityActionModel extends JsonObjec */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?int $quantity = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->quantity = $quantity; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -73,7 +81,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -92,6 +100,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

New value to set. * If 0, the Custom Line Item is removed from the Order.

@@ -122,6 +150,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php index f0d25f5962f..6941a690281 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemAction.php @@ -15,17 +15,31 @@ interface StagedOrderRemoveCustomLineItemAction extends StagedOrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; /** - *

id of the Custom Line Item to remove.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** * @param ?string $customLineItemId */ public function setCustomLineItemId(?string $customLineItemId): void; + + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php index ade405e1a10..9001ca08cb4 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionBuilder.php @@ -29,7 +29,13 @@ final class StagedOrderRemoveCustomLineItemActionBuilder implements Builder private $customLineItemId; /** - *

id of the Custom Line Item to remove.

+ + * @var ?string + */ + private $customLineItemKey; + + /** + *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -39,6 +45,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** * @param ?string $customLineItemId * @return $this @@ -50,11 +67,23 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + public function build(): StagedOrderRemoveCustomLineItemAction { return new StagedOrderRemoveCustomLineItemActionModel( - $this->customLineItemId + $this->customLineItemId, + $this->customLineItemKey ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php index 5824e401a1c..589a6a7125e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderRemoveCustomLineItemActionModel.php @@ -34,15 +34,23 @@ final class StagedOrderRemoveCustomLineItemActionModel extends JsonObjectModel i */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * @psalm-suppress MissingParamType */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -65,7 +73,7 @@ public function getAction() } /** - *

id of the Custom Line Item to remove.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -84,6 +92,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** * @param ?string $customLineItemId @@ -92,4 +120,12 @@ public function setCustomLineItemId(?string $customLineItemId): void { $this->customLineItemId = $customLineItemId; } + + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php index 044c5776ad7..7c047eda964 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldAction.php @@ -15,17 +15,26 @@ interface StagedOrderSetCustomLineItemCustomFieldAction extends StagedOrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_NAME = 'name'; public const FIELD_VALUE = 'value'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Name of the Custom Field.

* @@ -49,6 +58,11 @@ public function getValue(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php index 4e5cd02538d..fb1313390e5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionBuilder.php @@ -28,6 +28,12 @@ final class StagedOrderSetCustomLineItemCustomFieldActionBuilder implements Buil */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?string @@ -41,7 +47,7 @@ final class StagedOrderSetCustomLineItemCustomFieldActionBuilder implements Buil private $value; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -51,6 +57,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Name of the Custom Field.

* @@ -86,6 +103,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?string $name * @return $this @@ -113,6 +141,7 @@ public function build(): StagedOrderSetCustomLineItemCustomFieldAction { return new StagedOrderSetCustomLineItemCustomFieldActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->name, $this->value ); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php index 3b6b5636787..8176e530519 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomFieldActionModel.php @@ -34,6 +34,12 @@ final class StagedOrderSetCustomLineItemCustomFieldActionModel extends JsonObjec */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?string @@ -52,11 +58,13 @@ final class StagedOrderSetCustomLineItemCustomFieldActionModel extends JsonObjec */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?string $name = null, $value = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->name = $name; $this->value = $value; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -81,7 +89,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -100,6 +108,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Name of the Custom Field.

* @@ -151,6 +179,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php index bb143a0e3ec..38fec38105f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeAction.php @@ -17,17 +17,26 @@ interface StagedOrderSetCustomLineItemCustomTypeAction extends StagedOrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_TYPE = 'type'; public const FIELD_FIELDS = 'fields'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Defines the Type that extends the Custom Line Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

@@ -50,6 +59,11 @@ public function getFields(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php index 6ac9ddb09bd..93e4cf8ad2f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionBuilder.php @@ -32,6 +32,12 @@ final class StagedOrderSetCustomLineItemCustomTypeActionBuilder implements Build */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder @@ -45,7 +51,7 @@ final class StagedOrderSetCustomLineItemCustomTypeActionBuilder implements Build private $fields; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -55,6 +61,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Defines the Type that extends the Custom Line Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

@@ -89,6 +106,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?TypeResourceIdentifier $type * @return $this @@ -137,6 +165,7 @@ public function build(): StagedOrderSetCustomLineItemCustomTypeAction { return new StagedOrderSetCustomLineItemCustomTypeActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields ); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php index dbffc0a9e97..05e1d26d8ee 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemCustomTypeActionModel.php @@ -38,6 +38,12 @@ final class StagedOrderSetCustomLineItemCustomTypeActionModel extends JsonObject */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?TypeResourceIdentifier @@ -56,11 +62,13 @@ final class StagedOrderSetCustomLineItemCustomTypeActionModel extends JsonObject */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?TypeResourceIdentifier $type = null, ?FieldContainer $fields = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->type = $type; $this->fields = $fields; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -85,7 +93,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -104,6 +112,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Defines the Type that extends the Custom Line Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Custom Line Item.

@@ -156,6 +184,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php index c689fd3db61..f56242535f8 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsAction.php @@ -16,16 +16,25 @@ interface StagedOrderSetCustomLineItemShippingDetailsAction extends StagedOrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Value to set. * If empty, any existing value is removed.

@@ -40,6 +49,11 @@ public function getShippingDetails(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php index 76cf041d506..235fe20a0d3 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionBuilder.php @@ -30,6 +30,12 @@ final class StagedOrderSetCustomLineItemShippingDetailsActionBuilder implements */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|ItemShippingDetailsDraft|ItemShippingDetailsDraftBuilder @@ -37,7 +43,7 @@ final class StagedOrderSetCustomLineItemShippingDetailsActionBuilder implements private $shippingDetails; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -47,6 +53,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, any existing value is removed.

@@ -70,6 +87,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this @@ -96,6 +124,7 @@ public function build(): StagedOrderSetCustomLineItemShippingDetailsAction { return new StagedOrderSetCustomLineItemShippingDetailsActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php index f583b723dba..7cb9a5f5148 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemShippingDetailsActionModel.php @@ -36,6 +36,12 @@ final class StagedOrderSetCustomLineItemShippingDetailsActionModel extends JsonO */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?ItemShippingDetailsDraft @@ -48,10 +54,12 @@ final class StagedOrderSetCustomLineItemShippingDetailsActionModel extends JsonO */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?ItemShippingDetailsDraft $shippingDetails = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->shippingDetails = $shippingDetails; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -75,7 +83,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -94,6 +102,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, any existing value is removed.

@@ -125,6 +153,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?ItemShippingDetailsDraft $shippingDetails */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php index bf4900678a1..daaac2daa42 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php @@ -16,16 +16,25 @@ interface StagedOrderSetCustomLineItemTaxAmountAction extends StagedOrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Value to set. * If empty, any existing value is removed.

@@ -40,6 +49,11 @@ public function getExternalTaxAmount(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?ExternalTaxAmountDraft $externalTaxAmount */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php index 2b669cfcf8f..bb78f772258 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php @@ -30,6 +30,12 @@ final class StagedOrderSetCustomLineItemTaxAmountActionBuilder implements Builde */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|ExternalTaxAmountDraft|ExternalTaxAmountDraftBuilder @@ -37,7 +43,7 @@ final class StagedOrderSetCustomLineItemTaxAmountActionBuilder implements Builde private $externalTaxAmount; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -47,6 +53,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, any existing value is removed.

@@ -70,6 +87,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?ExternalTaxAmountDraft $externalTaxAmount * @return $this @@ -96,6 +124,7 @@ public function build(): StagedOrderSetCustomLineItemTaxAmountAction { return new StagedOrderSetCustomLineItemTaxAmountActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->externalTaxAmount instanceof ExternalTaxAmountDraftBuilder ? $this->externalTaxAmount->build() : $this->externalTaxAmount ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php index 5e72d851391..33b0b8ad43b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php @@ -36,6 +36,12 @@ final class StagedOrderSetCustomLineItemTaxAmountActionModel extends JsonObjectM */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?ExternalTaxAmountDraft @@ -48,10 +54,12 @@ final class StagedOrderSetCustomLineItemTaxAmountActionModel extends JsonObjectM */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?ExternalTaxAmountDraft $externalTaxAmount = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->externalTaxAmount = $externalTaxAmount; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -75,7 +83,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -94,6 +102,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, any existing value is removed.

@@ -125,6 +153,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?ExternalTaxAmountDraft $externalTaxAmount */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php index 7935559056a..1c2c8ad36cd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php @@ -16,16 +16,25 @@ interface StagedOrderSetCustomLineItemTaxRateAction extends StagedOrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Value to set. * If empty, an existing value is removed.

@@ -40,6 +49,11 @@ public function getExternalTaxRate(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?ExternalTaxRateDraft $externalTaxRate */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php index 0d3f65b33d8..ee1e8ba51da 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php @@ -30,6 +30,12 @@ final class StagedOrderSetCustomLineItemTaxRateActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder @@ -37,7 +43,7 @@ final class StagedOrderSetCustomLineItemTaxRateActionBuilder implements Builder private $externalTaxRate; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -47,6 +53,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, an existing value is removed.

@@ -70,6 +87,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?ExternalTaxRateDraft $externalTaxRate * @return $this @@ -96,6 +124,7 @@ public function build(): StagedOrderSetCustomLineItemTaxRateAction { return new StagedOrderSetCustomLineItemTaxRateActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php index 9bd06c69556..4259b289fce 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php @@ -36,6 +36,12 @@ final class StagedOrderSetCustomLineItemTaxRateActionModel extends JsonObjectMod */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?ExternalTaxRateDraft @@ -48,10 +54,12 @@ final class StagedOrderSetCustomLineItemTaxRateActionModel extends JsonObjectMod */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?ExternalTaxRateDraft $externalTaxRate = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->externalTaxRate = $externalTaxRate; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -75,7 +83,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -94,6 +102,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Value to set. * If empty, an existing value is removed.

@@ -125,6 +153,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?ExternalTaxRateDraft $externalTaxRate */ diff --git a/references.txt b/references.txt index b8aaba98d43..f3e931f7815 100644 --- a/references.txt +++ b/references.txt @@ -71,3 +71,4 @@ cc581bbaa4c907418e64d72d70a1b17ef1297638 e40afdfd0ae914b593926d478cb307e9a3b7328b da31e9917b314501c2a67a8e3bc2e6dfe9c228ca 409fe5dd4ae936941f2654ae5fa5598ea983d3ac +e67d95b62824670b34d2441b151b4a4540c650fd From 567b845f3b0b9df50c328e59e30ad49c12f464ab Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 14 Jul 2023 11:40:50 +0000 Subject: [PATCH 11/44] TASK: Updating SDK --- changes.md | 16 ++++++++ .../LineItemStateTransitionMessage.php | 14 +++++++ .../LineItemStateTransitionMessageBuilder.php | 29 ++++++++++++++ .../LineItemStateTransitionMessageModel.php | 36 ++++++++++++++++++ .../LineItemStateTransitionMessagePayload.php | 14 +++++++ ...emStateTransitionMessagePayloadBuilder.php | 29 ++++++++++++++ ...ItemStateTransitionMessagePayloadModel.php | 36 ++++++++++++++++++ .../OrderLineItemDiscountSetMessage.php | 14 +++++++ ...OrderLineItemDiscountSetMessageBuilder.php | 29 ++++++++++++++ .../OrderLineItemDiscountSetMessageModel.php | 36 ++++++++++++++++++ ...OrderLineItemDiscountSetMessagePayload.php | 14 +++++++ ...neItemDiscountSetMessagePayloadBuilder.php | 29 ++++++++++++++ ...LineItemDiscountSetMessagePayloadModel.php | 36 ++++++++++++++++++ ...rLineItemDistributionChannelSetMessage.php | 14 +++++++ ...emDistributionChannelSetMessageBuilder.php | 29 ++++++++++++++ ...ItemDistributionChannelSetMessageModel.php | 36 ++++++++++++++++++ ...emDistributionChannelSetMessagePayload.php | 14 +++++++ ...ibutionChannelSetMessagePayloadBuilder.php | 29 ++++++++++++++ ...tributionChannelSetMessagePayloadModel.php | 36 ++++++++++++++++++ .../Message/OrderLineItemRemovedMessage.php | 14 +++++++ .../OrderLineItemRemovedMessageBuilder.php | 29 ++++++++++++++ .../OrderLineItemRemovedMessageModel.php | 36 ++++++++++++++++++ .../OrderLineItemRemovedMessagePayload.php | 14 +++++++ ...erLineItemRemovedMessagePayloadBuilder.php | 29 ++++++++++++++ ...rderLineItemRemovedMessagePayloadModel.php | 36 ++++++++++++++++++ .../Order/OrderImportLineItemStateAction.php | 16 +++++++- .../OrderImportLineItemStateActionBuilder.php | 31 ++++++++++++++- .../OrderImportLineItemStateActionModel.php | 38 ++++++++++++++++++- .../OrderTransitionLineItemStateAction.php | 16 +++++++- ...erTransitionLineItemStateActionBuilder.php | 31 ++++++++++++++- ...rderTransitionLineItemStateActionModel.php | 38 ++++++++++++++++++- .../StagedOrderImportLineItemStateAction.php | 16 +++++++- ...dOrderImportLineItemStateActionBuilder.php | 31 ++++++++++++++- ...gedOrderImportLineItemStateActionModel.php | 38 ++++++++++++++++++- ...agedOrderTransitionLineItemStateAction.php | 16 +++++++- ...erTransitionLineItemStateActionBuilder.php | 31 ++++++++++++++- ...rderTransitionLineItemStateActionModel.php | 38 ++++++++++++++++++- references.txt | 1 + 38 files changed, 977 insertions(+), 12 deletions(-) diff --git a/changes.md b/changes.md index b764689cd02..431665c3c61 100644 --- a/changes.md +++ b/changes.md @@ -24,22 +24,34 @@ - added property `customLineItemKey` to type `CartSetCustomLineItemShippingDetailsAction` - added property `customLineItemKey` to type `CartSetCustomLineItemTaxAmountAction` - added property `customLineItemKey` to type `CartSetCustomLineItemTaxRateAction` +- added property `lineItemKey` to type `LineItemStateTransitionMessage` +- added property `lineItemKey` to type `OrderLineItemDiscountSetMessage` +- added property `lineItemKey` to type `OrderLineItemDistributionChannelSetMessage` +- added property `lineItemKey` to type `OrderLineItemRemovedMessage` +- added property `lineItemKey` to type `LineItemStateTransitionMessagePayload` +- added property `lineItemKey` to type `OrderLineItemDiscountSetMessagePayload` +- added property `lineItemKey` to type `OrderLineItemDistributionChannelSetMessagePayload` +- added property `lineItemKey` to type `OrderLineItemRemovedMessagePayload` - added property `directDiscounts` to type `StagedOrder` - added property `shippingDetails` to type `StagedOrderAddCustomLineItemAction` - added property `shippingKey` to type `StagedOrderAddDeliveryAction` - added property `inventoryMode` to type `StagedOrderAddLineItemAction` - added property `customLineItemKey` to type `StagedOrderChangeCustomLineItemMoneyAction` - added property `customLineItemKey` to type `StagedOrderChangeCustomLineItemQuantityAction` +- added property `lineItemKey` to type `StagedOrderImportLineItemStateAction` - added property `customLineItemKey` to type `StagedOrderRemoveCustomLineItemAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemCustomFieldAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemCustomTypeAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemShippingDetailsAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxAmountAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxRateAction` +- added property `lineItemKey` to type `StagedOrderTransitionLineItemStateAction` - added property `directDiscounts` to type `Order` +- added property `lineItemKey` to type `OrderImportLineItemStateAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemCustomFieldAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemCustomTypeAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemShippingDetailsAction` +- added property `lineItemKey` to type `OrderTransitionLineItemStateAction`
@@ -58,15 +70,19 @@ - changed property `customLineItemId` of type `CartSetCustomLineItemTaxRateAction` to be optional - changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemMoneyAction` to be optional - changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemQuantityAction` to be optional +- changed property `lineItemId` of type `StagedOrderImportLineItemStateAction` to be optional - changed property `customLineItemId` of type `StagedOrderRemoveCustomLineItemAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemCustomFieldAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemCustomTypeAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemShippingDetailsAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxAmountAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxRateAction` to be optional +- changed property `lineItemId` of type `StagedOrderTransitionLineItemStateAction` to be optional +- changed property `lineItemId` of type `OrderImportLineItemStateAction` to be optional - changed property `customLineItemId` of type `OrderSetCustomLineItemCustomFieldAction` to be optional - changed property `customLineItemId` of type `OrderSetCustomLineItemCustomTypeAction` to be optional - changed property `customLineItemId` of type `OrderSetCustomLineItemShippingDetailsAction` to be optional +- changed property `lineItemId` of type `OrderTransitionLineItemStateAction` to be optional - :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required - :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required - :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessage.php index e20f229d5b8..586cddb13c9 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessage.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessage.php @@ -16,6 +16,7 @@ interface LineItemStateTransitionMessage extends OrderMessage { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_TRANSITION_DATE = 'transitionDate'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_FROM_STATE = 'fromState'; @@ -29,6 +30,14 @@ interface LineItemStateTransitionMessage extends OrderMessage */ public function getLineItemId(); + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Date and time (UTC) when the transition of the Line Item State was performed.

* @@ -66,6 +75,11 @@ public function getToState(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?DateTimeImmutable $transitionDate */ diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageBuilder.php index 44037716006..3ae87c23402 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageBuilder.php @@ -95,6 +95,12 @@ final class LineItemStateTransitionMessageBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?DateTimeImmutable @@ -241,6 +247,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Date and time (UTC) when the transition of the Line Item State was performed.

* @@ -406,6 +423,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?DateTimeImmutable $transitionDate * @return $this @@ -530,6 +558,7 @@ public function build(): LineItemStateTransitionMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->lineItemId, + $this->lineItemKey, $this->transitionDate, $this->quantity, $this->fromState instanceof StateReferenceBuilder ? $this->fromState->build() : $this->fromState, diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageModel.php index 03d49e2d289..f1ba284f1ba 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessageModel.php @@ -101,6 +101,12 @@ final class LineItemStateTransitionMessageModel extends JsonObjectModel implemen */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?DateTimeImmutable @@ -141,6 +147,7 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $lineItemId = null, + ?string $lineItemKey = null, ?DateTimeImmutable $transitionDate = null, ?int $quantity = null, ?StateReference $fromState = null, @@ -158,6 +165,7 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->transitionDate = $transitionDate; $this->quantity = $quantity; $this->fromState = $fromState; @@ -418,6 +426,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Date and time (UTC) when the transition of the Line Item State was performed.

* @@ -593,6 +621,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?DateTimeImmutable $transitionDate */ diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayload.php index f1df497c39a..4c255e18a3f 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayload.php @@ -16,6 +16,7 @@ interface LineItemStateTransitionMessagePayload extends OrderMessagePayload { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_TRANSITION_DATE = 'transitionDate'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_FROM_STATE = 'fromState'; @@ -29,6 +30,14 @@ interface LineItemStateTransitionMessagePayload extends OrderMessagePayload */ public function getLineItemId(); + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Date and time (UTC) when the transition of the Line Item State was performed.

* @@ -66,6 +75,11 @@ public function getToState(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?DateTimeImmutable $transitionDate */ diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadBuilder.php index 95569e2c656..3f49c0e6442 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadBuilder.php @@ -29,6 +29,12 @@ final class LineItemStateTransitionMessagePayloadBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?DateTimeImmutable @@ -64,6 +70,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Date and time (UTC) when the transition of the Line Item State was performed.

* @@ -119,6 +136,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?DateTimeImmutable $transitionDate * @return $this @@ -189,6 +217,7 @@ public function build(): LineItemStateTransitionMessagePayload { return new LineItemStateTransitionMessagePayloadModel( $this->lineItemId, + $this->lineItemKey, $this->transitionDate, $this->quantity, $this->fromState instanceof StateReferenceBuilder ? $this->fromState->build() : $this->fromState, diff --git a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadModel.php index ac54ae0c872..2d507cbec70 100644 --- a/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/LineItemStateTransitionMessagePayloadModel.php @@ -35,6 +35,12 @@ final class LineItemStateTransitionMessagePayloadModel extends JsonObjectModel i */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?DateTimeImmutable @@ -65,6 +71,7 @@ final class LineItemStateTransitionMessagePayloadModel extends JsonObjectModel i */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?DateTimeImmutable $transitionDate = null, ?int $quantity = null, ?StateReference $fromState = null, @@ -72,6 +79,7 @@ public function __construct( ?string $type = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->transitionDate = $transitionDate; $this->quantity = $quantity; $this->fromState = $fromState; @@ -117,6 +125,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Date and time (UTC) when the transition of the Line Item State was performed.

* @@ -212,6 +240,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?DateTimeImmutable $transitionDate */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php index 5edaa210699..cfd5fe66f72 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessage.php @@ -18,6 +18,7 @@ interface OrderLineItemDiscountSetMessage extends OrderMessage { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity'; public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_TAXED_PRICE = 'taxedPrice'; @@ -31,6 +32,14 @@ interface OrderLineItemDiscountSetMessage extends OrderMessage */ public function getLineItemId(); + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -68,6 +77,11 @@ public function getTaxedPricePortions(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php index 91724b4f729..ed447c98f4c 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageBuilder.php @@ -99,6 +99,12 @@ final class OrderLineItemDiscountSetMessageBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?DiscountedLineItemPriceForQuantityCollection @@ -245,6 +251,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -410,6 +427,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity * @return $this @@ -534,6 +562,7 @@ public function build(): OrderLineItemDiscountSetMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->lineItemId, + $this->lineItemKey, $this->discountedPricePerQuantity, $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php index 89e247189c4..848bf0c0c30 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessageModel.php @@ -105,6 +105,12 @@ final class OrderLineItemDiscountSetMessageModel extends JsonObjectModel impleme */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?DiscountedLineItemPriceForQuantityCollection @@ -145,6 +151,7 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $lineItemId = null, + ?string $lineItemKey = null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, ?Money $totalPrice = null, ?TaxedItemPrice $taxedPrice = null, @@ -162,6 +169,7 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; @@ -422,6 +430,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -593,6 +621,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php index 2e7be7b3b2e..93eff9cde2d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayload.php @@ -18,6 +18,7 @@ interface OrderLineItemDiscountSetMessagePayload extends OrderMessagePayload { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity'; public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_TAXED_PRICE = 'taxedPrice'; @@ -31,6 +32,14 @@ interface OrderLineItemDiscountSetMessagePayload extends OrderMessagePayload */ public function getLineItemId(); + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -68,6 +77,11 @@ public function getTaxedPricePortions(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php index e003e91b3c4..19a6439bcb2 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadBuilder.php @@ -32,6 +32,12 @@ final class OrderLineItemDiscountSetMessagePayloadBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?DiscountedLineItemPriceForQuantityCollection @@ -67,6 +73,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -122,6 +139,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity * @return $this @@ -192,6 +220,7 @@ public function build(): OrderLineItemDiscountSetMessagePayload { return new OrderLineItemDiscountSetMessagePayloadModel( $this->lineItemId, + $this->lineItemKey, $this->discountedPricePerQuantity, $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php index 0554fdde612..b0d680acc22 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDiscountSetMessagePayloadModel.php @@ -38,6 +38,12 @@ final class OrderLineItemDiscountSetMessagePayloadModel extends JsonObjectModel */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?DiscountedLineItemPriceForQuantityCollection @@ -68,6 +74,7 @@ final class OrderLineItemDiscountSetMessagePayloadModel extends JsonObjectModel */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, ?Money $totalPrice = null, ?TaxedItemPrice $taxedPrice = null, @@ -75,6 +82,7 @@ public function __construct( ?string $type = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; @@ -120,6 +128,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -211,6 +239,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessage.php index 720bc36be42..4c995cb3d4e 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessage.php @@ -15,6 +15,7 @@ interface OrderLineItemDistributionChannelSetMessage extends OrderMessage { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; /** @@ -25,6 +26,14 @@ interface OrderLineItemDistributionChannelSetMessage extends OrderMessage */ public function getLineItemId(); + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Distribution Channel that was set.

* @@ -38,6 +47,11 @@ public function getDistributionChannel(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?ChannelReference $distributionChannel */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageBuilder.php index 27b7a603ca4..d6db4eb8cd0 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageBuilder.php @@ -95,6 +95,12 @@ final class OrderLineItemDistributionChannelSetMessageBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var null|ChannelReference|ChannelReferenceBuilder @@ -223,6 +229,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Distribution Channel that was set.

* @@ -355,6 +372,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?ChannelReference $distributionChannel * @return $this @@ -435,6 +463,7 @@ public function build(): OrderLineItemDistributionChannelSetMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->lineItemId, + $this->lineItemKey, $this->distributionChannel instanceof ChannelReferenceBuilder ? $this->distributionChannel->build() : $this->distributionChannel ); } diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageModel.php index 7c5a9d7e6e2..f1785e39a53 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessageModel.php @@ -101,6 +101,12 @@ final class OrderLineItemDistributionChannelSetMessageModel extends JsonObjectMo */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?ChannelReference @@ -123,6 +129,7 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $lineItemId = null, + ?string $lineItemKey = null, ?ChannelReference $distributionChannel = null, ?string $type = null ) { @@ -137,6 +144,7 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->distributionChannel = $distributionChannel; $this->type = $type ?? self::DISCRIMINATOR_VALUE; } @@ -394,6 +402,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Distribution Channel that was set.

* @@ -504,6 +532,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?ChannelReference $distributionChannel */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayload.php index a57058174c5..fab134aa58d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayload.php @@ -15,6 +15,7 @@ interface OrderLineItemDistributionChannelSetMessagePayload extends OrderMessagePayload { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; /** @@ -25,6 +26,14 @@ interface OrderLineItemDistributionChannelSetMessagePayload extends OrderMessage */ public function getLineItemId(); + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Distribution Channel that was set.

* @@ -38,6 +47,11 @@ public function getDistributionChannel(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?ChannelReference $distributionChannel */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadBuilder.php index 3ef1d5b8d74..4a4b8afddda 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadBuilder.php @@ -28,6 +28,12 @@ final class OrderLineItemDistributionChannelSetMessagePayloadBuilder implements */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var null|ChannelReference|ChannelReferenceBuilder @@ -45,6 +51,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Distribution Channel that was set.

* @@ -67,6 +84,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?ChannelReference $distributionChannel * @return $this @@ -93,6 +121,7 @@ public function build(): OrderLineItemDistributionChannelSetMessagePayload { return new OrderLineItemDistributionChannelSetMessagePayloadModel( $this->lineItemId, + $this->lineItemKey, $this->distributionChannel instanceof ChannelReferenceBuilder ? $this->distributionChannel->build() : $this->distributionChannel ); } diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadModel.php index 66732bc9b10..7ada5ec6b8a 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemDistributionChannelSetMessagePayloadModel.php @@ -34,6 +34,12 @@ final class OrderLineItemDistributionChannelSetMessagePayloadModel extends JsonO */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?ChannelReference @@ -46,10 +52,12 @@ final class OrderLineItemDistributionChannelSetMessagePayloadModel extends JsonO */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?ChannelReference $distributionChannel = null, ?string $type = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->distributionChannel = $distributionChannel; $this->type = $type ?? self::DISCRIMINATOR_VALUE; } @@ -92,6 +100,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Distribution Channel that was set.

* @@ -122,6 +150,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?ChannelReference $distributionChannel */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessage.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessage.php index 4955293004e..083affa7af4 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessage.php @@ -19,6 +19,7 @@ interface OrderLineItemRemovedMessage extends OrderMessage { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_REMOVED_QUANTITY = 'removedQuantity'; public const FIELD_NEW_QUANTITY = 'newQuantity'; public const FIELD_NEW_STATE = 'newState'; @@ -35,6 +36,14 @@ interface OrderLineItemRemovedMessage extends OrderMessage */ public function getLineItemId(); + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Quantity of Line Items that were removed during the Remove Line Item update action.

* @@ -96,6 +105,11 @@ public function getNewShippingDetail(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?int $removedQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageBuilder.php index 7965fa02b5b..49036fded37 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageBuilder.php @@ -102,6 +102,12 @@ final class OrderLineItemRemovedMessageBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?int @@ -266,6 +272,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Quantity of Line Items that were removed during the Remove Line Item update action.

* @@ -464,6 +481,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?int $removedQuantity * @return $this @@ -643,6 +671,7 @@ public function build(): OrderLineItemRemovedMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->lineItemId, + $this->lineItemKey, $this->removedQuantity, $this->newQuantity, $this->newState, diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageModel.php index ee17669f624..d7cfb465007 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessageModel.php @@ -108,6 +108,12 @@ final class OrderLineItemRemovedMessageModel extends JsonObjectModel implements */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?int @@ -166,6 +172,7 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $lineItemId = null, + ?string $lineItemKey = null, ?int $removedQuantity = null, ?int $newQuantity = null, ?ItemStateCollection $newState = null, @@ -186,6 +193,7 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->removedQuantity = $removedQuantity; $this->newQuantity = $newQuantity; $this->newState = $newState; @@ -449,6 +457,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Quantity of Line Items that were removed during the Remove Line Item update action.

* @@ -682,6 +710,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?int $removedQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayload.php index 6e3feff88b1..168d3735bb8 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayload.php @@ -19,6 +19,7 @@ interface OrderLineItemRemovedMessagePayload extends OrderMessagePayload { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_REMOVED_QUANTITY = 'removedQuantity'; public const FIELD_NEW_QUANTITY = 'newQuantity'; public const FIELD_NEW_STATE = 'newState'; @@ -35,6 +36,14 @@ interface OrderLineItemRemovedMessagePayload extends OrderMessagePayload */ public function getLineItemId(); + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Quantity of Line Items that were removed during the Remove Line Item update action.

* @@ -96,6 +105,11 @@ public function getNewShippingDetail(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?int $removedQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadBuilder.php index 74f68fcb136..7652cdb2454 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadBuilder.php @@ -35,6 +35,12 @@ final class OrderLineItemRemovedMessagePayloadBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?int @@ -88,6 +94,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Quantity of Line Items that were removed during the Remove Line Item update action.

* @@ -176,6 +193,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?int $removedQuantity * @return $this @@ -301,6 +329,7 @@ public function build(): OrderLineItemRemovedMessagePayload { return new OrderLineItemRemovedMessagePayloadModel( $this->lineItemId, + $this->lineItemKey, $this->removedQuantity, $this->newQuantity, $this->newState, diff --git a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadModel.php index b7c11a33856..fb353ab1885 100644 --- a/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderLineItemRemovedMessagePayloadModel.php @@ -41,6 +41,12 @@ final class OrderLineItemRemovedMessagePayloadModel extends JsonObjectModel impl */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?int @@ -89,6 +95,7 @@ final class OrderLineItemRemovedMessagePayloadModel extends JsonObjectModel impl */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?int $removedQuantity = null, ?int $newQuantity = null, ?ItemStateCollection $newState = null, @@ -99,6 +106,7 @@ public function __construct( ?string $type = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->removedQuantity = $removedQuantity; $this->newQuantity = $newQuantity; $this->newState = $newState; @@ -147,6 +155,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

User-defined unique identifier of the LineItem.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Quantity of Line Items that were removed during the Remove Line Item update action.

* @@ -300,6 +328,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?int $removedQuantity */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php index f60fa5ee286..3803b95987f 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateAction.php @@ -14,16 +14,25 @@ interface OrderImportLineItemStateAction extends OrderUpdateAction { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_STATE = 'state'; /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getLineItemId(); + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

New status of the Line Items.

* @@ -37,6 +46,11 @@ public function getState(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?ItemStateCollection $state */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php index a2ac96b9092..543565dcaa1 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionBuilder.php @@ -26,6 +26,12 @@ final class OrderImportLineItemStateActionBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?ItemStateCollection @@ -33,7 +39,7 @@ final class OrderImportLineItemStateActionBuilder implements Builder private $state; /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

New status of the Line Items.

* @@ -65,6 +82,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?ItemStateCollection $state * @return $this @@ -81,6 +109,7 @@ public function build(): OrderImportLineItemStateAction { return new OrderImportLineItemStateActionModel( $this->lineItemId, + $this->lineItemKey, $this->state ); } diff --git a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php index 4bef20c7443..3e3d411fea5 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportLineItemStateActionModel.php @@ -32,6 +32,12 @@ final class OrderImportLineItemStateActionModel extends JsonObjectModel implemen */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?ItemStateCollection @@ -44,10 +50,12 @@ final class OrderImportLineItemStateActionModel extends JsonObjectModel implemen */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?ItemStateCollection $state = null, ?string $action = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->state = $state; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

New status of the Line Items.

* @@ -119,6 +147,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?ItemStateCollection $state */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php index ccda9a71903..c3061620ae6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateAction.php @@ -16,19 +16,28 @@ interface OrderTransitionLineItemStateAction extends OrderUpdateAction { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_FROM_STATE = 'fromState'; public const FIELD_TO_STATE = 'toState'; public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getLineItemId(); + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Number of Line Items that should transition State.

* @@ -66,6 +75,11 @@ public function getActualTransitionDate(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php index 9c4b1769067..372de15f161 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionBuilder.php @@ -29,6 +29,12 @@ final class OrderTransitionLineItemStateActionBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?int @@ -54,7 +60,7 @@ final class OrderTransitionLineItemStateActionBuilder implements Builder private $actualTransitionDate; /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -64,6 +70,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Number of Line Items that should transition State.

* @@ -119,6 +136,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -189,6 +217,7 @@ public function build(): OrderTransitionLineItemStateAction { return new OrderTransitionLineItemStateActionModel( $this->lineItemId, + $this->lineItemKey, $this->quantity, $this->fromState instanceof StateResourceIdentifierBuilder ? $this->fromState->build() : $this->fromState, $this->toState instanceof StateResourceIdentifierBuilder ? $this->toState->build() : $this->toState, diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php index f817ba21ec4..ff4d134616d 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionLineItemStateActionModel.php @@ -35,6 +35,12 @@ final class OrderTransitionLineItemStateActionModel extends JsonObjectModel impl */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?int @@ -65,6 +71,7 @@ final class OrderTransitionLineItemStateActionModel extends JsonObjectModel impl */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?int $quantity = null, ?StateResourceIdentifier $fromState = null, ?StateResourceIdentifier $toState = null, @@ -72,6 +79,7 @@ public function __construct( ?string $action = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; @@ -98,7 +106,7 @@ public function getAction() } /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -117,6 +125,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Number of Line Items that should transition State.

* @@ -212,6 +240,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php index 2cf4ac3c145..ec9bc1a24e6 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateAction.php @@ -16,16 +16,25 @@ interface StagedOrderImportLineItemStateAction extends StagedOrderUpdateAction { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_STATE = 'state'; /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getLineItemId(); + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

New status of the Line Items.

* @@ -39,6 +48,11 @@ public function getState(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?ItemStateCollection $state */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php index 822ca2a0bb0..d75242f28bf 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionBuilder.php @@ -29,6 +29,12 @@ final class StagedOrderImportLineItemStateActionBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?ItemStateCollection @@ -36,7 +42,7 @@ final class StagedOrderImportLineItemStateActionBuilder implements Builder private $state; /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -46,6 +52,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

New status of the Line Items.

* @@ -68,6 +85,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?ItemStateCollection $state * @return $this @@ -84,6 +112,7 @@ public function build(): StagedOrderImportLineItemStateAction { return new StagedOrderImportLineItemStateActionModel( $this->lineItemId, + $this->lineItemKey, $this->state ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php index aaf5c30e94d..aa25b5c8a2e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportLineItemStateActionModel.php @@ -35,6 +35,12 @@ final class StagedOrderImportLineItemStateActionModel extends JsonObjectModel im */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?ItemStateCollection @@ -47,10 +53,12 @@ final class StagedOrderImportLineItemStateActionModel extends JsonObjectModel im */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?ItemStateCollection $state = null, ?string $action = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->state = $state; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -74,7 +82,7 @@ public function getAction() } /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -93,6 +101,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

New status of the Line Items.

* @@ -122,6 +150,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?ItemStateCollection $state */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php index cbe49ef9015..0a3a2c2f7ad 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateAction.php @@ -17,19 +17,28 @@ interface StagedOrderTransitionLineItemStateAction extends StagedOrderUpdateAction { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_FROM_STATE = 'fromState'; public const FIELD_TO_STATE = 'toState'; public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getLineItemId(); + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Number of Line Items that should transition State.

* @@ -67,6 +76,11 @@ public function getActualTransitionDate(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php index 4c5edb5bc71..731ad8b5d8c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionBuilder.php @@ -31,6 +31,12 @@ final class StagedOrderTransitionLineItemStateActionBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?int @@ -56,7 +62,7 @@ final class StagedOrderTransitionLineItemStateActionBuilder implements Builder private $actualTransitionDate; /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -66,6 +72,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Number of Line Items that should transition State.

* @@ -121,6 +138,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -191,6 +219,7 @@ public function build(): StagedOrderTransitionLineItemStateAction { return new StagedOrderTransitionLineItemStateActionModel( $this->lineItemId, + $this->lineItemKey, $this->quantity, $this->fromState instanceof StateResourceIdentifierBuilder ? $this->fromState->build() : $this->fromState, $this->toState instanceof StateResourceIdentifierBuilder ? $this->toState->build() : $this->toState, diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php index 8e24d307a4e..014455301d1 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionLineItemStateActionModel.php @@ -37,6 +37,12 @@ final class StagedOrderTransitionLineItemStateActionModel extends JsonObjectMode */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?int @@ -67,6 +73,7 @@ final class StagedOrderTransitionLineItemStateActionModel extends JsonObjectMode */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?int $quantity = null, ?StateResourceIdentifier $fromState = null, ?StateResourceIdentifier $toState = null, @@ -74,6 +81,7 @@ public function __construct( ?string $action = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; @@ -100,7 +108,7 @@ public function getAction() } /** - *

id of the LineItem to update.

+ *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -119,6 +127,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Number of Line Items that should transition State.

* @@ -214,6 +242,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?int $quantity */ diff --git a/references.txt b/references.txt index f3e931f7815..1c1e6f96f64 100644 --- a/references.txt +++ b/references.txt @@ -72,3 +72,4 @@ e40afdfd0ae914b593926d478cb307e9a3b7328b da31e9917b314501c2a67a8e3bc2e6dfe9c228ca 409fe5dd4ae936941f2654ae5fa5598ea983d3ac e67d95b62824670b34d2441b151b4a4540c650fd +eb9b378300a33f0fa88c299529ff4ea856d7a05a From ee47eee2224b448257e4246add19c538c3212671 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 14 Jul 2023 12:12:56 +0000 Subject: [PATCH 12/44] TASK: Updating SDK --- changes.md | 7 +++++++ references.txt | 1 + 2 files changed, 8 insertions(+) diff --git a/changes.md b/changes.md index 431665c3c61..8b5633b1f17 100644 --- a/changes.md +++ b/changes.md @@ -136,6 +136,13 @@ +
+Added Enum(s) + +- added enum `associate-role` to type `ChangeSubscriptionResourceTypeId` +
+ +
Added Method(s) diff --git a/references.txt b/references.txt index 1c1e6f96f64..59a545317ba 100644 --- a/references.txt +++ b/references.txt @@ -73,3 +73,4 @@ da31e9917b314501c2a67a8e3bc2e6dfe9c228ca 409fe5dd4ae936941f2654ae5fa5598ea983d3ac e67d95b62824670b34d2441b151b4a4540c650fd eb9b378300a33f0fa88c299529ff4ea856d7a05a +ffae5451a83fffb30629a708d9325edfcc11d72a From f34e71106cb42d8e9cc2c96ea3ab6c3c7588f79e Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 14 Jul 2023 13:44:21 +0000 Subject: [PATCH 13/44] TASK: Updating SDK --- changes.md | 3 ++ .../src/Models/Common/ClientLogging.php | 16 ++++++- .../Models/Common/ClientLoggingBuilder.php | 44 ++++++++++++++++++- .../src/Models/Common/ClientLoggingModel.php | 41 ++++++++++++++++- .../src/Models/Common/CreatedBy.php | 15 ++++++- .../src/Models/Common/CreatedByBuilder.php | 44 ++++++++++++++++++- .../src/Models/Common/CreatedByModel.php | 41 ++++++++++++++++- .../src/Models/Common/LastModifiedBy.php | 15 ++++++- .../Models/Common/LastModifiedByBuilder.php | 44 ++++++++++++++++++- .../src/Models/Common/LastModifiedByModel.php | 41 ++++++++++++++++- references.txt | 1 + 11 files changed, 290 insertions(+), 15 deletions(-) diff --git a/changes.md b/changes.md index 8b5633b1f17..fcc9d9dd1c3 100644 --- a/changes.md +++ b/changes.md @@ -24,6 +24,9 @@ - added property `customLineItemKey` to type `CartSetCustomLineItemShippingDetailsAction` - added property `customLineItemKey` to type `CartSetCustomLineItemTaxAmountAction` - added property `customLineItemKey` to type `CartSetCustomLineItemTaxRateAction` +- added property `associate` to type `ClientLogging` +- added property `associate` to type `CreatedBy` +- added property `associate` to type `LastModifiedBy` - added property `lineItemKey` to type `LineItemStateTransitionMessage` - added property `lineItemKey` to type `OrderLineItemDiscountSetMessage` - added property `lineItemKey` to type `OrderLineItemDistributionChannelSetMessage` diff --git a/lib/commercetools-api/src/Models/Common/ClientLogging.php b/lib/commercetools-api/src/Models/Common/ClientLogging.php index 3340e99edec..d3140dd0103 100644 --- a/lib/commercetools-api/src/Models/Common/ClientLogging.php +++ b/lib/commercetools-api/src/Models/Common/ClientLogging.php @@ -18,9 +18,10 @@ interface ClientLogging extends JsonObject public const FIELD_EXTERNAL_USER_ID = 'externalUserId'; public const FIELD_CUSTOMER = 'customer'; public const FIELD_ANONYMOUS_ID = 'anonymousId'; + public const FIELD_ASSOCIATE = 'associate'; /** - *

id of the APIClient which created the resource.

+ *

id of the API Client which created the resource.

* * @return null|string @@ -51,6 +52,14 @@ public function getCustomer(); */ public function getAnonymousId(); + /** + *

Indicates the Customer who created or modified the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

+ * + + * @return null|CustomerReference + */ + public function getAssociate(); + /** * @param ?string $clientId */ @@ -70,4 +79,9 @@ public function setCustomer(?CustomerReference $customer): void; * @param ?string $anonymousId */ public function setAnonymousId(?string $anonymousId): void; + + /** + * @param ?CustomerReference $associate + */ + public function setAssociate(?CustomerReference $associate): void; } diff --git a/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php b/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php index c79e13d0d9d..fe146f5f7c7 100644 --- a/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php +++ b/lib/commercetools-api/src/Models/Common/ClientLoggingBuilder.php @@ -47,7 +47,13 @@ final class ClientLoggingBuilder implements Builder private $anonymousId; /** - *

id of the APIClient which created the resource.

+ + * @var null|CustomerReference|CustomerReferenceBuilder + */ + private $associate; + + /** + *

id of the API Client which created the resource.

* * @return null|string @@ -90,6 +96,17 @@ public function getAnonymousId() return $this->anonymousId; } + /** + *

Indicates the Customer who created or modified the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

+ * + + * @return null|CustomerReference + */ + public function getAssociate() + { + return $this->associate instanceof CustomerReferenceBuilder ? $this->associate->build() : $this->associate; + } + /** * @param ?string $clientId * @return $this @@ -134,6 +151,17 @@ public function withAnonymousId(?string $anonymousId) return $this; } + /** + * @param ?CustomerReference $associate + * @return $this + */ + public function withAssociate(?CustomerReference $associate) + { + $this->associate = $associate; + + return $this; + } + /** * @deprecated use withCustomer() instead * @return $this @@ -145,13 +173,25 @@ public function withCustomerBuilder(?CustomerReferenceBuilder $customer) return $this; } + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?CustomerReferenceBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + public function build(): ClientLogging { return new ClientLoggingModel( $this->clientId, $this->externalUserId, $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer, - $this->anonymousId + $this->anonymousId, + $this->associate instanceof CustomerReferenceBuilder ? $this->associate->build() : $this->associate ); } diff --git a/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php b/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php index dab05dd84ad..20d3d1655a4 100644 --- a/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php +++ b/lib/commercetools-api/src/Models/Common/ClientLoggingModel.php @@ -45,6 +45,12 @@ final class ClientLoggingModel extends JsonObjectModel implements ClientLogging */ protected $anonymousId; + /** + * + * @var ?CustomerReference + */ + protected $associate; + /** * @psalm-suppress MissingParamType @@ -53,16 +59,18 @@ public function __construct( ?string $clientId = null, ?string $externalUserId = null, ?CustomerReference $customer = null, - ?string $anonymousId = null + ?string $anonymousId = null, + ?CustomerReference $associate = null ) { $this->clientId = $clientId; $this->externalUserId = $externalUserId; $this->customer = $customer; $this->anonymousId = $anonymousId; + $this->associate = $associate; } /** - *

id of the APIClient which created the resource.

+ *

id of the API Client which created the resource.

* * * @return null|string @@ -142,6 +150,27 @@ public function getAnonymousId() return $this->anonymousId; } + /** + *

Indicates the Customer who created or modified the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

+ * + * + * @return null|CustomerReference + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = CustomerReferenceModel::of($data); + } + + return $this->associate; + } + /** * @param ?string $clientId @@ -174,4 +203,12 @@ public function setAnonymousId(?string $anonymousId): void { $this->anonymousId = $anonymousId; } + + /** + * @param ?CustomerReference $associate + */ + public function setAssociate(?CustomerReference $associate): void + { + $this->associate = $associate; + } } diff --git a/lib/commercetools-api/src/Models/Common/CreatedBy.php b/lib/commercetools-api/src/Models/Common/CreatedBy.php index 6742848e5e5..fef6f5db357 100644 --- a/lib/commercetools-api/src/Models/Common/CreatedBy.php +++ b/lib/commercetools-api/src/Models/Common/CreatedBy.php @@ -15,7 +15,7 @@ interface CreatedBy extends ClientLogging { /** - *

id of the APIClient which created the resource.

+ *

id of the API Client which created the resource.

* * @return null|string @@ -46,6 +46,14 @@ public function getCustomer(); */ public function getAnonymousId(); + /** + *

Indicates the Customer who created the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

+ * + + * @return null|CustomerReference + */ + public function getAssociate(); + /** * @param ?string $clientId */ @@ -65,4 +73,9 @@ public function setCustomer(?CustomerReference $customer): void; * @param ?string $anonymousId */ public function setAnonymousId(?string $anonymousId): void; + + /** + * @param ?CustomerReference $associate + */ + public function setAssociate(?CustomerReference $associate): void; } diff --git a/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php b/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php index 6a452aecaa0..c85df4c6fec 100644 --- a/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php +++ b/lib/commercetools-api/src/Models/Common/CreatedByBuilder.php @@ -47,7 +47,13 @@ final class CreatedByBuilder implements Builder private $anonymousId; /** - *

id of the APIClient which created the resource.

+ + * @var null|CustomerReference|CustomerReferenceBuilder + */ + private $associate; + + /** + *

id of the API Client which created the resource.

* * @return null|string @@ -90,6 +96,17 @@ public function getAnonymousId() return $this->anonymousId; } + /** + *

Indicates the Customer who created the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

+ * + + * @return null|CustomerReference + */ + public function getAssociate() + { + return $this->associate instanceof CustomerReferenceBuilder ? $this->associate->build() : $this->associate; + } + /** * @param ?string $clientId * @return $this @@ -134,6 +151,17 @@ public function withAnonymousId(?string $anonymousId) return $this; } + /** + * @param ?CustomerReference $associate + * @return $this + */ + public function withAssociate(?CustomerReference $associate) + { + $this->associate = $associate; + + return $this; + } + /** * @deprecated use withCustomer() instead * @return $this @@ -145,13 +173,25 @@ public function withCustomerBuilder(?CustomerReferenceBuilder $customer) return $this; } + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?CustomerReferenceBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + public function build(): CreatedBy { return new CreatedByModel( $this->clientId, $this->externalUserId, $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer, - $this->anonymousId + $this->anonymousId, + $this->associate instanceof CustomerReferenceBuilder ? $this->associate->build() : $this->associate ); } diff --git a/lib/commercetools-api/src/Models/Common/CreatedByModel.php b/lib/commercetools-api/src/Models/Common/CreatedByModel.php index 6052824c470..f72778c4b69 100644 --- a/lib/commercetools-api/src/Models/Common/CreatedByModel.php +++ b/lib/commercetools-api/src/Models/Common/CreatedByModel.php @@ -45,6 +45,12 @@ final class CreatedByModel extends JsonObjectModel implements CreatedBy */ protected $anonymousId; + /** + * + * @var ?CustomerReference + */ + protected $associate; + /** * @psalm-suppress MissingParamType @@ -53,16 +59,18 @@ public function __construct( ?string $clientId = null, ?string $externalUserId = null, ?CustomerReference $customer = null, - ?string $anonymousId = null + ?string $anonymousId = null, + ?CustomerReference $associate = null ) { $this->clientId = $clientId; $this->externalUserId = $externalUserId; $this->customer = $customer; $this->anonymousId = $anonymousId; + $this->associate = $associate; } /** - *

id of the APIClient which created the resource.

+ *

id of the API Client which created the resource.

* * * @return null|string @@ -142,6 +150,27 @@ public function getAnonymousId() return $this->anonymousId; } + /** + *

Indicates the Customer who created the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

+ * + * + * @return null|CustomerReference + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = CustomerReferenceModel::of($data); + } + + return $this->associate; + } + /** * @param ?string $clientId @@ -174,4 +203,12 @@ public function setAnonymousId(?string $anonymousId): void { $this->anonymousId = $anonymousId; } + + /** + * @param ?CustomerReference $associate + */ + public function setAssociate(?CustomerReference $associate): void + { + $this->associate = $associate; + } } diff --git a/lib/commercetools-api/src/Models/Common/LastModifiedBy.php b/lib/commercetools-api/src/Models/Common/LastModifiedBy.php index 77973ce26eb..fd478be3443 100644 --- a/lib/commercetools-api/src/Models/Common/LastModifiedBy.php +++ b/lib/commercetools-api/src/Models/Common/LastModifiedBy.php @@ -15,7 +15,7 @@ interface LastModifiedBy extends ClientLogging { /** - *

id of the APIClient which modified the resource.

+ *

id of the API Client which modified the resource.

* * @return null|string @@ -46,6 +46,14 @@ public function getCustomer(); */ public function getAnonymousId(); + /** + *

Indicates the Customer who modified the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

+ * + + * @return null|CustomerReference + */ + public function getAssociate(); + /** * @param ?string $clientId */ @@ -65,4 +73,9 @@ public function setCustomer(?CustomerReference $customer): void; * @param ?string $anonymousId */ public function setAnonymousId(?string $anonymousId): void; + + /** + * @param ?CustomerReference $associate + */ + public function setAssociate(?CustomerReference $associate): void; } diff --git a/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php b/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php index 6850b861881..fbef084625d 100644 --- a/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php +++ b/lib/commercetools-api/src/Models/Common/LastModifiedByBuilder.php @@ -47,7 +47,13 @@ final class LastModifiedByBuilder implements Builder private $anonymousId; /** - *

id of the APIClient which modified the resource.

+ + * @var null|CustomerReference|CustomerReferenceBuilder + */ + private $associate; + + /** + *

id of the API Client which modified the resource.

* * @return null|string @@ -90,6 +96,17 @@ public function getAnonymousId() return $this->anonymousId; } + /** + *

Indicates the Customer who modified the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

+ * + + * @return null|CustomerReference + */ + public function getAssociate() + { + return $this->associate instanceof CustomerReferenceBuilder ? $this->associate->build() : $this->associate; + } + /** * @param ?string $clientId * @return $this @@ -134,6 +151,17 @@ public function withAnonymousId(?string $anonymousId) return $this; } + /** + * @param ?CustomerReference $associate + * @return $this + */ + public function withAssociate(?CustomerReference $associate) + { + $this->associate = $associate; + + return $this; + } + /** * @deprecated use withCustomer() instead * @return $this @@ -145,13 +173,25 @@ public function withCustomerBuilder(?CustomerReferenceBuilder $customer) return $this; } + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?CustomerReferenceBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + public function build(): LastModifiedBy { return new LastModifiedByModel( $this->clientId, $this->externalUserId, $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer, - $this->anonymousId + $this->anonymousId, + $this->associate instanceof CustomerReferenceBuilder ? $this->associate->build() : $this->associate ); } diff --git a/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php b/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php index abef32579e4..f441d47a40a 100644 --- a/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php +++ b/lib/commercetools-api/src/Models/Common/LastModifiedByModel.php @@ -45,6 +45,12 @@ final class LastModifiedByModel extends JsonObjectModel implements LastModifiedB */ protected $anonymousId; + /** + * + * @var ?CustomerReference + */ + protected $associate; + /** * @psalm-suppress MissingParamType @@ -53,16 +59,18 @@ public function __construct( ?string $clientId = null, ?string $externalUserId = null, ?CustomerReference $customer = null, - ?string $anonymousId = null + ?string $anonymousId = null, + ?CustomerReference $associate = null ) { $this->clientId = $clientId; $this->externalUserId = $externalUserId; $this->customer = $customer; $this->anonymousId = $anonymousId; + $this->associate = $associate; } /** - *

id of the APIClient which modified the resource.

+ *

id of the API Client which modified the resource.

* * * @return null|string @@ -142,6 +150,27 @@ public function getAnonymousId() return $this->anonymousId; } + /** + *

Indicates the Customer who modified the resource in the context of a Business Unit. Only present when an Associate acts on behalf of a company using the associate endpoints.

+ * + * + * @return null|CustomerReference + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = CustomerReferenceModel::of($data); + } + + return $this->associate; + } + /** * @param ?string $clientId @@ -174,4 +203,12 @@ public function setAnonymousId(?string $anonymousId): void { $this->anonymousId = $anonymousId; } + + /** + * @param ?CustomerReference $associate + */ + public function setAssociate(?CustomerReference $associate): void + { + $this->associate = $associate; + } } diff --git a/references.txt b/references.txt index 59a545317ba..fb659e72820 100644 --- a/references.txt +++ b/references.txt @@ -74,3 +74,4 @@ da31e9917b314501c2a67a8e3bc2e6dfe9c228ca e67d95b62824670b34d2441b151b4a4540c650fd eb9b378300a33f0fa88c299529ff4ea856d7a05a ffae5451a83fffb30629a708d9325edfcc11d72a +d64e3f818ddbb68526fbbe5c0ba3c1cfde9a7c0f From 2d29590ac0abd8ad311eb4ad50ef4b97421959c7 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 17 Jul 2023 12:03:36 +0000 Subject: [PATCH 14/44] TASK: Updating SDK --- changes.md | 8 ++++++++ .../src/Models/Message/OrderCustomerSetMessage.php | 8 ++++---- .../src/Models/Message/OrderCustomerSetMessageBuilder.php | 8 ++++---- .../src/Models/Message/OrderCustomerSetMessageModel.php | 8 ++++---- .../src/Models/Message/OrderCustomerSetMessagePayload.php | 8 ++++---- .../Message/OrderCustomerSetMessagePayloadBuilder.php | 8 ++++---- .../Message/OrderCustomerSetMessagePayloadModel.php | 8 ++++---- .../src/Models/Productdrafts/PriceDraftImport.php | 1 + .../src/Models/Productdrafts/PriceDraftImportBuilder.php | 1 + .../src/Models/Productdrafts/PriceDraftImportModel.php | 1 + references.txt | 1 + 11 files changed, 36 insertions(+), 24 deletions(-) diff --git a/changes.md b/changes.md index fcc9d9dd1c3..ac4fe005f71 100644 --- a/changes.md +++ b/changes.md @@ -159,3 +159,11 @@ - added method `$apiRoot->withProjectKey()->inStoreKeyWithStoreKeyValue()->cartDiscounts()->withId()->delete()`
+**Import changes** + +
+Required Property(s) + +- :warning: changed property `key` of type `PriceDraftImport` to be required +
+ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessage.php index e0b29ce3231..a9aebba176f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessage.php @@ -21,7 +21,7 @@ interface OrderCustomerSetMessage extends OrderMessage public const FIELD_OLD_CUSTOMER_GROUP = 'oldCustomerGroup'; /** - *

Customer on the Order after the Set Customer Id update action.

+ *

Customer on the Order after the Set Customer ID update action.

* * @return null|CustomerReference @@ -29,7 +29,7 @@ interface OrderCustomerSetMessage extends OrderMessage public function getCustomer(); /** - *

CustomerGroup on the Order after the Set Customer Id update action.

+ *

CustomerGroup on the Order after the Set Customer ID update action.

* * @return null|CustomerGroupReference @@ -37,7 +37,7 @@ public function getCustomer(); public function getCustomerGroup(); /** - *

Customer on the Order before the Set Customer Id update action.

+ *

Customer on the Order before the Set Customer ID update action.

* * @return null|CustomerReference @@ -45,7 +45,7 @@ public function getCustomerGroup(); public function getOldCustomer(); /** - *

CustomerGroup on the Order before the Set Customer Id update action.

+ *

CustomerGroup on the Order before the Set Customer ID update action.

* * @return null|CustomerGroupReference diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageBuilder.php index 05d4d80e45a..5e3d2ed7f02 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageBuilder.php @@ -227,7 +227,7 @@ public function getResourceUserProvidedIdentifiers() } /** - *

Customer on the Order after the Set Customer Id update action.

+ *

Customer on the Order after the Set Customer ID update action.

* * @return null|CustomerReference @@ -238,7 +238,7 @@ public function getCustomer() } /** - *

CustomerGroup on the Order after the Set Customer Id update action.

+ *

CustomerGroup on the Order after the Set Customer ID update action.

* * @return null|CustomerGroupReference @@ -249,7 +249,7 @@ public function getCustomerGroup() } /** - *

Customer on the Order before the Set Customer Id update action.

+ *

Customer on the Order before the Set Customer ID update action.

* * @return null|CustomerReference @@ -260,7 +260,7 @@ public function getOldCustomer() } /** - *

CustomerGroup on the Order before the Set Customer Id update action.

+ *

CustomerGroup on the Order before the Set Customer ID update action.

* * @return null|CustomerGroupReference diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageModel.php index ac25c4492ab..1cfda25c21f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessageModel.php @@ -393,7 +393,7 @@ public function getResourceUserProvidedIdentifiers() } /** - *

Customer on the Order after the Set Customer Id update action.

+ *

Customer on the Order after the Set Customer ID update action.

* * * @return null|CustomerReference @@ -414,7 +414,7 @@ public function getCustomer() } /** - *

CustomerGroup on the Order after the Set Customer Id update action.

+ *

CustomerGroup on the Order after the Set Customer ID update action.

* * * @return null|CustomerGroupReference @@ -435,7 +435,7 @@ public function getCustomerGroup() } /** - *

Customer on the Order before the Set Customer Id update action.

+ *

Customer on the Order before the Set Customer ID update action.

* * * @return null|CustomerReference @@ -456,7 +456,7 @@ public function getOldCustomer() } /** - *

CustomerGroup on the Order before the Set Customer Id update action.

+ *

CustomerGroup on the Order before the Set Customer ID update action.

* * * @return null|CustomerGroupReference diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayload.php index 8b18dd11f5f..b138ba51725 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayload.php @@ -21,7 +21,7 @@ interface OrderCustomerSetMessagePayload extends OrderMessagePayload public const FIELD_OLD_CUSTOMER_GROUP = 'oldCustomerGroup'; /** - *

Customer on the Order after the Set Customer Id update action.

+ *

Customer on the Order after the Set Customer ID update action.

* * @return null|CustomerReference @@ -29,7 +29,7 @@ interface OrderCustomerSetMessagePayload extends OrderMessagePayload public function getCustomer(); /** - *

CustomerGroup on the Order after the Set Customer Id update action.

+ *

CustomerGroup on the Order after the Set Customer ID update action.

* * @return null|CustomerGroupReference @@ -37,7 +37,7 @@ public function getCustomer(); public function getCustomerGroup(); /** - *

Customer on the Order before the Set Customer Id update action.

+ *

Customer on the Order before the Set Customer ID update action.

* * @return null|CustomerReference @@ -45,7 +45,7 @@ public function getCustomerGroup(); public function getOldCustomer(); /** - *

CustomerGroup on the Order before the Set Customer Id update action.

+ *

CustomerGroup on the Order before the Set Customer ID update action.

* * @return null|CustomerGroupReference diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadBuilder.php index 6655d8cc54d..19e05e123db 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadBuilder.php @@ -49,7 +49,7 @@ final class OrderCustomerSetMessagePayloadBuilder implements Builder private $oldCustomerGroup; /** - *

Customer on the Order after the Set Customer Id update action.

+ *

Customer on the Order after the Set Customer ID update action.

* * @return null|CustomerReference @@ -60,7 +60,7 @@ public function getCustomer() } /** - *

CustomerGroup on the Order after the Set Customer Id update action.

+ *

CustomerGroup on the Order after the Set Customer ID update action.

* * @return null|CustomerGroupReference @@ -71,7 +71,7 @@ public function getCustomerGroup() } /** - *

Customer on the Order before the Set Customer Id update action.

+ *

Customer on the Order before the Set Customer ID update action.

* * @return null|CustomerReference @@ -82,7 +82,7 @@ public function getOldCustomer() } /** - *

CustomerGroup on the Order before the Set Customer Id update action.

+ *

CustomerGroup on the Order before the Set Customer ID update action.

* * @return null|CustomerGroupReference diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadModel.php index a478cd4ebe4..63f0e176534 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomerSetMessagePayloadModel.php @@ -91,7 +91,7 @@ public function getType() } /** - *

Customer on the Order after the Set Customer Id update action.

+ *

Customer on the Order after the Set Customer ID update action.

* * * @return null|CustomerReference @@ -112,7 +112,7 @@ public function getCustomer() } /** - *

CustomerGroup on the Order after the Set Customer Id update action.

+ *

CustomerGroup on the Order after the Set Customer ID update action.

* * * @return null|CustomerGroupReference @@ -133,7 +133,7 @@ public function getCustomerGroup() } /** - *

Customer on the Order before the Set Customer Id update action.

+ *

Customer on the Order before the Set Customer ID update action.

* * * @return null|CustomerReference @@ -154,7 +154,7 @@ public function getOldCustomer() } /** - *

CustomerGroup on the Order before the Set Customer Id update action.

+ *

CustomerGroup on the Order before the Set Customer ID update action.

* * * @return null|CustomerGroupReference diff --git a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php index 7ddc78e81b6..da25f63d824 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php +++ b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php @@ -99,6 +99,7 @@ public function getTiers(); /** *

User-defined unique identifier for the Embedded Price.

+ *

This field is required from 31 July 2023.

* * @return null|string diff --git a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php index e076c32529f..e90508af135 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php +++ b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php @@ -187,6 +187,7 @@ public function getTiers() /** *

User-defined unique identifier for the Embedded Price.

+ *

This field is required from 31 July 2023.

* * @return null|string diff --git a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php index 03de346ff07..b3f247f8605 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php +++ b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php @@ -308,6 +308,7 @@ public function getTiers() /** *

User-defined unique identifier for the Embedded Price.

+ *

This field is required from 31 July 2023.

* * * @return null|string diff --git a/references.txt b/references.txt index fb659e72820..62ad597026b 100644 --- a/references.txt +++ b/references.txt @@ -75,3 +75,4 @@ e67d95b62824670b34d2441b151b4a4540c650fd eb9b378300a33f0fa88c299529ff4ea856d7a05a ffae5451a83fffb30629a708d9325edfcc11d72a d64e3f818ddbb68526fbbe5c0ba3c1cfde9a7c0f +b07e7ba714fd02e261dac1818a92f4b434ffb62b From e9754b9f33b020dceefd3218fa072c6c3bc56cff Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 17 Jul 2023 13:04:34 +0000 Subject: [PATCH 15/44] TASK: Updating SDK --- changes.md | 1 + .../src/Models/Common/ResourceIdentifier.php | 1 - .../Common/ResourceIdentifierBuilder.php | 2 - .../Models/Common/ResourceIdentifierModel.php | 3 - .../Models/Order/OrderResourceIdentifier.php | 42 ------ .../Order/OrderResourceIdentifierBuilder.php | 94 ------------- .../OrderResourceIdentifierCollection.php | 56 -------- .../Order/OrderResourceIdentifierModel.php | 133 ------------------ references.txt | 1 + 9 files changed, 2 insertions(+), 331 deletions(-) delete mode 100644 lib/commercetools-api/src/Models/Order/OrderResourceIdentifier.php delete mode 100644 lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php delete mode 100644 lib/commercetools-api/src/Models/Order/OrderResourceIdentifierCollection.php delete mode 100644 lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php diff --git a/changes.md b/changes.md index ac4fe005f71..67756deadcd 100644 --- a/changes.md +++ b/changes.md @@ -119,6 +119,7 @@ - :warning: removed type `CartSetDeliveryAddressCustomFieldAction` - :warning: removed type `CartSetDeliveryAddressCustomTypeAction` +- :warning: removed type `OrderResourceIdentifier` diff --git a/lib/commercetools-api/src/Models/Common/ResourceIdentifier.php b/lib/commercetools-api/src/Models/Common/ResourceIdentifier.php index c45496d719e..9e95c61ab7e 100644 --- a/lib/commercetools-api/src/Models/Common/ResourceIdentifier.php +++ b/lib/commercetools-api/src/Models/Common/ResourceIdentifier.php @@ -19,7 +19,6 @@ use Commercetools\Api\Models\CustomerGroup\CustomerGroupResourceIdentifier; use Commercetools\Api\Models\DiscountCode\DiscountCodeResourceIdentifier; use Commercetools\Api\Models\Inventory\InventoryEntryResourceIdentifier; -use Commercetools\Api\Models\Order\OrderResourceIdentifier; use Commercetools\Api\Models\OrderEdit\OrderEditResourceIdentifier; use Commercetools\Api\Models\Payment\PaymentResourceIdentifier; use Commercetools\Api\Models\Product\ProductResourceIdentifier; diff --git a/lib/commercetools-api/src/Models/Common/ResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Common/ResourceIdentifierBuilder.php index 84eba03ed51..f7ca759c8b2 100644 --- a/lib/commercetools-api/src/Models/Common/ResourceIdentifierBuilder.php +++ b/lib/commercetools-api/src/Models/Common/ResourceIdentifierBuilder.php @@ -30,8 +30,6 @@ use Commercetools\Api\Models\DiscountCode\DiscountCodeResourceIdentifierBuilder; use Commercetools\Api\Models\Inventory\InventoryEntryResourceIdentifier; use Commercetools\Api\Models\Inventory\InventoryEntryResourceIdentifierBuilder; -use Commercetools\Api\Models\Order\OrderResourceIdentifier; -use Commercetools\Api\Models\Order\OrderResourceIdentifierBuilder; use Commercetools\Api\Models\OrderEdit\OrderEditResourceIdentifier; use Commercetools\Api\Models\OrderEdit\OrderEditResourceIdentifierBuilder; use Commercetools\Api\Models\Payment\PaymentResourceIdentifier; diff --git a/lib/commercetools-api/src/Models/Common/ResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Common/ResourceIdentifierModel.php index b69557ebecb..6ff5bdd277f 100644 --- a/lib/commercetools-api/src/Models/Common/ResourceIdentifierModel.php +++ b/lib/commercetools-api/src/Models/Common/ResourceIdentifierModel.php @@ -30,8 +30,6 @@ use Commercetools\Api\Models\DiscountCode\DiscountCodeResourceIdentifierModel; use Commercetools\Api\Models\Inventory\InventoryEntryResourceIdentifier; use Commercetools\Api\Models\Inventory\InventoryEntryResourceIdentifierModel; -use Commercetools\Api\Models\Order\OrderResourceIdentifier; -use Commercetools\Api\Models\Order\OrderResourceIdentifierModel; use Commercetools\Api\Models\OrderEdit\OrderEditResourceIdentifier; use Commercetools\Api\Models\OrderEdit\OrderEditResourceIdentifierModel; use Commercetools\Api\Models\Payment\PaymentResourceIdentifier; @@ -114,7 +112,6 @@ final class ResourceIdentifierModel extends JsonObjectModel implements ResourceI 'customer-group' => CustomerGroupResourceIdentifierModel::class, 'discount-code' => DiscountCodeResourceIdentifierModel::class, 'inventory-entry' => InventoryEntryResourceIdentifierModel::class, - 'order' => OrderResourceIdentifierModel::class, 'order-edit' => OrderEditResourceIdentifierModel::class, 'payment' => PaymentResourceIdentifierModel::class, 'product' => ProductResourceIdentifierModel::class, diff --git a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifier.php b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifier.php deleted file mode 100644 index 7c4679796ca..00000000000 --- a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifier.php +++ /dev/null @@ -1,42 +0,0 @@ -Unique identifier of the referenced Order.

- * - - * @return null|string - */ - public function getId(); - - /** - *

User-defined unique identifier of the referenced Order.

- * - - * @return null|string - */ - public function getKey(); - - /** - * @param ?string $id - */ - public function setId(?string $id): void; - - /** - * @param ?string $key - */ - public function setKey(?string $key): void; -} diff --git a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php deleted file mode 100644 index 8bc192164e6..00000000000 --- a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierBuilder.php +++ /dev/null @@ -1,94 +0,0 @@ - - */ -final class OrderResourceIdentifierBuilder implements Builder -{ - /** - - * @var ?string - */ - private $id; - - /** - - * @var ?string - */ - private $key; - - /** - *

Unique identifier of the referenced Order.

- * - - * @return null|string - */ - public function getId() - { - return $this->id; - } - - /** - *

User-defined unique identifier of the referenced Order.

- * - - * @return null|string - */ - public function getKey() - { - return $this->key; - } - - /** - * @param ?string $id - * @return $this - */ - public function withId(?string $id) - { - $this->id = $id; - - return $this; - } - - /** - * @param ?string $key - * @return $this - */ - public function withKey(?string $key) - { - $this->key = $key; - - return $this; - } - - - public function build(): OrderResourceIdentifier - { - return new OrderResourceIdentifierModel( - $this->id, - $this->key - ); - } - - public static function of(): OrderResourceIdentifierBuilder - { - return new self(); - } -} diff --git a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierCollection.php b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierCollection.php deleted file mode 100644 index 5a1d833185f..00000000000 --- a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method OrderResourceIdentifier current() - * @method OrderResourceIdentifier end() - * @method OrderResourceIdentifier at($offset) - */ -class OrderResourceIdentifierCollection extends ResourceIdentifierCollection -{ - /** - * @psalm-assert OrderResourceIdentifier $value - * @psalm-param OrderResourceIdentifier|stdClass $value - * @throws InvalidArgumentException - * - * @return OrderResourceIdentifierCollection - */ - public function add($value) - { - if (!$value instanceof OrderResourceIdentifier) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?OrderResourceIdentifier - */ - protected function mapper() - { - return function (?int $index): ?OrderResourceIdentifier { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var OrderResourceIdentifier $data */ - $data = OrderResourceIdentifierModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php b/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php deleted file mode 100644 index c3eaedf0d78..00000000000 --- a/lib/commercetools-api/src/Models/Order/OrderResourceIdentifierModel.php +++ /dev/null @@ -1,133 +0,0 @@ -id = $id; - $this->key = $key; - $this->typeId = $typeId ?? self::DISCRIMINATOR_VALUE; - } - - /** - *

Type of referenced resource. If given, it must match the expected ReferenceTypeId of the referenced resource.

- * - * - * @return null|string - */ - public function getTypeId() - { - if (is_null($this->typeId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TYPE_ID); - if (is_null($data)) { - return null; - } - $this->typeId = (string) $data; - } - - return $this->typeId; - } - - /** - *

Unique identifier of the referenced Order.

- * - * - * @return null|string - */ - public function getId() - { - if (is_null($this->id)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ID); - if (is_null($data)) { - return null; - } - $this->id = (string) $data; - } - - return $this->id; - } - - /** - *

User-defined unique identifier of the referenced Order.

- * - * - * @return null|string - */ - public function getKey() - { - if (is_null($this->key)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_KEY); - if (is_null($data)) { - return null; - } - $this->key = (string) $data; - } - - return $this->key; - } - - - /** - * @param ?string $id - */ - public function setId(?string $id): void - { - $this->id = $id; - } - - /** - * @param ?string $key - */ - public function setKey(?string $key): void - { - $this->key = $key; - } -} diff --git a/references.txt b/references.txt index 62ad597026b..08dad2159d2 100644 --- a/references.txt +++ b/references.txt @@ -76,3 +76,4 @@ eb9b378300a33f0fa88c299529ff4ea856d7a05a ffae5451a83fffb30629a708d9325edfcc11d72a d64e3f818ddbb68526fbbe5c0ba3c1cfde9a7c0f b07e7ba714fd02e261dac1818a92f4b434ffb62b +68aece12ea78c79043175a729bc159bf2ecef280 From 24d574a47405acd509d561f1d3fd6d19606be0e2 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 18 Jul 2023 13:52:28 +0000 Subject: [PATCH 16/44] TASK: Updating SDK --- changes.md | 4 + lib/commercetools-api/docs/RequestBuilder.md | 8 +- .../src/Models/Cart/CartDraft.php | 2 +- .../src/Models/Cart/CartDraftBuilder.php | 2 +- .../src/Models/Cart/CartDraftModel.php | 2 +- .../src/Models/Cart/DirectDiscount.php | 2 +- .../src/Models/Cart/DirectDiscountBuilder.php | 2 +- .../src/Models/Cart/DirectDiscountDraft.php | 2 +- .../Cart/DirectDiscountDraftBuilder.php | 2 +- .../Models/Cart/DirectDiscountDraftModel.php | 2 +- .../src/Models/Cart/DirectDiscountModel.php | 2 +- .../src/Models/Cart/TaxedPriceDraft.php | 4 +- .../Models/Cart/TaxedPriceDraftBuilder.php | 4 +- .../src/Models/Cart/TaxedPriceDraftModel.php | 4 +- .../src/Models/CartDiscount/CartDiscount.php | 5 +- .../CartDiscount/CartDiscountBuilder.php | 5 +- .../Models/CartDiscount/CartDiscountDraft.php | 6 +- .../CartDiscount/CartDiscountDraftBuilder.php | 6 +- .../CartDiscount/CartDiscountDraftModel.php | 6 +- .../Models/CartDiscount/CartDiscountModel.php | 5 +- .../MultiBuyCustomLineItemsTarget.php | 6 +- .../MultiBuyCustomLineItemsTargetBuilder.php | 6 +- .../MultiBuyCustomLineItemsTargetModel.php | 6 +- .../CartDiscount/MultiBuyLineItemsTarget.php | 6 +- .../MultiBuyLineItemsTargetBuilder.php | 6 +- .../MultiBuyLineItemsTargetModel.php | 6 +- .../CustomLineItemImportDraft.php | 101 +-- .../CustomLineItemImportDraftBuilder.php | 180 ++--- .../CustomLineItemImportDraftCollection.php | 2 +- .../CustomLineItemImportDraftModel.php | 226 +++--- .../Order/DiscountedLineItemPriceDraft.php | 4 +- .../DiscountedLineItemPriceDraftBuilder.php | 4 +- .../DiscountedLineItemPriceDraftModel.php | 4 +- .../src/Models/Order/LineItemImportDraft.php | 120 ++-- .../Order/LineItemImportDraftBuilder.php | 220 +++--- .../Models/Order/LineItemImportDraftModel.php | 278 ++++---- .../src/Models/Order/OrderImportDraft.php | 265 ++++--- .../Models/Order/OrderImportDraftBuilder.php | 521 ++++++++------ .../Models/Order/OrderImportDraftModel.php | 657 ++++++++++-------- .../Order/ProductVariantImportDraft.php | 21 +- .../ProductVariantImportDraftBuilder.php | 21 +- .../Order/ProductVariantImportDraftModel.php | 21 +- .../Models/Order/ShippingInfoImportDraft.php | 18 +- .../Order/ShippingInfoImportDraftBuilder.php | 18 +- .../Order/ShippingInfoImportDraftModel.php | 18 +- references.txt | 1 + 46 files changed, 1566 insertions(+), 1245 deletions(-) rename lib/commercetools-api/src/Models/{Cart => Order}/CustomLineItemImportDraft.php (79%) rename lib/commercetools-api/src/Models/{Cart => Order}/CustomLineItemImportDraftBuilder.php (89%) rename lib/commercetools-api/src/Models/{Cart => Order}/CustomLineItemImportDraftCollection.php (97%) rename lib/commercetools-api/src/Models/{Cart => Order}/CustomLineItemImportDraftModel.php (89%) diff --git a/changes.md b/changes.md index 67756deadcd..474d150e2ff 100644 --- a/changes.md +++ b/changes.md @@ -50,6 +50,8 @@ - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxRateAction` - added property `lineItemKey` to type `StagedOrderTransitionLineItemStateAction` - added property `directDiscounts` to type `Order` +- added property `purchaseOrderNumber` to type `OrderImportDraft` +- added property `taxCalculationMode` to type `OrderImportDraft` - added property `lineItemKey` to type `OrderImportLineItemStateAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemCustomFieldAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemCustomTypeAction` @@ -81,6 +83,7 @@ - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxAmountAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxRateAction` to be optional - changed property `lineItemId` of type `StagedOrderTransitionLineItemStateAction` to be optional +- changed property `priceMode` of type `CustomLineItemImportDraft` to be optional - changed property `lineItemId` of type `OrderImportLineItemStateAction` to be optional - changed property `customLineItemId` of type `OrderSetCustomLineItemCustomFieldAction` to be optional - changed property `customLineItemId` of type `OrderSetCustomLineItemCustomTypeAction` to be optional @@ -102,6 +105,7 @@ - :warning: changed property `locale` of type `StagedOrderSetLocaleAction` from type `string` to `Locale` - :warning: changed property `country` of type `Order` from type `string` to `CountryCode` - :warning: changed property `locale` of type `Order` from type `string` to `Locale` +- :warning: changed property `country` of type `OrderImportDraft` from type `string` to `CountryCode` - :warning: changed property `locale` of type `OrderSetLocaleAction` from type `string` to `Locale` diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index de771280a7b..76dc84d4b04 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -4999,7 +4999,13 @@ $request = $builder ``` ## `withProjectKey("projectKey")->orders()->importOrder()->post(null)` -Create an Order by Import +Importing an Order produces the [Order Imported](ctp:api:type:OrderImportedMessage) Message. + +Specific Error Codes: + +- [OutOfStock](ctp:api:type:OutOfStockError) +- [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) + ### Example ```php diff --git a/lib/commercetools-api/src/Models/Cart/CartDraft.php b/lib/commercetools-api/src/Models/Cart/CartDraft.php index e242e7e930c..41b9fcfe204 100644 --- a/lib/commercetools-api/src/Models/Cart/CartDraft.php +++ b/lib/commercetools-api/src/Models/Cart/CartDraft.php @@ -157,7 +157,7 @@ public function getExternalTaxRateForShippingMethod(); public function getTaxRoundingMode(); /** - *

Determines how taxes are calculated when calculating taxes for taxedPrice.

+ *

Determines how taxes are calculated for taxedPrice.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php index 2137aed6781..464871bc1c1 100644 --- a/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartDraftBuilder.php @@ -353,7 +353,7 @@ public function getTaxRoundingMode() } /** - *

Determines how taxes are calculated when calculating taxes for taxedPrice.

+ *

Determines how taxes are calculated for taxedPrice.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/CartDraftModel.php b/lib/commercetools-api/src/Models/Cart/CartDraftModel.php index 953132c93a3..2d85f5354f9 100644 --- a/lib/commercetools-api/src/Models/Cart/CartDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartDraftModel.php @@ -539,7 +539,7 @@ public function getTaxRoundingMode() } /** - *

Determines how taxes are calculated when calculating taxes for taxedPrice.

+ *

Determines how taxes are calculated for taxedPrice.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscount.php b/lib/commercetools-api/src/Models/Cart/DirectDiscount.php index b7de92b61c2..b39dcf6b6e9 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscount.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscount.php @@ -36,7 +36,7 @@ public function getId(); public function getValue(); /** - *

Part of the Cart that is discounted.

+ *

Segment of the Cart that is discounted.

*

Empty when the value is set to giftLineItem.

* diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php index d78c22f0dea..929b0b45922 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountBuilder.php @@ -65,7 +65,7 @@ public function getValue() } /** - *

Part of the Cart that is discounted.

+ *

Segment of the Cart that is discounted.

*

Empty when the value is set to giftLineItem.

* diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php index 61392c32276..b883b87e14c 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraft.php @@ -27,7 +27,7 @@ interface DirectDiscountDraft extends JsonObject public function getValue(); /** - *

Defines what part of the Cart will be discounted.

+ *

Defines what segment of the Cart will be discounted.

*

If value is set to giftLineItem, this must not be set.

* diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php index 3e1251615ee..0d3b2fa53c9 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftBuilder.php @@ -48,7 +48,7 @@ public function getValue() } /** - *

Defines what part of the Cart will be discounted.

+ *

Defines what segment of the Cart will be discounted.

*

If value is set to giftLineItem, this must not be set.

* diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php index 9e03cd1d979..be693cdbb2b 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountDraftModel.php @@ -69,7 +69,7 @@ public function getValue() } /** - *

Defines what part of the Cart will be discounted.

+ *

Defines what segment of the Cart will be discounted.

*

If value is set to giftLineItem, this must not be set.

* * diff --git a/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php b/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php index fa776ec2b25..de3c42a2366 100644 --- a/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php +++ b/lib/commercetools-api/src/Models/Cart/DirectDiscountModel.php @@ -97,7 +97,7 @@ public function getValue() } /** - *

Part of the Cart that is discounted.

+ *

Segment of the Cart that is discounted.

*

Empty when the value is set to giftLineItem.

* * diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php index 8bcdfe20415..514b993bc6f 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraft.php @@ -19,7 +19,7 @@ interface TaxedPriceDraft extends JsonObject public const FIELD_TAX_PORTIONS = 'taxPortions'; /** - *

Total net price of the Line Item or Custom Line Item.

+ *

Total net price of the Cart or Order.

* * @return null|Money @@ -27,7 +27,7 @@ interface TaxedPriceDraft extends JsonObject public function getTotalNet(); /** - *

Total gross price of the Line Item or Custom Line Item.

+ *

Total gross price of the Cart or Order.

* * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php index e837dfe4a52..f97a2e1a8b6 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftBuilder.php @@ -41,7 +41,7 @@ final class TaxedPriceDraftBuilder implements Builder private $taxPortions; /** - *

Total net price of the Line Item or Custom Line Item.

+ *

Total net price of the Cart or Order.

* * @return null|Money @@ -52,7 +52,7 @@ public function getTotalNet() } /** - *

Total gross price of the Line Item or Custom Line Item.

+ *

Total gross price of the Cart or Order.

* * @return null|Money diff --git a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php index 635633565fc..491e8e85760 100644 --- a/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/TaxedPriceDraftModel.php @@ -54,7 +54,7 @@ public function __construct( } /** - *

Total net price of the Line Item or Custom Line Item.

+ *

Total net price of the Cart or Order.

* * * @return null|Money @@ -75,7 +75,7 @@ public function getTotalNet() } /** - *

Total gross price of the Line Item or Custom Line Item.

+ *

Total gross price of the Cart or Order.

* * * @return null|Money diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php index b137eb51b5d..5ded405ea74 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscount.php @@ -112,7 +112,7 @@ public function getKey(); public function getDescription(); /** - *

Effect of the CartDiscount.

+ *

Effect of the CartDiscount on the target.

* * @return null|CartDiscountValue @@ -128,7 +128,8 @@ public function getValue(); public function getCartPredicate(); /** - *

Sets a CartDiscountTarget. Empty if value has type giftLineItem.

+ *

Segment of the Cart that is discounted.

+ *

Empty, if the value is giftLineItem.

* * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php index e0cdcdac08b..2dc29fe675b 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountBuilder.php @@ -259,7 +259,7 @@ public function getDescription() } /** - *

Effect of the CartDiscount.

+ *

Effect of the CartDiscount on the target.

* * @return null|CartDiscountValue @@ -281,7 +281,8 @@ public function getCartPredicate() } /** - *

Sets a CartDiscountTarget. Empty if value has type giftLineItem.

+ *

Segment of the Cart that is discounted.

+ *

Empty, if the value is giftLineItem.

* * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php index 3b10675fc5f..b401a099554 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraft.php @@ -57,8 +57,7 @@ public function getKey(); public function getDescription(); /** - *

Effect of the CartDiscount. - * For a target, relative or absolute Discount values or a fixed item Price value can be specified. If no target is specified, a Gift Line Item can be added to the Cart.

+ *

Effect of the CartDiscount on the target.

* * @return null|CartDiscountValueDraft @@ -74,7 +73,8 @@ public function getValue(); public function getCartPredicate(); /** - *

Must not be set when the value has type giftLineItem, otherwise a CartDiscountTarget must be set.

+ *

Segment of the Cart that will be discounted.

+ *

Must not be set if the value is giftLineItem.

* * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php index 427555390a3..638b4ebcad8 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftBuilder.php @@ -144,8 +144,7 @@ public function getDescription() } /** - *

Effect of the CartDiscount. - * For a target, relative or absolute Discount values or a fixed item Price value can be specified. If no target is specified, a Gift Line Item can be added to the Cart.

+ *

Effect of the CartDiscount on the target.

* * @return null|CartDiscountValueDraft @@ -167,7 +166,8 @@ public function getCartPredicate() } /** - *

Must not be set when the value has type giftLineItem, otherwise a CartDiscountTarget must be set.

+ *

Segment of the Cart that will be discounted.

+ *

Must not be set if the value is giftLineItem.

* * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php index 69c5d18fa1a..ef9e4213299 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountDraftModel.php @@ -208,8 +208,7 @@ public function getDescription() } /** - *

Effect of the CartDiscount. - * For a target, relative or absolute Discount values or a fixed item Price value can be specified. If no target is specified, a Gift Line Item can be added to the Cart.

+ *

Effect of the CartDiscount on the target.

* * * @return null|CartDiscountValueDraft @@ -250,7 +249,8 @@ public function getCartPredicate() } /** - *

Must not be set when the value has type giftLineItem, otherwise a CartDiscountTarget must be set.

+ *

Segment of the Cart that will be discounted.

+ *

Must not be set if the value is giftLineItem.

* * * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php index 78112057e65..c890e8b8351 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountModel.php @@ -401,7 +401,7 @@ public function getDescription() } /** - *

Effect of the CartDiscount.

+ *

Effect of the CartDiscount on the target.

* * * @return null|CartDiscountValue @@ -442,7 +442,8 @@ public function getCartPredicate() } /** - *

Sets a CartDiscountTarget. Empty if value has type giftLineItem.

+ *

Segment of the Cart that is discounted.

+ *

Empty, if the value is giftLineItem.

* * * @return null|CartDiscountTarget diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTarget.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTarget.php index 1fe78cc0bc4..79fd21b35ff 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTarget.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTarget.php @@ -36,7 +36,8 @@ public function getPredicate(); public function getTriggerQuantity(); /** - *

Number of Custom Line Items that are discounted per application of this Discount.

+ *

Number of Custom Line Items that are discounted per application of this Discount. + * It must be less than or equal to the triggerQuantity.

* * @return null|int @@ -44,7 +45,8 @@ public function getTriggerQuantity(); public function getDiscountedQuantity(); /** - *

Maximum number of times this Discount can be applied.

+ *

Maximum number of times this Discount can be applied. + * Do not set if the Discount should be applied an unlimited number of times.

* * @return null|int diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetBuilder.php index cd0e4257fbd..13a92a75550 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetBuilder.php @@ -73,7 +73,8 @@ public function getTriggerQuantity() } /** - *

Number of Custom Line Items that are discounted per application of this Discount.

+ *

Number of Custom Line Items that are discounted per application of this Discount. + * It must be less than or equal to the triggerQuantity.

* * @return null|int @@ -84,7 +85,8 @@ public function getDiscountedQuantity() } /** - *

Maximum number of times this Discount can be applied.

+ *

Maximum number of times this Discount can be applied. + * Do not set if the Discount should be applied an unlimited number of times.

* * @return null|int diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetModel.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetModel.php index a57670da524..c5c2fa38f51 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyCustomLineItemsTargetModel.php @@ -135,7 +135,8 @@ public function getTriggerQuantity() } /** - *

Number of Custom Line Items that are discounted per application of this Discount.

+ *

Number of Custom Line Items that are discounted per application of this Discount. + * It must be less than or equal to the triggerQuantity.

* * * @return null|int @@ -155,7 +156,8 @@ public function getDiscountedQuantity() } /** - *

Maximum number of times this Discount can be applied.

+ *

Maximum number of times this Discount can be applied. + * Do not set if the Discount should be applied an unlimited number of times.

* * * @return null|int diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTarget.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTarget.php index e28e85e90e2..382fa2517e2 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTarget.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTarget.php @@ -36,7 +36,8 @@ public function getPredicate(); public function getTriggerQuantity(); /** - *

Number of Line Items that are discounted per application of this Discount.

+ *

Number of Line Items that are discounted per application of this Discount. + * It must be less than or equal to the triggerQuantity.

* * @return null|int @@ -44,7 +45,8 @@ public function getTriggerQuantity(); public function getDiscountedQuantity(); /** - *

Maximum number of times this Discount can be applied.

+ *

Maximum number of times this Discount can be applied. + * Do not set if the Discount should be applied an unlimited number of times.

* * @return null|int diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetBuilder.php index 015176885a7..1d7dc075199 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetBuilder.php @@ -73,7 +73,8 @@ public function getTriggerQuantity() } /** - *

Number of Line Items that are discounted per application of this Discount.

+ *

Number of Line Items that are discounted per application of this Discount. + * It must be less than or equal to the triggerQuantity.

* * @return null|int @@ -84,7 +85,8 @@ public function getDiscountedQuantity() } /** - *

Maximum number of times this Discount can be applied.

+ *

Maximum number of times this Discount can be applied. + * Do not set if the Discount should be applied an unlimited number of times.

* * @return null|int diff --git a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetModel.php b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetModel.php index c118dfd93e1..018ea37f07d 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/MultiBuyLineItemsTargetModel.php @@ -135,7 +135,8 @@ public function getTriggerQuantity() } /** - *

Number of Line Items that are discounted per application of this Discount.

+ *

Number of Line Items that are discounted per application of this Discount. + * It must be less than or equal to the triggerQuantity.

* * * @return null|int @@ -155,7 +156,8 @@ public function getDiscountedQuantity() } /** - *

Maximum number of times this Discount can be applied.

+ *

Maximum number of times this Discount can be applied. + * Do not set if the Discount should be applied an unlimited number of times.

* * * @return null|int diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraft.php b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraft.php similarity index 79% rename from lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraft.php rename to lib/commercetools-api/src/Models/Order/CustomLineItemImportDraft.php index b7762662a26..54d7b3ced58 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraft.php @@ -6,11 +6,11 @@ * Do not change it. */ -namespace Commercetools\Api\Models\Cart; +namespace Commercetools\Api\Models\Order; +use Commercetools\Api\Models\Cart\ItemShippingDetailsDraft; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\Money; -use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxRate; use Commercetools\Api\Models\Type\CustomFieldsDraft; @@ -20,103 +20,104 @@ interface CustomLineItemImportDraft extends JsonObject { public const FIELD_NAME = 'name'; + public const FIELD_SLUG = 'slug'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_MONEY = 'money'; - public const FIELD_SLUG = 'slug'; - public const FIELD_STATE = 'state'; public const FIELD_TAX_RATE = 'taxRate'; public const FIELD_TAX_CATEGORY = 'taxCategory'; - public const FIELD_CUSTOM = 'custom'; - public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; public const FIELD_PRICE_MODE = 'priceMode'; + public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_STATE = 'state'; + public const FIELD_CUSTOM = 'custom'; /** + *

Name of the Custom Line Item.

+ * * @return null|LocalizedString */ public function getName(); /** - *

The amount of a CustomLineItem in the cart. - * Must be a positive integer.

+ *

User-defined identifier used in a deep-link URL for the Custom Line Item. This value should match the pattern [a-zA-Z0-9_-]{2,256}.

* - * @return null|int + * @return null|string */ - public function getQuantity(); + public function getSlug(); /** - *

The cost to add to the cart. The amount can be negative.

+ *

The number of items in the Custom Line Item. Can be a negative value.

* - * @return null|Money - */ - public function getMoney(); - - /** - - * @return null|string + * @return null|int */ - public function getSlug(); + public function getQuantity(); /** + *

The cost of individual items in the Custom Line Item. The amount can be negative.

+ * - * @return null|ItemStateCollection + * @return null|Money */ - public function getState(); + public function getMoney(); /** + *

The tax rate used to calculate the taxedPrice of the Order.

+ * * @return null|TaxRate */ public function getTaxRate(); /** + *

Include a value to associate a Tax Category with the Custom Line Item.

+ * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); /** - *

The custom fields.

+ *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
* - * @return null|CustomFieldsDraft + * @return null|string */ - public function getCustom(); + public function getPriceMode(); /** + *

Container for Custom Line Item-specific addresses.

+ * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); /** - *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget - * are applied to the Custom Line Item.
  • - *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • - *
+ *

State of the Custom Line Items.

* - * @return null|string + * @return null|ItemStateCollection */ - public function getPriceMode(); + public function getState(); /** - * @param ?LocalizedString $name - */ - public function setName(?LocalizedString $name): void; + *

Custom Fields of the CustomLineItem.

+ * - /** - * @param ?int $quantity + * @return null|CustomFieldsDraft */ - public function setQuantity(?int $quantity): void; + public function getCustom(); /** - * @param ?Money $money + * @param ?LocalizedString $name */ - public function setMoney(?Money $money): void; + public function setName(?LocalizedString $name): void; /** * @param ?string $slug @@ -124,9 +125,14 @@ public function setMoney(?Money $money): void; public function setSlug(?string $slug): void; /** - * @param ?ItemStateCollection $state + * @param ?int $quantity */ - public function setState(?ItemStateCollection $state): void; + public function setQuantity(?int $quantity): void; + + /** + * @param ?Money $money + */ + public function setMoney(?Money $money): void; /** * @param ?TaxRate $taxRate @@ -139,9 +145,9 @@ public function setTaxRate(?TaxRate $taxRate): void; public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): void; /** - * @param ?CustomFieldsDraft $custom + * @param ?string $priceMode */ - public function setCustom(?CustomFieldsDraft $custom): void; + public function setPriceMode(?string $priceMode): void; /** * @param ?ItemShippingDetailsDraft $shippingDetails @@ -149,7 +155,12 @@ public function setCustom(?CustomFieldsDraft $custom): void; public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; /** - * @param ?string $priceMode + * @param ?ItemStateCollection $state */ - public function setPriceMode(?string $priceMode): void; + public function setState(?ItemStateCollection $state): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftBuilder.php similarity index 89% rename from lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftBuilder.php rename to lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftBuilder.php index 87914ef7fcb..d46073486be 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftBuilder.php @@ -6,13 +6,14 @@ * Do not change it. */ -namespace Commercetools\Api\Models\Cart; +namespace Commercetools\Api\Models\Order; +use Commercetools\Api\Models\Cart\ItemShippingDetailsDraft; +use Commercetools\Api\Models\Cart\ItemShippingDetailsDraftBuilder; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringBuilder; use Commercetools\Api\Models\Common\Money; use Commercetools\Api\Models\Common\MoneyBuilder; -use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierBuilder; use Commercetools\Api\Models\TaxCategory\TaxRate; @@ -39,27 +40,21 @@ final class CustomLineItemImportDraftBuilder implements Builder /** - * @var ?int - */ - private $quantity; - - /** - - * @var null|Money|MoneyBuilder + * @var ?string */ - private $money; + private $slug; /** - * @var ?string + * @var ?int */ - private $slug; + private $quantity; /** - * @var ?ItemStateCollection + * @var null|Money|MoneyBuilder */ - private $state; + private $money; /** @@ -75,9 +70,9 @@ final class CustomLineItemImportDraftBuilder implements Builder /** - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + * @var ?string */ - private $custom; + private $priceMode; /** @@ -87,61 +82,63 @@ final class CustomLineItemImportDraftBuilder implements Builder /** - * @var ?string + * @var ?ItemStateCollection */ - private $priceMode; + private $state; /** - * @return null|LocalizedString + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ - public function getName() - { - return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; - } + private $custom; /** - *

The amount of a CustomLineItem in the cart. - * Must be a positive integer.

+ *

Name of the Custom Line Item.

* - * @return null|int + * @return null|LocalizedString */ - public function getQuantity() + public function getName() { - return $this->quantity; + return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; } /** - *

The cost to add to the cart. The amount can be negative.

+ *

User-defined identifier used in a deep-link URL for the Custom Line Item. This value should match the pattern [a-zA-Z0-9_-]{2,256}.

* - * @return null|Money + * @return null|string */ - public function getMoney() + public function getSlug() { - return $this->money instanceof MoneyBuilder ? $this->money->build() : $this->money; + return $this->slug; } /** + *

The number of items in the Custom Line Item. Can be a negative value.

+ * - * @return null|string + * @return null|int */ - public function getSlug() + public function getQuantity() { - return $this->slug; + return $this->quantity; } /** + *

The cost of individual items in the Custom Line Item. The amount can be negative.

+ * - * @return null|ItemStateCollection + * @return null|Money */ - public function getState() + public function getMoney() { - return $this->state; + return $this->money instanceof MoneyBuilder ? $this->money->build() : $this->money; } /** + *

The tax rate used to calculate the taxedPrice of the Order.

+ * * @return null|TaxRate */ @@ -151,6 +148,8 @@ public function getTaxRate() } /** + *

Include a value to associate a Tax Category with the Custom Line Item.

+ * * @return null|TaxCategoryResourceIdentifier */ @@ -160,17 +159,23 @@ public function getTaxCategory() } /** - *

The custom fields.

+ *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
* - * @return null|CustomFieldsDraft + * @return null|string */ - public function getCustom() + public function getPriceMode() { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + return $this->priceMode; } /** + *

Container for Custom Line Item-specific addresses.

+ * * @return null|ItemShippingDetailsDraft */ @@ -180,71 +185,67 @@ public function getShippingDetails() } /** - *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget - * are applied to the Custom Line Item.
  • - *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • - *
+ *

State of the Custom Line Items.

* - * @return null|string + * @return null|ItemStateCollection */ - public function getPriceMode() + public function getState() { - return $this->priceMode; + return $this->state; } /** - * @param ?LocalizedString $name - * @return $this + *

Custom Fields of the CustomLineItem.

+ * + + * @return null|CustomFieldsDraft */ - public function withName(?LocalizedString $name) + public function getCustom() { - $this->name = $name; - - return $this; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** - * @param ?int $quantity + * @param ?LocalizedString $name * @return $this */ - public function withQuantity(?int $quantity) + public function withName(?LocalizedString $name) { - $this->quantity = $quantity; + $this->name = $name; return $this; } /** - * @param ?Money $money + * @param ?string $slug * @return $this */ - public function withMoney(?Money $money) + public function withSlug(?string $slug) { - $this->money = $money; + $this->slug = $slug; return $this; } /** - * @param ?string $slug + * @param ?int $quantity * @return $this */ - public function withSlug(?string $slug) + public function withQuantity(?int $quantity) { - $this->slug = $slug; + $this->quantity = $quantity; return $this; } /** - * @param ?ItemStateCollection $state + * @param ?Money $money * @return $this */ - public function withState(?ItemStateCollection $state) + public function withMoney(?Money $money) { - $this->state = $state; + $this->money = $money; return $this; } @@ -272,12 +273,12 @@ public function withTaxCategory(?TaxCategoryResourceIdentifier $taxCategory) } /** - * @param ?CustomFieldsDraft $custom + * @param ?string $priceMode * @return $this */ - public function withCustom(?CustomFieldsDraft $custom) + public function withPriceMode(?string $priceMode) { - $this->custom = $custom; + $this->priceMode = $priceMode; return $this; } @@ -294,12 +295,23 @@ public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) } /** - * @param ?string $priceMode + * @param ?ItemStateCollection $state * @return $this */ - public function withPriceMode(?string $priceMode) + public function withState(?ItemStateCollection $state) { - $this->priceMode = $priceMode; + $this->state = $state; + + return $this; + } + + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; return $this; } @@ -349,23 +361,23 @@ public function withTaxCategoryBuilder(?TaxCategoryResourceIdentifierBuilder $ta } /** - * @deprecated use withCustom() instead + * @deprecated use withShippingDetails() instead * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shippingDetails) { - $this->custom = $custom; + $this->shippingDetails = $shippingDetails; return $this; } /** - * @deprecated use withShippingDetails() instead + * @deprecated use withCustom() instead * @return $this */ - public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shippingDetails) + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) { - $this->shippingDetails = $shippingDetails; + $this->custom = $custom; return $this; } @@ -374,15 +386,15 @@ public function build(): CustomLineItemImportDraft { return new CustomLineItemImportDraftModel( $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, + $this->slug, $this->quantity, $this->money instanceof MoneyBuilder ? $this->money->build() : $this->money, - $this->slug, - $this->state, $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate, $this->taxCategory instanceof TaxCategoryResourceIdentifierBuilder ? $this->taxCategory->build() : $this->taxCategory, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, + $this->priceMode, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, - $this->priceMode + $this->state, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftCollection.php b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftCollection.php similarity index 97% rename from lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftCollection.php rename to lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftCollection.php index 5103ea2282a..325fa045b89 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftCollection.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftCollection.php @@ -6,7 +6,7 @@ * Do not change it. */ -namespace Commercetools\Api\Models\Cart; +namespace Commercetools\Api\Models\Order; use Commercetools\Base\MapperSequence; use Commercetools\Exception\InvalidArgumentException; diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftModel.php b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftModel.php similarity index 89% rename from lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftModel.php rename to lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftModel.php index 35964a4148e..348d9cec4cd 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftModel.php @@ -6,13 +6,14 @@ * Do not change it. */ -namespace Commercetools\Api\Models\Cart; +namespace Commercetools\Api\Models\Order; +use Commercetools\Api\Models\Cart\ItemShippingDetailsDraft; +use Commercetools\Api\Models\Cart\ItemShippingDetailsDraftModel; use Commercetools\Api\Models\Common\LocalizedString; use Commercetools\Api\Models\Common\LocalizedStringModel; use Commercetools\Api\Models\Common\Money; use Commercetools\Api\Models\Common\MoneyModel; -use Commercetools\Api\Models\Order\ItemStateCollection; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifier; use Commercetools\Api\Models\TaxCategory\TaxCategoryResourceIdentifierModel; use Commercetools\Api\Models\TaxCategory\TaxRate; @@ -38,27 +39,21 @@ final class CustomLineItemImportDraftModel extends JsonObjectModel implements Cu /** * - * @var ?int - */ - protected $quantity; - - /** - * - * @var ?Money + * @var ?string */ - protected $money; + protected $slug; /** * - * @var ?string + * @var ?int */ - protected $slug; + protected $quantity; /** * - * @var ?ItemStateCollection + * @var ?Money */ - protected $state; + protected $money; /** * @@ -74,9 +69,9 @@ final class CustomLineItemImportDraftModel extends JsonObjectModel implements Cu /** * - * @var ?CustomFieldsDraft + * @var ?string */ - protected $custom; + protected $priceMode; /** * @@ -86,9 +81,15 @@ final class CustomLineItemImportDraftModel extends JsonObjectModel implements Cu /** * - * @var ?string + * @var ?ItemStateCollection */ - protected $priceMode; + protected $state; + + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; /** @@ -96,29 +97,31 @@ final class CustomLineItemImportDraftModel extends JsonObjectModel implements Cu */ public function __construct( ?LocalizedString $name = null, + ?string $slug = null, ?int $quantity = null, ?Money $money = null, - ?string $slug = null, - ?ItemStateCollection $state = null, ?TaxRate $taxRate = null, ?TaxCategoryResourceIdentifier $taxCategory = null, - ?CustomFieldsDraft $custom = null, + ?string $priceMode = null, ?ItemShippingDetailsDraft $shippingDetails = null, - ?string $priceMode = null + ?ItemStateCollection $state = null, + ?CustomFieldsDraft $custom = null ) { $this->name = $name; + $this->slug = $slug; $this->quantity = $quantity; $this->money = $money; - $this->slug = $slug; - $this->state = $state; $this->taxRate = $taxRate; $this->taxCategory = $taxCategory; - $this->custom = $custom; - $this->shippingDetails = $shippingDetails; $this->priceMode = $priceMode; + $this->shippingDetails = $shippingDetails; + $this->state = $state; + $this->custom = $custom; } /** + *

Name of the Custom Line Item.

+ * * * @return null|LocalizedString */ @@ -138,8 +141,27 @@ public function getName() } /** - *

The amount of a CustomLineItem in the cart. - * Must be a positive integer.

+ *

User-defined identifier used in a deep-link URL for the Custom Line Item. This value should match the pattern [a-zA-Z0-9_-]{2,256}.

+ * + * + * @return null|string + */ + public function getSlug() + { + if (is_null($this->slug)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SLUG); + if (is_null($data)) { + return null; + } + $this->slug = (string) $data; + } + + return $this->slug; + } + + /** + *

The number of items in the Custom Line Item. Can be a negative value.

* * * @return null|int @@ -159,7 +181,7 @@ public function getQuantity() } /** - *

The cost to add to the cart. The amount can be negative.

+ *

The cost of individual items in the Custom Line Item. The amount can be negative.

* * * @return null|Money @@ -180,42 +202,8 @@ public function getMoney() } /** + *

The tax rate used to calculate the taxedPrice of the Order.

* - * @return null|string - */ - public function getSlug() - { - if (is_null($this->slug)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SLUG); - if (is_null($data)) { - return null; - } - $this->slug = (string) $data; - } - - return $this->slug; - } - - /** - * - * @return null|ItemStateCollection - */ - public function getState() - { - if (is_null($this->state)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_STATE); - if (is_null($data)) { - return null; - } - $this->state = ItemStateCollection::fromArray($data); - } - - return $this->state; - } - - /** * * @return null|TaxRate */ @@ -235,6 +223,8 @@ public function getTaxRate() } /** + *

Include a value to associate a Tax Category with the Custom Line Item.

+ * * * @return null|TaxCategoryResourceIdentifier */ @@ -254,27 +244,32 @@ public function getTaxCategory() } /** - *

The custom fields.

+ *
    + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget + * are applied to the Custom Line Item.
  • + *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • + *
* * - * @return null|CustomFieldsDraft + * @return null|string */ - public function getCustom() + public function getPriceMode() { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($this->priceMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PRICE_MODE); if (is_null($data)) { return null; } - - $this->custom = CustomFieldsDraftModel::of($data); + $this->priceMode = (string) $data; } - return $this->custom; + return $this->priceMode; } /** + *

Container for Custom Line Item-specific addresses.

+ * * * @return null|ItemShippingDetailsDraft */ @@ -294,68 +289,77 @@ public function getShippingDetails() } /** - *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget - * are applied to the Custom Line Item.
  • - *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • - *
+ *

State of the Custom Line Items.

* * - * @return null|string + * @return null|ItemStateCollection */ - public function getPriceMode() + public function getState() { - if (is_null($this->priceMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_PRICE_MODE); + if (is_null($this->state)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STATE); if (is_null($data)) { return null; } - $this->priceMode = (string) $data; + $this->state = ItemStateCollection::fromArray($data); } - return $this->priceMode; + return $this->state; } - /** - * @param ?LocalizedString $name + *

Custom Fields of the CustomLineItem.

+ * + * + * @return null|CustomFieldsDraft */ - public function setName(?LocalizedString $name): void + public function getCustom() { - $this->name = $name; + 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 ?int $quantity + * @param ?LocalizedString $name */ - public function setQuantity(?int $quantity): void + public function setName(?LocalizedString $name): void { - $this->quantity = $quantity; + $this->name = $name; } /** - * @param ?Money $money + * @param ?string $slug */ - public function setMoney(?Money $money): void + public function setSlug(?string $slug): void { - $this->money = $money; + $this->slug = $slug; } /** - * @param ?string $slug + * @param ?int $quantity */ - public function setSlug(?string $slug): void + public function setQuantity(?int $quantity): void { - $this->slug = $slug; + $this->quantity = $quantity; } /** - * @param ?ItemStateCollection $state + * @param ?Money $money */ - public function setState(?ItemStateCollection $state): void + public function setMoney(?Money $money): void { - $this->state = $state; + $this->money = $money; } /** @@ -375,11 +379,11 @@ public function setTaxCategory(?TaxCategoryResourceIdentifier $taxCategory): voi } /** - * @param ?CustomFieldsDraft $custom + * @param ?string $priceMode */ - public function setCustom(?CustomFieldsDraft $custom): void + public function setPriceMode(?string $priceMode): void { - $this->custom = $custom; + $this->priceMode = $priceMode; } /** @@ -391,10 +395,18 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): } /** - * @param ?string $priceMode + * @param ?ItemStateCollection $state */ - public function setPriceMode(?string $priceMode): void + public function setState(?ItemStateCollection $state): void { - $this->priceMode = $priceMode; + $this->state = $state; + } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; } } diff --git a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraft.php b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraft.php index 7c0c6d3481a..72c43cde2b5 100644 --- a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraft.php +++ b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraft.php @@ -19,7 +19,7 @@ interface DiscountedLineItemPriceDraft extends JsonObject public const FIELD_INCLUDED_DISCOUNTS = 'includedDiscounts'; /** - *

Draft type that stores amounts only in cent precision for the specified currency.

+ *

Discounted money value.

* * @return null|Money @@ -27,6 +27,8 @@ interface DiscountedLineItemPriceDraft extends JsonObject public function getValue(); /** + *

Discounts to be applied.

+ * * @return null|DiscountedLineItemPortionCollection */ diff --git a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftBuilder.php b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftBuilder.php index e774a498793..ce5c8a2a785 100644 --- a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftBuilder.php @@ -36,7 +36,7 @@ final class DiscountedLineItemPriceDraftBuilder implements Builder private $includedDiscounts; /** - *

Draft type that stores amounts only in cent precision for the specified currency.

+ *

Discounted money value.

* * @return null|Money @@ -47,6 +47,8 @@ public function getValue() } /** + *

Discounts to be applied.

+ * * @return null|DiscountedLineItemPortionCollection */ diff --git a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftModel.php b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftModel.php index 73ee7ee0565..29159468546 100644 --- a/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/DiscountedLineItemPriceDraftModel.php @@ -47,7 +47,7 @@ public function __construct( } /** - *

Draft type that stores amounts only in cent precision for the specified currency.

+ *

Discounted money value.

* * * @return null|Money @@ -68,6 +68,8 @@ public function getValue() } /** + *

Discounts to be applied.

+ * * * @return null|DiscountedLineItemPortionCollection */ diff --git a/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php b/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php index 1de13892d70..bc4a6f607eb 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php @@ -19,30 +19,21 @@ interface LineItemImportDraft extends JsonObject { - public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_NAME = 'name'; public const FIELD_VARIANT = 'variant'; - public const FIELD_PRICE = 'price'; + public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_QUANTITY = 'quantity'; - public const FIELD_STATE = 'state'; - public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; - public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; + public const FIELD_PRICE = 'price'; public const FIELD_TAX_RATE = 'taxRate'; - public const FIELD_CUSTOM = 'custom'; + public const FIELD_DISTRIBUTION_CHANNEL = 'distributionChannel'; + public const FIELD_SUPPLY_CHANNEL = 'supplyChannel'; public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; + public const FIELD_STATE = 'state'; + public const FIELD_CUSTOM = 'custom'; /** - *

ID of the existing product. - * You also need to specify the ID of the variant if this property is set or alternatively you can just specify SKU of the product variant.

- * - - * @return null|string - */ - public function getProductId(); - - /** - *

The product name.

+ *

Name of the Line Item.

* * @return null|LocalizedString @@ -50,44 +41,49 @@ public function getProductId(); public function getName(); /** + *

The Product Variant to use as a Line Item.

+ * * @return null|ProductVariantImportDraft */ public function getVariant(); /** + *

id of the Product the Product Variant belongs to.

+ *

If provided, you must also set variant.id.

+ * - * @return null|PriceDraft + * @return null|string */ - public function getPrice(); + public function getProductId(); /** + *

The number of Product Variants in the LineItem. Can be a negative value.

+ * * @return null|int */ public function getQuantity(); /** + *

The Line Item price for quantity = 1. The amount can be negative.

+ * - * @return null|ItemStateCollection + * @return null|PriceDraft */ - public function getState(); + public function getPrice(); /** - *

Connection to a particular supplier. - * By providing supply channel information, you can uniquely identify - * inventory entries that should be reserved. - * The provided channel should have the - * InventorySupply role.

+ *

The tax rate used to calculate the taxedPrice of the Order.

* - * @return null|ChannelResourceIdentifier + * @return null|TaxRate */ - public function getSupplyChannel(); + public function getTaxRate(); /** - *

The channel is used to select a ProductPrice. - * The provided channel should have the ProductDistribution role.

+ *

The Channel used to select a Price. + * This Channel must have the ProductDistribution role.

* * @return null|ChannelResourceIdentifier @@ -95,22 +91,18 @@ public function getSupplyChannel(); public function getDistributionChannel(); /** - - * @return null|TaxRate - */ - public function getTaxRate(); - - /** - *

The custom fields.

+ *

The Channel used to supply Line Items. + * By providing supply Channel information, you can uniquely identify Inventory entries that should be reserved. + * This Channel must have the InventorySupply role.

* - * @return null|CustomFieldsDraft + * @return null|ChannelResourceIdentifier */ - public function getCustom(); + public function getSupplyChannel(); /** - *

Inventory mode specific to the line item only, valid for the entire quantity of the line item. - * Set only if inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

+ *

Inventory mode specific to the LineItem, valid for the entire quantity of the LineItem. + * Set only if Inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

* * @return null|string @@ -118,15 +110,28 @@ public function getCustom(); public function getInventoryMode(); /** + *

Container for Line Item-specific addresses.

+ * * @return null|ItemShippingDetailsDraft */ public function getShippingDetails(); /** - * @param ?string $productId + *

States of the Line Item.

+ * + + * @return null|ItemStateCollection */ - public function setProductId(?string $productId): void; + public function getState(); + + /** + *

Custom Fields of the LineItem.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom(); /** * @param ?LocalizedString $name @@ -139,9 +144,9 @@ public function setName(?LocalizedString $name): void; public function setVariant(?ProductVariantImportDraft $variant): void; /** - * @param ?PriceDraft $price + * @param ?string $productId */ - public function setPrice(?PriceDraft $price): void; + public function setProductId(?string $productId): void; /** * @param ?int $quantity @@ -149,14 +154,14 @@ public function setPrice(?PriceDraft $price): void; public function setQuantity(?int $quantity): void; /** - * @param ?ItemStateCollection $state + * @param ?PriceDraft $price */ - public function setState(?ItemStateCollection $state): void; + public function setPrice(?PriceDraft $price): void; /** - * @param ?ChannelResourceIdentifier $supplyChannel + * @param ?TaxRate $taxRate */ - public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void; + public function setTaxRate(?TaxRate $taxRate): void; /** * @param ?ChannelResourceIdentifier $distributionChannel @@ -164,14 +169,9 @@ public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): voi public function setDistributionChannel(?ChannelResourceIdentifier $distributionChannel): void; /** - * @param ?TaxRate $taxRate - */ - public function setTaxRate(?TaxRate $taxRate): void; - - /** - * @param ?CustomFieldsDraft $custom + * @param ?ChannelResourceIdentifier $supplyChannel */ - public function setCustom(?CustomFieldsDraft $custom): void; + public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void; /** * @param ?string $inventoryMode @@ -182,4 +182,14 @@ public function setInventoryMode(?string $inventoryMode): void; * @param ?ItemShippingDetailsDraft $shippingDetails */ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): void; + + /** + * @param ?ItemStateCollection $state + */ + public function setState(?ItemStateCollection $state): void; + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php index 0ab8767c8f8..d7cb7818b78 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php @@ -32,12 +32,6 @@ */ final class LineItemImportDraftBuilder implements Builder { - /** - - * @var ?string - */ - private $productId; - /** * @var null|LocalizedString|LocalizedStringBuilder @@ -52,9 +46,9 @@ final class LineItemImportDraftBuilder implements Builder /** - * @var null|PriceDraft|PriceDraftBuilder + * @var ?string */ - private $price; + private $productId; /** @@ -64,15 +58,15 @@ final class LineItemImportDraftBuilder implements Builder /** - * @var ?ItemStateCollection + * @var null|PriceDraft|PriceDraftBuilder */ - private $state; + private $price; /** - * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder + * @var null|TaxRate|TaxRateBuilder */ - private $supplyChannel; + private $taxRate; /** @@ -82,15 +76,9 @@ final class LineItemImportDraftBuilder implements Builder /** - * @var null|TaxRate|TaxRateBuilder - */ - private $taxRate; - - /** - - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + * @var null|ChannelResourceIdentifier|ChannelResourceIdentifierBuilder */ - private $custom; + private $supplyChannel; /** @@ -105,19 +93,19 @@ final class LineItemImportDraftBuilder implements Builder private $shippingDetails; /** - *

ID of the existing product. - * You also need to specify the ID of the variant if this property is set or alternatively you can just specify SKU of the product variant.

- * - * @return null|string + * @var ?ItemStateCollection */ - public function getProductId() - { - return $this->productId; - } + private $state; /** - *

The product name.

+ + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + */ + private $custom; + + /** + *

Name of the Line Item.

* * @return null|LocalizedString @@ -128,6 +116,8 @@ public function getName() } /** + *

The Product Variant to use as a Line Item.

+ * * @return null|ProductVariantImportDraft */ @@ -137,15 +127,20 @@ public function getVariant() } /** + *

id of the Product the Product Variant belongs to.

+ *

If provided, you must also set variant.id.

+ * - * @return null|PriceDraft + * @return null|string */ - public function getPrice() + public function getProductId() { - return $this->price instanceof PriceDraftBuilder ? $this->price->build() : $this->price; + return $this->productId; } /** + *

The number of Product Variants in the LineItem. Can be a negative value.

+ * * @return null|int */ @@ -155,32 +150,30 @@ public function getQuantity() } /** + *

The Line Item price for quantity = 1. The amount can be negative.

+ * - * @return null|ItemStateCollection + * @return null|PriceDraft */ - public function getState() + public function getPrice() { - return $this->state; + return $this->price instanceof PriceDraftBuilder ? $this->price->build() : $this->price; } /** - *

Connection to a particular supplier. - * By providing supply channel information, you can uniquely identify - * inventory entries that should be reserved. - * The provided channel should have the - * InventorySupply role.

+ *

The tax rate used to calculate the taxedPrice of the Order.

* - * @return null|ChannelResourceIdentifier + * @return null|TaxRate */ - public function getSupplyChannel() + public function getTaxRate() { - return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel; + return $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate; } /** - *

The channel is used to select a ProductPrice. - * The provided channel should have the ProductDistribution role.

+ *

The Channel used to select a Price. + * This Channel must have the ProductDistribution role.

* * @return null|ChannelResourceIdentifier @@ -191,28 +184,21 @@ public function getDistributionChannel() } /** - - * @return null|TaxRate - */ - public function getTaxRate() - { - return $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate; - } - - /** - *

The custom fields.

+ *

The Channel used to supply Line Items. + * By providing supply Channel information, you can uniquely identify Inventory entries that should be reserved. + * This Channel must have the InventorySupply role.

* - * @return null|CustomFieldsDraft + * @return null|ChannelResourceIdentifier */ - public function getCustom() + public function getSupplyChannel() { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + return $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel; } /** - *

Inventory mode specific to the line item only, valid for the entire quantity of the line item. - * Set only if inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

+ *

Inventory mode specific to the LineItem, valid for the entire quantity of the LineItem. + * Set only if Inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

* * @return null|string @@ -223,6 +209,8 @@ public function getInventoryMode() } /** + *

Container for Line Item-specific addresses.

+ * * @return null|ItemShippingDetailsDraft */ @@ -232,14 +220,25 @@ public function getShippingDetails() } /** - * @param ?string $productId - * @return $this + *

States of the Line Item.

+ * + + * @return null|ItemStateCollection */ - public function withProductId(?string $productId) + public function getState() { - $this->productId = $productId; + return $this->state; + } - return $this; + /** + *

Custom Fields of the LineItem.

+ * + + * @return null|CustomFieldsDraft + */ + public function getCustom() + { + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -265,12 +264,12 @@ public function withVariant(?ProductVariantImportDraft $variant) } /** - * @param ?PriceDraft $price + * @param ?string $productId * @return $this */ - public function withPrice(?PriceDraft $price) + public function withProductId(?string $productId) { - $this->price = $price; + $this->productId = $productId; return $this; } @@ -287,23 +286,23 @@ public function withQuantity(?int $quantity) } /** - * @param ?ItemStateCollection $state + * @param ?PriceDraft $price * @return $this */ - public function withState(?ItemStateCollection $state) + public function withPrice(?PriceDraft $price) { - $this->state = $state; + $this->price = $price; return $this; } /** - * @param ?ChannelResourceIdentifier $supplyChannel + * @param ?TaxRate $taxRate * @return $this */ - public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel) + public function withTaxRate(?TaxRate $taxRate) { - $this->supplyChannel = $supplyChannel; + $this->taxRate = $taxRate; return $this; } @@ -320,45 +319,56 @@ public function withDistributionChannel(?ChannelResourceIdentifier $distribution } /** - * @param ?TaxRate $taxRate + * @param ?ChannelResourceIdentifier $supplyChannel * @return $this */ - public function withTaxRate(?TaxRate $taxRate) + public function withSupplyChannel(?ChannelResourceIdentifier $supplyChannel) { - $this->taxRate = $taxRate; + $this->supplyChannel = $supplyChannel; return $this; } /** - * @param ?CustomFieldsDraft $custom + * @param ?string $inventoryMode * @return $this */ - public function withCustom(?CustomFieldsDraft $custom) + public function withInventoryMode(?string $inventoryMode) { - $this->custom = $custom; + $this->inventoryMode = $inventoryMode; return $this; } /** - * @param ?string $inventoryMode + * @param ?ItemShippingDetailsDraft $shippingDetails * @return $this */ - public function withInventoryMode(?string $inventoryMode) + public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) { - $this->inventoryMode = $inventoryMode; + $this->shippingDetails = $shippingDetails; return $this; } /** - * @param ?ItemShippingDetailsDraft $shippingDetails + * @param ?ItemStateCollection $state * @return $this */ - public function withShippingDetails(?ItemShippingDetailsDraft $shippingDetails) + public function withState(?ItemStateCollection $state) { - $this->shippingDetails = $shippingDetails; + $this->state = $state; + + return $this; + } + + /** + * @param ?CustomFieldsDraft $custom + * @return $this + */ + public function withCustom(?CustomFieldsDraft $custom) + { + $this->custom = $custom; return $this; } @@ -397,12 +407,12 @@ public function withPriceBuilder(?PriceDraftBuilder $price) } /** - * @deprecated use withSupplyChannel() instead + * @deprecated use withTaxRate() instead * @return $this */ - public function withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel) + public function withTaxRateBuilder(?TaxRateBuilder $taxRate) { - $this->supplyChannel = $supplyChannel; + $this->taxRate = $taxRate; return $this; } @@ -419,34 +429,34 @@ public function withDistributionChannelBuilder(?ChannelResourceIdentifierBuilder } /** - * @deprecated use withTaxRate() instead + * @deprecated use withSupplyChannel() instead * @return $this */ - public function withTaxRateBuilder(?TaxRateBuilder $taxRate) + public function withSupplyChannelBuilder(?ChannelResourceIdentifierBuilder $supplyChannel) { - $this->taxRate = $taxRate; + $this->supplyChannel = $supplyChannel; return $this; } /** - * @deprecated use withCustom() instead + * @deprecated use withShippingDetails() instead * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shippingDetails) { - $this->custom = $custom; + $this->shippingDetails = $shippingDetails; return $this; } /** - * @deprecated use withShippingDetails() instead + * @deprecated use withCustom() instead * @return $this */ - public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shippingDetails) + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) { - $this->shippingDetails = $shippingDetails; + $this->custom = $custom; return $this; } @@ -454,18 +464,18 @@ public function withShippingDetailsBuilder(?ItemShippingDetailsDraftBuilder $shi public function build(): LineItemImportDraft { return new LineItemImportDraftModel( - $this->productId, $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, $this->variant instanceof ProductVariantImportDraftBuilder ? $this->variant->build() : $this->variant, - $this->price instanceof PriceDraftBuilder ? $this->price->build() : $this->price, + $this->productId, $this->quantity, - $this->state, - $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, - $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, + $this->price instanceof PriceDraftBuilder ? $this->price->build() : $this->price, $this->taxRate instanceof TaxRateBuilder ? $this->taxRate->build() : $this->taxRate, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, + $this->distributionChannel instanceof ChannelResourceIdentifierBuilder ? $this->distributionChannel->build() : $this->distributionChannel, + $this->supplyChannel instanceof ChannelResourceIdentifierBuilder ? $this->supplyChannel->build() : $this->supplyChannel, $this->inventoryMode, - $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails + $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, + $this->state, + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php b/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php index ed86bae1c9f..170f7c4599b 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php @@ -31,12 +31,6 @@ */ final class LineItemImportDraftModel extends JsonObjectModel implements LineItemImportDraft { - /** - * - * @var ?string - */ - protected $productId; - /** * * @var ?LocalizedString @@ -51,9 +45,9 @@ final class LineItemImportDraftModel extends JsonObjectModel implements LineItem /** * - * @var ?PriceDraft + * @var ?string */ - protected $price; + protected $productId; /** * @@ -63,15 +57,15 @@ final class LineItemImportDraftModel extends JsonObjectModel implements LineItem /** * - * @var ?ItemStateCollection + * @var ?PriceDraft */ - protected $state; + protected $price; /** * - * @var ?ChannelResourceIdentifier + * @var ?TaxRate */ - protected $supplyChannel; + protected $taxRate; /** * @@ -81,15 +75,9 @@ final class LineItemImportDraftModel extends JsonObjectModel implements LineItem /** * - * @var ?TaxRate - */ - protected $taxRate; - - /** - * - * @var ?CustomFieldsDraft + * @var ?ChannelResourceIdentifier */ - protected $custom; + protected $supplyChannel; /** * @@ -103,61 +91,52 @@ final class LineItemImportDraftModel extends JsonObjectModel implements LineItem */ protected $shippingDetails; + /** + * + * @var ?ItemStateCollection + */ + protected $state; + + /** + * + * @var ?CustomFieldsDraft + */ + protected $custom; + /** * @psalm-suppress MissingParamType */ public function __construct( - ?string $productId = null, ?LocalizedString $name = null, ?ProductVariantImportDraft $variant = null, - ?PriceDraft $price = null, + ?string $productId = null, ?int $quantity = null, - ?ItemStateCollection $state = null, - ?ChannelResourceIdentifier $supplyChannel = null, - ?ChannelResourceIdentifier $distributionChannel = null, + ?PriceDraft $price = null, ?TaxRate $taxRate = null, - ?CustomFieldsDraft $custom = null, + ?ChannelResourceIdentifier $distributionChannel = null, + ?ChannelResourceIdentifier $supplyChannel = null, ?string $inventoryMode = null, - ?ItemShippingDetailsDraft $shippingDetails = null + ?ItemShippingDetailsDraft $shippingDetails = null, + ?ItemStateCollection $state = null, + ?CustomFieldsDraft $custom = null ) { - $this->productId = $productId; $this->name = $name; $this->variant = $variant; - $this->price = $price; + $this->productId = $productId; $this->quantity = $quantity; - $this->state = $state; - $this->supplyChannel = $supplyChannel; - $this->distributionChannel = $distributionChannel; + $this->price = $price; $this->taxRate = $taxRate; - $this->custom = $custom; + $this->distributionChannel = $distributionChannel; + $this->supplyChannel = $supplyChannel; $this->inventoryMode = $inventoryMode; $this->shippingDetails = $shippingDetails; + $this->state = $state; + $this->custom = $custom; } /** - *

ID of the existing product. - * You also need to specify the ID of the variant if this property is set or alternatively you can just specify SKU of the product variant.

- * - * - * @return null|string - */ - public function getProductId() - { - if (is_null($this->productId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_PRODUCT_ID); - if (is_null($data)) { - return null; - } - $this->productId = (string) $data; - } - - return $this->productId; - } - - /** - *

The product name.

+ *

Name of the Line Item.

* * * @return null|LocalizedString @@ -178,6 +157,8 @@ public function getName() } /** + *

The Product Variant to use as a Line Item.

+ * * * @return null|ProductVariantImportDraft */ @@ -197,25 +178,29 @@ public function getVariant() } /** + *

id of the Product the Product Variant belongs to.

+ *

If provided, you must also set variant.id.

* - * @return null|PriceDraft + * + * @return null|string */ - public function getPrice() + public function getProductId() { - if (is_null($this->price)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_PRICE); + if (is_null($this->productId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PRODUCT_ID); if (is_null($data)) { return null; } - - $this->price = PriceDraftModel::of($data); + $this->productId = (string) $data; } - return $this->price; + return $this->productId; } /** + *

The number of Product Variants in the LineItem. Can be a negative value.

+ * * * @return null|int */ @@ -234,51 +219,50 @@ public function getQuantity() } /** + *

The Line Item price for quantity = 1. The amount can be negative.

* - * @return null|ItemStateCollection + * + * @return null|PriceDraft */ - public function getState() + public function getPrice() { - if (is_null($this->state)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_STATE); + if (is_null($this->price)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PRICE); if (is_null($data)) { return null; } - $this->state = ItemStateCollection::fromArray($data); + + $this->price = PriceDraftModel::of($data); } - return $this->state; + return $this->price; } /** - *

Connection to a particular supplier. - * By providing supply channel information, you can uniquely identify - * inventory entries that should be reserved. - * The provided channel should have the - * InventorySupply role.

+ *

The tax rate used to calculate the taxedPrice of the Order.

* * - * @return null|ChannelResourceIdentifier + * @return null|TaxRate */ - public function getSupplyChannel() + public function getTaxRate() { - if (is_null($this->supplyChannel)) { + if (is_null($this->taxRate)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SUPPLY_CHANNEL); + $data = $this->raw(self::FIELD_TAX_RATE); if (is_null($data)) { return null; } - $this->supplyChannel = ChannelResourceIdentifierModel::of($data); + $this->taxRate = TaxRateModel::of($data); } - return $this->supplyChannel; + return $this->taxRate; } /** - *

The channel is used to select a ProductPrice. - * The provided channel should have the ProductDistribution role.

+ *

The Channel used to select a Price. + * This Channel must have the ProductDistribution role.

* * * @return null|ChannelResourceIdentifier @@ -299,48 +283,31 @@ public function getDistributionChannel() } /** - * - * @return null|TaxRate - */ - public function getTaxRate() - { - if (is_null($this->taxRate)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_TAX_RATE); - if (is_null($data)) { - return null; - } - - $this->taxRate = TaxRateModel::of($data); - } - - return $this->taxRate; - } - - /** - *

The custom fields.

+ *

The Channel used to supply Line Items. + * By providing supply Channel information, you can uniquely identify Inventory entries that should be reserved. + * This Channel must have the InventorySupply role.

* * - * @return null|CustomFieldsDraft + * @return null|ChannelResourceIdentifier */ - public function getCustom() + public function getSupplyChannel() { - if (is_null($this->custom)) { + if (is_null($this->supplyChannel)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); + $data = $this->raw(self::FIELD_SUPPLY_CHANNEL); if (is_null($data)) { return null; } - $this->custom = CustomFieldsDraftModel::of($data); + $this->supplyChannel = ChannelResourceIdentifierModel::of($data); } - return $this->custom; + return $this->supplyChannel; } /** - *

Inventory mode specific to the line item only, valid for the entire quantity of the line item. - * Set only if inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

+ *

Inventory mode specific to the LineItem, valid for the entire quantity of the LineItem. + * Set only if Inventory mode should be different from the inventoryMode specified on the OrderImportDraft.

* * * @return null|string @@ -360,6 +327,8 @@ public function getInventoryMode() } /** + *

Container for Line Item-specific addresses.

+ * * * @return null|ItemShippingDetailsDraft */ @@ -378,15 +347,48 @@ public function getShippingDetails() return $this->shippingDetails; } + /** + *

States of the Line Item.

+ * + * + * @return null|ItemStateCollection + */ + public function getState() + { + if (is_null($this->state)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_STATE); + if (is_null($data)) { + return null; + } + $this->state = ItemStateCollection::fromArray($data); + } + + return $this->state; + } /** - * @param ?string $productId + *

Custom Fields of the LineItem.

+ * + * + * @return null|CustomFieldsDraft */ - public function setProductId(?string $productId): void + public function getCustom() { - $this->productId = $productId; + 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 ?LocalizedString $name */ @@ -404,11 +406,11 @@ public function setVariant(?ProductVariantImportDraft $variant): void } /** - * @param ?PriceDraft $price + * @param ?string $productId */ - public function setPrice(?PriceDraft $price): void + public function setProductId(?string $productId): void { - $this->price = $price; + $this->productId = $productId; } /** @@ -420,19 +422,19 @@ public function setQuantity(?int $quantity): void } /** - * @param ?ItemStateCollection $state + * @param ?PriceDraft $price */ - public function setState(?ItemStateCollection $state): void + public function setPrice(?PriceDraft $price): void { - $this->state = $state; + $this->price = $price; } /** - * @param ?ChannelResourceIdentifier $supplyChannel + * @param ?TaxRate $taxRate */ - public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void + public function setTaxRate(?TaxRate $taxRate): void { - $this->supplyChannel = $supplyChannel; + $this->taxRate = $taxRate; } /** @@ -444,19 +446,11 @@ public function setDistributionChannel(?ChannelResourceIdentifier $distributionC } /** - * @param ?TaxRate $taxRate - */ - public function setTaxRate(?TaxRate $taxRate): void - { - $this->taxRate = $taxRate; - } - - /** - * @param ?CustomFieldsDraft $custom + * @param ?ChannelResourceIdentifier $supplyChannel */ - public function setCustom(?CustomFieldsDraft $custom): void + public function setSupplyChannel(?ChannelResourceIdentifier $supplyChannel): void { - $this->custom = $custom; + $this->supplyChannel = $supplyChannel; } /** @@ -474,4 +468,20 @@ public function setShippingDetails(?ItemShippingDetailsDraft $shippingDetails): { $this->shippingDetails = $shippingDetails; } + + /** + * @param ?ItemStateCollection $state + */ + public function setState(?ItemStateCollection $state): void + { + $this->state = $state; + } + + /** + * @param ?CustomFieldsDraft $custom + */ + public function setCustom(?CustomFieldsDraft $custom): void + { + $this->custom = $custom; + } } diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraft.php b/lib/commercetools-api/src/Models/Order/OrderImportDraft.php index d1a10b409ac..d88f184ad73 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraft.php @@ -9,7 +9,6 @@ namespace Commercetools\Api\Models\Order; use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; -use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection; use Commercetools\Api\Models\Cart\TaxedPriceDraft; use Commercetools\Api\Models\Common\BaseAddress; use Commercetools\Api\Models\Common\BaseAddressCollection; @@ -25,35 +24,36 @@ interface OrderImportDraft extends JsonObject { public const FIELD_ORDER_NUMBER = 'orderNumber'; + public const FIELD_PURCHASE_ORDER_NUMBER = 'purchaseOrderNumber'; public const FIELD_CUSTOMER_ID = 'customerId'; public const FIELD_CUSTOMER_EMAIL = 'customerEmail'; + public const FIELD_CUSTOMER_GROUP = 'customerGroup'; + public const FIELD_BUSINESS_UNIT = 'businessUnit'; + public const FIELD_STORE = 'store'; public const FIELD_LINE_ITEMS = 'lineItems'; public const FIELD_CUSTOM_LINE_ITEMS = 'customLineItems'; public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_TAXED_PRICE = 'taxedPrice'; - public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; + public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; + public const FIELD_TAX_CALCULATION_MODE = 'taxCalculationMode'; + public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_BILLING_ADDRESS = 'billingAddress'; - public const FIELD_CUSTOMER_GROUP = 'customerGroup'; - public const FIELD_COUNTRY = 'country'; - public const FIELD_ORDER_STATE = 'orderState'; - public const FIELD_STATE = 'state'; - public const FIELD_SHIPMENT_STATE = 'shipmentState'; - public const FIELD_PAYMENT_STATE = 'paymentState'; + public const FIELD_SHIPPING_ADDRESS = 'shippingAddress'; + public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; public const FIELD_SHIPPING_INFO = 'shippingInfo'; public const FIELD_PAYMENT_INFO = 'paymentInfo'; + public const FIELD_PAYMENT_STATE = 'paymentState'; + public const FIELD_SHIPMENT_STATE = 'shipmentState'; + public const FIELD_ORDER_STATE = 'orderState'; + public const FIELD_STATE = 'state'; + public const FIELD_COUNTRY = 'country'; + public const FIELD_ORIGIN = 'origin'; public const FIELD_COMPLETED_AT = 'completedAt'; public const FIELD_CUSTOM = 'custom'; - public const FIELD_INVENTORY_MODE = 'inventoryMode'; - public const FIELD_TAX_ROUNDING_MODE = 'taxRoundingMode'; - public const FIELD_ITEM_SHIPPING_ADDRESSES = 'itemShippingAddresses'; - public const FIELD_BUSINESS_UNIT = 'businessUnit'; - public const FIELD_STORE = 'store'; - public const FIELD_ORIGIN = 'origin'; /** - *

String that unique identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique within a project.

+ *

User-defined identifier of the Order. Must be unique across a Project. + * Once set, the value cannot be changed.

* * @return null|string @@ -61,7 +61,15 @@ interface OrderImportDraft extends JsonObject public function getOrderNumber(); /** - *

If given the customer with that ID must exist in the project.

+ *

User-defined identifier for a purchase Order.

+ * + + * @return null|string + */ + public function getPurchaseOrderNumber(); + + /** + *

The id of the Customer the Order belongs to.

* * @return null|string @@ -69,7 +77,7 @@ public function getOrderNumber(); public function getCustomerId(); /** - *

The customer email can be used when no check against existing Customers is desired during order import.

+ *

The Email address of the Customer the Order belongs to. Can be used instead of customerId when no check against existing Customers is required.

* * @return null|string @@ -77,98 +85,117 @@ public function getCustomerId(); public function getCustomerEmail(); /** - *

If not given customLineItems must not be empty.

+ *

The Customer Group of the Customer the Order belongs to.

* - * @return null|LineItemImportDraftCollection + * @return null|CustomerGroupResourceIdentifier */ - public function getLineItems(); + public function getCustomerGroup(); /** - *

If not given lineItems must not be empty.

+ *

ResourceIdentifier to the Business Unit the Order should belong to. + * When the customerId of the Order is also set, the Customer must be an Associate of the Business Unit.

* - * @return null|CustomLineItemImportDraftCollection + * @return null|BusinessUnitResourceIdentifier */ - public function getCustomLineItems(); + public function getBusinessUnit(); /** + *

The Store the Order belongs to. + * Used for filtering.

+ *

If a LineItemImportDraft or a CustomLineItemImportDraft specifies a distributionChannel or a supplyChannel that is not defined for the referenced Store, the Order Import gets rejected. + * The same applies when the provided country is not defined for the referenced Store.

+ * - * @return null|Money + * @return null|StoreResourceIdentifier */ - public function getTotalPrice(); + public function getStore(); /** - *

Order Import does not support calculation of taxes. - * When setting the draft the taxedPrice is to be provided.

+ *

Line Items to add to the Order.

+ *

If not specified, customLineItems must not be empty.

* - * @return null|TaxedPriceDraft + * @return null|LineItemImportDraftCollection */ - public function getTaxedPrice(); + public function getLineItems(); /** + *

Custom Line Items to add to the Cart.

+ *

If not specified, lineItems must not be empty.

+ * - * @return null|BaseAddress + * @return null|CustomLineItemImportDraftCollection */ - public function getShippingAddress(); + public function getCustomLineItems(); /** + *

The total Price of the Order. The amount can be negative.

+ * - * @return null|BaseAddress + * @return null|Money */ - public function getBillingAddress(); + public function getTotalPrice(); /** - *

Set when the customer is set and the customer is a member of a customer group. - * Used for product variant price selection.

+ *

Include TaxedPrice information for the Order. If not included, and if you have Tax Rates set for Line Items and Custom Line Items, the Order total will not be recalculated.

* - * @return null|CustomerGroupResourceIdentifier + * @return null|TaxedPriceDraft */ - public function getCustomerGroup(); + public function getTaxedPrice(); /** - *

A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

+ *

Determines how monetary values are rounded when calculating taxes for taxedPrice.

* * @return null|string */ - public function getCountry(); + public function getTaxRoundingMode(); /** - *

Current status of the Order.

+ *

Determines how taxes are calculated for taxedPrice.

* * @return null|string */ - public function getOrderState(); + public function getTaxCalculationMode(); /** - *

This reference can point to a state in a custom workflow.

+ *

Determines how stock quantities are tracked for Line Items in the Cart.

* - * @return null|StateReference + * @return null|string */ - public function getState(); + public function getInventoryMode(); /** - *

Shipment status of the Order.

+ *

Billing address associated with the Order.

* - * @return null|string + * @return null|BaseAddress */ - public function getShipmentState(); + public function getBillingAddress(); /** + *

Shipping address associated with the Order.

+ * - * @return null|string + * @return null|BaseAddress */ - public function getPaymentState(); + public function getShippingAddress(); /** - *

Set if the ShippingMethod is set.

+ *

Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

+ * + + * @return null|BaseAddressCollection + */ + public function getItemShippingAddresses(); + + /** + *

Shipping-related information of the Order.

* * @return null|ShippingInfoImportDraft @@ -184,70 +211,79 @@ public function getShippingInfo(); public function getPaymentInfo(); /** + *

Payment status of the Order.

+ * - * @return null|DateTimeImmutable + * @return null|string */ - public function getCompletedAt(); + public function getPaymentState(); /** - *

The custom fields.

+ *

Shipment status of the Order.

* - * @return null|CustomFieldsDraft + * @return null|string */ - public function getCustom(); + public function getShipmentState(); /** - *

If not given the mode None will be assigned by default.

+ *

Current status of the Order.

* * @return null|string */ - public function getInventoryMode(); + public function getOrderState(); /** - *

If not given the tax rounding mode HalfEven will be assigned by default.

+ *

State of the Order in a custom workflow.

* - * @return null|string + * @return null|StateReference */ - public function getTaxRoundingMode(); + public function getState(); /** - *

Contains addresses for orders with multiple shipping addresses.

+ *

Include a value to associate a country with the Order.

* - * @return null|BaseAddressCollection + * @return null|string */ - public function getItemShippingAddresses(); + public function getCountry(); /** - *

The Business Unit the Cart belongs to.

+ *

Indicates the origin of the Order.

* - * @return null|BusinessUnitResourceIdentifier + * @return null|string */ - public function getBusinessUnit(); + public function getOrigin(); /** + *

User-defined date and time for the Order. This value does not influence the createdAt or lastModifiedAt values of the Order created by the Order Import.

+ * - * @return null|StoreResourceIdentifier + * @return null|DateTimeImmutable */ - public function getStore(); + public function getCompletedAt(); /** - *

The default origin is Customer.

+ *

Custom Fields for the Order.

* - * @return null|string + * @return null|CustomFieldsDraft */ - public function getOrigin(); + public function getCustom(); /** * @param ?string $orderNumber */ public function setOrderNumber(?string $orderNumber): void; + /** + * @param ?string $purchaseOrderNumber + */ + public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void; + /** * @param ?string $customerId */ @@ -258,6 +294,21 @@ public function setCustomerId(?string $customerId): void; */ public function setCustomerEmail(?string $customerEmail): void; + /** + * @param ?CustomerGroupResourceIdentifier $customerGroup + */ + public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup): void; + + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + */ + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void; + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void; + /** * @param ?LineItemImportDraftCollection $lineItems */ @@ -279,44 +330,34 @@ public function setTotalPrice(?Money $totalPrice): void; public function setTaxedPrice(?TaxedPriceDraft $taxedPrice): void; /** - * @param ?BaseAddress $shippingAddress - */ - public function setShippingAddress(?BaseAddress $shippingAddress): void; - - /** - * @param ?BaseAddress $billingAddress - */ - public function setBillingAddress(?BaseAddress $billingAddress): void; - - /** - * @param ?CustomerGroupResourceIdentifier $customerGroup + * @param ?string $taxRoundingMode */ - public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup): void; + public function setTaxRoundingMode(?string $taxRoundingMode): void; /** - * @param ?string $country + * @param ?string $taxCalculationMode */ - public function setCountry(?string $country): void; + public function setTaxCalculationMode(?string $taxCalculationMode): void; /** - * @param ?string $orderState + * @param ?string $inventoryMode */ - public function setOrderState(?string $orderState): void; + public function setInventoryMode(?string $inventoryMode): void; /** - * @param ?StateReference $state + * @param ?BaseAddress $billingAddress */ - public function setState(?StateReference $state): void; + public function setBillingAddress(?BaseAddress $billingAddress): void; /** - * @param ?string $shipmentState + * @param ?BaseAddress $shippingAddress */ - public function setShipmentState(?string $shipmentState): void; + public function setShippingAddress(?BaseAddress $shippingAddress): void; /** - * @param ?string $paymentState + * @param ?BaseAddressCollection $itemShippingAddresses */ - public function setPaymentState(?string $paymentState): void; + public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void; /** * @param ?ShippingInfoImportDraft $shippingInfo @@ -329,42 +370,42 @@ public function setShippingInfo(?ShippingInfoImportDraft $shippingInfo): void; public function setPaymentInfo(?PaymentInfo $paymentInfo): void; /** - * @param ?DateTimeImmutable $completedAt + * @param ?string $paymentState */ - public function setCompletedAt(?DateTimeImmutable $completedAt): void; + public function setPaymentState(?string $paymentState): void; /** - * @param ?CustomFieldsDraft $custom + * @param ?string $shipmentState */ - public function setCustom(?CustomFieldsDraft $custom): void; + public function setShipmentState(?string $shipmentState): void; /** - * @param ?string $inventoryMode + * @param ?string $orderState */ - public function setInventoryMode(?string $inventoryMode): void; + public function setOrderState(?string $orderState): void; /** - * @param ?string $taxRoundingMode + * @param ?StateReference $state */ - public function setTaxRoundingMode(?string $taxRoundingMode): void; + public function setState(?StateReference $state): void; /** - * @param ?BaseAddressCollection $itemShippingAddresses + * @param ?string $country */ - public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void; + public function setCountry(?string $country): void; /** - * @param ?BusinessUnitResourceIdentifier $businessUnit + * @param ?string $origin */ - public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void; + public function setOrigin(?string $origin): void; /** - * @param ?StoreResourceIdentifier $store + * @param ?DateTimeImmutable $completedAt */ - public function setStore(?StoreResourceIdentifier $store): void; + public function setCompletedAt(?DateTimeImmutable $completedAt): void; /** - * @param ?string $origin + * @param ?CustomFieldsDraft $custom */ - public function setOrigin(?string $origin): void; + public function setCustom(?CustomFieldsDraft $custom): void; } diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php index 9ad95fa59fe..1f0d4bb6db2 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraftBuilder.php @@ -10,7 +10,6 @@ use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifierBuilder; -use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection; use Commercetools\Api\Models\Cart\TaxedPriceDraft; use Commercetools\Api\Models\Cart\TaxedPriceDraftBuilder; use Commercetools\Api\Models\Common\BaseAddress; @@ -45,6 +44,12 @@ final class OrderImportDraftBuilder implements Builder */ private $orderNumber; + /** + + * @var ?string + */ + private $purchaseOrderNumber; + /** * @var ?string @@ -59,75 +64,81 @@ final class OrderImportDraftBuilder implements Builder /** - * @var ?LineItemImportDraftCollection + * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder */ - private $lineItems; + private $customerGroup; /** - * @var ?CustomLineItemImportDraftCollection + * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder */ - private $customLineItems; + private $businessUnit; /** - * @var null|Money|MoneyBuilder + * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder */ - private $totalPrice; + private $store; /** - * @var null|TaxedPriceDraft|TaxedPriceDraftBuilder + * @var ?LineItemImportDraftCollection */ - private $taxedPrice; + private $lineItems; /** - * @var null|BaseAddress|BaseAddressBuilder + * @var ?CustomLineItemImportDraftCollection */ - private $shippingAddress; + private $customLineItems; /** - * @var null|BaseAddress|BaseAddressBuilder + * @var null|Money|MoneyBuilder */ - private $billingAddress; + private $totalPrice; /** - * @var null|CustomerGroupResourceIdentifier|CustomerGroupResourceIdentifierBuilder + * @var null|TaxedPriceDraft|TaxedPriceDraftBuilder */ - private $customerGroup; + private $taxedPrice; /** * @var ?string */ - private $country; + private $taxRoundingMode; /** * @var ?string */ - private $orderState; + private $taxCalculationMode; /** - * @var null|StateReference|StateReferenceBuilder + * @var ?string */ - private $state; + private $inventoryMode; /** - * @var ?string + * @var null|BaseAddress|BaseAddressBuilder */ - private $shipmentState; + private $billingAddress; /** - * @var ?string + * @var null|BaseAddress|BaseAddressBuilder */ - private $paymentState; + private $shippingAddress; + + /** + + * @var ?BaseAddressCollection + */ + private $itemShippingAddresses; /** @@ -143,56 +154,55 @@ final class OrderImportDraftBuilder implements Builder /** - * @var ?DateTimeImmutable + * @var ?string */ - private $completedAt; + private $paymentState; /** - * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder + * @var ?string */ - private $custom; + private $shipmentState; /** * @var ?string */ - private $inventoryMode; + private $orderState; /** - * @var ?string + * @var null|StateReference|StateReferenceBuilder */ - private $taxRoundingMode; + private $state; /** - * @var ?BaseAddressCollection + * @var ?string */ - private $itemShippingAddresses; + private $country; /** - * @var null|BusinessUnitResourceIdentifier|BusinessUnitResourceIdentifierBuilder + * @var ?string */ - private $businessUnit; + private $origin; /** - * @var null|StoreResourceIdentifier|StoreResourceIdentifierBuilder + * @var ?DateTimeImmutable */ - private $store; + private $completedAt; /** - * @var ?string + * @var null|CustomFieldsDraft|CustomFieldsDraftBuilder */ - private $origin; + private $custom; /** - *

String that unique identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique within a project.

+ *

User-defined identifier of the Order. Must be unique across a Project. + * Once set, the value cannot be changed.

* * @return null|string @@ -203,7 +213,18 @@ public function getOrderNumber() } /** - *

If given the customer with that ID must exist in the project.

+ *

User-defined identifier for a purchase Order.

+ * + + * @return null|string + */ + public function getPurchaseOrderNumber() + { + return $this->purchaseOrderNumber; + } + + /** + *

The id of the Customer the Order belongs to.

* * @return null|string @@ -214,7 +235,7 @@ public function getCustomerId() } /** - *

The customer email can be used when no check against existing Customers is desired during order import.

+ *

The Email address of the Customer the Order belongs to. Can be used instead of customerId when no check against existing Customers is required.

* * @return null|string @@ -225,134 +246,156 @@ public function getCustomerEmail() } /** - *

If not given customLineItems must not be empty.

+ *

The Customer Group of the Customer the Order belongs to.

* - * @return null|LineItemImportDraftCollection + * @return null|CustomerGroupResourceIdentifier */ - public function getLineItems() + public function getCustomerGroup() { - return $this->lineItems; + return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup; } /** - *

If not given lineItems must not be empty.

+ *

ResourceIdentifier to the Business Unit the Order should belong to. + * When the customerId of the Order is also set, the Customer must be an Associate of the Business Unit.

* - * @return null|CustomLineItemImportDraftCollection + * @return null|BusinessUnitResourceIdentifier */ - public function getCustomLineItems() + public function getBusinessUnit() { - return $this->customLineItems; + return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit; } /** + *

The Store the Order belongs to. + * Used for filtering.

+ *

If a LineItemImportDraft or a CustomLineItemImportDraft specifies a distributionChannel or a supplyChannel that is not defined for the referenced Store, the Order Import gets rejected. + * The same applies when the provided country is not defined for the referenced Store.

+ * - * @return null|Money + * @return null|StoreResourceIdentifier */ - public function getTotalPrice() + public function getStore() { - return $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice; + return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store; } /** - *

Order Import does not support calculation of taxes. - * When setting the draft the taxedPrice is to be provided.

+ *

Line Items to add to the Order.

+ *

If not specified, customLineItems must not be empty.

* - * @return null|TaxedPriceDraft + * @return null|LineItemImportDraftCollection */ - public function getTaxedPrice() + public function getLineItems() { - return $this->taxedPrice instanceof TaxedPriceDraftBuilder ? $this->taxedPrice->build() : $this->taxedPrice; + return $this->lineItems; } /** + *

Custom Line Items to add to the Cart.

+ *

If not specified, lineItems must not be empty.

+ * - * @return null|BaseAddress + * @return null|CustomLineItemImportDraftCollection */ - public function getShippingAddress() + public function getCustomLineItems() { - return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + return $this->customLineItems; } /** + *

The total Price of the Order. The amount can be negative.

+ * - * @return null|BaseAddress + * @return null|Money */ - public function getBillingAddress() + public function getTotalPrice() { - return $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress; + return $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice; } /** - *

Set when the customer is set and the customer is a member of a customer group. - * Used for product variant price selection.

+ *

Include TaxedPrice information for the Order. If not included, and if you have Tax Rates set for Line Items and Custom Line Items, the Order total will not be recalculated.

* - * @return null|CustomerGroupResourceIdentifier + * @return null|TaxedPriceDraft */ - public function getCustomerGroup() + public function getTaxedPrice() { - return $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup; + return $this->taxedPrice instanceof TaxedPriceDraftBuilder ? $this->taxedPrice->build() : $this->taxedPrice; } /** - *

A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

+ *

Determines how monetary values are rounded when calculating taxes for taxedPrice.

* * @return null|string */ - public function getCountry() + public function getTaxRoundingMode() { - return $this->country; + return $this->taxRoundingMode; } /** - *

Current status of the Order.

+ *

Determines how taxes are calculated for taxedPrice.

* * @return null|string */ - public function getOrderState() + public function getTaxCalculationMode() { - return $this->orderState; + return $this->taxCalculationMode; } /** - *

This reference can point to a state in a custom workflow.

+ *

Determines how stock quantities are tracked for Line Items in the Cart.

* - * @return null|StateReference + * @return null|string */ - public function getState() + public function getInventoryMode() { - return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; + return $this->inventoryMode; } /** - *

Shipment status of the Order.

+ *

Billing address associated with the Order.

* - * @return null|string + * @return null|BaseAddress */ - public function getShipmentState() + public function getBillingAddress() { - return $this->shipmentState; + return $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress; } /** + *

Shipping address associated with the Order.

+ * - * @return null|string + * @return null|BaseAddress */ - public function getPaymentState() + public function getShippingAddress() { - return $this->paymentState; + return $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress; + } + + /** + *

Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

+ * + + * @return null|BaseAddressCollection + */ + public function getItemShippingAddresses() + { + return $this->itemShippingAddresses; } /** - *

Set if the ShippingMethod is set.

+ *

Shipping-related information of the Order.

* * @return null|ShippingInfoImportDraft @@ -374,87 +417,91 @@ public function getPaymentInfo() } /** + *

Payment status of the Order.

+ * - * @return null|DateTimeImmutable + * @return null|string */ - public function getCompletedAt() + public function getPaymentState() { - return $this->completedAt; + return $this->paymentState; } /** - *

The custom fields.

+ *

Shipment status of the Order.

* - * @return null|CustomFieldsDraft + * @return null|string */ - public function getCustom() + public function getShipmentState() { - return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; + return $this->shipmentState; } /** - *

If not given the mode None will be assigned by default.

+ *

Current status of the Order.

* * @return null|string */ - public function getInventoryMode() + public function getOrderState() { - return $this->inventoryMode; + return $this->orderState; } /** - *

If not given the tax rounding mode HalfEven will be assigned by default.

+ *

State of the Order in a custom workflow.

* - * @return null|string + * @return null|StateReference */ - public function getTaxRoundingMode() + public function getState() { - return $this->taxRoundingMode; + return $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state; } /** - *

Contains addresses for orders with multiple shipping addresses.

+ *

Include a value to associate a country with the Order.

* - * @return null|BaseAddressCollection + * @return null|string */ - public function getItemShippingAddresses() + public function getCountry() { - return $this->itemShippingAddresses; + return $this->country; } /** - *

The Business Unit the Cart belongs to.

+ *

Indicates the origin of the Order.

* - * @return null|BusinessUnitResourceIdentifier + * @return null|string */ - public function getBusinessUnit() + public function getOrigin() { - return $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit; + return $this->origin; } /** + *

User-defined date and time for the Order. This value does not influence the createdAt or lastModifiedAt values of the Order created by the Order Import.

+ * - * @return null|StoreResourceIdentifier + * @return null|DateTimeImmutable */ - public function getStore() + public function getCompletedAt() { - return $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store; + return $this->completedAt; } /** - *

The default origin is Customer.

+ *

Custom Fields for the Order.

* - * @return null|string + * @return null|CustomFieldsDraft */ - public function getOrigin() + public function getCustom() { - return $this->origin; + return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } /** @@ -468,6 +515,17 @@ public function withOrderNumber(?string $orderNumber) return $this; } + /** + * @param ?string $purchaseOrderNumber + * @return $this + */ + public function withPurchaseOrderNumber(?string $purchaseOrderNumber) + { + $this->purchaseOrderNumber = $purchaseOrderNumber; + + return $this; + } + /** * @param ?string $customerId * @return $this @@ -491,133 +549,144 @@ public function withCustomerEmail(?string $customerEmail) } /** - * @param ?LineItemImportDraftCollection $lineItems + * @param ?CustomerGroupResourceIdentifier $customerGroup * @return $this */ - public function withLineItems(?LineItemImportDraftCollection $lineItems) + public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup) { - $this->lineItems = $lineItems; + $this->customerGroup = $customerGroup; return $this; } /** - * @param ?CustomLineItemImportDraftCollection $customLineItems + * @param ?BusinessUnitResourceIdentifier $businessUnit * @return $this */ - public function withCustomLineItems(?CustomLineItemImportDraftCollection $customLineItems) + public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit) { - $this->customLineItems = $customLineItems; + $this->businessUnit = $businessUnit; return $this; } /** - * @param ?Money $totalPrice + * @param ?StoreResourceIdentifier $store * @return $this */ - public function withTotalPrice(?Money $totalPrice) + public function withStore(?StoreResourceIdentifier $store) { - $this->totalPrice = $totalPrice; + $this->store = $store; return $this; } /** - * @param ?TaxedPriceDraft $taxedPrice + * @param ?LineItemImportDraftCollection $lineItems * @return $this */ - public function withTaxedPrice(?TaxedPriceDraft $taxedPrice) + public function withLineItems(?LineItemImportDraftCollection $lineItems) { - $this->taxedPrice = $taxedPrice; + $this->lineItems = $lineItems; return $this; } /** - * @param ?BaseAddress $shippingAddress + * @param ?CustomLineItemImportDraftCollection $customLineItems * @return $this */ - public function withShippingAddress(?BaseAddress $shippingAddress) + public function withCustomLineItems(?CustomLineItemImportDraftCollection $customLineItems) { - $this->shippingAddress = $shippingAddress; + $this->customLineItems = $customLineItems; return $this; } /** - * @param ?BaseAddress $billingAddress + * @param ?Money $totalPrice * @return $this */ - public function withBillingAddress(?BaseAddress $billingAddress) + public function withTotalPrice(?Money $totalPrice) { - $this->billingAddress = $billingAddress; + $this->totalPrice = $totalPrice; return $this; } /** - * @param ?CustomerGroupResourceIdentifier $customerGroup + * @param ?TaxedPriceDraft $taxedPrice * @return $this */ - public function withCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup) + public function withTaxedPrice(?TaxedPriceDraft $taxedPrice) { - $this->customerGroup = $customerGroup; + $this->taxedPrice = $taxedPrice; return $this; } /** - * @param ?string $country + * @param ?string $taxRoundingMode * @return $this */ - public function withCountry(?string $country) + public function withTaxRoundingMode(?string $taxRoundingMode) { - $this->country = $country; + $this->taxRoundingMode = $taxRoundingMode; return $this; } /** - * @param ?string $orderState + * @param ?string $taxCalculationMode * @return $this */ - public function withOrderState(?string $orderState) + public function withTaxCalculationMode(?string $taxCalculationMode) { - $this->orderState = $orderState; + $this->taxCalculationMode = $taxCalculationMode; return $this; } /** - * @param ?StateReference $state + * @param ?string $inventoryMode * @return $this */ - public function withState(?StateReference $state) + public function withInventoryMode(?string $inventoryMode) { - $this->state = $state; + $this->inventoryMode = $inventoryMode; return $this; } /** - * @param ?string $shipmentState + * @param ?BaseAddress $billingAddress * @return $this */ - public function withShipmentState(?string $shipmentState) + public function withBillingAddress(?BaseAddress $billingAddress) { - $this->shipmentState = $shipmentState; + $this->billingAddress = $billingAddress; return $this; } /** - * @param ?string $paymentState + * @param ?BaseAddress $shippingAddress * @return $this */ - public function withPaymentState(?string $paymentState) + public function withShippingAddress(?BaseAddress $shippingAddress) { - $this->paymentState = $paymentState; + $this->shippingAddress = $shippingAddress; + + return $this; + } + + /** + * @param ?BaseAddressCollection $itemShippingAddresses + * @return $this + */ + public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses) + { + $this->itemShippingAddresses = $itemShippingAddresses; return $this; } @@ -645,210 +714,210 @@ public function withPaymentInfo(?PaymentInfo $paymentInfo) } /** - * @param ?DateTimeImmutable $completedAt + * @param ?string $paymentState * @return $this */ - public function withCompletedAt(?DateTimeImmutable $completedAt) + public function withPaymentState(?string $paymentState) { - $this->completedAt = $completedAt; + $this->paymentState = $paymentState; return $this; } /** - * @param ?CustomFieldsDraft $custom + * @param ?string $shipmentState * @return $this */ - public function withCustom(?CustomFieldsDraft $custom) + public function withShipmentState(?string $shipmentState) { - $this->custom = $custom; + $this->shipmentState = $shipmentState; return $this; } /** - * @param ?string $inventoryMode + * @param ?string $orderState * @return $this */ - public function withInventoryMode(?string $inventoryMode) + public function withOrderState(?string $orderState) { - $this->inventoryMode = $inventoryMode; + $this->orderState = $orderState; return $this; } /** - * @param ?string $taxRoundingMode + * @param ?StateReference $state * @return $this */ - public function withTaxRoundingMode(?string $taxRoundingMode) + public function withState(?StateReference $state) { - $this->taxRoundingMode = $taxRoundingMode; + $this->state = $state; return $this; } /** - * @param ?BaseAddressCollection $itemShippingAddresses + * @param ?string $country * @return $this */ - public function withItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses) + public function withCountry(?string $country) { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->country = $country; return $this; } /** - * @param ?BusinessUnitResourceIdentifier $businessUnit + * @param ?string $origin * @return $this */ - public function withBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit) + public function withOrigin(?string $origin) { - $this->businessUnit = $businessUnit; + $this->origin = $origin; return $this; } /** - * @param ?StoreResourceIdentifier $store + * @param ?DateTimeImmutable $completedAt * @return $this */ - public function withStore(?StoreResourceIdentifier $store) + public function withCompletedAt(?DateTimeImmutable $completedAt) { - $this->store = $store; + $this->completedAt = $completedAt; return $this; } /** - * @param ?string $origin + * @param ?CustomFieldsDraft $custom * @return $this */ - public function withOrigin(?string $origin) + public function withCustom(?CustomFieldsDraft $custom) { - $this->origin = $origin; + $this->custom = $custom; return $this; } /** - * @deprecated use withTotalPrice() instead + * @deprecated use withCustomerGroup() instead * @return $this */ - public function withTotalPriceBuilder(?MoneyBuilder $totalPrice) + public function withCustomerGroupBuilder(?CustomerGroupResourceIdentifierBuilder $customerGroup) { - $this->totalPrice = $totalPrice; + $this->customerGroup = $customerGroup; return $this; } /** - * @deprecated use withTaxedPrice() instead + * @deprecated use withBusinessUnit() instead * @return $this */ - public function withTaxedPriceBuilder(?TaxedPriceDraftBuilder $taxedPrice) + public function withBusinessUnitBuilder(?BusinessUnitResourceIdentifierBuilder $businessUnit) { - $this->taxedPrice = $taxedPrice; + $this->businessUnit = $businessUnit; return $this; } /** - * @deprecated use withShippingAddress() instead + * @deprecated use withStore() instead * @return $this */ - public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress) + public function withStoreBuilder(?StoreResourceIdentifierBuilder $store) { - $this->shippingAddress = $shippingAddress; + $this->store = $store; return $this; } /** - * @deprecated use withBillingAddress() instead + * @deprecated use withTotalPrice() instead * @return $this */ - public function withBillingAddressBuilder(?BaseAddressBuilder $billingAddress) + public function withTotalPriceBuilder(?MoneyBuilder $totalPrice) { - $this->billingAddress = $billingAddress; + $this->totalPrice = $totalPrice; return $this; } /** - * @deprecated use withCustomerGroup() instead + * @deprecated use withTaxedPrice() instead * @return $this */ - public function withCustomerGroupBuilder(?CustomerGroupResourceIdentifierBuilder $customerGroup) + public function withTaxedPriceBuilder(?TaxedPriceDraftBuilder $taxedPrice) { - $this->customerGroup = $customerGroup; + $this->taxedPrice = $taxedPrice; return $this; } /** - * @deprecated use withState() instead + * @deprecated use withBillingAddress() instead * @return $this */ - public function withStateBuilder(?StateReferenceBuilder $state) + public function withBillingAddressBuilder(?BaseAddressBuilder $billingAddress) { - $this->state = $state; + $this->billingAddress = $billingAddress; return $this; } /** - * @deprecated use withShippingInfo() instead + * @deprecated use withShippingAddress() instead * @return $this */ - public function withShippingInfoBuilder(?ShippingInfoImportDraftBuilder $shippingInfo) + public function withShippingAddressBuilder(?BaseAddressBuilder $shippingAddress) { - $this->shippingInfo = $shippingInfo; + $this->shippingAddress = $shippingAddress; return $this; } /** - * @deprecated use withPaymentInfo() instead + * @deprecated use withShippingInfo() instead * @return $this */ - public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo) + public function withShippingInfoBuilder(?ShippingInfoImportDraftBuilder $shippingInfo) { - $this->paymentInfo = $paymentInfo; + $this->shippingInfo = $shippingInfo; return $this; } /** - * @deprecated use withCustom() instead + * @deprecated use withPaymentInfo() instead * @return $this */ - public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) + public function withPaymentInfoBuilder(?PaymentInfoBuilder $paymentInfo) { - $this->custom = $custom; + $this->paymentInfo = $paymentInfo; return $this; } /** - * @deprecated use withBusinessUnit() instead + * @deprecated use withState() instead * @return $this */ - public function withBusinessUnitBuilder(?BusinessUnitResourceIdentifierBuilder $businessUnit) + public function withStateBuilder(?StateReferenceBuilder $state) { - $this->businessUnit = $businessUnit; + $this->state = $state; return $this; } /** - * @deprecated use withStore() instead + * @deprecated use withCustom() instead * @return $this */ - public function withStoreBuilder(?StoreResourceIdentifierBuilder $store) + public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) { - $this->store = $store; + $this->custom = $custom; return $this; } @@ -857,30 +926,32 @@ public function build(): OrderImportDraft { return new OrderImportDraftModel( $this->orderNumber, + $this->purchaseOrderNumber, $this->customerId, $this->customerEmail, + $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup, + $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit, + $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store, $this->lineItems, $this->customLineItems, $this->totalPrice instanceof MoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->taxedPrice instanceof TaxedPriceDraftBuilder ? $this->taxedPrice->build() : $this->taxedPrice, - $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->taxRoundingMode, + $this->taxCalculationMode, + $this->inventoryMode, $this->billingAddress instanceof BaseAddressBuilder ? $this->billingAddress->build() : $this->billingAddress, - $this->customerGroup instanceof CustomerGroupResourceIdentifierBuilder ? $this->customerGroup->build() : $this->customerGroup, - $this->country, - $this->orderState, - $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, - $this->shipmentState, - $this->paymentState, + $this->shippingAddress instanceof BaseAddressBuilder ? $this->shippingAddress->build() : $this->shippingAddress, + $this->itemShippingAddresses, $this->shippingInfo instanceof ShippingInfoImportDraftBuilder ? $this->shippingInfo->build() : $this->shippingInfo, $this->paymentInfo instanceof PaymentInfoBuilder ? $this->paymentInfo->build() : $this->paymentInfo, + $this->paymentState, + $this->shipmentState, + $this->orderState, + $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, + $this->country, + $this->origin, $this->completedAt, - $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, - $this->inventoryMode, - $this->taxRoundingMode, - $this->itemShippingAddresses, - $this->businessUnit instanceof BusinessUnitResourceIdentifierBuilder ? $this->businessUnit->build() : $this->businessUnit, - $this->store instanceof StoreResourceIdentifierBuilder ? $this->store->build() : $this->store, - $this->origin + $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom ); } diff --git a/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php b/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php index 663cf832a9b..c60b86ab4cf 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportDraftModel.php @@ -10,7 +10,6 @@ use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifier; use Commercetools\Api\Models\BusinessUnit\BusinessUnitResourceIdentifierModel; -use Commercetools\Api\Models\Cart\CustomLineItemImportDraftCollection; use Commercetools\Api\Models\Cart\TaxedPriceDraft; use Commercetools\Api\Models\Cart\TaxedPriceDraftModel; use Commercetools\Api\Models\Common\BaseAddress; @@ -44,6 +43,12 @@ final class OrderImportDraftModel extends JsonObjectModel implements OrderImport */ protected $orderNumber; + /** + * + * @var ?string + */ + protected $purchaseOrderNumber; + /** * * @var ?string @@ -58,75 +63,81 @@ final class OrderImportDraftModel extends JsonObjectModel implements OrderImport /** * - * @var ?LineItemImportDraftCollection + * @var ?CustomerGroupResourceIdentifier */ - protected $lineItems; + protected $customerGroup; /** * - * @var ?CustomLineItemImportDraftCollection + * @var ?BusinessUnitResourceIdentifier */ - protected $customLineItems; + protected $businessUnit; /** * - * @var ?Money + * @var ?StoreResourceIdentifier */ - protected $totalPrice; + protected $store; /** * - * @var ?TaxedPriceDraft + * @var ?LineItemImportDraftCollection */ - protected $taxedPrice; + protected $lineItems; /** * - * @var ?BaseAddress + * @var ?CustomLineItemImportDraftCollection */ - protected $shippingAddress; + protected $customLineItems; /** * - * @var ?BaseAddress + * @var ?Money */ - protected $billingAddress; + protected $totalPrice; /** * - * @var ?CustomerGroupResourceIdentifier + * @var ?TaxedPriceDraft */ - protected $customerGroup; + protected $taxedPrice; /** * * @var ?string */ - protected $country; + protected $taxRoundingMode; /** * * @var ?string */ - protected $orderState; + protected $taxCalculationMode; /** * - * @var ?StateReference + * @var ?string */ - protected $state; + protected $inventoryMode; /** * - * @var ?string + * @var ?BaseAddress */ - protected $shipmentState; + protected $billingAddress; /** * - * @var ?string + * @var ?BaseAddress */ - protected $paymentState; + protected $shippingAddress; + + /** + * + * @var ?BaseAddressCollection + */ + protected $itemShippingAddresses; /** * @@ -142,51 +153,51 @@ final class OrderImportDraftModel extends JsonObjectModel implements OrderImport /** * - * @var ?DateTimeImmutable + * @var ?string */ - protected $completedAt; + protected $paymentState; /** * - * @var ?CustomFieldsDraft + * @var ?string */ - protected $custom; + protected $shipmentState; /** * * @var ?string */ - protected $inventoryMode; + protected $orderState; /** * - * @var ?string + * @var ?StateReference */ - protected $taxRoundingMode; + protected $state; /** * - * @var ?BaseAddressCollection + * @var ?string */ - protected $itemShippingAddresses; + protected $country; /** * - * @var ?BusinessUnitResourceIdentifier + * @var ?string */ - protected $businessUnit; + protected $origin; /** * - * @var ?StoreResourceIdentifier + * @var ?DateTimeImmutable */ - protected $store; + protected $completedAt; /** * - * @var ?string + * @var ?CustomFieldsDraft */ - protected $origin; + protected $custom; /** @@ -194,62 +205,65 @@ final class OrderImportDraftModel extends JsonObjectModel implements OrderImport */ public function __construct( ?string $orderNumber = null, + ?string $purchaseOrderNumber = null, ?string $customerId = null, ?string $customerEmail = null, + ?CustomerGroupResourceIdentifier $customerGroup = null, + ?BusinessUnitResourceIdentifier $businessUnit = null, + ?StoreResourceIdentifier $store = null, ?LineItemImportDraftCollection $lineItems = null, ?CustomLineItemImportDraftCollection $customLineItems = null, ?Money $totalPrice = null, ?TaxedPriceDraft $taxedPrice = null, - ?BaseAddress $shippingAddress = null, + ?string $taxRoundingMode = null, + ?string $taxCalculationMode = null, + ?string $inventoryMode = null, ?BaseAddress $billingAddress = null, - ?CustomerGroupResourceIdentifier $customerGroup = null, - ?string $country = null, - ?string $orderState = null, - ?StateReference $state = null, - ?string $shipmentState = null, - ?string $paymentState = null, + ?BaseAddress $shippingAddress = null, + ?BaseAddressCollection $itemShippingAddresses = null, ?ShippingInfoImportDraft $shippingInfo = null, ?PaymentInfo $paymentInfo = null, + ?string $paymentState = null, + ?string $shipmentState = null, + ?string $orderState = null, + ?StateReference $state = null, + ?string $country = null, + ?string $origin = null, ?DateTimeImmutable $completedAt = null, - ?CustomFieldsDraft $custom = null, - ?string $inventoryMode = null, - ?string $taxRoundingMode = null, - ?BaseAddressCollection $itemShippingAddresses = null, - ?BusinessUnitResourceIdentifier $businessUnit = null, - ?StoreResourceIdentifier $store = null, - ?string $origin = null + ?CustomFieldsDraft $custom = null ) { $this->orderNumber = $orderNumber; + $this->purchaseOrderNumber = $purchaseOrderNumber; $this->customerId = $customerId; $this->customerEmail = $customerEmail; + $this->customerGroup = $customerGroup; + $this->businessUnit = $businessUnit; + $this->store = $store; $this->lineItems = $lineItems; $this->customLineItems = $customLineItems; $this->totalPrice = $totalPrice; $this->taxedPrice = $taxedPrice; - $this->shippingAddress = $shippingAddress; + $this->taxRoundingMode = $taxRoundingMode; + $this->taxCalculationMode = $taxCalculationMode; + $this->inventoryMode = $inventoryMode; $this->billingAddress = $billingAddress; - $this->customerGroup = $customerGroup; - $this->country = $country; - $this->orderState = $orderState; - $this->state = $state; - $this->shipmentState = $shipmentState; - $this->paymentState = $paymentState; + $this->shippingAddress = $shippingAddress; + $this->itemShippingAddresses = $itemShippingAddresses; $this->shippingInfo = $shippingInfo; $this->paymentInfo = $paymentInfo; + $this->paymentState = $paymentState; + $this->shipmentState = $shipmentState; + $this->orderState = $orderState; + $this->state = $state; + $this->country = $country; + $this->origin = $origin; $this->completedAt = $completedAt; $this->custom = $custom; - $this->inventoryMode = $inventoryMode; - $this->taxRoundingMode = $taxRoundingMode; - $this->itemShippingAddresses = $itemShippingAddresses; - $this->businessUnit = $businessUnit; - $this->store = $store; - $this->origin = $origin; } /** - *

String that unique identifies an order. - * It can be used to create more human-readable (in contrast to ID) identifier for the order. - * It should be unique within a project.

+ *

User-defined identifier of the Order. Must be unique across a Project. + * Once set, the value cannot be changed.

* * * @return null|string @@ -269,7 +283,27 @@ public function getOrderNumber() } /** - *

If given the customer with that ID must exist in the project.

+ *

User-defined identifier for a purchase Order.

+ * + * + * @return null|string + */ + public function getPurchaseOrderNumber() + { + if (is_null($this->purchaseOrderNumber)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PURCHASE_ORDER_NUMBER); + if (is_null($data)) { + return null; + } + $this->purchaseOrderNumber = (string) $data; + } + + return $this->purchaseOrderNumber; + } + + /** + *

The id of the Customer the Order belongs to.

* * * @return null|string @@ -289,7 +323,7 @@ public function getCustomerId() } /** - *

The customer email can be used when no check against existing Customers is desired during order import.

+ *

The Email address of the Customer the Order belongs to. Can be used instead of customerId when no check against existing Customers is required.

* * * @return null|string @@ -309,7 +343,75 @@ public function getCustomerEmail() } /** - *

If not given customLineItems must not be empty.

+ *

The Customer Group of the Customer the Order belongs to.

+ * + * + * @return null|CustomerGroupResourceIdentifier + */ + public function getCustomerGroup() + { + if (is_null($this->customerGroup)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER_GROUP); + if (is_null($data)) { + return null; + } + + $this->customerGroup = CustomerGroupResourceIdentifierModel::of($data); + } + + return $this->customerGroup; + } + + /** + *

ResourceIdentifier to the Business Unit the Order should belong to. + * When the customerId of the Order is also set, the Customer must be an Associate of the Business Unit.

+ * + * + * @return null|BusinessUnitResourceIdentifier + */ + public function getBusinessUnit() + { + if (is_null($this->businessUnit)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($data)) { + return null; + } + + $this->businessUnit = BusinessUnitResourceIdentifierModel::of($data); + } + + return $this->businessUnit; + } + + /** + *

The Store the Order belongs to. + * Used for filtering.

+ *

If a LineItemImportDraft or a CustomLineItemImportDraft specifies a distributionChannel or a supplyChannel that is not defined for the referenced Store, the Order Import gets rejected. + * The same applies when the provided country is not defined for the referenced Store.

+ * + * + * @return null|StoreResourceIdentifier + */ + public function getStore() + { + if (is_null($this->store)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STORE); + if (is_null($data)) { + return null; + } + + $this->store = StoreResourceIdentifierModel::of($data); + } + + return $this->store; + } + + /** + *

Line Items to add to the Order.

+ *

If not specified, customLineItems must not be empty.

* * * @return null|LineItemImportDraftCollection @@ -329,7 +431,8 @@ public function getLineItems() } /** - *

If not given lineItems must not be empty.

+ *

Custom Line Items to add to the Cart.

+ *

If not specified, lineItems must not be empty.

* * * @return null|CustomLineItemImportDraftCollection @@ -349,6 +452,8 @@ public function getCustomLineItems() } /** + *

The total Price of the Order. The amount can be negative.

+ * * * @return null|Money */ @@ -368,8 +473,7 @@ public function getTotalPrice() } /** - *

Order Import does not support calculation of taxes. - * When setting the draft the taxedPrice is to be provided.

+ *

Include TaxedPrice information for the Order. If not included, and if you have Tax Rates set for Line Items and Custom Line Items, the Order total will not be recalculated.

* * * @return null|TaxedPriceDraft @@ -390,167 +494,129 @@ public function getTaxedPrice() } /** + *

Determines how monetary values are rounded when calculating taxes for taxedPrice.

* - * @return null|BaseAddress + * + * @return null|string */ - public function getShippingAddress() + public function getTaxRoundingMode() { - if (is_null($this->shippingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); + if (is_null($this->taxRoundingMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE); if (is_null($data)) { return null; } - - $this->shippingAddress = BaseAddressModel::of($data); + $this->taxRoundingMode = (string) $data; } - return $this->shippingAddress; + return $this->taxRoundingMode; } /** + *

Determines how taxes are calculated for taxedPrice.

* - * @return null|BaseAddress + * + * @return null|string */ - public function getBillingAddress() + public function getTaxCalculationMode() { - if (is_null($this->billingAddress)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_BILLING_ADDRESS); + if (is_null($this->taxCalculationMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TAX_CALCULATION_MODE); if (is_null($data)) { return null; } - - $this->billingAddress = BaseAddressModel::of($data); + $this->taxCalculationMode = (string) $data; } - return $this->billingAddress; + return $this->taxCalculationMode; } /** - *

Set when the customer is set and the customer is a member of a customer group. - * Used for product variant price selection.

+ *

Determines how stock quantities are tracked for Line Items in the Cart.

* * - * @return null|CustomerGroupResourceIdentifier + * @return null|string */ - public function getCustomerGroup() + public function getInventoryMode() { - if (is_null($this->customerGroup)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOMER_GROUP); + if (is_null($this->inventoryMode)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_INVENTORY_MODE); if (is_null($data)) { return null; } - - $this->customerGroup = CustomerGroupResourceIdentifierModel::of($data); + $this->inventoryMode = (string) $data; } - return $this->customerGroup; + return $this->inventoryMode; } /** - *

A two-digit country code as per ISO 3166-1 alpha-2. - * Used for product variant price selection.

+ *

Billing address associated with the Order.

* * - * @return null|string + * @return null|BaseAddress */ - public function getCountry() + public function getBillingAddress() { - if (is_null($this->country)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_COUNTRY); + if (is_null($this->billingAddress)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_BILLING_ADDRESS); if (is_null($data)) { return null; } - $this->country = (string) $data; - } - return $this->country; - } - - /** - *

Current status of the Order.

- * - * - * @return null|string - */ - public function getOrderState() - { - if (is_null($this->orderState)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ORDER_STATE); - if (is_null($data)) { - return null; - } - $this->orderState = (string) $data; + $this->billingAddress = BaseAddressModel::of($data); } - return $this->orderState; + return $this->billingAddress; } /** - *

This reference can point to a state in a custom workflow.

+ *

Shipping address associated with the Order.

* * - * @return null|StateReference + * @return null|BaseAddress */ - public function getState() + public function getShippingAddress() { - if (is_null($this->state)) { + if (is_null($this->shippingAddress)) { /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_STATE); + $data = $this->raw(self::FIELD_SHIPPING_ADDRESS); if (is_null($data)) { return null; } - $this->state = StateReferenceModel::of($data); + $this->shippingAddress = BaseAddressModel::of($data); } - return $this->state; + return $this->shippingAddress; } /** - *

Shipment status of the Order.

+ *

Addresses for Orders with multiple shipping addresses. Addresses must include a value for key.

* * - * @return null|string - */ - public function getShipmentState() - { - if (is_null($this->shipmentState)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SHIPMENT_STATE); - if (is_null($data)) { - return null; - } - $this->shipmentState = (string) $data; - } - - return $this->shipmentState; - } - - /** - * - * @return null|string + * @return null|BaseAddressCollection */ - public function getPaymentState() + public function getItemShippingAddresses() { - if (is_null($this->paymentState)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_PAYMENT_STATE); + if (is_null($this->itemShippingAddresses)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); if (is_null($data)) { return null; } - $this->paymentState = (string) $data; + $this->itemShippingAddresses = BaseAddressCollection::fromArray($data); } - return $this->paymentState; + return $this->itemShippingAddresses; } /** - *

Set if the ShippingMethod is set.

+ *

Shipping-related information of the Order.

* * * @return null|ShippingInfoImportDraft @@ -592,166 +658,169 @@ public function getPaymentInfo() } /** + *

Payment status of the Order.

* - * @return null|DateTimeImmutable + * + * @return null|string */ - public function getCompletedAt() + public function getPaymentState() { - if (is_null($this->completedAt)) { + if (is_null($this->paymentState)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_COMPLETED_AT); + $data = $this->raw(self::FIELD_PAYMENT_STATE); if (is_null($data)) { return null; } - $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); - if (false === $data) { - return null; - } - $this->completedAt = $data; + $this->paymentState = (string) $data; } - return $this->completedAt; + return $this->paymentState; } /** - *

The custom fields.

+ *

Shipment status of the Order.

* * - * @return null|CustomFieldsDraft + * @return null|string */ - public function getCustom() + public function getShipmentState() { - if (is_null($this->custom)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOM); + if (is_null($this->shipmentState)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPMENT_STATE); if (is_null($data)) { return null; } - - $this->custom = CustomFieldsDraftModel::of($data); + $this->shipmentState = (string) $data; } - return $this->custom; + return $this->shipmentState; } /** - *

If not given the mode None will be assigned by default.

+ *

Current status of the Order.

* * * @return null|string */ - public function getInventoryMode() + public function getOrderState() { - if (is_null($this->inventoryMode)) { + if (is_null($this->orderState)) { /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_INVENTORY_MODE); + $data = $this->raw(self::FIELD_ORDER_STATE); if (is_null($data)) { return null; } - $this->inventoryMode = (string) $data; + $this->orderState = (string) $data; } - return $this->inventoryMode; + return $this->orderState; } /** - *

If not given the tax rounding mode HalfEven will be assigned by default.

+ *

State of the Order in a custom workflow.

* * - * @return null|string + * @return null|StateReference */ - public function getTaxRoundingMode() + public function getState() { - if (is_null($this->taxRoundingMode)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TAX_ROUNDING_MODE); + if (is_null($this->state)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STATE); if (is_null($data)) { return null; } - $this->taxRoundingMode = (string) $data; + + $this->state = StateReferenceModel::of($data); } - return $this->taxRoundingMode; + return $this->state; } /** - *

Contains addresses for orders with multiple shipping addresses.

+ *

Include a value to associate a country with the Order.

* * - * @return null|BaseAddressCollection + * @return null|string */ - public function getItemShippingAddresses() + public function getCountry() { - if (is_null($this->itemShippingAddresses)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_ITEM_SHIPPING_ADDRESSES); + if (is_null($this->country)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_COUNTRY); if (is_null($data)) { return null; } - $this->itemShippingAddresses = BaseAddressCollection::fromArray($data); + $this->country = (string) $data; } - return $this->itemShippingAddresses; + return $this->country; } /** - *

The Business Unit the Cart belongs to.

+ *

Indicates the origin of the Order.

* * - * @return null|BusinessUnitResourceIdentifier + * @return null|string */ - public function getBusinessUnit() + public function getOrigin() { - if (is_null($this->businessUnit)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_BUSINESS_UNIT); + if (is_null($this->origin)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ORIGIN); if (is_null($data)) { return null; } - - $this->businessUnit = BusinessUnitResourceIdentifierModel::of($data); + $this->origin = (string) $data; } - return $this->businessUnit; + return $this->origin; } /** + *

User-defined date and time for the Order. This value does not influence the createdAt or lastModifiedAt values of the Order created by the Order Import.

* - * @return null|StoreResourceIdentifier + * + * @return null|DateTimeImmutable */ - public function getStore() + public function getCompletedAt() { - if (is_null($this->store)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_STORE); + if (is_null($this->completedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_COMPLETED_AT); if (is_null($data)) { return null; } - - $this->store = StoreResourceIdentifierModel::of($data); + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->completedAt = $data; } - return $this->store; + return $this->completedAt; } /** - *

The default origin is Customer.

+ *

Custom Fields for the Order.

* * - * @return null|string + * @return null|CustomFieldsDraft */ - public function getOrigin() + public function getCustom() { - if (is_null($this->origin)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_ORIGIN); + if (is_null($this->custom)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM); if (is_null($data)) { return null; } - $this->origin = (string) $data; + + $this->custom = CustomFieldsDraftModel::of($data); } - return $this->origin; + return $this->custom; } @@ -763,6 +832,14 @@ public function setOrderNumber(?string $orderNumber): void $this->orderNumber = $orderNumber; } + /** + * @param ?string $purchaseOrderNumber + */ + public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void + { + $this->purchaseOrderNumber = $purchaseOrderNumber; + } + /** * @param ?string $customerId */ @@ -779,6 +856,30 @@ public function setCustomerEmail(?string $customerEmail): void $this->customerEmail = $customerEmail; } + /** + * @param ?CustomerGroupResourceIdentifier $customerGroup + */ + public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup): void + { + $this->customerGroup = $customerGroup; + } + + /** + * @param ?BusinessUnitResourceIdentifier $businessUnit + */ + public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void + { + $this->businessUnit = $businessUnit; + } + + /** + * @param ?StoreResourceIdentifier $store + */ + public function setStore(?StoreResourceIdentifier $store): void + { + $this->store = $store; + } + /** * @param ?LineItemImportDraftCollection $lineItems */ @@ -812,67 +913,51 @@ public function setTaxedPrice(?TaxedPriceDraft $taxedPrice): void } /** - * @param ?BaseAddress $shippingAddress - */ - public function setShippingAddress(?BaseAddress $shippingAddress): void - { - $this->shippingAddress = $shippingAddress; - } - - /** - * @param ?BaseAddress $billingAddress - */ - public function setBillingAddress(?BaseAddress $billingAddress): void - { - $this->billingAddress = $billingAddress; - } - - /** - * @param ?CustomerGroupResourceIdentifier $customerGroup + * @param ?string $taxRoundingMode */ - public function setCustomerGroup(?CustomerGroupResourceIdentifier $customerGroup): void + public function setTaxRoundingMode(?string $taxRoundingMode): void { - $this->customerGroup = $customerGroup; + $this->taxRoundingMode = $taxRoundingMode; } /** - * @param ?string $country + * @param ?string $taxCalculationMode */ - public function setCountry(?string $country): void + public function setTaxCalculationMode(?string $taxCalculationMode): void { - $this->country = $country; + $this->taxCalculationMode = $taxCalculationMode; } /** - * @param ?string $orderState + * @param ?string $inventoryMode */ - public function setOrderState(?string $orderState): void + public function setInventoryMode(?string $inventoryMode): void { - $this->orderState = $orderState; + $this->inventoryMode = $inventoryMode; } /** - * @param ?StateReference $state + * @param ?BaseAddress $billingAddress */ - public function setState(?StateReference $state): void + public function setBillingAddress(?BaseAddress $billingAddress): void { - $this->state = $state; + $this->billingAddress = $billingAddress; } /** - * @param ?string $shipmentState + * @param ?BaseAddress $shippingAddress */ - public function setShipmentState(?string $shipmentState): void + public function setShippingAddress(?BaseAddress $shippingAddress): void { - $this->shipmentState = $shipmentState; + $this->shippingAddress = $shippingAddress; } /** - * @param ?string $paymentState + * @param ?BaseAddressCollection $itemShippingAddresses */ - public function setPaymentState(?string $paymentState): void + public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void { - $this->paymentState = $paymentState; + $this->itemShippingAddresses = $itemShippingAddresses; } /** @@ -892,67 +977,67 @@ public function setPaymentInfo(?PaymentInfo $paymentInfo): void } /** - * @param ?DateTimeImmutable $completedAt + * @param ?string $paymentState */ - public function setCompletedAt(?DateTimeImmutable $completedAt): void + public function setPaymentState(?string $paymentState): void { - $this->completedAt = $completedAt; + $this->paymentState = $paymentState; } /** - * @param ?CustomFieldsDraft $custom + * @param ?string $shipmentState */ - public function setCustom(?CustomFieldsDraft $custom): void + public function setShipmentState(?string $shipmentState): void { - $this->custom = $custom; + $this->shipmentState = $shipmentState; } /** - * @param ?string $inventoryMode + * @param ?string $orderState */ - public function setInventoryMode(?string $inventoryMode): void + public function setOrderState(?string $orderState): void { - $this->inventoryMode = $inventoryMode; + $this->orderState = $orderState; } /** - * @param ?string $taxRoundingMode + * @param ?StateReference $state */ - public function setTaxRoundingMode(?string $taxRoundingMode): void + public function setState(?StateReference $state): void { - $this->taxRoundingMode = $taxRoundingMode; + $this->state = $state; } /** - * @param ?BaseAddressCollection $itemShippingAddresses + * @param ?string $country */ - public function setItemShippingAddresses(?BaseAddressCollection $itemShippingAddresses): void + public function setCountry(?string $country): void { - $this->itemShippingAddresses = $itemShippingAddresses; + $this->country = $country; } /** - * @param ?BusinessUnitResourceIdentifier $businessUnit + * @param ?string $origin */ - public function setBusinessUnit(?BusinessUnitResourceIdentifier $businessUnit): void + public function setOrigin(?string $origin): void { - $this->businessUnit = $businessUnit; + $this->origin = $origin; } /** - * @param ?StoreResourceIdentifier $store + * @param ?DateTimeImmutable $completedAt */ - public function setStore(?StoreResourceIdentifier $store): void + public function setCompletedAt(?DateTimeImmutable $completedAt): void { - $this->store = $store; + $this->completedAt = $completedAt; } /** - * @param ?string $origin + * @param ?CustomFieldsDraft $custom */ - public function setOrigin(?string $origin): void + public function setCustom(?CustomFieldsDraft $custom): void { - $this->origin = $origin; + $this->custom = $custom; } diff --git a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraft.php b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraft.php index 574fbde0d60..818d0931e4a 100644 --- a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraft.php @@ -23,9 +23,8 @@ interface ProductVariantImportDraft extends JsonObject public const FIELD_IMAGES = 'images'; /** - *

The sequential ID of the variant within the product. - * The variant with provided ID should exist in some existing product, so you also need to specify the productId if this property is set, - * or alternatively you can just specify SKU of the product variant.

+ *

The id of the ProductVariant. Required if you do not set a value for sku. + * If set, you must specify a productId in the LineItemImportDraft also.

* * @return null|int @@ -33,7 +32,7 @@ interface ProductVariantImportDraft extends JsonObject public function getId(); /** - *

The SKU of the existing variant.

+ *

The sku of the ProductVariant. Required if you do not set a value for id.

* * @return null|string @@ -41,9 +40,9 @@ public function getId(); public function getSku(); /** - *

The Embedded Prices of the variant. - * The prices should not contain two prices for the same price scope (same currency, country, customer group, channel, valid from and valid until). - * If this property is defined, then it will override the prices property from the original product variant, otherwise prices property from the original product variant would be copied in the resulting order.

+ *

The Prices of the Product Variant if you want to override the prices property in the referenced ProductVariant. + * If not set, the prices from the referenced ProductVariant are used in the resulting Order. + * If set, each Price must have its unique price scope (same value.currencyCode, country, customerGroup, channel, validFrom and validUntil).

* * @return null|PriceDraftCollection @@ -51,8 +50,8 @@ public function getSku(); public function getPrices(); /** - *

If this property is defined, then it will override the attributes property from the original - * product variant, otherwise attributes property from the original product variant would be copied in the resulting order.

+ *

The Attributes of the Product Variant if you want to override the attributes property in the referenced ProductVariant. + * If not set, the attributes from the referenced ProductVariant are copied to the resulting Order.

* * @return null|AttributeCollection @@ -60,8 +59,8 @@ public function getPrices(); public function getAttributes(); /** - *

If this property is defined, then it will override the images property from the original - * product variant, otherwise images property from the original product variant would be copied in the resulting order.

+ *

The Images of the Product Variant if you want to override the images property in the referenced ProductVariant. + * If not set, the images from the referenced ProductVariant are copied to the resulting Order.

* * @return null|ImageCollection diff --git a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftBuilder.php index e9d989085b2..36bdf1056fc 100644 --- a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftBuilder.php @@ -54,9 +54,8 @@ final class ProductVariantImportDraftBuilder implements Builder private $images; /** - *

The sequential ID of the variant within the product. - * The variant with provided ID should exist in some existing product, so you also need to specify the productId if this property is set, - * or alternatively you can just specify SKU of the product variant.

+ *

The id of the ProductVariant. Required if you do not set a value for sku. + * If set, you must specify a productId in the LineItemImportDraft also.

* * @return null|int @@ -67,7 +66,7 @@ public function getId() } /** - *

The SKU of the existing variant.

+ *

The sku of the ProductVariant. Required if you do not set a value for id.

* * @return null|string @@ -78,9 +77,9 @@ public function getSku() } /** - *

The Embedded Prices of the variant. - * The prices should not contain two prices for the same price scope (same currency, country, customer group, channel, valid from and valid until). - * If this property is defined, then it will override the prices property from the original product variant, otherwise prices property from the original product variant would be copied in the resulting order.

+ *

The Prices of the Product Variant if you want to override the prices property in the referenced ProductVariant. + * If not set, the prices from the referenced ProductVariant are used in the resulting Order. + * If set, each Price must have its unique price scope (same value.currencyCode, country, customerGroup, channel, validFrom and validUntil).

* * @return null|PriceDraftCollection @@ -91,8 +90,8 @@ public function getPrices() } /** - *

If this property is defined, then it will override the attributes property from the original - * product variant, otherwise attributes property from the original product variant would be copied in the resulting order.

+ *

The Attributes of the Product Variant if you want to override the attributes property in the referenced ProductVariant. + * If not set, the attributes from the referenced ProductVariant are copied to the resulting Order.

* * @return null|AttributeCollection @@ -103,8 +102,8 @@ public function getAttributes() } /** - *

If this property is defined, then it will override the images property from the original - * product variant, otherwise images property from the original product variant would be copied in the resulting order.

+ *

The Images of the Product Variant if you want to override the images property in the referenced ProductVariant. + * If not set, the images from the referenced ProductVariant are copied to the resulting Order.

* * @return null|ImageCollection diff --git a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftModel.php b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftModel.php index 4e204623898..73910b5113a 100644 --- a/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ProductVariantImportDraftModel.php @@ -71,9 +71,8 @@ public function __construct( } /** - *

The sequential ID of the variant within the product. - * The variant with provided ID should exist in some existing product, so you also need to specify the productId if this property is set, - * or alternatively you can just specify SKU of the product variant.

+ *

The id of the ProductVariant. Required if you do not set a value for sku. + * If set, you must specify a productId in the LineItemImportDraft also.

* * * @return null|int @@ -93,7 +92,7 @@ public function getId() } /** - *

The SKU of the existing variant.

+ *

The sku of the ProductVariant. Required if you do not set a value for id.

* * * @return null|string @@ -113,9 +112,9 @@ public function getSku() } /** - *

The Embedded Prices of the variant. - * The prices should not contain two prices for the same price scope (same currency, country, customer group, channel, valid from and valid until). - * If this property is defined, then it will override the prices property from the original product variant, otherwise prices property from the original product variant would be copied in the resulting order.

+ *

The Prices of the Product Variant if you want to override the prices property in the referenced ProductVariant. + * If not set, the prices from the referenced ProductVariant are used in the resulting Order. + * If set, each Price must have its unique price scope (same value.currencyCode, country, customerGroup, channel, validFrom and validUntil).

* * * @return null|PriceDraftCollection @@ -135,8 +134,8 @@ public function getPrices() } /** - *

If this property is defined, then it will override the attributes property from the original - * product variant, otherwise attributes property from the original product variant would be copied in the resulting order.

+ *

The Attributes of the Product Variant if you want to override the attributes property in the referenced ProductVariant. + * If not set, the attributes from the referenced ProductVariant are copied to the resulting Order.

* * * @return null|AttributeCollection @@ -156,8 +155,8 @@ public function getAttributes() } /** - *

If this property is defined, then it will override the images property from the original - * product variant, otherwise images property from the original product variant would be copied in the resulting order.

+ *

The Images of the Product Variant if you want to override the images property in the referenced ProductVariant. + * If not set, the images from the referenced ProductVariant are copied to the resulting Order.

* * * @return null|ImageCollection diff --git a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraft.php b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraft.php index 6e4f1e17881..cf547b62bb2 100644 --- a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraft.php @@ -29,19 +29,23 @@ interface ShippingInfoImportDraft extends JsonObject public const FIELD_SHIPPING_METHOD_STATE = 'shippingMethodState'; /** + *

Name of the Shipping Method.

+ * * @return null|string */ public function getShippingMethodName(); /** + *

The base price for the Shipping Method.

+ * * @return null|Money */ public function getPrice(); /** - *

The shipping rate used to determine the price.

+ *

Shipping rate information for the Order.

* * @return null|ShippingRateDraft @@ -49,19 +53,23 @@ public function getPrice(); public function getShippingRate(); /** + *

Include a Tax Rate for the Shipping Method.

+ * * @return null|TaxRate */ public function getTaxRate(); /** + *

Include a value to associate a Tax Category with the shipping information.

+ * * @return null|TaxCategoryResourceIdentifier */ public function getTaxCategory(); /** - *

Not set if custom shipping method is used.

+ *

Include a value to associate a Shipping Method with the Order.

* * @return null|ShippingMethodResourceIdentifier @@ -69,7 +77,7 @@ public function getTaxCategory(); public function getShippingMethod(); /** - *

Deliveries are compilations of information on how the articles are being delivered to the customers.

+ *

Information on how items are to be delivered to customers.

* * @return null|DeliveryDraftCollection @@ -77,13 +85,15 @@ public function getShippingMethod(); public function getDeliveries(); /** + *

Discounted Price of the Shipping Method.

+ * * @return null|DiscountedLineItemPriceDraft */ public function getDiscountedPrice(); /** - *

Indicates whether the ShippingMethod referenced is allowed for the cart or not.

+ *

Indicates if the ShippingMethod referenced is allowed for the Order or not.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftBuilder.php index be50972e657..b832bb79b40 100644 --- a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftBuilder.php @@ -85,6 +85,8 @@ final class ShippingInfoImportDraftBuilder implements Builder private $shippingMethodState; /** + *

Name of the Shipping Method.

+ * * @return null|string */ @@ -94,6 +96,8 @@ public function getShippingMethodName() } /** + *

The base price for the Shipping Method.

+ * * @return null|Money */ @@ -103,7 +107,7 @@ public function getPrice() } /** - *

The shipping rate used to determine the price.

+ *

Shipping rate information for the Order.

* * @return null|ShippingRateDraft @@ -114,6 +118,8 @@ public function getShippingRate() } /** + *

Include a Tax Rate for the Shipping Method.

+ * * @return null|TaxRate */ @@ -123,6 +129,8 @@ public function getTaxRate() } /** + *

Include a value to associate a Tax Category with the shipping information.

+ * * @return null|TaxCategoryResourceIdentifier */ @@ -132,7 +140,7 @@ public function getTaxCategory() } /** - *

Not set if custom shipping method is used.

+ *

Include a value to associate a Shipping Method with the Order.

* * @return null|ShippingMethodResourceIdentifier @@ -143,7 +151,7 @@ public function getShippingMethod() } /** - *

Deliveries are compilations of information on how the articles are being delivered to the customers.

+ *

Information on how items are to be delivered to customers.

* * @return null|DeliveryDraftCollection @@ -154,6 +162,8 @@ public function getDeliveries() } /** + *

Discounted Price of the Shipping Method.

+ * * @return null|DiscountedLineItemPriceDraft */ @@ -163,7 +173,7 @@ public function getDiscountedPrice() } /** - *

Indicates whether the ShippingMethod referenced is allowed for the cart or not.

+ *

Indicates if the ShippingMethod referenced is allowed for the Order or not.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftModel.php b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftModel.php index 4e588752a07..af6b2596f0e 100644 --- a/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ShippingInfoImportDraftModel.php @@ -110,6 +110,8 @@ public function __construct( } /** + *

Name of the Shipping Method.

+ * * * @return null|string */ @@ -128,6 +130,8 @@ public function getShippingMethodName() } /** + *

The base price for the Shipping Method.

+ * * * @return null|Money */ @@ -147,7 +151,7 @@ public function getPrice() } /** - *

The shipping rate used to determine the price.

+ *

Shipping rate information for the Order.

* * * @return null|ShippingRateDraft @@ -168,6 +172,8 @@ public function getShippingRate() } /** + *

Include a Tax Rate for the Shipping Method.

+ * * * @return null|TaxRate */ @@ -187,6 +193,8 @@ public function getTaxRate() } /** + *

Include a value to associate a Tax Category with the shipping information.

+ * * * @return null|TaxCategoryResourceIdentifier */ @@ -206,7 +214,7 @@ public function getTaxCategory() } /** - *

Not set if custom shipping method is used.

+ *

Include a value to associate a Shipping Method with the Order.

* * * @return null|ShippingMethodResourceIdentifier @@ -227,7 +235,7 @@ public function getShippingMethod() } /** - *

Deliveries are compilations of information on how the articles are being delivered to the customers.

+ *

Information on how items are to be delivered to customers.

* * * @return null|DeliveryDraftCollection @@ -247,6 +255,8 @@ public function getDeliveries() } /** + *

Discounted Price of the Shipping Method.

+ * * * @return null|DiscountedLineItemPriceDraft */ @@ -266,7 +276,7 @@ public function getDiscountedPrice() } /** - *

Indicates whether the ShippingMethod referenced is allowed for the cart or not.

+ *

Indicates if the ShippingMethod referenced is allowed for the Order or not.

* * * @return null|string diff --git a/references.txt b/references.txt index 08dad2159d2..a74971923bf 100644 --- a/references.txt +++ b/references.txt @@ -77,3 +77,4 @@ ffae5451a83fffb30629a708d9325edfcc11d72a d64e3f818ddbb68526fbbe5c0ba3c1cfde9a7c0f b07e7ba714fd02e261dac1818a92f4b434ffb62b 68aece12ea78c79043175a729bc159bf2ecef280 +1983af4216979cb57ba71255ef917e9cbb03bded From 9bd758b419272eb81399c2afbd91c18836f060f5 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 18 Jul 2023 14:22:58 +0000 Subject: [PATCH 17/44] TASK: Updating SDK --- changes.md | 24 +++ .../Change/AddInheritedAssociateChange.php | 49 +++++ .../AddInheritedAssociateChangeBuilder.php | 102 +++++++++++ .../AddInheritedAssociateChangeCollection.php | 56 ++++++ .../AddInheritedAssociateChangeModel.php | 134 ++++++++++++++ .../Change/ChangeBuyerAssignableChange.php | 62 +++++++ .../ChangeBuyerAssignableChangeBuilder.php | 119 ++++++++++++ .../ChangeBuyerAssignableChangeCollection.php | 56 ++++++ .../ChangeBuyerAssignableChangeModel.php | 167 +++++++++++++++++ .../Change/ChangeInheritedAssociateChange.php | 63 +++++++ .../ChangeInheritedAssociateChangeBuilder.php | 142 +++++++++++++++ ...angeInheritedAssociateChangeCollection.php | 56 ++++++ .../ChangeInheritedAssociateChangeModel.php | 171 ++++++++++++++++++ .../src/Models/Change/ChangeModel.php | 6 + .../Change/RemoveInheritedAssociateChange.php | 49 +++++ .../RemoveInheritedAssociateChangeBuilder.php | 102 +++++++++++ ...moveInheritedAssociateChangeCollection.php | 56 ++++++ .../RemoveInheritedAssociateChangeModel.php | 134 ++++++++++++++ .../Models/Change/SetLocalizedNameChange.php | 63 +++++++ .../Change/SetLocalizedNameChangeBuilder.php | 142 +++++++++++++++ .../SetLocalizedNameChangeCollection.php | 56 ++++++ .../Change/SetLocalizedNameChangeModel.php | 171 ++++++++++++++++++ .../Models/Change/SetPermissionsChange.php | 62 +++++++ .../Change/SetPermissionsChangeBuilder.php | 119 ++++++++++++ .../Change/SetPermissionsChangeCollection.php | 56 ++++++ .../Change/SetPermissionsChangeModel.php | 167 +++++++++++++++++ .../src/Models/Common/InheritedAssociate.php | 41 +++++ .../Common/InheritedAssociateBuilder.php | 98 ++++++++++ .../Common/InheritedAssociateCollection.php | 56 ++++++ .../Models/Common/InheritedAssociateModel.php | 105 +++++++++++ .../InheritedAssociateRoleAssignment.php | 41 +++++ ...nheritedAssociateRoleAssignmentBuilder.php | 109 +++++++++++ ...ritedAssociateRoleAssignmentCollection.php | 56 ++++++ .../InheritedAssociateRoleAssignmentModel.php | 106 +++++++++++ .../src/Models/Label/AssociateRoleLabel.php | 51 ++++++ .../Label/AssociateRoleLabelBuilder.php | 92 ++++++++++ .../Label/AssociateRoleLabelCollection.php | 56 ++++++ .../Models/Label/AssociateRoleLabelModel.php | 133 ++++++++++++++ .../src/Models/Label/LabelModel.php | 1 + references.txt | 1 + 40 files changed, 3330 insertions(+) create mode 100644 lib/commercetools-history/src/Models/Change/AddInheritedAssociateChange.php create mode 100644 lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeBuilder.php create mode 100644 lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeCollection.php create mode 100644 lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeModel.php create mode 100644 lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChange.php create mode 100644 lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeBuilder.php create mode 100644 lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeCollection.php create mode 100644 lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeModel.php create mode 100644 lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChange.php create mode 100644 lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeBuilder.php create mode 100644 lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeCollection.php create mode 100644 lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeModel.php create mode 100644 lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChange.php create mode 100644 lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeBuilder.php create mode 100644 lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeCollection.php create mode 100644 lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeModel.php create mode 100644 lib/commercetools-history/src/Models/Change/SetLocalizedNameChange.php create mode 100644 lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeBuilder.php create mode 100644 lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeCollection.php create mode 100644 lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeModel.php create mode 100644 lib/commercetools-history/src/Models/Change/SetPermissionsChange.php create mode 100644 lib/commercetools-history/src/Models/Change/SetPermissionsChangeBuilder.php create mode 100644 lib/commercetools-history/src/Models/Change/SetPermissionsChangeCollection.php create mode 100644 lib/commercetools-history/src/Models/Change/SetPermissionsChangeModel.php create mode 100644 lib/commercetools-history/src/Models/Common/InheritedAssociate.php create mode 100644 lib/commercetools-history/src/Models/Common/InheritedAssociateBuilder.php create mode 100644 lib/commercetools-history/src/Models/Common/InheritedAssociateCollection.php create mode 100644 lib/commercetools-history/src/Models/Common/InheritedAssociateModel.php create mode 100644 lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignment.php create mode 100644 lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignmentBuilder.php create mode 100644 lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignmentCollection.php create mode 100644 lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignmentModel.php create mode 100644 lib/commercetools-history/src/Models/Label/AssociateRoleLabel.php create mode 100644 lib/commercetools-history/src/Models/Label/AssociateRoleLabelBuilder.php create mode 100644 lib/commercetools-history/src/Models/Label/AssociateRoleLabelCollection.php create mode 100644 lib/commercetools-history/src/Models/Label/AssociateRoleLabelModel.php diff --git a/changes.md b/changes.md index 474d150e2ff..f83dd01e485 100644 --- a/changes.md +++ b/changes.md @@ -172,3 +172,27 @@ - :warning: changed property `key` of type `PriceDraftImport` to be required +**History changes** + +
+Added Type(s) + +- added type `AddInheritedAssociateChange` +- added type `AssociateRoleLabel` +- added type `ChangeBuyerAssignableChange` +- added type `ChangeInheritedAssociateChange` +- added type `InheritedAssociate` +- added type `InheritedAssociateRoleAssignment` +- added type `Permission` +- added type `RemoveInheritedAssociateChange` +- added type `SetLocalizedNameChange` +- added type `SetPermissionsChange` +
+ + +
+Added Enum(s) + +- added enum `associate-role` to type `ChangeHistoryResourceType` +
+ diff --git a/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChange.php b/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChange.php new file mode 100644 index 00000000000..a2ae543908f --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChange.php @@ -0,0 +1,49 @@ +Value after the change.

+ * + + * @return null|InheritedAssociate + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?InheritedAssociate $nextValue + */ + public function setNextValue(?InheritedAssociate $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeBuilder.php new file mode 100644 index 00000000000..6eb321e9cfa --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeBuilder.php @@ -0,0 +1,102 @@ + + */ +final class AddInheritedAssociateChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var null|InheritedAssociate|InheritedAssociateBuilder + */ + private $nextValue; + + /** + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + *

Value after the change.

+ * + + * @return null|InheritedAssociate + */ + public function getNextValue() + { + return $this->nextValue instanceof InheritedAssociateBuilder ? $this->nextValue->build() : $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?InheritedAssociate $nextValue + * @return $this + */ + public function withNextValue(?InheritedAssociate $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + /** + * @deprecated use withNextValue() instead + * @return $this + */ + public function withNextValueBuilder(?InheritedAssociateBuilder $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + public function build(): AddInheritedAssociateChange + { + return new AddInheritedAssociateChangeModel( + $this->change, + $this->nextValue instanceof InheritedAssociateBuilder ? $this->nextValue->build() : $this->nextValue + ); + } + + public static function of(): AddInheritedAssociateChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeCollection.php b/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeCollection.php new file mode 100644 index 00000000000..7db44a9e7ec --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeCollection.php @@ -0,0 +1,56 @@ + + * @method AddInheritedAssociateChange current() + * @method AddInheritedAssociateChange end() + * @method AddInheritedAssociateChange at($offset) + */ +class AddInheritedAssociateChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert AddInheritedAssociateChange $value + * @psalm-param AddInheritedAssociateChange|stdClass $value + * @throws InvalidArgumentException + * + * @return AddInheritedAssociateChangeCollection + */ + public function add($value) + { + if (!$value instanceof AddInheritedAssociateChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?AddInheritedAssociateChange + */ + protected function mapper() + { + return function (?int $index): ?AddInheritedAssociateChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var AddInheritedAssociateChange $data */ + $data = AddInheritedAssociateChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeModel.php b/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeModel.php new file mode 100644 index 00000000000..7d7257186d3 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/AddInheritedAssociateChangeModel.php @@ -0,0 +1,134 @@ +change = $change; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + *

Value after the change.

+ * + * + * @return null|InheritedAssociate + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + + $this->nextValue = InheritedAssociateModel::of($data); + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?InheritedAssociate $nextValue + */ + public function setNextValue(?InheritedAssociate $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChange.php b/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChange.php new file mode 100644 index 00000000000..a48a0140010 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChange.php @@ -0,0 +1,62 @@ +Value before the change.

+ * + + * @return null|bool + */ + public function getPreviousValue(); + + /** + *

Value after the change.

+ * + + * @return null|bool + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?bool $previousValue + */ + public function setPreviousValue(?bool $previousValue): void; + + /** + * @param ?bool $nextValue + */ + public function setNextValue(?bool $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeBuilder.php new file mode 100644 index 00000000000..b933a0252bc --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeBuilder.php @@ -0,0 +1,119 @@ + + */ +final class ChangeBuyerAssignableChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var ?bool + */ + private $previousValue; + + /** + + * @var ?bool + */ + private $nextValue; + + /** + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + *

Value before the change.

+ * + + * @return null|bool + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + *

Value after the change.

+ * + + * @return null|bool + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?bool $previousValue + * @return $this + */ + public function withPreviousValue(?bool $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?bool $nextValue + * @return $this + */ + public function withNextValue(?bool $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + + public function build(): ChangeBuyerAssignableChange + { + return new ChangeBuyerAssignableChangeModel( + $this->change, + $this->previousValue, + $this->nextValue + ); + } + + public static function of(): ChangeBuyerAssignableChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeCollection.php b/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeCollection.php new file mode 100644 index 00000000000..426b39c21ec --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeCollection.php @@ -0,0 +1,56 @@ + + * @method ChangeBuyerAssignableChange current() + * @method ChangeBuyerAssignableChange end() + * @method ChangeBuyerAssignableChange at($offset) + */ +class ChangeBuyerAssignableChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert ChangeBuyerAssignableChange $value + * @psalm-param ChangeBuyerAssignableChange|stdClass $value + * @throws InvalidArgumentException + * + * @return ChangeBuyerAssignableChangeCollection + */ + public function add($value) + { + if (!$value instanceof ChangeBuyerAssignableChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ChangeBuyerAssignableChange + */ + protected function mapper() + { + return function (?int $index): ?ChangeBuyerAssignableChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ChangeBuyerAssignableChange $data */ + $data = ChangeBuyerAssignableChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeModel.php new file mode 100644 index 00000000000..1cc8898ff26 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeBuyerAssignableChangeModel.php @@ -0,0 +1,167 @@ +change = $change; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + *

Value before the change.

+ * + * + * @return null|bool + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = (bool) $data; + } + + return $this->previousValue; + } + + /** + *

Value after the change.

+ * + * + * @return null|bool + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?bool $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = (bool) $data; + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?bool $previousValue + */ + public function setPreviousValue(?bool $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?bool $nextValue + */ + public function setNextValue(?bool $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChange.php b/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChange.php new file mode 100644 index 00000000000..331605502d1 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChange.php @@ -0,0 +1,63 @@ +Value before the change.

+ * + + * @return null|InheritedAssociate + */ + public function getPreviousValue(); + + /** + *

Value after the change.

+ * + + * @return null|InheritedAssociate + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?InheritedAssociate $previousValue + */ + public function setPreviousValue(?InheritedAssociate $previousValue): void; + + /** + * @param ?InheritedAssociate $nextValue + */ + public function setNextValue(?InheritedAssociate $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeBuilder.php new file mode 100644 index 00000000000..2dac0d77faa --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeBuilder.php @@ -0,0 +1,142 @@ + + */ +final class ChangeInheritedAssociateChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var null|InheritedAssociate|InheritedAssociateBuilder + */ + private $previousValue; + + /** + + * @var null|InheritedAssociate|InheritedAssociateBuilder + */ + private $nextValue; + + /** + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + *

Value before the change.

+ * + + * @return null|InheritedAssociate + */ + public function getPreviousValue() + { + return $this->previousValue instanceof InheritedAssociateBuilder ? $this->previousValue->build() : $this->previousValue; + } + + /** + *

Value after the change.

+ * + + * @return null|InheritedAssociate + */ + public function getNextValue() + { + return $this->nextValue instanceof InheritedAssociateBuilder ? $this->nextValue->build() : $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?InheritedAssociate $previousValue + * @return $this + */ + public function withPreviousValue(?InheritedAssociate $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?InheritedAssociate $nextValue + * @return $this + */ + public function withNextValue(?InheritedAssociate $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + /** + * @deprecated use withPreviousValue() instead + * @return $this + */ + public function withPreviousValueBuilder(?InheritedAssociateBuilder $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @deprecated use withNextValue() instead + * @return $this + */ + public function withNextValueBuilder(?InheritedAssociateBuilder $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + public function build(): ChangeInheritedAssociateChange + { + return new ChangeInheritedAssociateChangeModel( + $this->change, + $this->previousValue instanceof InheritedAssociateBuilder ? $this->previousValue->build() : $this->previousValue, + $this->nextValue instanceof InheritedAssociateBuilder ? $this->nextValue->build() : $this->nextValue + ); + } + + public static function of(): ChangeInheritedAssociateChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeCollection.php b/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeCollection.php new file mode 100644 index 00000000000..ba239194f6e --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeCollection.php @@ -0,0 +1,56 @@ + + * @method ChangeInheritedAssociateChange current() + * @method ChangeInheritedAssociateChange end() + * @method ChangeInheritedAssociateChange at($offset) + */ +class ChangeInheritedAssociateChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert ChangeInheritedAssociateChange $value + * @psalm-param ChangeInheritedAssociateChange|stdClass $value + * @throws InvalidArgumentException + * + * @return ChangeInheritedAssociateChangeCollection + */ + public function add($value) + { + if (!$value instanceof ChangeInheritedAssociateChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ChangeInheritedAssociateChange + */ + protected function mapper() + { + return function (?int $index): ?ChangeInheritedAssociateChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ChangeInheritedAssociateChange $data */ + $data = ChangeInheritedAssociateChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeModel.php new file mode 100644 index 00000000000..ea92c419f0d --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/ChangeInheritedAssociateChangeModel.php @@ -0,0 +1,171 @@ +change = $change; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + *

Value before the change.

+ * + * + * @return null|InheritedAssociate + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + + $this->previousValue = InheritedAssociateModel::of($data); + } + + return $this->previousValue; + } + + /** + *

Value after the change.

+ * + * + * @return null|InheritedAssociate + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + + $this->nextValue = InheritedAssociateModel::of($data); + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?InheritedAssociate $previousValue + */ + public function setPreviousValue(?InheritedAssociate $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?InheritedAssociate $nextValue + */ + public function setNextValue(?InheritedAssociate $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/ChangeModel.php b/lib/commercetools-history/src/Models/Change/ChangeModel.php index cf64d623a62..c6b818ae60a 100644 --- a/lib/commercetools-history/src/Models/Change/ChangeModel.php +++ b/lib/commercetools-history/src/Models/Change/ChangeModel.php @@ -50,6 +50,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'AddEnumValueChange' => AddEnumValueChangeModel::class, 'AddExternalImageChange' => AddExternalImageChangeModel::class, 'AddFieldDefinitionChange' => AddFieldDefinitionChangeModel::class, + 'AddInheritedAssociateChange' => AddInheritedAssociateChangeModel::class, 'AddInterfaceInteractionChange' => AddInterfaceInteractionChangeModel::class, 'AddItemShippingAddressesChange' => AddItemShippingAddressesChangeModel::class, 'AddLocalizedEnumValueChange' => AddLocalizedEnumValueChangeModel::class, @@ -80,6 +81,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'ChangeAssociateModeChange' => ChangeAssociateModeChangeModel::class, 'ChangeAttributeConstraintChange' => ChangeAttributeConstraintChangeModel::class, 'ChangeAttributeOrderByNameChange' => ChangeAttributeOrderByNameChangeModel::class, + 'ChangeBuyerAssignableChange' => ChangeBuyerAssignableChangeModel::class, 'ChangeCartDiscountsChange' => ChangeCartDiscountsChangeModel::class, 'ChangeCartPredicateChange' => ChangeCartPredicateChangeModel::class, 'ChangeCustomLineItemQuantityChange' => ChangeCustomLineItemQuantityChangeModel::class, @@ -89,6 +91,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'ChangeEnumValueOrderChange' => ChangeEnumValueOrderChangeModel::class, 'ChangeFieldDefinitionOrderChange' => ChangeFieldDefinitionOrderChangeModel::class, 'ChangeGroupsChange' => ChangeGroupsChangeModel::class, + 'ChangeInheritedAssociateChange' => ChangeInheritedAssociateChangeModel::class, 'ChangeInitialChange' => ChangeInitialChangeModel::class, 'ChangeInputHintChange' => ChangeInputHintChangeModel::class, 'ChangeIsActiveChange' => ChangeIsActiveChangeModel::class, @@ -152,6 +155,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'RemoveFieldDefinitionChange' => RemoveFieldDefinitionChangeModel::class, 'RemoveFromCategoryChange' => RemoveFromCategoryChangeModel::class, 'RemoveImageChange' => RemoveImageChangeModel::class, + 'RemoveInheritedAssociateChange' => RemoveInheritedAssociateChangeModel::class, 'RemoveItemShippingAddressesChange' => RemoveItemShippingAddressesChangeModel::class, 'RemoveLocalizedEnumValuesChange' => RemoveLocalizedEnumValuesChangeModel::class, 'RemoveLocationChange' => RemoveLocationChangeModel::class, @@ -242,6 +246,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'SetLineItemTotalPriceChange' => SetLineItemTotalPriceChangeModel::class, 'SetLocaleChange' => SetLocaleChangeModel::class, 'SetLocalizedDescriptionChange' => SetLocalizedDescriptionChangeModel::class, + 'SetLocalizedNameChange' => SetLocalizedNameChangeModel::class, 'SetMaxApplicationsChange' => SetMaxApplicationsChangeModel::class, 'SetMaxApplicationsPerCustomerChange' => SetMaxApplicationsPerCustomerChangeModel::class, 'SetMetaDescriptionChange' => SetMetaDescriptionChangeModel::class, @@ -261,6 +266,7 @@ final class ChangeModel extends JsonObjectModel implements Change 'SetParcelItemsChange' => SetParcelItemsChangeModel::class, 'SetParcelMeasurementsChange' => SetParcelMeasurementsChangeModel::class, 'SetParcelTrackingDataChange' => SetParcelTrackingDataChangeModel::class, + 'SetPermissionsChange' => SetPermissionsChangeModel::class, 'SetPricesChange' => SetPricesChangeModel::class, 'SetProductCountChange' => SetProductCountChangeModel::class, 'SetProductPriceCustomFieldChange' => SetProductPriceCustomFieldChangeModel::class, diff --git a/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChange.php b/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChange.php new file mode 100644 index 00000000000..8299a5d808c --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChange.php @@ -0,0 +1,49 @@ +The value before the change.

+ * + + * @return null|InheritedAssociate + */ + public function getPreviousValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?InheritedAssociate $previousValue + */ + public function setPreviousValue(?InheritedAssociate $previousValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeBuilder.php b/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeBuilder.php new file mode 100644 index 00000000000..58662e4a062 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeBuilder.php @@ -0,0 +1,102 @@ + + */ +final class RemoveInheritedAssociateChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var null|InheritedAssociate|InheritedAssociateBuilder + */ + private $previousValue; + + /** + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + *

The value before the change.

+ * + + * @return null|InheritedAssociate + */ + public function getPreviousValue() + { + return $this->previousValue instanceof InheritedAssociateBuilder ? $this->previousValue->build() : $this->previousValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?InheritedAssociate $previousValue + * @return $this + */ + public function withPreviousValue(?InheritedAssociate $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @deprecated use withPreviousValue() instead + * @return $this + */ + public function withPreviousValueBuilder(?InheritedAssociateBuilder $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + public function build(): RemoveInheritedAssociateChange + { + return new RemoveInheritedAssociateChangeModel( + $this->change, + $this->previousValue instanceof InheritedAssociateBuilder ? $this->previousValue->build() : $this->previousValue + ); + } + + public static function of(): RemoveInheritedAssociateChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeCollection.php b/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeCollection.php new file mode 100644 index 00000000000..7e5d9e0ac89 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeCollection.php @@ -0,0 +1,56 @@ + + * @method RemoveInheritedAssociateChange current() + * @method RemoveInheritedAssociateChange end() + * @method RemoveInheritedAssociateChange at($offset) + */ +class RemoveInheritedAssociateChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert RemoveInheritedAssociateChange $value + * @psalm-param RemoveInheritedAssociateChange|stdClass $value + * @throws InvalidArgumentException + * + * @return RemoveInheritedAssociateChangeCollection + */ + public function add($value) + { + if (!$value instanceof RemoveInheritedAssociateChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?RemoveInheritedAssociateChange + */ + protected function mapper() + { + return function (?int $index): ?RemoveInheritedAssociateChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var RemoveInheritedAssociateChange $data */ + $data = RemoveInheritedAssociateChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeModel.php b/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeModel.php new file mode 100644 index 00000000000..364b2b9584d --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/RemoveInheritedAssociateChangeModel.php @@ -0,0 +1,134 @@ +change = $change; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + *

The value before the change.

+ * + * + * @return null|InheritedAssociate + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + + $this->previousValue = InheritedAssociateModel::of($data); + } + + return $this->previousValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?InheritedAssociate $previousValue + */ + public function setPreviousValue(?InheritedAssociate $previousValue): void + { + $this->previousValue = $previousValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/SetLocalizedNameChange.php b/lib/commercetools-history/src/Models/Change/SetLocalizedNameChange.php new file mode 100644 index 00000000000..cdd026be834 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLocalizedNameChange.php @@ -0,0 +1,63 @@ +Value before the change.

+ * + + * @return null|LocalizedString + */ + public function getPreviousValue(); + + /** + *

Value after the change.

+ * + + * @return null|LocalizedString + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?LocalizedString $previousValue + */ + public function setPreviousValue(?LocalizedString $previousValue): void; + + /** + * @param ?LocalizedString $nextValue + */ + public function setNextValue(?LocalizedString $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeBuilder.php new file mode 100644 index 00000000000..a20c68fe1be --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeBuilder.php @@ -0,0 +1,142 @@ + + */ +final class SetLocalizedNameChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var null|LocalizedString|LocalizedStringBuilder + */ + private $previousValue; + + /** + + * @var null|LocalizedString|LocalizedStringBuilder + */ + private $nextValue; + + /** + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + *

Value before the change.

+ * + + * @return null|LocalizedString + */ + public function getPreviousValue() + { + return $this->previousValue instanceof LocalizedStringBuilder ? $this->previousValue->build() : $this->previousValue; + } + + /** + *

Value after the change.

+ * + + * @return null|LocalizedString + */ + public function getNextValue() + { + return $this->nextValue instanceof LocalizedStringBuilder ? $this->nextValue->build() : $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?LocalizedString $previousValue + * @return $this + */ + public function withPreviousValue(?LocalizedString $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?LocalizedString $nextValue + * @return $this + */ + public function withNextValue(?LocalizedString $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + /** + * @deprecated use withPreviousValue() instead + * @return $this + */ + public function withPreviousValueBuilder(?LocalizedStringBuilder $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @deprecated use withNextValue() instead + * @return $this + */ + public function withNextValueBuilder(?LocalizedStringBuilder $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + public function build(): SetLocalizedNameChange + { + return new SetLocalizedNameChangeModel( + $this->change, + $this->previousValue instanceof LocalizedStringBuilder ? $this->previousValue->build() : $this->previousValue, + $this->nextValue instanceof LocalizedStringBuilder ? $this->nextValue->build() : $this->nextValue + ); + } + + public static function of(): SetLocalizedNameChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeCollection.php b/lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeCollection.php new file mode 100644 index 00000000000..94b16835153 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeCollection.php @@ -0,0 +1,56 @@ + + * @method SetLocalizedNameChange current() + * @method SetLocalizedNameChange end() + * @method SetLocalizedNameChange at($offset) + */ +class SetLocalizedNameChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert SetLocalizedNameChange $value + * @psalm-param SetLocalizedNameChange|stdClass $value + * @throws InvalidArgumentException + * + * @return SetLocalizedNameChangeCollection + */ + public function add($value) + { + if (!$value instanceof SetLocalizedNameChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?SetLocalizedNameChange + */ + protected function mapper() + { + return function (?int $index): ?SetLocalizedNameChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var SetLocalizedNameChange $data */ + $data = SetLocalizedNameChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeModel.php b/lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeModel.php new file mode 100644 index 00000000000..2a6fc99c0b1 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetLocalizedNameChangeModel.php @@ -0,0 +1,171 @@ +change = $change; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + *

Value before the change.

+ * + * + * @return null|LocalizedString + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + + $this->previousValue = LocalizedStringModel::of($data); + } + + return $this->previousValue; + } + + /** + *

Value after the change.

+ * + * + * @return null|LocalizedString + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + + $this->nextValue = LocalizedStringModel::of($data); + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?LocalizedString $previousValue + */ + public function setPreviousValue(?LocalizedString $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?LocalizedString $nextValue + */ + public function setNextValue(?LocalizedString $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Change/SetPermissionsChange.php b/lib/commercetools-history/src/Models/Change/SetPermissionsChange.php new file mode 100644 index 00000000000..3d9b8062e07 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetPermissionsChange.php @@ -0,0 +1,62 @@ +Value before the change.

+ * + + * @return null|array + */ + public function getPreviousValue(); + + /** + *

Value after the change.

+ * + + * @return null|array + */ + public function getNextValue(); + + /** + * @param ?string $change + */ + public function setChange(?string $change): void; + + /** + * @param ?array $previousValue + */ + public function setPreviousValue(?array $previousValue): void; + + /** + * @param ?array $nextValue + */ + public function setNextValue(?array $nextValue): void; +} diff --git a/lib/commercetools-history/src/Models/Change/SetPermissionsChangeBuilder.php b/lib/commercetools-history/src/Models/Change/SetPermissionsChangeBuilder.php new file mode 100644 index 00000000000..bbf98bcec9a --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetPermissionsChangeBuilder.php @@ -0,0 +1,119 @@ + + */ +final class SetPermissionsChangeBuilder implements Builder +{ + /** + + * @var ?string + */ + private $change; + + /** + + * @var ?array + */ + private $previousValue; + + /** + + * @var ?array + */ + private $nextValue; + + /** + + * @return null|string + */ + public function getChange() + { + return $this->change; + } + + /** + *

Value before the change.

+ * + + * @return null|array + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + *

Value after the change.

+ * + + * @return null|array + */ + public function getNextValue() + { + return $this->nextValue; + } + + /** + * @param ?string $change + * @return $this + */ + public function withChange(?string $change) + { + $this->change = $change; + + return $this; + } + + /** + * @param ?array $previousValue + * @return $this + */ + public function withPreviousValue(?array $previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @param ?array $nextValue + * @return $this + */ + public function withNextValue(?array $nextValue) + { + $this->nextValue = $nextValue; + + return $this; + } + + + public function build(): SetPermissionsChange + { + return new SetPermissionsChangeModel( + $this->change, + $this->previousValue, + $this->nextValue + ); + } + + public static function of(): SetPermissionsChangeBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetPermissionsChangeCollection.php b/lib/commercetools-history/src/Models/Change/SetPermissionsChangeCollection.php new file mode 100644 index 00000000000..e5223b62f71 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetPermissionsChangeCollection.php @@ -0,0 +1,56 @@ + + * @method SetPermissionsChange current() + * @method SetPermissionsChange end() + * @method SetPermissionsChange at($offset) + */ +class SetPermissionsChangeCollection extends ChangeCollection +{ + /** + * @psalm-assert SetPermissionsChange $value + * @psalm-param SetPermissionsChange|stdClass $value + * @throws InvalidArgumentException + * + * @return SetPermissionsChangeCollection + */ + public function add($value) + { + if (!$value instanceof SetPermissionsChange) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?SetPermissionsChange + */ + protected function mapper() + { + return function (?int $index): ?SetPermissionsChange { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var SetPermissionsChange $data */ + $data = SetPermissionsChangeModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Change/SetPermissionsChangeModel.php b/lib/commercetools-history/src/Models/Change/SetPermissionsChangeModel.php new file mode 100644 index 00000000000..43d5a71f3c5 --- /dev/null +++ b/lib/commercetools-history/src/Models/Change/SetPermissionsChangeModel.php @@ -0,0 +1,167 @@ +change = $change; + $this->previousValue = $previousValue; + $this->nextValue = $nextValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + * + * @return null|string + */ + public function getChange() + { + if (is_null($this->change)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CHANGE); + if (is_null($data)) { + return null; + } + $this->change = (string) $data; + } + + return $this->change; + } + + /** + *

Value before the change.

+ * + * + * @return null|array + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = $data; + } + + return $this->previousValue; + } + + /** + *

Value after the change.

+ * + * + * @return null|array + */ + public function getNextValue() + { + if (is_null($this->nextValue)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_NEXT_VALUE); + if (is_null($data)) { + return null; + } + $this->nextValue = $data; + } + + return $this->nextValue; + } + + + /** + * @param ?string $change + */ + public function setChange(?string $change): void + { + $this->change = $change; + } + + /** + * @param ?array $previousValue + */ + public function setPreviousValue(?array $previousValue): void + { + $this->previousValue = $previousValue; + } + + /** + * @param ?array $nextValue + */ + public function setNextValue(?array $nextValue): void + { + $this->nextValue = $nextValue; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Common/InheritedAssociate.php b/lib/commercetools-history/src/Models/Common/InheritedAssociate.php new file mode 100644 index 00000000000..7a10ebba356 --- /dev/null +++ b/lib/commercetools-history/src/Models/Common/InheritedAssociate.php @@ -0,0 +1,41 @@ + + */ +final class InheritedAssociateBuilder implements Builder +{ + /** + + * @var ?InheritedAssociateRoleAssignmentCollection + */ + private $associateRoleAssignments; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $customer; + + /** + + * @return null|InheritedAssociateRoleAssignmentCollection + */ + public function getAssociateRoleAssignments() + { + return $this->associateRoleAssignments; + } + + /** + + * @return null|Reference + */ + public function getCustomer() + { + return $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer; + } + + /** + * @param ?InheritedAssociateRoleAssignmentCollection $associateRoleAssignments + * @return $this + */ + public function withAssociateRoleAssignments(?InheritedAssociateRoleAssignmentCollection $associateRoleAssignments) + { + $this->associateRoleAssignments = $associateRoleAssignments; + + return $this; + } + + /** + * @param ?Reference $customer + * @return $this + */ + public function withCustomer(?Reference $customer) + { + $this->customer = $customer; + + return $this; + } + + /** + * @deprecated use withCustomer() instead + * @return $this + */ + public function withCustomerBuilder(?ReferenceBuilder $customer) + { + $this->customer = $customer; + + return $this; + } + + public function build(): InheritedAssociate + { + return new InheritedAssociateModel( + $this->associateRoleAssignments, + $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer + ); + } + + public static function of(): InheritedAssociateBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Common/InheritedAssociateCollection.php b/lib/commercetools-history/src/Models/Common/InheritedAssociateCollection.php new file mode 100644 index 00000000000..c08de8bf1b5 --- /dev/null +++ b/lib/commercetools-history/src/Models/Common/InheritedAssociateCollection.php @@ -0,0 +1,56 @@ + + * @method InheritedAssociate current() + * @method InheritedAssociate end() + * @method InheritedAssociate at($offset) + */ +class InheritedAssociateCollection extends MapperSequence +{ + /** + * @psalm-assert InheritedAssociate $value + * @psalm-param InheritedAssociate|stdClass $value + * @throws InvalidArgumentException + * + * @return InheritedAssociateCollection + */ + public function add($value) + { + if (!$value instanceof InheritedAssociate) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?InheritedAssociate + */ + protected function mapper() + { + return function (?int $index): ?InheritedAssociate { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var InheritedAssociate $data */ + $data = InheritedAssociateModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Common/InheritedAssociateModel.php b/lib/commercetools-history/src/Models/Common/InheritedAssociateModel.php new file mode 100644 index 00000000000..4737059a675 --- /dev/null +++ b/lib/commercetools-history/src/Models/Common/InheritedAssociateModel.php @@ -0,0 +1,105 @@ +associateRoleAssignments = $associateRoleAssignments; + $this->customer = $customer; + + } + + /** + * + * @return null|InheritedAssociateRoleAssignmentCollection + */ + public function getAssociateRoleAssignments() + { + if (is_null($this->associateRoleAssignments)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_ASSOCIATE_ROLE_ASSIGNMENTS); + if (is_null($data)) { + return null; + } + $this->associateRoleAssignments = InheritedAssociateRoleAssignmentCollection::fromArray($data); + } + + return $this->associateRoleAssignments; + } + + /** + * + * @return null|Reference + */ + public function getCustomer() + { + if (is_null($this->customer)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER); + if (is_null($data)) { + return null; + } + + $this->customer = ReferenceModel::of($data); + } + + return $this->customer; + } + + + /** + * @param ?InheritedAssociateRoleAssignmentCollection $associateRoleAssignments + */ + public function setAssociateRoleAssignments(?InheritedAssociateRoleAssignmentCollection $associateRoleAssignments): void + { + $this->associateRoleAssignments = $associateRoleAssignments; + } + + /** + * @param ?Reference $customer + */ + public function setCustomer(?Reference $customer): void + { + $this->customer = $customer; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignment.php b/lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignment.php new file mode 100644 index 00000000000..76d85d30bf8 --- /dev/null +++ b/lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignment.php @@ -0,0 +1,41 @@ + + */ +final class InheritedAssociateRoleAssignmentBuilder implements Builder +{ + /** + + * @var null|KeyReference|KeyReferenceBuilder + */ + private $associateRole; + + /** + + * @var null|KeyReference|KeyReferenceBuilder + */ + private $source; + + /** + + * @return null|KeyReference + */ + public function getAssociateRole() + { + return $this->associateRole instanceof KeyReferenceBuilder ? $this->associateRole->build() : $this->associateRole; + } + + /** + + * @return null|KeyReference + */ + public function getSource() + { + return $this->source instanceof KeyReferenceBuilder ? $this->source->build() : $this->source; + } + + /** + * @param ?KeyReference $associateRole + * @return $this + */ + public function withAssociateRole(?KeyReference $associateRole) + { + $this->associateRole = $associateRole; + + return $this; + } + + /** + * @param ?KeyReference $source + * @return $this + */ + public function withSource(?KeyReference $source) + { + $this->source = $source; + + return $this; + } + + /** + * @deprecated use withAssociateRole() instead + * @return $this + */ + public function withAssociateRoleBuilder(?KeyReferenceBuilder $associateRole) + { + $this->associateRole = $associateRole; + + return $this; + } + + /** + * @deprecated use withSource() instead + * @return $this + */ + public function withSourceBuilder(?KeyReferenceBuilder $source) + { + $this->source = $source; + + return $this; + } + + public function build(): InheritedAssociateRoleAssignment + { + return new InheritedAssociateRoleAssignmentModel( + $this->associateRole instanceof KeyReferenceBuilder ? $this->associateRole->build() : $this->associateRole, + $this->source instanceof KeyReferenceBuilder ? $this->source->build() : $this->source + ); + } + + public static function of(): InheritedAssociateRoleAssignmentBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignmentCollection.php b/lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignmentCollection.php new file mode 100644 index 00000000000..94bfccd564d --- /dev/null +++ b/lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignmentCollection.php @@ -0,0 +1,56 @@ + + * @method InheritedAssociateRoleAssignment current() + * @method InheritedAssociateRoleAssignment end() + * @method InheritedAssociateRoleAssignment at($offset) + */ +class InheritedAssociateRoleAssignmentCollection extends MapperSequence +{ + /** + * @psalm-assert InheritedAssociateRoleAssignment $value + * @psalm-param InheritedAssociateRoleAssignment|stdClass $value + * @throws InvalidArgumentException + * + * @return InheritedAssociateRoleAssignmentCollection + */ + public function add($value) + { + if (!$value instanceof InheritedAssociateRoleAssignment) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?InheritedAssociateRoleAssignment + */ + protected function mapper() + { + return function (?int $index): ?InheritedAssociateRoleAssignment { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var InheritedAssociateRoleAssignment $data */ + $data = InheritedAssociateRoleAssignmentModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignmentModel.php b/lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignmentModel.php new file mode 100644 index 00000000000..2939ce39e01 --- /dev/null +++ b/lib/commercetools-history/src/Models/Common/InheritedAssociateRoleAssignmentModel.php @@ -0,0 +1,106 @@ +associateRole = $associateRole; + $this->source = $source; + + } + + /** + * + * @return null|KeyReference + */ + public function getAssociateRole() + { + if (is_null($this->associateRole)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE_ROLE); + if (is_null($data)) { + return null; + } + + $this->associateRole = KeyReferenceModel::of($data); + } + + return $this->associateRole; + } + + /** + * + * @return null|KeyReference + */ + public function getSource() + { + if (is_null($this->source)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_SOURCE); + if (is_null($data)) { + return null; + } + + $this->source = KeyReferenceModel::of($data); + } + + return $this->source; + } + + + /** + * @param ?KeyReference $associateRole + */ + public function setAssociateRole(?KeyReference $associateRole): void + { + $this->associateRole = $associateRole; + } + + /** + * @param ?KeyReference $source + */ + public function setSource(?KeyReference $source): void + { + $this->source = $source; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Label/AssociateRoleLabel.php b/lib/commercetools-history/src/Models/Label/AssociateRoleLabel.php new file mode 100644 index 00000000000..f3140f2e9cb --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/AssociateRoleLabel.php @@ -0,0 +1,51 @@ +User-defined unique identifier of the Associate Role.

+ * + + * @return null|string + */ + public function getKey(); + + /** + *

Name of the Associate Role.

+ * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-history/src/Models/Label/AssociateRoleLabelBuilder.php b/lib/commercetools-history/src/Models/Label/AssociateRoleLabelBuilder.php new file mode 100644 index 00000000000..7ea157011cc --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/AssociateRoleLabelBuilder.php @@ -0,0 +1,92 @@ + + */ +final class AssociateRoleLabelBuilder implements Builder +{ + /** + + * @var ?string + */ + private $key; + + /** + + * @var ?string + */ + private $name; + + /** + *

User-defined unique identifier of the Associate Role.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + + /** + *

Name of the Associate Role.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + + public function build(): AssociateRoleLabel + { + return new AssociateRoleLabelModel( + $this->key, + $this->name + ); + } + + public static function of(): AssociateRoleLabelBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-history/src/Models/Label/AssociateRoleLabelCollection.php b/lib/commercetools-history/src/Models/Label/AssociateRoleLabelCollection.php new file mode 100644 index 00000000000..e9d9fe15a44 --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/AssociateRoleLabelCollection.php @@ -0,0 +1,56 @@ + + * @method AssociateRoleLabel current() + * @method AssociateRoleLabel end() + * @method AssociateRoleLabel at($offset) + */ +class AssociateRoleLabelCollection extends LabelCollection +{ + /** + * @psalm-assert AssociateRoleLabel $value + * @psalm-param AssociateRoleLabel|stdClass $value + * @throws InvalidArgumentException + * + * @return AssociateRoleLabelCollection + */ + public function add($value) + { + if (!$value instanceof AssociateRoleLabel) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?AssociateRoleLabel + */ + protected function mapper() + { + return function (?int $index): ?AssociateRoleLabel { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var AssociateRoleLabel $data */ + $data = AssociateRoleLabelModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-history/src/Models/Label/AssociateRoleLabelModel.php b/lib/commercetools-history/src/Models/Label/AssociateRoleLabelModel.php new file mode 100644 index 00000000000..219b3f1c160 --- /dev/null +++ b/lib/commercetools-history/src/Models/Label/AssociateRoleLabelModel.php @@ -0,0 +1,133 @@ +key = $key; + $this->name = $name; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-defined unique identifier of the Associate Role.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + + /** + *

Name of the Associate Role.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + + +} diff --git a/lib/commercetools-history/src/Models/Label/LabelModel.php b/lib/commercetools-history/src/Models/Label/LabelModel.php index dca7b572193..b3996f78947 100644 --- a/lib/commercetools-history/src/Models/Label/LabelModel.php +++ b/lib/commercetools-history/src/Models/Label/LabelModel.php @@ -32,6 +32,7 @@ final class LabelModel extends JsonObjectModel implements Label * */ private static $discriminatorClasses = [ + 'AssociateRoleLabel' => AssociateRoleLabelModel::class, 'BusinessUnitLabel' => BusinessUnitLabelModel::class, 'CustomObjectLabel' => CustomObjectLabelModel::class, 'CustomerLabel' => CustomerLabelModel::class, diff --git a/references.txt b/references.txt index a74971923bf..c519a4855cf 100644 --- a/references.txt +++ b/references.txt @@ -78,3 +78,4 @@ d64e3f818ddbb68526fbbe5c0ba3c1cfde9a7c0f b07e7ba714fd02e261dac1818a92f4b434ffb62b 68aece12ea78c79043175a729bc159bf2ecef280 1983af4216979cb57ba71255ef917e9cbb03bded +c9260db322647c370b40e1883a503f6a0aec131d From c7ac721f1f2d82c7adc6eba536271c92eb735a3f Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 18 Jul 2023 14:51:08 +0000 Subject: [PATCH 18/44] TASK: Updating SDK --- changes.md | 1 + references.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/changes.md b/changes.md index f83dd01e485..d9c563529cd 100644 --- a/changes.md +++ b/changes.md @@ -169,6 +169,7 @@
Required Property(s) +- changed property `addresses` of type `CustomerImport` to be optional - :warning: changed property `key` of type `PriceDraftImport` to be required
diff --git a/references.txt b/references.txt index c519a4855cf..e15de671841 100644 --- a/references.txt +++ b/references.txt @@ -79,3 +79,4 @@ b07e7ba714fd02e261dac1818a92f4b434ffb62b 68aece12ea78c79043175a729bc159bf2ecef280 1983af4216979cb57ba71255ef917e9cbb03bded c9260db322647c370b40e1883a503f6a0aec131d +03d2ea8ce027fa53701a10fbfb27e4e9626ae223 From 8af7dd4f45afac747c3e1aef019a05d9c27bef3f Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Thu, 20 Jul 2023 12:42:16 +0000 Subject: [PATCH 19/44] TASK: Updating SDK --- references.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/references.txt b/references.txt index e15de671841..ff35bd518e2 100644 --- a/references.txt +++ b/references.txt @@ -80,3 +80,4 @@ b07e7ba714fd02e261dac1818a92f4b434ffb62b 1983af4216979cb57ba71255ef917e9cbb03bded c9260db322647c370b40e1883a503f6a0aec131d 03d2ea8ce027fa53701a10fbfb27e4e9626ae223 +7ca1a57b89f7abd9deecf8bf3e236b9a8109ecb4 From a0ac20ab9e8cfb9e8dbdc6c8d9abe3ff3b80d294 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 21 Jul 2023 12:06:56 +0000 Subject: [PATCH 20/44] TASK: Updating SDK --- changes.md | 18 +++++++++ .../CustomLineItemStateTransitionMessage.php | 14 +++++++ ...mLineItemStateTransitionMessageBuilder.php | 29 ++++++++++++++ ...tomLineItemStateTransitionMessageModel.php | 36 ++++++++++++++++++ ...mLineItemStateTransitionMessagePayload.php | 14 +++++++ ...emStateTransitionMessagePayloadBuilder.php | 29 ++++++++++++++ ...ItemStateTransitionMessagePayloadModel.php | 36 ++++++++++++++++++ .../OrderCustomLineItemDiscountSetMessage.php | 14 +++++++ ...ustomLineItemDiscountSetMessageBuilder.php | 29 ++++++++++++++ ...rCustomLineItemDiscountSetMessageModel.php | 36 ++++++++++++++++++ ...ustomLineItemDiscountSetMessagePayload.php | 14 +++++++ ...neItemDiscountSetMessagePayloadBuilder.php | 29 ++++++++++++++ ...LineItemDiscountSetMessagePayloadModel.php | 36 ++++++++++++++++++ ...erCustomLineItemQuantityChangedMessage.php | 14 +++++++ ...mLineItemQuantityChangedMessageBuilder.php | 29 ++++++++++++++ ...tomLineItemQuantityChangedMessageModel.php | 36 ++++++++++++++++++ ...mLineItemQuantityChangedMessagePayload.php | 14 +++++++ ...emQuantityChangedMessagePayloadBuilder.php | 29 ++++++++++++++ ...ItemQuantityChangedMessagePayloadModel.php | 36 ++++++++++++++++++ .../OrderCustomLineItemRemovedMessage.php | 14 +++++++ ...derCustomLineItemRemovedMessageBuilder.php | 29 ++++++++++++++ ...OrderCustomLineItemRemovedMessageModel.php | 36 ++++++++++++++++++ ...derCustomLineItemRemovedMessagePayload.php | 14 +++++++ ...omLineItemRemovedMessagePayloadBuilder.php | 29 ++++++++++++++ ...stomLineItemRemovedMessagePayloadModel.php | 36 ++++++++++++++++++ .../Order/CustomLineItemImportDraft.php | 14 +++++++ .../CustomLineItemImportDraftBuilder.php | 29 ++++++++++++++ .../Order/CustomLineItemImportDraftModel.php | 36 ++++++++++++++++++ .../src/Models/Order/LineItemImportDraft.php | 14 +++++++ .../Order/LineItemImportDraftBuilder.php | 29 ++++++++++++++ .../Models/Order/LineItemImportDraftModel.php | 36 ++++++++++++++++++ .../OrderImportCustomLineItemStateAction.php | 16 +++++++- ...ImportCustomLineItemStateActionBuilder.php | 31 ++++++++++++++- ...erImportCustomLineItemStateActionModel.php | 38 ++++++++++++++++++- ...derTransitionCustomLineItemStateAction.php | 16 +++++++- ...sitionCustomLineItemStateActionBuilder.php | 31 ++++++++++++++- ...ansitionCustomLineItemStateActionModel.php | 38 ++++++++++++++++++- ...edOrderImportCustomLineItemStateAction.php | 16 +++++++- ...ImportCustomLineItemStateActionBuilder.php | 31 ++++++++++++++- ...erImportCustomLineItemStateActionModel.php | 38 ++++++++++++++++++- ...derTransitionCustomLineItemStateAction.php | 16 +++++++- ...sitionCustomLineItemStateActionBuilder.php | 31 ++++++++++++++- ...ansitionCustomLineItemStateActionModel.php | 38 ++++++++++++++++++- references.txt | 1 + 44 files changed, 1137 insertions(+), 12 deletions(-) diff --git a/changes.md b/changes.md index d9c563529cd..22033a85819 100644 --- a/changes.md +++ b/changes.md @@ -27,11 +27,19 @@ - added property `associate` to type `ClientLogging` - added property `associate` to type `CreatedBy` - added property `associate` to type `LastModifiedBy` +- added property `customLineItemKey` to type `CustomLineItemStateTransitionMessage` - added property `lineItemKey` to type `LineItemStateTransitionMessage` +- added property `customLineItemKey` to type `OrderCustomLineItemDiscountSetMessage` +- added property `customLineItemKey` to type `OrderCustomLineItemQuantityChangedMessage` +- added property `customLineItemKey` to type `OrderCustomLineItemRemovedMessage` - added property `lineItemKey` to type `OrderLineItemDiscountSetMessage` - added property `lineItemKey` to type `OrderLineItemDistributionChannelSetMessage` - added property `lineItemKey` to type `OrderLineItemRemovedMessage` +- added property `customLineItemKey` to type `CustomLineItemStateTransitionMessagePayload` - added property `lineItemKey` to type `LineItemStateTransitionMessagePayload` +- added property `customLineItemKey` to type `OrderCustomLineItemDiscountSetMessagePayload` +- added property `customLineItemKey` to type `OrderCustomLineItemQuantityChangedMessagePayload` +- added property `customLineItemKey` to type `OrderCustomLineItemRemovedMessagePayload` - added property `lineItemKey` to type `OrderLineItemDiscountSetMessagePayload` - added property `lineItemKey` to type `OrderLineItemDistributionChannelSetMessagePayload` - added property `lineItemKey` to type `OrderLineItemRemovedMessagePayload` @@ -41,6 +49,7 @@ - added property `inventoryMode` to type `StagedOrderAddLineItemAction` - added property `customLineItemKey` to type `StagedOrderChangeCustomLineItemMoneyAction` - added property `customLineItemKey` to type `StagedOrderChangeCustomLineItemQuantityAction` +- added property `customLineItemKey` to type `StagedOrderImportCustomLineItemStateAction` - added property `lineItemKey` to type `StagedOrderImportLineItemStateAction` - added property `customLineItemKey` to type `StagedOrderRemoveCustomLineItemAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemCustomFieldAction` @@ -48,14 +57,19 @@ - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemShippingDetailsAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxAmountAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxRateAction` +- added property `customLineItemKey` to type `StagedOrderTransitionCustomLineItemStateAction` - added property `lineItemKey` to type `StagedOrderTransitionLineItemStateAction` +- added property `key` to type `CustomLineItemImportDraft` +- added property `key` to type `LineItemImportDraft` - added property `directDiscounts` to type `Order` - added property `purchaseOrderNumber` to type `OrderImportDraft` - added property `taxCalculationMode` to type `OrderImportDraft` +- added property `customLineItemKey` to type `OrderImportCustomLineItemStateAction` - added property `lineItemKey` to type `OrderImportLineItemStateAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemCustomFieldAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemCustomTypeAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemShippingDetailsAction` +- added property `customLineItemKey` to type `OrderTransitionCustomLineItemStateAction` - added property `lineItemKey` to type `OrderTransitionLineItemStateAction` @@ -75,6 +89,7 @@ - changed property `customLineItemId` of type `CartSetCustomLineItemTaxRateAction` to be optional - changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemMoneyAction` to be optional - changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemQuantityAction` to be optional +- changed property `customLineItemId` of type `StagedOrderImportCustomLineItemStateAction` to be optional - changed property `lineItemId` of type `StagedOrderImportLineItemStateAction` to be optional - changed property `customLineItemId` of type `StagedOrderRemoveCustomLineItemAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemCustomFieldAction` to be optional @@ -82,12 +97,15 @@ - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemShippingDetailsAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxAmountAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxRateAction` to be optional +- changed property `customLineItemId` of type `StagedOrderTransitionCustomLineItemStateAction` to be optional - changed property `lineItemId` of type `StagedOrderTransitionLineItemStateAction` to be optional - changed property `priceMode` of type `CustomLineItemImportDraft` to be optional +- changed property `customLineItemId` of type `OrderImportCustomLineItemStateAction` to be optional - changed property `lineItemId` of type `OrderImportLineItemStateAction` to be optional - changed property `customLineItemId` of type `OrderSetCustomLineItemCustomFieldAction` to be optional - changed property `customLineItemId` of type `OrderSetCustomLineItemCustomTypeAction` to be optional - changed property `customLineItemId` of type `OrderSetCustomLineItemShippingDetailsAction` to be optional +- changed property `customLineItemId` of type `OrderTransitionCustomLineItemStateAction` to be optional - changed property `lineItemId` of type `OrderTransitionLineItemStateAction` to be optional - :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required - :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessage.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessage.php index 48a46026bfa..1121fa1311c 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessage.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessage.php @@ -16,6 +16,7 @@ interface CustomLineItemStateTransitionMessage extends OrderMessage { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_TRANSITION_DATE = 'transitionDate'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_FROM_STATE = 'fromState'; @@ -29,6 +30,14 @@ interface CustomLineItemStateTransitionMessage extends OrderMessage */ public function getCustomLineItemId(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Date and time (UTC) when the transition of the Custom Line Item State was performed.

* @@ -66,6 +75,11 @@ public function getToState(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?DateTimeImmutable $transitionDate */ diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageBuilder.php index e86499624a8..621963a3a0e 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageBuilder.php @@ -95,6 +95,12 @@ final class CustomLineItemStateTransitionMessageBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?DateTimeImmutable @@ -241,6 +247,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Date and time (UTC) when the transition of the Custom Line Item State was performed.

* @@ -406,6 +423,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?DateTimeImmutable $transitionDate * @return $this @@ -530,6 +558,7 @@ public function build(): CustomLineItemStateTransitionMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->customLineItemId, + $this->customLineItemKey, $this->transitionDate, $this->quantity, $this->fromState instanceof StateReferenceBuilder ? $this->fromState->build() : $this->fromState, diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageModel.php index 8250c178ea8..4778d4a00bf 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessageModel.php @@ -101,6 +101,12 @@ final class CustomLineItemStateTransitionMessageModel extends JsonObjectModel im */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?DateTimeImmutable @@ -141,6 +147,7 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?DateTimeImmutable $transitionDate = null, ?int $quantity = null, ?StateReference $fromState = null, @@ -158,6 +165,7 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->transitionDate = $transitionDate; $this->quantity = $quantity; $this->fromState = $fromState; @@ -418,6 +426,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Date and time (UTC) when the transition of the Custom Line Item State was performed.

* @@ -593,6 +621,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?DateTimeImmutable $transitionDate */ diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayload.php index 90f156668ec..3e55549a896 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayload.php @@ -16,6 +16,7 @@ interface CustomLineItemStateTransitionMessagePayload extends OrderMessagePayload { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_TRANSITION_DATE = 'transitionDate'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_FROM_STATE = 'fromState'; @@ -29,6 +30,14 @@ interface CustomLineItemStateTransitionMessagePayload extends OrderMessagePayloa */ public function getCustomLineItemId(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Date and time (UTC) when the transition of the Custom Line Item State was performed.

* @@ -66,6 +75,11 @@ public function getToState(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?DateTimeImmutable $transitionDate */ diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadBuilder.php index f428f767b15..1f693ceb13b 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadBuilder.php @@ -29,6 +29,12 @@ final class CustomLineItemStateTransitionMessagePayloadBuilder implements Builde */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?DateTimeImmutable @@ -64,6 +70,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Date and time (UTC) when the transition of the Custom Line Item State was performed.

* @@ -119,6 +136,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?DateTimeImmutable $transitionDate * @return $this @@ -189,6 +217,7 @@ public function build(): CustomLineItemStateTransitionMessagePayload { return new CustomLineItemStateTransitionMessagePayloadModel( $this->customLineItemId, + $this->customLineItemKey, $this->transitionDate, $this->quantity, $this->fromState instanceof StateReferenceBuilder ? $this->fromState->build() : $this->fromState, diff --git a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadModel.php index bf4756f1594..d3217d6f821 100644 --- a/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/CustomLineItemStateTransitionMessagePayloadModel.php @@ -35,6 +35,12 @@ final class CustomLineItemStateTransitionMessagePayloadModel extends JsonObjectM */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?DateTimeImmutable @@ -65,6 +71,7 @@ final class CustomLineItemStateTransitionMessagePayloadModel extends JsonObjectM */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?DateTimeImmutable $transitionDate = null, ?int $quantity = null, ?StateReference $fromState = null, @@ -72,6 +79,7 @@ public function __construct( ?string $type = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->transitionDate = $transitionDate; $this->quantity = $quantity; $this->fromState = $fromState; @@ -117,6 +125,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Date and time (UTC) when the transition of the Custom Line Item State was performed.

* @@ -212,6 +240,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?DateTimeImmutable $transitionDate */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessage.php index dd5bb94edfe..2f1932a15b0 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessage.php @@ -16,6 +16,7 @@ interface OrderCustomLineItemDiscountSetMessage extends OrderMessage { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity'; public const FIELD_TAXED_PRICE = 'taxedPrice'; @@ -27,6 +28,14 @@ interface OrderCustomLineItemDiscountSetMessage extends OrderMessage */ public function getCustomLineItemId(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -48,6 +57,11 @@ public function getTaxedPrice(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageBuilder.php index 3d717b5b63f..235181fea89 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageBuilder.php @@ -96,6 +96,12 @@ final class OrderCustomLineItemDiscountSetMessageBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?DiscountedLineItemPriceForQuantityCollection @@ -230,6 +236,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -373,6 +390,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity * @return $this @@ -464,6 +492,7 @@ public function build(): OrderCustomLineItemDiscountSetMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->customLineItemId, + $this->customLineItemKey, $this->discountedPricePerQuantity, $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice ); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageModel.php index 4db3435bdf0..e254dbc2d0f 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessageModel.php @@ -102,6 +102,12 @@ final class OrderCustomLineItemDiscountSetMessageModel extends JsonObjectModel i */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?DiscountedLineItemPriceForQuantityCollection @@ -130,6 +136,7 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, ?TaxedItemPrice $taxedPrice = null, ?string $type = null @@ -145,6 +152,7 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->taxedPrice = $taxedPrice; $this->type = $type ?? self::DISCRIMINATOR_VALUE; @@ -403,6 +411,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -533,6 +561,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayload.php index 9c16e648e3b..2c1c3099aec 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayload.php @@ -16,6 +16,7 @@ interface OrderCustomLineItemDiscountSetMessagePayload extends OrderMessagePayload { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_DISCOUNTED_PRICE_PER_QUANTITY = 'discountedPricePerQuantity'; public const FIELD_TAXED_PRICE = 'taxedPrice'; @@ -27,6 +28,14 @@ interface OrderCustomLineItemDiscountSetMessagePayload extends OrderMessagePaylo */ public function getCustomLineItemId(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -48,6 +57,11 @@ public function getTaxedPrice(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadBuilder.php index 0a11b35a783..24d8c253491 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadBuilder.php @@ -29,6 +29,12 @@ final class OrderCustomLineItemDiscountSetMessagePayloadBuilder implements Build */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?DiscountedLineItemPriceForQuantityCollection @@ -52,6 +58,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -85,6 +102,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity * @return $this @@ -122,6 +150,7 @@ public function build(): OrderCustomLineItemDiscountSetMessagePayload { return new OrderCustomLineItemDiscountSetMessagePayloadModel( $this->customLineItemId, + $this->customLineItemKey, $this->discountedPricePerQuantity, $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice ); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadModel.php index 08b246e4d62..22e067220e2 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemDiscountSetMessagePayloadModel.php @@ -35,6 +35,12 @@ final class OrderCustomLineItemDiscountSetMessagePayloadModel extends JsonObject */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?DiscountedLineItemPriceForQuantityCollection @@ -53,11 +59,13 @@ final class OrderCustomLineItemDiscountSetMessagePayloadModel extends JsonObject */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity = null, ?TaxedItemPrice $taxedPrice = null, ?string $type = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->discountedPricePerQuantity = $discountedPricePerQuantity; $this->taxedPrice = $taxedPrice; $this->type = $type ?? self::DISCRIMINATOR_VALUE; @@ -101,6 +109,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Array of DiscountedLineItemPriceForQuantity after the Discount recalculation.

* @@ -151,6 +179,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?DiscountedLineItemPriceForQuantityCollection $discountedPricePerQuantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessage.php index e602f6d8e8f..29eec8790d1 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessage.php @@ -14,6 +14,7 @@ interface OrderCustomLineItemQuantityChangedMessage extends OrderMessage { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_OLD_QUANTITY = 'oldQuantity'; @@ -25,6 +26,14 @@ interface OrderCustomLineItemQuantityChangedMessage extends OrderMessage */ public function getCustomLineItemId(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Custom Line Item quantity after the Change Custom Line Item Quantity update action.

* @@ -46,6 +55,11 @@ public function getOldQuantity(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageBuilder.php index 0a5ae868be7..1fdc9249483 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageBuilder.php @@ -93,6 +93,12 @@ final class OrderCustomLineItemQuantityChangedMessageBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?int @@ -227,6 +233,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Custom Line Item quantity after the Change Custom Line Item Quantity update action.

* @@ -370,6 +387,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -450,6 +478,7 @@ public function build(): OrderCustomLineItemQuantityChangedMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->customLineItemId, + $this->customLineItemKey, $this->quantity, $this->oldQuantity ); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageModel.php index 3c6a234f1a9..ad8446e1667 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessageModel.php @@ -99,6 +99,12 @@ final class OrderCustomLineItemQuantityChangedMessageModel extends JsonObjectMod */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?int @@ -127,6 +133,7 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?int $quantity = null, ?int $oldQuantity = null, ?string $type = null @@ -142,6 +149,7 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->quantity = $quantity; $this->oldQuantity = $oldQuantity; $this->type = $type ?? self::DISCRIMINATOR_VALUE; @@ -400,6 +408,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Custom Line Item quantity after the Change Custom Line Item Quantity update action.

* @@ -529,6 +557,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayload.php index 622da203c26..f7e0d0f04a8 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayload.php @@ -14,6 +14,7 @@ interface OrderCustomLineItemQuantityChangedMessagePayload extends OrderMessagePayload { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_OLD_QUANTITY = 'oldQuantity'; @@ -25,6 +26,14 @@ interface OrderCustomLineItemQuantityChangedMessagePayload extends OrderMessageP */ public function getCustomLineItemId(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Custom Line Item quantity after the Change Custom Line Item Quantity update action.

* @@ -46,6 +55,11 @@ public function getOldQuantity(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadBuilder.php index 7ad9601cc6b..5eae9c68112 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadBuilder.php @@ -26,6 +26,12 @@ final class OrderCustomLineItemQuantityChangedMessagePayloadBuilder implements B */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?int @@ -49,6 +55,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Custom Line Item quantity after the Change Custom Line Item Quantity update action.

* @@ -82,6 +99,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -109,6 +137,7 @@ public function build(): OrderCustomLineItemQuantityChangedMessagePayload { return new OrderCustomLineItemQuantityChangedMessagePayloadModel( $this->customLineItemId, + $this->customLineItemKey, $this->quantity, $this->oldQuantity ); diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadModel.php index d0bed523500..bf47bc8578d 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemQuantityChangedMessagePayloadModel.php @@ -32,6 +32,12 @@ final class OrderCustomLineItemQuantityChangedMessagePayloadModel extends JsonOb */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?int @@ -50,11 +56,13 @@ final class OrderCustomLineItemQuantityChangedMessagePayloadModel extends JsonOb */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?int $quantity = null, ?int $oldQuantity = null, ?string $type = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->quantity = $quantity; $this->oldQuantity = $oldQuantity; $this->type = $type ?? self::DISCRIMINATOR_VALUE; @@ -98,6 +106,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Custom Line Item quantity after the Change Custom Line Item Quantity update action.

* @@ -147,6 +175,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessage.php index b92665b597c..79b42b13e89 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessage.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessage.php @@ -15,6 +15,7 @@ interface OrderCustomLineItemRemovedMessage extends OrderMessage { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_CUSTOM_LINE_ITEM = 'customLineItem'; /** @@ -25,6 +26,14 @@ interface OrderCustomLineItemRemovedMessage extends OrderMessage */ public function getCustomLineItemId(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Custom Line Item that was removed from the Order.

* @@ -38,6 +47,11 @@ public function getCustomLineItem(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?CustomLineItem $customLineItem */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageBuilder.php index 8583c350a39..c4efed05753 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageBuilder.php @@ -95,6 +95,12 @@ final class OrderCustomLineItemRemovedMessageBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|CustomLineItem|CustomLineItemBuilder @@ -223,6 +229,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Custom Line Item that was removed from the Order.

* @@ -355,6 +372,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?CustomLineItem $customLineItem * @return $this @@ -435,6 +463,7 @@ public function build(): OrderCustomLineItemRemovedMessage $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, $this->customLineItemId, + $this->customLineItemKey, $this->customLineItem instanceof CustomLineItemBuilder ? $this->customLineItem->build() : $this->customLineItem ); } diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageModel.php index 8d13fa10f72..15c9f58a1b3 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessageModel.php @@ -101,6 +101,12 @@ final class OrderCustomLineItemRemovedMessageModel extends JsonObjectModel imple */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?CustomLineItem @@ -123,6 +129,7 @@ public function __construct( ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?CustomLineItem $customLineItem = null, ?string $type = null ) { @@ -137,6 +144,7 @@ public function __construct( $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->customLineItem = $customLineItem; $this->type = $type ?? self::DISCRIMINATOR_VALUE; } @@ -394,6 +402,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Custom Line Item that was removed from the Order.

* @@ -504,6 +532,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?CustomLineItem $customLineItem */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayload.php index 524fee1aff5..783fae8c252 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayload.php @@ -15,6 +15,7 @@ interface OrderCustomLineItemRemovedMessagePayload extends OrderMessagePayload { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_CUSTOM_LINE_ITEM = 'customLineItem'; /** @@ -25,6 +26,14 @@ interface OrderCustomLineItemRemovedMessagePayload extends OrderMessagePayload */ public function getCustomLineItemId(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Custom Line Item that was removed from the Order.

* @@ -38,6 +47,11 @@ public function getCustomLineItem(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?CustomLineItem $customLineItem */ diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadBuilder.php index b2c2c32ae1f..e3c87d79d03 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadBuilder.php @@ -28,6 +28,12 @@ final class OrderCustomLineItemRemovedMessagePayloadBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var null|CustomLineItem|CustomLineItemBuilder @@ -45,6 +51,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Custom Line Item that was removed from the Order.

* @@ -67,6 +84,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?CustomLineItem $customLineItem * @return $this @@ -93,6 +121,7 @@ public function build(): OrderCustomLineItemRemovedMessagePayload { return new OrderCustomLineItemRemovedMessagePayloadModel( $this->customLineItemId, + $this->customLineItemKey, $this->customLineItem instanceof CustomLineItemBuilder ? $this->customLineItem->build() : $this->customLineItem ); } diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadModel.php index 1d07158d47e..afe39e05549 100644 --- a/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/OrderCustomLineItemRemovedMessagePayloadModel.php @@ -34,6 +34,12 @@ final class OrderCustomLineItemRemovedMessagePayloadModel extends JsonObjectMode */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?CustomLineItem @@ -46,10 +52,12 @@ final class OrderCustomLineItemRemovedMessagePayloadModel extends JsonObjectMode */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?CustomLineItem $customLineItem = null, ?string $type = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->customLineItem = $customLineItem; $this->type = $type ?? self::DISCRIMINATOR_VALUE; } @@ -92,6 +100,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Custom Line Item that was removed from the Order.

* @@ -122,6 +150,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?CustomLineItem $customLineItem */ diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraft.php b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraft.php index 54d7b3ced58..8fdb3287b24 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraft.php @@ -20,6 +20,7 @@ interface CustomLineItemImportDraft extends JsonObject { public const FIELD_NAME = 'name'; + public const FIELD_KEY = 'key'; public const FIELD_SLUG = 'slug'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_MONEY = 'money'; @@ -38,6 +39,14 @@ interface CustomLineItemImportDraft extends JsonObject */ public function getName(); + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getKey(); + /** *

User-defined identifier used in a deep-link URL for the Custom Line Item. This value should match the pattern [a-zA-Z0-9_-]{2,256}.

* @@ -119,6 +128,11 @@ public function getCustom(); */ public function setName(?LocalizedString $name): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?string $slug */ diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftBuilder.php index d46073486be..b316d7d325f 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftBuilder.php @@ -38,6 +38,12 @@ final class CustomLineItemImportDraftBuilder implements Builder */ private $name; + /** + + * @var ?string + */ + private $key; + /** * @var ?string @@ -103,6 +109,17 @@ public function getName() return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

User-defined identifier used in a deep-link URL for the Custom Line Item. This value should match the pattern [a-zA-Z0-9_-]{2,256}.

* @@ -217,6 +234,17 @@ public function withName(?LocalizedString $name) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?string $slug * @return $this @@ -386,6 +414,7 @@ public function build(): CustomLineItemImportDraft { return new CustomLineItemImportDraftModel( $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, + $this->key, $this->slug, $this->quantity, $this->money instanceof MoneyBuilder ? $this->money->build() : $this->money, diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftModel.php b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftModel.php index 348d9cec4cd..1bf37a36d3c 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemImportDraftModel.php @@ -37,6 +37,12 @@ final class CustomLineItemImportDraftModel extends JsonObjectModel implements Cu */ protected $name; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?string @@ -97,6 +103,7 @@ final class CustomLineItemImportDraftModel extends JsonObjectModel implements Cu */ public function __construct( ?LocalizedString $name = null, + ?string $key = null, ?string $slug = null, ?int $quantity = null, ?Money $money = null, @@ -108,6 +115,7 @@ public function __construct( ?CustomFieldsDraft $custom = null ) { $this->name = $name; + $this->key = $key; $this->slug = $slug; $this->quantity = $quantity; $this->money = $money; @@ -140,6 +148,26 @@ public function getName() return $this->name; } + /** + *

User-defined unique identifier of the Custom Line Item.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

User-defined identifier used in a deep-link URL for the Custom Line Item. This value should match the pattern [a-zA-Z0-9_-]{2,256}.

* @@ -338,6 +366,14 @@ public function setName(?LocalizedString $name): void $this->name = $name; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?string $slug */ diff --git a/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php b/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php index bc4a6f607eb..fe58ecfc191 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php +++ b/lib/commercetools-api/src/Models/Order/LineItemImportDraft.php @@ -20,6 +20,7 @@ interface LineItemImportDraft extends JsonObject { public const FIELD_NAME = 'name'; + public const FIELD_KEY = 'key'; public const FIELD_VARIANT = 'variant'; public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_QUANTITY = 'quantity'; @@ -40,6 +41,14 @@ interface LineItemImportDraft extends JsonObject */ public function getName(); + /** + *

User-defined unique identifier of the Line Item.

+ * + + * @return null|string + */ + public function getKey(); + /** *

The Product Variant to use as a Line Item.

* @@ -138,6 +147,11 @@ public function getCustom(); */ public function setName(?LocalizedString $name): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?ProductVariantImportDraft $variant */ diff --git a/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php b/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php index d7cb7818b78..045298acadb 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/LineItemImportDraftBuilder.php @@ -38,6 +38,12 @@ final class LineItemImportDraftBuilder implements Builder */ private $name; + /** + + * @var ?string + */ + private $key; + /** * @var null|ProductVariantImportDraft|ProductVariantImportDraftBuilder @@ -115,6 +121,17 @@ public function getName() return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; } + /** + *

User-defined unique identifier of the Line Item.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

The Product Variant to use as a Line Item.

* @@ -252,6 +269,17 @@ public function withName(?LocalizedString $name) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?ProductVariantImportDraft $variant * @return $this @@ -465,6 +493,7 @@ public function build(): LineItemImportDraft { return new LineItemImportDraftModel( $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, + $this->key, $this->variant instanceof ProductVariantImportDraftBuilder ? $this->variant->build() : $this->variant, $this->productId, $this->quantity, diff --git a/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php b/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php index 170f7c4599b..3e3a22ae4de 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/LineItemImportDraftModel.php @@ -37,6 +37,12 @@ final class LineItemImportDraftModel extends JsonObjectModel implements LineItem */ protected $name; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?ProductVariantImportDraft @@ -109,6 +115,7 @@ final class LineItemImportDraftModel extends JsonObjectModel implements LineItem */ public function __construct( ?LocalizedString $name = null, + ?string $key = null, ?ProductVariantImportDraft $variant = null, ?string $productId = null, ?int $quantity = null, @@ -122,6 +129,7 @@ public function __construct( ?CustomFieldsDraft $custom = null ) { $this->name = $name; + $this->key = $key; $this->variant = $variant; $this->productId = $productId; $this->quantity = $quantity; @@ -156,6 +164,26 @@ public function getName() return $this->name; } + /** + *

User-defined unique identifier of the Line Item.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

The Product Variant to use as a Line Item.

* @@ -397,6 +425,14 @@ public function setName(?LocalizedString $name): void $this->name = $name; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?ProductVariantImportDraft $variant */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php index e0173eec29a..ffa8fc0c7ac 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateAction.php @@ -14,16 +14,25 @@ interface OrderImportCustomLineItemStateAction extends OrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_STATE = 'state'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

New status of the Custom Line Items.

* @@ -37,6 +46,11 @@ public function getState(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?ItemStateCollection $state */ diff --git a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php index f5808b17fa4..f590399000b 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionBuilder.php @@ -26,6 +26,12 @@ final class OrderImportCustomLineItemStateActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?ItemStateCollection @@ -33,7 +39,7 @@ final class OrderImportCustomLineItemStateActionBuilder implements Builder private $state; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

New status of the Custom Line Items.

* @@ -65,6 +82,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?ItemStateCollection $state * @return $this @@ -81,6 +109,7 @@ public function build(): OrderImportCustomLineItemStateAction { return new OrderImportCustomLineItemStateActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->state ); } diff --git a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php index 76fa9b7c174..de8080615d4 100644 --- a/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderImportCustomLineItemStateActionModel.php @@ -32,6 +32,12 @@ final class OrderImportCustomLineItemStateActionModel extends JsonObjectModel im */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?ItemStateCollection @@ -44,10 +50,12 @@ final class OrderImportCustomLineItemStateActionModel extends JsonObjectModel im */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?ItemStateCollection $state = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->state = $state; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

New status of the Custom Line Items.

* @@ -119,6 +147,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?ItemStateCollection $state */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php index 0599639e81d..2c6f341bf62 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateAction.php @@ -16,19 +16,28 @@ interface OrderTransitionCustomLineItemStateAction extends OrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_FROM_STATE = 'fromState'; public const FIELD_TO_STATE = 'toState'; public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Number of Custom Line Items that should transition State.

* @@ -66,6 +75,11 @@ public function getActualTransitionDate(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php index cd60789d03d..09e835df8d7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionBuilder.php @@ -29,6 +29,12 @@ final class OrderTransitionCustomLineItemStateActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?int @@ -54,7 +60,7 @@ final class OrderTransitionCustomLineItemStateActionBuilder implements Builder private $actualTransitionDate; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -64,6 +70,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Number of Custom Line Items that should transition State.

* @@ -119,6 +136,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -189,6 +217,7 @@ public function build(): OrderTransitionCustomLineItemStateAction { return new OrderTransitionCustomLineItemStateActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->quantity, $this->fromState instanceof StateResourceIdentifierBuilder ? $this->fromState->build() : $this->fromState, $this->toState instanceof StateResourceIdentifierBuilder ? $this->toState->build() : $this->toState, diff --git a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php index 0003d2fc9a9..b54913087d0 100644 --- a/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderTransitionCustomLineItemStateActionModel.php @@ -35,6 +35,12 @@ final class OrderTransitionCustomLineItemStateActionModel extends JsonObjectMode */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?int @@ -65,6 +71,7 @@ final class OrderTransitionCustomLineItemStateActionModel extends JsonObjectMode */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?int $quantity = null, ?StateResourceIdentifier $fromState = null, ?StateResourceIdentifier $toState = null, @@ -72,6 +79,7 @@ public function __construct( ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; @@ -98,7 +106,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -117,6 +125,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Number of Custom Line Items that should transition State.

* @@ -212,6 +240,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php index e40934c90ae..0520ebfaf2d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateAction.php @@ -16,16 +16,25 @@ interface StagedOrderImportCustomLineItemStateAction extends StagedOrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_STATE = 'state'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

New status of the Custom Line Items.

* @@ -39,6 +48,11 @@ public function getState(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?ItemStateCollection $state */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php index 4b187ce393e..f012262bbce 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionBuilder.php @@ -29,6 +29,12 @@ final class StagedOrderImportCustomLineItemStateActionBuilder implements Builder */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?ItemStateCollection @@ -36,7 +42,7 @@ final class StagedOrderImportCustomLineItemStateActionBuilder implements Builder private $state; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -46,6 +52,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

New status of the Custom Line Items.

* @@ -68,6 +85,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?ItemStateCollection $state * @return $this @@ -84,6 +112,7 @@ public function build(): StagedOrderImportCustomLineItemStateAction { return new StagedOrderImportCustomLineItemStateActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->state ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php index 92794b02dec..dc7344e98a7 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderImportCustomLineItemStateActionModel.php @@ -35,6 +35,12 @@ final class StagedOrderImportCustomLineItemStateActionModel extends JsonObjectMo */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?ItemStateCollection @@ -47,10 +53,12 @@ final class StagedOrderImportCustomLineItemStateActionModel extends JsonObjectMo */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?ItemStateCollection $state = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->state = $state; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -74,7 +82,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -93,6 +101,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

New status of the Custom Line Items.

* @@ -122,6 +150,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?ItemStateCollection $state */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php index a0c2497749e..57608fecad9 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateAction.php @@ -17,19 +17,28 @@ interface StagedOrderTransitionCustomLineItemStateAction extends StagedOrderUpdateAction { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_FROM_STATE = 'fromState'; public const FIELD_TO_STATE = 'toState'; public const FIELD_ACTUAL_TRANSITION_DATE = 'actualTransitionDate'; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string */ public function getCustomLineItemId(); + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey(); + /** *

Number of Custom Line Items that should transition State.

* @@ -67,6 +76,11 @@ public function getActualTransitionDate(); */ public function setCustomLineItemId(?string $customLineItemId): void; + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php index f00d3ab8897..63884626338 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionBuilder.php @@ -31,6 +31,12 @@ final class StagedOrderTransitionCustomLineItemStateActionBuilder implements Bui */ private $customLineItemId; + /** + + * @var ?string + */ + private $customLineItemKey; + /** * @var ?int @@ -56,7 +62,7 @@ final class StagedOrderTransitionCustomLineItemStateActionBuilder implements Bui private $actualTransitionDate; /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * @return null|string @@ -66,6 +72,17 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + + * @return null|string + */ + public function getCustomLineItemKey() + { + return $this->customLineItemKey; + } + /** *

Number of Custom Line Items that should transition State.

* @@ -121,6 +138,17 @@ public function withCustomLineItemId(?string $customLineItemId) return $this; } + /** + * @param ?string $customLineItemKey + * @return $this + */ + public function withCustomLineItemKey(?string $customLineItemKey) + { + $this->customLineItemKey = $customLineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -191,6 +219,7 @@ public function build(): StagedOrderTransitionCustomLineItemStateAction { return new StagedOrderTransitionCustomLineItemStateActionModel( $this->customLineItemId, + $this->customLineItemKey, $this->quantity, $this->fromState instanceof StateResourceIdentifierBuilder ? $this->fromState->build() : $this->fromState, $this->toState instanceof StateResourceIdentifierBuilder ? $this->toState->build() : $this->toState, diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php index 0f93e81e78a..d50568489cd 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderTransitionCustomLineItemStateActionModel.php @@ -37,6 +37,12 @@ final class StagedOrderTransitionCustomLineItemStateActionModel extends JsonObje */ protected $customLineItemId; + /** + * + * @var ?string + */ + protected $customLineItemKey; + /** * * @var ?int @@ -67,6 +73,7 @@ final class StagedOrderTransitionCustomLineItemStateActionModel extends JsonObje */ public function __construct( ?string $customLineItemId = null, + ?string $customLineItemKey = null, ?int $quantity = null, ?StateResourceIdentifier $fromState = null, ?StateResourceIdentifier $toState = null, @@ -74,6 +81,7 @@ public function __construct( ?string $action = null ) { $this->customLineItemId = $customLineItemId; + $this->customLineItemKey = $customLineItemKey; $this->quantity = $quantity; $this->fromState = $fromState; $this->toState = $toState; @@ -100,7 +108,7 @@ public function getAction() } /** - *

id of the CustomLineItem to update.

+ *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* * * @return null|string @@ -119,6 +127,26 @@ public function getCustomLineItemId() return $this->customLineItemId; } + /** + *

key of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

+ * + * + * @return null|string + */ + public function getCustomLineItemKey() + { + if (is_null($this->customLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CUSTOM_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->customLineItemKey = (string) $data; + } + + return $this->customLineItemKey; + } + /** *

Number of Custom Line Items that should transition State.

* @@ -214,6 +242,14 @@ public function setCustomLineItemId(?string $customLineItemId): void $this->customLineItemId = $customLineItemId; } + /** + * @param ?string $customLineItemKey + */ + public function setCustomLineItemKey(?string $customLineItemKey): void + { + $this->customLineItemKey = $customLineItemKey; + } + /** * @param ?int $quantity */ diff --git a/references.txt b/references.txt index ff35bd518e2..694e994fdc2 100644 --- a/references.txt +++ b/references.txt @@ -81,3 +81,4 @@ b07e7ba714fd02e261dac1818a92f4b434ffb62b c9260db322647c370b40e1883a503f6a0aec131d 03d2ea8ce027fa53701a10fbfb27e4e9626ae223 7ca1a57b89f7abd9deecf8bf3e236b9a8109ecb4 +fc8383e5c0bead4d9aba4d3724ba28c1010ac325 From c8dcfb20273db275dd4d2ca1bad095821e0ed3bb Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 25 Jul 2023 13:54:37 +0000 Subject: [PATCH 21/44] TASK: Updating SDK --- changes.md | 2 + ...rceByProjectKeyMeQuoteRequestsByIDTest.php | 198 +++++++++--------- ...yProjectKeyMeQuoteRequestsKeyByKeyTest.php | 198 +++++++++--------- lib/commercetools-api/docs/RequestBuilder.md | 24 +-- ...esourceByProjectKeyMeQuoteRequestsByID.php | 16 +- ...rceByProjectKeyMeQuoteRequestsKeyByKey.php | 16 +- references.txt | 1 + 7 files changed, 229 insertions(+), 226 deletions(-) diff --git a/changes.md b/changes.md index 22033a85819..156c2047459 100644 --- a/changes.md +++ b/changes.md @@ -87,6 +87,7 @@ - changed property `customLineItemId` of type `CartSetCustomLineItemShippingDetailsAction` to be optional - changed property `customLineItemId` of type `CartSetCustomLineItemTaxAmountAction` to be optional - changed property `customLineItemId` of type `CartSetCustomLineItemTaxRateAction` to be optional +- changed property `comment` of type `MyQuoteRequestDraft` to be optional - changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemMoneyAction` to be optional - changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemQuantityAction` to be optional - changed property `customLineItemId` of type `StagedOrderImportCustomLineItemStateAction` to be optional @@ -107,6 +108,7 @@ - changed property `customLineItemId` of type `OrderSetCustomLineItemShippingDetailsAction` to be optional - changed property `customLineItemId` of type `OrderTransitionCustomLineItemStateAction` to be optional - changed property `lineItemId` of type `OrderTransitionLineItemStateAction` to be optional +- changed property `comment` of type `QuoteRequestDraft` to be optional - :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required - :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required - :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuoteRequestsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuoteRequestsByIDTest.php index c7333058369..c7c0acef42c 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuoteRequestsByIDTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuoteRequestsByIDTest.php @@ -21,9 +21,9 @@ use Psr\Http\Message\RequestInterface; /** + * @covers \Commercetools\Api\Client\Resource\ByProjectKeyMeQuoteRequestsByIDGet * @covers \Commercetools\Api\Client\Resource\ByProjectKeyMeQuoteRequestsByIDPost * @covers \Commercetools\Api\Client\Resource\ByProjectKeyMeQuoteRequestsByIDDelete - * @covers \Commercetools\Api\Client\Resource\ByProjectKeyMeQuoteRequestsByIDGet * @covers \Commercetools\Api\Client\Resource\ResourceByProjectKeyMeQuoteRequestsByID */ class ResourceByProjectKeyMeQuoteRequestsByIDTest extends TestCase @@ -92,6 +92,31 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ + 'ByProjectKeyMeQuoteRequestsByIDGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quoteRequests() + ->withId('test_ID') + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/me/quote-requests/test_ID?expand=expand', + ], + 'ByProjectKeyMeQuoteRequestsByIDGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->quoteRequests() + ->withId("test_ID") + ->get(); + }, + 'get', + 'test_projectKey/me/quote-requests/test_ID', + ], 'ByProjectKeyMeQuoteRequestsByIDPost_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -154,31 +179,6 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 'delete', 'test_projectKey/me/quote-requests/test_ID', - ], - 'ByProjectKeyMeQuoteRequestsByIDGet_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->me() - ->quoteRequests() - ->withId('test_ID') - ->get() - ->withExpand('expand'); - }, - 'get', - 'test_projectKey/me/quote-requests/test_ID?expand=expand', - ], - 'ByProjectKeyMeQuoteRequestsByIDGet' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("test_projectKey") - ->me() - ->quoteRequests() - ->withId("test_ID") - ->get(); - }, - 'get', - 'test_projectKey/me/quote-requests/test_ID', ] ]; } @@ -192,34 +192,34 @@ public function getResources() public function getRequestBuilders() { return [ - 'ByProjectKeyMeQuoteRequestsByIDPost' => [ + 'ByProjectKeyMeQuoteRequestsByIDGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); } ], - 'ByProjectKeyMeQuoteRequestsByIDDelete' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); } ], - 'ByProjectKeyMeQuoteRequestsByIDGet' => [ + 'ByProjectKeyMeQuoteRequestsByIDDelete' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); } ] ]; @@ -228,322 +228,322 @@ function (ApiRequestBuilder $builder): RequestInterface { public function getRequestBuilderResponses() { return [ - 'ByProjectKeyMeQuoteRequestsByIDPost_200' => [ + 'ByProjectKeyMeQuoteRequestsByIDGet_200' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); }, 200 ], - 'ByProjectKeyMeQuoteRequestsByIDPost_409' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->quoteRequests() - ->withId("ID") - ->post(null); - }, - 409 - ], - 'ByProjectKeyMeQuoteRequestsByIDPost_400' => [ + 'ByProjectKeyMeQuoteRequestsByIDGet_400' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); }, 400 ], - 'ByProjectKeyMeQuoteRequestsByIDPost_401' => [ + 'ByProjectKeyMeQuoteRequestsByIDGet_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); }, 401 ], - 'ByProjectKeyMeQuoteRequestsByIDPost_403' => [ + 'ByProjectKeyMeQuoteRequestsByIDGet_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); }, 403 ], - 'ByProjectKeyMeQuoteRequestsByIDPost_404' => [ + 'ByProjectKeyMeQuoteRequestsByIDGet_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); }, 404 ], - 'ByProjectKeyMeQuoteRequestsByIDPost_500' => [ + 'ByProjectKeyMeQuoteRequestsByIDGet_500' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); }, 500 ], - 'ByProjectKeyMeQuoteRequestsByIDPost_502' => [ + 'ByProjectKeyMeQuoteRequestsByIDGet_502' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); }, 502 ], - 'ByProjectKeyMeQuoteRequestsByIDPost_503' => [ + 'ByProjectKeyMeQuoteRequestsByIDGet_503' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); }, 503 ], - 'ByProjectKeyMeQuoteRequestsByIDPost_599' => [ + 'ByProjectKeyMeQuoteRequestsByIDGet_599' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); }, 599 ], - 'ByProjectKeyMeQuoteRequestsByIDDelete_200' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost_200' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); }, 200 ], - 'ByProjectKeyMeQuoteRequestsByIDDelete_409' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost_409' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); }, 409 ], - 'ByProjectKeyMeQuoteRequestsByIDDelete_400' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost_400' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); }, 400 ], - 'ByProjectKeyMeQuoteRequestsByIDDelete_401' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); }, 401 ], - 'ByProjectKeyMeQuoteRequestsByIDDelete_403' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); }, 403 ], - 'ByProjectKeyMeQuoteRequestsByIDDelete_404' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); }, 404 ], - 'ByProjectKeyMeQuoteRequestsByIDDelete_500' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost_500' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); }, 500 ], - 'ByProjectKeyMeQuoteRequestsByIDDelete_502' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost_502' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); }, 502 ], - 'ByProjectKeyMeQuoteRequestsByIDDelete_503' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost_503' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); }, 503 ], - 'ByProjectKeyMeQuoteRequestsByIDDelete_599' => [ + 'ByProjectKeyMeQuoteRequestsByIDPost_599' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); }, 599 ], - 'ByProjectKeyMeQuoteRequestsByIDGet_200' => [ + 'ByProjectKeyMeQuoteRequestsByIDDelete_200' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); }, 200 ], - 'ByProjectKeyMeQuoteRequestsByIDGet_400' => [ + 'ByProjectKeyMeQuoteRequestsByIDDelete_409' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); + }, + 409 + ], + 'ByProjectKeyMeQuoteRequestsByIDDelete_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quoteRequests() + ->withId("ID") + ->delete(); }, 400 ], - 'ByProjectKeyMeQuoteRequestsByIDGet_401' => [ + 'ByProjectKeyMeQuoteRequestsByIDDelete_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); }, 401 ], - 'ByProjectKeyMeQuoteRequestsByIDGet_403' => [ + 'ByProjectKeyMeQuoteRequestsByIDDelete_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); }, 403 ], - 'ByProjectKeyMeQuoteRequestsByIDGet_404' => [ + 'ByProjectKeyMeQuoteRequestsByIDDelete_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); }, 404 ], - 'ByProjectKeyMeQuoteRequestsByIDGet_500' => [ + 'ByProjectKeyMeQuoteRequestsByIDDelete_500' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); }, 500 ], - 'ByProjectKeyMeQuoteRequestsByIDGet_502' => [ + 'ByProjectKeyMeQuoteRequestsByIDDelete_502' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); }, 502 ], - 'ByProjectKeyMeQuoteRequestsByIDGet_503' => [ + 'ByProjectKeyMeQuoteRequestsByIDDelete_503' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); }, 503 ], - 'ByProjectKeyMeQuoteRequestsByIDGet_599' => [ + 'ByProjectKeyMeQuoteRequestsByIDDelete_599' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); }, 599 ] diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuoteRequestsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuoteRequestsKeyByKeyTest.php index d10ccf3bad7..dfaefad7014 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuoteRequestsKeyByKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMeQuoteRequestsKeyByKeyTest.php @@ -21,9 +21,9 @@ use Psr\Http\Message\RequestInterface; /** + * @covers \Commercetools\Api\Client\Resource\ByProjectKeyMeQuoteRequestsKeyByKeyGet * @covers \Commercetools\Api\Client\Resource\ByProjectKeyMeQuoteRequestsKeyByKeyPost * @covers \Commercetools\Api\Client\Resource\ByProjectKeyMeQuoteRequestsKeyByKeyDelete - * @covers \Commercetools\Api\Client\Resource\ByProjectKeyMeQuoteRequestsKeyByKeyGet * @covers \Commercetools\Api\Client\Resource\ResourceByProjectKeyMeQuoteRequestsKeyByKey */ class ResourceByProjectKeyMeQuoteRequestsKeyByKeyTest extends TestCase @@ -92,6 +92,31 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_withExpand' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey('test_projectKey') + ->me() + ->quoteRequests() + ->withKey('test_key') + ->get() + ->withExpand('expand'); + }, + 'get', + 'test_projectKey/me/quote-requests/key=test_key?expand=expand', + ], + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("test_projectKey") + ->me() + ->quoteRequests() + ->withKey("test_key") + ->get(); + }, + 'get', + 'test_projectKey/me/quote-requests/key=test_key', + ], 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_withExpand' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -154,31 +179,6 @@ function (ApiRequestBuilder $builder): RequestInterface { }, 'delete', 'test_projectKey/me/quote-requests/key=test_key', - ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->me() - ->quoteRequests() - ->withKey('test_key') - ->get() - ->withExpand('expand'); - }, - 'get', - 'test_projectKey/me/quote-requests/key=test_key?expand=expand', - ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("test_projectKey") - ->me() - ->quoteRequests() - ->withKey("test_key") - ->get(); - }, - 'get', - 'test_projectKey/me/quote-requests/key=test_key', ] ]; } @@ -192,34 +192,34 @@ public function getResources() public function getRequestBuilders() { return [ - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); } ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); } ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); } ] ]; @@ -228,322 +228,322 @@ function (ApiRequestBuilder $builder): RequestInterface { public function getRequestBuilderResponses() { return [ - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_200' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_200' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); }, 200 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_409' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->quoteRequests() - ->withKey("key") - ->post(null); - }, - 409 - ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_400' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_400' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); }, 400 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_401' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); }, 401 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_403' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); }, 403 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_404' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); }, 404 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_500' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_500' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); }, 500 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_502' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_502' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); }, 502 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_503' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_503' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); }, 503 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_599' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_599' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); }, 599 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_200' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_200' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); }, 200 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_409' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_409' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); }, 409 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_400' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_400' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); }, 400 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_401' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); }, 401 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_403' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); }, 403 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_404' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); }, 404 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_500' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_500' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); }, 500 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_502' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_502' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); }, 502 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_503' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_503' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); }, 503 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_599' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyPost_599' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); }, 599 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_200' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_200' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); }, 200 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_400' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_409' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); + }, + 409 + ], + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_400' => [ + function (ApiRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKey("projectKey") + ->me() + ->quoteRequests() + ->withKey("key") + ->delete(); }, 400 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_401' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_401' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); }, 401 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_403' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_403' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); }, 403 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_404' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_404' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); }, 404 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_500' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_500' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); }, 500 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_502' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_502' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); }, 502 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_503' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_503' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); }, 503 ], - 'ByProjectKeyMeQuoteRequestsKeyByKeyGet_599' => [ + 'ByProjectKeyMeQuoteRequestsKeyByKeyDelete_599' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder ->withProjectKey("projectKey") ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); }, 599 ] diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index 76dc84d4b04..f6bb8e7b633 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -4416,7 +4416,7 @@ $request = $builder ->quoteRequests() ->post(null); ``` -## `withProjectKey("projectKey")->me()->quoteRequests()->withId("ID")->post(null)` +## `withProjectKey("projectKey")->me()->quoteRequests()->withId("ID")->get()` null @@ -4430,9 +4430,9 @@ $request = $builder ->me() ->quoteRequests() ->withId("ID") - ->post(null); + ->get(); ``` -## `withProjectKey("projectKey")->me()->quoteRequests()->withId("ID")->delete()` +## `withProjectKey("projectKey")->me()->quoteRequests()->withId("ID")->post(null)` null @@ -4446,9 +4446,9 @@ $request = $builder ->me() ->quoteRequests() ->withId("ID") - ->delete(); + ->post(null); ``` -## `withProjectKey("projectKey")->me()->quoteRequests()->withId("ID")->get()` +## `withProjectKey("projectKey")->me()->quoteRequests()->withId("ID")->delete()` null @@ -4462,9 +4462,9 @@ $request = $builder ->me() ->quoteRequests() ->withId("ID") - ->get(); + ->delete(); ``` -## `withProjectKey("projectKey")->me()->quoteRequests()->withKey("key")->post(null)` +## `withProjectKey("projectKey")->me()->quoteRequests()->withKey("key")->get()` null @@ -4478,9 +4478,9 @@ $request = $builder ->me() ->quoteRequests() ->withKey("key") - ->post(null); + ->get(); ``` -## `withProjectKey("projectKey")->me()->quoteRequests()->withKey("key")->delete()` +## `withProjectKey("projectKey")->me()->quoteRequests()->withKey("key")->post(null)` null @@ -4494,9 +4494,9 @@ $request = $builder ->me() ->quoteRequests() ->withKey("key") - ->delete(); + ->post(null); ``` -## `withProjectKey("projectKey")->me()->quoteRequests()->withKey("key")->get()` +## `withProjectKey("projectKey")->me()->quoteRequests()->withKey("key")->delete()` null @@ -4510,7 +4510,7 @@ $request = $builder ->me() ->quoteRequests() ->withKey("key") - ->get(); + ->delete(); ``` ## `withProjectKey("projectKey")->me()->quotes()->get()` diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuoteRequestsByID.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuoteRequestsByID.php index b71baf204dd..b65faf60414 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuoteRequestsByID.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuoteRequestsByID.php @@ -27,33 +27,33 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** - * @psalm-param ?MyQuoteRequestUpdate $body + * @psalm-param ?object|array|string $body * @psalm-param array $headers */ - public function post(?MyQuoteRequestUpdate $body = null, array $headers = []): ByProjectKeyMeQuoteRequestsByIDPost + public function get($body = null, array $headers = []): ByProjectKeyMeQuoteRequestsByIDGet { $args = $this->getArgs(); - return new ByProjectKeyMeQuoteRequestsByIDPost($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + return new ByProjectKeyMeQuoteRequestsByIDGet($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); } /** - * @psalm-param ?object|array|string $body + * @psalm-param ?MyQuoteRequestUpdate $body * @psalm-param array $headers */ - public function delete($body = null, array $headers = []): ByProjectKeyMeQuoteRequestsByIDDelete + public function post(?MyQuoteRequestUpdate $body = null, array $headers = []): ByProjectKeyMeQuoteRequestsByIDPost { $args = $this->getArgs(); - return new ByProjectKeyMeQuoteRequestsByIDDelete($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + return new ByProjectKeyMeQuoteRequestsByIDPost($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); } /** * @psalm-param ?object|array|string $body * @psalm-param array $headers */ - public function get($body = null, array $headers = []): ByProjectKeyMeQuoteRequestsByIDGet + public function delete($body = null, array $headers = []): ByProjectKeyMeQuoteRequestsByIDDelete { $args = $this->getArgs(); - return new ByProjectKeyMeQuoteRequestsByIDGet($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); + return new ByProjectKeyMeQuoteRequestsByIDDelete($args['projectKey'], $args['ID'], $body, $headers, $this->getClient()); } } diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuoteRequestsKeyByKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuoteRequestsKeyByKey.php index 09e2585d05f..be8487c29bd 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuoteRequestsKeyByKey.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMeQuoteRequestsKeyByKey.php @@ -27,33 +27,33 @@ public function __construct(array $args = [], ClientInterface $client = null) } /** - * @psalm-param ?MyQuoteRequestUpdate $body + * @psalm-param ?object|array|string $body * @psalm-param array $headers */ - public function post(?MyQuoteRequestUpdate $body = null, array $headers = []): ByProjectKeyMeQuoteRequestsKeyByKeyPost + public function get($body = null, array $headers = []): ByProjectKeyMeQuoteRequestsKeyByKeyGet { $args = $this->getArgs(); - return new ByProjectKeyMeQuoteRequestsKeyByKeyPost($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + return new ByProjectKeyMeQuoteRequestsKeyByKeyGet($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); } /** - * @psalm-param ?object|array|string $body + * @psalm-param ?MyQuoteRequestUpdate $body * @psalm-param array $headers */ - public function delete($body = null, array $headers = []): ByProjectKeyMeQuoteRequestsKeyByKeyDelete + public function post(?MyQuoteRequestUpdate $body = null, array $headers = []): ByProjectKeyMeQuoteRequestsKeyByKeyPost { $args = $this->getArgs(); - return new ByProjectKeyMeQuoteRequestsKeyByKeyDelete($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + return new ByProjectKeyMeQuoteRequestsKeyByKeyPost($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); } /** * @psalm-param ?object|array|string $body * @psalm-param array $headers */ - public function get($body = null, array $headers = []): ByProjectKeyMeQuoteRequestsKeyByKeyGet + public function delete($body = null, array $headers = []): ByProjectKeyMeQuoteRequestsKeyByKeyDelete { $args = $this->getArgs(); - return new ByProjectKeyMeQuoteRequestsKeyByKeyGet($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); + return new ByProjectKeyMeQuoteRequestsKeyByKeyDelete($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); } } diff --git a/references.txt b/references.txt index 694e994fdc2..ac3b8331676 100644 --- a/references.txt +++ b/references.txt @@ -82,3 +82,4 @@ c9260db322647c370b40e1883a503f6a0aec131d 03d2ea8ce027fa53701a10fbfb27e4e9626ae223 7ca1a57b89f7abd9deecf8bf3e236b9a8109ecb4 fc8383e5c0bead4d9aba4d3724ba28c1010ac325 +90abb1a51e55b9796ee3e9d7a0eb232a9f87960d From 1762b039f8645ef875ea9c3dba04264a879725d1 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Thu, 27 Jul 2023 13:32:38 +0000 Subject: [PATCH 22/44] TASK: Updating SDK --- references.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/references.txt b/references.txt index ac3b8331676..6455433f14d 100644 --- a/references.txt +++ b/references.txt @@ -83,3 +83,4 @@ c9260db322647c370b40e1883a503f6a0aec131d 7ca1a57b89f7abd9deecf8bf3e236b9a8109ecb4 fc8383e5c0bead4d9aba4d3724ba28c1010ac325 90abb1a51e55b9796ee3e9d7a0eb232a9f87960d +9ef269836540faeef9a7b3afb0e39fdfc28f1724 From 332975f857710bc18f6646ecffdac580dd8933b1 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 28 Jul 2023 08:09:56 +0000 Subject: [PATCH 23/44] TASK: Updating SDK --- references.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/references.txt b/references.txt index 6455433f14d..d02c3c5ff65 100644 --- a/references.txt +++ b/references.txt @@ -84,3 +84,4 @@ c9260db322647c370b40e1883a503f6a0aec131d fc8383e5c0bead4d9aba4d3724ba28c1010ac325 90abb1a51e55b9796ee3e9d7a0eb232a9f87960d 9ef269836540faeef9a7b3afb0e39fdfc28f1724 +636e68b1749e566a3d98552cdc8a006dc5591e89 From ee7696edc164854482b2d83416de95a9163ce1cd Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 28 Jul 2023 09:25:32 +0000 Subject: [PATCH 24/44] TASK: Updating SDK --- references.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/references.txt b/references.txt index d02c3c5ff65..537b82ca2f2 100644 --- a/references.txt +++ b/references.txt @@ -85,3 +85,4 @@ fc8383e5c0bead4d9aba4d3724ba28c1010ac325 90abb1a51e55b9796ee3e9d7a0eb232a9f87960d 9ef269836540faeef9a7b3afb0e39fdfc28f1724 636e68b1749e566a3d98552cdc8a006dc5591e89 +f15664352ad27ec193e2ca1140e7dbeae4fa3167 From 59edd3874fd7b9e1d6bb27a950c091d01522ac7f Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 28 Jul 2023 14:23:23 +0000 Subject: [PATCH 25/44] TASK: Updating SDK --- references.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/references.txt b/references.txt index 537b82ca2f2..318e1f59069 100644 --- a/references.txt +++ b/references.txt @@ -86,3 +86,4 @@ fc8383e5c0bead4d9aba4d3724ba28c1010ac325 9ef269836540faeef9a7b3afb0e39fdfc28f1724 636e68b1749e566a3d98552cdc8a006dc5591e89 f15664352ad27ec193e2ca1140e7dbeae4fa3167 +42b64a42df6aa9c806903287bed0674c134113b1 From bb60d53be215ca094e5824c62a6acad4a07b0763 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 28 Jul 2023 15:15:31 +0000 Subject: [PATCH 26/44] TASK: Updating SDK --- changes.md | 4 ++ .../src/Models/Common/BaseResource.php | 2 +- .../src/Models/Common/BaseResourceBuilder.php | 4 +- .../src/Models/Common/BaseResourceModel.php | 4 +- ...p => BusinessUnitParentChangedMessage.php} | 2 +- ...sinessUnitParentChangedMessageBuilder.php} | 10 ++-- ...nessUnitParentChangedMessageCollection.php | 56 +++++++++++++++++++ ...BusinessUnitParentChangedMessageModel.php} | 4 +- ...sinessUnitParentChangedMessagePayload.php} | 2 +- ...nitParentChangedMessagePayloadBuilder.php} | 10 ++-- ...tParentChangedMessagePayloadCollection.php | 56 +++++++++++++++++++ ...sUnitParentChangedMessagePayloadModel.php} | 4 +- ...UnitParentUnitChangedMessageCollection.php | 56 ------------------- ...entUnitChangedMessagePayloadCollection.php | 56 ------------------- .../src/Models/Message/MessageModel.php | 2 +- .../Models/Message/MessagePayloadModel.php | 2 +- references.txt | 1 + 17 files changed, 140 insertions(+), 135 deletions(-) rename lib/commercetools-api/src/Models/Message/{BusinessUnitParentUnitChangedMessage.php => BusinessUnitParentChangedMessage.php} (95%) rename lib/commercetools-api/src/Models/Message/{BusinessUnitParentUnitChangedMessageBuilder.php => BusinessUnitParentChangedMessageBuilder.php} (97%) create mode 100644 lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessageCollection.php rename lib/commercetools-api/src/Models/Message/{BusinessUnitParentUnitChangedMessageModel.php => BusinessUnitParentChangedMessageModel.php} (98%) rename lib/commercetools-api/src/Models/Message/{BusinessUnitParentUnitChangedMessagePayload.php => BusinessUnitParentChangedMessagePayload.php} (94%) rename lib/commercetools-api/src/Models/Message/{BusinessUnitParentUnitChangedMessagePayloadBuilder.php => BusinessUnitParentChangedMessagePayloadBuilder.php} (88%) create mode 100644 lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayloadCollection.php rename lib/commercetools-api/src/Models/Message/{BusinessUnitParentUnitChangedMessagePayloadModel.php => BusinessUnitParentChangedMessagePayloadModel.php} (94%) delete mode 100644 lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageCollection.php delete mode 100644 lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadCollection.php diff --git a/changes.md b/changes.md index 156c2047459..bc2f3f53c01 100644 --- a/changes.md +++ b/changes.md @@ -143,6 +143,8 @@ - :warning: removed type `CartSetDeliveryAddressCustomFieldAction` - :warning: removed type `CartSetDeliveryAddressCustomTypeAction` +- :warning: removed type `BusinessUnitParentUnitChangedMessage` +- :warning: removed type `BusinessUnitParentUnitChangedMessagePayload` - :warning: removed type `OrderResourceIdentifier` @@ -159,6 +161,8 @@ - added type `GraphQLMaxCartDiscountsReachedError` - added type `GraphQLMaxStoreReferencesReachedError` - added type `GraphQLStoreCartDiscountsLimitReachedError` +- added type `BusinessUnitParentChangedMessage` +- added type `BusinessUnitParentChangedMessagePayload` - added type `StagedOrderSetDirectDiscountsAction` - added type `StagedOrderSetStoreAction` diff --git a/lib/commercetools-api/src/Models/Common/BaseResource.php b/lib/commercetools-api/src/Models/Common/BaseResource.php index 3cb695f5bc4..884a6d7db35 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResource.php +++ b/lib/commercetools-api/src/Models/Common/BaseResource.php @@ -46,7 +46,7 @@ use Commercetools\Api\Models\Message\BusinessUnitDefaultShippingAddressSetMessage; use Commercetools\Api\Models\Message\BusinessUnitDeletedMessage; use Commercetools\Api\Models\Message\BusinessUnitNameChangedMessage; -use Commercetools\Api\Models\Message\BusinessUnitParentUnitChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitParentChangedMessage; use Commercetools\Api\Models\Message\BusinessUnitShippingAddressAddedMessage; use Commercetools\Api\Models\Message\BusinessUnitShippingAddressRemovedMessage; use Commercetools\Api\Models\Message\BusinessUnitStatusChangedMessage; diff --git a/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php b/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php index d9df40cfd8e..674652a3149 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php @@ -84,8 +84,8 @@ use Commercetools\Api\Models\Message\BusinessUnitDeletedMessageBuilder; use Commercetools\Api\Models\Message\BusinessUnitNameChangedMessage; use Commercetools\Api\Models\Message\BusinessUnitNameChangedMessageBuilder; -use Commercetools\Api\Models\Message\BusinessUnitParentUnitChangedMessage; -use Commercetools\Api\Models\Message\BusinessUnitParentUnitChangedMessageBuilder; +use Commercetools\Api\Models\Message\BusinessUnitParentChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitParentChangedMessageBuilder; use Commercetools\Api\Models\Message\BusinessUnitShippingAddressAddedMessage; use Commercetools\Api\Models\Message\BusinessUnitShippingAddressAddedMessageBuilder; use Commercetools\Api\Models\Message\BusinessUnitShippingAddressRemovedMessage; diff --git a/lib/commercetools-api/src/Models/Common/BaseResourceModel.php b/lib/commercetools-api/src/Models/Common/BaseResourceModel.php index 3e46d5d6613..97588a2251a 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResourceModel.php +++ b/lib/commercetools-api/src/Models/Common/BaseResourceModel.php @@ -84,8 +84,8 @@ use Commercetools\Api\Models\Message\BusinessUnitDeletedMessageModel; use Commercetools\Api\Models\Message\BusinessUnitNameChangedMessage; use Commercetools\Api\Models\Message\BusinessUnitNameChangedMessageModel; -use Commercetools\Api\Models\Message\BusinessUnitParentUnitChangedMessage; -use Commercetools\Api\Models\Message\BusinessUnitParentUnitChangedMessageModel; +use Commercetools\Api\Models\Message\BusinessUnitParentChangedMessage; +use Commercetools\Api\Models\Message\BusinessUnitParentChangedMessageModel; use Commercetools\Api\Models\Message\BusinessUnitShippingAddressAddedMessage; use Commercetools\Api\Models\Message\BusinessUnitShippingAddressAddedMessageModel; use Commercetools\Api\Models\Message\BusinessUnitShippingAddressRemovedMessage; diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessage.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessage.php similarity index 95% rename from lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessage.php rename to lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessage.php index 96b403e84bf..4deb3d97645 100644 --- a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessage.php +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessage.php @@ -12,7 +12,7 @@ use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; -interface BusinessUnitParentUnitChangedMessage extends Message +interface BusinessUnitParentChangedMessage extends Message { public const FIELD_OLD_PARENT_UNIT = 'oldParentUnit'; public const FIELD_NEW_PARENT_UNIT = 'newParentUnit'; diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessageBuilder.php similarity index 97% rename from lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageBuilder.php rename to lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessageBuilder.php index 7fccd063742..32073d5ba2a 100644 --- a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessageBuilder.php @@ -25,9 +25,9 @@ use stdClass; /** - * @implements Builder + * @implements Builder */ -final class BusinessUnitParentUnitChangedMessageBuilder implements Builder +final class BusinessUnitParentChangedMessageBuilder implements Builder { /** @@ -432,9 +432,9 @@ public function withNewParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $newPa return $this; } - public function build(): BusinessUnitParentUnitChangedMessage + public function build(): BusinessUnitParentChangedMessage { - return new BusinessUnitParentUnitChangedMessageModel( + return new BusinessUnitParentChangedMessageModel( $this->id, $this->version, $this->createdAt, @@ -450,7 +450,7 @@ public function build(): BusinessUnitParentUnitChangedMessage ); } - public static function of(): BusinessUnitParentUnitChangedMessageBuilder + public static function of(): BusinessUnitParentChangedMessageBuilder { return new self(); } diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessageCollection.php new file mode 100644 index 00000000000..86ef8ecf413 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitParentChangedMessage current() + * @method BusinessUnitParentChangedMessage end() + * @method BusinessUnitParentChangedMessage at($offset) + */ +class BusinessUnitParentChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert BusinessUnitParentChangedMessage $value + * @psalm-param BusinessUnitParentChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitParentChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitParentChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitParentChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitParentChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitParentChangedMessage $data */ + $data = BusinessUnitParentChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessageModel.php similarity index 98% rename from lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageModel.php rename to lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessageModel.php index 954c92a02ee..7196a0a0ba8 100644 --- a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessageModel.php @@ -26,9 +26,9 @@ /** * @internal */ -final class BusinessUnitParentUnitChangedMessageModel extends JsonObjectModel implements BusinessUnitParentUnitChangedMessage +final class BusinessUnitParentChangedMessageModel extends JsonObjectModel implements BusinessUnitParentChangedMessage { - public const DISCRIMINATOR_VALUE = 'BusinessUnitParentUnitChanged'; + public const DISCRIMINATOR_VALUE = 'BusinessUnitParentChanged'; /** * * @var ?string diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayload.php similarity index 94% rename from lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayload.php rename to lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayload.php index 2b506e66f3a..60484d7b58b 100644 --- a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayload.php @@ -12,7 +12,7 @@ use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; -interface BusinessUnitParentUnitChangedMessagePayload extends MessagePayload +interface BusinessUnitParentChangedMessagePayload extends MessagePayload { public const FIELD_OLD_PARENT_UNIT = 'oldParentUnit'; public const FIELD_NEW_PARENT_UNIT = 'newParentUnit'; diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayloadBuilder.php similarity index 88% rename from lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadBuilder.php rename to lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayloadBuilder.php index 98c2694666a..32d77def5e3 100644 --- a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayloadBuilder.php @@ -18,9 +18,9 @@ use stdClass; /** - * @implements Builder + * @implements Builder */ -final class BusinessUnitParentUnitChangedMessagePayloadBuilder implements Builder +final class BusinessUnitParentChangedMessagePayloadBuilder implements Builder { /** @@ -100,15 +100,15 @@ public function withNewParentUnitBuilder(?BusinessUnitKeyReferenceBuilder $newPa return $this; } - public function build(): BusinessUnitParentUnitChangedMessagePayload + public function build(): BusinessUnitParentChangedMessagePayload { - return new BusinessUnitParentUnitChangedMessagePayloadModel( + return new BusinessUnitParentChangedMessagePayloadModel( $this->oldParentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->oldParentUnit->build() : $this->oldParentUnit, $this->newParentUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->newParentUnit->build() : $this->newParentUnit ); } - public static function of(): BusinessUnitParentUnitChangedMessagePayloadBuilder + public static function of(): BusinessUnitParentChangedMessagePayloadBuilder { return new self(); } diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..1f871cec928 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method BusinessUnitParentChangedMessagePayload current() + * @method BusinessUnitParentChangedMessagePayload end() + * @method BusinessUnitParentChangedMessagePayload at($offset) + */ +class BusinessUnitParentChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert BusinessUnitParentChangedMessagePayload $value + * @psalm-param BusinessUnitParentChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return BusinessUnitParentChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof BusinessUnitParentChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?BusinessUnitParentChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?BusinessUnitParentChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var BusinessUnitParentChangedMessagePayload $data */ + $data = BusinessUnitParentChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayloadModel.php similarity index 94% rename from lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadModel.php rename to lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayloadModel.php index 5310c3b11cd..de6590d66d9 100644 --- a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/BusinessUnitParentChangedMessagePayloadModel.php @@ -19,9 +19,9 @@ /** * @internal */ -final class BusinessUnitParentUnitChangedMessagePayloadModel extends JsonObjectModel implements BusinessUnitParentUnitChangedMessagePayload +final class BusinessUnitParentChangedMessagePayloadModel extends JsonObjectModel implements BusinessUnitParentChangedMessagePayload { - public const DISCRIMINATOR_VALUE = 'BusinessUnitParentUnitChanged'; + public const DISCRIMINATOR_VALUE = 'BusinessUnitParentChanged'; /** * * @var ?string diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageCollection.php deleted file mode 100644 index 14422e36f2b..00000000000 --- a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessageCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method BusinessUnitParentUnitChangedMessage current() - * @method BusinessUnitParentUnitChangedMessage end() - * @method BusinessUnitParentUnitChangedMessage at($offset) - */ -class BusinessUnitParentUnitChangedMessageCollection extends MessageCollection -{ - /** - * @psalm-assert BusinessUnitParentUnitChangedMessage $value - * @psalm-param BusinessUnitParentUnitChangedMessage|stdClass $value - * @throws InvalidArgumentException - * - * @return BusinessUnitParentUnitChangedMessageCollection - */ - public function add($value) - { - if (!$value instanceof BusinessUnitParentUnitChangedMessage) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?BusinessUnitParentUnitChangedMessage - */ - protected function mapper() - { - return function (?int $index): ?BusinessUnitParentUnitChangedMessage { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var BusinessUnitParentUnitChangedMessage $data */ - $data = BusinessUnitParentUnitChangedMessageModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadCollection.php deleted file mode 100644 index 8400d879de3..00000000000 --- a/lib/commercetools-api/src/Models/Message/BusinessUnitParentUnitChangedMessagePayloadCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method BusinessUnitParentUnitChangedMessagePayload current() - * @method BusinessUnitParentUnitChangedMessagePayload end() - * @method BusinessUnitParentUnitChangedMessagePayload at($offset) - */ -class BusinessUnitParentUnitChangedMessagePayloadCollection extends MessagePayloadCollection -{ - /** - * @psalm-assert BusinessUnitParentUnitChangedMessagePayload $value - * @psalm-param BusinessUnitParentUnitChangedMessagePayload|stdClass $value - * @throws InvalidArgumentException - * - * @return BusinessUnitParentUnitChangedMessagePayloadCollection - */ - public function add($value) - { - if (!$value instanceof BusinessUnitParentUnitChangedMessagePayload) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?BusinessUnitParentUnitChangedMessagePayload - */ - protected function mapper() - { - return function (?int $index): ?BusinessUnitParentUnitChangedMessagePayload { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var BusinessUnitParentUnitChangedMessagePayload $data */ - $data = BusinessUnitParentUnitChangedMessagePayloadModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/Message/MessageModel.php b/lib/commercetools-api/src/Models/Message/MessageModel.php index 536849c2d5a..30a338b015d 100644 --- a/lib/commercetools-api/src/Models/Message/MessageModel.php +++ b/lib/commercetools-api/src/Models/Message/MessageModel.php @@ -123,7 +123,7 @@ final class MessageModel extends JsonObjectModel implements Message 'BusinessUnitDefaultShippingAddressSet' => BusinessUnitDefaultShippingAddressSetMessageModel::class, 'BusinessUnitDeleted' => BusinessUnitDeletedMessageModel::class, 'BusinessUnitNameChanged' => BusinessUnitNameChangedMessageModel::class, - 'BusinessUnitParentUnitChanged' => BusinessUnitParentUnitChangedMessageModel::class, + 'BusinessUnitParentChanged' => BusinessUnitParentChangedMessageModel::class, 'BusinessUnitShippingAddressAdded' => BusinessUnitShippingAddressAddedMessageModel::class, 'BusinessUnitShippingAddressRemoved' => BusinessUnitShippingAddressRemovedMessageModel::class, 'BusinessUnitStatusChanged' => BusinessUnitStatusChangedMessageModel::class, diff --git a/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php index ec148ecfd99..893b547045d 100644 --- a/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php @@ -54,7 +54,7 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa 'BusinessUnitDefaultShippingAddressSet' => BusinessUnitDefaultShippingAddressSetMessagePayloadModel::class, 'BusinessUnitDeleted' => BusinessUnitDeletedMessagePayloadModel::class, 'BusinessUnitNameChanged' => BusinessUnitNameChangedMessagePayloadModel::class, - 'BusinessUnitParentUnitChanged' => BusinessUnitParentUnitChangedMessagePayloadModel::class, + 'BusinessUnitParentChanged' => BusinessUnitParentChangedMessagePayloadModel::class, 'BusinessUnitShippingAddressAdded' => BusinessUnitShippingAddressAddedMessagePayloadModel::class, 'BusinessUnitShippingAddressRemoved' => BusinessUnitShippingAddressRemovedMessagePayloadModel::class, 'BusinessUnitStatusChanged' => BusinessUnitStatusChangedMessagePayloadModel::class, diff --git a/references.txt b/references.txt index 318e1f59069..7c45a479763 100644 --- a/references.txt +++ b/references.txt @@ -87,3 +87,4 @@ fc8383e5c0bead4d9aba4d3724ba28c1010ac325 636e68b1749e566a3d98552cdc8a006dc5591e89 f15664352ad27ec193e2ca1140e7dbeae4fa3167 42b64a42df6aa9c806903287bed0674c134113b1 +754ae90cfe73d7429934ccce580e799a949ed98d From bc277c477db076ffac40089a515636ad45754ae9 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 31 Jul 2023 09:06:28 +0000 Subject: [PATCH 27/44] TASK: Updating SDK --- references.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/references.txt b/references.txt index 7c45a479763..47b3fd7ef34 100644 --- a/references.txt +++ b/references.txt @@ -88,3 +88,4 @@ fc8383e5c0bead4d9aba4d3724ba28c1010ac325 f15664352ad27ec193e2ca1140e7dbeae4fa3167 42b64a42df6aa9c806903287bed0674c134113b1 754ae90cfe73d7429934ccce580e799a949ed98d +43ec24cb27d83029991ae44c2c5af31fa2e6bebc From e71bc5bb452bda9f51f695c2322f79d2ad30f754 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 31 Jul 2023 12:22:40 +0000 Subject: [PATCH 28/44] TASK: Updating SDK --- .../src/Models/Productdrafts/PriceDraftImport.php | 1 - .../src/Models/Productdrafts/PriceDraftImportBuilder.php | 1 - .../src/Models/Productdrafts/PriceDraftImportModel.php | 1 - references.txt | 1 + 4 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php index da25f63d824..7ddc78e81b6 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php +++ b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImport.php @@ -99,7 +99,6 @@ public function getTiers(); /** *

User-defined unique identifier for the Embedded Price.

- *

This field is required from 31 July 2023.

* * @return null|string diff --git a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php index e90508af135..e076c32529f 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php +++ b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportBuilder.php @@ -187,7 +187,6 @@ public function getTiers() /** *

User-defined unique identifier for the Embedded Price.

- *

This field is required from 31 July 2023.

* * @return null|string diff --git a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php index b3f247f8605..03de346ff07 100644 --- a/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php +++ b/lib/commercetools-import/src/Models/Productdrafts/PriceDraftImportModel.php @@ -308,7 +308,6 @@ public function getTiers() /** *

User-defined unique identifier for the Embedded Price.

- *

This field is required from 31 July 2023.

* * * @return null|string diff --git a/references.txt b/references.txt index 47b3fd7ef34..496aaf64664 100644 --- a/references.txt +++ b/references.txt @@ -89,3 +89,4 @@ f15664352ad27ec193e2ca1140e7dbeae4fa3167 42b64a42df6aa9c806903287bed0674c134113b1 754ae90cfe73d7429934ccce580e799a949ed98d 43ec24cb27d83029991ae44c2c5af31fa2e6bebc +b47352c3ed66fd9ad8e6b14402217fec39941d06 From ba6c264c8e0b048bb75c30de39383ed28fab426b Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 31 Jul 2023 12:36:11 +0000 Subject: [PATCH 29/44] TASK: Updating SDK --- changes.md | 4 ++++ .../CartDiscount/CartDiscountValueFixed.php | 10 +++++----- .../CartDiscountValueFixedBuilder.php | 12 ++++++------ .../CartDiscountValueFixedDraft.php | 10 +++++----- .../CartDiscountValueFixedDraftBuilder.php | 12 ++++++------ .../CartDiscountValueFixedDraftModel.php | 16 ++++++++-------- .../CartDiscountValueFixedModel.php | 16 ++++++++-------- .../Common/CentPrecisionMoneyDraftBuilder.php | 6 +----- .../Common/CentPrecisionMoneyDraftModel.php | 8 +++----- .../Models/Common/CentPrecisionMoneyModel.php | 2 +- .../Common/HighPrecisionMoneyDraftModel.php | 2 ++ .../Models/Common/HighPrecisionMoneyModel.php | 2 +- .../src/Models/Common/TypedMoney.php | 8 ++++---- .../src/Models/Common/TypedMoneyBuilder.php | 6 +++--- .../src/Models/Common/TypedMoneyDraft.php | 17 ++++++++++++++++- .../Models/Common/TypedMoneyDraftBuilder.php | 8 ++------ .../src/Models/Common/TypedMoneyDraftModel.php | 10 ++++------ .../src/Models/Common/TypedMoneyModel.php | 8 ++++---- references.txt | 1 + 19 files changed, 84 insertions(+), 74 deletions(-) diff --git a/changes.md b/changes.md index bc2f3f53c01..b7a35976586 100644 --- a/changes.md +++ b/changes.md @@ -87,6 +87,8 @@ - changed property `customLineItemId` of type `CartSetCustomLineItemShippingDetailsAction` to be optional - changed property `customLineItemId` of type `CartSetCustomLineItemTaxAmountAction` to be optional - changed property `customLineItemId` of type `CartSetCustomLineItemTaxRateAction` to be optional +- changed property `centAmount` of type `CentPrecisionMoneyDraft` to be optional +- changed property `centAmount` of type `TypedMoneyDraft` to be optional - changed property `comment` of type `MyQuoteRequestDraft` to be optional - changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemMoneyAction` to be optional - changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemQuantityAction` to be optional @@ -119,6 +121,8 @@
Changed Property(s) +- :warning: changed property `money` of type `CartDiscountValueFixed` from type `CentPrecisionMoney[]` to `TypedMoney[]` +- :warning: changed property `money` of type `CartDiscountValueFixedDraft` from type `Money[]` to `TypedMoneyDraft[]` - :warning: changed property `country` of type `StagedOrder` from type `string` to `CountryCode` - :warning: changed property `locale` of type `StagedOrder` from type `string` to `Locale` - :warning: changed property `country` of type `StagedOrderSetCountryAction` from type `string` to `CountryCode` diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixed.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixed.php index 9d32c943f65..1b7c1cfcc03 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixed.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixed.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\CartDiscount; -use Commercetools\Api\Models\Common\CentPrecisionMoneyCollection; +use Commercetools\Api\Models\Common\TypedMoneyCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -17,15 +17,15 @@ interface CartDiscountValueFixed extends CartDiscountValue public const FIELD_MONEY = 'money'; /** - *

Cent precision money values in different currencies.

+ *

Money values in cent precision or high precision of different currencies.

* - * @return null|CentPrecisionMoneyCollection + * @return null|TypedMoneyCollection */ public function getMoney(); /** - * @param ?CentPrecisionMoneyCollection $money + * @param ?TypedMoneyCollection $money */ - public function setMoney(?CentPrecisionMoneyCollection $money): void; + public function setMoney(?TypedMoneyCollection $money): void; } diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedBuilder.php index 5c8f1706a7e..22905edbc1c 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedBuilder.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\CartDiscount; -use Commercetools\Api\Models\Common\CentPrecisionMoneyCollection; +use Commercetools\Api\Models\Common\TypedMoneyCollection; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -23,15 +23,15 @@ final class CartDiscountValueFixedBuilder implements Builder { /** - * @var ?CentPrecisionMoneyCollection + * @var ?TypedMoneyCollection */ private $money; /** - *

Cent precision money values in different currencies.

+ *

Money values in cent precision or high precision of different currencies.

* - * @return null|CentPrecisionMoneyCollection + * @return null|TypedMoneyCollection */ public function getMoney() { @@ -39,10 +39,10 @@ public function getMoney() } /** - * @param ?CentPrecisionMoneyCollection $money + * @param ?TypedMoneyCollection $money * @return $this */ - public function withMoney(?CentPrecisionMoneyCollection $money) + public function withMoney(?TypedMoneyCollection $money) { $this->money = $money; diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php index aad2280141d..db3be4fa2f5 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\CartDiscount; -use Commercetools\Api\Models\Common\MoneyCollection; +use Commercetools\Api\Models\Common\TypedMoneyDraftCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -17,16 +17,16 @@ interface CartDiscountValueFixedDraft extends CartDiscountValueDraft public const FIELD_MONEY = 'money'; /** - *

Money values in different currencies. + *

Money values provided either in cent precision or high precision for different currencies. * A fixed Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.

* - * @return null|MoneyCollection + * @return null|TypedMoneyDraftCollection */ public function getMoney(); /** - * @param ?MoneyCollection $money + * @param ?TypedMoneyDraftCollection $money */ - public function setMoney(?MoneyCollection $money): void; + public function setMoney(?TypedMoneyDraftCollection $money): void; } diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php index be04a0f60d6..75fe07203f8 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\CartDiscount; -use Commercetools\Api\Models\Common\MoneyCollection; +use Commercetools\Api\Models\Common\TypedMoneyDraftCollection; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -23,16 +23,16 @@ final class CartDiscountValueFixedDraftBuilder implements Builder { /** - * @var ?MoneyCollection + * @var ?TypedMoneyDraftCollection */ private $money; /** - *

Money values in different currencies. + *

Money values provided either in cent precision or high precision for different currencies. * A fixed Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.

* - * @return null|MoneyCollection + * @return null|TypedMoneyDraftCollection */ public function getMoney() { @@ -40,10 +40,10 @@ public function getMoney() } /** - * @param ?MoneyCollection $money + * @param ?TypedMoneyDraftCollection $money * @return $this */ - public function withMoney(?MoneyCollection $money) + public function withMoney(?TypedMoneyDraftCollection $money) { $this->money = $money; diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php index cd893f9826f..fa5f11f2af1 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\CartDiscount; -use Commercetools\Api\Models\Common\MoneyCollection; +use Commercetools\Api\Models\Common\TypedMoneyDraftCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -29,7 +29,7 @@ final class CartDiscountValueFixedDraftModel extends JsonObjectModel implements /** * - * @var ?MoneyCollection + * @var ?TypedMoneyDraftCollection */ protected $money; @@ -38,7 +38,7 @@ final class CartDiscountValueFixedDraftModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?MoneyCollection $money = null, + ?TypedMoneyDraftCollection $money = null, ?string $type = null ) { $this->money = $money; @@ -64,11 +64,11 @@ public function getType() } /** - *

Money values in different currencies. + *

Money values provided either in cent precision or high precision for different currencies. * A fixed Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.

* * - * @return null|MoneyCollection + * @return null|TypedMoneyDraftCollection */ public function getMoney() { @@ -78,7 +78,7 @@ public function getMoney() if (is_null($data)) { return null; } - $this->money = MoneyCollection::fromArray($data); + $this->money = TypedMoneyDraftCollection::fromArray($data); } return $this->money; @@ -86,9 +86,9 @@ public function getMoney() /** - * @param ?MoneyCollection $money + * @param ?TypedMoneyDraftCollection $money */ - public function setMoney(?MoneyCollection $money): void + public function setMoney(?TypedMoneyDraftCollection $money): void { $this->money = $money; } diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedModel.php index 4fa4dbc17aa..d6661486540 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedModel.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\CartDiscount; -use Commercetools\Api\Models\Common\CentPrecisionMoneyCollection; +use Commercetools\Api\Models\Common\TypedMoneyCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -29,7 +29,7 @@ final class CartDiscountValueFixedModel extends JsonObjectModel implements CartD /** * - * @var ?CentPrecisionMoneyCollection + * @var ?TypedMoneyCollection */ protected $money; @@ -38,7 +38,7 @@ final class CartDiscountValueFixedModel extends JsonObjectModel implements CartD * @psalm-suppress MissingParamType */ public function __construct( - ?CentPrecisionMoneyCollection $money = null, + ?TypedMoneyCollection $money = null, ?string $type = null ) { $this->money = $money; @@ -64,10 +64,10 @@ public function getType() } /** - *

Cent precision money values in different currencies.

+ *

Money values in cent precision or high precision of different currencies.

* * - * @return null|CentPrecisionMoneyCollection + * @return null|TypedMoneyCollection */ public function getMoney() { @@ -77,7 +77,7 @@ public function getMoney() if (is_null($data)) { return null; } - $this->money = CentPrecisionMoneyCollection::fromArray($data); + $this->money = TypedMoneyCollection::fromArray($data); } return $this->money; @@ -85,9 +85,9 @@ public function getMoney() /** - * @param ?CentPrecisionMoneyCollection $money + * @param ?TypedMoneyCollection $money */ - public function setMoney(?CentPrecisionMoneyCollection $money): void + public function setMoney(?TypedMoneyCollection $money): void { $this->money = $money; } diff --git a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftBuilder.php b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftBuilder.php index dedddb991e8..9dff448f7a1 100644 --- a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftBuilder.php @@ -39,11 +39,7 @@ final class CentPrecisionMoneyDraftBuilder implements Builder private $fractionDigits; /** - *

Amount in the smallest indivisible unit of a currency, such as:

- *
    - *
  • Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as 500).
  • - *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • - *
+ *

Amount in the smallest indivisible unit of a currency.

* * @return null|int diff --git a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftModel.php b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftModel.php index 4de6f0eaf99..329fe3aa469 100644 --- a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyDraftModel.php @@ -61,11 +61,7 @@ public function __construct( } /** - *

Amount in the smallest indivisible unit of a currency, such as:

- *
    - *
  • Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as 500).
  • - *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • - *
+ *

Amount in the smallest indivisible unit of a currency.

* * * @return null|int @@ -105,6 +101,8 @@ public function getCurrencyCode() } /** + *

Determines the type of money used.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyModel.php b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyModel.php index fb5cf371060..64eacd14784 100644 --- a/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyModel.php +++ b/lib/commercetools-api/src/Models/Common/CentPrecisionMoneyModel.php @@ -105,7 +105,7 @@ public function getCurrencyCode() } /** - *

MoneyType supports two different values, one for amounts in cent precision and another one for sub-cent amounts up to 20 fraction digits.

+ *

Type of money used.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftModel.php b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftModel.php index 478987282aa..f1baf31d736 100644 --- a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyDraftModel.php @@ -111,6 +111,8 @@ public function getCurrencyCode() } /** + *

Determines the type of money used.

+ * * * @return null|string */ diff --git a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyModel.php b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyModel.php index dae8697e48e..1fa0fa39fc3 100644 --- a/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyModel.php +++ b/lib/commercetools-api/src/Models/Common/HighPrecisionMoneyModel.php @@ -113,7 +113,7 @@ public function getCurrencyCode() } /** - *

MoneyType supports two different values, one for amounts in cent precision and another one for sub-cent amounts up to 20 fraction digits.

+ *

Type of money used.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/TypedMoney.php b/lib/commercetools-api/src/Models/Common/TypedMoney.php index 40e767bdbaf..6cba53896c0 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoney.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoney.php @@ -18,7 +18,7 @@ interface TypedMoney extends Money public const FIELD_FRACTION_DIGITS = 'fractionDigits'; /** - *

MoneyType supports two different values, one for amounts in cent precision and another one for sub-cent amounts up to 20 fraction digits.

+ *

Type of money used.

* * @return null|string @@ -26,10 +26,10 @@ interface TypedMoney extends Money public function getType(); /** - *

Number of digits after the decimal separator:

+ *

Number of digits after the decimal separator.

*
    - *
  • Equal to the default number of fraction digits for a currency in CentPrecisionMoney.
  • - *
  • Greater than the default number of fraction digits for a currency in HighPrecisionMoney.
  • + *
  • For CentPrecisionMoney, it is equal to the default number of fraction digits for a currency.
  • + *
  • For HighPrecisionMoney, it is greater than the default number of fraction digits for a currency.
  • *
* diff --git a/lib/commercetools-api/src/Models/Common/TypedMoneyBuilder.php b/lib/commercetools-api/src/Models/Common/TypedMoneyBuilder.php index 89ef19fccae..409e8389ebc 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoneyBuilder.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoneyBuilder.php @@ -65,10 +65,10 @@ public function getCurrencyCode() } /** - *

Number of digits after the decimal separator:

+ *

Number of digits after the decimal separator.

*
    - *
  • Equal to the default number of fraction digits for a currency in CentPrecisionMoney.
  • - *
  • Greater than the default number of fraction digits for a currency in HighPrecisionMoney.
  • + *
  • For CentPrecisionMoney, it is equal to the default number of fraction digits for a currency.
  • + *
  • For HighPrecisionMoney, it is greater than the default number of fraction digits for a currency.
  • *
* diff --git a/lib/commercetools-api/src/Models/Common/TypedMoneyDraft.php b/lib/commercetools-api/src/Models/Common/TypedMoneyDraft.php index ac4f149316b..eeab0b669b6 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoneyDraft.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoneyDraft.php @@ -18,21 +18,36 @@ interface TypedMoneyDraft extends Money public const FIELD_FRACTION_DIGITS = 'fractionDigits'; /** + *

Determines the type of money used.

+ * * @return null|string */ public function getType(); /** - *

Must be equal to the default number of fraction digits for the specified currency.

+ *

Number of fraction digits for a specified money.

* * @return null|int */ public function getFractionDigits(); + /** + *

Amount in the smallest indivisible unit of a currency.

+ * + + * @return null|int + */ + public function getCentAmount(); + /** * @param ?int $fractionDigits */ public function setFractionDigits(?int $fractionDigits): void; + + /** + * @param ?int $centAmount + */ + public function setCentAmount(?int $centAmount): void; } diff --git a/lib/commercetools-api/src/Models/Common/TypedMoneyDraftBuilder.php b/lib/commercetools-api/src/Models/Common/TypedMoneyDraftBuilder.php index 67770da0e14..74da319a7a2 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoneyDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoneyDraftBuilder.php @@ -39,11 +39,7 @@ final class TypedMoneyDraftBuilder implements Builder private $fractionDigits; /** - *

Amount in the smallest indivisible unit of a currency, such as:

- *
    - *
  • Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as 500).
  • - *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • - *
+ *

Amount in the smallest indivisible unit of a currency.

* * @return null|int @@ -65,7 +61,7 @@ public function getCurrencyCode() } /** - *

Must be equal to the default number of fraction digits for the specified currency.

+ *

Number of fraction digits for a specified money.

* * @return null|int diff --git a/lib/commercetools-api/src/Models/Common/TypedMoneyDraftModel.php b/lib/commercetools-api/src/Models/Common/TypedMoneyDraftModel.php index 371190240d4..3c3d65bf242 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoneyDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoneyDraftModel.php @@ -69,11 +69,7 @@ public function __construct( } /** - *

Amount in the smallest indivisible unit of a currency, such as:

- *
    - *
  • Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as 500).
  • - *
  • The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as 5).
  • - *
+ *

Amount in the smallest indivisible unit of a currency.

* * * @return null|int @@ -113,6 +109,8 @@ public function getCurrencyCode() } /** + *

Determines the type of money used.

+ * * * @return null|string */ @@ -131,7 +129,7 @@ public function getType() } /** - *

Must be equal to the default number of fraction digits for the specified currency.

+ *

Number of fraction digits for a specified money.

* * * @return null|int diff --git a/lib/commercetools-api/src/Models/Common/TypedMoneyModel.php b/lib/commercetools-api/src/Models/Common/TypedMoneyModel.php index eb44aebac3a..27ed99c41bf 100644 --- a/lib/commercetools-api/src/Models/Common/TypedMoneyModel.php +++ b/lib/commercetools-api/src/Models/Common/TypedMoneyModel.php @@ -113,7 +113,7 @@ public function getCurrencyCode() } /** - *

MoneyType supports two different values, one for amounts in cent precision and another one for sub-cent amounts up to 20 fraction digits.

+ *

Type of money used.

* * * @return null|string @@ -133,10 +133,10 @@ public function getType() } /** - *

Number of digits after the decimal separator:

+ *

Number of digits after the decimal separator.

*
    - *
  • Equal to the default number of fraction digits for a currency in CentPrecisionMoney.
  • - *
  • Greater than the default number of fraction digits for a currency in HighPrecisionMoney.
  • + *
  • For CentPrecisionMoney, it is equal to the default number of fraction digits for a currency.
  • + *
  • For HighPrecisionMoney, it is greater than the default number of fraction digits for a currency.
  • *
* * diff --git a/references.txt b/references.txt index 496aaf64664..640902498fe 100644 --- a/references.txt +++ b/references.txt @@ -90,3 +90,4 @@ f15664352ad27ec193e2ca1140e7dbeae4fa3167 754ae90cfe73d7429934ccce580e799a949ed98d 43ec24cb27d83029991ae44c2c5af31fa2e6bebc b47352c3ed66fd9ad8e6b14402217fec39941d06 +16f42e68e7e48c4ea35ca3791f0d412bdc4d44c8 From 34f486feb3348b561ac5589dde5f1795d5153196 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 31 Jul 2023 13:49:55 +0000 Subject: [PATCH 30/44] TASK: Updating SDK --- changes.md | 20 ++++++++++ .../Models/Order/CustomLineItemReturnItem.php | 13 +++++++ .../Order/CustomLineItemReturnItemBuilder.php | 29 ++++++++++++++ .../Order/CustomLineItemReturnItemModel.php | 36 ++++++++++++++++++ .../src/Models/Order/LineItemReturnItem.php | 13 +++++++ .../Order/LineItemReturnItemBuilder.php | 29 ++++++++++++++ .../Models/Order/LineItemReturnItemModel.php | 36 ++++++++++++++++++ .../OrderSetReturnItemCustomFieldAction.php | 16 +++++++- ...rSetReturnItemCustomFieldActionBuilder.php | 31 ++++++++++++++- ...derSetReturnItemCustomFieldActionModel.php | 38 ++++++++++++++++++- .../OrderSetReturnItemCustomTypeAction.php | 16 +++++++- ...erSetReturnItemCustomTypeActionBuilder.php | 31 ++++++++++++++- ...rderSetReturnItemCustomTypeActionModel.php | 38 ++++++++++++++++++- .../OrderSetReturnPaymentStateAction.php | 16 +++++++- ...rderSetReturnPaymentStateActionBuilder.php | 31 ++++++++++++++- .../OrderSetReturnPaymentStateActionModel.php | 38 ++++++++++++++++++- .../OrderSetReturnShipmentStateAction.php | 16 +++++++- ...derSetReturnShipmentStateActionBuilder.php | 31 ++++++++++++++- ...OrderSetReturnShipmentStateActionModel.php | 38 ++++++++++++++++++- .../src/Models/Order/ReturnItem.php | 14 +++++++ .../src/Models/Order/ReturnItemBuilder.php | 29 ++++++++++++++ .../src/Models/Order/ReturnItemDraft.php | 14 +++++++ .../Models/Order/ReturnItemDraftBuilder.php | 29 ++++++++++++++ .../src/Models/Order/ReturnItemDraftModel.php | 36 ++++++++++++++++++ .../src/Models/Order/ReturnItemModel.php | 36 ++++++++++++++++++ ...gedOrderSetReturnItemCustomFieldAction.php | 16 +++++++- ...rSetReturnItemCustomFieldActionBuilder.php | 31 ++++++++++++++- ...derSetReturnItemCustomFieldActionModel.php | 38 ++++++++++++++++++- ...agedOrderSetReturnItemCustomTypeAction.php | 16 +++++++- ...erSetReturnItemCustomTypeActionBuilder.php | 31 ++++++++++++++- ...rderSetReturnItemCustomTypeActionModel.php | 38 ++++++++++++++++++- ...StagedOrderSetReturnPaymentStateAction.php | 16 +++++++- ...rderSetReturnPaymentStateActionBuilder.php | 31 ++++++++++++++- ...dOrderSetReturnPaymentStateActionModel.php | 38 ++++++++++++++++++- ...tagedOrderSetReturnShipmentStateAction.php | 16 +++++++- ...derSetReturnShipmentStateActionBuilder.php | 31 ++++++++++++++- ...OrderSetReturnShipmentStateActionModel.php | 38 ++++++++++++++++++- references.txt | 1 + 38 files changed, 991 insertions(+), 24 deletions(-) diff --git a/changes.md b/changes.md index b7a35976586..57eeb86bfc7 100644 --- a/changes.md +++ b/changes.md @@ -57,18 +57,30 @@ - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemShippingDetailsAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxAmountAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxRateAction` +- added property `returnItemKey` to type `StagedOrderSetReturnItemCustomFieldAction` +- added property `returnItemKey` to type `StagedOrderSetReturnItemCustomTypeAction` +- added property `returnItemKey` to type `StagedOrderSetReturnPaymentStateAction` +- added property `returnItemKey` to type `StagedOrderSetReturnShipmentStateAction` - added property `customLineItemKey` to type `StagedOrderTransitionCustomLineItemStateAction` - added property `lineItemKey` to type `StagedOrderTransitionLineItemStateAction` - added property `key` to type `CustomLineItemImportDraft` +- added property `key` to type `CustomLineItemReturnItem` - added property `key` to type `LineItemImportDraft` +- added property `key` to type `LineItemReturnItem` - added property `directDiscounts` to type `Order` - added property `purchaseOrderNumber` to type `OrderImportDraft` - added property `taxCalculationMode` to type `OrderImportDraft` +- added property `key` to type `ReturnItem` +- added property `key` to type `ReturnItemDraft` - added property `customLineItemKey` to type `OrderImportCustomLineItemStateAction` - added property `lineItemKey` to type `OrderImportLineItemStateAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemCustomFieldAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemCustomTypeAction` - added property `customLineItemKey` to type `OrderSetCustomLineItemShippingDetailsAction` +- added property `returnItemKey` to type `OrderSetReturnItemCustomFieldAction` +- added property `returnItemKey` to type `OrderSetReturnItemCustomTypeAction` +- added property `returnItemKey` to type `OrderSetReturnPaymentStateAction` +- added property `returnItemKey` to type `OrderSetReturnShipmentStateAction` - added property `customLineItemKey` to type `OrderTransitionCustomLineItemStateAction` - added property `lineItemKey` to type `OrderTransitionLineItemStateAction`
@@ -100,6 +112,10 @@ - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemShippingDetailsAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxAmountAction` to be optional - changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxRateAction` to be optional +- changed property `returnItemId` of type `StagedOrderSetReturnItemCustomFieldAction` to be optional +- changed property `returnItemId` of type `StagedOrderSetReturnItemCustomTypeAction` to be optional +- changed property `returnItemId` of type `StagedOrderSetReturnPaymentStateAction` to be optional +- changed property `returnItemId` of type `StagedOrderSetReturnShipmentStateAction` to be optional - changed property `customLineItemId` of type `StagedOrderTransitionCustomLineItemStateAction` to be optional - changed property `lineItemId` of type `StagedOrderTransitionLineItemStateAction` to be optional - changed property `priceMode` of type `CustomLineItemImportDraft` to be optional @@ -108,6 +124,10 @@ - changed property `customLineItemId` of type `OrderSetCustomLineItemCustomFieldAction` to be optional - changed property `customLineItemId` of type `OrderSetCustomLineItemCustomTypeAction` to be optional - changed property `customLineItemId` of type `OrderSetCustomLineItemShippingDetailsAction` to be optional +- changed property `returnItemId` of type `OrderSetReturnItemCustomFieldAction` to be optional +- changed property `returnItemId` of type `OrderSetReturnItemCustomTypeAction` to be optional +- changed property `returnItemId` of type `OrderSetReturnPaymentStateAction` to be optional +- changed property `returnItemId` of type `OrderSetReturnShipmentStateAction` to be optional - changed property `customLineItemId` of type `OrderTransitionCustomLineItemStateAction` to be optional - changed property `lineItemId` of type `OrderTransitionLineItemStateAction` to be optional - changed property `comment` of type `QuoteRequestDraft` to be optional diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php index d5698c68fc4..1e7340890ad 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItem.php @@ -15,6 +15,14 @@ interface CustomLineItemReturnItem extends ReturnItem { public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; + /** + *

User-defined unique identifier of the CustomLineItemReturnItem.

+ * + + * @return null|string + */ + public function getKey(); + /** *

id of the returned CustomLineItem.

* @@ -31,6 +39,11 @@ public function getCustomLineItemId(); */ public function getQuantity(); + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?string $customLineItemId */ diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php index 5b1425034f4..31d6d0a87c2 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemBuilder.php @@ -29,6 +29,12 @@ final class CustomLineItemReturnItemBuilder implements Builder */ private $id; + /** + + * @var ?string + */ + private $key; + /** * @var ?int @@ -88,6 +94,17 @@ public function getId() return $this->id; } + /** + *

User-defined unique identifier of the CustomLineItemReturnItem.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Number of Custom Line Items returned.

* @@ -191,6 +208,17 @@ public function withId(?string $id) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -294,6 +322,7 @@ public function build(): CustomLineItemReturnItem { return new CustomLineItemReturnItemModel( $this->id, + $this->key, $this->quantity, $this->comment, $this->shipmentState, diff --git a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php index dc948c38485..cd53e829878 100644 --- a/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php +++ b/lib/commercetools-api/src/Models/Order/CustomLineItemReturnItemModel.php @@ -29,6 +29,12 @@ final class CustomLineItemReturnItemModel extends JsonObjectModel implements Cus */ protected $id; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?int @@ -89,6 +95,7 @@ final class CustomLineItemReturnItemModel extends JsonObjectModel implements Cus */ public function __construct( ?string $id = null, + ?string $key = null, ?int $quantity = null, ?string $comment = null, ?string $shipmentState = null, @@ -100,6 +107,7 @@ public function __construct( ?string $type = null ) { $this->id = $id; + $this->key = $key; $this->quantity = $quantity; $this->comment = $comment; $this->shipmentState = $shipmentState; @@ -131,6 +139,26 @@ public function getId() return $this->id; } + /** + *

User-defined unique identifier of the CustomLineItemReturnItem.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Number of Custom Line Items returned.

* @@ -331,6 +359,14 @@ public function setId(?string $id): void $this->id = $id; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php b/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php index 15885ab9042..92da0f38b1e 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php +++ b/lib/commercetools-api/src/Models/Order/LineItemReturnItem.php @@ -15,6 +15,14 @@ interface LineItemReturnItem extends ReturnItem { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + /** + *

User-defined unique identifier of the LineItemReturnItem.

+ * + + * @return null|string + */ + public function getKey(); + /** *

id of the returned LineItem.

* @@ -31,6 +39,11 @@ public function getLineItemId(); */ public function getQuantity(); + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?string $lineItemId */ diff --git a/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php b/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php index 2afdad95ba2..86acf674464 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/LineItemReturnItemBuilder.php @@ -29,6 +29,12 @@ final class LineItemReturnItemBuilder implements Builder */ private $id; + /** + + * @var ?string + */ + private $key; + /** * @var ?int @@ -88,6 +94,17 @@ public function getId() return $this->id; } + /** + *

User-defined unique identifier of the LineItemReturnItem.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Number of Line Items returned.

* @@ -191,6 +208,17 @@ public function withId(?string $id) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -294,6 +322,7 @@ public function build(): LineItemReturnItem { return new LineItemReturnItemModel( $this->id, + $this->key, $this->quantity, $this->comment, $this->shipmentState, diff --git a/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php b/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php index babd26bf3b9..498ee6ec085 100644 --- a/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php +++ b/lib/commercetools-api/src/Models/Order/LineItemReturnItemModel.php @@ -29,6 +29,12 @@ final class LineItemReturnItemModel extends JsonObjectModel implements LineItemR */ protected $id; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?int @@ -89,6 +95,7 @@ final class LineItemReturnItemModel extends JsonObjectModel implements LineItemR */ public function __construct( ?string $id = null, + ?string $key = null, ?int $quantity = null, ?string $comment = null, ?string $shipmentState = null, @@ -100,6 +107,7 @@ public function __construct( ?string $type = null ) { $this->id = $id; + $this->key = $key; $this->quantity = $quantity; $this->comment = $comment; $this->shipmentState = $shipmentState; @@ -131,6 +139,26 @@ public function getId() return $this->id; } + /** + *

User-defined unique identifier of the LineItemReturnItem.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Number of Line Items returned.

* @@ -331,6 +359,14 @@ public function setId(?string $id): void $this->id = $id; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php index 980ef4a5e2d..4243baa3ba3 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldAction.php @@ -14,17 +14,26 @@ interface OrderSetReturnItemCustomFieldAction extends OrderUpdateAction { public const FIELD_RETURN_ITEM_ID = 'returnItemId'; + public const FIELD_RETURN_ITEM_KEY = 'returnItemKey'; public const FIELD_NAME = 'name'; public const FIELD_VALUE = 'value'; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string */ public function getReturnItemId(); + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey(); + /** *

Name of the Custom Field.

* @@ -48,6 +57,11 @@ public function getValue(); */ public function setReturnItemId(?string $returnItemId): void; + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void; + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php index 26773ac5de0..0ae50a104b7 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionBuilder.php @@ -26,6 +26,12 @@ final class OrderSetReturnItemCustomFieldActionBuilder implements Builder */ private $returnItemId; + /** + + * @var ?string + */ + private $returnItemKey; + /** * @var ?string @@ -39,7 +45,7 @@ final class OrderSetReturnItemCustomFieldActionBuilder implements Builder private $value; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string @@ -49,6 +55,17 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey() + { + return $this->returnItemKey; + } + /** *

Name of the Custom Field.

* @@ -84,6 +101,17 @@ public function withReturnItemId(?string $returnItemId) return $this; } + /** + * @param ?string $returnItemKey + * @return $this + */ + public function withReturnItemKey(?string $returnItemKey) + { + $this->returnItemKey = $returnItemKey; + + return $this; + } + /** * @param ?string $name * @return $this @@ -111,6 +139,7 @@ public function build(): OrderSetReturnItemCustomFieldAction { return new OrderSetReturnItemCustomFieldActionModel( $this->returnItemId, + $this->returnItemKey, $this->name, $this->value ); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php index dcf5346ee6e..a323d4915b3 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomFieldActionModel.php @@ -32,6 +32,12 @@ final class OrderSetReturnItemCustomFieldActionModel extends JsonObjectModel imp */ protected $returnItemId; + /** + * + * @var ?string + */ + protected $returnItemKey; + /** * * @var ?string @@ -50,11 +56,13 @@ final class OrderSetReturnItemCustomFieldActionModel extends JsonObjectModel imp */ public function __construct( ?string $returnItemId = null, + ?string $returnItemKey = null, ?string $name = null, $value = null, ?string $action = null ) { $this->returnItemId = $returnItemId; + $this->returnItemKey = $returnItemKey; $this->name = $name; $this->value = $value; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -79,7 +87,7 @@ public function getAction() } /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * * @return null|string @@ -98,6 +106,26 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + * + * @return null|string + */ + public function getReturnItemKey() + { + if (is_null($this->returnItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RETURN_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->returnItemKey = (string) $data; + } + + return $this->returnItemKey; + } + /** *

Name of the Custom Field.

* @@ -149,6 +177,14 @@ public function setReturnItemId(?string $returnItemId): void $this->returnItemId = $returnItemId; } + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void + { + $this->returnItemKey = $returnItemKey; + } + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php index 2eed3a5778d..d761af57644 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeAction.php @@ -16,17 +16,26 @@ interface OrderSetReturnItemCustomTypeAction extends OrderUpdateAction { public const FIELD_RETURN_ITEM_ID = 'returnItemId'; + public const FIELD_RETURN_ITEM_KEY = 'returnItemKey'; public const FIELD_TYPE = 'type'; public const FIELD_FIELDS = 'fields'; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string */ public function getReturnItemId(); + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey(); + /** *

Defines the Type that extends the Return Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Return Item.

@@ -49,6 +58,11 @@ public function getFields(); */ public function setReturnItemId(?string $returnItemId): void; + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void; + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php index bfeb53ab507..2c628daa40c 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionBuilder.php @@ -30,6 +30,12 @@ final class OrderSetReturnItemCustomTypeActionBuilder implements Builder */ private $returnItemId; + /** + + * @var ?string + */ + private $returnItemKey; + /** * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder @@ -43,7 +49,7 @@ final class OrderSetReturnItemCustomTypeActionBuilder implements Builder private $fields; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string @@ -53,6 +59,17 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey() + { + return $this->returnItemKey; + } + /** *

Defines the Type that extends the Return Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Return Item.

@@ -87,6 +104,17 @@ public function withReturnItemId(?string $returnItemId) return $this; } + /** + * @param ?string $returnItemKey + * @return $this + */ + public function withReturnItemKey(?string $returnItemKey) + { + $this->returnItemKey = $returnItemKey; + + return $this; + } + /** * @param ?TypeResourceIdentifier $type * @return $this @@ -135,6 +163,7 @@ public function build(): OrderSetReturnItemCustomTypeAction { return new OrderSetReturnItemCustomTypeActionModel( $this->returnItemId, + $this->returnItemKey, $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields ); diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php index ff010648f0a..12c23203e78 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnItemCustomTypeActionModel.php @@ -36,6 +36,12 @@ final class OrderSetReturnItemCustomTypeActionModel extends JsonObjectModel impl */ protected $returnItemId; + /** + * + * @var ?string + */ + protected $returnItemKey; + /** * * @var ?TypeResourceIdentifier @@ -54,11 +60,13 @@ final class OrderSetReturnItemCustomTypeActionModel extends JsonObjectModel impl */ public function __construct( ?string $returnItemId = null, + ?string $returnItemKey = null, ?TypeResourceIdentifier $type = null, ?FieldContainer $fields = null, ?string $action = null ) { $this->returnItemId = $returnItemId; + $this->returnItemKey = $returnItemKey; $this->type = $type; $this->fields = $fields; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -83,7 +91,7 @@ public function getAction() } /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * * @return null|string @@ -102,6 +110,26 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + * + * @return null|string + */ + public function getReturnItemKey() + { + if (is_null($this->returnItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RETURN_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->returnItemKey = (string) $data; + } + + return $this->returnItemKey; + } + /** *

Defines the Type that extends the Return Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Return Item.

@@ -154,6 +182,14 @@ public function setReturnItemId(?string $returnItemId): void $this->returnItemId = $returnItemId; } + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void + { + $this->returnItemKey = $returnItemKey; + } + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php index 6ae54daa461..9f2abca9067 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateAction.php @@ -14,16 +14,25 @@ interface OrderSetReturnPaymentStateAction extends OrderUpdateAction { public const FIELD_RETURN_ITEM_ID = 'returnItemId'; + public const FIELD_RETURN_ITEM_KEY = 'returnItemKey'; public const FIELD_PAYMENT_STATE = 'paymentState'; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string */ public function getReturnItemId(); + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey(); + /** *

New Payment status of the ReturnItem.

* @@ -37,6 +46,11 @@ public function getPaymentState(); */ public function setReturnItemId(?string $returnItemId): void; + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void; + /** * @param ?string $paymentState */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php index 6d127eb73c9..a05274f53f6 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionBuilder.php @@ -26,6 +26,12 @@ final class OrderSetReturnPaymentStateActionBuilder implements Builder */ private $returnItemId; + /** + + * @var ?string + */ + private $returnItemKey; + /** * @var ?string @@ -33,7 +39,7 @@ final class OrderSetReturnPaymentStateActionBuilder implements Builder private $paymentState; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey() + { + return $this->returnItemKey; + } + /** *

New Payment status of the ReturnItem.

* @@ -65,6 +82,17 @@ public function withReturnItemId(?string $returnItemId) return $this; } + /** + * @param ?string $returnItemKey + * @return $this + */ + public function withReturnItemKey(?string $returnItemKey) + { + $this->returnItemKey = $returnItemKey; + + return $this; + } + /** * @param ?string $paymentState * @return $this @@ -81,6 +109,7 @@ public function build(): OrderSetReturnPaymentStateAction { return new OrderSetReturnPaymentStateActionModel( $this->returnItemId, + $this->returnItemKey, $this->paymentState ); } diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php index 73a13bfe884..e587175a1a9 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnPaymentStateActionModel.php @@ -32,6 +32,12 @@ final class OrderSetReturnPaymentStateActionModel extends JsonObjectModel implem */ protected $returnItemId; + /** + * + * @var ?string + */ + protected $returnItemKey; + /** * * @var ?string @@ -44,10 +50,12 @@ final class OrderSetReturnPaymentStateActionModel extends JsonObjectModel implem */ public function __construct( ?string $returnItemId = null, + ?string $returnItemKey = null, ?string $paymentState = null, ?string $action = null ) { $this->returnItemId = $returnItemId; + $this->returnItemKey = $returnItemKey; $this->paymentState = $paymentState; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + * + * @return null|string + */ + public function getReturnItemKey() + { + if (is_null($this->returnItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RETURN_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->returnItemKey = (string) $data; + } + + return $this->returnItemKey; + } + /** *

New Payment status of the ReturnItem.

* @@ -119,6 +147,14 @@ public function setReturnItemId(?string $returnItemId): void $this->returnItemId = $returnItemId; } + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void + { + $this->returnItemKey = $returnItemKey; + } + /** * @param ?string $paymentState */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php index e912725f511..b92282eed92 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateAction.php @@ -14,16 +14,25 @@ interface OrderSetReturnShipmentStateAction extends OrderUpdateAction { public const FIELD_RETURN_ITEM_ID = 'returnItemId'; + public const FIELD_RETURN_ITEM_KEY = 'returnItemKey'; public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string */ public function getReturnItemId(); + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey(); + /** *

New shipment state of the ReturnItem.

* @@ -37,6 +46,11 @@ public function getShipmentState(); */ public function setReturnItemId(?string $returnItemId): void; + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void; + /** * @param ?string $shipmentState */ diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php index e3519b76b87..48a1f2c2b16 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionBuilder.php @@ -26,6 +26,12 @@ final class OrderSetReturnShipmentStateActionBuilder implements Builder */ private $returnItemId; + /** + + * @var ?string + */ + private $returnItemKey; + /** * @var ?string @@ -33,7 +39,7 @@ final class OrderSetReturnShipmentStateActionBuilder implements Builder private $shipmentState; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey() + { + return $this->returnItemKey; + } + /** *

New shipment state of the ReturnItem.

* @@ -65,6 +82,17 @@ public function withReturnItemId(?string $returnItemId) return $this; } + /** + * @param ?string $returnItemKey + * @return $this + */ + public function withReturnItemKey(?string $returnItemKey) + { + $this->returnItemKey = $returnItemKey; + + return $this; + } + /** * @param ?string $shipmentState * @return $this @@ -81,6 +109,7 @@ public function build(): OrderSetReturnShipmentStateAction { return new OrderSetReturnShipmentStateActionModel( $this->returnItemId, + $this->returnItemKey, $this->shipmentState ); } diff --git a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php index d30c771c915..1f2fd6d3608 100644 --- a/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php +++ b/lib/commercetools-api/src/Models/Order/OrderSetReturnShipmentStateActionModel.php @@ -32,6 +32,12 @@ final class OrderSetReturnShipmentStateActionModel extends JsonObjectModel imple */ protected $returnItemId; + /** + * + * @var ?string + */ + protected $returnItemKey; + /** * * @var ?string @@ -44,10 +50,12 @@ final class OrderSetReturnShipmentStateActionModel extends JsonObjectModel imple */ public function __construct( ?string $returnItemId = null, + ?string $returnItemKey = null, ?string $shipmentState = null, ?string $action = null ) { $this->returnItemId = $returnItemId; + $this->returnItemKey = $returnItemKey; $this->shipmentState = $shipmentState; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + * + * @return null|string + */ + public function getReturnItemKey() + { + if (is_null($this->returnItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RETURN_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->returnItemKey = (string) $data; + } + + return $this->returnItemKey; + } + /** *

New shipment state of the ReturnItem.

* @@ -119,6 +147,14 @@ public function setReturnItemId(?string $returnItemId): void $this->returnItemId = $returnItemId; } + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void + { + $this->returnItemKey = $returnItemKey; + } + /** * @param ?string $shipmentState */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnItem.php b/lib/commercetools-api/src/Models/Order/ReturnItem.php index 50dbb7afe51..12e2ac692c0 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItem.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItem.php @@ -17,6 +17,7 @@ interface ReturnItem extends JsonObject { public const DISCRIMINATOR_FIELD = 'type'; public const FIELD_ID = 'id'; + public const FIELD_KEY = 'key'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_TYPE = 'type'; public const FIELD_COMMENT = 'comment'; @@ -34,6 +35,14 @@ interface ReturnItem extends JsonObject */ public function getId(); + /** + *

User-defined unique identifier of the Return Item.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Number of Line Items or Custom Line Items returned.

* @@ -105,6 +114,11 @@ public function getCreatedAt(); */ public function setId(?string $id): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php b/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php index 7c62da26167..e796b2acb86 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemBuilder.php @@ -29,6 +29,12 @@ final class ReturnItemBuilder implements Builder */ private $id; + /** + + * @var ?string + */ + private $key; + /** * @var ?int @@ -82,6 +88,17 @@ public function getId() return $this->id; } + /** + *

User-defined unique identifier of the Return Item.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Number of Line Items or Custom Line Items returned.

* @@ -174,6 +191,17 @@ public function withId(?string $id) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -266,6 +294,7 @@ public function build(): ReturnItem { return new ReturnItemModel( $this->id, + $this->key, $this->quantity, $this->comment, $this->shipmentState, diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php b/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php index ddb55011e6c..03ec28939a4 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemDraft.php @@ -14,6 +14,7 @@ interface ReturnItemDraft extends JsonObject { + public const FIELD_KEY = 'key'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_LINE_ITEM_ID = 'lineItemId'; public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; @@ -21,6 +22,14 @@ interface ReturnItemDraft extends JsonObject public const FIELD_SHIPMENT_STATE = 'shipmentState'; public const FIELD_CUSTOM = 'custom'; + /** + *

User-defined unique identifier of the Return Item.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Number of Line Items or Custom Line Items to return.

* @@ -72,6 +81,11 @@ public function getShipmentState(); */ public function getCustom(); + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php b/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php index 016ab8d501f..b538f6a375a 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemDraftBuilder.php @@ -22,6 +22,12 @@ */ final class ReturnItemDraftBuilder implements Builder { + /** + + * @var ?string + */ + private $key; + /** * @var ?int @@ -58,6 +64,17 @@ final class ReturnItemDraftBuilder implements Builder */ private $custom; + /** + *

User-defined unique identifier of the Return Item.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Number of Line Items or Custom Line Items to return.

* @@ -127,6 +144,17 @@ public function getCustom() return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -207,6 +235,7 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) public function build(): ReturnItemDraft { return new ReturnItemDraftModel( + $this->key, $this->quantity, $this->lineItemId, $this->customLineItemId, diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php b/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php index ec67b8662b1..7cc6b215fa8 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemDraftModel.php @@ -21,6 +21,12 @@ */ final class ReturnItemDraftModel extends JsonObjectModel implements ReturnItemDraft { + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?int @@ -62,6 +68,7 @@ final class ReturnItemDraftModel extends JsonObjectModel implements ReturnItemDr * @psalm-suppress MissingParamType */ public function __construct( + ?string $key = null, ?int $quantity = null, ?string $lineItemId = null, ?string $customLineItemId = null, @@ -69,6 +76,7 @@ public function __construct( ?string $shipmentState = null, ?CustomFieldsDraft $custom = null ) { + $this->key = $key; $this->quantity = $quantity; $this->lineItemId = $lineItemId; $this->customLineItemId = $customLineItemId; @@ -77,6 +85,26 @@ public function __construct( $this->custom = $custom; } + /** + *

User-defined unique identifier of the Return Item.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Number of Line Items or Custom Line Items to return.

* @@ -202,6 +230,14 @@ public function getCustom() } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Order/ReturnItemModel.php b/lib/commercetools-api/src/Models/Order/ReturnItemModel.php index 96906c99c1a..4a9ffcb7b23 100644 --- a/lib/commercetools-api/src/Models/Order/ReturnItemModel.php +++ b/lib/commercetools-api/src/Models/Order/ReturnItemModel.php @@ -29,6 +29,12 @@ final class ReturnItemModel extends JsonObjectModel implements ReturnItem */ protected $id; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?int @@ -91,6 +97,7 @@ final class ReturnItemModel extends JsonObjectModel implements ReturnItem */ public function __construct( ?string $id = null, + ?string $key = null, ?int $quantity = null, ?string $comment = null, ?string $shipmentState = null, @@ -101,6 +108,7 @@ public function __construct( ?string $type = null ) { $this->id = $id; + $this->key = $key; $this->quantity = $quantity; $this->comment = $comment; $this->shipmentState = $shipmentState; @@ -131,6 +139,26 @@ public function getId() return $this->id; } + /** + *

User-defined unique identifier of the Return Item.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Number of Line Items or Custom Line Items returned.

* @@ -311,6 +339,14 @@ public function setId(?string $id): void $this->id = $id; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php index 67d7b9a5cd2..e41ea9c3e6d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldAction.php @@ -15,17 +15,26 @@ interface StagedOrderSetReturnItemCustomFieldAction extends StagedOrderUpdateAction { public const FIELD_RETURN_ITEM_ID = 'returnItemId'; + public const FIELD_RETURN_ITEM_KEY = 'returnItemKey'; public const FIELD_NAME = 'name'; public const FIELD_VALUE = 'value'; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string */ public function getReturnItemId(); + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey(); + /** *

Name of the Custom Field.

* @@ -49,6 +58,11 @@ public function getValue(); */ public function setReturnItemId(?string $returnItemId): void; + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void; + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php index 5779c6f2be1..4f03a6621c5 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionBuilder.php @@ -28,6 +28,12 @@ final class StagedOrderSetReturnItemCustomFieldActionBuilder implements Builder */ private $returnItemId; + /** + + * @var ?string + */ + private $returnItemKey; + /** * @var ?string @@ -41,7 +47,7 @@ final class StagedOrderSetReturnItemCustomFieldActionBuilder implements Builder private $value; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string @@ -51,6 +57,17 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey() + { + return $this->returnItemKey; + } + /** *

Name of the Custom Field.

* @@ -86,6 +103,17 @@ public function withReturnItemId(?string $returnItemId) return $this; } + /** + * @param ?string $returnItemKey + * @return $this + */ + public function withReturnItemKey(?string $returnItemKey) + { + $this->returnItemKey = $returnItemKey; + + return $this; + } + /** * @param ?string $name * @return $this @@ -113,6 +141,7 @@ public function build(): StagedOrderSetReturnItemCustomFieldAction { return new StagedOrderSetReturnItemCustomFieldActionModel( $this->returnItemId, + $this->returnItemKey, $this->name, $this->value ); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php index bba2597baa3..dc6d132769e 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomFieldActionModel.php @@ -34,6 +34,12 @@ final class StagedOrderSetReturnItemCustomFieldActionModel extends JsonObjectMod */ protected $returnItemId; + /** + * + * @var ?string + */ + protected $returnItemKey; + /** * * @var ?string @@ -52,11 +58,13 @@ final class StagedOrderSetReturnItemCustomFieldActionModel extends JsonObjectMod */ public function __construct( ?string $returnItemId = null, + ?string $returnItemKey = null, ?string $name = null, $value = null, ?string $action = null ) { $this->returnItemId = $returnItemId; + $this->returnItemKey = $returnItemKey; $this->name = $name; $this->value = $value; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -81,7 +89,7 @@ public function getAction() } /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * * @return null|string @@ -100,6 +108,26 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + * + * @return null|string + */ + public function getReturnItemKey() + { + if (is_null($this->returnItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RETURN_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->returnItemKey = (string) $data; + } + + return $this->returnItemKey; + } + /** *

Name of the Custom Field.

* @@ -151,6 +179,14 @@ public function setReturnItemId(?string $returnItemId): void $this->returnItemId = $returnItemId; } + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void + { + $this->returnItemKey = $returnItemKey; + } + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php index 1a4df2e5de8..0db2f0ce816 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeAction.php @@ -17,17 +17,26 @@ interface StagedOrderSetReturnItemCustomTypeAction extends StagedOrderUpdateAction { public const FIELD_RETURN_ITEM_ID = 'returnItemId'; + public const FIELD_RETURN_ITEM_KEY = 'returnItemKey'; public const FIELD_TYPE = 'type'; public const FIELD_FIELDS = 'fields'; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string */ public function getReturnItemId(); + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey(); + /** *

Defines the Type that extends the Return Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Return Item.

@@ -50,6 +59,11 @@ public function getFields(); */ public function setReturnItemId(?string $returnItemId): void; + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void; + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php index ad86a1675bf..514ebeb9acc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionBuilder.php @@ -32,6 +32,12 @@ final class StagedOrderSetReturnItemCustomTypeActionBuilder implements Builder */ private $returnItemId; + /** + + * @var ?string + */ + private $returnItemKey; + /** * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder @@ -45,7 +51,7 @@ final class StagedOrderSetReturnItemCustomTypeActionBuilder implements Builder private $fields; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string @@ -55,6 +61,17 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey() + { + return $this->returnItemKey; + } + /** *

Defines the Type that extends the Return Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Return Item.

@@ -89,6 +106,17 @@ public function withReturnItemId(?string $returnItemId) return $this; } + /** + * @param ?string $returnItemKey + * @return $this + */ + public function withReturnItemKey(?string $returnItemKey) + { + $this->returnItemKey = $returnItemKey; + + return $this; + } + /** * @param ?TypeResourceIdentifier $type * @return $this @@ -137,6 +165,7 @@ public function build(): StagedOrderSetReturnItemCustomTypeAction { return new StagedOrderSetReturnItemCustomTypeActionModel( $this->returnItemId, + $this->returnItemKey, $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields ); diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php index fdb675b1508..b2b23c9cb82 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnItemCustomTypeActionModel.php @@ -38,6 +38,12 @@ final class StagedOrderSetReturnItemCustomTypeActionModel extends JsonObjectMode */ protected $returnItemId; + /** + * + * @var ?string + */ + protected $returnItemKey; + /** * * @var ?TypeResourceIdentifier @@ -56,11 +62,13 @@ final class StagedOrderSetReturnItemCustomTypeActionModel extends JsonObjectMode */ public function __construct( ?string $returnItemId = null, + ?string $returnItemKey = null, ?TypeResourceIdentifier $type = null, ?FieldContainer $fields = null, ?string $action = null ) { $this->returnItemId = $returnItemId; + $this->returnItemKey = $returnItemKey; $this->type = $type; $this->fields = $fields; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -85,7 +93,7 @@ public function getAction() } /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * * @return null|string @@ -104,6 +112,26 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + * + * @return null|string + */ + public function getReturnItemKey() + { + if (is_null($this->returnItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RETURN_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->returnItemKey = (string) $data; + } + + return $this->returnItemKey; + } + /** *

Defines the Type that extends the Return Item with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the Return Item.

@@ -156,6 +184,14 @@ public function setReturnItemId(?string $returnItemId): void $this->returnItemId = $returnItemId; } + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void + { + $this->returnItemKey = $returnItemKey; + } + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php index 6958328c908..60c06832545 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateAction.php @@ -15,16 +15,25 @@ interface StagedOrderSetReturnPaymentStateAction extends StagedOrderUpdateAction { public const FIELD_RETURN_ITEM_ID = 'returnItemId'; + public const FIELD_RETURN_ITEM_KEY = 'returnItemKey'; public const FIELD_PAYMENT_STATE = 'paymentState'; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string */ public function getReturnItemId(); + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey(); + /** *

New Payment status of the ReturnItem.

* @@ -38,6 +47,11 @@ public function getPaymentState(); */ public function setReturnItemId(?string $returnItemId): void; + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void; + /** * @param ?string $paymentState */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php index 7711ea8e6bb..3c868a24d4d 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionBuilder.php @@ -28,6 +28,12 @@ final class StagedOrderSetReturnPaymentStateActionBuilder implements Builder */ private $returnItemId; + /** + + * @var ?string + */ + private $returnItemKey; + /** * @var ?string @@ -35,7 +41,7 @@ final class StagedOrderSetReturnPaymentStateActionBuilder implements Builder private $paymentState; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string @@ -45,6 +51,17 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey() + { + return $this->returnItemKey; + } + /** *

New Payment status of the ReturnItem.

* @@ -67,6 +84,17 @@ public function withReturnItemId(?string $returnItemId) return $this; } + /** + * @param ?string $returnItemKey + * @return $this + */ + public function withReturnItemKey(?string $returnItemKey) + { + $this->returnItemKey = $returnItemKey; + + return $this; + } + /** * @param ?string $paymentState * @return $this @@ -83,6 +111,7 @@ public function build(): StagedOrderSetReturnPaymentStateAction { return new StagedOrderSetReturnPaymentStateActionModel( $this->returnItemId, + $this->returnItemKey, $this->paymentState ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php index 0a03d35e5b3..0c46a7e13ec 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnPaymentStateActionModel.php @@ -34,6 +34,12 @@ final class StagedOrderSetReturnPaymentStateActionModel extends JsonObjectModel */ protected $returnItemId; + /** + * + * @var ?string + */ + protected $returnItemKey; + /** * * @var ?string @@ -46,10 +52,12 @@ final class StagedOrderSetReturnPaymentStateActionModel extends JsonObjectModel */ public function __construct( ?string $returnItemId = null, + ?string $returnItemKey = null, ?string $paymentState = null, ?string $action = null ) { $this->returnItemId = $returnItemId; + $this->returnItemKey = $returnItemKey; $this->paymentState = $paymentState; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -73,7 +81,7 @@ public function getAction() } /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * * @return null|string @@ -92,6 +100,26 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + * + * @return null|string + */ + public function getReturnItemKey() + { + if (is_null($this->returnItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RETURN_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->returnItemKey = (string) $data; + } + + return $this->returnItemKey; + } + /** *

New Payment status of the ReturnItem.

* @@ -121,6 +149,14 @@ public function setReturnItemId(?string $returnItemId): void $this->returnItemId = $returnItemId; } + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void + { + $this->returnItemKey = $returnItemKey; + } + /** * @param ?string $paymentState */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php index 116fa85ce19..792c29fc63b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateAction.php @@ -15,16 +15,25 @@ interface StagedOrderSetReturnShipmentStateAction extends StagedOrderUpdateAction { public const FIELD_RETURN_ITEM_ID = 'returnItemId'; + public const FIELD_RETURN_ITEM_KEY = 'returnItemKey'; public const FIELD_SHIPMENT_STATE = 'shipmentState'; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string */ public function getReturnItemId(); + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey(); + /** *

New shipment state of the ReturnItem.

* @@ -38,6 +47,11 @@ public function getShipmentState(); */ public function setReturnItemId(?string $returnItemId): void; + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void; + /** * @param ?string $shipmentState */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php index cdd41d2e5d1..df7cf4c4dfc 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionBuilder.php @@ -28,6 +28,12 @@ final class StagedOrderSetReturnShipmentStateActionBuilder implements Builder */ private $returnItemId; + /** + + * @var ?string + */ + private $returnItemKey; + /** * @var ?string @@ -35,7 +41,7 @@ final class StagedOrderSetReturnShipmentStateActionBuilder implements Builder private $shipmentState; /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * @return null|string @@ -45,6 +51,17 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + + * @return null|string + */ + public function getReturnItemKey() + { + return $this->returnItemKey; + } + /** *

New shipment state of the ReturnItem.

* @@ -67,6 +84,17 @@ public function withReturnItemId(?string $returnItemId) return $this; } + /** + * @param ?string $returnItemKey + * @return $this + */ + public function withReturnItemKey(?string $returnItemKey) + { + $this->returnItemKey = $returnItemKey; + + return $this; + } + /** * @param ?string $shipmentState * @return $this @@ -83,6 +111,7 @@ public function build(): StagedOrderSetReturnShipmentStateAction { return new StagedOrderSetReturnShipmentStateActionModel( $this->returnItemId, + $this->returnItemKey, $this->shipmentState ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php index 0e445f1b12d..5e65fdfe2ed 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetReturnShipmentStateActionModel.php @@ -34,6 +34,12 @@ final class StagedOrderSetReturnShipmentStateActionModel extends JsonObjectModel */ protected $returnItemId; + /** + * + * @var ?string + */ + protected $returnItemKey; + /** * * @var ?string @@ -46,10 +52,12 @@ final class StagedOrderSetReturnShipmentStateActionModel extends JsonObjectModel */ public function __construct( ?string $returnItemId = null, + ?string $returnItemKey = null, ?string $shipmentState = null, ?string $action = null ) { $this->returnItemId = $returnItemId; + $this->returnItemKey = $returnItemKey; $this->shipmentState = $shipmentState; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -73,7 +81,7 @@ public function getAction() } /** - *

id of the ReturnItem to update.

+ *

id of the ReturnItem to update. Either returnItemId or returnItemKey is required.

* * * @return null|string @@ -92,6 +100,26 @@ public function getReturnItemId() return $this->returnItemId; } + /** + *

key of the ReturnItem to update. Either returnItemId or returnItemKey is required.

+ * + * + * @return null|string + */ + public function getReturnItemKey() + { + if (is_null($this->returnItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_RETURN_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->returnItemKey = (string) $data; + } + + return $this->returnItemKey; + } + /** *

New shipment state of the ReturnItem.

* @@ -121,6 +149,14 @@ public function setReturnItemId(?string $returnItemId): void $this->returnItemId = $returnItemId; } + /** + * @param ?string $returnItemKey + */ + public function setReturnItemKey(?string $returnItemKey): void + { + $this->returnItemKey = $returnItemKey; + } + /** * @param ?string $shipmentState */ diff --git a/references.txt b/references.txt index 640902498fe..0865a70d833 100644 --- a/references.txt +++ b/references.txt @@ -91,3 +91,4 @@ f15664352ad27ec193e2ca1140e7dbeae4fa3167 43ec24cb27d83029991ae44c2c5af31fa2e6bebc b47352c3ed66fd9ad8e6b14402217fec39941d06 16f42e68e7e48c4ea35ca3791f0d412bdc4d44c8 +c497e6c324870e2e3d2c39d1196a329b71f3752e From 2010bbbe5ea4d8dee6f35b7db06dac8e851cb152 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 31 Jul 2023 14:34:17 +0000 Subject: [PATCH 31/44] TASK: Updating SDK --- changes.md | 2 + .../src/Models/Error/ContentTooLargeError.php | 34 ++++++ .../Error/ContentTooLargeErrorBuilder.php | 63 +++++++++++ .../Error/ContentTooLargeErrorCollection.php | 56 +++++++++ .../Error/ContentTooLargeErrorModel.php | 106 ++++++++++++++++++ .../src/Models/Error/ErrorObjectModel.php | 1 + .../Error/GraphQLContentTooLargeError.php | 21 ++++ .../GraphQLContentTooLargeErrorBuilder.php | 33 ++++++ .../GraphQLContentTooLargeErrorCollection.php | 56 +++++++++ .../GraphQLContentTooLargeErrorModel.php | 71 ++++++++++++ .../Models/Error/GraphQLErrorObjectModel.php | 1 + references.txt | 1 + 12 files changed, 445 insertions(+) create mode 100644 lib/commercetools-api/src/Models/Error/ContentTooLargeError.php create mode 100644 lib/commercetools-api/src/Models/Error/ContentTooLargeErrorBuilder.php create mode 100644 lib/commercetools-api/src/Models/Error/ContentTooLargeErrorCollection.php create mode 100644 lib/commercetools-api/src/Models/Error/ContentTooLargeErrorModel.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeError.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeErrorBuilder.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeErrorCollection.php create mode 100644 lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeErrorModel.php diff --git a/changes.md b/changes.md index 57eeb86bfc7..019639427b3 100644 --- a/changes.md +++ b/changes.md @@ -179,9 +179,11 @@ - added type `CartDiscountAddStoreAction` - added type `CartDiscountRemoveStoreAction` - added type `CartDiscountSetStoresAction` +- added type `ContentTooLargeError` - added type `MaxCartDiscountsReachedError` - added type `MaxStoreReferencesReachedError` - added type `StoreCartDiscountsLimitReachedError` +- added type `GraphQLContentTooLargeError` - added type `GraphQLMaxCartDiscountsReachedError` - added type `GraphQLMaxStoreReferencesReachedError` - added type `GraphQLStoreCartDiscountsLimitReachedError` diff --git a/lib/commercetools-api/src/Models/Error/ContentTooLargeError.php b/lib/commercetools-api/src/Models/Error/ContentTooLargeError.php new file mode 100644 index 00000000000..0533311d586 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ContentTooLargeError.php @@ -0,0 +1,34 @@ +"Content too large."

+ * + + * @return null|string + */ + public function getMessage(); + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void; +} diff --git a/lib/commercetools-api/src/Models/Error/ContentTooLargeErrorBuilder.php b/lib/commercetools-api/src/Models/Error/ContentTooLargeErrorBuilder.php new file mode 100644 index 00000000000..0d3ff2534ff --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ContentTooLargeErrorBuilder.php @@ -0,0 +1,63 @@ + + */ +final class ContentTooLargeErrorBuilder implements Builder +{ + /** + + * @var ?string + */ + private $message; + + /** + *

"Content too large."

+ * + + * @return null|string + */ + public function getMessage() + { + return $this->message; + } + + /** + * @param ?string $message + * @return $this + */ + public function withMessage(?string $message) + { + $this->message = $message; + + return $this; + } + + + public function build(): ContentTooLargeError + { + return new ContentTooLargeErrorModel( + $this->message + ); + } + + public static function of(): ContentTooLargeErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/ContentTooLargeErrorCollection.php b/lib/commercetools-api/src/Models/Error/ContentTooLargeErrorCollection.php new file mode 100644 index 00000000000..e77cc66f53b --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ContentTooLargeErrorCollection.php @@ -0,0 +1,56 @@ + + * @method ContentTooLargeError current() + * @method ContentTooLargeError end() + * @method ContentTooLargeError at($offset) + */ +class ContentTooLargeErrorCollection extends ErrorObjectCollection +{ + /** + * @psalm-assert ContentTooLargeError $value + * @psalm-param ContentTooLargeError|stdClass $value + * @throws InvalidArgumentException + * + * @return ContentTooLargeErrorCollection + */ + public function add($value) + { + if (!$value instanceof ContentTooLargeError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?ContentTooLargeError + */ + protected function mapper() + { + return function (?int $index): ?ContentTooLargeError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var ContentTooLargeError $data */ + $data = ContentTooLargeErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/ContentTooLargeErrorModel.php b/lib/commercetools-api/src/Models/Error/ContentTooLargeErrorModel.php new file mode 100644 index 00000000000..ce907c34d89 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/ContentTooLargeErrorModel.php @@ -0,0 +1,106 @@ +message = $message; + $this->code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + /** + *

"Content too large."

+ * + * + * @return null|string + */ + public function getMessage() + { + if (is_null($this->message)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_MESSAGE); + if (is_null($data)) { + return null; + } + $this->message = (string) $data; + } + + return $this->message; + } + + + /** + * @param ?string $message + */ + public function setMessage(?string $message): void + { + $this->message = $message; + } + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php index 790c8bd9752..c3ee5940711 100644 --- a/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php +++ b/lib/commercetools-api/src/Models/Error/ErrorObjectModel.php @@ -44,6 +44,7 @@ final class ErrorObjectModel extends JsonObjectModel implements ErrorObject 'AttributeNameDoesNotExist' => AttributeNameDoesNotExistErrorModel::class, 'BadGateway' => BadGatewayErrorModel::class, 'ConcurrentModification' => ConcurrentModificationErrorModel::class, + 'ContentTooLarge' => ContentTooLargeErrorModel::class, 'CountryNotConfiguredInStore' => CountryNotConfiguredInStoreErrorModel::class, 'DiscountCodeNonApplicable' => DiscountCodeNonApplicableErrorModel::class, 'DuplicateAttributeValue' => DuplicateAttributeValueErrorModel::class, diff --git a/lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeError.php b/lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeError.php new file mode 100644 index 00000000000..763616ab1e3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeError.php @@ -0,0 +1,21 @@ + + */ +final class GraphQLContentTooLargeErrorBuilder implements Builder +{ + public function build(): GraphQLContentTooLargeError + { + return new GraphQLContentTooLargeErrorModel( + ); + } + + public static function of(): GraphQLContentTooLargeErrorBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeErrorCollection.php b/lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeErrorCollection.php new file mode 100644 index 00000000000..24f3609e759 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeErrorCollection.php @@ -0,0 +1,56 @@ + + * @method GraphQLContentTooLargeError current() + * @method GraphQLContentTooLargeError end() + * @method GraphQLContentTooLargeError at($offset) + */ +class GraphQLContentTooLargeErrorCollection extends GraphQLErrorObjectCollection +{ + /** + * @psalm-assert GraphQLContentTooLargeError $value + * @psalm-param GraphQLContentTooLargeError|stdClass $value + * @throws InvalidArgumentException + * + * @return GraphQLContentTooLargeErrorCollection + */ + public function add($value) + { + if (!$value instanceof GraphQLContentTooLargeError) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?GraphQLContentTooLargeError + */ + protected function mapper() + { + return function (?int $index): ?GraphQLContentTooLargeError { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var GraphQLContentTooLargeError $data */ + $data = GraphQLContentTooLargeErrorModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeErrorModel.php b/lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeErrorModel.php new file mode 100644 index 00000000000..92684faf606 --- /dev/null +++ b/lib/commercetools-api/src/Models/Error/GraphQLContentTooLargeErrorModel.php @@ -0,0 +1,71 @@ +code = $code ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getCode() + { + if (is_null($this->code)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CODE); + if (is_null($data)) { + return null; + } + $this->code = (string) $data; + } + + return $this->code; + } + + + + /** + * @return mixed + */ + public function by(string $key) + { + $data = $this->raw($key); + if (is_null($data)) { + return null; + } + + return $data; + } +} diff --git a/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php b/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php index 6a13b97c692..ffe735a5c5a 100644 --- a/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php +++ b/lib/commercetools-api/src/Models/Error/GraphQLErrorObjectModel.php @@ -38,6 +38,7 @@ final class GraphQLErrorObjectModel extends JsonObjectModel implements GraphQLEr 'AttributeNameDoesNotExist' => GraphQLAttributeNameDoesNotExistErrorModel::class, 'BadGateway' => GraphQLBadGatewayErrorModel::class, 'ConcurrentModification' => GraphQLConcurrentModificationErrorModel::class, + 'ContentTooLarge' => GraphQLContentTooLargeErrorModel::class, 'CountryNotConfiguredInStore' => GraphQLCountryNotConfiguredInStoreErrorModel::class, 'DiscountCodeNonApplicable' => GraphQLDiscountCodeNonApplicableErrorModel::class, 'DuplicateAttributeValue' => GraphQLDuplicateAttributeValueErrorModel::class, diff --git a/references.txt b/references.txt index 0865a70d833..636bac29333 100644 --- a/references.txt +++ b/references.txt @@ -92,3 +92,4 @@ f15664352ad27ec193e2ca1140e7dbeae4fa3167 b47352c3ed66fd9ad8e6b14402217fec39941d06 16f42e68e7e48c4ea35ca3791f0d412bdc4d44c8 c497e6c324870e2e3d2c39d1196a329b71f3752e +661857d6a78af850d990d9408d4193192c169afb From ef93859bdc35ecda53b4279f3af1b5a5c6a1f67b Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 1 Aug 2023 10:42:28 +0000 Subject: [PATCH 32/44] TASK: Updating SDK --- changes.md | 1 + .../src/Models/Me/MyBusinessUnitAssociateDraft.php | 2 +- .../src/Models/Me/MyBusinessUnitAssociateDraftBuilder.php | 2 +- .../src/Models/Me/MyBusinessUnitAssociateDraftModel.php | 2 +- references.txt | 1 + 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/changes.md b/changes.md index 019639427b3..6e473325654 100644 --- a/changes.md +++ b/changes.md @@ -131,6 +131,7 @@ - changed property `customLineItemId` of type `OrderTransitionCustomLineItemStateAction` to be optional - changed property `lineItemId` of type `OrderTransitionLineItemStateAction` to be optional - changed property `comment` of type `QuoteRequestDraft` to be optional +- :warning: changed property `associateRoleAssignments` of type `AssociateDraft` to be required - :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required - :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required - :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraft.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraft.php index ec9fd72c50f..29fe2e28bae 100644 --- a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraft.php +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraft.php @@ -35,7 +35,7 @@ public function getVersion(); public function getCustomer(); /** - *

Roles assigned to the new Associate within a Business Unit.

+ *

Roles assigned to the new Associate within a Business Unit. Can only contain AssociateRoles with the buyerAssignable property set to true.

* * @return null|AssociateRoleAssignmentDraftCollection diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftBuilder.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftBuilder.php index 7ca331418e8..1c86d3cee82 100644 --- a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftBuilder.php @@ -62,7 +62,7 @@ public function getCustomer() } /** - *

Roles assigned to the new Associate within a Business Unit.

+ *

Roles assigned to the new Associate within a Business Unit. Can only contain AssociateRoles with the buyerAssignable property set to true.

* * @return null|AssociateRoleAssignmentDraftCollection diff --git a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftModel.php b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftModel.php index e20732b8a1b..3dec249ba85 100644 --- a/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftModel.php +++ b/lib/commercetools-api/src/Models/Me/MyBusinessUnitAssociateDraftModel.php @@ -94,7 +94,7 @@ public function getCustomer() } /** - *

Roles assigned to the new Associate within a Business Unit.

+ *

Roles assigned to the new Associate within a Business Unit. Can only contain AssociateRoles with the buyerAssignable property set to true.

* * * @return null|AssociateRoleAssignmentDraftCollection diff --git a/references.txt b/references.txt index 636bac29333..2d3b73a3514 100644 --- a/references.txt +++ b/references.txt @@ -93,3 +93,4 @@ b47352c3ed66fd9ad8e6b14402217fec39941d06 16f42e68e7e48c4ea35ca3791f0d412bdc4d44c8 c497e6c324870e2e3d2c39d1196a329b71f3752e 661857d6a78af850d990d9408d4193192c169afb +4d5cb623c03b9be3d9ad491c2918ba03343f8323 From 4315e8d8315b27a80dec832acfc052b6b5db4c24 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 1 Aug 2023 12:07:52 +0000 Subject: [PATCH 33/44] TASK: Updating SDK --- changes.md | 10 + .../src/Models/Message/MessageModel.php | 5 + .../Models/Message/MessagePayloadModel.php | 5 + .../Message/OrderCustomFieldAddedMessage.php | 44 ++ .../OrderCustomFieldAddedMessageBuilder.php | 433 ++++++++++++++ ...OrderCustomFieldAddedMessageCollection.php | 56 ++ .../OrderCustomFieldAddedMessageModel.php | 526 ++++++++++++++++ .../OrderCustomFieldAddedMessagePayload.php | 44 ++ ...rCustomFieldAddedMessagePayloadBuilder.php | 92 +++ ...stomFieldAddedMessagePayloadCollection.php | 56 ++ ...derCustomFieldAddedMessagePayloadModel.php | 129 ++++ .../OrderCustomFieldChangedMessage.php | 59 ++ .../OrderCustomFieldChangedMessageBuilder.php | 463 ++++++++++++++ ...derCustomFieldChangedMessageCollection.php | 56 ++ .../OrderCustomFieldChangedMessageModel.php | 563 ++++++++++++++++++ .../OrderCustomFieldChangedMessagePayload.php | 59 ++ ...ustomFieldChangedMessagePayloadBuilder.php | 122 ++++ ...omFieldChangedMessagePayloadCollection.php | 56 ++ ...rCustomFieldChangedMessagePayloadModel.php | 166 ++++++ .../OrderCustomFieldRemovedMessage.php | 30 + .../OrderCustomFieldRemovedMessageBuilder.php | 404 +++++++++++++ ...derCustomFieldRemovedMessageCollection.php | 56 ++ .../OrderCustomFieldRemovedMessageModel.php | 490 +++++++++++++++ .../OrderCustomFieldRemovedMessagePayload.php | 30 + ...ustomFieldRemovedMessagePayloadBuilder.php | 63 ++ ...omFieldRemovedMessagePayloadCollection.php | 56 ++ ...rCustomFieldRemovedMessagePayloadModel.php | 93 +++ .../Message/OrderCustomTypeRemovedMessage.php | 31 + .../OrderCustomTypeRemovedMessageBuilder.php | 405 +++++++++++++ ...rderCustomTypeRemovedMessageCollection.php | 56 ++ .../OrderCustomTypeRemovedMessageModel.php | 491 +++++++++++++++ .../OrderCustomTypeRemovedMessagePayload.php | 31 + ...CustomTypeRemovedMessagePayloadBuilder.php | 64 ++ ...tomTypeRemovedMessagePayloadCollection.php | 56 ++ ...erCustomTypeRemovedMessagePayloadModel.php | 94 +++ .../Message/OrderCustomTypeSetMessage.php | 46 ++ .../OrderCustomTypeSetMessageBuilder.php | 447 ++++++++++++++ .../OrderCustomTypeSetMessageCollection.php | 56 ++ .../OrderCustomTypeSetMessageModel.php | 530 +++++++++++++++++ .../OrderCustomTypeSetMessagePayload.php | 46 ++ ...rderCustomTypeSetMessagePayloadBuilder.php | 105 ++++ ...rCustomTypeSetMessagePayloadCollection.php | 56 ++ .../OrderCustomTypeSetMessagePayloadModel.php | 133 +++++ references.txt | 1 + 44 files changed, 6814 insertions(+) create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadModel.php diff --git a/changes.md b/changes.md index 6e473325654..b539d967fb0 100644 --- a/changes.md +++ b/changes.md @@ -189,7 +189,17 @@ - added type `GraphQLMaxStoreReferencesReachedError` - added type `GraphQLStoreCartDiscountsLimitReachedError` - added type `BusinessUnitParentChangedMessage` +- added type `OrderCustomFieldAddedMessage` +- added type `OrderCustomFieldChangedMessage` +- added type `OrderCustomFieldRemovedMessage` +- added type `OrderCustomTypeRemovedMessage` +- added type `OrderCustomTypeSetMessage` - added type `BusinessUnitParentChangedMessagePayload` +- added type `OrderCustomFieldAddedMessagePayload` +- added type `OrderCustomFieldChangedMessagePayload` +- added type `OrderCustomFieldRemovedMessagePayload` +- added type `OrderCustomTypeRemovedMessagePayload` +- added type `OrderCustomTypeSetMessagePayload` - added type `StagedOrderSetDirectDiscountsAction` - added type `StagedOrderSetStoreAction` diff --git a/lib/commercetools-api/src/Models/Message/MessageModel.php b/lib/commercetools-api/src/Models/Message/MessageModel.php index 30a338b015d..f1ed15e0228 100644 --- a/lib/commercetools-api/src/Models/Message/MessageModel.php +++ b/lib/commercetools-api/src/Models/Message/MessageModel.php @@ -158,10 +158,15 @@ final class MessageModel extends JsonObjectModel implements Message 'LineItemStateTransition' => LineItemStateTransitionMessageModel::class, 'OrderBillingAddressSet' => OrderBillingAddressSetMessageModel::class, 'OrderCreated' => OrderCreatedMessageModel::class, + 'OrderCustomFieldAdded' => OrderCustomFieldAddedMessageModel::class, + 'OrderCustomFieldChanged' => OrderCustomFieldChangedMessageModel::class, + 'OrderCustomFieldRemoved' => OrderCustomFieldRemovedMessageModel::class, 'OrderCustomLineItemAdded' => OrderCustomLineItemAddedMessageModel::class, 'OrderCustomLineItemDiscountSet' => OrderCustomLineItemDiscountSetMessageModel::class, 'OrderCustomLineItemQuantityChanged' => OrderCustomLineItemQuantityChangedMessageModel::class, 'OrderCustomLineItemRemoved' => OrderCustomLineItemRemovedMessageModel::class, + 'OrderCustomTypeRemoved' => OrderCustomTypeRemovedMessageModel::class, + 'OrderCustomTypeSet' => OrderCustomTypeSetMessageModel::class, 'OrderCustomerEmailSet' => OrderCustomerEmailSetMessageModel::class, 'OrderCustomerGroupSet' => OrderCustomerGroupSetMessageModel::class, 'OrderCustomerSet' => OrderCustomerSetMessageModel::class, diff --git a/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php index 893b547045d..b74c2da4dcf 100644 --- a/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php @@ -89,10 +89,15 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa 'LineItemStateTransition' => LineItemStateTransitionMessagePayloadModel::class, 'OrderBillingAddressSet' => OrderBillingAddressSetMessagePayloadModel::class, 'OrderCreated' => OrderCreatedMessagePayloadModel::class, + 'OrderCustomFieldAdded' => OrderCustomFieldAddedMessagePayloadModel::class, + 'OrderCustomFieldChanged' => OrderCustomFieldChangedMessagePayloadModel::class, + 'OrderCustomFieldRemoved' => OrderCustomFieldRemovedMessagePayloadModel::class, 'OrderCustomLineItemAdded' => OrderCustomLineItemAddedMessagePayloadModel::class, 'OrderCustomLineItemDiscountSet' => OrderCustomLineItemDiscountSetMessagePayloadModel::class, 'OrderCustomLineItemQuantityChanged' => OrderCustomLineItemQuantityChangedMessagePayloadModel::class, 'OrderCustomLineItemRemoved' => OrderCustomLineItemRemovedMessagePayloadModel::class, + 'OrderCustomTypeRemoved' => OrderCustomTypeRemovedMessagePayloadModel::class, + 'OrderCustomTypeSet' => OrderCustomTypeSetMessagePayloadModel::class, 'OrderCustomerEmailSet' => OrderCustomerEmailSetMessagePayloadModel::class, 'OrderCustomerGroupSet' => OrderCustomerGroupSetMessagePayloadModel::class, 'OrderCustomerSet' => OrderCustomerSetMessagePayloadModel::class, diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessage.php new file mode 100644 index 00000000000..6636fbc19ad --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessage.php @@ -0,0 +1,44 @@ +Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageBuilder.php new file mode 100644 index 00000000000..f8ce5b29d34 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageBuilder.php @@ -0,0 +1,433 @@ + + */ +final class OrderCustomFieldAddedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): OrderCustomFieldAddedMessage + { + return new OrderCustomFieldAddedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name, + $this->value + ); + } + + public static function of(): OrderCustomFieldAddedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageCollection.php new file mode 100644 index 00000000000..63f66e5b638 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomFieldAddedMessage current() + * @method OrderCustomFieldAddedMessage end() + * @method OrderCustomFieldAddedMessage at($offset) + */ +class OrderCustomFieldAddedMessageCollection extends OrderMessageCollection +{ + /** + * @psalm-assert OrderCustomFieldAddedMessage $value + * @psalm-param OrderCustomFieldAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomFieldAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomFieldAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomFieldAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomFieldAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomFieldAddedMessage $data */ + $data = OrderCustomFieldAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageModel.php new file mode 100644 index 00000000000..1d718ff4518 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessageModel.php @@ -0,0 +1,526 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->value = $value; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been added.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayload.php new file mode 100644 index 00000000000..3f241f94630 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayload.php @@ -0,0 +1,44 @@ +Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadBuilder.php new file mode 100644 index 00000000000..dd93bba7346 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadBuilder.php @@ -0,0 +1,92 @@ + + */ +final class OrderCustomFieldAddedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + + public function build(): OrderCustomFieldAddedMessagePayload + { + return new OrderCustomFieldAddedMessagePayloadModel( + $this->name, + $this->value + ); + } + + public static function of(): OrderCustomFieldAddedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..f6c351ce720 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomFieldAddedMessagePayload current() + * @method OrderCustomFieldAddedMessagePayload end() + * @method OrderCustomFieldAddedMessagePayload at($offset) + */ +class OrderCustomFieldAddedMessagePayloadCollection extends OrderMessagePayloadCollection +{ + /** + * @psalm-assert OrderCustomFieldAddedMessagePayload $value + * @psalm-param OrderCustomFieldAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomFieldAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomFieldAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomFieldAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomFieldAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomFieldAddedMessagePayload $data */ + $data = OrderCustomFieldAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadModel.php new file mode 100644 index 00000000000..c1fc72d6430 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldAddedMessagePayloadModel.php @@ -0,0 +1,129 @@ +name = $name; + $this->value = $value; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Name of the Custom Field that has been added.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessage.php new file mode 100644 index 00000000000..1ff6cc3e130 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessage.php @@ -0,0 +1,59 @@ +Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Order before, an Order Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageBuilder.php new file mode 100644 index 00000000000..431b6ba9af5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageBuilder.php @@ -0,0 +1,463 @@ + + */ +final class OrderCustomFieldChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + + * @var null|mixed|mixed + */ + private $previousValue; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Order before, an Order Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * @param mixed $previousValue + * @return $this + */ + public function withPreviousValue($previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): OrderCustomFieldChangedMessage + { + return new OrderCustomFieldChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name, + $this->value, + $this->previousValue + ); + } + + public static function of(): OrderCustomFieldChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageCollection.php new file mode 100644 index 00000000000..e2e5ac4d077 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomFieldChangedMessage current() + * @method OrderCustomFieldChangedMessage end() + * @method OrderCustomFieldChangedMessage at($offset) + */ +class OrderCustomFieldChangedMessageCollection extends OrderMessageCollection +{ + /** + * @psalm-assert OrderCustomFieldChangedMessage $value + * @psalm-param OrderCustomFieldChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomFieldChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomFieldChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomFieldChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomFieldChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomFieldChangedMessage $data */ + $data = OrderCustomFieldChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageModel.php new file mode 100644 index 00000000000..1a9797507ae --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessageModel.php @@ -0,0 +1,563 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->value = $value; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been changed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Order before, an Order Custom Field Added Message is generated instead.

+ * + * + * @return null|mixed + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = $data; + } + + return $this->previousValue; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void + { + $this->previousValue = $previousValue; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayload.php new file mode 100644 index 00000000000..1290e7bb3b7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayload.php @@ -0,0 +1,59 @@ +Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Order before, an Order Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..b8dff3a1a59 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadBuilder.php @@ -0,0 +1,122 @@ + + */ +final class OrderCustomFieldChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + + * @var null|mixed|mixed + */ + private $previousValue; + + /** + *

Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Order before, an Order Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * @param mixed $previousValue + * @return $this + */ + public function withPreviousValue($previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + + public function build(): OrderCustomFieldChangedMessagePayload + { + return new OrderCustomFieldChangedMessagePayloadModel( + $this->name, + $this->value, + $this->previousValue + ); + } + + public static function of(): OrderCustomFieldChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..101287b7b72 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomFieldChangedMessagePayload current() + * @method OrderCustomFieldChangedMessagePayload end() + * @method OrderCustomFieldChangedMessagePayload at($offset) + */ +class OrderCustomFieldChangedMessagePayloadCollection extends OrderMessagePayloadCollection +{ + /** + * @psalm-assert OrderCustomFieldChangedMessagePayload $value + * @psalm-param OrderCustomFieldChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomFieldChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomFieldChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomFieldChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomFieldChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomFieldChangedMessagePayload $data */ + $data = OrderCustomFieldChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadModel.php new file mode 100644 index 00000000000..04d6cda303a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldChangedMessagePayloadModel.php @@ -0,0 +1,166 @@ +name = $name; + $this->value = $value; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Name of the Custom Field that has been changed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Order before, an Order Custom Field Added Message is generated instead.

+ * + * + * @return null|mixed + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = $data; + } + + return $this->previousValue; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void + { + $this->previousValue = $previousValue; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessage.php new file mode 100644 index 00000000000..db3381999b9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessage.php @@ -0,0 +1,30 @@ +Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageBuilder.php new file mode 100644 index 00000000000..8d98b462f6e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageBuilder.php @@ -0,0 +1,404 @@ + + */ +final class OrderCustomFieldRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $name; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): OrderCustomFieldRemovedMessage + { + return new OrderCustomFieldRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name + ); + } + + public static function of(): OrderCustomFieldRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageCollection.php new file mode 100644 index 00000000000..0959d32bec0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomFieldRemovedMessage current() + * @method OrderCustomFieldRemovedMessage end() + * @method OrderCustomFieldRemovedMessage at($offset) + */ +class OrderCustomFieldRemovedMessageCollection extends OrderMessageCollection +{ + /** + * @psalm-assert OrderCustomFieldRemovedMessage $value + * @psalm-param OrderCustomFieldRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomFieldRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomFieldRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomFieldRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomFieldRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomFieldRemovedMessage $data */ + $data = OrderCustomFieldRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageModel.php new file mode 100644 index 00000000000..23529e417f4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessageModel.php @@ -0,0 +1,490 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been removed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayload.php new file mode 100644 index 00000000000..f8292e0e1a8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayload.php @@ -0,0 +1,30 @@ +Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..7ee1c0748fa --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadBuilder.php @@ -0,0 +1,63 @@ + + */ +final class OrderCustomFieldRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + *

Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + + public function build(): OrderCustomFieldRemovedMessagePayload + { + return new OrderCustomFieldRemovedMessagePayloadModel( + $this->name + ); + } + + public static function of(): OrderCustomFieldRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..f394dab0c51 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomFieldRemovedMessagePayload current() + * @method OrderCustomFieldRemovedMessagePayload end() + * @method OrderCustomFieldRemovedMessagePayload at($offset) + */ +class OrderCustomFieldRemovedMessagePayloadCollection extends OrderMessagePayloadCollection +{ + /** + * @psalm-assert OrderCustomFieldRemovedMessagePayload $value + * @psalm-param OrderCustomFieldRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomFieldRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomFieldRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomFieldRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomFieldRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomFieldRemovedMessagePayload $data */ + $data = OrderCustomFieldRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..d54c4498099 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomFieldRemovedMessagePayloadModel.php @@ -0,0 +1,93 @@ +name = $name; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Name of the Custom Field that has been removed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessage.php new file mode 100644 index 00000000000..0bab94fa82c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessage.php @@ -0,0 +1,31 @@ +id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageBuilder.php new file mode 100644 index 00000000000..0df280d2e70 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageBuilder.php @@ -0,0 +1,405 @@ + + */ +final class OrderCustomTypeRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): OrderCustomTypeRemovedMessage + { + return new OrderCustomTypeRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->previousTypeId + ); + } + + public static function of(): OrderCustomTypeRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageCollection.php new file mode 100644 index 00000000000..22528111faa --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomTypeRemovedMessage current() + * @method OrderCustomTypeRemovedMessage end() + * @method OrderCustomTypeRemovedMessage at($offset) + */ +class OrderCustomTypeRemovedMessageCollection extends OrderMessageCollection +{ + /** + * @psalm-assert OrderCustomTypeRemovedMessage $value + * @psalm-param OrderCustomTypeRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomTypeRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomTypeRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomTypeRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomTypeRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomTypeRemovedMessage $data */ + $data = OrderCustomTypeRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageModel.php new file mode 100644 index 00000000000..7b9091fb75d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessageModel.php @@ -0,0 +1,491 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayload.php new file mode 100644 index 00000000000..557023fe09f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayload.php @@ -0,0 +1,31 @@ +id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..c6907e53602 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadBuilder.php @@ -0,0 +1,64 @@ + + */ +final class OrderCustomTypeRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + + public function build(): OrderCustomTypeRemovedMessagePayload + { + return new OrderCustomTypeRemovedMessagePayloadModel( + $this->previousTypeId + ); + } + + public static function of(): OrderCustomTypeRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..c19b1ba091c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomTypeRemovedMessagePayload current() + * @method OrderCustomTypeRemovedMessagePayload end() + * @method OrderCustomTypeRemovedMessagePayload at($offset) + */ +class OrderCustomTypeRemovedMessagePayloadCollection extends OrderMessagePayloadCollection +{ + /** + * @psalm-assert OrderCustomTypeRemovedMessagePayload $value + * @psalm-param OrderCustomTypeRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomTypeRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomTypeRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomTypeRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomTypeRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomTypeRemovedMessagePayload $data */ + $data = OrderCustomTypeRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..b5c816de228 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeRemovedMessagePayloadModel.php @@ -0,0 +1,94 @@ +previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessage.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessage.php new file mode 100644 index 00000000000..717e83ab2b8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessage.php @@ -0,0 +1,46 @@ +The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields(); + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void; + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageBuilder.php new file mode 100644 index 00000000000..ff2fa6cac3e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageBuilder.php @@ -0,0 +1,447 @@ + + */ +final class OrderCustomTypeSetMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $customFields; + + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields() + { + return $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?CustomFields $customFields + * @return $this + */ + public function withCustomFields(?CustomFields $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withCustomFields() instead + * @return $this + */ + public function withCustomFieldsBuilder(?CustomFieldsBuilder $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + public function build(): OrderCustomTypeSetMessage + { + return new OrderCustomTypeSetMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields, + $this->previousTypeId + ); + } + + public static function of(): OrderCustomTypeSetMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageCollection.php new file mode 100644 index 00000000000..97237125fc0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomTypeSetMessage current() + * @method OrderCustomTypeSetMessage end() + * @method OrderCustomTypeSetMessage at($offset) + */ +class OrderCustomTypeSetMessageCollection extends OrderMessageCollection +{ + /** + * @psalm-assert OrderCustomTypeSetMessage $value + * @psalm-param OrderCustomTypeSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomTypeSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomTypeSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomTypeSetMessage + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomTypeSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomTypeSetMessage $data */ + $data = OrderCustomTypeSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageModel.php new file mode 100644 index 00000000000..7dbdb8191f6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessageModel.php @@ -0,0 +1,530 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->customFields = $customFields; + $this->previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

The Custom Fields that have been set.

+ * + * + * @return null|CustomFields + */ + public function getCustomFields() + { + if (is_null($this->customFields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM_FIELDS); + if (is_null($data)) { + return null; + } + + $this->customFields = CustomFieldsModel::of($data); + } + + return $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void + { + $this->customFields = $customFields; + } + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayload.php new file mode 100644 index 00000000000..6e617674ec4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayload.php @@ -0,0 +1,46 @@ +The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields(); + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void; + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadBuilder.php new file mode 100644 index 00000000000..c7a3481a076 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadBuilder.php @@ -0,0 +1,105 @@ + + */ +final class OrderCustomTypeSetMessagePayloadBuilder implements Builder +{ + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $customFields; + + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields() + { + return $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?CustomFields $customFields + * @return $this + */ + public function withCustomFields(?CustomFields $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + /** + * @deprecated use withCustomFields() instead + * @return $this + */ + public function withCustomFieldsBuilder(?CustomFieldsBuilder $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + public function build(): OrderCustomTypeSetMessagePayload + { + return new OrderCustomTypeSetMessagePayloadModel( + $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields, + $this->previousTypeId + ); + } + + public static function of(): OrderCustomTypeSetMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadCollection.php new file mode 100644 index 00000000000..8a4a422fa69 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method OrderCustomTypeSetMessagePayload current() + * @method OrderCustomTypeSetMessagePayload end() + * @method OrderCustomTypeSetMessagePayload at($offset) + */ +class OrderCustomTypeSetMessagePayloadCollection extends OrderMessagePayloadCollection +{ + /** + * @psalm-assert OrderCustomTypeSetMessagePayload $value + * @psalm-param OrderCustomTypeSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return OrderCustomTypeSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof OrderCustomTypeSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?OrderCustomTypeSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?OrderCustomTypeSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var OrderCustomTypeSetMessagePayload $data */ + $data = OrderCustomTypeSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadModel.php new file mode 100644 index 00000000000..724a8708766 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/OrderCustomTypeSetMessagePayloadModel.php @@ -0,0 +1,133 @@ +customFields = $customFields; + $this->previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

The Custom Fields that have been set.

+ * + * + * @return null|CustomFields + */ + public function getCustomFields() + { + if (is_null($this->customFields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM_FIELDS); + if (is_null($data)) { + return null; + } + + $this->customFields = CustomFieldsModel::of($data); + } + + return $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void + { + $this->customFields = $customFields; + } + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } +} diff --git a/references.txt b/references.txt index 2d3b73a3514..cbca7a7e7a9 100644 --- a/references.txt +++ b/references.txt @@ -94,3 +94,4 @@ b47352c3ed66fd9ad8e6b14402217fec39941d06 c497e6c324870e2e3d2c39d1196a329b71f3752e 661857d6a78af850d990d9408d4193192c169afb 4d5cb623c03b9be3d9ad491c2918ba03343f8323 +25f0dfe7f3d3887530495d18f88a04eaa5d8d1c8 From 76a5d77f3fb72d1fc98f28bd58a0a015d8a6c075 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Wed, 2 Aug 2023 14:31:24 +0000 Subject: [PATCH 34/44] TASK: Updating SDK --- changes.md | 15 +++++++++++++++ .../src/Models/BusinessUnit/Associate.php | 2 +- .../src/Models/BusinessUnit/AssociateBuilder.php | 4 ++-- .../src/Models/BusinessUnit/AssociateDraft.php | 2 +- .../Models/BusinessUnit/AssociateDraftBuilder.php | 4 ++-- .../Models/BusinessUnit/AssociateDraftModel.php | 4 ++-- .../src/Models/BusinessUnit/AssociateModel.php | 4 ++-- references.txt | 1 + 8 files changed, 26 insertions(+), 10 deletions(-) diff --git a/changes.md b/changes.md index b539d967fb0..9273bfdafee 100644 --- a/changes.md +++ b/changes.md @@ -139,6 +139,14 @@ +
+Deprecated Property(s) + +- property `Associate::roles` is removed +- property `AssociateDraft::roles` is removed +
+ +
Changed Property(s) @@ -163,6 +171,13 @@
+
+Deprecated Type(s) + +- type `AssociateRoleDeprecated` is removed +
+ +
Removed Type(s) diff --git a/lib/commercetools-api/src/Models/BusinessUnit/Associate.php b/lib/commercetools-api/src/Models/BusinessUnit/Associate.php index 41c496a1b69..0d1a0479156 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/Associate.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/Associate.php @@ -29,7 +29,7 @@ public function getAssociateRoleAssignments(); /** *

Deprecated type. Use associateRoleAssignment instead.

* - * @deprecated + * @return null|array */ public function getRoles(); diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php index 3ced6a1593c..57830987d4f 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php @@ -29,7 +29,7 @@ final class AssociateBuilder implements Builder private $associateRoleAssignments; /** - * @deprecated + * @var ?array */ private $roles; @@ -54,7 +54,7 @@ public function getAssociateRoleAssignments() /** *

Deprecated type. Use associateRoleAssignment instead.

* - * @deprecated + * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php index ae7b9b7250e..5290ddda1de 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php @@ -29,7 +29,7 @@ public function getAssociateRoleAssignments(); /** *

Deprecated type. Use associateRoleAssignment instead.

* - * @deprecated + * @return null|array */ public function getRoles(); diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php index 832b3565051..92ee24bf70b 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php @@ -29,7 +29,7 @@ final class AssociateDraftBuilder implements Builder private $associateRoleAssignments; /** - * @deprecated + * @var ?array */ private $roles; @@ -54,7 +54,7 @@ public function getAssociateRoleAssignments() /** *

Deprecated type. Use associateRoleAssignment instead.

* - * @deprecated + * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php index 5eda3134f28..4c70cd7a2ed 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php @@ -28,7 +28,7 @@ final class AssociateDraftModel extends JsonObjectModel implements AssociateDraf protected $associateRoleAssignments; /** - * @deprecated + * * @var ?array */ protected $roles; @@ -76,7 +76,7 @@ public function getAssociateRoleAssignments() /** *

Deprecated type. Use associateRoleAssignment instead.

* - * @deprecated + * * @return null|array */ public function getRoles() diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php index 780974f2c12..c28f9abb33c 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php @@ -28,7 +28,7 @@ final class AssociateModel extends JsonObjectModel implements Associate protected $associateRoleAssignments; /** - * @deprecated + * * @var ?array */ protected $roles; @@ -76,7 +76,7 @@ public function getAssociateRoleAssignments() /** *

Deprecated type. Use associateRoleAssignment instead.

* - * @deprecated + * * @return null|array */ public function getRoles() diff --git a/references.txt b/references.txt index cbca7a7e7a9..12a7cb8326c 100644 --- a/references.txt +++ b/references.txt @@ -95,3 +95,4 @@ c497e6c324870e2e3d2c39d1196a329b71f3752e 661857d6a78af850d990d9408d4193192c169afb 4d5cb623c03b9be3d9ad491c2918ba03343f8323 25f0dfe7f3d3887530495d18f88a04eaa5d8d1c8 +4b5adb8760c0f8e20541b4c7da8445f89bed5bb4 From cd9f72e2dd5a119859bb35a47a6ef8d95e983a95 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Thu, 3 Aug 2023 15:17:26 +0000 Subject: [PATCH 35/44] TASK: Updating SDK --- references.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/references.txt b/references.txt index 12a7cb8326c..37b04c2191b 100644 --- a/references.txt +++ b/references.txt @@ -96,3 +96,4 @@ c497e6c324870e2e3d2c39d1196a329b71f3752e 4d5cb623c03b9be3d9ad491c2918ba03343f8323 25f0dfe7f3d3887530495d18f88a04eaa5d8d1c8 4b5adb8760c0f8e20541b4c7da8445f89bed5bb4 +3a530eba3854922a79388a1400f06b18b48f12f7 From d945c60d0507ccf931f032de781ce0423c565209 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 4 Aug 2023 14:39:52 +0000 Subject: [PATCH 36/44] TASK: Updating SDK --- changes.md | 8 ++ ...ndividualExclusionProductSelectionType.php | 31 ------ ...alExclusionProductSelectionTypeBuilder.php | 75 -------------- ...xclusionProductSelectionTypeCollection.php | 56 ----------- ...dualExclusionProductSelectionTypeModel.php | 98 ------------------- .../IndividualProductSelectionType.php | 31 ------ .../IndividualProductSelectionTypeBuilder.php | 75 -------------- ...dividualProductSelectionTypeCollection.php | 56 ----------- .../IndividualProductSelectionTypeModel.php | 98 ------------------- .../ProductSelection/ProductSelection.php | 2 +- .../ProductSelectionBuilder.php | 4 +- .../ProductSelectionDraft.php | 2 +- .../ProductSelectionDraftBuilder.php | 4 +- .../ProductSelectionDraftModel.php | 4 +- .../ProductSelectionModel.php | 4 +- .../ProductSelection/ProductSelectionType.php | 2 +- .../ProductSelectionTypeModel.php | 6 +- references.txt | 1 + 18 files changed, 22 insertions(+), 535 deletions(-) delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionType.php delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeBuilder.php delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeCollection.php delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeModel.php delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionType.php delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeBuilder.php delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeCollection.php delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeModel.php diff --git a/changes.md b/changes.md index 9273bfdafee..a2cecae006c 100644 --- a/changes.md +++ b/changes.md @@ -144,6 +144,11 @@ - property `Associate::roles` is removed - property `AssociateDraft::roles` is removed +- property `IndividualExclusionProductSelectionType::type` is removed +- property `IndividualProductSelectionType::type` is removed +- property `ProductSelection::type` is removed +- property `ProductSelectionDraft::type` is removed +- property `ProductSelectionType::type` is removed
@@ -175,6 +180,9 @@ Deprecated Type(s) - type `AssociateRoleDeprecated` is removed +- type `IndividualExclusionProductSelectionType` is removed +- type `IndividualProductSelectionType` is removed +- type `ProductSelectionTypeEnum` is removed diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionType.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionType.php deleted file mode 100644 index 2a5537f5a9d..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionType.php +++ /dev/null @@ -1,31 +0,0 @@ -The name of the ProductSelection which is recommended to be unique.

- * - - * @return null|LocalizedString - */ - public function getName(); - - /** - * @param ?LocalizedString $name - */ - public function setName(?LocalizedString $name): void; -} diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeBuilder.php deleted file mode 100644 index 1300ef8e4f0..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ -final class IndividualExclusionProductSelectionTypeBuilder implements Builder -{ - /** - - * @var null|LocalizedString|LocalizedStringBuilder - */ - private $name; - - /** - *

The name of the ProductSelection which is recommended to be unique.

- * - - * @return null|LocalizedString - */ - public function getName() - { - return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; - } - - /** - * @param ?LocalizedString $name - * @return $this - */ - public function withName(?LocalizedString $name) - { - $this->name = $name; - - return $this; - } - - /** - * @deprecated use withName() instead - * @return $this - */ - public function withNameBuilder(?LocalizedStringBuilder $name) - { - $this->name = $name; - - return $this; - } - - public function build(): IndividualExclusionProductSelectionType - { - return new IndividualExclusionProductSelectionTypeModel( - $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name - ); - } - - public static function of(): IndividualExclusionProductSelectionTypeBuilder - { - return new self(); - } -} diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeCollection.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeCollection.php deleted file mode 100644 index 287eab51881..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method IndividualExclusionProductSelectionType current() - * @method IndividualExclusionProductSelectionType end() - * @method IndividualExclusionProductSelectionType at($offset) - */ -class IndividualExclusionProductSelectionTypeCollection extends ProductSelectionTypeCollection -{ - /** - * @psalm-assert IndividualExclusionProductSelectionType $value - * @psalm-param IndividualExclusionProductSelectionType|stdClass $value - * @throws InvalidArgumentException - * - * @return IndividualExclusionProductSelectionTypeCollection - */ - public function add($value) - { - if (!$value instanceof IndividualExclusionProductSelectionType) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?IndividualExclusionProductSelectionType - */ - protected function mapper() - { - return function (?int $index): ?IndividualExclusionProductSelectionType { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var IndividualExclusionProductSelectionType $data */ - $data = IndividualExclusionProductSelectionTypeModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeModel.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeModel.php deleted file mode 100644 index 0841dbb1417..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualExclusionProductSelectionTypeModel.php +++ /dev/null @@ -1,98 +0,0 @@ -name = $name; - $this->type = $type ?? self::DISCRIMINATOR_VALUE; - } - - /** - *

The following types of Product Selections are supported:

- * - * @deprecated - * @return null|string - */ - public function getType() - { - if (is_null($this->type)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TYPE); - if (is_null($data)) { - return null; - } - $this->type = (string) $data; - } - - return $this->type; - } - - /** - *

The name of the ProductSelection which is recommended to be unique.

- * - * - * @return null|LocalizedString - */ - public function getName() - { - if (is_null($this->name)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_NAME); - if (is_null($data)) { - return null; - } - - $this->name = LocalizedStringModel::of($data); - } - - return $this->name; - } - - - /** - * @param ?LocalizedString $name - */ - public function setName(?LocalizedString $name): void - { - $this->name = $name; - } -} diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionType.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionType.php deleted file mode 100644 index d6251a8c0b0..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionType.php +++ /dev/null @@ -1,31 +0,0 @@ -The name of the ProductSelection which is recommended to be unique.

- * - - * @return null|LocalizedString - */ - public function getName(); - - /** - * @param ?LocalizedString $name - */ - public function setName(?LocalizedString $name): void; -} diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeBuilder.php deleted file mode 100644 index 579a3a0cdcd..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeBuilder.php +++ /dev/null @@ -1,75 +0,0 @@ - - */ -final class IndividualProductSelectionTypeBuilder implements Builder -{ - /** - - * @var null|LocalizedString|LocalizedStringBuilder - */ - private $name; - - /** - *

The name of the ProductSelection which is recommended to be unique.

- * - - * @return null|LocalizedString - */ - public function getName() - { - return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; - } - - /** - * @param ?LocalizedString $name - * @return $this - */ - public function withName(?LocalizedString $name) - { - $this->name = $name; - - return $this; - } - - /** - * @deprecated use withName() instead - * @return $this - */ - public function withNameBuilder(?LocalizedStringBuilder $name) - { - $this->name = $name; - - return $this; - } - - public function build(): IndividualProductSelectionType - { - return new IndividualProductSelectionTypeModel( - $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name - ); - } - - public static function of(): IndividualProductSelectionTypeBuilder - { - return new self(); - } -} diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeCollection.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeCollection.php deleted file mode 100644 index 17985f3113a..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeCollection.php +++ /dev/null @@ -1,56 +0,0 @@ - - * @method IndividualProductSelectionType current() - * @method IndividualProductSelectionType end() - * @method IndividualProductSelectionType at($offset) - */ -class IndividualProductSelectionTypeCollection extends ProductSelectionTypeCollection -{ - /** - * @psalm-assert IndividualProductSelectionType $value - * @psalm-param IndividualProductSelectionType|stdClass $value - * @throws InvalidArgumentException - * - * @return IndividualProductSelectionTypeCollection - */ - public function add($value) - { - if (!$value instanceof IndividualProductSelectionType) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?IndividualProductSelectionType - */ - protected function mapper() - { - return function (?int $index): ?IndividualProductSelectionType { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var IndividualProductSelectionType $data */ - $data = IndividualProductSelectionTypeModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeModel.php b/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeModel.php deleted file mode 100644 index f179163d201..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/IndividualProductSelectionTypeModel.php +++ /dev/null @@ -1,98 +0,0 @@ -name = $name; - $this->type = $type ?? self::DISCRIMINATOR_VALUE; - } - - /** - *

The following types of Product Selections are supported:

- * - * @deprecated - * @return null|string - */ - public function getType() - { - if (is_null($this->type)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TYPE); - if (is_null($data)) { - return null; - } - $this->type = (string) $data; - } - - return $this->type; - } - - /** - *

The name of the ProductSelection which is recommended to be unique.

- * - * - * @return null|LocalizedString - */ - public function getName() - { - if (is_null($this->name)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_NAME); - if (is_null($data)) { - return null; - } - - $this->name = LocalizedStringModel::of($data); - } - - return $this->name; - } - - - /** - * @param ?LocalizedString $name - */ - public function setName(?LocalizedString $name): void - { - $this->name = $name; - } -} diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php index 2c909ec6361..3db3d328bb6 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php @@ -104,7 +104,7 @@ public function getProductCount(); *

Specifies in which way the Products are assigned to the ProductSelection. * Currently, the only way of doing this is to specify each Product individually, either by including or excluding them explicitly.

* - * @deprecated + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php index f4cfe5e339f..d3a62bea90c 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php @@ -86,7 +86,7 @@ final class ProductSelectionBuilder implements Builder private $productCount; /** - * @deprecated + * @var ?string */ private $type; @@ -206,7 +206,7 @@ public function getProductCount() *

Specifies in which way the Products are assigned to the ProductSelection. * Currently, the only way of doing this is to specify each Product individually, either by including or excluding them explicitly.

* - * @deprecated + * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php index 4467dc23a3e..1def18f156f 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php @@ -48,7 +48,7 @@ public function getCustom(); /** *

Type of the Product Selection.

* - * @deprecated + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php index 13de72d5262..ca4c0070f35 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php @@ -43,7 +43,7 @@ final class ProductSelectionDraftBuilder implements Builder private $custom; /** - * @deprecated + * @var ?string */ private $type; @@ -90,7 +90,7 @@ public function getCustom() /** *

Type of the Product Selection.

* - * @deprecated + * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php index 84c34337482..19edcd085ef 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php @@ -42,7 +42,7 @@ final class ProductSelectionDraftModel extends JsonObjectModel implements Produc protected $custom; /** - * @deprecated + * * @var ?string */ protected $type; @@ -136,7 +136,7 @@ public function getCustom() /** *

Type of the Product Selection.

* - * @deprecated + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php index de29b94d45a..c2a34257802 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php @@ -85,7 +85,7 @@ final class ProductSelectionModel extends JsonObjectModel implements ProductSele protected $productCount; /** - * @deprecated + * * @var ?string */ protected $type; @@ -329,7 +329,7 @@ public function getProductCount() *

Specifies in which way the Products are assigned to the ProductSelection. * Currently, the only way of doing this is to specify each Product individually, either by including or excluding them explicitly.

* - * @deprecated + * * @return null|string */ public function getType() diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php index 9f80a0361a3..0c275fac2ce 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php @@ -19,7 +19,7 @@ interface ProductSelectionType extends JsonObject /** *

The following types of Product Selections are supported:

* - * @deprecated + * @return null|string */ public function getType(); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php index 9bbb38625e7..bc6ded06ac5 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php @@ -21,7 +21,7 @@ final class ProductSelectionTypeModel extends JsonObjectModel implements Product { public const DISCRIMINATOR_VALUE = ''; /** - * @deprecated + * * @var ?string */ protected $type; @@ -31,8 +31,6 @@ final class ProductSelectionTypeModel extends JsonObjectModel implements Product * */ private static $discriminatorClasses = [ - 'individual' => IndividualProductSelectionTypeModel::class, - 'individualExclusion' => IndividualExclusionProductSelectionTypeModel::class, ]; /** @@ -47,7 +45,7 @@ public function __construct( /** *

The following types of Product Selections are supported:

* - * @deprecated + * * @return null|string */ public function getType() diff --git a/references.txt b/references.txt index 37b04c2191b..b7ceed277cc 100644 --- a/references.txt +++ b/references.txt @@ -97,3 +97,4 @@ c497e6c324870e2e3d2c39d1196a329b71f3752e 25f0dfe7f3d3887530495d18f88a04eaa5d8d1c8 4b5adb8760c0f8e20541b4c7da8445f89bed5bb4 3a530eba3854922a79388a1400f06b18b48f12f7 +859aa057d141373a076b2d8468114db7d99f20c4 From d2772f1ff00b090901c733621540a166e48bcc66 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Fri, 4 Aug 2023 15:13:40 +0000 Subject: [PATCH 37/44] TASK: Updating SDK --- changes.md | 5 +++ .../CartSetCustomLineItemTaxAmountAction.php | 15 ++++++++ ...etCustomLineItemTaxAmountActionBuilder.php | 32 +++++++++++++++- ...tSetCustomLineItemTaxAmountActionModel.php | 37 +++++++++++++++++++ .../CartSetCustomLineItemTaxRateAction.php | 15 ++++++++ ...tSetCustomLineItemTaxRateActionBuilder.php | 32 +++++++++++++++- ...artSetCustomLineItemTaxRateActionModel.php | 37 +++++++++++++++++++ .../src/Models/Cart/CustomLineItem.php | 14 +++++++ .../src/Models/Cart/CustomLineItemBuilder.php | 29 +++++++++++++++ .../src/Models/Cart/CustomLineItemModel.php | 36 ++++++++++++++++++ ...dOrderSetCustomLineItemTaxAmountAction.php | 15 ++++++++ ...etCustomLineItemTaxAmountActionBuilder.php | 32 +++++++++++++++- ...rSetCustomLineItemTaxAmountActionModel.php | 37 +++++++++++++++++++ ...gedOrderSetCustomLineItemTaxRateAction.php | 15 ++++++++ ...rSetCustomLineItemTaxRateActionBuilder.php | 32 +++++++++++++++- ...derSetCustomLineItemTaxRateActionModel.php | 37 +++++++++++++++++++ references.txt | 1 + 17 files changed, 417 insertions(+), 4 deletions(-) diff --git a/changes.md b/changes.md index a2cecae006c..6d4a99190b5 100644 --- a/changes.md +++ b/changes.md @@ -14,6 +14,7 @@ - added property `stores` to type `CartDiscount` - added property `stores` to type `CartDiscountDraft` +- added property `taxedPricePortions` to type `CustomLineItem` - added property `customLineItemKey` to type `CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction` - added property `customLineItemKey` to type `CartChangeCustomLineItemMoneyAction` - added property `customLineItemKey` to type `CartChangeCustomLineItemPriceModeAction` @@ -23,7 +24,9 @@ - added property `customLineItemKey` to type `CartSetCustomLineItemCustomTypeAction` - added property `customLineItemKey` to type `CartSetCustomLineItemShippingDetailsAction` - added property `customLineItemKey` to type `CartSetCustomLineItemTaxAmountAction` +- added property `shippingKey` to type `CartSetCustomLineItemTaxAmountAction` - added property `customLineItemKey` to type `CartSetCustomLineItemTaxRateAction` +- added property `shippingKey` to type `CartSetCustomLineItemTaxRateAction` - added property `associate` to type `ClientLogging` - added property `associate` to type `CreatedBy` - added property `associate` to type `LastModifiedBy` @@ -56,7 +59,9 @@ - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemCustomTypeAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemShippingDetailsAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxAmountAction` +- added property `shippingKey` to type `StagedOrderSetCustomLineItemTaxAmountAction` - added property `customLineItemKey` to type `StagedOrderSetCustomLineItemTaxRateAction` +- added property `shippingKey` to type `StagedOrderSetCustomLineItemTaxRateAction` - added property `returnItemKey` to type `StagedOrderSetReturnItemCustomFieldAction` - added property `returnItemKey` to type `StagedOrderSetReturnItemCustomTypeAction` - added property `returnItemKey` to type `StagedOrderSetReturnPaymentStateAction` diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php index 6e6d2ecee6f..07831b8565c 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountAction.php @@ -16,6 +16,7 @@ interface CartSetCustomLineItemTaxAmountAction extends CartUpdateAction public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

@@ -42,6 +43,15 @@ public function getCustomLineItemKey(); */ public function getExternalTaxAmount(); + /** + *

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $customLineItemId */ @@ -56,4 +66,9 @@ public function setCustomLineItemKey(?string $customLineItemKey): void; * @param ?ExternalTaxAmountDraft $externalTaxAmount */ public function setExternalTaxAmount(?ExternalTaxAmountDraft $externalTaxAmount): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php index 4c86ed294eb..6c0866595a0 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionBuilder.php @@ -38,6 +38,12 @@ final class CartSetCustomLineItemTaxAmountActionBuilder implements Builder */ private $externalTaxAmount; + /** + + * @var ?string + */ + private $shippingKey; + /** *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* @@ -72,6 +78,18 @@ public function getExternalTaxAmount() return $this->externalTaxAmount instanceof ExternalTaxAmountDraftBuilder ? $this->externalTaxAmount->build() : $this->externalTaxAmount; } + /** + *

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $customLineItemId * @return $this @@ -105,6 +123,17 @@ public function withExternalTaxAmount(?ExternalTaxAmountDraft $externalTaxAmount return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withExternalTaxAmount() instead * @return $this @@ -121,7 +150,8 @@ public function build(): CartSetCustomLineItemTaxAmountAction return new CartSetCustomLineItemTaxAmountActionModel( $this->customLineItemId, $this->customLineItemKey, - $this->externalTaxAmount instanceof ExternalTaxAmountDraftBuilder ? $this->externalTaxAmount->build() : $this->externalTaxAmount + $this->externalTaxAmount instanceof ExternalTaxAmountDraftBuilder ? $this->externalTaxAmount->build() : $this->externalTaxAmount, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php index 5745acc4691..0b21bcb8f08 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxAmountActionModel.php @@ -44,6 +44,12 @@ final class CartSetCustomLineItemTaxAmountActionModel extends JsonObjectModel im */ protected $externalTaxAmount; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -52,11 +58,13 @@ public function __construct( ?string $customLineItemId = null, ?string $customLineItemKey = null, ?ExternalTaxAmountDraft $externalTaxAmount = null, + ?string $shippingKey = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->customLineItemKey = $customLineItemKey; $this->externalTaxAmount = $externalTaxAmount; + $this->shippingKey = $shippingKey; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -140,6 +148,27 @@ public function getExternalTaxAmount() return $this->externalTaxAmount; } + /** + *

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $customLineItemId @@ -164,4 +193,12 @@ public function setExternalTaxAmount(?ExternalTaxAmountDraft $externalTaxAmount) { $this->externalTaxAmount = $externalTaxAmount; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php index 0d606fd2e78..8dfb1546f8d 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateAction.php @@ -16,6 +16,7 @@ interface CartSetCustomLineItemTaxRateAction extends CartUpdateAction public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

@@ -42,6 +43,15 @@ public function getCustomLineItemKey(); */ public function getExternalTaxRate(); + /** + *

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $customLineItemId */ @@ -56,4 +66,9 @@ public function setCustomLineItemKey(?string $customLineItemKey): void; * @param ?ExternalTaxRateDraft $externalTaxRate */ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php index 15936c0196a..f18403b74a8 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionBuilder.php @@ -38,6 +38,12 @@ final class CartSetCustomLineItemTaxRateActionBuilder implements Builder */ private $externalTaxRate; + /** + + * @var ?string + */ + private $shippingKey; + /** *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

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

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $customLineItemId * @return $this @@ -105,6 +123,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withExternalTaxRate() instead * @return $this @@ -121,7 +150,8 @@ public function build(): CartSetCustomLineItemTaxRateAction return new CartSetCustomLineItemTaxRateActionModel( $this->customLineItemId, $this->customLineItemKey, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php index 8787c70d6a6..b7726540288 100644 --- a/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/Cart/CartSetCustomLineItemTaxRateActionModel.php @@ -44,6 +44,12 @@ final class CartSetCustomLineItemTaxRateActionModel extends JsonObjectModel impl */ protected $externalTaxRate; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -52,11 +58,13 @@ public function __construct( ?string $customLineItemId = null, ?string $customLineItemKey = null, ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $shippingKey = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->customLineItemKey = $customLineItemKey; $this->externalTaxRate = $externalTaxRate; + $this->shippingKey = $shippingKey; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -140,6 +148,27 @@ public function getExternalTaxRate() return $this->externalTaxRate; } + /** + *

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $customLineItemId @@ -164,4 +193,12 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItem.php b/lib/commercetools-api/src/Models/Cart/CustomLineItem.php index 083997fcba1..bb7e6ef1648 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItem.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItem.php @@ -25,6 +25,7 @@ interface CustomLineItem extends JsonObject public const FIELD_NAME = 'name'; public const FIELD_MONEY = 'money'; public const FIELD_TAXED_PRICE = 'taxedPrice'; + public const FIELD_TAXED_PRICE_PORTIONS = 'taxedPricePortions'; public const FIELD_TOTAL_PRICE = 'totalPrice'; public const FIELD_SLUG = 'slug'; public const FIELD_QUANTITY = 'quantity'; @@ -77,6 +78,14 @@ public function getMoney(); */ public function getTaxedPrice(); + /** + *

Taxed price of the Shipping Method that is automatically set after perMethodTaxRate is set.

+ * + + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions(); + /** *

Total price of the Custom Line Item (money multiplied by quantity). * If the Custom Line Item is discounted, the total price is discountedPricePerQuantity multiplied by quantity.

@@ -197,6 +206,11 @@ public function setMoney(?TypedMoney $money): void; */ public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void; + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + */ + public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void; + /** * @param ?CentPrecisionMoney $totalPrice */ diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php index 613aa609761..aa1691a1885 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemBuilder.php @@ -63,6 +63,12 @@ final class CustomLineItemBuilder implements Builder */ private $taxedPrice; + /** + + * @var ?MethodTaxedPriceCollection + */ + private $taxedPricePortions; + /** * @var null|CentPrecisionMoney|CentPrecisionMoneyBuilder @@ -184,6 +190,17 @@ public function getTaxedPrice() return $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice; } + /** + *

Taxed price of the Shipping Method that is automatically set after perMethodTaxRate is set.

+ * + + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions() + { + return $this->taxedPricePortions; + } + /** *

Total price of the Custom Line Item (money multiplied by quantity). * If the Custom Line Item is discounted, the total price is discountedPricePerQuantity multiplied by quantity.

@@ -367,6 +384,17 @@ public function withTaxedPrice(?TaxedItemPrice $taxedPrice) return $this; } + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + * @return $this + */ + public function withTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions) + { + $this->taxedPricePortions = $taxedPricePortions; + + return $this; + } + /** * @param ?CentPrecisionMoney $totalPrice * @return $this @@ -584,6 +612,7 @@ public function build(): CustomLineItem $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, $this->money instanceof TypedMoneyBuilder ? $this->money->build() : $this->money, $this->taxedPrice instanceof TaxedItemPriceBuilder ? $this->taxedPrice->build() : $this->taxedPrice, + $this->taxedPricePortions, $this->totalPrice instanceof CentPrecisionMoneyBuilder ? $this->totalPrice->build() : $this->totalPrice, $this->slug, $this->quantity, diff --git a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php index 73b22020d7d..6e9a3d6e6ea 100644 --- a/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php +++ b/lib/commercetools-api/src/Models/Cart/CustomLineItemModel.php @@ -62,6 +62,12 @@ final class CustomLineItemModel extends JsonObjectModel implements CustomLineIte */ protected $taxedPrice; + /** + * + * @var ?MethodTaxedPriceCollection + */ + protected $taxedPricePortions; + /** * * @var ?CentPrecisionMoney @@ -138,6 +144,7 @@ public function __construct( ?LocalizedString $name = null, ?TypedMoney $money = null, ?TaxedItemPrice $taxedPrice = null, + ?MethodTaxedPriceCollection $taxedPricePortions = null, ?CentPrecisionMoney $totalPrice = null, ?string $slug = null, ?int $quantity = null, @@ -155,6 +162,7 @@ public function __construct( $this->name = $name; $this->money = $money; $this->taxedPrice = $taxedPrice; + $this->taxedPricePortions = $taxedPricePortions; $this->totalPrice = $totalPrice; $this->slug = $slug; $this->quantity = $quantity; @@ -271,6 +279,26 @@ public function getTaxedPrice() return $this->taxedPrice; } + /** + *

Taxed price of the Shipping Method that is automatically set after perMethodTaxRate is set.

+ * + * + * @return null|MethodTaxedPriceCollection + */ + public function getTaxedPricePortions() + { + if (is_null($this->taxedPricePortions)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_TAXED_PRICE_PORTIONS); + if (is_null($data)) { + return null; + } + $this->taxedPricePortions = MethodTaxedPriceCollection::fromArray($data); + } + + return $this->taxedPricePortions; + } + /** *

Total price of the Custom Line Item (money multiplied by quantity). * If the Custom Line Item is discounted, the total price is discountedPricePerQuantity multiplied by quantity.

@@ -544,6 +572,14 @@ public function setTaxedPrice(?TaxedItemPrice $taxedPrice): void $this->taxedPrice = $taxedPrice; } + /** + * @param ?MethodTaxedPriceCollection $taxedPricePortions + */ + public function setTaxedPricePortions(?MethodTaxedPriceCollection $taxedPricePortions): void + { + $this->taxedPricePortions = $taxedPricePortions; + } + /** * @param ?CentPrecisionMoney $totalPrice */ diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php index daaac2daa42..5e1b508936b 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountAction.php @@ -18,6 +18,7 @@ interface StagedOrderSetCustomLineItemTaxAmountAction extends StagedOrderUpdateA public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_EXTERNAL_TAX_AMOUNT = 'externalTaxAmount'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

@@ -44,6 +45,15 @@ public function getCustomLineItemKey(); */ public function getExternalTaxAmount(); + /** + *

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $customLineItemId */ @@ -58,4 +68,9 @@ public function setCustomLineItemKey(?string $customLineItemKey): void; * @param ?ExternalTaxAmountDraft $externalTaxAmount */ public function setExternalTaxAmount(?ExternalTaxAmountDraft $externalTaxAmount): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php index bb78f772258..ec2a9d8c191 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionBuilder.php @@ -42,6 +42,12 @@ final class StagedOrderSetCustomLineItemTaxAmountActionBuilder implements Builde */ private $externalTaxAmount; + /** + + * @var ?string + */ + private $shippingKey; + /** *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

* @@ -76,6 +82,18 @@ public function getExternalTaxAmount() return $this->externalTaxAmount instanceof ExternalTaxAmountDraftBuilder ? $this->externalTaxAmount->build() : $this->externalTaxAmount; } + /** + *

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $customLineItemId * @return $this @@ -109,6 +127,17 @@ public function withExternalTaxAmount(?ExternalTaxAmountDraft $externalTaxAmount return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withExternalTaxAmount() instead * @return $this @@ -125,7 +154,8 @@ public function build(): StagedOrderSetCustomLineItemTaxAmountAction return new StagedOrderSetCustomLineItemTaxAmountActionModel( $this->customLineItemId, $this->customLineItemKey, - $this->externalTaxAmount instanceof ExternalTaxAmountDraftBuilder ? $this->externalTaxAmount->build() : $this->externalTaxAmount + $this->externalTaxAmount instanceof ExternalTaxAmountDraftBuilder ? $this->externalTaxAmount->build() : $this->externalTaxAmount, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php index 33b0b8ad43b..9c11bf8a7da 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxAmountActionModel.php @@ -48,6 +48,12 @@ final class StagedOrderSetCustomLineItemTaxAmountActionModel extends JsonObjectM */ protected $externalTaxAmount; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -56,11 +62,13 @@ public function __construct( ?string $customLineItemId = null, ?string $customLineItemKey = null, ?ExternalTaxAmountDraft $externalTaxAmount = null, + ?string $shippingKey = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->customLineItemKey = $customLineItemKey; $this->externalTaxAmount = $externalTaxAmount; + $this->shippingKey = $shippingKey; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -144,6 +152,27 @@ public function getExternalTaxAmount() return $this->externalTaxAmount; } + /** + *

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $customLineItemId @@ -168,4 +197,12 @@ public function setExternalTaxAmount(?ExternalTaxAmountDraft $externalTaxAmount) { $this->externalTaxAmount = $externalTaxAmount; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php index 1c2c8ad36cd..45b4c93d28c 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateAction.php @@ -18,6 +18,7 @@ interface StagedOrderSetCustomLineItemTaxRateAction extends StagedOrderUpdateAct public const FIELD_CUSTOM_LINE_ITEM_ID = 'customLineItemId'; public const FIELD_CUSTOM_LINE_ITEM_KEY = 'customLineItemKey'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_SHIPPING_KEY = 'shippingKey'; /** *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

@@ -44,6 +45,15 @@ public function getCustomLineItemKey(); */ public function getExternalTaxRate(); + /** + *

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey(); + /** * @param ?string $customLineItemId */ @@ -58,4 +68,9 @@ public function setCustomLineItemKey(?string $customLineItemKey): void; * @param ?ExternalTaxRateDraft $externalTaxRate */ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void; } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php index ee1e8ba51da..d317bb69860 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionBuilder.php @@ -42,6 +42,12 @@ final class StagedOrderSetCustomLineItemTaxRateActionBuilder implements Builder */ private $externalTaxRate; + /** + + * @var ?string + */ + private $shippingKey; + /** *

id of the CustomLineItem to update. Either customLineItemId or customLineItemKey is required.

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

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingKey() + { + return $this->shippingKey; + } + /** * @param ?string $customLineItemId * @return $this @@ -109,6 +127,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) return $this; } + /** + * @param ?string $shippingKey + * @return $this + */ + public function withShippingKey(?string $shippingKey) + { + $this->shippingKey = $shippingKey; + + return $this; + } + /** * @deprecated use withExternalTaxRate() instead * @return $this @@ -125,7 +154,8 @@ public function build(): StagedOrderSetCustomLineItemTaxRateAction return new StagedOrderSetCustomLineItemTaxRateActionModel( $this->customLineItemId, $this->customLineItemKey, - $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate + $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->shippingKey ); } diff --git a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php index 4259b289fce..822515d271f 100644 --- a/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php +++ b/lib/commercetools-api/src/Models/OrderEdit/StagedOrderSetCustomLineItemTaxRateActionModel.php @@ -48,6 +48,12 @@ final class StagedOrderSetCustomLineItemTaxRateActionModel extends JsonObjectMod */ protected $externalTaxRate; + /** + * + * @var ?string + */ + protected $shippingKey; + /** * @psalm-suppress MissingParamType @@ -56,11 +62,13 @@ public function __construct( ?string $customLineItemId = null, ?string $customLineItemKey = null, ?ExternalTaxRateDraft $externalTaxRate = null, + ?string $shippingKey = null, ?string $action = null ) { $this->customLineItemId = $customLineItemId; $this->customLineItemKey = $customLineItemKey; $this->externalTaxRate = $externalTaxRate; + $this->shippingKey = $shippingKey; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -144,6 +152,27 @@ public function getExternalTaxRate() return $this->externalTaxRate; } + /** + *

key of the ShippingMethod used for this Custom Line Item. + * This is required for Carts with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingKey() + { + if (is_null($this->shippingKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_KEY); + if (is_null($data)) { + return null; + } + $this->shippingKey = (string) $data; + } + + return $this->shippingKey; + } + /** * @param ?string $customLineItemId @@ -168,4 +197,12 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void { $this->externalTaxRate = $externalTaxRate; } + + /** + * @param ?string $shippingKey + */ + public function setShippingKey(?string $shippingKey): void + { + $this->shippingKey = $shippingKey; + } } diff --git a/references.txt b/references.txt index b7ceed277cc..efba59ecb57 100644 --- a/references.txt +++ b/references.txt @@ -98,3 +98,4 @@ c497e6c324870e2e3d2c39d1196a329b71f3752e 4b5adb8760c0f8e20541b4c7da8445f89bed5bb4 3a530eba3854922a79388a1400f06b18b48f12f7 859aa057d141373a076b2d8468114db7d99f20c4 +1670b8eb918db6237e6c39d244301670d9f7b6ee From e91fe91d04392f14aa9ece991dd82ae246c9ce4b Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 7 Aug 2023 10:08:49 +0000 Subject: [PATCH 38/44] TASK: Updating SDK --- changes.md | 1 + references.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/changes.md b/changes.md index 6d4a99190b5..b4e34c548ab 100644 --- a/changes.md +++ b/changes.md @@ -94,6 +94,7 @@
Required Property(s) +- changed property `roles` of type `Associate` to be optional - changed property `customLineItemId` of type `CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction` to be optional - changed property `customLineItemId` of type `CartChangeCustomLineItemMoneyAction` to be optional - changed property `customLineItemId` of type `CartChangeCustomLineItemPriceModeAction` to be optional diff --git a/references.txt b/references.txt index efba59ecb57..a24f6c63472 100644 --- a/references.txt +++ b/references.txt @@ -99,3 +99,4 @@ c497e6c324870e2e3d2c39d1196a329b71f3752e 3a530eba3854922a79388a1400f06b18b48f12f7 859aa057d141373a076b2d8468114db7d99f20c4 1670b8eb918db6237e6c39d244301670d9f7b6ee +d842da41f5bb7448d8ec3f7ad959c1e46626bc2f From 1e82889a38d1c8c0db4ad2c3b717e4c1bee22c34 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 7 Aug 2023 13:56:31 +0000 Subject: [PATCH 39/44] TASK: Updating SDK --- changes.md | 98 +++++++++++++++++++++++++------------------------- references.txt | 1 + 2 files changed, 50 insertions(+), 49 deletions(-) diff --git a/changes.md b/changes.md index b4e34c548ab..f7b8df1d766 100644 --- a/changes.md +++ b/changes.md @@ -1,11 +1,18 @@ **Api changes**
-Added Resource(s) +Changed Property(s) -- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts` -- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}` -- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}` +- :warning: changed property `money` of type `CartDiscountValueFixed` from type `CentPrecisionMoney[]` to `TypedMoney[]` +- :warning: changed property `money` of type `CartDiscountValueFixedDraft` from type `Money[]` to `TypedMoneyDraft[]` +- :warning: changed property `country` of type `StagedOrder` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `StagedOrder` from type `string` to `Locale` +- :warning: changed property `country` of type `StagedOrderSetCountryAction` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `StagedOrderSetLocaleAction` from type `string` to `Locale` +- :warning: changed property `country` of type `Order` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `Order` from type `string` to `Locale` +- :warning: changed property `country` of type `OrderImportDraft` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `OrderSetLocaleAction` from type `string` to `Locale`
@@ -94,6 +101,11 @@
Required Property(s) +- :warning: changed property `associateRoleAssignments` of type `AssociateDraft` to be required +- :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required +- :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required +- :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required +- :warning: changed property `shipmentState` of type `OrderChangeShipmentStateAction` to be required - changed property `roles` of type `Associate` to be optional - changed property `customLineItemId` of type `CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction` to be optional - changed property `customLineItemId` of type `CartChangeCustomLineItemMoneyAction` to be optional @@ -137,11 +149,6 @@ - changed property `customLineItemId` of type `OrderTransitionCustomLineItemStateAction` to be optional - changed property `lineItemId` of type `OrderTransitionLineItemStateAction` to be optional - changed property `comment` of type `QuoteRequestDraft` to be optional -- :warning: changed property `associateRoleAssignments` of type `AssociateDraft` to be required -- :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required -- :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required -- :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required -- :warning: changed property `shipmentState` of type `OrderChangeShipmentStateAction` to be required
@@ -158,22 +165,6 @@
-
-Changed Property(s) - -- :warning: changed property `money` of type `CartDiscountValueFixed` from type `CentPrecisionMoney[]` to `TypedMoney[]` -- :warning: changed property `money` of type `CartDiscountValueFixedDraft` from type `Money[]` to `TypedMoneyDraft[]` -- :warning: changed property `country` of type `StagedOrder` from type `string` to `CountryCode` -- :warning: changed property `locale` of type `StagedOrder` from type `string` to `Locale` -- :warning: changed property `country` of type `StagedOrderSetCountryAction` from type `string` to `CountryCode` -- :warning: changed property `locale` of type `StagedOrderSetLocaleAction` from type `string` to `Locale` -- :warning: changed property `country` of type `Order` from type `string` to `CountryCode` -- :warning: changed property `locale` of type `Order` from type `string` to `Locale` -- :warning: changed property `country` of type `OrderImportDraft` from type `string` to `CountryCode` -- :warning: changed property `locale` of type `OrderSetLocaleAction` from type `string` to `Locale` -
- -
Added QueryParameter(s) @@ -182,27 +173,6 @@
-
-Deprecated Type(s) - -- type `AssociateRoleDeprecated` is removed -- type `IndividualExclusionProductSelectionType` is removed -- type `IndividualProductSelectionType` is removed -- type `ProductSelectionTypeEnum` is removed -
- - -
-Removed Type(s) - -- :warning: removed type `CartSetDeliveryAddressCustomFieldAction` -- :warning: removed type `CartSetDeliveryAddressCustomTypeAction` -- :warning: removed type `BusinessUnitParentUnitChangedMessage` -- :warning: removed type `BusinessUnitParentUnitChangedMessagePayload` -- :warning: removed type `OrderResourceIdentifier` -
- -
Added Type(s) @@ -235,9 +205,23 @@
-Added Enum(s) +Deprecated Type(s) -- added enum `associate-role` to type `ChangeSubscriptionResourceTypeId` +- type `AssociateRoleDeprecated` is removed +- type `IndividualExclusionProductSelectionType` is removed +- type `IndividualProductSelectionType` is removed +- type `ProductSelectionTypeEnum` is removed +
+ + +
+Removed Type(s) + +- :warning: removed type `CartSetDeliveryAddressCustomFieldAction` +- :warning: removed type `CartSetDeliveryAddressCustomTypeAction` +- :warning: removed type `BusinessUnitParentUnitChangedMessage` +- :warning: removed type `BusinessUnitParentUnitChangedMessagePayload` +- :warning: removed type `OrderResourceIdentifier`
@@ -254,13 +238,29 @@ - added method `$apiRoot->withProjectKey()->inStoreKeyWithStoreKeyValue()->cartDiscounts()->withId()->delete()`
+ +
+Added Resource(s) + +- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts` +- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}` +- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}` +
+ + +
+Added Enum(s) + +- added enum `associate-role` to type `ChangeSubscriptionResourceTypeId` +
+ **Import changes**
Required Property(s) -- changed property `addresses` of type `CustomerImport` to be optional - :warning: changed property `key` of type `PriceDraftImport` to be required +- changed property `addresses` of type `CustomerImport` to be optional
**History changes** diff --git a/references.txt b/references.txt index a24f6c63472..90c3aeec178 100644 --- a/references.txt +++ b/references.txt @@ -100,3 +100,4 @@ c497e6c324870e2e3d2c39d1196a329b71f3752e 859aa057d141373a076b2d8468114db7d99f20c4 1670b8eb918db6237e6c39d244301670d9f7b6ee d842da41f5bb7448d8ec3f7ad959c1e46626bc2f +e87bf15e82d10768771e954e60a6fc971a68142a From d78856f3a371155e4d5f7d4ce4b99bcb77011f0b Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Tue, 8 Aug 2023 15:52:42 +0000 Subject: [PATCH 40/44] TASK: Updating SDK --- changes.md | 22 ++++++++++++ ...ResourceByProjectKeyExtensionsByIDTest.php | 36 ------------------- ...urceByProjectKeyExtensionsKeyByKeyTest.php | 36 ------------------- .../ResourceByProjectKeyExtensionsTest.php | 22 ------------ ...ourceByProjectKeySubscriptionsByIDTest.php | 36 ------------------- ...eByProjectKeySubscriptionsKeyByKeyTest.php | 36 ------------------- .../ResourceByProjectKeySubscriptionsTest.php | 22 ------------ .../ByProjectKeyExtensionsByIDDelete.php | 12 +------ .../ByProjectKeyExtensionsByIDGet.php | 12 +------ .../ByProjectKeyExtensionsByIDPost.php | 12 +------ .../Resource/ByProjectKeyExtensionsGet.php | 12 +------ .../ByProjectKeyExtensionsKeyByKeyDelete.php | 12 +------ .../ByProjectKeyExtensionsKeyByKeyGet.php | 12 +------ .../ByProjectKeyExtensionsKeyByKeyPost.php | 12 +------ .../Resource/ByProjectKeyExtensionsPost.php | 12 +------ .../ByProjectKeySubscriptionsByIDDelete.php | 12 +------ .../ByProjectKeySubscriptionsByIDGet.php | 12 +------ .../ByProjectKeySubscriptionsByIDPost.php | 12 +------ .../Resource/ByProjectKeySubscriptionsGet.php | 12 +------ ...yProjectKeySubscriptionsKeyByKeyDelete.php | 12 +------ .../ByProjectKeySubscriptionsKeyByKeyGet.php | 12 +------ .../ByProjectKeySubscriptionsKeyByKeyPost.php | 12 +------ .../ByProjectKeySubscriptionsPost.php | 12 +------ references.txt | 1 + 24 files changed, 39 insertions(+), 364 deletions(-) diff --git a/changes.md b/changes.md index f7b8df1d766..f56e0191a3c 100644 --- a/changes.md +++ b/changes.md @@ -173,6 +173,28 @@ +
+Removed QueryParameter(s) + +- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions` +- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions` +- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions` +- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions` +- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions/key={key}` +- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions/key={key}` +- :warning: removed query parameter `expand` from method `delete /{projectKey}/subscriptions/key={key}` +- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions/{ID}` +- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions/{ID}` +- :warning: removed query parameter `expand` from method `delete /{projectKey}/subscriptions/{ID}` +- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions/key={key}` +- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions/key={key}` +- :warning: removed query parameter `expand` from method `delete /{projectKey}/extensions/key={key}` +- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions/{ID}` +- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions/{ID}` +- :warning: removed query parameter `expand` from method `delete /{projectKey}/extensions/{ID}` +
+ +
Added Type(s) diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsByIDTest.php index 8b4d0e133bc..ab577986607 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsByIDTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsByIDTest.php @@ -92,18 +92,6 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ - 'ByProjectKeyExtensionsByIDGet_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->extensions() - ->withId('test_ID') - ->get() - ->withExpand('expand'); - }, - 'get', - 'test_projectKey/extensions/test_ID?expand=expand', - ], 'ByProjectKeyExtensionsByIDGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -115,18 +103,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/extensions/test_ID', ], - 'ByProjectKeyExtensionsByIDPost_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->extensions() - ->withId('test_ID') - ->post(null) - ->withExpand('expand'); - }, - 'post', - 'test_projectKey/extensions/test_ID?expand=expand', - ], 'ByProjectKeyExtensionsByIDPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -150,18 +126,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'delete', 'test_projectKey/extensions/test_ID?version=version', ], - 'ByProjectKeyExtensionsByIDDelete_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->extensions() - ->withId('test_ID') - ->delete() - ->withExpand('expand'); - }, - 'delete', - 'test_projectKey/extensions/test_ID?expand=expand', - ], 'ByProjectKeyExtensionsByIDDelete' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsKeyByKeyTest.php index c7f93bc213c..bd51ce10d4a 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsKeyByKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsKeyByKeyTest.php @@ -92,18 +92,6 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ - 'ByProjectKeyExtensionsKeyByKeyGet_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->extensions() - ->withKey('test_key') - ->get() - ->withExpand('expand'); - }, - 'get', - 'test_projectKey/extensions/key=test_key?expand=expand', - ], 'ByProjectKeyExtensionsKeyByKeyGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -115,18 +103,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/extensions/key=test_key', ], - 'ByProjectKeyExtensionsKeyByKeyPost_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->extensions() - ->withKey('test_key') - ->post(null) - ->withExpand('expand'); - }, - 'post', - 'test_projectKey/extensions/key=test_key?expand=expand', - ], 'ByProjectKeyExtensionsKeyByKeyPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -150,18 +126,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'delete', 'test_projectKey/extensions/key=test_key?version=version', ], - 'ByProjectKeyExtensionsKeyByKeyDelete_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->extensions() - ->withKey('test_key') - ->delete() - ->withExpand('expand'); - }, - 'delete', - 'test_projectKey/extensions/key=test_key?expand=expand', - ], 'ByProjectKeyExtensionsKeyByKeyDelete' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsTest.php index 5c0968d4860..c63e46844c4 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyExtensionsTest.php @@ -102,17 +102,6 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ - 'ByProjectKeyExtensionsGet_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->extensions() - ->get() - ->withExpand('expand'); - }, - 'get', - 'test_projectKey/extensions?expand=expand', - ], 'ByProjectKeyExtensionsGet_withSort' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -189,17 +178,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/extensions', ], - 'ByProjectKeyExtensionsPost_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->extensions() - ->post(null) - ->withExpand('expand'); - }, - 'post', - 'test_projectKey/extensions?expand=expand', - ], 'ByProjectKeyExtensionsPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDTest.php index edb80c88d6a..6befb569119 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsByIDTest.php @@ -102,18 +102,6 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ - 'ByProjectKeySubscriptionsByIDGet_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->subscriptions() - ->withId('test_ID') - ->get() - ->withExpand('expand'); - }, - 'get', - 'test_projectKey/subscriptions/test_ID?expand=expand', - ], 'ByProjectKeySubscriptionsByIDGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -125,18 +113,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/subscriptions/test_ID', ], - 'ByProjectKeySubscriptionsByIDPost_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->subscriptions() - ->withId('test_ID') - ->post(null) - ->withExpand('expand'); - }, - 'post', - 'test_projectKey/subscriptions/test_ID?expand=expand', - ], 'ByProjectKeySubscriptionsByIDPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -160,18 +136,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'delete', 'test_projectKey/subscriptions/test_ID?version=version', ], - 'ByProjectKeySubscriptionsByIDDelete_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->subscriptions() - ->withId('test_ID') - ->delete() - ->withExpand('expand'); - }, - 'delete', - 'test_projectKey/subscriptions/test_ID?expand=expand', - ], 'ByProjectKeySubscriptionsByIDDelete' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsKeyByKeyTest.php index ac0504914bd..022a8927f2c 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsKeyByKeyTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsKeyByKeyTest.php @@ -92,18 +92,6 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ - 'ByProjectKeySubscriptionsKeyByKeyGet_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->subscriptions() - ->withKey('test_key') - ->get() - ->withExpand('expand'); - }, - 'get', - 'test_projectKey/subscriptions/key=test_key?expand=expand', - ], 'ByProjectKeySubscriptionsKeyByKeyGet' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -115,18 +103,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/subscriptions/key=test_key', ], - 'ByProjectKeySubscriptionsKeyByKeyPost_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->subscriptions() - ->withKey('test_key') - ->post(null) - ->withExpand('expand'); - }, - 'post', - 'test_projectKey/subscriptions/key=test_key?expand=expand', - ], 'ByProjectKeySubscriptionsKeyByKeyPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -150,18 +126,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'delete', 'test_projectKey/subscriptions/key=test_key?version=version', ], - 'ByProjectKeySubscriptionsKeyByKeyDelete_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->subscriptions() - ->withKey('test_key') - ->delete() - ->withExpand('expand'); - }, - 'delete', - 'test_projectKey/subscriptions/key=test_key?expand=expand', - ], 'ByProjectKeySubscriptionsKeyByKeyDelete' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsTest.php index 28b529874d1..5f2039c308b 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeySubscriptionsTest.php @@ -102,17 +102,6 @@ public function testExecuteServerException(callable $builderFunction) public function getRequests() { return [ - 'ByProjectKeySubscriptionsGet_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->subscriptions() - ->get() - ->withExpand('expand'); - }, - 'get', - 'test_projectKey/subscriptions?expand=expand', - ], 'ByProjectKeySubscriptionsGet_withSort' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder @@ -189,17 +178,6 @@ function (ApiRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/subscriptions', ], - 'ByProjectKeySubscriptionsPost_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->subscriptions() - ->post(null) - ->withExpand('expand'); - }, - 'post', - 'test_projectKey/subscriptions?expand=expand', - ], 'ByProjectKeySubscriptionsPost' => [ function (ApiRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDDelete.php index 66fc6010f59..d8615d66c03 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDDelete.php @@ -32,11 +32,10 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting - * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyExtensionsByIDDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 +class ByProjectKeyExtensionsByIDDelete extends ApiRequest implements Versioned, Conflicting, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -158,13 +157,4 @@ public function withVersion($version): ByProjectKeyExtensionsByIDDelete { return $this->withQueryParam('version', $version); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyExtensionsByIDDelete - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDGet.php index 0a777057bdb..2d937d00726 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDGet.php @@ -30,11 +30,10 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyExtensionsByIDGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +class ByProjectKeyExtensionsByIDGet extends ApiRequest implements Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -143,13 +142,4 @@ function (RequestException $e) use ($resultType) { } ); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyExtensionsByIDGet - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDPost.php index ad0a5a02a57..a97846dff7f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsByIDPost.php @@ -31,11 +31,10 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting - * @template-implements Expandable * @template-implements Deprecatable200 * @template-implements Errorable */ -class ByProjectKeyExtensionsByIDPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +class ByProjectKeyExtensionsByIDPost extends ApiRequest implements Conflicting, Deprecatable200, Errorable { /** * @param ?object|array|string $body @@ -148,13 +147,4 @@ function (RequestException $e) use ($resultType) { } ); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyExtensionsByIDPost - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsGet.php index 82f033cc34d..761b19fcc15 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsGet.php @@ -30,14 +30,13 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * @template-implements Expandable * @template-implements Sortable * @template-implements Paging * @template-implements Query * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyExtensionsGet extends ApiRequest implements Expandable, Sortable, Paging, Query, Errorable, Deprecatable200 +class ByProjectKeyExtensionsGet extends ApiRequest implements Sortable, Paging, Query, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -147,15 +146,6 @@ function (RequestException $e) use ($resultType) { ); } - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyExtensionsGet - { - return $this->withQueryParam('expand', $expand); - } - /** * * @psalm-param scalar|scalar[] $sort diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyDelete.php index 61e87d37ed8..2c5fd38731e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyDelete.php @@ -32,11 +32,10 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting - * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyExtensionsKeyByKeyDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 +class ByProjectKeyExtensionsKeyByKeyDelete extends ApiRequest implements Versioned, Conflicting, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -158,13 +157,4 @@ public function withVersion($version): ByProjectKeyExtensionsKeyByKeyDelete { return $this->withQueryParam('version', $version); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyExtensionsKeyByKeyDelete - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyGet.php index 86db4cbce59..6cee5f351c7 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyGet.php @@ -30,11 +30,10 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeyExtensionsKeyByKeyGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +class ByProjectKeyExtensionsKeyByKeyGet extends ApiRequest implements Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -143,13 +142,4 @@ function (RequestException $e) use ($resultType) { } ); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyExtensionsKeyByKeyGet - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyPost.php index 7b9e08641e0..ea1bfcae17f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsKeyByKeyPost.php @@ -31,11 +31,10 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting - * @template-implements Expandable * @template-implements Deprecatable200 * @template-implements Errorable */ -class ByProjectKeyExtensionsKeyByKeyPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +class ByProjectKeyExtensionsKeyByKeyPost extends ApiRequest implements Conflicting, Deprecatable200, Errorable { /** * @param ?object|array|string $body @@ -148,13 +147,4 @@ function (RequestException $e) use ($resultType) { } ); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyExtensionsKeyByKeyPost - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsPost.php index bac8cf6a02b..91faad663e5 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeyExtensionsPost.php @@ -30,11 +30,10 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * @template-implements Expandable * @template-implements Deprecatable201 * @template-implements Errorable */ -class ByProjectKeyExtensionsPost extends ApiRequest implements Expandable, Deprecatable201, Errorable +class ByProjectKeyExtensionsPost extends ApiRequest implements Deprecatable201, Errorable { /** * @param ?object|array|string $body @@ -143,13 +142,4 @@ function (RequestException $e) use ($resultType) { } ); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyExtensionsPost - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDDelete.php index a76802595a5..c1f9e1a00f3 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDDelete.php @@ -32,11 +32,10 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting - * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeySubscriptionsByIDDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 +class ByProjectKeySubscriptionsByIDDelete extends ApiRequest implements Versioned, Conflicting, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -158,13 +157,4 @@ public function withVersion($version): ByProjectKeySubscriptionsByIDDelete { return $this->withQueryParam('version', $version); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeySubscriptionsByIDDelete - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDGet.php index a0b188c17e4..c29a89f3537 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDGet.php @@ -30,11 +30,10 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeySubscriptionsByIDGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +class ByProjectKeySubscriptionsByIDGet extends ApiRequest implements Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -143,13 +142,4 @@ function (RequestException $e) use ($resultType) { } ); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeySubscriptionsByIDGet - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDPost.php index 1df884dbceb..54038abbb09 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsByIDPost.php @@ -31,11 +31,10 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting - * @template-implements Expandable * @template-implements Deprecatable200 * @template-implements Errorable */ -class ByProjectKeySubscriptionsByIDPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +class ByProjectKeySubscriptionsByIDPost extends ApiRequest implements Conflicting, Deprecatable200, Errorable { /** * @param ?object|array|string $body @@ -148,13 +147,4 @@ function (RequestException $e) use ($resultType) { } ); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeySubscriptionsByIDPost - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsGet.php index d4f4bb6afb8..c6cd282555e 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsGet.php @@ -30,14 +30,13 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * @template-implements Expandable * @template-implements Sortable * @template-implements Paging * @template-implements Query * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeySubscriptionsGet extends ApiRequest implements Expandable, Sortable, Paging, Query, Errorable, Deprecatable200 +class ByProjectKeySubscriptionsGet extends ApiRequest implements Sortable, Paging, Query, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -147,15 +146,6 @@ function (RequestException $e) use ($resultType) { ); } - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeySubscriptionsGet - { - return $this->withQueryParam('expand', $expand); - } - /** * * @psalm-param scalar|scalar[] $sort diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyDelete.php index 7043a6d44e6..d709744de3f 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyDelete.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyDelete.php @@ -32,11 +32,10 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Versioned * @template-implements Conflicting - * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeySubscriptionsKeyByKeyDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 +class ByProjectKeySubscriptionsKeyByKeyDelete extends ApiRequest implements Versioned, Conflicting, Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -158,13 +157,4 @@ public function withVersion($version): ByProjectKeySubscriptionsKeyByKeyDelete { return $this->withQueryParam('version', $version); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeySubscriptionsKeyByKeyDelete - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyGet.php index 9a331dd124e..d5b9960bea4 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyGet.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyGet.php @@ -30,11 +30,10 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * @template-implements Expandable * @template-implements Errorable * @template-implements Deprecatable200 */ -class ByProjectKeySubscriptionsKeyByKeyGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 +class ByProjectKeySubscriptionsKeyByKeyGet extends ApiRequest implements Errorable, Deprecatable200 { /** * @param ?object|array|string $body @@ -143,13 +142,4 @@ function (RequestException $e) use ($resultType) { } ); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeySubscriptionsKeyByKeyGet - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyPost.php index e5c94dee8e0..f4de9b6bc31 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsKeyByKeyPost.php @@ -31,11 +31,10 @@ * @psalm-suppress PropertyNotSetInConstructor * @template-implements Conflicting - * @template-implements Expandable * @template-implements Deprecatable200 * @template-implements Errorable */ -class ByProjectKeySubscriptionsKeyByKeyPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable +class ByProjectKeySubscriptionsKeyByKeyPost extends ApiRequest implements Conflicting, Deprecatable200, Errorable { /** * @param ?object|array|string $body @@ -148,13 +147,4 @@ function (RequestException $e) use ($resultType) { } ); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeySubscriptionsKeyByKeyPost - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsPost.php index 6e713045691..8ff6998ab26 100644 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsPost.php +++ b/lib/commercetools-api/src/Client/Resource/ByProjectKeySubscriptionsPost.php @@ -30,11 +30,10 @@ /** * @psalm-suppress PropertyNotSetInConstructor - * @template-implements Expandable * @template-implements Deprecatable201 * @template-implements Errorable */ -class ByProjectKeySubscriptionsPost extends ApiRequest implements Expandable, Deprecatable201, Errorable +class ByProjectKeySubscriptionsPost extends ApiRequest implements Deprecatable201, Errorable { /** * @param ?object|array|string $body @@ -143,13 +142,4 @@ function (RequestException $e) use ($resultType) { } ); } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeySubscriptionsPost - { - return $this->withQueryParam('expand', $expand); - } } diff --git a/references.txt b/references.txt index 90c3aeec178..7194ef4461d 100644 --- a/references.txt +++ b/references.txt @@ -101,3 +101,4 @@ c497e6c324870e2e3d2c39d1196a329b71f3752e 1670b8eb918db6237e6c39d244301670d9f7b6ee d842da41f5bb7448d8ec3f7ad959c1e46626bc2f e87bf15e82d10768771e954e60a6fc971a68142a +593bb9958df2b6a0a49fd0fdb2c0bd965f0ffb98 From ac42d4a787ffa6b2f8f3290e1ee414fad4713901 Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Wed, 9 Aug 2023 10:48:46 +0000 Subject: [PATCH 41/44] TASK: Updating SDK --- references.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/references.txt b/references.txt index 7194ef4461d..68889528168 100644 --- a/references.txt +++ b/references.txt @@ -102,3 +102,4 @@ c497e6c324870e2e3d2c39d1196a329b71f3752e d842da41f5bb7448d8ec3f7ad959c1e46626bc2f e87bf15e82d10768771e954e60a6fc971a68142a 593bb9958df2b6a0a49fd0fdb2c0bd965f0ffb98 +611b2ef31a338db391bb58aab4beb98f9d342439 From 2eb57058cfca8b59fad2f0e242ce4ba4c5651f00 Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Mon, 4 Sep 2023 14:39:47 +0200 Subject: [PATCH 42/44] update ecs --- composer.json | 2 +- ecs.php | 22 ++++++---------------- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/composer.json b/composer.json index 8b5befaafca..bd1c9d5098d 100644 --- a/composer.json +++ b/composer.json @@ -70,7 +70,7 @@ "monolog/monolog": "^1.3 || ^2.0", "phpunit/phpunit": "^9.0 | 8.5.22", "cache/array-adapter": "^1.0", - "symplify/easy-coding-standard": "11.1.5" + "symplify/easy-coding-standard": "12.0.7" }, "config": { "allow-plugins": { diff --git a/ecs.php b/ecs.php index d7ee9b2a285..d59c38a4907 100644 --- a/ecs.php +++ b/ecs.php @@ -3,22 +3,12 @@ declare(strict_types=1); ini_set("memory_limit", "-1"); -use Commercetools\Tools\SummaryOnlyOutputFormatter; -use ECSPrefix202208\Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symplify\EasyCodingStandard\ValueObject\Set\SetList; -use Symplify\EasyCodingStandard\ValueObject\Option; +use Symplify\EasyCodingStandard\Config\ECSConfig; -return static function (ContainerConfigurator $containerConfigurator): void { - $parameters = $containerConfigurator->parameters(); - - $parameters->set(Option::CACHE_DIRECTORY, __DIR__ . '/.ecs_cache'); - - $parameters->set(Option::PATHS, [__DIR__ . '/src', __DIR__ . '/test', __DIR__ . '/lib/commercetools-api/src', __DIR__ . '/lib/commercetools-api-tests/test', __DIR__ . '/lib/commercetools-base/src', __DIR__ . '/lib/commercetools-base/test', __DIR__ . '/lib/commercetools-import/src', __DIR__ . '/lib/commercetools-import-tests/test', __DIR__ . '/lib/commercetools-ml/src', __DIR__ . '/lib/commercetools-ml-tests/test']); - $parameters->set(Option::PARALLEL, true); - - $containerConfigurator->import(SetList::PSR_12); - - $services = $containerConfigurator->services(); - - $services->set(SummaryOnlyOutputFormatter::class); +return static function (ECSConfig $ecsConfig): void { + $ecsConfig->cacheDirectory(__DIR__ . '/.ecs_cache'); + $ecsConfig->paths([__DIR__ . '/src', __DIR__ . '/test', __DIR__ . '/lib/commercetools-api/src', __DIR__ . '/lib/commercetools-api-tests/test', __DIR__ . '/lib/commercetools-base/src', __DIR__ . '/lib/commercetools-base/test', __DIR__ . '/lib/commercetools-import/src', __DIR__ . '/lib/commercetools-import-tests/test', __DIR__ . '/lib/commercetools-ml/src', __DIR__ . '/lib/commercetools-ml-tests/test']); + $ecsConfig->parallel(); + $ecsConfig->sets([SetList::PSR_12]); }; From dff4399b56b259d7d5d754ac37f40cfcdc5b53da Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Mon, 4 Sep 2023 14:43:45 +0200 Subject: [PATCH 43/44] apply php mixin --- api-php-mixin.raml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 api-php-mixin.raml diff --git a/api-php-mixin.raml b/api-php-mixin.raml new file mode 100644 index 00000000000..5a3ca9cc57d --- /dev/null +++ b/api-php-mixin.raml @@ -0,0 +1,8 @@ +#%RAML 1.0 Extension +usage: Adds PHP SDK extended functionality +extends: api.raml +types: + CartDiscountValueFixedDraft: + properties: + money: + type: Money[] \ No newline at end of file From 1def0b96ba8d9a58e427c623d0912d6560f8839c Mon Sep 17 00:00:00 2001 From: Auto Mation Date: Mon, 4 Sep 2023 19:15:51 +0000 Subject: [PATCH 44/44] TASK: Updating SDK --- changes.md | 319 +++++++--- ...urceByProjectKeyMePaymentsKeyByKeyTest.php | 552 ----------------- .../ResourceByProjectKeyMePaymentsTest.php | 13 - lib/commercetools-api/docs/RequestBuilder.md | 50 -- .../ByProjectKeyMePaymentsKeyByKeyDelete.php | 170 ------ .../ByProjectKeyMePaymentsKeyByKeyGet.php | 155 ----- .../ByProjectKeyMePaymentsKeyByKeyPost.php | 160 ----- .../ResourceByProjectKeyMePayments.php | 11 - ...ResourceByProjectKeyMePaymentsKeyByKey.php | 59 -- .../src/Models/BusinessUnit/Associate.php | 14 - .../Models/BusinessUnit/AssociateBuilder.php | 29 - .../Models/BusinessUnit/AssociateDraft.php | 14 - .../BusinessUnit/AssociateDraftBuilder.php | 29 - .../BusinessUnit/AssociateDraftModel.php | 36 -- .../Models/BusinessUnit/AssociateModel.php | 36 -- .../src/Models/Cart/LineItemDraft.php | 16 +- .../src/Models/Cart/LineItemDraftBuilder.php | 31 +- .../src/Models/Cart/LineItemDraftModel.php | 38 +- .../Cart/MethodExternalTaxRateDraft.php | 44 ++ .../MethodExternalTaxRateDraftBuilder.php | 102 ++++ .../MethodExternalTaxRateDraftCollection.php | 56 ++ .../Cart/MethodExternalTaxRateDraftModel.php | 103 ++++ .../CartDiscountValueFixedDraft.php | 8 +- .../CartDiscountValueFixedDraftBuilder.php | 10 +- .../CartDiscountValueFixedDraftModel.php | 14 +- .../src/Models/Common/Asset.php | 2 +- .../src/Models/Common/AssetBuilder.php | 2 +- .../src/Models/Common/AssetDraft.php | 2 +- .../src/Models/Common/AssetDraftBuilder.php | 2 +- .../src/Models/Common/AssetDraftModel.php | 2 +- .../src/Models/Common/AssetModel.php | 2 +- .../src/Models/Common/AssetSource.php | 2 +- .../src/Models/Common/AssetSourceBuilder.php | 2 +- .../src/Models/Common/AssetSourceModel.php | 2 +- .../src/Models/Common/BaseResource.php | 12 + .../src/Models/Common/BaseResourceBuilder.php | 24 + .../src/Models/Common/BaseResourceModel.php | 24 + .../Me/MyCartChangeLineItemQuantityAction.php | 28 - ...artChangeLineItemQuantityActionBuilder.php | 83 +-- ...yCartChangeLineItemQuantityActionModel.php | 74 --- .../Me/MyShoppingListAddLineItemAction.php | 14 + ...MyShoppingListAddLineItemActionBuilder.php | 29 + .../MyShoppingListAddLineItemActionModel.php | 36 ++ .../MyShoppingListAddTextLineItemAction.php | 14 + ...oppingListAddTextLineItemActionBuilder.php | 29 + ...ShoppingListAddTextLineItemActionModel.php | 36 ++ ...oppingListChangeLineItemQuantityAction.php | 4 +- ...istChangeLineItemQuantityActionBuilder.php | 4 +- ...gListChangeLineItemQuantityActionModel.php | 4 +- ...oppingListChangeTextLineItemNameAction.php | 16 +- ...istChangeTextLineItemNameActionBuilder.php | 31 +- ...gListChangeTextLineItemNameActionModel.php | 38 +- ...ngListChangeTextLineItemQuantityAction.php | 16 +- ...hangeTextLineItemQuantityActionBuilder.php | 31 +- ...tChangeTextLineItemQuantityActionModel.php | 38 +- .../Me/MyShoppingListRemoveLineItemAction.php | 16 +- ...hoppingListRemoveLineItemActionBuilder.php | 31 +- ...yShoppingListRemoveLineItemActionModel.php | 38 +- ...MyShoppingListRemoveTextLineItemAction.php | 16 +- ...ingListRemoveTextLineItemActionBuilder.php | 31 +- ...ppingListRemoveTextLineItemActionModel.php | 38 +- ...oppingListSetLineItemCustomFieldAction.php | 16 +- ...istSetLineItemCustomFieldActionBuilder.php | 31 +- ...gListSetLineItemCustomFieldActionModel.php | 38 +- ...ngListSetTextLineItemCustomFieldAction.php | 16 +- ...etTextLineItemCustomFieldActionBuilder.php | 31 +- ...tSetTextLineItemCustomFieldActionModel.php | 38 +- ...ingListSetTextLineItemCustomTypeAction.php | 16 +- ...SetTextLineItemCustomTypeActionBuilder.php | 31 +- ...stSetTextLineItemCustomTypeActionModel.php | 38 +- ...ngListSetTextLineItemDescriptionAction.php | 16 +- ...etTextLineItemDescriptionActionBuilder.php | 31 +- ...tSetTextLineItemDescriptionActionModel.php | 38 +- ...CustomerAddressCustomFieldAddedMessage.php | 44 ++ ...rAddressCustomFieldAddedMessageBuilder.php | 433 ++++++++++++++ ...dressCustomFieldAddedMessageCollection.php | 56 ++ ...merAddressCustomFieldAddedMessageModel.php | 526 ++++++++++++++++ ...rAddressCustomFieldAddedMessagePayload.php | 44 ++ ...sCustomFieldAddedMessagePayloadBuilder.php | 92 +++ ...stomFieldAddedMessagePayloadCollection.php | 56 ++ ...essCustomFieldAddedMessagePayloadModel.php | 129 ++++ ...stomerAddressCustomFieldChangedMessage.php | 59 ++ ...ddressCustomFieldChangedMessageBuilder.php | 463 ++++++++++++++ ...essCustomFieldChangedMessageCollection.php | 56 ++ ...rAddressCustomFieldChangedMessageModel.php | 563 ++++++++++++++++++ ...ddressCustomFieldChangedMessagePayload.php | 59 ++ ...ustomFieldChangedMessagePayloadBuilder.php | 122 ++++ ...omFieldChangedMessagePayloadCollection.php | 56 ++ ...sCustomFieldChangedMessagePayloadModel.php | 166 ++++++ ...stomerAddressCustomFieldRemovedMessage.php | 30 + ...ddressCustomFieldRemovedMessageBuilder.php | 404 +++++++++++++ ...essCustomFieldRemovedMessageCollection.php | 56 ++ ...rAddressCustomFieldRemovedMessageModel.php | 490 +++++++++++++++ ...ddressCustomFieldRemovedMessagePayload.php | 30 + ...ustomFieldRemovedMessagePayloadBuilder.php | 63 ++ ...omFieldRemovedMessagePayloadCollection.php | 56 ++ ...sCustomFieldRemovedMessagePayloadModel.php | 93 +++ ...ustomerAddressCustomTypeRemovedMessage.php | 31 + ...AddressCustomTypeRemovedMessageBuilder.php | 405 +++++++++++++ ...ressCustomTypeRemovedMessageCollection.php | 56 ++ ...erAddressCustomTypeRemovedMessageModel.php | 491 +++++++++++++++ ...AddressCustomTypeRemovedMessagePayload.php | 31 + ...CustomTypeRemovedMessagePayloadBuilder.php | 64 ++ ...tomTypeRemovedMessagePayloadCollection.php | 56 ++ ...ssCustomTypeRemovedMessagePayloadModel.php | 94 +++ .../CustomerAddressCustomTypeSetMessage.php | 46 ++ ...omerAddressCustomTypeSetMessageBuilder.php | 447 ++++++++++++++ ...rAddressCustomTypeSetMessageCollection.php | 56 ++ ...stomerAddressCustomTypeSetMessageModel.php | 530 +++++++++++++++++ ...omerAddressCustomTypeSetMessagePayload.php | 46 ++ ...ressCustomTypeSetMessagePayloadBuilder.php | 105 ++++ ...sCustomTypeSetMessagePayloadCollection.php | 56 ++ ...ddressCustomTypeSetMessagePayloadModel.php | 133 +++++ .../CustomerCustomFieldAddedMessage.php | 44 ++ ...CustomerCustomFieldAddedMessageBuilder.php | 433 ++++++++++++++ ...tomerCustomFieldAddedMessageCollection.php | 56 ++ .../CustomerCustomFieldAddedMessageModel.php | 526 ++++++++++++++++ ...CustomerCustomFieldAddedMessagePayload.php | 44 ++ ...rCustomFieldAddedMessagePayloadBuilder.php | 92 +++ ...stomFieldAddedMessagePayloadCollection.php | 56 ++ ...merCustomFieldAddedMessagePayloadModel.php | 129 ++++ .../CustomerCustomFieldChangedMessage.php | 59 ++ ...stomerCustomFieldChangedMessageBuilder.php | 463 ++++++++++++++ ...merCustomFieldChangedMessageCollection.php | 56 ++ ...CustomerCustomFieldChangedMessageModel.php | 563 ++++++++++++++++++ ...stomerCustomFieldChangedMessagePayload.php | 59 ++ ...ustomFieldChangedMessagePayloadBuilder.php | 122 ++++ ...omFieldChangedMessagePayloadCollection.php | 56 ++ ...rCustomFieldChangedMessagePayloadModel.php | 166 ++++++ .../CustomerCustomFieldRemovedMessage.php | 30 + ...stomerCustomFieldRemovedMessageBuilder.php | 404 +++++++++++++ ...merCustomFieldRemovedMessageCollection.php | 56 ++ ...CustomerCustomFieldRemovedMessageModel.php | 490 +++++++++++++++ ...stomerCustomFieldRemovedMessagePayload.php | 30 + ...ustomFieldRemovedMessagePayloadBuilder.php | 63 ++ ...omFieldRemovedMessagePayloadCollection.php | 56 ++ ...rCustomFieldRemovedMessagePayloadModel.php | 93 +++ .../CustomerCustomTypeRemovedMessage.php | 31 + ...ustomerCustomTypeRemovedMessageBuilder.php | 405 +++++++++++++ ...omerCustomTypeRemovedMessageCollection.php | 56 ++ .../CustomerCustomTypeRemovedMessageModel.php | 491 +++++++++++++++ ...ustomerCustomTypeRemovedMessagePayload.php | 31 + ...CustomTypeRemovedMessagePayloadBuilder.php | 64 ++ ...tomTypeRemovedMessagePayloadCollection.php | 56 ++ ...erCustomTypeRemovedMessagePayloadModel.php | 94 +++ .../Message/CustomerCustomTypeSetMessage.php | 46 ++ .../CustomerCustomTypeSetMessageBuilder.php | 447 ++++++++++++++ ...CustomerCustomTypeSetMessageCollection.php | 56 ++ .../CustomerCustomTypeSetMessageModel.php | 530 +++++++++++++++++ .../CustomerCustomTypeSetMessagePayload.php | 46 ++ ...omerCustomTypeSetMessagePayloadBuilder.php | 105 ++++ ...rCustomTypeSetMessagePayloadCollection.php | 56 ++ ...stomerCustomTypeSetMessagePayloadModel.php | 133 +++++ .../Models/Message/CustomerMessagePayload.php | 16 + .../CustomerMessagePayloadBuilder.php} | 12 +- .../CustomerMessagePayloadCollection.php | 56 ++ .../Message/CustomerMessagePayloadModel.php | 55 ++ .../src/Models/Message/MessageModel.php | 13 +- .../Models/Message/MessagePayloadModel.php | 13 +- .../PaymentStatusInterfaceCodeSetMessage.php | 14 - ...ntStatusInterfaceCodeSetMessageBuilder.php | 29 - ...mentStatusInterfaceCodeSetMessageModel.php | 36 -- ...ntStatusInterfaceCodeSetMessagePayload.php | 14 - ...sInterfaceCodeSetMessagePayloadBuilder.php | 29 - ...tusInterfaceCodeSetMessagePayloadModel.php | 36 -- .../QuoteRenegotiationRequestedMessage.php | 30 + ...teRenegotiationRequestedMessageBuilder.php | 404 +++++++++++++ ...enegotiationRequestedMessageCollection.php | 56 ++ ...uoteRenegotiationRequestedMessageModel.php | 490 +++++++++++++++ ...teRenegotiationRequestedMessagePayload.php | 30 + ...otiationRequestedMessagePayloadBuilder.php | 63 ++ ...ationRequestedMessagePayloadCollection.php | 56 ++ ...egotiationRequestedMessagePayloadModel.php | 93 +++ ...dalonePriceStagedChangesRemovedMessage.php | 31 + ...riceStagedChangesRemovedMessageBuilder.php | 417 +++++++++++++ ...eStagedChangesRemovedMessageCollection.php | 56 ++ ...ePriceStagedChangesRemovedMessageModel.php | 493 +++++++++++++++ ...riceStagedChangesRemovedMessagePayload.php | 31 + ...gedChangesRemovedMessagePayloadBuilder.php | 75 +++ ...ChangesRemovedMessagePayloadCollection.php | 56 ++ ...tagedChangesRemovedMessagePayloadModel.php | 96 +++ .../src/Models/Payment/Payment.php | 70 --- .../src/Models/Payment/PaymentBuilder.php | 179 ------ .../src/Models/Payment/PaymentDraft.php | 70 --- .../Models/Payment/PaymentDraftBuilder.php | 178 ------ .../src/Models/Payment/PaymentDraftModel.php | 183 ------ .../src/Models/Payment/PaymentModel.php | 183 ------ .../Product/ProductRemovePriceAction.php | 47 -- .../ProductRemovePriceActionBuilder.php | 103 ---- .../Product/ProductRemovePriceActionModel.php | 114 ---- .../ProductSelection/ProductSelection.php | 15 - .../ProductSelectionBuilder.php | 30 - .../ProductSelectionDraft.php | 14 - .../ProductSelectionDraftBuilder.php | 29 - .../ProductSelectionDraftModel.php | 36 -- .../ProductSelectionModel.php | 37 -- .../ProductSelection/ProductSelectionType.php | 26 - .../ProductSelectionTypeCollection.php | 60 -- .../ProductSelectionTypeModel.php | 95 --- .../src/Models/QuoteRequest/QuoteRequest.php | 15 + .../QuoteRequest/QuoteRequestBuilder.php | 42 ++ .../Models/QuoteRequest/QuoteRequestModel.php | 39 ++ .../ShoppingListAddLineItemAction.php | 14 + .../ShoppingListAddLineItemActionBuilder.php | 29 + .../ShoppingListAddLineItemActionModel.php | 36 ++ .../ShoppingListAddTextLineItemAction.php | 14 + ...oppingListAddTextLineItemActionBuilder.php | 29 + ...ShoppingListAddTextLineItemActionModel.php | 36 ++ ...oppingListChangeLineItemQuantityAction.php | 16 +- ...istChangeLineItemQuantityActionBuilder.php | 31 +- ...gListChangeLineItemQuantityActionModel.php | 38 +- ...oppingListChangeTextLineItemNameAction.php | 16 +- ...istChangeTextLineItemNameActionBuilder.php | 31 +- ...gListChangeTextLineItemNameActionModel.php | 38 +- ...ngListChangeTextLineItemQuantityAction.php | 16 +- ...hangeTextLineItemQuantityActionBuilder.php | 31 +- ...tChangeTextLineItemQuantityActionModel.php | 38 +- .../ShoppingList/ShoppingListLineItem.php | 14 + .../ShoppingListLineItemBuilder.php | 29 + .../ShoppingListLineItemDraft.php | 14 + .../ShoppingListLineItemDraftBuilder.php | 29 + .../ShoppingListLineItemDraftModel.php | 36 ++ .../ShoppingListLineItemModel.php | 36 ++ .../ShoppingListRemoveLineItemAction.php | 16 +- ...hoppingListRemoveLineItemActionBuilder.php | 31 +- .../ShoppingListRemoveLineItemActionModel.php | 38 +- .../ShoppingListRemoveTextLineItemAction.php | 16 +- ...ingListRemoveTextLineItemActionBuilder.php | 31 +- ...ppingListRemoveTextLineItemActionModel.php | 38 +- ...oppingListSetLineItemCustomFieldAction.php | 16 +- ...istSetLineItemCustomFieldActionBuilder.php | 31 +- ...gListSetLineItemCustomFieldActionModel.php | 38 +- ...hoppingListSetLineItemCustomTypeAction.php | 16 +- ...ListSetLineItemCustomTypeActionBuilder.php | 31 +- ...ngListSetLineItemCustomTypeActionModel.php | 38 +- ...ngListSetTextLineItemCustomFieldAction.php | 16 +- ...etTextLineItemCustomFieldActionBuilder.php | 31 +- ...tSetTextLineItemCustomFieldActionModel.php | 38 +- ...ingListSetTextLineItemCustomTypeAction.php | 16 +- ...SetTextLineItemCustomTypeActionBuilder.php | 31 +- ...stSetTextLineItemCustomTypeActionModel.php | 38 +- ...ngListSetTextLineItemDescriptionAction.php | 16 +- ...etTextLineItemDescriptionActionBuilder.php | 31 +- ...tSetTextLineItemDescriptionActionModel.php | 38 +- .../src/Models/ShoppingList/TextLineItem.php | 14 + .../ShoppingList/TextLineItemBuilder.php | 29 + .../Models/ShoppingList/TextLineItemDraft.php | 14 + .../ShoppingList/TextLineItemDraftBuilder.php | 29 + .../ShoppingList/TextLineItemDraftModel.php | 36 ++ .../Models/ShoppingList/TextLineItemModel.php | 36 ++ .../StandalonePrice/StagedPriceDraft.php | 31 + .../StagedPriceDraftBuilder.php | 75 +++ .../StagedPriceDraftCollection.php | 56 ++ .../StandalonePrice/StagedPriceDraftModel.php | 69 +++ .../StandalonePrice/StandalonePriceDraft.php | 14 + .../StandalonePriceDraftBuilder.php | 40 ++ .../StandalonePriceDraftModel.php | 37 ++ ...andalonePriceRemoveStagedChangesAction.php | 16 + ...ePriceRemoveStagedChangesActionBuilder.php | 33 + ...iceRemoveStagedChangesActionCollection.php | 56 ++ ...onePriceRemoveStagedChangesActionModel.php | 56 ++ .../StandalonePriceUpdateActionModel.php | 1 + .../src/Base/MapperFactory.php | 64 +- ...urceByProjectKeyByResourceTypeByIDTest.php | 48 +- ...ResourceByProjectKeyByResourceTypeTest.php | 45 +- .../Resource/ResourceByProjectKeyTest.php | 42 +- .../ByProjectKeyByResourceTypeByIDGet.php | 39 +- .../ByProjectKeyByResourceTypeGet.php | 39 +- .../src/Client/Resource/ByProjectKeyGet.php | 39 +- .../src/Models/ChangeHistory/ModifiedBy.php | 43 +- .../ChangeHistory/ModifiedByBuilder.php | 85 ++- .../Models/ChangeHistory/ModifiedByModel.php | 104 +++- .../src/Models/Customfields/Custom.php | 2 +- .../src/Models/Customfields/CustomBuilder.php | 2 +- .../src/Models/Customfields/CustomModel.php | 2 +- .../Errors/InvalidStateTransitionError.php | 4 +- .../InvalidStateTransitionErrorBuilder.php | 4 +- .../InvalidStateTransitionErrorModel.php | 4 +- .../Importsummaries/OperationStates.php | 14 + .../OperationStatesBuilder.php | 31 +- .../Importsummaries/OperationStatesModel.php | 38 +- .../src/Models/Orders/Parcel.php | 2 +- .../src/Models/Orders/ParcelBuilder.php | 2 +- .../src/Models/Orders/ParcelModel.php | 2 +- references.txt | 1 + src/Api/Models/Product/AttributeAccessor.php | 150 ++--- test/unit/MiscTest.php | 10 +- test/unit/ProductProjectionsTest.php | 10 +- 288 files changed, 20141 insertions(+), 3626 deletions(-) delete mode 100644 lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePaymentsKeyByKeyTest.php delete mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyDelete.php delete mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyGet.php delete mode 100644 lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyPost.php delete mode 100644 lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMePaymentsKeyByKey.php create mode 100644 lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraft.php create mode 100644 lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftBuilder.php create mode 100644 lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftCollection.php create mode 100644 lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerMessagePayload.php rename lib/commercetools-api/src/Models/{ProductSelection/ProductSelectionTypeBuilder.php => Message/CustomerMessagePayloadBuilder.php} (55%) create mode 100644 lib/commercetools-api/src/Models/Message/CustomerMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/CustomerMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadModel.php create mode 100644 lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessage.php create mode 100644 lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageModel.php create mode 100644 lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayload.php create mode 100644 lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadBuilder.php create mode 100644 lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadCollection.php create mode 100644 lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadModel.php delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeCollection.php delete mode 100644 lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php create mode 100644 lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraft.php create mode 100644 lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftBuilder.php create mode 100644 lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftCollection.php create mode 100644 lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftModel.php create mode 100644 lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesAction.php create mode 100644 lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesActionBuilder.php create mode 100644 lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesActionCollection.php create mode 100644 lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesActionModel.php diff --git a/changes.md b/changes.md index f56e0191a3c..852a61557f0 100644 --- a/changes.md +++ b/changes.md @@ -1,18 +1,120 @@ **Api changes**
-Changed Property(s) +Added Resource(s) -- :warning: changed property `money` of type `CartDiscountValueFixed` from type `CentPrecisionMoney[]` to `TypedMoney[]` -- :warning: changed property `money` of type `CartDiscountValueFixedDraft` from type `Money[]` to `TypedMoneyDraft[]` -- :warning: changed property `country` of type `StagedOrder` from type `string` to `CountryCode` -- :warning: changed property `locale` of type `StagedOrder` from type `string` to `Locale` -- :warning: changed property `country` of type `StagedOrderSetCountryAction` from type `string` to `CountryCode` -- :warning: changed property `locale` of type `StagedOrderSetLocaleAction` from type `string` to `Locale` -- :warning: changed property `country` of type `Order` from type `string` to `CountryCode` -- :warning: changed property `locale` of type `Order` from type `string` to `Locale` -- :warning: changed property `country` of type `OrderImportDraft` from type `string` to `CountryCode` -- :warning: changed property `locale` of type `OrderSetLocaleAction` from type `string` to `Locale` +- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts` +- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}` +- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}` +
+ + +
+Removed Resource(s) + +- :warning: removed resource `/{projectKey}/me/payments/key={key}` +
+ + +
+Added QueryParameter(s) + +- added query parameter `where` to method `get /{projectKey}/in-store/key={storeKey}/product-selection-assignments` +- added query parameter `/^var[.][a-zA-Z0-9]+$/` to method `get /{projectKey}/in-store/key={storeKey}/product-selection-assignments` +
+ + +
+Removed QueryParameter(s) + +- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions` +- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions` +- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions` +- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions` +- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions/key={key}` +- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions/key={key}` +- :warning: removed query parameter `expand` from method `delete /{projectKey}/subscriptions/key={key}` +- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions/{ID}` +- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions/{ID}` +- :warning: removed query parameter `expand` from method `delete /{projectKey}/subscriptions/{ID}` +- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions/key={key}` +- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions/key={key}` +- :warning: removed query parameter `expand` from method `delete /{projectKey}/extensions/key={key}` +- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions/{ID}` +- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions/{ID}` +- :warning: removed query parameter `expand` from method `delete /{projectKey}/extensions/{ID}` +
+ + +
+Required Property(s) + +- changed property `roles` of type `Associate` to be optional +- changed property `customLineItemId` of type `CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction` to be optional +- changed property `customLineItemId` of type `CartChangeCustomLineItemMoneyAction` to be optional +- changed property `customLineItemId` of type `CartChangeCustomLineItemPriceModeAction` to be optional +- changed property `customLineItemId` of type `CartChangeCustomLineItemQuantityAction` to be optional +- changed property `customLineItemId` of type `CartRemoveCustomLineItemAction` to be optional +- changed property `customLineItemId` of type `CartSetCustomLineItemCustomFieldAction` to be optional +- changed property `customLineItemId` of type `CartSetCustomLineItemCustomTypeAction` to be optional +- changed property `customLineItemId` of type `CartSetCustomLineItemShippingDetailsAction` to be optional +- changed property `customLineItemId` of type `CartSetCustomLineItemTaxAmountAction` to be optional +- changed property `customLineItemId` of type `CartSetCustomLineItemTaxRateAction` to be optional +- changed property `centAmount` of type `CentPrecisionMoneyDraft` to be optional +- changed property `centAmount` of type `TypedMoneyDraft` to be optional +- changed property `comment` of type `MyQuoteRequestDraft` to be optional +- changed property `textLineItemId` of type `MyShoppingListChangeTextLineItemNameAction` to be optional +- changed property `textLineItemId` of type `MyShoppingListChangeTextLineItemQuantityAction` to be optional +- changed property `lineItemId` of type `MyShoppingListRemoveLineItemAction` to be optional +- changed property `textLineItemId` of type `MyShoppingListRemoveTextLineItemAction` to be optional +- changed property `lineItemId` of type `MyShoppingListSetLineItemCustomFieldAction` to be optional +- changed property `textLineItemId` of type `MyShoppingListSetTextLineItemCustomFieldAction` to be optional +- changed property `textLineItemId` of type `MyShoppingListSetTextLineItemCustomTypeAction` to be optional +- changed property `textLineItemId` of type `MyShoppingListSetTextLineItemDescriptionAction` to be optional +- changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemMoneyAction` to be optional +- changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemQuantityAction` to be optional +- changed property `customLineItemId` of type `StagedOrderImportCustomLineItemStateAction` to be optional +- changed property `lineItemId` of type `StagedOrderImportLineItemStateAction` to be optional +- changed property `customLineItemId` of type `StagedOrderRemoveCustomLineItemAction` to be optional +- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemCustomFieldAction` to be optional +- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemCustomTypeAction` to be optional +- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemShippingDetailsAction` to be optional +- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxAmountAction` to be optional +- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxRateAction` to be optional +- changed property `returnItemId` of type `StagedOrderSetReturnItemCustomFieldAction` to be optional +- changed property `returnItemId` of type `StagedOrderSetReturnItemCustomTypeAction` to be optional +- changed property `returnItemId` of type `StagedOrderSetReturnPaymentStateAction` to be optional +- changed property `returnItemId` of type `StagedOrderSetReturnShipmentStateAction` to be optional +- changed property `customLineItemId` of type `StagedOrderTransitionCustomLineItemStateAction` to be optional +- changed property `lineItemId` of type `StagedOrderTransitionLineItemStateAction` to be optional +- changed property `priceMode` of type `CustomLineItemImportDraft` to be optional +- changed property `customLineItemId` of type `OrderImportCustomLineItemStateAction` to be optional +- changed property `lineItemId` of type `OrderImportLineItemStateAction` to be optional +- changed property `customLineItemId` of type `OrderSetCustomLineItemCustomFieldAction` to be optional +- changed property `customLineItemId` of type `OrderSetCustomLineItemCustomTypeAction` to be optional +- changed property `customLineItemId` of type `OrderSetCustomLineItemShippingDetailsAction` to be optional +- changed property `returnItemId` of type `OrderSetReturnItemCustomFieldAction` to be optional +- changed property `returnItemId` of type `OrderSetReturnItemCustomTypeAction` to be optional +- changed property `returnItemId` of type `OrderSetReturnPaymentStateAction` to be optional +- changed property `returnItemId` of type `OrderSetReturnShipmentStateAction` to be optional +- changed property `customLineItemId` of type `OrderTransitionCustomLineItemStateAction` to be optional +- changed property `lineItemId` of type `OrderTransitionLineItemStateAction` to be optional +- changed property `comment` of type `QuoteRequestDraft` to be optional +- changed property `lineItemId` of type `ShoppingListChangeLineItemQuantityAction` to be optional +- changed property `textLineItemId` of type `ShoppingListChangeTextLineItemNameAction` to be optional +- changed property `textLineItemId` of type `ShoppingListChangeTextLineItemQuantityAction` to be optional +- changed property `lineItemId` of type `ShoppingListRemoveLineItemAction` to be optional +- changed property `textLineItemId` of type `ShoppingListRemoveTextLineItemAction` to be optional +- changed property `lineItemId` of type `ShoppingListSetLineItemCustomFieldAction` to be optional +- changed property `lineItemId` of type `ShoppingListSetLineItemCustomTypeAction` to be optional +- changed property `textLineItemId` of type `ShoppingListSetTextLineItemCustomFieldAction` to be optional +- changed property `textLineItemId` of type `ShoppingListSetTextLineItemCustomTypeAction` to be optional +- changed property `textLineItemId` of type `ShoppingListSetTextLineItemDescriptionAction` to be optional +- :warning: changed property `associateRoleAssignments` of type `AssociateDraft` to be required +- :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required +- :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required +- :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required +- :warning: changed property `shipmentState` of type `OrderChangeShipmentStateAction` to be required
@@ -22,6 +124,7 @@ - added property `stores` to type `CartDiscount` - added property `stores` to type `CartDiscountDraft` - added property `taxedPricePortions` to type `CustomLineItem` +- added property `perMethodExternalTaxRate` to type `LineItemDraft` - added property `customLineItemKey` to type `CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction` - added property `customLineItemKey` to type `CartChangeCustomLineItemMoneyAction` - added property `customLineItemKey` to type `CartChangeCustomLineItemPriceModeAction` @@ -37,6 +140,16 @@ - added property `associate` to type `ClientLogging` - added property `associate` to type `CreatedBy` - added property `associate` to type `LastModifiedBy` +- added property `key` to type `MyShoppingListAddLineItemAction` +- added property `key` to type `MyShoppingListAddTextLineItemAction` +- added property `textLineItemKey` to type `MyShoppingListChangeTextLineItemNameAction` +- added property `textLineItemKey` to type `MyShoppingListChangeTextLineItemQuantityAction` +- added property `lineItemKey` to type `MyShoppingListRemoveLineItemAction` +- added property `textLineItemKey` to type `MyShoppingListRemoveTextLineItemAction` +- added property `lineItemKey` to type `MyShoppingListSetLineItemCustomFieldAction` +- added property `textLineItemKey` to type `MyShoppingListSetTextLineItemCustomFieldAction` +- added property `textLineItemKey` to type `MyShoppingListSetTextLineItemCustomTypeAction` +- added property `textLineItemKey` to type `MyShoppingListSetTextLineItemDescriptionAction` - added property `customLineItemKey` to type `CustomLineItemStateTransitionMessage` - added property `lineItemKey` to type `LineItemStateTransitionMessage` - added property `customLineItemKey` to type `OrderCustomLineItemDiscountSetMessage` @@ -95,60 +208,40 @@ - added property `returnItemKey` to type `OrderSetReturnShipmentStateAction` - added property `customLineItemKey` to type `OrderTransitionCustomLineItemStateAction` - added property `lineItemKey` to type `OrderTransitionLineItemStateAction` +- added property `cart` to type `QuoteRequest` +- added property `key` to type `ShoppingListLineItem` +- added property `key` to type `ShoppingListLineItemDraft` +- added property `key` to type `TextLineItem` +- added property `key` to type `TextLineItemDraft` +- added property `key` to type `ShoppingListAddLineItemAction` +- added property `key` to type `ShoppingListAddTextLineItemAction` +- added property `lineItemKey` to type `ShoppingListChangeLineItemQuantityAction` +- added property `textLineItemKey` to type `ShoppingListChangeTextLineItemNameAction` +- added property `textLineItemKey` to type `ShoppingListChangeTextLineItemQuantityAction` +- added property `lineItemKey` to type `ShoppingListRemoveLineItemAction` +- added property `textLineItemKey` to type `ShoppingListRemoveTextLineItemAction` +- added property `lineItemKey` to type `ShoppingListSetLineItemCustomFieldAction` +- added property `lineItemKey` to type `ShoppingListSetLineItemCustomTypeAction` +- added property `textLineItemKey` to type `ShoppingListSetTextLineItemCustomFieldAction` +- added property `textLineItemKey` to type `ShoppingListSetTextLineItemCustomTypeAction` +- added property `textLineItemKey` to type `ShoppingListSetTextLineItemDescriptionAction` +- added property `staged` to type `StandalonePriceDraft`
-Required Property(s) +Changed Property(s) -- :warning: changed property `associateRoleAssignments` of type `AssociateDraft` to be required -- :warning: changed property `paymentState` of type `StagedOrderChangePaymentStateAction` to be required -- :warning: changed property `shipmentState` of type `StagedOrderChangeShipmentStateAction` to be required -- :warning: changed property `paymentState` of type `OrderChangePaymentStateAction` to be required -- :warning: changed property `shipmentState` of type `OrderChangeShipmentStateAction` to be required -- changed property `roles` of type `Associate` to be optional -- changed property `customLineItemId` of type `CartApplyDeltaToCustomLineItemShippingDetailsTargetsAction` to be optional -- changed property `customLineItemId` of type `CartChangeCustomLineItemMoneyAction` to be optional -- changed property `customLineItemId` of type `CartChangeCustomLineItemPriceModeAction` to be optional -- changed property `customLineItemId` of type `CartChangeCustomLineItemQuantityAction` to be optional -- changed property `customLineItemId` of type `CartRemoveCustomLineItemAction` to be optional -- changed property `customLineItemId` of type `CartSetCustomLineItemCustomFieldAction` to be optional -- changed property `customLineItemId` of type `CartSetCustomLineItemCustomTypeAction` to be optional -- changed property `customLineItemId` of type `CartSetCustomLineItemShippingDetailsAction` to be optional -- changed property `customLineItemId` of type `CartSetCustomLineItemTaxAmountAction` to be optional -- changed property `customLineItemId` of type `CartSetCustomLineItemTaxRateAction` to be optional -- changed property `centAmount` of type `CentPrecisionMoneyDraft` to be optional -- changed property `centAmount` of type `TypedMoneyDraft` to be optional -- changed property `comment` of type `MyQuoteRequestDraft` to be optional -- changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemMoneyAction` to be optional -- changed property `customLineItemId` of type `StagedOrderChangeCustomLineItemQuantityAction` to be optional -- changed property `customLineItemId` of type `StagedOrderImportCustomLineItemStateAction` to be optional -- changed property `lineItemId` of type `StagedOrderImportLineItemStateAction` to be optional -- changed property `customLineItemId` of type `StagedOrderRemoveCustomLineItemAction` to be optional -- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemCustomFieldAction` to be optional -- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemCustomTypeAction` to be optional -- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemShippingDetailsAction` to be optional -- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxAmountAction` to be optional -- changed property `customLineItemId` of type `StagedOrderSetCustomLineItemTaxRateAction` to be optional -- changed property `returnItemId` of type `StagedOrderSetReturnItemCustomFieldAction` to be optional -- changed property `returnItemId` of type `StagedOrderSetReturnItemCustomTypeAction` to be optional -- changed property `returnItemId` of type `StagedOrderSetReturnPaymentStateAction` to be optional -- changed property `returnItemId` of type `StagedOrderSetReturnShipmentStateAction` to be optional -- changed property `customLineItemId` of type `StagedOrderTransitionCustomLineItemStateAction` to be optional -- changed property `lineItemId` of type `StagedOrderTransitionLineItemStateAction` to be optional -- changed property `priceMode` of type `CustomLineItemImportDraft` to be optional -- changed property `customLineItemId` of type `OrderImportCustomLineItemStateAction` to be optional -- changed property `lineItemId` of type `OrderImportLineItemStateAction` to be optional -- changed property `customLineItemId` of type `OrderSetCustomLineItemCustomFieldAction` to be optional -- changed property `customLineItemId` of type `OrderSetCustomLineItemCustomTypeAction` to be optional -- changed property `customLineItemId` of type `OrderSetCustomLineItemShippingDetailsAction` to be optional -- changed property `returnItemId` of type `OrderSetReturnItemCustomFieldAction` to be optional -- changed property `returnItemId` of type `OrderSetReturnItemCustomTypeAction` to be optional -- changed property `returnItemId` of type `OrderSetReturnPaymentStateAction` to be optional -- changed property `returnItemId` of type `OrderSetReturnShipmentStateAction` to be optional -- changed property `customLineItemId` of type `OrderTransitionCustomLineItemStateAction` to be optional -- changed property `lineItemId` of type `OrderTransitionLineItemStateAction` to be optional -- changed property `comment` of type `QuoteRequestDraft` to be optional +- :warning: changed property `money` of type `CartDiscountValueFixed` from type `CentPrecisionMoney[]` to `TypedMoney[]` +- :warning: changed property `money` of type `CartDiscountValueFixedDraft` from type `Money[]` to `TypedMoneyDraft[]` +- :warning: changed property `country` of type `StagedOrder` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `StagedOrder` from type `string` to `Locale` +- :warning: changed property `country` of type `StagedOrderSetCountryAction` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `StagedOrderSetLocaleAction` from type `string` to `Locale` +- :warning: changed property `country` of type `Order` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `Order` from type `string` to `Locale` +- :warning: changed property `country` of type `OrderImportDraft` from type `string` to `CountryCode` +- :warning: changed property `locale` of type `OrderSetLocaleAction` from type `string` to `Locale`
@@ -165,42 +258,13 @@ -
-Added QueryParameter(s) - -- added query parameter `where` to method `get /{projectKey}/in-store/key={storeKey}/product-selection-assignments` -- added query parameter `/^var[.][a-zA-Z0-9]+$/` to method `get /{projectKey}/in-store/key={storeKey}/product-selection-assignments` -
- - -
-Removed QueryParameter(s) - -- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions` -- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions` -- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions` -- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions` -- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions/key={key}` -- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions/key={key}` -- :warning: removed query parameter `expand` from method `delete /{projectKey}/subscriptions/key={key}` -- :warning: removed query parameter `expand` from method `get /{projectKey}/subscriptions/{ID}` -- :warning: removed query parameter `expand` from method `post /{projectKey}/subscriptions/{ID}` -- :warning: removed query parameter `expand` from method `delete /{projectKey}/subscriptions/{ID}` -- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions/key={key}` -- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions/key={key}` -- :warning: removed query parameter `expand` from method `delete /{projectKey}/extensions/key={key}` -- :warning: removed query parameter `expand` from method `get /{projectKey}/extensions/{ID}` -- :warning: removed query parameter `expand` from method `post /{projectKey}/extensions/{ID}` -- :warning: removed query parameter `expand` from method `delete /{projectKey}/extensions/{ID}` -
- -
Added Type(s) - added type `CartDiscountAddStoreAction` - added type `CartDiscountRemoveStoreAction` - added type `CartDiscountSetStoresAction` +- added type `MethodExternalTaxRateDraft` - added type `ContentTooLargeError` - added type `MaxCartDiscountsReachedError` - added type `MaxStoreReferencesReachedError` @@ -210,19 +274,46 @@ - added type `GraphQLMaxStoreReferencesReachedError` - added type `GraphQLStoreCartDiscountsLimitReachedError` - added type `BusinessUnitParentChangedMessage` +- added type `CustomerAddressCustomFieldAddedMessage` +- added type `CustomerAddressCustomFieldChangedMessage` +- added type `CustomerAddressCustomFieldRemovedMessage` +- added type `CustomerAddressCustomTypeRemovedMessage` +- added type `CustomerAddressCustomTypeSetMessage` +- added type `CustomerCustomFieldAddedMessage` +- added type `CustomerCustomFieldChangedMessage` +- added type `CustomerCustomFieldRemovedMessage` +- added type `CustomerCustomTypeRemovedMessage` +- added type `CustomerCustomTypeSetMessage` - added type `OrderCustomFieldAddedMessage` - added type `OrderCustomFieldChangedMessage` - added type `OrderCustomFieldRemovedMessage` - added type `OrderCustomTypeRemovedMessage` - added type `OrderCustomTypeSetMessage` +- added type `QuoteRenegotiationRequestedMessage` +- added type `StandalonePriceStagedChangesRemovedMessage` - added type `BusinessUnitParentChangedMessagePayload` +- added type `CustomerAddressCustomFieldAddedMessagePayload` +- added type `CustomerAddressCustomFieldChangedMessagePayload` +- added type `CustomerAddressCustomFieldRemovedMessagePayload` +- added type `CustomerAddressCustomTypeRemovedMessagePayload` +- added type `CustomerAddressCustomTypeSetMessagePayload` +- added type `CustomerCustomFieldAddedMessagePayload` +- added type `CustomerCustomFieldChangedMessagePayload` +- added type `CustomerCustomFieldRemovedMessagePayload` +- added type `CustomerCustomTypeRemovedMessagePayload` +- added type `CustomerCustomTypeSetMessagePayload` +- added type `CustomerMessagePayload` - added type `OrderCustomFieldAddedMessagePayload` - added type `OrderCustomFieldChangedMessagePayload` - added type `OrderCustomFieldRemovedMessagePayload` - added type `OrderCustomTypeRemovedMessagePayload` - added type `OrderCustomTypeSetMessagePayload` +- added type `QuoteRenegotiationRequestedMessagePayload` +- added type `StandalonePriceStagedChangesRemovedMessagePayload` - added type `StagedOrderSetDirectDiscountsAction` - added type `StagedOrderSetStoreAction` +- added type `StagedPriceDraft` +- added type `StandalonePriceRemoveStagedChangesAction`
@@ -232,6 +323,7 @@ - type `AssociateRoleDeprecated` is removed - type `IndividualExclusionProductSelectionType` is removed - type `IndividualProductSelectionType` is removed +- type `ProductSelectionType` is removed - type `ProductSelectionTypeEnum` is removed @@ -262,11 +354,11 @@
-Added Resource(s) +Removed Method(s) -- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts` -- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/key={key}` -- added resource `/{projectKey}/in-store/key={storeKey}/cart-discounts/{ID}` +- :warning: removed method `$apiRoot->withProjectKey()->me()->payments()->withKey()->get()` +- :warning: removed method `$apiRoot->withProjectKey()->me()->payments()->withKey()->post()` +- :warning: removed method `$apiRoot->withProjectKey()->me()->payments()->withKey()->delete()`
@@ -276,17 +368,47 @@ - added enum `associate-role` to type `ChangeSubscriptionResourceTypeId` + +
+Removed Enum(s) + +- :warning: removed enum `Failed` from type `QuoteState` +
+ **Import changes**
Required Property(s) -- :warning: changed property `key` of type `PriceDraftImport` to be required - changed property `addresses` of type `CustomerImport` to be optional +- :warning: changed property `key` of type `PriceDraftImport` to be required +
+ + +
+Added Property(s) + +- added property `canceled` to type `OperationStates` +
+ + +
+Added Enum(s) + +- added enum `canceled` to type `ProcessingState`
**History changes** +
+Added QueryParameter(s) + +- added query parameter `associateId` to method `get /{projectKey}` +- added query parameter `associateId` to method `get /{projectKey}/{resourceType}` +- added query parameter `associateId` to method `get /{projectKey}/{resourceType}/{ID}` +
+ +
Added Type(s) @@ -303,6 +425,13 @@
+
+Added Property(s) + +- added property `associate` to type `ModifiedBy` +
+ +
Added Enum(s) diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePaymentsKeyByKeyTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePaymentsKeyByKeyTest.php deleted file mode 100644 index af180214f87..00000000000 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePaymentsKeyByKeyTest.php +++ /dev/null @@ -1,552 +0,0 @@ -assertSame(strtolower($method), strtolower($request->getMethod())); - $this->assertSame($relativeUri, (string) $request->getUri()); - if (!is_null($body)) { - $this->assertJsonStringEqualsJsonString($body, (string) $request->getBody()); - } else { - $this->assertSame("", (string) $request->getBody()); - } - } - - - - /** - * @dataProvider getRequestBuilderResponses() - */ - public function testMapFromResponse(callable $builderFunction, $statusCode) - { - $builder = new ApiRequestBuilder(); - $request = $builderFunction($builder); - $this->assertInstanceOf(ApiRequest::class, $request); - - $response = new Response($statusCode, [], "{}"); - $this->assertInstanceOf(JsonObject::class, $request->mapFromResponse($response)); - } - - /** - * @dataProvider getRequestBuilders() - */ - public function testExecuteClientException(callable $builderFunction) - { - $client = $this->createMock(ClientInterface::class); - - $builder = new ApiRequestBuilder($client); - $request = $builderFunction($builder); - $client->method("send")->willThrowException(new ClientException("Oops!", $request, new Response(400))); - - $this->expectException(ApiClientException::class); - $request->execute(); - } - - /** - * @dataProvider getRequestBuilders() - */ - public function testExecuteServerException(callable $builderFunction) - { - $client = $this->createMock(ClientInterface::class); - - $builder = new ApiRequestBuilder($client); - $request = $builderFunction($builder); - $client->method("send")->willThrowException(new ServerException("Oops!", $request, new Response(500))); - - $this->expectException(ApiServerException::class); - $request->execute(); - } - - public function getRequests() - { - return [ - 'ByProjectKeyMePaymentsKeyByKeyGet_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->me() - ->payments() - ->withKey('test_key') - ->get() - ->withExpand('expand'); - }, - 'get', - 'test_projectKey/me/payments/key=test_key?expand=expand', - ], - 'ByProjectKeyMePaymentsKeyByKeyGet' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("test_projectKey") - ->me() - ->payments() - ->withKey("test_key") - ->get(); - }, - 'get', - 'test_projectKey/me/payments/key=test_key', - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->me() - ->payments() - ->withKey('test_key') - ->post(null) - ->withExpand('expand'); - }, - 'post', - 'test_projectKey/me/payments/key=test_key?expand=expand', - ], - 'ByProjectKeyMePaymentsKeyByKeyPost' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("test_projectKey") - ->me() - ->payments() - ->withKey("test_key") - ->post(null); - }, - 'post', - 'test_projectKey/me/payments/key=test_key', - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_withVersion' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->me() - ->payments() - ->withKey('test_key') - ->delete() - ->withVersion('version'); - }, - 'delete', - 'test_projectKey/me/payments/key=test_key?version=version', - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_withExpand' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey('test_projectKey') - ->me() - ->payments() - ->withKey('test_key') - ->delete() - ->withExpand('expand'); - }, - 'delete', - 'test_projectKey/me/payments/key=test_key?expand=expand', - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("test_projectKey") - ->me() - ->payments() - ->withKey("test_key") - ->delete(); - }, - 'delete', - 'test_projectKey/me/payments/key=test_key', - ] - ]; - } - - public function getResources() - { - return [ - ]; - } - - public function getRequestBuilders() - { - return [ - 'ByProjectKeyMePaymentsKeyByKeyGet' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); - } - ], - 'ByProjectKeyMePaymentsKeyByKeyPost' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - } - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - } - ] - ]; - } - - public function getRequestBuilderResponses() - { - return [ - 'ByProjectKeyMePaymentsKeyByKeyGet_200' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); - }, - 200 - ], - 'ByProjectKeyMePaymentsKeyByKeyGet_400' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); - }, - 400 - ], - 'ByProjectKeyMePaymentsKeyByKeyGet_401' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); - }, - 401 - ], - 'ByProjectKeyMePaymentsKeyByKeyGet_403' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); - }, - 403 - ], - 'ByProjectKeyMePaymentsKeyByKeyGet_404' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); - }, - 404 - ], - 'ByProjectKeyMePaymentsKeyByKeyGet_500' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); - }, - 500 - ], - 'ByProjectKeyMePaymentsKeyByKeyGet_502' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); - }, - 502 - ], - 'ByProjectKeyMePaymentsKeyByKeyGet_503' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); - }, - 503 - ], - 'ByProjectKeyMePaymentsKeyByKeyGet_599' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); - }, - 599 - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_200' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - }, - 200 - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_409' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - }, - 409 - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_400' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - }, - 400 - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_401' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - }, - 401 - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_403' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - }, - 403 - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_404' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - }, - 404 - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_500' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - }, - 500 - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_502' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - }, - 502 - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_503' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - }, - 503 - ], - 'ByProjectKeyMePaymentsKeyByKeyPost_599' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); - }, - 599 - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_200' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - }, - 200 - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_409' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - }, - 409 - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_400' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - }, - 400 - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_401' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - }, - 401 - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_403' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - }, - 403 - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_404' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - }, - 404 - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_500' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - }, - 500 - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_502' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - }, - 502 - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_503' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - }, - 503 - ], - 'ByProjectKeyMePaymentsKeyByKeyDelete_599' => [ - function (ApiRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); - }, - 599 - ] - ]; - } -} diff --git a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePaymentsTest.php b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePaymentsTest.php index b2eee6e240e..132eedfb1a7 100644 --- a/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePaymentsTest.php +++ b/lib/commercetools-api-tests/test/unit/Client/Resource/ResourceByProjectKeyMePaymentsTest.php @@ -10,7 +10,6 @@ use Commercetools\Api\Client\ApiRequestBuilder; use Commercetools\Api\Client\Resource\ResourceByProjectKeyMePaymentsByID; -use Commercetools\Api\Client\Resource\ResourceByProjectKeyMePaymentsKeyByKey; use Commercetools\Base\JsonObject; use Commercetools\Client\ApiRequest; use Commercetools\Exception\ApiClientException; @@ -226,18 +225,6 @@ function (ApiRequestBuilder $builder): RequestInterface { public function getResources() { return [ - 'ResourceByProjectKeyMePaymentsKeyByKey' => [ - function (ApiRequestBuilder $builder): ResourceByProjectKeyMePaymentsKeyByKey { - return $builder - ->withProjectKey("test_projectKey") - ->me() - ->payments() - ->withKey("test_key"); - }, - ResourceByProjectKeyMePaymentsKeyByKey::class, - ['projectKey' => 'test_projectKey', 'key' => 'test_key'], - '/{projectKey}/me/payments/key={key}' - ], 'ResourceByProjectKeyMePaymentsByID' => [ function (ApiRequestBuilder $builder): ResourceByProjectKeyMePaymentsByID { return $builder diff --git a/lib/commercetools-api/docs/RequestBuilder.md b/lib/commercetools-api/docs/RequestBuilder.md index f6bb8e7b633..9b142e2daae 100644 --- a/lib/commercetools-api/docs/RequestBuilder.md +++ b/lib/commercetools-api/docs/RequestBuilder.md @@ -4336,56 +4336,6 @@ $request = $builder ->withId("ID") ->delete(); ``` -## `withProjectKey("projectKey")->me()->payments()->withKey("key")->get()` - -null - -### Example -```php -use Commercetools\Api\Client\ApiRequestBuilder; - -$builder = new ApiRequestBuilder(); -$request = $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->get(); -``` -## `withProjectKey("projectKey")->me()->payments()->withKey("key")->post(null)` - -This endpoint can only update a Payment when it has no [Transactions](ctp:api:type:Transaction). - - -### Example -```php -use Commercetools\Api\Client\ApiRequestBuilder; - -$builder = new ApiRequestBuilder(); -$request = $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->post(null); -``` -## `withProjectKey("projectKey")->me()->payments()->withKey("key")->delete()` - -This endpoint can only delete a Payment when it has no [Transactions](ctp:api:type:Transaction). - - -### Example -```php -use Commercetools\Api\Client\ApiRequestBuilder; - -$builder = new ApiRequestBuilder(); -$request = $builder - ->withProjectKey("projectKey") - ->me() - ->payments() - ->withKey("key") - ->delete(); -``` ## `withProjectKey("projectKey")->me()->quoteRequests()->get()` null diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyDelete.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyDelete.php deleted file mode 100644 index bd8f872ad2e..00000000000 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyDelete.php +++ /dev/null @@ -1,170 +0,0 @@ - - * @template-implements Conflicting - * @template-implements Expandable - * @template-implements Errorable - * @template-implements Deprecatable200 - */ -class ByProjectKeyMePaymentsKeyByKeyDelete extends ApiRequest implements Versioned, Conflicting, Expandable, Errorable, Deprecatable200 -{ - /** - * @param ?object|array|string $body - * @psalm-param array $headers - */ - public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) - { - $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/me/payments/key={key}'); - parent::__construct($client, 'DELETE', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); - } - - /** - * @template T of JsonObject - * @psalm-param ?class-string $resultType - * @return ErrorResponse|JsonObject|MyPayment|T|null - */ - public function mapFromResponse(?ResponseInterface $response, string $resultType = null) - { - if (is_null($response)) { - return null; - } - if (is_null($resultType)) { - switch ($response->getStatusCode()) { - case '200': - $resultType = MyPaymentModel::class; - - break; - case '409': - $resultType = ErrorResponseModel::class; - - break; - case '400': - $resultType = ErrorResponseModel::class; - - break; - case '401': - $resultType = ErrorResponseModel::class; - - break; - case '403': - $resultType = ErrorResponseModel::class; - - break; - case '500': - $resultType = ErrorResponseModel::class; - - break; - case '502': - $resultType = ErrorResponseModel::class; - - break; - case '503': - $resultType = ErrorResponseModel::class; - - break; - default: - $resultType = JsonObjectModel::class; - - break; - } - } - - return $resultType::of($this->responseData($response)); - } - - /** - * @template T of JsonObject - * @psalm-param ?class-string $resultType - * - * @return null|T|ErrorResponse|JsonObject|MyPayment - */ - public function execute(array $options = [], string $resultType = null) - { - try { - $response = $this->send($options); - } catch (ServerException $e) { - $response = $e->getResponse(); - $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - throw $e; - } catch (ClientException $e) { - $response = $e->getResponse(); - $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - throw $e; - } - - return $this->mapFromResponse($response, $resultType); - } - - /** - * @template T of JsonObject - * @psalm-param ?class-string $resultType - * - * @return PromiseInterface - */ - public function executeAsync(array $options = [], string $resultType = null) - { - return $this->sendAsync($options)->then( - function (ResponseInterface $response) use ($resultType) { - return $this->mapFromResponse($response, $resultType); - }, - function (RequestException $e) use ($resultType) { - $response = $e->getResponse(); - if ($e instanceof ServerException) { - $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - } - if ($e instanceof ClientException) { - $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - } - throw $e; - } - ); - } - - /** - * - * @psalm-param scalar|scalar[] $version - */ - public function withVersion($version): ByProjectKeyMePaymentsKeyByKeyDelete - { - return $this->withQueryParam('version', $version); - } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyMePaymentsKeyByKeyDelete - { - return $this->withQueryParam('expand', $expand); - } -} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyGet.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyGet.php deleted file mode 100644 index 4756917cf7b..00000000000 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyGet.php +++ /dev/null @@ -1,155 +0,0 @@ - - * @template-implements Errorable - * @template-implements Deprecatable200 - */ -class ByProjectKeyMePaymentsKeyByKeyGet extends ApiRequest implements Expandable, Errorable, Deprecatable200 -{ - /** - * @param ?object|array|string $body - * @psalm-param array $headers - */ - public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) - { - $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/me/payments/key={key}'); - parent::__construct($client, 'GET', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); - } - - /** - * @template T of JsonObject - * @psalm-param ?class-string $resultType - * @return ErrorResponse|JsonObject|MyPayment|T|null - */ - public function mapFromResponse(?ResponseInterface $response, string $resultType = null) - { - if (is_null($response)) { - return null; - } - if (is_null($resultType)) { - switch ($response->getStatusCode()) { - case '200': - $resultType = MyPaymentModel::class; - - break; - case '400': - $resultType = ErrorResponseModel::class; - - break; - case '401': - $resultType = ErrorResponseModel::class; - - break; - case '403': - $resultType = ErrorResponseModel::class; - - break; - case '500': - $resultType = ErrorResponseModel::class; - - break; - case '502': - $resultType = ErrorResponseModel::class; - - break; - case '503': - $resultType = ErrorResponseModel::class; - - break; - default: - $resultType = JsonObjectModel::class; - - break; - } - } - - return $resultType::of($this->responseData($response)); - } - - /** - * @template T of JsonObject - * @psalm-param ?class-string $resultType - * - * @return null|T|ErrorResponse|JsonObject|MyPayment - */ - public function execute(array $options = [], string $resultType = null) - { - try { - $response = $this->send($options); - } catch (ServerException $e) { - $response = $e->getResponse(); - $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - throw $e; - } catch (ClientException $e) { - $response = $e->getResponse(); - $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - throw $e; - } - - return $this->mapFromResponse($response, $resultType); - } - - /** - * @template T of JsonObject - * @psalm-param ?class-string $resultType - * - * @return PromiseInterface - */ - public function executeAsync(array $options = [], string $resultType = null) - { - return $this->sendAsync($options)->then( - function (ResponseInterface $response) use ($resultType) { - return $this->mapFromResponse($response, $resultType); - }, - function (RequestException $e) use ($resultType) { - $response = $e->getResponse(); - if ($e instanceof ServerException) { - $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - } - if ($e instanceof ClientException) { - $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - } - throw $e; - } - ); - } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyMePaymentsKeyByKeyGet - { - return $this->withQueryParam('expand', $expand); - } -} diff --git a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyPost.php b/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyPost.php deleted file mode 100644 index 4cee545ef45..00000000000 --- a/lib/commercetools-api/src/Client/Resource/ByProjectKeyMePaymentsKeyByKeyPost.php +++ /dev/null @@ -1,160 +0,0 @@ - - * @template-implements Expandable - * @template-implements Deprecatable200 - * @template-implements Errorable - */ -class ByProjectKeyMePaymentsKeyByKeyPost extends ApiRequest implements Conflicting, Expandable, Deprecatable200, Errorable -{ - /** - * @param ?object|array|string $body - * @psalm-param array $headers - */ - public function __construct(string $projectKey, string $key, $body = null, array $headers = [], ClientInterface $client = null) - { - $uri = str_replace(['{projectKey}', '{key}'], [$projectKey, $key], '{projectKey}/me/payments/key={key}'); - parent::__construct($client, 'POST', $uri, $headers, is_object($body) || is_array($body) ? json_encode($body) : $body); - } - - /** - * @template T of JsonObject - * @psalm-param ?class-string $resultType - * @return ErrorResponse|JsonObject|MyPayment|T|null - */ - public function mapFromResponse(?ResponseInterface $response, string $resultType = null) - { - if (is_null($response)) { - return null; - } - if (is_null($resultType)) { - switch ($response->getStatusCode()) { - case '200': - $resultType = MyPaymentModel::class; - - break; - case '409': - $resultType = ErrorResponseModel::class; - - break; - case '400': - $resultType = ErrorResponseModel::class; - - break; - case '401': - $resultType = ErrorResponseModel::class; - - break; - case '403': - $resultType = ErrorResponseModel::class; - - break; - case '500': - $resultType = ErrorResponseModel::class; - - break; - case '502': - $resultType = ErrorResponseModel::class; - - break; - case '503': - $resultType = ErrorResponseModel::class; - - break; - default: - $resultType = JsonObjectModel::class; - - break; - } - } - - return $resultType::of($this->responseData($response)); - } - - /** - * @template T of JsonObject - * @psalm-param ?class-string $resultType - * - * @return null|T|ErrorResponse|JsonObject|MyPayment - */ - public function execute(array $options = [], string $resultType = null) - { - try { - $response = $this->send($options); - } catch (ServerException $e) { - $response = $e->getResponse(); - $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - throw $e; - } catch (ClientException $e) { - $response = $e->getResponse(); - $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - throw $e; - } - - return $this->mapFromResponse($response, $resultType); - } - - /** - * @template T of JsonObject - * @psalm-param ?class-string $resultType - * - * @return PromiseInterface - */ - public function executeAsync(array $options = [], string $resultType = null) - { - return $this->sendAsync($options)->then( - function (ResponseInterface $response) use ($resultType) { - return $this->mapFromResponse($response, $resultType); - }, - function (RequestException $e) use ($resultType) { - $response = $e->getResponse(); - if ($e instanceof ServerException) { - $e = ExceptionFactory::createServerException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - } - if ($e instanceof ClientException) { - $e = ExceptionFactory::createClientException($e, $this, $response, $this->mapFromResponse($response, $resultType)); - } - throw $e; - } - ); - } - - /** - * - * @psalm-param scalar|scalar[] $expand - */ - public function withExpand($expand): ByProjectKeyMePaymentsKeyByKeyPost - { - return $this->withQueryParam('expand', $expand); - } -} diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMePayments.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMePayments.php index 88759bdf026..9b9488b2eef 100644 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMePayments.php +++ b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMePayments.php @@ -26,17 +26,6 @@ public function __construct(array $args = [], ClientInterface $client = null) parent::__construct('/{projectKey}/me/payments', $args, $client); } - /** - */ - public function withKey(string $key = null): ResourceByProjectKeyMePaymentsKeyByKey - { - $args = $this->getArgs(); - if (!is_null($key)) { - $args['key'] = $key; - } - - return new ResourceByProjectKeyMePaymentsKeyByKey($args, $this->getClient()); - } /** */ public function withId(string $ID = null): ResourceByProjectKeyMePaymentsByID diff --git a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMePaymentsKeyByKey.php b/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMePaymentsKeyByKey.php deleted file mode 100644 index f26cdd47c87..00000000000 --- a/lib/commercetools-api/src/Client/Resource/ResourceByProjectKeyMePaymentsKeyByKey.php +++ /dev/null @@ -1,59 +0,0 @@ - $args - */ - public function __construct(array $args = [], ClientInterface $client = null) - { - parent::__construct('/{projectKey}/me/payments/key={key}', $args, $client); - } - - /** - * @psalm-param ?object|array|string $body - * @psalm-param array $headers - */ - public function get($body = null, array $headers = []): ByProjectKeyMePaymentsKeyByKeyGet - { - $args = $this->getArgs(); - - return new ByProjectKeyMePaymentsKeyByKeyGet($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); - } - /** - * @psalm-param ?MyPaymentUpdate $body - * @psalm-param array $headers - */ - public function post(?MyPaymentUpdate $body = null, array $headers = []): ByProjectKeyMePaymentsKeyByKeyPost - { - $args = $this->getArgs(); - - return new ByProjectKeyMePaymentsKeyByKeyPost($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); - } - /** - * @psalm-param ?object|array|string $body - * @psalm-param array $headers - */ - public function delete($body = null, array $headers = []): ByProjectKeyMePaymentsKeyByKeyDelete - { - $args = $this->getArgs(); - - return new ByProjectKeyMePaymentsKeyByKeyDelete($args['projectKey'], $args['key'], $body, $headers, $this->getClient()); - } -} diff --git a/lib/commercetools-api/src/Models/BusinessUnit/Associate.php b/lib/commercetools-api/src/Models/BusinessUnit/Associate.php index 0d1a0479156..c848d1d5842 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/Associate.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/Associate.php @@ -15,7 +15,6 @@ interface Associate extends JsonObject { public const FIELD_ASSOCIATE_ROLE_ASSIGNMENTS = 'associateRoleAssignments'; - public const FIELD_ROLES = 'roles'; public const FIELD_CUSTOMER = 'customer'; /** @@ -26,14 +25,6 @@ interface Associate extends JsonObject */ public function getAssociateRoleAssignments(); - /** - *

Deprecated type. Use associateRoleAssignment instead.

- * - - * @return null|array - */ - public function getRoles(); - /** *

The Customer that acts as an Associate in the Business Unit.

* @@ -47,11 +38,6 @@ public function getCustomer(); */ public function setAssociateRoleAssignments(?AssociateRoleAssignmentCollection $associateRoleAssignments): void; - /** - * @param ?array $roles - */ - public function setRoles(?array $roles): void; - /** * @param ?CustomerReference $customer */ diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php index 57830987d4f..96e09adb6e3 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateBuilder.php @@ -28,12 +28,6 @@ final class AssociateBuilder implements Builder */ private $associateRoleAssignments; - /** - - * @var ?array - */ - private $roles; - /** * @var null|CustomerReference|CustomerReferenceBuilder @@ -51,17 +45,6 @@ public function getAssociateRoleAssignments() return $this->associateRoleAssignments; } - /** - *

Deprecated type. Use associateRoleAssignment instead.

- * - - * @return null|array - */ - public function getRoles() - { - return $this->roles; - } - /** *

The Customer that acts as an Associate in the Business Unit.

* @@ -84,17 +67,6 @@ public function withAssociateRoleAssignments(?AssociateRoleAssignmentCollection return $this; } - /** - * @param ?array $roles - * @return $this - */ - public function withRoles(?array $roles) - { - $this->roles = $roles; - - return $this; - } - /** * @param ?CustomerReference $customer * @return $this @@ -121,7 +93,6 @@ public function build(): Associate { return new AssociateModel( $this->associateRoleAssignments, - $this->roles, $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer ); } diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php index 5290ddda1de..0d2a462e4bb 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraft.php @@ -15,7 +15,6 @@ interface AssociateDraft extends JsonObject { public const FIELD_ASSOCIATE_ROLE_ASSIGNMENTS = 'associateRoleAssignments'; - public const FIELD_ROLES = 'roles'; public const FIELD_CUSTOMER = 'customer'; /** @@ -26,14 +25,6 @@ interface AssociateDraft extends JsonObject */ public function getAssociateRoleAssignments(); - /** - *

Deprecated type. Use associateRoleAssignment instead.

- * - - * @return null|array - */ - public function getRoles(); - /** *

The Customer to be part of the Business Unit.

* @@ -47,11 +38,6 @@ public function getCustomer(); */ public function setAssociateRoleAssignments(?AssociateRoleAssignmentDraftCollection $associateRoleAssignments): void; - /** - * @param ?array $roles - */ - public function setRoles(?array $roles): void; - /** * @param ?CustomerResourceIdentifier $customer */ diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php index 92ee24bf70b..59a39c0bcfe 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftBuilder.php @@ -28,12 +28,6 @@ final class AssociateDraftBuilder implements Builder */ private $associateRoleAssignments; - /** - - * @var ?array - */ - private $roles; - /** * @var null|CustomerResourceIdentifier|CustomerResourceIdentifierBuilder @@ -51,17 +45,6 @@ public function getAssociateRoleAssignments() return $this->associateRoleAssignments; } - /** - *

Deprecated type. Use associateRoleAssignment instead.

- * - - * @return null|array - */ - public function getRoles() - { - return $this->roles; - } - /** *

The Customer to be part of the Business Unit.

* @@ -84,17 +67,6 @@ public function withAssociateRoleAssignments(?AssociateRoleAssignmentDraftCollec return $this; } - /** - * @param ?array $roles - * @return $this - */ - public function withRoles(?array $roles) - { - $this->roles = $roles; - - return $this; - } - /** * @param ?CustomerResourceIdentifier $customer * @return $this @@ -121,7 +93,6 @@ public function build(): AssociateDraft { return new AssociateDraftModel( $this->associateRoleAssignments, - $this->roles, $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer ); } diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php index 4c70cd7a2ed..edc468ede04 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateDraftModel.php @@ -27,12 +27,6 @@ final class AssociateDraftModel extends JsonObjectModel implements AssociateDraf */ protected $associateRoleAssignments; - /** - * - * @var ?array - */ - protected $roles; - /** * * @var ?CustomerResourceIdentifier @@ -45,11 +39,9 @@ final class AssociateDraftModel extends JsonObjectModel implements AssociateDraf */ public function __construct( ?AssociateRoleAssignmentDraftCollection $associateRoleAssignments = null, - ?array $roles = null, ?CustomerResourceIdentifier $customer = null ) { $this->associateRoleAssignments = $associateRoleAssignments; - $this->roles = $roles; $this->customer = $customer; } @@ -73,26 +65,6 @@ public function getAssociateRoleAssignments() return $this->associateRoleAssignments; } - /** - *

Deprecated type. Use associateRoleAssignment instead.

- * - * - * @return null|array - */ - public function getRoles() - { - if (is_null($this->roles)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_ROLES); - if (is_null($data)) { - return null; - } - $this->roles = $data; - } - - return $this->roles; - } - /** *

The Customer to be part of the Business Unit.

* @@ -123,14 +95,6 @@ public function setAssociateRoleAssignments(?AssociateRoleAssignmentDraftCollect $this->associateRoleAssignments = $associateRoleAssignments; } - /** - * @param ?array $roles - */ - public function setRoles(?array $roles): void - { - $this->roles = $roles; - } - /** * @param ?CustomerResourceIdentifier $customer */ diff --git a/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php b/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php index c28f9abb33c..6c82c59cdbc 100644 --- a/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php +++ b/lib/commercetools-api/src/Models/BusinessUnit/AssociateModel.php @@ -27,12 +27,6 @@ final class AssociateModel extends JsonObjectModel implements Associate */ protected $associateRoleAssignments; - /** - * - * @var ?array - */ - protected $roles; - /** * * @var ?CustomerReference @@ -45,11 +39,9 @@ final class AssociateModel extends JsonObjectModel implements Associate */ public function __construct( ?AssociateRoleAssignmentCollection $associateRoleAssignments = null, - ?array $roles = null, ?CustomerReference $customer = null ) { $this->associateRoleAssignments = $associateRoleAssignments; - $this->roles = $roles; $this->customer = $customer; } @@ -73,26 +65,6 @@ public function getAssociateRoleAssignments() return $this->associateRoleAssignments; } - /** - *

Deprecated type. Use associateRoleAssignment instead.

- * - * - * @return null|array - */ - public function getRoles() - { - if (is_null($this->roles)) { - /** @psalm-var ?list $data */ - $data = $this->raw(self::FIELD_ROLES); - if (is_null($data)) { - return null; - } - $this->roles = $data; - } - - return $this->roles; - } - /** *

The Customer that acts as an Associate in the Business Unit.

* @@ -123,14 +95,6 @@ public function setAssociateRoleAssignments(?AssociateRoleAssignmentCollection $ $this->associateRoleAssignments = $associateRoleAssignments; } - /** - * @param ?array $roles - */ - public function setRoles(?array $roles): void - { - $this->roles = $roles; - } - /** * @param ?CustomerReference $customer */ diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraft.php b/lib/commercetools-api/src/Models/Cart/LineItemDraft.php index 240894fe142..79a6a8563be 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraft.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraft.php @@ -28,6 +28,7 @@ interface LineItemDraft extends JsonObject public const FIELD_EXTERNAL_PRICE = 'externalPrice'; public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; public const FIELD_EXTERNAL_TAX_RATE = 'externalTaxRate'; + public const FIELD_PER_METHOD_EXTERNAL_TAX_RATE = 'perMethodExternalTaxRate'; public const FIELD_INVENTORY_MODE = 'inventoryMode'; public const FIELD_SHIPPING_DETAILS = 'shippingDetails'; public const FIELD_CUSTOM = 'custom'; @@ -120,13 +121,21 @@ public function getExternalPrice(); public function getExternalTotalPrice(); /** - *

External Tax Rate for the Line Item if the Cart has the External TaxMode.

+ *

Sets the external Tax Rate for the Line Item, if the Cart has the External TaxMode.

* * @return null|ExternalTaxRateDraft */ public function getExternalTaxRate(); + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ * + + * @return null|MethodExternalTaxRateDraftCollection + */ + public function getPerMethodExternalTaxRate(); + /** *

Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

@@ -207,6 +216,11 @@ public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotal */ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void; + /** + * @param ?MethodExternalTaxRateDraftCollection $perMethodExternalTaxRate + */ + public function setPerMethodExternalTaxRate(?MethodExternalTaxRateDraftCollection $perMethodExternalTaxRate): void; + /** * @param ?string $inventoryMode */ diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php index e14269376dd..374e67a01f9 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraftBuilder.php @@ -93,6 +93,12 @@ final class LineItemDraftBuilder implements Builder */ private $externalTaxRate; + /** + + * @var ?MethodExternalTaxRateDraftCollection + */ + private $perMethodExternalTaxRate; + /** * @var ?string @@ -229,7 +235,7 @@ public function getExternalTotalPrice() } /** - *

External Tax Rate for the Line Item if the Cart has the External TaxMode.

+ *

Sets the external Tax Rate for the Line Item, if the Cart has the External TaxMode.

* * @return null|ExternalTaxRateDraft @@ -239,6 +245,17 @@ public function getExternalTaxRate() return $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate; } + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ * + + * @return null|MethodExternalTaxRateDraftCollection + */ + public function getPerMethodExternalTaxRate() + { + return $this->perMethodExternalTaxRate; + } + /** *

Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

@@ -394,6 +411,17 @@ public function withExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate) return $this; } + /** + * @param ?MethodExternalTaxRateDraftCollection $perMethodExternalTaxRate + * @return $this + */ + public function withPerMethodExternalTaxRate(?MethodExternalTaxRateDraftCollection $perMethodExternalTaxRate) + { + $this->perMethodExternalTaxRate = $perMethodExternalTaxRate; + + return $this; + } + /** * @param ?string $inventoryMode * @return $this @@ -518,6 +546,7 @@ public function build(): LineItemDraft $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice, $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice, $this->externalTaxRate instanceof ExternalTaxRateDraftBuilder ? $this->externalTaxRate->build() : $this->externalTaxRate, + $this->perMethodExternalTaxRate, $this->inventoryMode, $this->shippingDetails instanceof ItemShippingDetailsDraftBuilder ? $this->shippingDetails->build() : $this->shippingDetails, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom diff --git a/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php b/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php index 3d9a32a281b..5dde946745f 100644 --- a/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/Cart/LineItemDraftModel.php @@ -92,6 +92,12 @@ final class LineItemDraftModel extends JsonObjectModel implements LineItemDraft */ protected $externalTaxRate; + /** + * + * @var ?MethodExternalTaxRateDraftCollection + */ + protected $perMethodExternalTaxRate; + /** * * @var ?string @@ -126,6 +132,7 @@ public function __construct( ?Money $externalPrice = null, ?ExternalLineItemTotalPrice $externalTotalPrice = null, ?ExternalTaxRateDraft $externalTaxRate = null, + ?MethodExternalTaxRateDraftCollection $perMethodExternalTaxRate = null, ?string $inventoryMode = null, ?ItemShippingDetailsDraft $shippingDetails = null, ?CustomFieldsDraft $custom = null @@ -141,6 +148,7 @@ public function __construct( $this->externalPrice = $externalPrice; $this->externalTotalPrice = $externalTotalPrice; $this->externalTaxRate = $externalTaxRate; + $this->perMethodExternalTaxRate = $perMethodExternalTaxRate; $this->inventoryMode = $inventoryMode; $this->shippingDetails = $shippingDetails; $this->custom = $custom; @@ -362,7 +370,7 @@ public function getExternalTotalPrice() } /** - *

External Tax Rate for the Line Item if the Cart has the External TaxMode.

+ *

Sets the external Tax Rate for the Line Item, if the Cart has the External TaxMode.

* * * @return null|ExternalTaxRateDraft @@ -382,6 +390,26 @@ public function getExternalTaxRate() return $this->externalTaxRate; } + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ * + * + * @return null|MethodExternalTaxRateDraftCollection + */ + public function getPerMethodExternalTaxRate() + { + if (is_null($this->perMethodExternalTaxRate)) { + /** @psalm-var ?list $data */ + $data = $this->raw(self::FIELD_PER_METHOD_EXTERNAL_TAX_RATE); + if (is_null($data)) { + return null; + } + $this->perMethodExternalTaxRate = MethodExternalTaxRateDraftCollection::fromArray($data); + } + + return $this->perMethodExternalTaxRate; + } + /** *

Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. * Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

@@ -534,6 +562,14 @@ public function setExternalTaxRate(?ExternalTaxRateDraft $externalTaxRate): void $this->externalTaxRate = $externalTaxRate; } + /** + * @param ?MethodExternalTaxRateDraftCollection $perMethodExternalTaxRate + */ + public function setPerMethodExternalTaxRate(?MethodExternalTaxRateDraftCollection $perMethodExternalTaxRate): void + { + $this->perMethodExternalTaxRate = $perMethodExternalTaxRate; + } + /** * @param ?string $inventoryMode */ diff --git a/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraft.php b/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraft.php new file mode 100644 index 00000000000..c43c1a0ec1b --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraft.php @@ -0,0 +1,44 @@ +User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingMethodKey(); + + /** + *

External Tax Rate for the Shipping Method, if the Cart has External TaxMode.

+ * + + * @return null|ExternalTaxRateDraft + */ + public function getTaxRate(); + + /** + * @param ?string $shippingMethodKey + */ + public function setShippingMethodKey(?string $shippingMethodKey): void; + + /** + * @param ?ExternalTaxRateDraft $taxRate + */ + public function setTaxRate(?ExternalTaxRateDraft $taxRate): void; +} diff --git a/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftBuilder.php b/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftBuilder.php new file mode 100644 index 00000000000..9ecc1ce1b27 --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftBuilder.php @@ -0,0 +1,102 @@ + + */ +final class MethodExternalTaxRateDraftBuilder implements Builder +{ + /** + + * @var ?string + */ + private $shippingMethodKey; + + /** + + * @var null|ExternalTaxRateDraft|ExternalTaxRateDraftBuilder + */ + private $taxRate; + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + + * @return null|string + */ + public function getShippingMethodKey() + { + return $this->shippingMethodKey; + } + + /** + *

External Tax Rate for the Shipping Method, if the Cart has External TaxMode.

+ * + + * @return null|ExternalTaxRateDraft + */ + public function getTaxRate() + { + return $this->taxRate instanceof ExternalTaxRateDraftBuilder ? $this->taxRate->build() : $this->taxRate; + } + + /** + * @param ?string $shippingMethodKey + * @return $this + */ + public function withShippingMethodKey(?string $shippingMethodKey) + { + $this->shippingMethodKey = $shippingMethodKey; + + return $this; + } + + /** + * @param ?ExternalTaxRateDraft $taxRate + * @return $this + */ + public function withTaxRate(?ExternalTaxRateDraft $taxRate) + { + $this->taxRate = $taxRate; + + return $this; + } + + /** + * @deprecated use withTaxRate() instead + * @return $this + */ + public function withTaxRateBuilder(?ExternalTaxRateDraftBuilder $taxRate) + { + $this->taxRate = $taxRate; + + return $this; + } + + public function build(): MethodExternalTaxRateDraft + { + return new MethodExternalTaxRateDraftModel( + $this->shippingMethodKey, + $this->taxRate instanceof ExternalTaxRateDraftBuilder ? $this->taxRate->build() : $this->taxRate + ); + } + + public static function of(): MethodExternalTaxRateDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftCollection.php b/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftCollection.php new file mode 100644 index 00000000000..eb6258e195c --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftCollection.php @@ -0,0 +1,56 @@ + + * @method MethodExternalTaxRateDraft current() + * @method MethodExternalTaxRateDraft end() + * @method MethodExternalTaxRateDraft at($offset) + */ +class MethodExternalTaxRateDraftCollection extends MapperSequence +{ + /** + * @psalm-assert MethodExternalTaxRateDraft $value + * @psalm-param MethodExternalTaxRateDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return MethodExternalTaxRateDraftCollection + */ + public function add($value) + { + if (!$value instanceof MethodExternalTaxRateDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?MethodExternalTaxRateDraft + */ + protected function mapper() + { + return function (?int $index): ?MethodExternalTaxRateDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var MethodExternalTaxRateDraft $data */ + $data = MethodExternalTaxRateDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftModel.php b/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftModel.php new file mode 100644 index 00000000000..6447b15646e --- /dev/null +++ b/lib/commercetools-api/src/Models/Cart/MethodExternalTaxRateDraftModel.php @@ -0,0 +1,103 @@ +shippingMethodKey = $shippingMethodKey; + $this->taxRate = $taxRate; + } + + /** + *

User-defined unique identifier of the Shipping Method in a Cart with Multiple ShippingMode.

+ * + * + * @return null|string + */ + public function getShippingMethodKey() + { + if (is_null($this->shippingMethodKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_SHIPPING_METHOD_KEY); + if (is_null($data)) { + return null; + } + $this->shippingMethodKey = (string) $data; + } + + return $this->shippingMethodKey; + } + + /** + *

External Tax Rate for the Shipping Method, if the Cart has External TaxMode.

+ * + * + * @return null|ExternalTaxRateDraft + */ + public function getTaxRate() + { + if (is_null($this->taxRate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_TAX_RATE); + if (is_null($data)) { + return null; + } + + $this->taxRate = ExternalTaxRateDraftModel::of($data); + } + + return $this->taxRate; + } + + + /** + * @param ?string $shippingMethodKey + */ + public function setShippingMethodKey(?string $shippingMethodKey): void + { + $this->shippingMethodKey = $shippingMethodKey; + } + + /** + * @param ?ExternalTaxRateDraft $taxRate + */ + public function setTaxRate(?ExternalTaxRateDraft $taxRate): void + { + $this->taxRate = $taxRate; + } +} diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php index db3be4fa2f5..64ba37df3c0 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraft.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\CartDiscount; -use Commercetools\Api\Models\Common\TypedMoneyDraftCollection; +use Commercetools\Api\Models\Common\MoneyCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -21,12 +21,12 @@ interface CartDiscountValueFixedDraft extends CartDiscountValueDraft * A fixed Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.

* - * @return null|TypedMoneyDraftCollection + * @return null|MoneyCollection */ public function getMoney(); /** - * @param ?TypedMoneyDraftCollection $money + * @param ?MoneyCollection $money */ - public function setMoney(?TypedMoneyDraftCollection $money): void; + public function setMoney(?MoneyCollection $money): void; } diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php index 75fe07203f8..8cb65ab52b8 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftBuilder.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\CartDiscount; -use Commercetools\Api\Models\Common\TypedMoneyDraftCollection; +use Commercetools\Api\Models\Common\MoneyCollection; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -23,7 +23,7 @@ final class CartDiscountValueFixedDraftBuilder implements Builder { /** - * @var ?TypedMoneyDraftCollection + * @var ?MoneyCollection */ private $money; @@ -32,7 +32,7 @@ final class CartDiscountValueFixedDraftBuilder implements Builder * A fixed Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.

* - * @return null|TypedMoneyDraftCollection + * @return null|MoneyCollection */ public function getMoney() { @@ -40,10 +40,10 @@ public function getMoney() } /** - * @param ?TypedMoneyDraftCollection $money + * @param ?MoneyCollection $money * @return $this */ - public function withMoney(?TypedMoneyDraftCollection $money) + public function withMoney(?MoneyCollection $money) { $this->money = $money; diff --git a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php index fa5f11f2af1..f65faf6f5d4 100644 --- a/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php +++ b/lib/commercetools-api/src/Models/CartDiscount/CartDiscountValueFixedDraftModel.php @@ -8,7 +8,7 @@ namespace Commercetools\Api\Models\CartDiscount; -use Commercetools\Api\Models\Common\TypedMoneyDraftCollection; +use Commercetools\Api\Models\Common\MoneyCollection; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; use Commercetools\Base\JsonObjectModel; @@ -29,7 +29,7 @@ final class CartDiscountValueFixedDraftModel extends JsonObjectModel implements /** * - * @var ?TypedMoneyDraftCollection + * @var ?MoneyCollection */ protected $money; @@ -38,7 +38,7 @@ final class CartDiscountValueFixedDraftModel extends JsonObjectModel implements * @psalm-suppress MissingParamType */ public function __construct( - ?TypedMoneyDraftCollection $money = null, + ?MoneyCollection $money = null, ?string $type = null ) { $this->money = $money; @@ -68,7 +68,7 @@ public function getType() * A fixed Cart Discount will only match a price if this array contains a value with the same currency. If it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$.

* * - * @return null|TypedMoneyDraftCollection + * @return null|MoneyCollection */ public function getMoney() { @@ -78,7 +78,7 @@ public function getMoney() if (is_null($data)) { return null; } - $this->money = TypedMoneyDraftCollection::fromArray($data); + $this->money = MoneyCollection::fromArray($data); } return $this->money; @@ -86,9 +86,9 @@ public function getMoney() /** - * @param ?TypedMoneyDraftCollection $money + * @param ?MoneyCollection $money */ - public function setMoney(?TypedMoneyDraftCollection $money): void + public function setMoney(?MoneyCollection $money): void { $this->money = $money; } diff --git a/lib/commercetools-api/src/Models/Common/Asset.php b/lib/commercetools-api/src/Models/Common/Asset.php index 92780cbfc06..bd251f4c191 100644 --- a/lib/commercetools-api/src/Models/Common/Asset.php +++ b/lib/commercetools-api/src/Models/Common/Asset.php @@ -69,7 +69,7 @@ public function getTags(); public function getCustom(); /** - *

User-defined unique identifier of the Asset.

+ *

User-defined identifier of the Asset. It is unique per Category or ProductVariant.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AssetBuilder.php b/lib/commercetools-api/src/Models/Common/AssetBuilder.php index ed57074d5c5..9b152b3f96d 100644 --- a/lib/commercetools-api/src/Models/Common/AssetBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AssetBuilder.php @@ -129,7 +129,7 @@ public function getCustom() } /** - *

User-defined unique identifier of the Asset.

+ *

User-defined identifier of the Asset. It is unique per Category or ProductVariant.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AssetDraft.php b/lib/commercetools-api/src/Models/Common/AssetDraft.php index e9cbdc9cbb2..b929aad9c75 100644 --- a/lib/commercetools-api/src/Models/Common/AssetDraft.php +++ b/lib/commercetools-api/src/Models/Common/AssetDraft.php @@ -60,7 +60,7 @@ public function getTags(); public function getCustom(); /** - *

User-defined unique identifier for the Asset.

+ *

User-defined identifier for the Asset. Must be unique per Category or ProductVariant.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AssetDraftBuilder.php b/lib/commercetools-api/src/Models/Common/AssetDraftBuilder.php index 4c8d8799ae9..ea986b68b14 100644 --- a/lib/commercetools-api/src/Models/Common/AssetDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AssetDraftBuilder.php @@ -112,7 +112,7 @@ public function getCustom() } /** - *

User-defined unique identifier for the Asset.

+ *

User-defined identifier for the Asset. Must be unique per Category or ProductVariant.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AssetDraftModel.php b/lib/commercetools-api/src/Models/Common/AssetDraftModel.php index e61e9242b45..19dce9165c3 100644 --- a/lib/commercetools-api/src/Models/Common/AssetDraftModel.php +++ b/lib/commercetools-api/src/Models/Common/AssetDraftModel.php @@ -179,7 +179,7 @@ public function getCustom() } /** - *

User-defined unique identifier for the Asset.

+ *

User-defined identifier for the Asset. Must be unique per Category or ProductVariant.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AssetModel.php b/lib/commercetools-api/src/Models/Common/AssetModel.php index 0b4e8d9ee28..f4e55b68a49 100644 --- a/lib/commercetools-api/src/Models/Common/AssetModel.php +++ b/lib/commercetools-api/src/Models/Common/AssetModel.php @@ -207,7 +207,7 @@ public function getCustom() } /** - *

User-defined unique identifier of the Asset.

+ *

User-defined identifier of the Asset. It is unique per Category or ProductVariant.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AssetSource.php b/lib/commercetools-api/src/Models/Common/AssetSource.php index e438482cdb6..ec593b78583 100644 --- a/lib/commercetools-api/src/Models/Common/AssetSource.php +++ b/lib/commercetools-api/src/Models/Common/AssetSource.php @@ -27,7 +27,7 @@ interface AssetSource extends JsonObject public function getUri(); /** - *

User-defined unique identifier of the AssetSource.

+ *

User-defined identifier of the AssetSource. Must be unique per Asset.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AssetSourceBuilder.php b/lib/commercetools-api/src/Models/Common/AssetSourceBuilder.php index e7ec770137c..5dc9458d3cc 100644 --- a/lib/commercetools-api/src/Models/Common/AssetSourceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/AssetSourceBuilder.php @@ -56,7 +56,7 @@ public function getUri() } /** - *

User-defined unique identifier of the AssetSource.

+ *

User-defined identifier of the AssetSource. Must be unique per Asset.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/AssetSourceModel.php b/lib/commercetools-api/src/Models/Common/AssetSourceModel.php index 3349e2961a6..37e90c7e08f 100644 --- a/lib/commercetools-api/src/Models/Common/AssetSourceModel.php +++ b/lib/commercetools-api/src/Models/Common/AssetSourceModel.php @@ -80,7 +80,7 @@ public function getUri() } /** - *

User-defined unique identifier of the AssetSource.

+ *

User-defined identifier of the AssetSource. Must be unique per Asset.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Common/BaseResource.php b/lib/commercetools-api/src/Models/Common/BaseResource.php index 884a6d7db35..07ac3845fce 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResource.php +++ b/lib/commercetools-api/src/Models/Common/BaseResource.php @@ -58,9 +58,19 @@ use Commercetools\Api\Models\Message\CategorySlugChangedMessage; use Commercetools\Api\Models\Message\CustomerAddressAddedMessage; use Commercetools\Api\Models\Message\CustomerAddressChangedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldAddedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldChangedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldRemovedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomTypeRemovedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomTypeSetMessage; use Commercetools\Api\Models\Message\CustomerAddressRemovedMessage; use Commercetools\Api\Models\Message\CustomerCompanyNameSetMessage; use Commercetools\Api\Models\Message\CustomerCreatedMessage; +use Commercetools\Api\Models\Message\CustomerCustomFieldAddedMessage; +use Commercetools\Api\Models\Message\CustomerCustomFieldChangedMessage; +use Commercetools\Api\Models\Message\CustomerCustomFieldRemovedMessage; +use Commercetools\Api\Models\Message\CustomerCustomTypeRemovedMessage; +use Commercetools\Api\Models\Message\CustomerCustomTypeSetMessage; use Commercetools\Api\Models\Message\CustomerDateOfBirthSetMessage; use Commercetools\Api\Models\Message\CustomerDeletedMessage; use Commercetools\Api\Models\Message\CustomerEmailChangedMessage; @@ -112,6 +122,7 @@ use Commercetools\Api\Models\Message\QuoteCreatedMessage; use Commercetools\Api\Models\Message\QuoteCustomerChangedMessage; use Commercetools\Api\Models\Message\QuoteDeletedMessage; +use Commercetools\Api\Models\Message\QuoteRenegotiationRequestedMessage; use Commercetools\Api\Models\Message\QuoteRequestCreatedMessage; use Commercetools\Api\Models\Message\QuoteRequestCustomerChangedMessage; use Commercetools\Api\Models\Message\QuoteRequestDeletedMessage; @@ -135,6 +146,7 @@ use Commercetools\Api\Models\Message\StandalonePriceExternalDiscountSetMessage; use Commercetools\Api\Models\Message\StandalonePriceKeySetMessage; use Commercetools\Api\Models\Message\StandalonePriceStagedChangesAppliedMessage; +use Commercetools\Api\Models\Message\StandalonePriceStagedChangesRemovedMessage; use Commercetools\Api\Models\Message\StandalonePriceTierAddedMessage; use Commercetools\Api\Models\Message\StandalonePriceTierRemovedMessage; use Commercetools\Api\Models\Message\StandalonePriceTiersSetMessage; diff --git a/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php b/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php index 674652a3149..ac8de93d205 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php +++ b/lib/commercetools-api/src/Models/Common/BaseResourceBuilder.php @@ -108,12 +108,32 @@ use Commercetools\Api\Models\Message\CustomerAddressAddedMessageBuilder; use Commercetools\Api\Models\Message\CustomerAddressChangedMessage; use Commercetools\Api\Models\Message\CustomerAddressChangedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldAddedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldAddedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldChangedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldChangedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldRemovedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldRemovedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerAddressCustomTypeRemovedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomTypeRemovedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerAddressCustomTypeSetMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomTypeSetMessageBuilder; use Commercetools\Api\Models\Message\CustomerAddressRemovedMessage; use Commercetools\Api\Models\Message\CustomerAddressRemovedMessageBuilder; use Commercetools\Api\Models\Message\CustomerCompanyNameSetMessage; use Commercetools\Api\Models\Message\CustomerCompanyNameSetMessageBuilder; use Commercetools\Api\Models\Message\CustomerCreatedMessage; use Commercetools\Api\Models\Message\CustomerCreatedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerCustomFieldAddedMessage; +use Commercetools\Api\Models\Message\CustomerCustomFieldAddedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerCustomFieldChangedMessage; +use Commercetools\Api\Models\Message\CustomerCustomFieldChangedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerCustomFieldRemovedMessage; +use Commercetools\Api\Models\Message\CustomerCustomFieldRemovedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerCustomTypeRemovedMessage; +use Commercetools\Api\Models\Message\CustomerCustomTypeRemovedMessageBuilder; +use Commercetools\Api\Models\Message\CustomerCustomTypeSetMessage; +use Commercetools\Api\Models\Message\CustomerCustomTypeSetMessageBuilder; use Commercetools\Api\Models\Message\CustomerDateOfBirthSetMessage; use Commercetools\Api\Models\Message\CustomerDateOfBirthSetMessageBuilder; use Commercetools\Api\Models\Message\CustomerDeletedMessage; @@ -216,6 +236,8 @@ use Commercetools\Api\Models\Message\QuoteCustomerChangedMessageBuilder; use Commercetools\Api\Models\Message\QuoteDeletedMessage; use Commercetools\Api\Models\Message\QuoteDeletedMessageBuilder; +use Commercetools\Api\Models\Message\QuoteRenegotiationRequestedMessage; +use Commercetools\Api\Models\Message\QuoteRenegotiationRequestedMessageBuilder; use Commercetools\Api\Models\Message\QuoteRequestCreatedMessage; use Commercetools\Api\Models\Message\QuoteRequestCreatedMessageBuilder; use Commercetools\Api\Models\Message\QuoteRequestCustomerChangedMessage; @@ -262,6 +284,8 @@ use Commercetools\Api\Models\Message\StandalonePriceKeySetMessageBuilder; use Commercetools\Api\Models\Message\StandalonePriceStagedChangesAppliedMessage; use Commercetools\Api\Models\Message\StandalonePriceStagedChangesAppliedMessageBuilder; +use Commercetools\Api\Models\Message\StandalonePriceStagedChangesRemovedMessage; +use Commercetools\Api\Models\Message\StandalonePriceStagedChangesRemovedMessageBuilder; use Commercetools\Api\Models\Message\StandalonePriceTierAddedMessage; use Commercetools\Api\Models\Message\StandalonePriceTierAddedMessageBuilder; use Commercetools\Api\Models\Message\StandalonePriceTierRemovedMessage; diff --git a/lib/commercetools-api/src/Models/Common/BaseResourceModel.php b/lib/commercetools-api/src/Models/Common/BaseResourceModel.php index 97588a2251a..eb70b5b5d14 100644 --- a/lib/commercetools-api/src/Models/Common/BaseResourceModel.php +++ b/lib/commercetools-api/src/Models/Common/BaseResourceModel.php @@ -108,12 +108,32 @@ use Commercetools\Api\Models\Message\CustomerAddressAddedMessageModel; use Commercetools\Api\Models\Message\CustomerAddressChangedMessage; use Commercetools\Api\Models\Message\CustomerAddressChangedMessageModel; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldAddedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldAddedMessageModel; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldChangedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldChangedMessageModel; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldRemovedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomFieldRemovedMessageModel; +use Commercetools\Api\Models\Message\CustomerAddressCustomTypeRemovedMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomTypeRemovedMessageModel; +use Commercetools\Api\Models\Message\CustomerAddressCustomTypeSetMessage; +use Commercetools\Api\Models\Message\CustomerAddressCustomTypeSetMessageModel; use Commercetools\Api\Models\Message\CustomerAddressRemovedMessage; use Commercetools\Api\Models\Message\CustomerAddressRemovedMessageModel; use Commercetools\Api\Models\Message\CustomerCompanyNameSetMessage; use Commercetools\Api\Models\Message\CustomerCompanyNameSetMessageModel; use Commercetools\Api\Models\Message\CustomerCreatedMessage; use Commercetools\Api\Models\Message\CustomerCreatedMessageModel; +use Commercetools\Api\Models\Message\CustomerCustomFieldAddedMessage; +use Commercetools\Api\Models\Message\CustomerCustomFieldAddedMessageModel; +use Commercetools\Api\Models\Message\CustomerCustomFieldChangedMessage; +use Commercetools\Api\Models\Message\CustomerCustomFieldChangedMessageModel; +use Commercetools\Api\Models\Message\CustomerCustomFieldRemovedMessage; +use Commercetools\Api\Models\Message\CustomerCustomFieldRemovedMessageModel; +use Commercetools\Api\Models\Message\CustomerCustomTypeRemovedMessage; +use Commercetools\Api\Models\Message\CustomerCustomTypeRemovedMessageModel; +use Commercetools\Api\Models\Message\CustomerCustomTypeSetMessage; +use Commercetools\Api\Models\Message\CustomerCustomTypeSetMessageModel; use Commercetools\Api\Models\Message\CustomerDateOfBirthSetMessage; use Commercetools\Api\Models\Message\CustomerDateOfBirthSetMessageModel; use Commercetools\Api\Models\Message\CustomerDeletedMessage; @@ -216,6 +236,8 @@ use Commercetools\Api\Models\Message\QuoteCustomerChangedMessageModel; use Commercetools\Api\Models\Message\QuoteDeletedMessage; use Commercetools\Api\Models\Message\QuoteDeletedMessageModel; +use Commercetools\Api\Models\Message\QuoteRenegotiationRequestedMessage; +use Commercetools\Api\Models\Message\QuoteRenegotiationRequestedMessageModel; use Commercetools\Api\Models\Message\QuoteRequestCreatedMessage; use Commercetools\Api\Models\Message\QuoteRequestCreatedMessageModel; use Commercetools\Api\Models\Message\QuoteRequestCustomerChangedMessage; @@ -262,6 +284,8 @@ use Commercetools\Api\Models\Message\StandalonePriceKeySetMessageModel; use Commercetools\Api\Models\Message\StandalonePriceStagedChangesAppliedMessage; use Commercetools\Api\Models\Message\StandalonePriceStagedChangesAppliedMessageModel; +use Commercetools\Api\Models\Message\StandalonePriceStagedChangesRemovedMessage; +use Commercetools\Api\Models\Message\StandalonePriceStagedChangesRemovedMessageModel; use Commercetools\Api\Models\Message\StandalonePriceTierAddedMessage; use Commercetools\Api\Models\Message\StandalonePriceTierAddedMessageModel; use Commercetools\Api\Models\Message\StandalonePriceTierRemovedMessage; diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php index 86c52ea89d7..0c79f64d0b8 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityAction.php @@ -18,8 +18,6 @@ interface MyCartChangeLineItemQuantityAction extends MyCartUpdateAction public const FIELD_LINE_ITEM_ID = 'lineItemId'; public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_QUANTITY = 'quantity'; - public const FIELD_EXTERNAL_PRICE = 'externalPrice'; - public const FIELD_EXTERNAL_TOTAL_PRICE = 'externalTotalPrice'; /** *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

@@ -46,22 +44,6 @@ public function getLineItemKey(); */ public function getQuantity(); - /** - *

Deprecated. Will be ignored.

- * - - * @return null|Money - */ - public function getExternalPrice(); - - /** - *

Deprecated. Will be ignored.

- * - - * @return null|ExternalLineItemTotalPrice - */ - public function getExternalTotalPrice(); - /** * @param ?string $lineItemId */ @@ -76,14 +58,4 @@ public function setLineItemKey(?string $lineItemKey): void; * @param ?int $quantity */ public function setQuantity(?int $quantity): void; - - /** - * @param ?Money $externalPrice - */ - public function setExternalPrice(?Money $externalPrice): void; - - /** - * @param ?ExternalLineItemTotalPrice $externalTotalPrice - */ - public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice): void; } diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php index 488c3e71850..48e5591294c 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionBuilder.php @@ -9,9 +9,7 @@ namespace Commercetools\Api\Models\Me; use Commercetools\Api\Models\Cart\ExternalLineItemTotalPrice; -use Commercetools\Api\Models\Cart\ExternalLineItemTotalPriceBuilder; use Commercetools\Api\Models\Common\Money; -use Commercetools\Api\Models\Common\MoneyBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -42,18 +40,6 @@ final class MyCartChangeLineItemQuantityActionBuilder implements Builder */ private $quantity; - /** - - * @var null|Money|MoneyBuilder - */ - private $externalPrice; - - /** - - * @var null|ExternalLineItemTotalPrice|ExternalLineItemTotalPriceBuilder - */ - private $externalTotalPrice; - /** *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

* @@ -88,28 +74,6 @@ public function getQuantity() return $this->quantity; } - /** - *

Deprecated. Will be ignored.

- * - - * @return null|Money - */ - public function getExternalPrice() - { - return $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice; - } - - /** - *

Deprecated. Will be ignored.

- * - - * @return null|ExternalLineItemTotalPrice - */ - public function getExternalTotalPrice() - { - return $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice; - } - /** * @param ?string $lineItemId * @return $this @@ -143,58 +107,13 @@ public function withQuantity(?int $quantity) return $this; } - /** - * @param ?Money $externalPrice - * @return $this - */ - public function withExternalPrice(?Money $externalPrice) - { - $this->externalPrice = $externalPrice; - - return $this; - } - - /** - * @param ?ExternalLineItemTotalPrice $externalTotalPrice - * @return $this - */ - public function withExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice) - { - $this->externalTotalPrice = $externalTotalPrice; - - return $this; - } - - /** - * @deprecated use withExternalPrice() instead - * @return $this - */ - public function withExternalPriceBuilder(?MoneyBuilder $externalPrice) - { - $this->externalPrice = $externalPrice; - - return $this; - } - - /** - * @deprecated use withExternalTotalPrice() instead - * @return $this - */ - public function withExternalTotalPriceBuilder(?ExternalLineItemTotalPriceBuilder $externalTotalPrice) - { - $this->externalTotalPrice = $externalTotalPrice; - - return $this; - } public function build(): MyCartChangeLineItemQuantityAction { return new MyCartChangeLineItemQuantityActionModel( $this->lineItemId, $this->lineItemKey, - $this->quantity, - $this->externalPrice instanceof MoneyBuilder ? $this->externalPrice->build() : $this->externalPrice, - $this->externalTotalPrice instanceof ExternalLineItemTotalPriceBuilder ? $this->externalTotalPrice->build() : $this->externalTotalPrice + $this->quantity ); } diff --git a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php index 551a010c8d5..4f118776cf4 100644 --- a/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyCartChangeLineItemQuantityActionModel.php @@ -48,18 +48,6 @@ final class MyCartChangeLineItemQuantityActionModel extends JsonObjectModel impl */ protected $quantity; - /** - * - * @var ?Money - */ - protected $externalPrice; - - /** - * - * @var ?ExternalLineItemTotalPrice - */ - protected $externalTotalPrice; - /** * @psalm-suppress MissingParamType @@ -68,15 +56,11 @@ public function __construct( ?string $lineItemId = null, ?string $lineItemKey = null, ?int $quantity = null, - ?Money $externalPrice = null, - ?ExternalLineItemTotalPrice $externalTotalPrice = null, ?string $action = null ) { $this->lineItemId = $lineItemId; $this->lineItemKey = $lineItemKey; $this->quantity = $quantity; - $this->externalPrice = $externalPrice; - $this->externalTotalPrice = $externalTotalPrice; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -159,48 +143,6 @@ public function getQuantity() return $this->quantity; } - /** - *

Deprecated. Will be ignored.

- * - * - * @return null|Money - */ - public function getExternalPrice() - { - if (is_null($this->externalPrice)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_PRICE); - if (is_null($data)) { - return null; - } - - $this->externalPrice = MoneyModel::of($data); - } - - return $this->externalPrice; - } - - /** - *

Deprecated. Will be ignored.

- * - * - * @return null|ExternalLineItemTotalPrice - */ - public function getExternalTotalPrice() - { - if (is_null($this->externalTotalPrice)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_EXTERNAL_TOTAL_PRICE); - if (is_null($data)) { - return null; - } - - $this->externalTotalPrice = ExternalLineItemTotalPriceModel::of($data); - } - - return $this->externalTotalPrice; - } - /** * @param ?string $lineItemId @@ -225,20 +167,4 @@ public function setQuantity(?int $quantity): void { $this->quantity = $quantity; } - - /** - * @param ?Money $externalPrice - */ - public function setExternalPrice(?Money $externalPrice): void - { - $this->externalPrice = $externalPrice; - } - - /** - * @param ?ExternalLineItemTotalPrice $externalTotalPrice - */ - public function setExternalTotalPrice(?ExternalLineItemTotalPrice $externalTotalPrice): void - { - $this->externalTotalPrice = $externalTotalPrice; - } } diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemAction.php index e55c486b721..2339b8ac785 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemAction.php @@ -15,6 +15,7 @@ interface MyShoppingListAddLineItemAction extends MyShoppingListUpdateAction { + public const FIELD_KEY = 'key'; public const FIELD_SKU = 'sku'; public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_VARIANT_ID = 'variantId'; @@ -22,6 +23,14 @@ interface MyShoppingListAddLineItemAction extends MyShoppingListUpdateAction public const FIELD_ADDED_AT = 'addedAt'; public const FIELD_CUSTOM = 'custom'; + /** + *

User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey(); + /** *

sku of the ProductVariant.

* @@ -70,6 +79,11 @@ public function getAddedAt(); */ public function getCustom(); + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?string $sku */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionBuilder.php index 24361069dd4..4fc4a529923 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionBuilder.php @@ -23,6 +23,12 @@ */ final class MyShoppingListAddLineItemActionBuilder implements Builder { + /** + + * @var ?string + */ + private $key; + /** * @var ?string @@ -59,6 +65,17 @@ final class MyShoppingListAddLineItemActionBuilder implements Builder */ private $custom; + /** + *

User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

sku of the ProductVariant.

* @@ -125,6 +142,17 @@ public function getCustom() return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?string $sku * @return $this @@ -205,6 +233,7 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) public function build(): MyShoppingListAddLineItemAction { return new MyShoppingListAddLineItemActionModel( + $this->key, $this->sku, $this->productId, $this->variantId, diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionModel.php index 82bfe5f6880..154ac7905d1 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddLineItemActionModel.php @@ -29,6 +29,12 @@ final class MyShoppingListAddLineItemActionModel extends JsonObjectModel impleme */ protected $action; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?string @@ -70,6 +76,7 @@ final class MyShoppingListAddLineItemActionModel extends JsonObjectModel impleme * @psalm-suppress MissingParamType */ public function __construct( + ?string $key = null, ?string $sku = null, ?string $productId = null, ?int $variantId = null, @@ -78,6 +85,7 @@ public function __construct( ?CustomFieldsDraft $custom = null, ?string $action = null ) { + $this->key = $key; $this->sku = $sku; $this->productId = $productId; $this->variantId = $variantId; @@ -105,6 +113,26 @@ public function getAction() return $this->action; } + /** + *

User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

sku of the ProductVariant.

* @@ -231,6 +259,14 @@ public function getCustom() } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?string $sku */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemAction.php index d9825bce130..768d48f7dbb 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemAction.php @@ -17,6 +17,7 @@ interface MyShoppingListAddTextLineItemAction extends MyShoppingListUpdateAction { public const FIELD_NAME = 'name'; + public const FIELD_KEY = 'key'; public const FIELD_DESCRIPTION = 'description'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_ADDED_AT = 'addedAt'; @@ -30,6 +31,14 @@ interface MyShoppingListAddTextLineItemAction extends MyShoppingListUpdateAction */ public function getName(); + /** + *

User-defined identifier of the TextLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Description of the TextLineItem.

* @@ -67,6 +76,11 @@ public function getCustom(); */ public function setName(?LocalizedString $name): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?LocalizedString $description */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionBuilder.php index 4a9a153efc3..3d53df2f20e 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionBuilder.php @@ -31,6 +31,12 @@ final class MyShoppingListAddTextLineItemActionBuilder implements Builder */ private $name; + /** + + * @var ?string + */ + private $key; + /** * @var null|LocalizedString|LocalizedStringBuilder @@ -66,6 +72,17 @@ public function getName() return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; } + /** + *

User-defined identifier of the TextLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Description of the TextLineItem.

* @@ -121,6 +138,17 @@ public function withName(?LocalizedString $name) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?LocalizedString $description * @return $this @@ -202,6 +230,7 @@ public function build(): MyShoppingListAddTextLineItemAction { return new MyShoppingListAddTextLineItemActionModel( $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, + $this->key, $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description, $this->quantity, $this->addedAt, diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionModel.php index 5a94cfc1c0b..98d7af30d54 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListAddTextLineItemActionModel.php @@ -37,6 +37,12 @@ final class MyShoppingListAddTextLineItemActionModel extends JsonObjectModel imp */ protected $name; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?LocalizedString @@ -67,6 +73,7 @@ final class MyShoppingListAddTextLineItemActionModel extends JsonObjectModel imp */ public function __construct( ?LocalizedString $name = null, + ?string $key = null, ?LocalizedString $description = null, ?int $quantity = null, ?DateTimeImmutable $addedAt = null, @@ -74,6 +81,7 @@ public function __construct( ?string $action = null ) { $this->name = $name; + $this->key = $key; $this->description = $description; $this->quantity = $quantity; $this->addedAt = $addedAt; @@ -120,6 +128,26 @@ public function getName() return $this->name; } + /** + *

User-defined identifier of the TextLineItem. Must be unique per ShoppingList.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Description of the TextLineItem.

* @@ -215,6 +243,14 @@ public function setName(?LocalizedString $name): void $this->name = $name; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?LocalizedString $description */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityAction.php index 6c9a87bd399..023ba06470f 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityAction.php @@ -18,7 +18,7 @@ interface MyShoppingListChangeLineItemQuantityAction extends MyShoppingListUpdat public const FIELD_QUANTITY = 'quantity'; /** - *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

+ *

id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -26,7 +26,7 @@ interface MyShoppingListChangeLineItemQuantityAction extends MyShoppingListUpdat public function getLineItemId(); /** - *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ *

key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionBuilder.php index bf35aa80bfe..032705dd484 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionBuilder.php @@ -39,7 +39,7 @@ final class MyShoppingListChangeLineItemQuantityActionBuilder implements Builder private $quantity; /** - *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

+ *

id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -50,7 +50,7 @@ public function getLineItemId() } /** - *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ *

key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionModel.php index 06f12f4ae82..c3e197fc5b1 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeLineItemQuantityActionModel.php @@ -79,7 +79,7 @@ public function getAction() } /** - *

id of the LineItem to update. Either lineItemId or lineItemKey is required.

+ *

id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -99,7 +99,7 @@ public function getLineItemId() } /** - *

key of the LineItem to update. Either lineItemId or lineItemKey is required.

+ *

key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameAction.php index a2909f46a2d..20bb66a4449 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameAction.php @@ -15,16 +15,25 @@ interface MyShoppingListChangeTextLineItemNameAction extends MyShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_NAME = 'name'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

New value to set. Must not be empty.

* @@ -38,6 +47,11 @@ public function getName(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?LocalizedString $name */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionBuilder.php index 85b7ceefdd5..d6920be6ec2 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionBuilder.php @@ -28,6 +28,12 @@ final class MyShoppingListChangeTextLineItemNameActionBuilder implements Builder */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var null|LocalizedString|LocalizedStringBuilder @@ -35,7 +41,7 @@ final class MyShoppingListChangeTextLineItemNameActionBuilder implements Builder private $name; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -45,6 +51,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

New value to set. Must not be empty.

* @@ -67,6 +84,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?LocalizedString $name * @return $this @@ -93,6 +121,7 @@ public function build(): MyShoppingListChangeTextLineItemNameAction { return new MyShoppingListChangeTextLineItemNameActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name ); } diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionModel.php index 8ef910790b5..8615f6d3f15 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemNameActionModel.php @@ -34,6 +34,12 @@ final class MyShoppingListChangeTextLineItemNameActionModel extends JsonObjectMo */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?LocalizedString @@ -46,10 +52,12 @@ final class MyShoppingListChangeTextLineItemNameActionModel extends JsonObjectMo */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?LocalizedString $name = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->name = $name; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -73,7 +81,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -92,6 +100,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

New value to set. Must not be empty.

* @@ -122,6 +150,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?LocalizedString $name */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityAction.php index a91ed4a2e89..b2669cb63b1 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityAction.php @@ -14,16 +14,25 @@ interface MyShoppingListChangeTextLineItemQuantityAction extends MyShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_QUANTITY = 'quantity'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

New value to set. If 0, the TextLineItem is removed from the ShoppingList.

* @@ -37,6 +46,11 @@ public function getQuantity(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionBuilder.php index b1a4cd1b792..9910ba71020 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionBuilder.php @@ -26,6 +26,12 @@ final class MyShoppingListChangeTextLineItemQuantityActionBuilder implements Bui */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var ?int @@ -33,7 +39,7 @@ final class MyShoppingListChangeTextLineItemQuantityActionBuilder implements Bui private $quantity; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

New value to set. If 0, the TextLineItem is removed from the ShoppingList.

* @@ -65,6 +82,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -81,6 +109,7 @@ public function build(): MyShoppingListChangeTextLineItemQuantityAction { return new MyShoppingListChangeTextLineItemQuantityActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->quantity ); } diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionModel.php index 425b0ff612b..ae738f728f9 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListChangeTextLineItemQuantityActionModel.php @@ -32,6 +32,12 @@ final class MyShoppingListChangeTextLineItemQuantityActionModel extends JsonObje */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?int @@ -44,10 +50,12 @@ final class MyShoppingListChangeTextLineItemQuantityActionModel extends JsonObje */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?int $quantity = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->quantity = $quantity; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

New value to set. If 0, the TextLineItem is removed from the ShoppingList.

* @@ -119,6 +147,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemAction.php index 05f139b3b48..cb2fbea9a9c 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemAction.php @@ -14,16 +14,25 @@ interface MyShoppingListRemoveLineItemAction extends MyShoppingListUpdateAction { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_QUANTITY = 'quantity'; /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getLineItemId(); + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Amount to remove from the quantity of the ShoppingListLineItem. If not set, the ShoppingListLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the ShoppingListLineItem, the ShoppingListLineItem is removed from the ShoppingList.

* @@ -37,6 +46,11 @@ public function getQuantity(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionBuilder.php index 76366855a09..3d5eba6d1d9 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionBuilder.php @@ -26,6 +26,12 @@ final class MyShoppingListRemoveLineItemActionBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?int @@ -33,7 +39,7 @@ final class MyShoppingListRemoveLineItemActionBuilder implements Builder private $quantity; /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Amount to remove from the quantity of the ShoppingListLineItem. If not set, the ShoppingListLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the ShoppingListLineItem, the ShoppingListLineItem is removed from the ShoppingList.

* @@ -65,6 +82,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -81,6 +109,7 @@ public function build(): MyShoppingListRemoveLineItemAction { return new MyShoppingListRemoveLineItemActionModel( $this->lineItemId, + $this->lineItemKey, $this->quantity ); } diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionModel.php index 34052136e84..6e95f24f195 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveLineItemActionModel.php @@ -32,6 +32,12 @@ final class MyShoppingListRemoveLineItemActionModel extends JsonObjectModel impl */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?int @@ -44,10 +50,12 @@ final class MyShoppingListRemoveLineItemActionModel extends JsonObjectModel impl */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?int $quantity = null, ?string $action = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->quantity = $quantity; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Amount to remove from the quantity of the ShoppingListLineItem. If not set, the ShoppingListLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the ShoppingListLineItem, the ShoppingListLineItem is removed from the ShoppingList.

* @@ -119,6 +147,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemAction.php index 031a819eb7d..43df7597cfd 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemAction.php @@ -14,16 +14,25 @@ interface MyShoppingListRemoveTextLineItemAction extends MyShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_QUANTITY = 'quantity'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

Amount to remove from the quantity of the TextLineItem. If not set, the TextLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the TextLineItem, the TextLineItem is removed from the ShoppingList.

* @@ -37,6 +46,11 @@ public function getQuantity(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionBuilder.php index 83db696c1fc..0d789e18baf 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionBuilder.php @@ -26,6 +26,12 @@ final class MyShoppingListRemoveTextLineItemActionBuilder implements Builder */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var ?int @@ -33,7 +39,7 @@ final class MyShoppingListRemoveTextLineItemActionBuilder implements Builder private $quantity; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

Amount to remove from the quantity of the TextLineItem. If not set, the TextLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the TextLineItem, the TextLineItem is removed from the ShoppingList.

* @@ -65,6 +82,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -81,6 +109,7 @@ public function build(): MyShoppingListRemoveTextLineItemAction { return new MyShoppingListRemoveTextLineItemActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->quantity ); } diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionModel.php index 73c12ea46e4..3b2cdc6e2ca 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListRemoveTextLineItemActionModel.php @@ -32,6 +32,12 @@ final class MyShoppingListRemoveTextLineItemActionModel extends JsonObjectModel */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?int @@ -44,10 +50,12 @@ final class MyShoppingListRemoveTextLineItemActionModel extends JsonObjectModel */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?int $quantity = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->quantity = $quantity; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

Amount to remove from the quantity of the TextLineItem. If not set, the TextLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the TextLineItem, the TextLineItem is removed from the ShoppingList.

* @@ -119,6 +147,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldAction.php index f276bbd817e..75972f022e5 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldAction.php @@ -14,17 +14,26 @@ interface MyShoppingListSetLineItemCustomFieldAction extends MyShoppingListUpdateAction { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_NAME = 'name'; public const FIELD_VALUE = 'value'; /** - *

Unique identifier of an existing ShoppingListLineItem in the ShoppingList.

+ *

Unique identifier of an the ShoppingListLineItem. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getLineItemId(); + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Name of the Custom Field.

* @@ -48,6 +57,11 @@ public function getValue(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionBuilder.php index 45593ffac6d..0fed9e81831 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionBuilder.php @@ -26,6 +26,12 @@ final class MyShoppingListSetLineItemCustomFieldActionBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?string @@ -39,7 +45,7 @@ final class MyShoppingListSetLineItemCustomFieldActionBuilder implements Builder private $value; /** - *

Unique identifier of an existing ShoppingListLineItem in the ShoppingList.

+ *

Unique identifier of an the ShoppingListLineItem. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -49,6 +55,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Name of the Custom Field.

* @@ -84,6 +101,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?string $name * @return $this @@ -111,6 +139,7 @@ public function build(): MyShoppingListSetLineItemCustomFieldAction { return new MyShoppingListSetLineItemCustomFieldActionModel( $this->lineItemId, + $this->lineItemKey, $this->name, $this->value ); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionModel.php index 5a67607a971..645088d4a80 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetLineItemCustomFieldActionModel.php @@ -32,6 +32,12 @@ final class MyShoppingListSetLineItemCustomFieldActionModel extends JsonObjectMo */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?string @@ -50,11 +56,13 @@ final class MyShoppingListSetLineItemCustomFieldActionModel extends JsonObjectMo */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?string $name = null, $value = null, ?string $action = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->name = $name; $this->value = $value; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -79,7 +87,7 @@ public function getAction() } /** - *

Unique identifier of an existing ShoppingListLineItem in the ShoppingList.

+ *

Unique identifier of an the ShoppingListLineItem. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -98,6 +106,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Name of the Custom Field.

* @@ -149,6 +177,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldAction.php index 36cd871083e..bd525f86db5 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldAction.php @@ -14,17 +14,26 @@ interface MyShoppingListSetTextLineItemCustomFieldAction extends MyShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_NAME = 'name'; public const FIELD_VALUE = 'value'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

Name of the Custom Field.

* @@ -48,6 +57,11 @@ public function getValue(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionBuilder.php index 6acd6c920a3..3dca07b6abf 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionBuilder.php @@ -26,6 +26,12 @@ final class MyShoppingListSetTextLineItemCustomFieldActionBuilder implements Bui */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var ?string @@ -39,7 +45,7 @@ final class MyShoppingListSetTextLineItemCustomFieldActionBuilder implements Bui private $value; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -49,6 +55,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

Name of the Custom Field.

* @@ -84,6 +101,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?string $name * @return $this @@ -111,6 +139,7 @@ public function build(): MyShoppingListSetTextLineItemCustomFieldAction { return new MyShoppingListSetTextLineItemCustomFieldActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->name, $this->value ); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionModel.php index ba1fff0bd46..75726e56931 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomFieldActionModel.php @@ -32,6 +32,12 @@ final class MyShoppingListSetTextLineItemCustomFieldActionModel extends JsonObje */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?string @@ -50,11 +56,13 @@ final class MyShoppingListSetTextLineItemCustomFieldActionModel extends JsonObje */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?string $name = null, $value = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->name = $name; $this->value = $value; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -79,7 +87,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -98,6 +106,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

Name of the Custom Field.

* @@ -149,6 +177,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeAction.php index 81201fdbd4b..cd3424b12d0 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeAction.php @@ -16,17 +16,26 @@ interface MyShoppingListSetTextLineItemCustomTypeAction extends MyShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_TYPE = 'type'; public const FIELD_FIELDS = 'fields'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

@@ -49,6 +58,11 @@ public function getFields(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionBuilder.php index 1207bf0530e..5a840ed4c3b 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionBuilder.php @@ -30,6 +30,12 @@ final class MyShoppingListSetTextLineItemCustomTypeActionBuilder implements Buil */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder @@ -43,7 +49,7 @@ final class MyShoppingListSetTextLineItemCustomTypeActionBuilder implements Buil private $fields; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -53,6 +59,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

@@ -87,6 +104,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?TypeResourceIdentifier $type * @return $this @@ -135,6 +163,7 @@ public function build(): MyShoppingListSetTextLineItemCustomTypeAction { return new MyShoppingListSetTextLineItemCustomTypeActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields ); diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionModel.php index ab8efdbc003..f9cd976d627 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemCustomTypeActionModel.php @@ -36,6 +36,12 @@ final class MyShoppingListSetTextLineItemCustomTypeActionModel extends JsonObjec */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?TypeResourceIdentifier @@ -54,11 +60,13 @@ final class MyShoppingListSetTextLineItemCustomTypeActionModel extends JsonObjec */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?TypeResourceIdentifier $type = null, ?FieldContainer $fields = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->type = $type; $this->fields = $fields; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -83,7 +91,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -102,6 +110,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

@@ -154,6 +182,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionAction.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionAction.php index 61a9468220e..955eb668c0b 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionAction.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionAction.php @@ -15,16 +15,25 @@ interface MyShoppingListSetTextLineItemDescriptionAction extends MyShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_DESCRIPTION = 'description'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

Value to set. If empty, any existing value will be removed.

* @@ -38,6 +47,11 @@ public function getDescription(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?LocalizedString $description */ diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionBuilder.php index 346b5c94083..458c7b7c02a 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionBuilder.php @@ -28,6 +28,12 @@ final class MyShoppingListSetTextLineItemDescriptionActionBuilder implements Bui */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var null|LocalizedString|LocalizedStringBuilder @@ -35,7 +41,7 @@ final class MyShoppingListSetTextLineItemDescriptionActionBuilder implements Bui private $description; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -45,6 +51,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

Value to set. If empty, any existing value will be removed.

* @@ -67,6 +84,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?LocalizedString $description * @return $this @@ -93,6 +121,7 @@ public function build(): MyShoppingListSetTextLineItemDescriptionAction { return new MyShoppingListSetTextLineItemDescriptionActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description ); } diff --git a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionModel.php b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionModel.php index cb219db368f..e666d6c8039 100644 --- a/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/Me/MyShoppingListSetTextLineItemDescriptionActionModel.php @@ -34,6 +34,12 @@ final class MyShoppingListSetTextLineItemDescriptionActionModel extends JsonObje */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?LocalizedString @@ -46,10 +52,12 @@ final class MyShoppingListSetTextLineItemDescriptionActionModel extends JsonObje */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?LocalizedString $description = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->description = $description; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -73,7 +81,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -92,6 +100,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

Value to set. If empty, any existing value will be removed.

* @@ -122,6 +150,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?LocalizedString $description */ diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessage.php new file mode 100644 index 00000000000..ee33600fe7a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessage.php @@ -0,0 +1,44 @@ +Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageBuilder.php new file mode 100644 index 00000000000..2e7feef57ef --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageBuilder.php @@ -0,0 +1,433 @@ + + */ +final class CustomerAddressCustomFieldAddedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): CustomerAddressCustomFieldAddedMessage + { + return new CustomerAddressCustomFieldAddedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name, + $this->value + ); + } + + public static function of(): CustomerAddressCustomFieldAddedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageCollection.php new file mode 100644 index 00000000000..c8c3d92a027 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddressCustomFieldAddedMessage current() + * @method CustomerAddressCustomFieldAddedMessage end() + * @method CustomerAddressCustomFieldAddedMessage at($offset) + */ +class CustomerAddressCustomFieldAddedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerAddressCustomFieldAddedMessage $value + * @psalm-param CustomerAddressCustomFieldAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddressCustomFieldAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddressCustomFieldAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddressCustomFieldAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddressCustomFieldAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddressCustomFieldAddedMessage $data */ + $data = CustomerAddressCustomFieldAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageModel.php new file mode 100644 index 00000000000..67d7d1d2168 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessageModel.php @@ -0,0 +1,526 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->value = $value; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been added.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayload.php new file mode 100644 index 00000000000..1f589546f9f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayload.php @@ -0,0 +1,44 @@ +Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadBuilder.php new file mode 100644 index 00000000000..29df6b5ea65 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadBuilder.php @@ -0,0 +1,92 @@ + + */ +final class CustomerAddressCustomFieldAddedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + + public function build(): CustomerAddressCustomFieldAddedMessagePayload + { + return new CustomerAddressCustomFieldAddedMessagePayloadModel( + $this->name, + $this->value + ); + } + + public static function of(): CustomerAddressCustomFieldAddedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..6f1a52d05c4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddressCustomFieldAddedMessagePayload current() + * @method CustomerAddressCustomFieldAddedMessagePayload end() + * @method CustomerAddressCustomFieldAddedMessagePayload at($offset) + */ +class CustomerAddressCustomFieldAddedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerAddressCustomFieldAddedMessagePayload $value + * @psalm-param CustomerAddressCustomFieldAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddressCustomFieldAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddressCustomFieldAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddressCustomFieldAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddressCustomFieldAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddressCustomFieldAddedMessagePayload $data */ + $data = CustomerAddressCustomFieldAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadModel.php new file mode 100644 index 00000000000..9a39563bd7e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldAddedMessagePayloadModel.php @@ -0,0 +1,129 @@ +name = $name; + $this->value = $value; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Name of the Custom Field that has been added.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessage.php new file mode 100644 index 00000000000..1ef830da01b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessage.php @@ -0,0 +1,59 @@ +Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer Address before, a Customer Address Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageBuilder.php new file mode 100644 index 00000000000..905a4f89716 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageBuilder.php @@ -0,0 +1,463 @@ + + */ +final class CustomerAddressCustomFieldChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + + * @var null|mixed|mixed + */ + private $previousValue; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer Address before, a Customer Address Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * @param mixed $previousValue + * @return $this + */ + public function withPreviousValue($previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): CustomerAddressCustomFieldChangedMessage + { + return new CustomerAddressCustomFieldChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name, + $this->value, + $this->previousValue + ); + } + + public static function of(): CustomerAddressCustomFieldChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageCollection.php new file mode 100644 index 00000000000..a8449e850d6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddressCustomFieldChangedMessage current() + * @method CustomerAddressCustomFieldChangedMessage end() + * @method CustomerAddressCustomFieldChangedMessage at($offset) + */ +class CustomerAddressCustomFieldChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerAddressCustomFieldChangedMessage $value + * @psalm-param CustomerAddressCustomFieldChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddressCustomFieldChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddressCustomFieldChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddressCustomFieldChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddressCustomFieldChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddressCustomFieldChangedMessage $data */ + $data = CustomerAddressCustomFieldChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageModel.php new file mode 100644 index 00000000000..cfc8ea6da87 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessageModel.php @@ -0,0 +1,563 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->value = $value; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been changed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer Address before, a Customer Address Custom Field Added Message is generated instead.

+ * + * + * @return null|mixed + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = $data; + } + + return $this->previousValue; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void + { + $this->previousValue = $previousValue; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayload.php new file mode 100644 index 00000000000..5508873a668 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayload.php @@ -0,0 +1,59 @@ +Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer Address before, a Customer Address Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..4abad66ed61 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadBuilder.php @@ -0,0 +1,122 @@ + + */ +final class CustomerAddressCustomFieldChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + + * @var null|mixed|mixed + */ + private $previousValue; + + /** + *

Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer Address before, a Customer Address Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * @param mixed $previousValue + * @return $this + */ + public function withPreviousValue($previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + + public function build(): CustomerAddressCustomFieldChangedMessagePayload + { + return new CustomerAddressCustomFieldChangedMessagePayloadModel( + $this->name, + $this->value, + $this->previousValue + ); + } + + public static function of(): CustomerAddressCustomFieldChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..12b6dc17c0e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddressCustomFieldChangedMessagePayload current() + * @method CustomerAddressCustomFieldChangedMessagePayload end() + * @method CustomerAddressCustomFieldChangedMessagePayload at($offset) + */ +class CustomerAddressCustomFieldChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerAddressCustomFieldChangedMessagePayload $value + * @psalm-param CustomerAddressCustomFieldChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddressCustomFieldChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddressCustomFieldChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddressCustomFieldChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddressCustomFieldChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddressCustomFieldChangedMessagePayload $data */ + $data = CustomerAddressCustomFieldChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadModel.php new file mode 100644 index 00000000000..00e89ac0e61 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldChangedMessagePayloadModel.php @@ -0,0 +1,166 @@ +name = $name; + $this->value = $value; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Name of the Custom Field that has been changed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer Address before, a Customer Address Custom Field Added Message is generated instead.

+ * + * + * @return null|mixed + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = $data; + } + + return $this->previousValue; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void + { + $this->previousValue = $previousValue; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessage.php new file mode 100644 index 00000000000..3c3aa89d175 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessage.php @@ -0,0 +1,30 @@ +Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageBuilder.php new file mode 100644 index 00000000000..497289a5232 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageBuilder.php @@ -0,0 +1,404 @@ + + */ +final class CustomerAddressCustomFieldRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $name; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): CustomerAddressCustomFieldRemovedMessage + { + return new CustomerAddressCustomFieldRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name + ); + } + + public static function of(): CustomerAddressCustomFieldRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageCollection.php new file mode 100644 index 00000000000..412096fec82 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddressCustomFieldRemovedMessage current() + * @method CustomerAddressCustomFieldRemovedMessage end() + * @method CustomerAddressCustomFieldRemovedMessage at($offset) + */ +class CustomerAddressCustomFieldRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerAddressCustomFieldRemovedMessage $value + * @psalm-param CustomerAddressCustomFieldRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddressCustomFieldRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddressCustomFieldRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddressCustomFieldRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddressCustomFieldRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddressCustomFieldRemovedMessage $data */ + $data = CustomerAddressCustomFieldRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageModel.php new file mode 100644 index 00000000000..082fe4b0ae0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessageModel.php @@ -0,0 +1,490 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been removed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayload.php new file mode 100644 index 00000000000..f0f359e047e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayload.php @@ -0,0 +1,30 @@ +Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..ea19a8023b6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadBuilder.php @@ -0,0 +1,63 @@ + + */ +final class CustomerAddressCustomFieldRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + *

Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + + public function build(): CustomerAddressCustomFieldRemovedMessagePayload + { + return new CustomerAddressCustomFieldRemovedMessagePayloadModel( + $this->name + ); + } + + public static function of(): CustomerAddressCustomFieldRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..b0b585590eb --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddressCustomFieldRemovedMessagePayload current() + * @method CustomerAddressCustomFieldRemovedMessagePayload end() + * @method CustomerAddressCustomFieldRemovedMessagePayload at($offset) + */ +class CustomerAddressCustomFieldRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerAddressCustomFieldRemovedMessagePayload $value + * @psalm-param CustomerAddressCustomFieldRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddressCustomFieldRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddressCustomFieldRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddressCustomFieldRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddressCustomFieldRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddressCustomFieldRemovedMessagePayload $data */ + $data = CustomerAddressCustomFieldRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..028df937fed --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomFieldRemovedMessagePayloadModel.php @@ -0,0 +1,93 @@ +name = $name; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Name of the Custom Field that has been removed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessage.php new file mode 100644 index 00000000000..9379f6127ad --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessage.php @@ -0,0 +1,31 @@ +id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageBuilder.php new file mode 100644 index 00000000000..250a8f2a510 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageBuilder.php @@ -0,0 +1,405 @@ + + */ +final class CustomerAddressCustomTypeRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): CustomerAddressCustomTypeRemovedMessage + { + return new CustomerAddressCustomTypeRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->previousTypeId + ); + } + + public static function of(): CustomerAddressCustomTypeRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageCollection.php new file mode 100644 index 00000000000..b4811b65dde --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddressCustomTypeRemovedMessage current() + * @method CustomerAddressCustomTypeRemovedMessage end() + * @method CustomerAddressCustomTypeRemovedMessage at($offset) + */ +class CustomerAddressCustomTypeRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerAddressCustomTypeRemovedMessage $value + * @psalm-param CustomerAddressCustomTypeRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddressCustomTypeRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddressCustomTypeRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddressCustomTypeRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddressCustomTypeRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddressCustomTypeRemovedMessage $data */ + $data = CustomerAddressCustomTypeRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageModel.php new file mode 100644 index 00000000000..f9df631b51a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessageModel.php @@ -0,0 +1,491 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayload.php new file mode 100644 index 00000000000..9cd69b3bb53 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayload.php @@ -0,0 +1,31 @@ +id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..05269fa9d4c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadBuilder.php @@ -0,0 +1,64 @@ + + */ +final class CustomerAddressCustomTypeRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + + public function build(): CustomerAddressCustomTypeRemovedMessagePayload + { + return new CustomerAddressCustomTypeRemovedMessagePayloadModel( + $this->previousTypeId + ); + } + + public static function of(): CustomerAddressCustomTypeRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..2507fecfc92 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddressCustomTypeRemovedMessagePayload current() + * @method CustomerAddressCustomTypeRemovedMessagePayload end() + * @method CustomerAddressCustomTypeRemovedMessagePayload at($offset) + */ +class CustomerAddressCustomTypeRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerAddressCustomTypeRemovedMessagePayload $value + * @psalm-param CustomerAddressCustomTypeRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddressCustomTypeRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddressCustomTypeRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddressCustomTypeRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddressCustomTypeRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddressCustomTypeRemovedMessagePayload $data */ + $data = CustomerAddressCustomTypeRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..a7c1503ec11 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeRemovedMessagePayloadModel.php @@ -0,0 +1,94 @@ +previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessage.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessage.php new file mode 100644 index 00000000000..cc33a3b23b5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessage.php @@ -0,0 +1,46 @@ +The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields(); + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void; + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageBuilder.php new file mode 100644 index 00000000000..f06f1e286c1 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageBuilder.php @@ -0,0 +1,447 @@ + + */ +final class CustomerAddressCustomTypeSetMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $customFields; + + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields() + { + return $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?CustomFields $customFields + * @return $this + */ + public function withCustomFields(?CustomFields $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withCustomFields() instead + * @return $this + */ + public function withCustomFieldsBuilder(?CustomFieldsBuilder $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + public function build(): CustomerAddressCustomTypeSetMessage + { + return new CustomerAddressCustomTypeSetMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields, + $this->previousTypeId + ); + } + + public static function of(): CustomerAddressCustomTypeSetMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageCollection.php new file mode 100644 index 00000000000..7e207e1014a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddressCustomTypeSetMessage current() + * @method CustomerAddressCustomTypeSetMessage end() + * @method CustomerAddressCustomTypeSetMessage at($offset) + */ +class CustomerAddressCustomTypeSetMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerAddressCustomTypeSetMessage $value + * @psalm-param CustomerAddressCustomTypeSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddressCustomTypeSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddressCustomTypeSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddressCustomTypeSetMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddressCustomTypeSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddressCustomTypeSetMessage $data */ + $data = CustomerAddressCustomTypeSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageModel.php new file mode 100644 index 00000000000..cb96ea51429 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessageModel.php @@ -0,0 +1,530 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->customFields = $customFields; + $this->previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

The Custom Fields that have been set.

+ * + * + * @return null|CustomFields + */ + public function getCustomFields() + { + if (is_null($this->customFields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM_FIELDS); + if (is_null($data)) { + return null; + } + + $this->customFields = CustomFieldsModel::of($data); + } + + return $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void + { + $this->customFields = $customFields; + } + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayload.php new file mode 100644 index 00000000000..38ecdfbcf8c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayload.php @@ -0,0 +1,46 @@ +The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields(); + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void; + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadBuilder.php new file mode 100644 index 00000000000..8ba497f3a0a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadBuilder.php @@ -0,0 +1,105 @@ + + */ +final class CustomerAddressCustomTypeSetMessagePayloadBuilder implements Builder +{ + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $customFields; + + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields() + { + return $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?CustomFields $customFields + * @return $this + */ + public function withCustomFields(?CustomFields $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + /** + * @deprecated use withCustomFields() instead + * @return $this + */ + public function withCustomFieldsBuilder(?CustomFieldsBuilder $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + public function build(): CustomerAddressCustomTypeSetMessagePayload + { + return new CustomerAddressCustomTypeSetMessagePayloadModel( + $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields, + $this->previousTypeId + ); + } + + public static function of(): CustomerAddressCustomTypeSetMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadCollection.php new file mode 100644 index 00000000000..546e7fd269d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerAddressCustomTypeSetMessagePayload current() + * @method CustomerAddressCustomTypeSetMessagePayload end() + * @method CustomerAddressCustomTypeSetMessagePayload at($offset) + */ +class CustomerAddressCustomTypeSetMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerAddressCustomTypeSetMessagePayload $value + * @psalm-param CustomerAddressCustomTypeSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerAddressCustomTypeSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerAddressCustomTypeSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerAddressCustomTypeSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerAddressCustomTypeSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerAddressCustomTypeSetMessagePayload $data */ + $data = CustomerAddressCustomTypeSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadModel.php new file mode 100644 index 00000000000..b4403e0cd14 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerAddressCustomTypeSetMessagePayloadModel.php @@ -0,0 +1,133 @@ +customFields = $customFields; + $this->previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

The Custom Fields that have been set.

+ * + * + * @return null|CustomFields + */ + public function getCustomFields() + { + if (is_null($this->customFields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM_FIELDS); + if (is_null($data)) { + return null; + } + + $this->customFields = CustomFieldsModel::of($data); + } + + return $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void + { + $this->customFields = $customFields; + } + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessage.php new file mode 100644 index 00000000000..42fbcc561ca --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessage.php @@ -0,0 +1,44 @@ +Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageBuilder.php new file mode 100644 index 00000000000..2d27e6a06f7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageBuilder.php @@ -0,0 +1,433 @@ + + */ +final class CustomerCustomFieldAddedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): CustomerCustomFieldAddedMessage + { + return new CustomerCustomFieldAddedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name, + $this->value + ); + } + + public static function of(): CustomerCustomFieldAddedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageCollection.php new file mode 100644 index 00000000000..9a332d375b6 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerCustomFieldAddedMessage current() + * @method CustomerCustomFieldAddedMessage end() + * @method CustomerCustomFieldAddedMessage at($offset) + */ +class CustomerCustomFieldAddedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerCustomFieldAddedMessage $value + * @psalm-param CustomerCustomFieldAddedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerCustomFieldAddedMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerCustomFieldAddedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerCustomFieldAddedMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerCustomFieldAddedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerCustomFieldAddedMessage $data */ + $data = CustomerCustomFieldAddedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageModel.php new file mode 100644 index 00000000000..0bd78c36c98 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessageModel.php @@ -0,0 +1,526 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->value = $value; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been added.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayload.php new file mode 100644 index 00000000000..7ccc663ea19 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayload.php @@ -0,0 +1,44 @@ +Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadBuilder.php new file mode 100644 index 00000000000..8307c2f7ca0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadBuilder.php @@ -0,0 +1,92 @@ + + */ +final class CustomerCustomFieldAddedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + *

Name of the Custom Field that has been added.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + + public function build(): CustomerCustomFieldAddedMessagePayload + { + return new CustomerCustomFieldAddedMessagePayloadModel( + $this->name, + $this->value + ); + } + + public static function of(): CustomerCustomFieldAddedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadCollection.php new file mode 100644 index 00000000000..fa9c0707d85 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerCustomFieldAddedMessagePayload current() + * @method CustomerCustomFieldAddedMessagePayload end() + * @method CustomerCustomFieldAddedMessagePayload at($offset) + */ +class CustomerCustomFieldAddedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerCustomFieldAddedMessagePayload $value + * @psalm-param CustomerCustomFieldAddedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerCustomFieldAddedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerCustomFieldAddedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerCustomFieldAddedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerCustomFieldAddedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerCustomFieldAddedMessagePayload $data */ + $data = CustomerCustomFieldAddedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadModel.php new file mode 100644 index 00000000000..66d02f2f25e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldAddedMessagePayloadModel.php @@ -0,0 +1,129 @@ +name = $name; + $this->value = $value; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Name of the Custom Field that has been added.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

The added CustomFieldValue based on the FieldType.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessage.php new file mode 100644 index 00000000000..6ae01abd8f9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessage.php @@ -0,0 +1,59 @@ +Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer before, a Customer Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageBuilder.php new file mode 100644 index 00000000000..d61d02696e3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageBuilder.php @@ -0,0 +1,463 @@ + + */ +final class CustomerCustomFieldChangedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + + * @var null|mixed|mixed + */ + private $previousValue; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer before, a Customer Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * @param mixed $previousValue + * @return $this + */ + public function withPreviousValue($previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): CustomerCustomFieldChangedMessage + { + return new CustomerCustomFieldChangedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name, + $this->value, + $this->previousValue + ); + } + + public static function of(): CustomerCustomFieldChangedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageCollection.php new file mode 100644 index 00000000000..601cb763d49 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerCustomFieldChangedMessage current() + * @method CustomerCustomFieldChangedMessage end() + * @method CustomerCustomFieldChangedMessage at($offset) + */ +class CustomerCustomFieldChangedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerCustomFieldChangedMessage $value + * @psalm-param CustomerCustomFieldChangedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerCustomFieldChangedMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerCustomFieldChangedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerCustomFieldChangedMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerCustomFieldChangedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerCustomFieldChangedMessage $data */ + $data = CustomerCustomFieldChangedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageModel.php new file mode 100644 index 00000000000..1495c1823f7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessageModel.php @@ -0,0 +1,563 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->value = $value; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been changed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer before, a Customer Custom Field Added Message is generated instead.

+ * + * + * @return null|mixed + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = $data; + } + + return $this->previousValue; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void + { + $this->previousValue = $previousValue; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayload.php new file mode 100644 index 00000000000..740884d2788 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayload.php @@ -0,0 +1,59 @@ +Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName(); + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue(); + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer before, a Customer Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; + + /** + * @param mixed $value + */ + public function setValue($value): void; + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadBuilder.php new file mode 100644 index 00000000000..969dfbaa46b --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadBuilder.php @@ -0,0 +1,122 @@ + + */ +final class CustomerCustomFieldChangedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + + * @var null|mixed|mixed + */ + private $value; + + /** + + * @var null|mixed|mixed + */ + private $previousValue; + + /** + *

Name of the Custom Field that has been changed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + + * @return null|mixed + */ + public function getValue() + { + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer before, a Customer Custom Field Added Message is generated instead.

+ * + + * @return null|mixed + */ + public function getPreviousValue() + { + return $this->previousValue; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @param mixed $value + * @return $this + */ + public function withValue($value) + { + $this->value = $value; + + return $this; + } + + /** + * @param mixed $previousValue + * @return $this + */ + public function withPreviousValue($previousValue) + { + $this->previousValue = $previousValue; + + return $this; + } + + + public function build(): CustomerCustomFieldChangedMessagePayload + { + return new CustomerCustomFieldChangedMessagePayloadModel( + $this->name, + $this->value, + $this->previousValue + ); + } + + public static function of(): CustomerCustomFieldChangedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadCollection.php new file mode 100644 index 00000000000..06172cb84b7 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerCustomFieldChangedMessagePayload current() + * @method CustomerCustomFieldChangedMessagePayload end() + * @method CustomerCustomFieldChangedMessagePayload at($offset) + */ +class CustomerCustomFieldChangedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerCustomFieldChangedMessagePayload $value + * @psalm-param CustomerCustomFieldChangedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerCustomFieldChangedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerCustomFieldChangedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerCustomFieldChangedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerCustomFieldChangedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerCustomFieldChangedMessagePayload $data */ + $data = CustomerCustomFieldChangedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadModel.php new file mode 100644 index 00000000000..b69c5189920 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldChangedMessagePayloadModel.php @@ -0,0 +1,166 @@ +name = $name; + $this->value = $value; + $this->previousValue = $previousValue; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Name of the Custom Field that has been changed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + /** + *

CustomFieldValue based on the FieldType after the Set Custom Field update action.

+ * + * + * @return null|mixed + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $this->value = $data; + } + + return $this->value; + } + + /** + *

CustomFieldValue based on the FieldType before the Set CustomField update action. + * When there has not been a Custom Field with the name on the Customer before, a Customer Custom Field Added Message is generated instead.

+ * + * + * @return null|mixed + */ + public function getPreviousValue() + { + if (is_null($this->previousValue)) { + /** @psalm-var mixed $data */ + $data = $this->raw(self::FIELD_PREVIOUS_VALUE); + if (is_null($data)) { + return null; + } + $this->previousValue = $data; + } + + return $this->previousValue; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + /** + * @param mixed $value + */ + public function setValue($value): void + { + $this->value = $value; + } + + /** + * @param mixed $previousValue + */ + public function setPreviousValue($previousValue): void + { + $this->previousValue = $previousValue; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessage.php new file mode 100644 index 00000000000..b48a1af2842 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessage.php @@ -0,0 +1,30 @@ +Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageBuilder.php new file mode 100644 index 00000000000..258ff553df4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageBuilder.php @@ -0,0 +1,404 @@ + + */ +final class CustomerCustomFieldRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $name; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): CustomerCustomFieldRemovedMessage + { + return new CustomerCustomFieldRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->name + ); + } + + public static function of(): CustomerCustomFieldRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageCollection.php new file mode 100644 index 00000000000..183d595ee5d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerCustomFieldRemovedMessage current() + * @method CustomerCustomFieldRemovedMessage end() + * @method CustomerCustomFieldRemovedMessage at($offset) + */ +class CustomerCustomFieldRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerCustomFieldRemovedMessage $value + * @psalm-param CustomerCustomFieldRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerCustomFieldRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerCustomFieldRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerCustomFieldRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerCustomFieldRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerCustomFieldRemovedMessage $data */ + $data = CustomerCustomFieldRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageModel.php new file mode 100644 index 00000000000..bb932b41df3 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessageModel.php @@ -0,0 +1,490 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->name = $name; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Name of the Custom Field that has been removed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayload.php new file mode 100644 index 00000000000..189977210ac --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayload.php @@ -0,0 +1,30 @@ +Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName(); + + /** + * @param ?string $name + */ + public function setName(?string $name): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..91377b77e87 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadBuilder.php @@ -0,0 +1,63 @@ + + */ +final class CustomerCustomFieldRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $name; + + /** + *

Name of the Custom Field that has been removed.

+ * + + * @return null|string + */ + public function getName() + { + return $this->name; + } + + /** + * @param ?string $name + * @return $this + */ + public function withName(?string $name) + { + $this->name = $name; + + return $this; + } + + + public function build(): CustomerCustomFieldRemovedMessagePayload + { + return new CustomerCustomFieldRemovedMessagePayloadModel( + $this->name + ); + } + + public static function of(): CustomerCustomFieldRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..5b26d8bf3cb --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerCustomFieldRemovedMessagePayload current() + * @method CustomerCustomFieldRemovedMessagePayload end() + * @method CustomerCustomFieldRemovedMessagePayload at($offset) + */ +class CustomerCustomFieldRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerCustomFieldRemovedMessagePayload $value + * @psalm-param CustomerCustomFieldRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerCustomFieldRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerCustomFieldRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerCustomFieldRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerCustomFieldRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerCustomFieldRemovedMessagePayload $data */ + $data = CustomerCustomFieldRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..eb44992c1f9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomFieldRemovedMessagePayloadModel.php @@ -0,0 +1,93 @@ +name = $name; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Name of the Custom Field that has been removed.

+ * + * + * @return null|string + */ + public function getName() + { + if (is_null($this->name)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_NAME); + if (is_null($data)) { + return null; + } + $this->name = (string) $data; + } + + return $this->name; + } + + + /** + * @param ?string $name + */ + public function setName(?string $name): void + { + $this->name = $name; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessage.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessage.php new file mode 100644 index 00000000000..77c48dae8ff --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessage.php @@ -0,0 +1,31 @@ +id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageBuilder.php new file mode 100644 index 00000000000..5b1df620c3c --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageBuilder.php @@ -0,0 +1,405 @@ + + */ +final class CustomerCustomTypeRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): CustomerCustomTypeRemovedMessage + { + return new CustomerCustomTypeRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->previousTypeId + ); + } + + public static function of(): CustomerCustomTypeRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageCollection.php new file mode 100644 index 00000000000..8b004e10ef0 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerCustomTypeRemovedMessage current() + * @method CustomerCustomTypeRemovedMessage end() + * @method CustomerCustomTypeRemovedMessage at($offset) + */ +class CustomerCustomTypeRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerCustomTypeRemovedMessage $value + * @psalm-param CustomerCustomTypeRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerCustomTypeRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerCustomTypeRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerCustomTypeRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerCustomTypeRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerCustomTypeRemovedMessage $data */ + $data = CustomerCustomTypeRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageModel.php new file mode 100644 index 00000000000..03d71d3399e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessageModel.php @@ -0,0 +1,491 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayload.php new file mode 100644 index 00000000000..9a1e6c8dc3e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayload.php @@ -0,0 +1,31 @@ +id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..0ed38e334b4 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadBuilder.php @@ -0,0 +1,64 @@ + + */ +final class CustomerCustomTypeRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + + public function build(): CustomerCustomTypeRemovedMessagePayload + { + return new CustomerCustomTypeRemovedMessagePayloadModel( + $this->previousTypeId + ); + } + + public static function of(): CustomerCustomTypeRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..048f9c25c44 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerCustomTypeRemovedMessagePayload current() + * @method CustomerCustomTypeRemovedMessagePayload end() + * @method CustomerCustomTypeRemovedMessagePayload at($offset) + */ +class CustomerCustomTypeRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerCustomTypeRemovedMessagePayload $value + * @psalm-param CustomerCustomTypeRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerCustomTypeRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerCustomTypeRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerCustomTypeRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerCustomTypeRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerCustomTypeRemovedMessagePayload $data */ + $data = CustomerCustomTypeRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..659faf7b845 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeRemovedMessagePayloadModel.php @@ -0,0 +1,94 @@ +previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

id of the Custom Type that has been removed.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessage.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessage.php new file mode 100644 index 00000000000..fbad39af590 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessage.php @@ -0,0 +1,46 @@ +The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields(); + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void; + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageBuilder.php new file mode 100644 index 00000000000..72488a41bfd --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageBuilder.php @@ -0,0 +1,447 @@ + + */ +final class CustomerCustomTypeSetMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $customFields; + + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields() + { + return $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?CustomFields $customFields + * @return $this + */ + public function withCustomFields(?CustomFields $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withCustomFields() instead + * @return $this + */ + public function withCustomFieldsBuilder(?CustomFieldsBuilder $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + public function build(): CustomerCustomTypeSetMessage + { + return new CustomerCustomTypeSetMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields, + $this->previousTypeId + ); + } + + public static function of(): CustomerCustomTypeSetMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageCollection.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageCollection.php new file mode 100644 index 00000000000..89f8811a53f --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerCustomTypeSetMessage current() + * @method CustomerCustomTypeSetMessage end() + * @method CustomerCustomTypeSetMessage at($offset) + */ +class CustomerCustomTypeSetMessageCollection extends MessageCollection +{ + /** + * @psalm-assert CustomerCustomTypeSetMessage $value + * @psalm-param CustomerCustomTypeSetMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerCustomTypeSetMessageCollection + */ + public function add($value) + { + if (!$value instanceof CustomerCustomTypeSetMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerCustomTypeSetMessage + */ + protected function mapper() + { + return function (?int $index): ?CustomerCustomTypeSetMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerCustomTypeSetMessage $data */ + $data = CustomerCustomTypeSetMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageModel.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageModel.php new file mode 100644 index 00000000000..d4774e7db3a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessageModel.php @@ -0,0 +1,530 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->customFields = $customFields; + $this->previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

The Custom Fields that have been set.

+ * + * + * @return null|CustomFields + */ + public function getCustomFields() + { + if (is_null($this->customFields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM_FIELDS); + if (is_null($data)) { + return null; + } + + $this->customFields = CustomFieldsModel::of($data); + } + + return $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void + { + $this->customFields = $customFields; + } + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayload.php new file mode 100644 index 00000000000..acb520b858d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayload.php @@ -0,0 +1,46 @@ +The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields(); + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId(); + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void; + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void; +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadBuilder.php new file mode 100644 index 00000000000..fcc6ba12716 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadBuilder.php @@ -0,0 +1,105 @@ + + */ +final class CustomerCustomTypeSetMessagePayloadBuilder implements Builder +{ + /** + + * @var null|CustomFields|CustomFieldsBuilder + */ + private $customFields; + + /** + + * @var ?string + */ + private $previousTypeId; + + /** + *

The Custom Fields that have been set.

+ * + + * @return null|CustomFields + */ + public function getCustomFields() + { + return $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + + * @return null|string + */ + public function getPreviousTypeId() + { + return $this->previousTypeId; + } + + /** + * @param ?CustomFields $customFields + * @return $this + */ + public function withCustomFields(?CustomFields $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + /** + * @param ?string $previousTypeId + * @return $this + */ + public function withPreviousTypeId(?string $previousTypeId) + { + $this->previousTypeId = $previousTypeId; + + return $this; + } + + /** + * @deprecated use withCustomFields() instead + * @return $this + */ + public function withCustomFieldsBuilder(?CustomFieldsBuilder $customFields) + { + $this->customFields = $customFields; + + return $this; + } + + public function build(): CustomerCustomTypeSetMessagePayload + { + return new CustomerCustomTypeSetMessagePayloadModel( + $this->customFields instanceof CustomFieldsBuilder ? $this->customFields->build() : $this->customFields, + $this->previousTypeId + ); + } + + public static function of(): CustomerCustomTypeSetMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadCollection.php new file mode 100644 index 00000000000..bfa992b9135 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerCustomTypeSetMessagePayload current() + * @method CustomerCustomTypeSetMessagePayload end() + * @method CustomerCustomTypeSetMessagePayload at($offset) + */ +class CustomerCustomTypeSetMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerCustomTypeSetMessagePayload $value + * @psalm-param CustomerCustomTypeSetMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerCustomTypeSetMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerCustomTypeSetMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerCustomTypeSetMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerCustomTypeSetMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerCustomTypeSetMessagePayload $data */ + $data = CustomerCustomTypeSetMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadModel.php new file mode 100644 index 00000000000..23197f210f2 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerCustomTypeSetMessagePayloadModel.php @@ -0,0 +1,133 @@ +customFields = $customFields; + $this->previousTypeId = $previousTypeId; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

The Custom Fields that have been set.

+ * + * + * @return null|CustomFields + */ + public function getCustomFields() + { + if (is_null($this->customFields)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOM_FIELDS); + if (is_null($data)) { + return null; + } + + $this->customFields = CustomFieldsModel::of($data); + } + + return $this->customFields; + } + + /** + *

id of the previous Custom Type.

+ *

Absent when there has not been a Custom Type before.

+ * + * + * @return null|string + */ + public function getPreviousTypeId() + { + if (is_null($this->previousTypeId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_PREVIOUS_TYPE_ID); + if (is_null($data)) { + return null; + } + $this->previousTypeId = (string) $data; + } + + return $this->previousTypeId; + } + + + /** + * @param ?CustomFields $customFields + */ + public function setCustomFields(?CustomFields $customFields): void + { + $this->customFields = $customFields; + } + + /** + * @param ?string $previousTypeId + */ + public function setPreviousTypeId(?string $previousTypeId): void + { + $this->previousTypeId = $previousTypeId; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerMessagePayload.php b/lib/commercetools-api/src/Models/Message/CustomerMessagePayload.php new file mode 100644 index 00000000000..6ef8b56570a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerMessagePayload.php @@ -0,0 +1,16 @@ + + * @implements Builder */ -final class ProductSelectionTypeBuilder implements Builder +final class CustomerMessagePayloadBuilder implements Builder { - public function build(): ProductSelectionType + public function build(): CustomerMessagePayload { - return new ProductSelectionTypeModel( + return new CustomerMessagePayloadModel( ); } - public static function of(): ProductSelectionTypeBuilder + public static function of(): CustomerMessagePayloadBuilder { return new self(); } diff --git a/lib/commercetools-api/src/Models/Message/CustomerMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/CustomerMessagePayloadCollection.php new file mode 100644 index 00000000000..8038d015e86 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method CustomerMessagePayload current() + * @method CustomerMessagePayload end() + * @method CustomerMessagePayload at($offset) + */ +class CustomerMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert CustomerMessagePayload $value + * @psalm-param CustomerMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return CustomerMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof CustomerMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?CustomerMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?CustomerMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var CustomerMessagePayload $data */ + $data = CustomerMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/CustomerMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/CustomerMessagePayloadModel.php new file mode 100644 index 00000000000..b8ef4ed6db8 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/CustomerMessagePayloadModel.php @@ -0,0 +1,55 @@ +type = $type; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } +} diff --git a/lib/commercetools-api/src/Models/Message/MessageModel.php b/lib/commercetools-api/src/Models/Message/MessageModel.php index f1ed15e0228..d8ba1d22880 100644 --- a/lib/commercetools-api/src/Models/Message/MessageModel.php +++ b/lib/commercetools-api/src/Models/Message/MessageModel.php @@ -136,9 +136,19 @@ final class MessageModel extends JsonObjectModel implements Message 'CustomLineItemStateTransition' => CustomLineItemStateTransitionMessageModel::class, 'CustomerAddressAdded' => CustomerAddressAddedMessageModel::class, 'CustomerAddressChanged' => CustomerAddressChangedMessageModel::class, + 'CustomerAddressCustomFieldAdded' => CustomerAddressCustomFieldAddedMessageModel::class, + 'CustomerAddressCustomFieldChanged' => CustomerAddressCustomFieldChangedMessageModel::class, + 'CustomerAddressCustomFieldRemoved' => CustomerAddressCustomFieldRemovedMessageModel::class, + 'CustomerAddressCustomTypeRemoved' => CustomerAddressCustomTypeRemovedMessageModel::class, + 'CustomerAddressCustomTypeSet' => CustomerAddressCustomTypeSetMessageModel::class, 'CustomerAddressRemoved' => CustomerAddressRemovedMessageModel::class, 'CustomerCompanyNameSet' => CustomerCompanyNameSetMessageModel::class, 'CustomerCreated' => CustomerCreatedMessageModel::class, + 'CustomerCustomFieldAdded' => CustomerCustomFieldAddedMessageModel::class, + 'CustomerCustomFieldChanged' => CustomerCustomFieldChangedMessageModel::class, + 'CustomerCustomFieldRemoved' => CustomerCustomFieldRemovedMessageModel::class, + 'CustomerCustomTypeRemoved' => CustomerCustomTypeRemovedMessageModel::class, + 'CustomerCustomTypeSet' => CustomerCustomTypeSetMessageModel::class, 'CustomerDateOfBirthSet' => CustomerDateOfBirthSetMessageModel::class, 'CustomerDeleted' => CustomerDeletedMessageModel::class, 'CustomerEmailChanged' => CustomerEmailChangedMessageModel::class, @@ -232,6 +242,7 @@ final class MessageModel extends JsonObjectModel implements Message 'QuoteCreated' => QuoteCreatedMessageModel::class, 'QuoteCustomerChanged' => QuoteCustomerChangedMessageModel::class, 'QuoteDeleted' => QuoteDeletedMessageModel::class, + 'QuoteRenegotiationRequested' => QuoteRenegotiationRequestedMessageModel::class, 'QuoteRequestCreated' => QuoteRequestCreatedMessageModel::class, 'QuoteRequestCustomerChanged' => QuoteRequestCustomerChangedMessageModel::class, 'QuoteRequestDeleted' => QuoteRequestDeletedMessageModel::class, @@ -257,6 +268,7 @@ final class MessageModel extends JsonObjectModel implements Message 'StandalonePriceExternalDiscountSet' => StandalonePriceExternalDiscountSetMessageModel::class, 'StandalonePriceKeySet' => StandalonePriceKeySetMessageModel::class, 'StandalonePriceStagedChangesApplied' => StandalonePriceStagedChangesAppliedMessageModel::class, + 'StandalonePriceStagedChangesRemoved' => StandalonePriceStagedChangesRemovedMessageModel::class, 'StandalonePriceTierAdded' => StandalonePriceTierAddedMessageModel::class, 'StandalonePriceTierRemoved' => StandalonePriceTierRemovedMessageModel::class, 'StandalonePriceTiersSet' => StandalonePriceTiersSetMessageModel::class, @@ -272,7 +284,6 @@ final class MessageModel extends JsonObjectModel implements Message 'StoreNameSet' => StoreNameSetMessageModel::class, 'StoreProductSelectionsChanged' => StoreProductSelectionsChangedMessageModel::class, 'StoreSupplyChannelsChanged' => StoreSupplyChannelsChangedMessageModel::class, - 'null' => OrderMessageModel::class, ]; /** diff --git a/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php index b74c2da4dcf..dc02a62ad47 100644 --- a/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/MessagePayloadModel.php @@ -67,9 +67,19 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa 'CustomLineItemStateTransition' => CustomLineItemStateTransitionMessagePayloadModel::class, 'CustomerAddressAdded' => CustomerAddressAddedMessagePayloadModel::class, 'CustomerAddressChanged' => CustomerAddressChangedMessagePayloadModel::class, + 'CustomerAddressCustomFieldAdded' => CustomerAddressCustomFieldAddedMessagePayloadModel::class, + 'CustomerAddressCustomFieldChanged' => CustomerAddressCustomFieldChangedMessagePayloadModel::class, + 'CustomerAddressCustomFieldRemoved' => CustomerAddressCustomFieldRemovedMessagePayloadModel::class, + 'CustomerAddressCustomTypeRemoved' => CustomerAddressCustomTypeRemovedMessagePayloadModel::class, + 'CustomerAddressCustomTypeSet' => CustomerAddressCustomTypeSetMessagePayloadModel::class, 'CustomerAddressRemoved' => CustomerAddressRemovedMessagePayloadModel::class, 'CustomerCompanyNameSet' => CustomerCompanyNameSetMessagePayloadModel::class, 'CustomerCreated' => CustomerCreatedMessagePayloadModel::class, + 'CustomerCustomFieldAdded' => CustomerCustomFieldAddedMessagePayloadModel::class, + 'CustomerCustomFieldChanged' => CustomerCustomFieldChangedMessagePayloadModel::class, + 'CustomerCustomFieldRemoved' => CustomerCustomFieldRemovedMessagePayloadModel::class, + 'CustomerCustomTypeRemoved' => CustomerCustomTypeRemovedMessagePayloadModel::class, + 'CustomerCustomTypeSet' => CustomerCustomTypeSetMessagePayloadModel::class, 'CustomerDateOfBirthSet' => CustomerDateOfBirthSetMessagePayloadModel::class, 'CustomerDeleted' => CustomerDeletedMessagePayloadModel::class, 'CustomerEmailChanged' => CustomerEmailChangedMessagePayloadModel::class, @@ -163,6 +173,7 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa 'QuoteCreated' => QuoteCreatedMessagePayloadModel::class, 'QuoteCustomerChanged' => QuoteCustomerChangedMessagePayloadModel::class, 'QuoteDeleted' => QuoteDeletedMessagePayloadModel::class, + 'QuoteRenegotiationRequested' => QuoteRenegotiationRequestedMessagePayloadModel::class, 'QuoteRequestCreated' => QuoteRequestCreatedMessagePayloadModel::class, 'QuoteRequestCustomerChanged' => QuoteRequestCustomerChangedMessagePayloadModel::class, 'QuoteRequestDeleted' => QuoteRequestDeletedMessagePayloadModel::class, @@ -189,6 +200,7 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa 'StandalonePriceExternalDiscountSet' => StandalonePriceExternalDiscountSetMessagePayloadModel::class, 'StandalonePriceKeySet' => StandalonePriceKeySetMessagePayloadModel::class, 'StandalonePriceStagedChangesApplied' => StandalonePriceStagedChangesAppliedMessagePayloadModel::class, + 'StandalonePriceStagedChangesRemoved' => StandalonePriceStagedChangesRemovedMessagePayloadModel::class, 'StandalonePriceTierAdded' => StandalonePriceTierAddedMessagePayloadModel::class, 'StandalonePriceTierRemoved' => StandalonePriceTierRemovedMessagePayloadModel::class, 'StandalonePriceTiersSet' => StandalonePriceTiersSetMessagePayloadModel::class, @@ -204,7 +216,6 @@ final class MessagePayloadModel extends JsonObjectModel implements MessagePayloa 'StoreNameSet' => StoreNameSetMessagePayloadModel::class, 'StoreProductSelectionsChanged' => StoreProductSelectionsChangedMessagePayloadModel::class, 'StoreSupplyChannelsChanged' => StoreSupplyChannelsChangedMessagePayloadModel::class, - 'null' => OrderMessagePayloadModel::class, ]; /** diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessage.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessage.php index b25010112f5..b37b33fbe20 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessage.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessage.php @@ -13,17 +13,8 @@ interface PaymentStatusInterfaceCodeSetMessage extends Message { - public const FIELD_PAYMENT_ID = 'paymentId'; public const FIELD_INTERFACE_CODE = 'interfaceCode'; - /** - *

Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

- * - - * @return null|string - */ - public function getPaymentId(); - /** *

The interfaceCode that was set during the Set StatusInterfaceCode update action.

* @@ -32,11 +23,6 @@ public function getPaymentId(); */ public function getInterfaceCode(); - /** - * @param ?string $paymentId - */ - public function setPaymentId(?string $paymentId): void; - /** * @param ?string $interfaceCode */ diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageBuilder.php index 642b27c3644..c1c02c89a4d 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageBuilder.php @@ -87,12 +87,6 @@ final class PaymentStatusInterfaceCodeSetMessageBuilder implements Builder */ private $resourceUserProvidedIdentifiers; - /** - - * @var ?string - */ - private $paymentId; - /** * @var ?string @@ -210,17 +204,6 @@ public function getResourceUserProvidedIdentifiers() return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; } - /** - *

Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

- * - - * @return null|string - */ - public function getPaymentId() - { - return $this->paymentId; - } - /** *

The interfaceCode that was set during the Set StatusInterfaceCode update action.

* @@ -342,17 +325,6 @@ public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $re return $this; } - /** - * @param ?string $paymentId - * @return $this - */ - public function withPaymentId(?string $paymentId) - { - $this->paymentId = $paymentId; - - return $this; - } - /** * @param ?string $interfaceCode * @return $this @@ -421,7 +393,6 @@ public function build(): PaymentStatusInterfaceCodeSetMessage $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, $this->resourceVersion, $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, - $this->paymentId, $this->interfaceCode ); } diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageModel.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageModel.php index 3492fec45f2..8a38a67a575 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessageModel.php @@ -93,12 +93,6 @@ final class PaymentStatusInterfaceCodeSetMessageModel extends JsonObjectModel im */ protected $resourceUserProvidedIdentifiers; - /** - * - * @var ?string - */ - protected $paymentId; - /** * * @var ?string @@ -120,7 +114,6 @@ public function __construct( ?Reference $resource = null, ?int $resourceVersion = null, ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers = null, - ?string $paymentId = null, ?string $interfaceCode = null, ?string $type = null ) { @@ -134,7 +127,6 @@ public function __construct( $this->resource = $resource; $this->resourceVersion = $resourceVersion; $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; - $this->paymentId = $paymentId; $this->interfaceCode = $interfaceCode; $this->type = $type ?? self::DISCRIMINATOR_VALUE; } @@ -372,26 +364,6 @@ public function getResourceUserProvidedIdentifiers() return $this->resourceUserProvidedIdentifiers; } - /** - *

Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

- * - * - * @return null|string - */ - public function getPaymentId() - { - if (is_null($this->paymentId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_PAYMENT_ID); - if (is_null($data)) { - return null; - } - $this->paymentId = (string) $data; - } - - return $this->paymentId; - } - /** *

The interfaceCode that was set during the Set StatusInterfaceCode update action.

* @@ -493,14 +465,6 @@ public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $res $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; } - /** - * @param ?string $paymentId - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId = $paymentId; - } - /** * @param ?string $interfaceCode */ diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayload.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayload.php index c7017858d25..e867066e962 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayload.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayload.php @@ -13,17 +13,8 @@ interface PaymentStatusInterfaceCodeSetMessagePayload extends MessagePayload { - public const FIELD_PAYMENT_ID = 'paymentId'; public const FIELD_INTERFACE_CODE = 'interfaceCode'; - /** - *

Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

- * - - * @return null|string - */ - public function getPaymentId(); - /** *

The interfaceCode that was set during the Set StatusInterfaceCode update action.

* @@ -32,11 +23,6 @@ public function getPaymentId(); */ public function getInterfaceCode(); - /** - * @param ?string $paymentId - */ - public function setPaymentId(?string $paymentId): void; - /** * @param ?string $interfaceCode */ diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadBuilder.php index 0a860251af2..c4004185669 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadBuilder.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadBuilder.php @@ -20,29 +20,12 @@ */ final class PaymentStatusInterfaceCodeSetMessagePayloadBuilder implements Builder { - /** - - * @var ?string - */ - private $paymentId; - /** * @var ?string */ private $interfaceCode; - /** - *

Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

- * - - * @return null|string - */ - public function getPaymentId() - { - return $this->paymentId; - } - /** *

The interfaceCode that was set during the Set StatusInterfaceCode update action.

* @@ -54,17 +37,6 @@ public function getInterfaceCode() return $this->interfaceCode; } - /** - * @param ?string $paymentId - * @return $this - */ - public function withPaymentId(?string $paymentId) - { - $this->paymentId = $paymentId; - - return $this; - } - /** * @param ?string $interfaceCode * @return $this @@ -80,7 +52,6 @@ public function withInterfaceCode(?string $interfaceCode) public function build(): PaymentStatusInterfaceCodeSetMessagePayload { return new PaymentStatusInterfaceCodeSetMessagePayloadModel( - $this->paymentId, $this->interfaceCode ); } diff --git a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadModel.php index 1b796bf76e1..ed6e1683c86 100644 --- a/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadModel.php +++ b/lib/commercetools-api/src/Models/Message/PaymentStatusInterfaceCodeSetMessagePayloadModel.php @@ -26,12 +26,6 @@ final class PaymentStatusInterfaceCodeSetMessagePayloadModel extends JsonObjectM */ protected $type; - /** - * - * @var ?string - */ - protected $paymentId; - /** * * @var ?string @@ -43,11 +37,9 @@ final class PaymentStatusInterfaceCodeSetMessagePayloadModel extends JsonObjectM * @psalm-suppress MissingParamType */ public function __construct( - ?string $paymentId = null, ?string $interfaceCode = null, ?string $type = null ) { - $this->paymentId = $paymentId; $this->interfaceCode = $interfaceCode; $this->type = $type ?? self::DISCRIMINATOR_VALUE; } @@ -70,26 +62,6 @@ public function getType() return $this->type; } - /** - *

Unique identifier for the Payment for which the Set StatusInterfaceCode update action was applied.

- * - * - * @return null|string - */ - public function getPaymentId() - { - if (is_null($this->paymentId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_PAYMENT_ID); - if (is_null($data)) { - return null; - } - $this->paymentId = (string) $data; - } - - return $this->paymentId; - } - /** *

The interfaceCode that was set during the Set StatusInterfaceCode update action.

* @@ -111,14 +83,6 @@ public function getInterfaceCode() } - /** - * @param ?string $paymentId - */ - public function setPaymentId(?string $paymentId): void - { - $this->paymentId = $paymentId; - } - /** * @param ?string $interfaceCode */ diff --git a/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessage.php b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessage.php new file mode 100644 index 00000000000..7687f1069cb --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessage.php @@ -0,0 +1,30 @@ +Message from the Buyer regarding the Quote renegotiation request.

+ * + + * @return null|string + */ + public function getBuyerComment(); + + /** + * @param ?string $buyerComment + */ + public function setBuyerComment(?string $buyerComment): void; +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageBuilder.php new file mode 100644 index 00000000000..bad53c13a9d --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageBuilder.php @@ -0,0 +1,404 @@ + + */ +final class QuoteRenegotiationRequestedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var ?string + */ + private $buyerComment; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Message from the Buyer regarding the Quote renegotiation request.

+ * + + * @return null|string + */ + public function getBuyerComment() + { + return $this->buyerComment; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?string $buyerComment + * @return $this + */ + public function withBuyerComment(?string $buyerComment) + { + $this->buyerComment = $buyerComment; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + public function build(): QuoteRenegotiationRequestedMessage + { + return new QuoteRenegotiationRequestedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->buyerComment + ); + } + + public static function of(): QuoteRenegotiationRequestedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageCollection.php b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageCollection.php new file mode 100644 index 00000000000..fce92dd95e5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteRenegotiationRequestedMessage current() + * @method QuoteRenegotiationRequestedMessage end() + * @method QuoteRenegotiationRequestedMessage at($offset) + */ +class QuoteRenegotiationRequestedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert QuoteRenegotiationRequestedMessage $value + * @psalm-param QuoteRenegotiationRequestedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteRenegotiationRequestedMessageCollection + */ + public function add($value) + { + if (!$value instanceof QuoteRenegotiationRequestedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteRenegotiationRequestedMessage + */ + protected function mapper() + { + return function (?int $index): ?QuoteRenegotiationRequestedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteRenegotiationRequestedMessage $data */ + $data = QuoteRenegotiationRequestedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageModel.php b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageModel.php new file mode 100644 index 00000000000..8ce79a3809e --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessageModel.php @@ -0,0 +1,490 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->buyerComment = $buyerComment; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Message from the Buyer regarding the Quote renegotiation request.

+ * + * + * @return null|string + */ + public function getBuyerComment() + { + if (is_null($this->buyerComment)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_BUYER_COMMENT); + if (is_null($data)) { + return null; + } + $this->buyerComment = (string) $data; + } + + return $this->buyerComment; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?string $buyerComment + */ + public function setBuyerComment(?string $buyerComment): void + { + $this->buyerComment = $buyerComment; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayload.php b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayload.php new file mode 100644 index 00000000000..ce9c41eda97 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayload.php @@ -0,0 +1,30 @@ +Message from the Buyer regarding the Quote renegotiation request.

+ * + + * @return null|string + */ + public function getBuyerComment(); + + /** + * @param ?string $buyerComment + */ + public function setBuyerComment(?string $buyerComment): void; +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadBuilder.php new file mode 100644 index 00000000000..7641aed6344 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadBuilder.php @@ -0,0 +1,63 @@ + + */ +final class QuoteRenegotiationRequestedMessagePayloadBuilder implements Builder +{ + /** + + * @var ?string + */ + private $buyerComment; + + /** + *

Message from the Buyer regarding the Quote renegotiation request.

+ * + + * @return null|string + */ + public function getBuyerComment() + { + return $this->buyerComment; + } + + /** + * @param ?string $buyerComment + * @return $this + */ + public function withBuyerComment(?string $buyerComment) + { + $this->buyerComment = $buyerComment; + + return $this; + } + + + public function build(): QuoteRenegotiationRequestedMessagePayload + { + return new QuoteRenegotiationRequestedMessagePayloadModel( + $this->buyerComment + ); + } + + public static function of(): QuoteRenegotiationRequestedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadCollection.php new file mode 100644 index 00000000000..f5b4cb07951 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method QuoteRenegotiationRequestedMessagePayload current() + * @method QuoteRenegotiationRequestedMessagePayload end() + * @method QuoteRenegotiationRequestedMessagePayload at($offset) + */ +class QuoteRenegotiationRequestedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert QuoteRenegotiationRequestedMessagePayload $value + * @psalm-param QuoteRenegotiationRequestedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return QuoteRenegotiationRequestedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof QuoteRenegotiationRequestedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?QuoteRenegotiationRequestedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?QuoteRenegotiationRequestedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var QuoteRenegotiationRequestedMessagePayload $data */ + $data = QuoteRenegotiationRequestedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadModel.php new file mode 100644 index 00000000000..f52f64a6cd5 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/QuoteRenegotiationRequestedMessagePayloadModel.php @@ -0,0 +1,93 @@ +buyerComment = $buyerComment; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Message from the Buyer regarding the Quote renegotiation request.

+ * + * + * @return null|string + */ + public function getBuyerComment() + { + if (is_null($this->buyerComment)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_BUYER_COMMENT); + if (is_null($data)) { + return null; + } + $this->buyerComment = (string) $data; + } + + return $this->buyerComment; + } + + + /** + * @param ?string $buyerComment + */ + public function setBuyerComment(?string $buyerComment): void + { + $this->buyerComment = $buyerComment; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessage.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessage.php new file mode 100644 index 00000000000..5dc56bb664a --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessage.php @@ -0,0 +1,31 @@ +Removed changes of the StandalonePrice after the Remove Staged Changes update action.

+ * + + * @return null|StagedStandalonePrice + */ + public function getStagedChanges(); + + /** + * @param ?StagedStandalonePrice $stagedChanges + */ + public function setStagedChanges(?StagedStandalonePrice $stagedChanges): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageBuilder.php new file mode 100644 index 00000000000..cbd21f90991 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageBuilder.php @@ -0,0 +1,417 @@ + + */ +final class StandalonePriceStagedChangesRemovedMessageBuilder implements Builder +{ + /** + + * @var ?string + */ + private $id; + + /** + + * @var ?int + */ + private $version; + + /** + + * @var ?DateTimeImmutable + */ + private $createdAt; + + /** + + * @var ?DateTimeImmutable + */ + private $lastModifiedAt; + + /** + + * @var null|LastModifiedBy|LastModifiedByBuilder + */ + private $lastModifiedBy; + + /** + + * @var null|CreatedBy|CreatedByBuilder + */ + private $createdBy; + + /** + + * @var ?int + */ + private $sequenceNumber; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $resource; + + /** + + * @var ?int + */ + private $resourceVersion; + + /** + + * @var null|UserProvidedIdentifiers|UserProvidedIdentifiersBuilder + */ + private $resourceUserProvidedIdentifiers; + + /** + + * @var null|StagedStandalonePrice|StagedStandalonePriceBuilder + */ + private $stagedChanges; + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + + * @return null|string + */ + public function getId() + { + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + + * @return null|int + */ + public function getVersion() + { + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + return $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + + * @return null|CreatedBy + */ + public function getCreatedBy() + { + return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + + * @return null|int + */ + public function getSequenceNumber() + { + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + + * @return null|Reference + */ + public function getResource() + { + return $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + + * @return null|int + */ + public function getResourceVersion() + { + return $this->resourceVersion; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + return $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers; + } + + /** + *

Removed changes of the StandalonePrice after the Remove Staged Changes update action.

+ * + + * @return null|StagedStandalonePrice + */ + public function getStagedChanges() + { + return $this->stagedChanges instanceof StagedStandalonePriceBuilder ? $this->stagedChanges->build() : $this->stagedChanges; + } + + /** + * @param ?string $id + * @return $this + */ + public function withId(?string $id) + { + $this->id = $id; + + return $this; + } + + /** + * @param ?int $version + * @return $this + */ + public function withVersion(?int $version) + { + $this->version = $version; + + return $this; + } + + /** + * @param ?DateTimeImmutable $createdAt + * @return $this + */ + public function withCreatedAt(?DateTimeImmutable $createdAt) + { + $this->createdAt = $createdAt; + + return $this; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + * @return $this + */ + public function withLastModifiedAt(?DateTimeImmutable $lastModifiedAt) + { + $this->lastModifiedAt = $lastModifiedAt; + + return $this; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + * @return $this + */ + public function withLastModifiedBy(?LastModifiedBy $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @param ?CreatedBy $createdBy + * @return $this + */ + public function withCreatedBy(?CreatedBy $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @param ?int $sequenceNumber + * @return $this + */ + public function withSequenceNumber(?int $sequenceNumber) + { + $this->sequenceNumber = $sequenceNumber; + + return $this; + } + + /** + * @param ?Reference $resource + * @return $this + */ + public function withResource(?Reference $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @param ?int $resourceVersion + * @return $this + */ + public function withResourceVersion(?int $resourceVersion) + { + $this->resourceVersion = $resourceVersion; + + return $this; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + * @return $this + */ + public function withResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @param ?StagedStandalonePrice $stagedChanges + * @return $this + */ + public function withStagedChanges(?StagedStandalonePrice $stagedChanges) + { + $this->stagedChanges = $stagedChanges; + + return $this; + } + + /** + * @deprecated use withLastModifiedBy() instead + * @return $this + */ + public function withLastModifiedByBuilder(?LastModifiedByBuilder $lastModifiedBy) + { + $this->lastModifiedBy = $lastModifiedBy; + + return $this; + } + + /** + * @deprecated use withCreatedBy() instead + * @return $this + */ + public function withCreatedByBuilder(?CreatedByBuilder $createdBy) + { + $this->createdBy = $createdBy; + + return $this; + } + + /** + * @deprecated use withResource() instead + * @return $this + */ + public function withResourceBuilder(?ReferenceBuilder $resource) + { + $this->resource = $resource; + + return $this; + } + + /** + * @deprecated use withResourceUserProvidedIdentifiers() instead + * @return $this + */ + public function withResourceUserProvidedIdentifiersBuilder(?UserProvidedIdentifiersBuilder $resourceUserProvidedIdentifiers) + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + + return $this; + } + + /** + * @deprecated use withStagedChanges() instead + * @return $this + */ + public function withStagedChangesBuilder(?StagedStandalonePriceBuilder $stagedChanges) + { + $this->stagedChanges = $stagedChanges; + + return $this; + } + + public function build(): StandalonePriceStagedChangesRemovedMessage + { + return new StandalonePriceStagedChangesRemovedMessageModel( + $this->id, + $this->version, + $this->createdAt, + $this->lastModifiedAt, + $this->lastModifiedBy instanceof LastModifiedByBuilder ? $this->lastModifiedBy->build() : $this->lastModifiedBy, + $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, + $this->sequenceNumber, + $this->resource instanceof ReferenceBuilder ? $this->resource->build() : $this->resource, + $this->resourceVersion, + $this->resourceUserProvidedIdentifiers instanceof UserProvidedIdentifiersBuilder ? $this->resourceUserProvidedIdentifiers->build() : $this->resourceUserProvidedIdentifiers, + $this->stagedChanges instanceof StagedStandalonePriceBuilder ? $this->stagedChanges->build() : $this->stagedChanges + ); + } + + public static function of(): StandalonePriceStagedChangesRemovedMessageBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageCollection.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageCollection.php new file mode 100644 index 00000000000..f25bd83fec9 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceStagedChangesRemovedMessage current() + * @method StandalonePriceStagedChangesRemovedMessage end() + * @method StandalonePriceStagedChangesRemovedMessage at($offset) + */ +class StandalonePriceStagedChangesRemovedMessageCollection extends MessageCollection +{ + /** + * @psalm-assert StandalonePriceStagedChangesRemovedMessage $value + * @psalm-param StandalonePriceStagedChangesRemovedMessage|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceStagedChangesRemovedMessageCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceStagedChangesRemovedMessage) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceStagedChangesRemovedMessage + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceStagedChangesRemovedMessage { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceStagedChangesRemovedMessage $data */ + $data = StandalonePriceStagedChangesRemovedMessageModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageModel.php new file mode 100644 index 00000000000..0b2864fd001 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessageModel.php @@ -0,0 +1,493 @@ +id = $id; + $this->version = $version; + $this->createdAt = $createdAt; + $this->lastModifiedAt = $lastModifiedAt; + $this->lastModifiedBy = $lastModifiedBy; + $this->createdBy = $createdBy; + $this->sequenceNumber = $sequenceNumber; + $this->resource = $resource; + $this->resourceVersion = $resourceVersion; + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + $this->stagedChanges = $stagedChanges; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + *

Unique identifier of the Message. Can be used to track which Messages have been processed.

+ * + * + * @return null|string + */ + public function getId() + { + if (is_null($this->id)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ID); + if (is_null($data)) { + return null; + } + $this->id = (string) $data; + } + + return $this->id; + } + + /** + *

Version of a resource. In case of Messages, this is always 1.

+ * + * + * @return null|int + */ + public function getVersion() + { + if (is_null($this->version)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_VERSION); + if (is_null($data)) { + return null; + } + $this->version = (int) $data; + } + + return $this->version; + } + + /** + *

Date and time (UTC) the Message was generated.

+ * + * + * @return null|DateTimeImmutable + */ + public function getCreatedAt() + { + if (is_null($this->createdAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CREATED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->createdAt = $data; + } + + return $this->createdAt; + } + + /** + *

Value of createdAt.

+ * + * + * @return null|DateTimeImmutable + */ + public function getLastModifiedAt() + { + if (is_null($this->lastModifiedAt)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_AT); + if (is_null($data)) { + return null; + } + $data = DateTimeImmutable::createFromFormat(MapperFactory::DATETIME_FORMAT, $data); + if (false === $data) { + return null; + } + $this->lastModifiedAt = $data; + } + + return $this->lastModifiedAt; + } + + /** + *

Value of createdBy.

+ * + * + * @return null|LastModifiedBy + */ + public function getLastModifiedBy() + { + if (is_null($this->lastModifiedBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_LAST_MODIFIED_BY); + if (is_null($data)) { + return null; + } + + $this->lastModifiedBy = LastModifiedByModel::of($data); + } + + return $this->lastModifiedBy; + } + + /** + *

Present on resources created after 1 February 2019 except for events not tracked.

+ * + * + * @return null|CreatedBy + */ + public function getCreatedBy() + { + if (is_null($this->createdBy)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CREATED_BY); + if (is_null($data)) { + return null; + } + + $this->createdBy = CreatedByModel::of($data); + } + + return $this->createdBy; + } + + /** + *

Message number in relation to other Messages for a given resource. The sequenceNumber of the next Message for the resource is the successor of the sequenceNumber of the current Message. Meaning, the sequenceNumber of the next Message equals the sequenceNumber of the current Message + 1. + * sequenceNumber can be used to ensure that Messages are processed in the correct order for a particular resource.

+ * + * + * @return null|int + */ + public function getSequenceNumber() + { + if (is_null($this->sequenceNumber)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_SEQUENCE_NUMBER); + if (is_null($data)) { + return null; + } + $this->sequenceNumber = (int) $data; + } + + return $this->sequenceNumber; + } + + /** + *

Reference to the resource on which the change or action was performed.

+ * + * + * @return null|Reference + */ + public function getResource() + { + if (is_null($this->resource)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE); + if (is_null($data)) { + return null; + } + $className = ReferenceModel::resolveDiscriminatorClass($data); + $this->resource = $className::of($data); + } + + return $this->resource; + } + + /** + *

Version of the resource on which the change or action was performed.

+ * + * + * @return null|int + */ + public function getResourceVersion() + { + if (is_null($this->resourceVersion)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_RESOURCE_VERSION); + if (is_null($data)) { + return null; + } + $this->resourceVersion = (int) $data; + } + + return $this->resourceVersion; + } + + /** + *

Message Type of the Message.

+ * + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

User-provided identifiers of the resource, such as key or externalId. Only present if the resource has such identifiers.

+ * + * + * @return null|UserProvidedIdentifiers + */ + public function getResourceUserProvidedIdentifiers() + { + if (is_null($this->resourceUserProvidedIdentifiers)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_RESOURCE_USER_PROVIDED_IDENTIFIERS); + if (is_null($data)) { + return null; + } + + $this->resourceUserProvidedIdentifiers = UserProvidedIdentifiersModel::of($data); + } + + return $this->resourceUserProvidedIdentifiers; + } + + /** + *

Removed changes of the StandalonePrice after the Remove Staged Changes update action.

+ * + * + * @return null|StagedStandalonePrice + */ + public function getStagedChanges() + { + if (is_null($this->stagedChanges)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STAGED_CHANGES); + if (is_null($data)) { + return null; + } + + $this->stagedChanges = StagedStandalonePriceModel::of($data); + } + + return $this->stagedChanges; + } + + + /** + * @param ?string $id + */ + public function setId(?string $id): void + { + $this->id = $id; + } + + /** + * @param ?int $version + */ + public function setVersion(?int $version): void + { + $this->version = $version; + } + + /** + * @param ?DateTimeImmutable $createdAt + */ + public function setCreatedAt(?DateTimeImmutable $createdAt): void + { + $this->createdAt = $createdAt; + } + + /** + * @param ?DateTimeImmutable $lastModifiedAt + */ + public function setLastModifiedAt(?DateTimeImmutable $lastModifiedAt): void + { + $this->lastModifiedAt = $lastModifiedAt; + } + + /** + * @param ?LastModifiedBy $lastModifiedBy + */ + public function setLastModifiedBy(?LastModifiedBy $lastModifiedBy): void + { + $this->lastModifiedBy = $lastModifiedBy; + } + + /** + * @param ?CreatedBy $createdBy + */ + public function setCreatedBy(?CreatedBy $createdBy): void + { + $this->createdBy = $createdBy; + } + + /** + * @param ?int $sequenceNumber + */ + public function setSequenceNumber(?int $sequenceNumber): void + { + $this->sequenceNumber = $sequenceNumber; + } + + /** + * @param ?Reference $resource + */ + public function setResource(?Reference $resource): void + { + $this->resource = $resource; + } + + /** + * @param ?int $resourceVersion + */ + public function setResourceVersion(?int $resourceVersion): void + { + $this->resourceVersion = $resourceVersion; + } + + /** + * @param ?UserProvidedIdentifiers $resourceUserProvidedIdentifiers + */ + public function setResourceUserProvidedIdentifiers(?UserProvidedIdentifiers $resourceUserProvidedIdentifiers): void + { + $this->resourceUserProvidedIdentifiers = $resourceUserProvidedIdentifiers; + } + + /** + * @param ?StagedStandalonePrice $stagedChanges + */ + public function setStagedChanges(?StagedStandalonePrice $stagedChanges): void + { + $this->stagedChanges = $stagedChanges; + } + + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $data = $this->toArray(); + if (isset($data[Message::FIELD_CREATED_AT]) && $data[Message::FIELD_CREATED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_CREATED_AT] = $data[Message::FIELD_CREATED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + + if (isset($data[Message::FIELD_LAST_MODIFIED_AT]) && $data[Message::FIELD_LAST_MODIFIED_AT] instanceof \DateTimeImmutable) { + $data[Message::FIELD_LAST_MODIFIED_AT] = $data[Message::FIELD_LAST_MODIFIED_AT]->setTimeZone(new \DateTimeZone('UTC'))->format('c'); + } + return (object) $data; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayload.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayload.php new file mode 100644 index 00000000000..3af6d496933 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayload.php @@ -0,0 +1,31 @@ +Removed changes of the StandalonePrice after the Remove Staged Changes update action.

+ * + + * @return null|StagedStandalonePrice + */ + public function getStagedChanges(); + + /** + * @param ?StagedStandalonePrice $stagedChanges + */ + public function setStagedChanges(?StagedStandalonePrice $stagedChanges): void; +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadBuilder.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadBuilder.php new file mode 100644 index 00000000000..f3af8174111 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadBuilder.php @@ -0,0 +1,75 @@ + + */ +final class StandalonePriceStagedChangesRemovedMessagePayloadBuilder implements Builder +{ + /** + + * @var null|StagedStandalonePrice|StagedStandalonePriceBuilder + */ + private $stagedChanges; + + /** + *

Removed changes of the StandalonePrice after the Remove Staged Changes update action.

+ * + + * @return null|StagedStandalonePrice + */ + public function getStagedChanges() + { + return $this->stagedChanges instanceof StagedStandalonePriceBuilder ? $this->stagedChanges->build() : $this->stagedChanges; + } + + /** + * @param ?StagedStandalonePrice $stagedChanges + * @return $this + */ + public function withStagedChanges(?StagedStandalonePrice $stagedChanges) + { + $this->stagedChanges = $stagedChanges; + + return $this; + } + + /** + * @deprecated use withStagedChanges() instead + * @return $this + */ + public function withStagedChangesBuilder(?StagedStandalonePriceBuilder $stagedChanges) + { + $this->stagedChanges = $stagedChanges; + + return $this; + } + + public function build(): StandalonePriceStagedChangesRemovedMessagePayload + { + return new StandalonePriceStagedChangesRemovedMessagePayloadModel( + $this->stagedChanges instanceof StagedStandalonePriceBuilder ? $this->stagedChanges->build() : $this->stagedChanges + ); + } + + public static function of(): StandalonePriceStagedChangesRemovedMessagePayloadBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadCollection.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadCollection.php new file mode 100644 index 00000000000..bc4c40c9a44 --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceStagedChangesRemovedMessagePayload current() + * @method StandalonePriceStagedChangesRemovedMessagePayload end() + * @method StandalonePriceStagedChangesRemovedMessagePayload at($offset) + */ +class StandalonePriceStagedChangesRemovedMessagePayloadCollection extends MessagePayloadCollection +{ + /** + * @psalm-assert StandalonePriceStagedChangesRemovedMessagePayload $value + * @psalm-param StandalonePriceStagedChangesRemovedMessagePayload|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceStagedChangesRemovedMessagePayloadCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceStagedChangesRemovedMessagePayload) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceStagedChangesRemovedMessagePayload + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceStagedChangesRemovedMessagePayload { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceStagedChangesRemovedMessagePayload $data */ + $data = StandalonePriceStagedChangesRemovedMessagePayloadModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadModel.php b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadModel.php new file mode 100644 index 00000000000..52d0b6851ea --- /dev/null +++ b/lib/commercetools-api/src/Models/Message/StandalonePriceStagedChangesRemovedMessagePayloadModel.php @@ -0,0 +1,96 @@ +stagedChanges = $stagedChanges; + $this->type = $type ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getType() + { + if (is_null($this->type)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TYPE); + if (is_null($data)) { + return null; + } + $this->type = (string) $data; + } + + return $this->type; + } + + /** + *

Removed changes of the StandalonePrice after the Remove Staged Changes update action.

+ * + * + * @return null|StagedStandalonePrice + */ + public function getStagedChanges() + { + if (is_null($this->stagedChanges)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STAGED_CHANGES); + if (is_null($data)) { + return null; + } + + $this->stagedChanges = StagedStandalonePriceModel::of($data); + } + + return $this->stagedChanges; + } + + + /** + * @param ?StagedStandalonePrice $stagedChanges + */ + public function setStagedChanges(?StagedStandalonePrice $stagedChanges): void + { + $this->stagedChanges = $stagedChanges; + } +} diff --git a/lib/commercetools-api/src/Models/Payment/Payment.php b/lib/commercetools-api/src/Models/Payment/Payment.php index 51a833ec6eb..4e0b5b09c76 100644 --- a/lib/commercetools-api/src/Models/Payment/Payment.php +++ b/lib/commercetools-api/src/Models/Payment/Payment.php @@ -26,13 +26,8 @@ interface Payment extends BaseResource public const FIELD_CREATED_BY = 'createdBy'; public const FIELD_CUSTOMER = 'customer'; public const FIELD_ANONYMOUS_ID = 'anonymousId'; - public const FIELD_EXTERNAL_ID = 'externalId'; public const FIELD_INTERFACE_ID = 'interfaceId'; public const FIELD_AMOUNT_PLANNED = 'amountPlanned'; - public const FIELD_AMOUNT_AUTHORIZED = 'amountAuthorized'; - public const FIELD_AUTHORIZED_UNTIL = 'authorizedUntil'; - public const FIELD_AMOUNT_PAID = 'amountPaid'; - public const FIELD_AMOUNT_REFUNDED = 'amountRefunded'; public const FIELD_PAYMENT_METHOD_INFO = 'paymentMethodInfo'; public const FIELD_PAYMENT_STATUS = 'paymentStatus'; public const FIELD_TRANSACTIONS = 'transactions'; @@ -104,14 +99,6 @@ public function getCustomer(); */ public function getAnonymousId(); - /** - *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

- * - - * @return null|string - */ - public function getExternalId(); - /** *

Identifier used by the payment service that processes the Payment (for example, a PSP). * The combination of interfaceId and the paymentInterface field on PaymentMethodInfo must be unique.

@@ -130,38 +117,6 @@ public function getInterfaceId(); */ public function getAmountPlanned(); - /** - *

Deprecated because its value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|TypedMoney - */ - public function getAmountAuthorized(); - - /** - *

Deprecated because this field is of little practical value, as it is either not reliably known, or the authorization time is fixed for a PSP.

- * - - * @return null|string - */ - public function getAuthorizedUntil(); - - /** - *

Deprecated because its value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|TypedMoney - */ - public function getAmountPaid(); - - /** - *

Deprecated because its value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|TypedMoney - */ - public function getAmountRefunded(); - /** *

Information regarding the payment interface (for example, a PSP), and the specific payment method used.

* @@ -250,11 +205,6 @@ public function setCustomer(?CustomerReference $customer): void; */ public function setAnonymousId(?string $anonymousId): void; - /** - * @param ?string $externalId - */ - public function setExternalId(?string $externalId): void; - /** * @param ?string $interfaceId */ @@ -265,26 +215,6 @@ public function setInterfaceId(?string $interfaceId): void; */ public function setAmountPlanned(?CentPrecisionMoney $amountPlanned): void; - /** - * @param ?TypedMoney $amountAuthorized - */ - public function setAmountAuthorized(?TypedMoney $amountAuthorized): void; - - /** - * @param ?string $authorizedUntil - */ - public function setAuthorizedUntil(?string $authorizedUntil): void; - - /** - * @param ?TypedMoney $amountPaid - */ - public function setAmountPaid(?TypedMoney $amountPaid): void; - - /** - * @param ?TypedMoney $amountRefunded - */ - public function setAmountRefunded(?TypedMoney $amountRefunded): void; - /** * @param ?PaymentMethodInfo $paymentMethodInfo */ diff --git a/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php index 87be4262642..5915d2b6c43 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentBuilder.php @@ -17,7 +17,6 @@ use Commercetools\Api\Models\Common\LastModifiedBy; use Commercetools\Api\Models\Common\LastModifiedByBuilder; use Commercetools\Api\Models\Common\TypedMoney; -use Commercetools\Api\Models\Common\TypedMoneyBuilder; use Commercetools\Api\Models\Customer\CustomerReference; use Commercetools\Api\Models\Customer\CustomerReferenceBuilder; use Commercetools\Api\Models\Type\CustomFields; @@ -84,12 +83,6 @@ final class PaymentBuilder implements Builder */ private $anonymousId; - /** - - * @var ?string - */ - private $externalId; - /** * @var ?string @@ -102,30 +95,6 @@ final class PaymentBuilder implements Builder */ private $amountPlanned; - /** - - * @var null|TypedMoney|TypedMoneyBuilder - */ - private $amountAuthorized; - - /** - - * @var ?string - */ - private $authorizedUntil; - - /** - - * @var null|TypedMoney|TypedMoneyBuilder - */ - private $amountPaid; - - /** - - * @var null|TypedMoney|TypedMoneyBuilder - */ - private $amountRefunded; - /** * @var null|PaymentMethodInfo|PaymentMethodInfoBuilder @@ -250,17 +219,6 @@ public function getAnonymousId() return $this->anonymousId; } - /** - *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

- * - - * @return null|string - */ - public function getExternalId() - { - return $this->externalId; - } - /** *

Identifier used by the payment service that processes the Payment (for example, a PSP). * The combination of interfaceId and the paymentInterface field on PaymentMethodInfo must be unique.

@@ -285,50 +243,6 @@ public function getAmountPlanned() return $this->amountPlanned instanceof CentPrecisionMoneyBuilder ? $this->amountPlanned->build() : $this->amountPlanned; } - /** - *

Deprecated because its value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|TypedMoney - */ - public function getAmountAuthorized() - { - return $this->amountAuthorized instanceof TypedMoneyBuilder ? $this->amountAuthorized->build() : $this->amountAuthorized; - } - - /** - *

Deprecated because this field is of little practical value, as it is either not reliably known, or the authorization time is fixed for a PSP.

- * - - * @return null|string - */ - public function getAuthorizedUntil() - { - return $this->authorizedUntil; - } - - /** - *

Deprecated because its value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|TypedMoney - */ - public function getAmountPaid() - { - return $this->amountPaid instanceof TypedMoneyBuilder ? $this->amountPaid->build() : $this->amountPaid; - } - - /** - *

Deprecated because its value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|TypedMoney - */ - public function getAmountRefunded() - { - return $this->amountRefunded instanceof TypedMoneyBuilder ? $this->amountRefunded->build() : $this->amountRefunded; - } - /** *

Information regarding the payment interface (for example, a PSP), and the specific payment method used.

* @@ -483,17 +397,6 @@ public function withAnonymousId(?string $anonymousId) return $this; } - /** - * @param ?string $externalId - * @return $this - */ - public function withExternalId(?string $externalId) - { - $this->externalId = $externalId; - - return $this; - } - /** * @param ?string $interfaceId * @return $this @@ -516,50 +419,6 @@ public function withAmountPlanned(?CentPrecisionMoney $amountPlanned) return $this; } - /** - * @param ?TypedMoney $amountAuthorized - * @return $this - */ - public function withAmountAuthorized(?TypedMoney $amountAuthorized) - { - $this->amountAuthorized = $amountAuthorized; - - return $this; - } - - /** - * @param ?string $authorizedUntil - * @return $this - */ - public function withAuthorizedUntil(?string $authorizedUntil) - { - $this->authorizedUntil = $authorizedUntil; - - return $this; - } - - /** - * @param ?TypedMoney $amountPaid - * @return $this - */ - public function withAmountPaid(?TypedMoney $amountPaid) - { - $this->amountPaid = $amountPaid; - - return $this; - } - - /** - * @param ?TypedMoney $amountRefunded - * @return $this - */ - public function withAmountRefunded(?TypedMoney $amountRefunded) - { - $this->amountRefunded = $amountRefunded; - - return $this; - } - /** * @param ?PaymentMethodInfo $paymentMethodInfo * @return $this @@ -670,39 +529,6 @@ public function withAmountPlannedBuilder(?CentPrecisionMoneyBuilder $amountPlann return $this; } - /** - * @deprecated use withAmountAuthorized() instead - * @return $this - */ - public function withAmountAuthorizedBuilder(?TypedMoneyBuilder $amountAuthorized) - { - $this->amountAuthorized = $amountAuthorized; - - return $this; - } - - /** - * @deprecated use withAmountPaid() instead - * @return $this - */ - public function withAmountPaidBuilder(?TypedMoneyBuilder $amountPaid) - { - $this->amountPaid = $amountPaid; - - return $this; - } - - /** - * @deprecated use withAmountRefunded() instead - * @return $this - */ - public function withAmountRefundedBuilder(?TypedMoneyBuilder $amountRefunded) - { - $this->amountRefunded = $amountRefunded; - - return $this; - } - /** * @deprecated use withPaymentMethodInfo() instead * @return $this @@ -747,13 +573,8 @@ public function build(): Payment $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy, $this->customer instanceof CustomerReferenceBuilder ? $this->customer->build() : $this->customer, $this->anonymousId, - $this->externalId, $this->interfaceId, $this->amountPlanned instanceof CentPrecisionMoneyBuilder ? $this->amountPlanned->build() : $this->amountPlanned, - $this->amountAuthorized instanceof TypedMoneyBuilder ? $this->amountAuthorized->build() : $this->amountAuthorized, - $this->authorizedUntil, - $this->amountPaid instanceof TypedMoneyBuilder ? $this->amountPaid->build() : $this->amountPaid, - $this->amountRefunded instanceof TypedMoneyBuilder ? $this->amountRefunded->build() : $this->amountRefunded, $this->paymentMethodInfo instanceof PaymentMethodInfoBuilder ? $this->paymentMethodInfo->build() : $this->paymentMethodInfo, $this->paymentStatus instanceof PaymentStatusBuilder ? $this->paymentStatus->build() : $this->paymentStatus, $this->transactions, diff --git a/lib/commercetools-api/src/Models/Payment/PaymentDraft.php b/lib/commercetools-api/src/Models/Payment/PaymentDraft.php index e0c8fdfd2c0..ecdaab8fc5c 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentDraft.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentDraft.php @@ -19,13 +19,8 @@ interface PaymentDraft extends JsonObject { public const FIELD_CUSTOMER = 'customer'; public const FIELD_ANONYMOUS_ID = 'anonymousId'; - public const FIELD_EXTERNAL_ID = 'externalId'; public const FIELD_INTERFACE_ID = 'interfaceId'; public const FIELD_AMOUNT_PLANNED = 'amountPlanned'; - public const FIELD_AMOUNT_AUTHORIZED = 'amountAuthorized'; - public const FIELD_AUTHORIZED_UNTIL = 'authorizedUntil'; - public const FIELD_AMOUNT_PAID = 'amountPaid'; - public const FIELD_AMOUNT_REFUNDED = 'amountRefunded'; public const FIELD_PAYMENT_METHOD_INFO = 'paymentMethodInfo'; public const FIELD_PAYMENT_STATUS = 'paymentStatus'; public const FIELD_TRANSACTIONS = 'transactions'; @@ -49,14 +44,6 @@ public function getCustomer(); */ public function getAnonymousId(); - /** - *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

- * - - * @return null|string - */ - public function getExternalId(); - /** *

Identifier used by the payment service that processes the Payment (for example, a PSP). * The combination of interfaceId and the paymentInterface field on PaymentMethodInfo must be unique. @@ -76,38 +63,6 @@ public function getInterfaceId(); */ public function getAmountPlanned(); - /** - *

Deprecated because the value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|Money - */ - public function getAmountAuthorized(); - - /** - *

Deprecated because this field is of little practical value, as it is either not reliably known, or the authorization time is fixed for a PSP.

- * - - * @return null|string - */ - public function getAuthorizedUntil(); - - /** - *

Deprecated because the value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|Money - */ - public function getAmountPaid(); - - /** - *

Deprecated because the value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|Money - */ - public function getAmountRefunded(); - /** *

Information regarding the payment interface (for example, a PSP), and the specific payment method used.

* @@ -166,11 +121,6 @@ public function setCustomer(?CustomerResourceIdentifier $customer): void; */ public function setAnonymousId(?string $anonymousId): void; - /** - * @param ?string $externalId - */ - public function setExternalId(?string $externalId): void; - /** * @param ?string $interfaceId */ @@ -181,26 +131,6 @@ public function setInterfaceId(?string $interfaceId): void; */ public function setAmountPlanned(?Money $amountPlanned): void; - /** - * @param ?Money $amountAuthorized - */ - public function setAmountAuthorized(?Money $amountAuthorized): void; - - /** - * @param ?string $authorizedUntil - */ - public function setAuthorizedUntil(?string $authorizedUntil): void; - - /** - * @param ?Money $amountPaid - */ - public function setAmountPaid(?Money $amountPaid): void; - - /** - * @param ?Money $amountRefunded - */ - public function setAmountRefunded(?Money $amountRefunded): void; - /** * @param ?PaymentMethodInfo $paymentMethodInfo */ diff --git a/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php b/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php index afca348155e..a0307f4dc9c 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentDraftBuilder.php @@ -39,12 +39,6 @@ final class PaymentDraftBuilder implements Builder */ private $anonymousId; - /** - - * @var ?string - */ - private $externalId; - /** * @var ?string @@ -57,30 +51,6 @@ final class PaymentDraftBuilder implements Builder */ private $amountPlanned; - /** - - * @var null|Money|MoneyBuilder - */ - private $amountAuthorized; - - /** - - * @var ?string - */ - private $authorizedUntil; - - /** - - * @var null|Money|MoneyBuilder - */ - private $amountPaid; - - /** - - * @var null|Money|MoneyBuilder - */ - private $amountRefunded; - /** * @var null|PaymentMethodInfo|PaymentMethodInfoBuilder @@ -139,17 +109,6 @@ public function getAnonymousId() return $this->anonymousId; } - /** - *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

- * - - * @return null|string - */ - public function getExternalId() - { - return $this->externalId; - } - /** *

Identifier used by the payment service that processes the Payment (for example, a PSP). * The combination of interfaceId and the paymentInterface field on PaymentMethodInfo must be unique. @@ -175,50 +134,6 @@ public function getAmountPlanned() return $this->amountPlanned instanceof MoneyBuilder ? $this->amountPlanned->build() : $this->amountPlanned; } - /** - *

Deprecated because the value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|Money - */ - public function getAmountAuthorized() - { - return $this->amountAuthorized instanceof MoneyBuilder ? $this->amountAuthorized->build() : $this->amountAuthorized; - } - - /** - *

Deprecated because this field is of little practical value, as it is either not reliably known, or the authorization time is fixed for a PSP.

- * - - * @return null|string - */ - public function getAuthorizedUntil() - { - return $this->authorizedUntil; - } - - /** - *

Deprecated because the value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|Money - */ - public function getAmountPaid() - { - return $this->amountPaid instanceof MoneyBuilder ? $this->amountPaid->build() : $this->amountPaid; - } - - /** - *

Deprecated because the value can be calculated from the total amounts saved in the Transactions.

- * - - * @return null|Money - */ - public function getAmountRefunded() - { - return $this->amountRefunded instanceof MoneyBuilder ? $this->amountRefunded->build() : $this->amountRefunded; - } - /** *

Information regarding the payment interface (for example, a PSP), and the specific payment method used.

* @@ -307,17 +222,6 @@ public function withAnonymousId(?string $anonymousId) return $this; } - /** - * @param ?string $externalId - * @return $this - */ - public function withExternalId(?string $externalId) - { - $this->externalId = $externalId; - - return $this; - } - /** * @param ?string $interfaceId * @return $this @@ -340,50 +244,6 @@ public function withAmountPlanned(?Money $amountPlanned) return $this; } - /** - * @param ?Money $amountAuthorized - * @return $this - */ - public function withAmountAuthorized(?Money $amountAuthorized) - { - $this->amountAuthorized = $amountAuthorized; - - return $this; - } - - /** - * @param ?string $authorizedUntil - * @return $this - */ - public function withAuthorizedUntil(?string $authorizedUntil) - { - $this->authorizedUntil = $authorizedUntil; - - return $this; - } - - /** - * @param ?Money $amountPaid - * @return $this - */ - public function withAmountPaid(?Money $amountPaid) - { - $this->amountPaid = $amountPaid; - - return $this; - } - - /** - * @param ?Money $amountRefunded - * @return $this - */ - public function withAmountRefunded(?Money $amountRefunded) - { - $this->amountRefunded = $amountRefunded; - - return $this; - } - /** * @param ?PaymentMethodInfo $paymentMethodInfo * @return $this @@ -472,39 +332,6 @@ public function withAmountPlannedBuilder(?MoneyBuilder $amountPlanned) return $this; } - /** - * @deprecated use withAmountAuthorized() instead - * @return $this - */ - public function withAmountAuthorizedBuilder(?MoneyBuilder $amountAuthorized) - { - $this->amountAuthorized = $amountAuthorized; - - return $this; - } - - /** - * @deprecated use withAmountPaid() instead - * @return $this - */ - public function withAmountPaidBuilder(?MoneyBuilder $amountPaid) - { - $this->amountPaid = $amountPaid; - - return $this; - } - - /** - * @deprecated use withAmountRefunded() instead - * @return $this - */ - public function withAmountRefundedBuilder(?MoneyBuilder $amountRefunded) - { - $this->amountRefunded = $amountRefunded; - - return $this; - } - /** * @deprecated use withPaymentMethodInfo() instead * @return $this @@ -543,13 +370,8 @@ public function build(): PaymentDraft return new PaymentDraftModel( $this->customer instanceof CustomerResourceIdentifierBuilder ? $this->customer->build() : $this->customer, $this->anonymousId, - $this->externalId, $this->interfaceId, $this->amountPlanned instanceof MoneyBuilder ? $this->amountPlanned->build() : $this->amountPlanned, - $this->amountAuthorized instanceof MoneyBuilder ? $this->amountAuthorized->build() : $this->amountAuthorized, - $this->authorizedUntil, - $this->amountPaid instanceof MoneyBuilder ? $this->amountPaid->build() : $this->amountPaid, - $this->amountRefunded instanceof MoneyBuilder ? $this->amountRefunded->build() : $this->amountRefunded, $this->paymentMethodInfo instanceof PaymentMethodInfoBuilder ? $this->paymentMethodInfo->build() : $this->paymentMethodInfo, $this->paymentStatus instanceof PaymentStatusDraftBuilder ? $this->paymentStatus->build() : $this->paymentStatus, $this->transactions, diff --git a/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php b/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php index 367e847f380..9cdad764795 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentDraftModel.php @@ -38,12 +38,6 @@ final class PaymentDraftModel extends JsonObjectModel implements PaymentDraft */ protected $anonymousId; - /** - * - * @var ?string - */ - protected $externalId; - /** * * @var ?string @@ -56,30 +50,6 @@ final class PaymentDraftModel extends JsonObjectModel implements PaymentDraft */ protected $amountPlanned; - /** - * - * @var ?Money - */ - protected $amountAuthorized; - - /** - * - * @var ?string - */ - protected $authorizedUntil; - - /** - * - * @var ?Money - */ - protected $amountPaid; - - /** - * - * @var ?Money - */ - protected $amountRefunded; - /** * * @var ?PaymentMethodInfo @@ -123,13 +93,8 @@ final class PaymentDraftModel extends JsonObjectModel implements PaymentDraft public function __construct( ?CustomerResourceIdentifier $customer = null, ?string $anonymousId = null, - ?string $externalId = null, ?string $interfaceId = null, ?Money $amountPlanned = null, - ?Money $amountAuthorized = null, - ?string $authorizedUntil = null, - ?Money $amountPaid = null, - ?Money $amountRefunded = null, ?PaymentMethodInfo $paymentMethodInfo = null, ?PaymentStatusDraft $paymentStatus = null, ?TransactionDraftCollection $transactions = null, @@ -139,13 +104,8 @@ public function __construct( ) { $this->customer = $customer; $this->anonymousId = $anonymousId; - $this->externalId = $externalId; $this->interfaceId = $interfaceId; $this->amountPlanned = $amountPlanned; - $this->amountAuthorized = $amountAuthorized; - $this->authorizedUntil = $authorizedUntil; - $this->amountPaid = $amountPaid; - $this->amountRefunded = $amountRefunded; $this->paymentMethodInfo = $paymentMethodInfo; $this->paymentStatus = $paymentStatus; $this->transactions = $transactions; @@ -195,26 +155,6 @@ public function getAnonymousId() return $this->anonymousId; } - /** - *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

- * - * - * @return null|string - */ - public function getExternalId() - { - if (is_null($this->externalId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_EXTERNAL_ID); - if (is_null($data)) { - return null; - } - $this->externalId = (string) $data; - } - - return $this->externalId; - } - /** *

Identifier used by the payment service that processes the Payment (for example, a PSP). * The combination of interfaceId and the paymentInterface field on PaymentMethodInfo must be unique. @@ -259,89 +199,6 @@ public function getAmountPlanned() return $this->amountPlanned; } - /** - *

Deprecated because the value can be calculated from the total amounts saved in the Transactions.

- * - * - * @return null|Money - */ - public function getAmountAuthorized() - { - if (is_null($this->amountAuthorized)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_AMOUNT_AUTHORIZED); - if (is_null($data)) { - return null; - } - - $this->amountAuthorized = MoneyModel::of($data); - } - - return $this->amountAuthorized; - } - - /** - *

Deprecated because this field is of little practical value, as it is either not reliably known, or the authorization time is fixed for a PSP.

- * - * - * @return null|string - */ - public function getAuthorizedUntil() - { - if (is_null($this->authorizedUntil)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_AUTHORIZED_UNTIL); - if (is_null($data)) { - return null; - } - $this->authorizedUntil = (string) $data; - } - - return $this->authorizedUntil; - } - - /** - *

Deprecated because the value can be calculated from the total amounts saved in the Transactions.

- * - * - * @return null|Money - */ - public function getAmountPaid() - { - if (is_null($this->amountPaid)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_AMOUNT_PAID); - if (is_null($data)) { - return null; - } - - $this->amountPaid = MoneyModel::of($data); - } - - return $this->amountPaid; - } - - /** - *

Deprecated because the value can be calculated from the total amounts saved in the Transactions.

- * - * - * @return null|Money - */ - public function getAmountRefunded() - { - if (is_null($this->amountRefunded)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_AMOUNT_REFUNDED); - if (is_null($data)) { - return null; - } - - $this->amountRefunded = MoneyModel::of($data); - } - - return $this->amountRefunded; - } - /** *

Information regarding the payment interface (for example, a PSP), and the specific payment method used.

* @@ -482,14 +339,6 @@ public function setAnonymousId(?string $anonymousId): void $this->anonymousId = $anonymousId; } - /** - * @param ?string $externalId - */ - public function setExternalId(?string $externalId): void - { - $this->externalId = $externalId; - } - /** * @param ?string $interfaceId */ @@ -506,38 +355,6 @@ public function setAmountPlanned(?Money $amountPlanned): void $this->amountPlanned = $amountPlanned; } - /** - * @param ?Money $amountAuthorized - */ - public function setAmountAuthorized(?Money $amountAuthorized): void - { - $this->amountAuthorized = $amountAuthorized; - } - - /** - * @param ?string $authorizedUntil - */ - public function setAuthorizedUntil(?string $authorizedUntil): void - { - $this->authorizedUntil = $authorizedUntil; - } - - /** - * @param ?Money $amountPaid - */ - public function setAmountPaid(?Money $amountPaid): void - { - $this->amountPaid = $amountPaid; - } - - /** - * @param ?Money $amountRefunded - */ - public function setAmountRefunded(?Money $amountRefunded): void - { - $this->amountRefunded = $amountRefunded; - } - /** * @param ?PaymentMethodInfo $paymentMethodInfo */ diff --git a/lib/commercetools-api/src/Models/Payment/PaymentModel.php b/lib/commercetools-api/src/Models/Payment/PaymentModel.php index 97994dac05c..d33e481601e 100644 --- a/lib/commercetools-api/src/Models/Payment/PaymentModel.php +++ b/lib/commercetools-api/src/Models/Payment/PaymentModel.php @@ -83,12 +83,6 @@ final class PaymentModel extends JsonObjectModel implements Payment */ protected $anonymousId; - /** - * - * @var ?string - */ - protected $externalId; - /** * * @var ?string @@ -101,30 +95,6 @@ final class PaymentModel extends JsonObjectModel implements Payment */ protected $amountPlanned; - /** - * - * @var ?TypedMoney - */ - protected $amountAuthorized; - - /** - * - * @var ?string - */ - protected $authorizedUntil; - - /** - * - * @var ?TypedMoney - */ - protected $amountPaid; - - /** - * - * @var ?TypedMoney - */ - protected $amountRefunded; - /** * * @var ?PaymentMethodInfo @@ -174,13 +144,8 @@ public function __construct( ?CreatedBy $createdBy = null, ?CustomerReference $customer = null, ?string $anonymousId = null, - ?string $externalId = null, ?string $interfaceId = null, ?CentPrecisionMoney $amountPlanned = null, - ?TypedMoney $amountAuthorized = null, - ?string $authorizedUntil = null, - ?TypedMoney $amountPaid = null, - ?TypedMoney $amountRefunded = null, ?PaymentMethodInfo $paymentMethodInfo = null, ?PaymentStatus $paymentStatus = null, ?TransactionCollection $transactions = null, @@ -196,13 +161,8 @@ public function __construct( $this->createdBy = $createdBy; $this->customer = $customer; $this->anonymousId = $anonymousId; - $this->externalId = $externalId; $this->interfaceId = $interfaceId; $this->amountPlanned = $amountPlanned; - $this->amountAuthorized = $amountAuthorized; - $this->authorizedUntil = $authorizedUntil; - $this->amountPaid = $amountPaid; - $this->amountRefunded = $amountRefunded; $this->paymentMethodInfo = $paymentMethodInfo; $this->paymentStatus = $paymentStatus; $this->transactions = $transactions; @@ -382,26 +342,6 @@ public function getAnonymousId() return $this->anonymousId; } - /** - *

Additional identifier for external systems like Customer Relationship Management (CRM) or Enterprise Resource Planning (ERP).

- * - * - * @return null|string - */ - public function getExternalId() - { - if (is_null($this->externalId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_EXTERNAL_ID); - if (is_null($data)) { - return null; - } - $this->externalId = (string) $data; - } - - return $this->externalId; - } - /** *

Identifier used by the payment service that processes the Payment (for example, a PSP). * The combination of interfaceId and the paymentInterface field on PaymentMethodInfo must be unique.

@@ -445,89 +385,6 @@ public function getAmountPlanned() return $this->amountPlanned; } - /** - *

Deprecated because its value can be calculated from the total amounts saved in the Transactions.

- * - * - * @return null|TypedMoney - */ - public function getAmountAuthorized() - { - if (is_null($this->amountAuthorized)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_AMOUNT_AUTHORIZED); - if (is_null($data)) { - return null; - } - $className = TypedMoneyModel::resolveDiscriminatorClass($data); - $this->amountAuthorized = $className::of($data); - } - - return $this->amountAuthorized; - } - - /** - *

Deprecated because this field is of little practical value, as it is either not reliably known, or the authorization time is fixed for a PSP.

- * - * - * @return null|string - */ - public function getAuthorizedUntil() - { - if (is_null($this->authorizedUntil)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_AUTHORIZED_UNTIL); - if (is_null($data)) { - return null; - } - $this->authorizedUntil = (string) $data; - } - - return $this->authorizedUntil; - } - - /** - *

Deprecated because its value can be calculated from the total amounts saved in the Transactions.

- * - * - * @return null|TypedMoney - */ - public function getAmountPaid() - { - if (is_null($this->amountPaid)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_AMOUNT_PAID); - if (is_null($data)) { - return null; - } - $className = TypedMoneyModel::resolveDiscriminatorClass($data); - $this->amountPaid = $className::of($data); - } - - return $this->amountPaid; - } - - /** - *

Deprecated because its value can be calculated from the total amounts saved in the Transactions.

- * - * - * @return null|TypedMoney - */ - public function getAmountRefunded() - { - if (is_null($this->amountRefunded)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_AMOUNT_REFUNDED); - if (is_null($data)) { - return null; - } - $className = TypedMoneyModel::resolveDiscriminatorClass($data); - $this->amountRefunded = $className::of($data); - } - - return $this->amountRefunded; - } - /** *

Information regarding the payment interface (for example, a PSP), and the specific payment method used.

* @@ -716,14 +573,6 @@ public function setAnonymousId(?string $anonymousId): void $this->anonymousId = $anonymousId; } - /** - * @param ?string $externalId - */ - public function setExternalId(?string $externalId): void - { - $this->externalId = $externalId; - } - /** * @param ?string $interfaceId */ @@ -740,38 +589,6 @@ public function setAmountPlanned(?CentPrecisionMoney $amountPlanned): void $this->amountPlanned = $amountPlanned; } - /** - * @param ?TypedMoney $amountAuthorized - */ - public function setAmountAuthorized(?TypedMoney $amountAuthorized): void - { - $this->amountAuthorized = $amountAuthorized; - } - - /** - * @param ?string $authorizedUntil - */ - public function setAuthorizedUntil(?string $authorizedUntil): void - { - $this->authorizedUntil = $authorizedUntil; - } - - /** - * @param ?TypedMoney $amountPaid - */ - public function setAmountPaid(?TypedMoney $amountPaid): void - { - $this->amountPaid = $amountPaid; - } - - /** - * @param ?TypedMoney $amountRefunded - */ - public function setAmountRefunded(?TypedMoney $amountRefunded): void - { - $this->amountRefunded = $amountRefunded; - } - /** * @param ?PaymentMethodInfo $paymentMethodInfo */ diff --git a/lib/commercetools-api/src/Models/Product/ProductRemovePriceAction.php b/lib/commercetools-api/src/Models/Product/ProductRemovePriceAction.php index 2db85e0670c..cf429c29b8c 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemovePriceAction.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemovePriceAction.php @@ -15,9 +15,6 @@ interface ProductRemovePriceAction extends ProductUpdateAction { public const FIELD_PRICE_ID = 'priceId'; - public const FIELD_SKU = 'sku'; - public const FIELD_VARIANT_ID = 'variantId'; - public const FIELD_PRICE = 'price'; public const FIELD_STAGED = 'staged'; /** @@ -28,35 +25,6 @@ interface ProductRemovePriceAction extends ProductUpdateAction */ public function getPriceId(); - /** - *

The sku of the ProductVariant the provided Price should be removed from. - * Either 'variantId' or 'sku' is required" when priceId is not provided. - * This field is now deprecated, use 'priceId' instead.

- * - - * @return null|string - */ - public function getSku(); - - /** - *

The id of the ProductVariant the provided Price should be removed from. - * Either 'variantId' or 'sku' is required" when priceId is not provided. - * This field is now deprecated, use 'priceId' instead.

- * - - * @return null|int - */ - public function getVariantId(); - - /** - *

The Price identical to the one to be removed from the ProductVariant. - * This field is now deprecated, use 'priceId' instead.

- * - - * @return null|PriceDraft - */ - public function getPrice(); - /** *

If true, only the staged Embedded Price is removed. If false, both the current and staged Embedded Price are removed.

* @@ -70,21 +38,6 @@ public function getStaged(); */ public function setPriceId(?string $priceId): void; - /** - * @param ?string $sku - */ - public function setSku(?string $sku): void; - - /** - * @param ?int $variantId - */ - public function setVariantId(?int $variantId): void; - - /** - * @param ?PriceDraft $price - */ - public function setPrice(?PriceDraft $price): void; - /** * @param ?bool $staged */ diff --git a/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionBuilder.php b/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionBuilder.php index a0215b687c2..5f9c945c5fe 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionBuilder.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionBuilder.php @@ -9,7 +9,6 @@ namespace Commercetools\Api\Models\Product; use Commercetools\Api\Models\Common\PriceDraft; -use Commercetools\Api\Models\Common\PriceDraftBuilder; use Commercetools\Base\Builder; use Commercetools\Base\DateTimeImmutableCollection; use Commercetools\Base\JsonObject; @@ -28,24 +27,6 @@ final class ProductRemovePriceActionBuilder implements Builder */ private $priceId; - /** - - * @var ?string - */ - private $sku; - - /** - - * @var ?int - */ - private $variantId; - - /** - - * @var null|PriceDraft|PriceDraftBuilder - */ - private $price; - /** * @var ?bool @@ -63,44 +44,6 @@ public function getPriceId() return $this->priceId; } - /** - *

The sku of the ProductVariant the provided Price should be removed from. - * Either 'variantId' or 'sku' is required" when priceId is not provided. - * This field is now deprecated, use 'priceId' instead.

- * - - * @return null|string - */ - public function getSku() - { - return $this->sku; - } - - /** - *

The id of the ProductVariant the provided Price should be removed from. - * Either 'variantId' or 'sku' is required" when priceId is not provided. - * This field is now deprecated, use 'priceId' instead.

- * - - * @return null|int - */ - public function getVariantId() - { - return $this->variantId; - } - - /** - *

The Price identical to the one to be removed from the ProductVariant. - * This field is now deprecated, use 'priceId' instead.

- * - - * @return null|PriceDraft - */ - public function getPrice() - { - return $this->price instanceof PriceDraftBuilder ? $this->price->build() : $this->price; - } - /** *

If true, only the staged Embedded Price is removed. If false, both the current and staged Embedded Price are removed.

* @@ -123,39 +66,6 @@ public function withPriceId(?string $priceId) return $this; } - /** - * @param ?string $sku - * @return $this - */ - public function withSku(?string $sku) - { - $this->sku = $sku; - - return $this; - } - - /** - * @param ?int $variantId - * @return $this - */ - public function withVariantId(?int $variantId) - { - $this->variantId = $variantId; - - return $this; - } - - /** - * @param ?PriceDraft $price - * @return $this - */ - public function withPrice(?PriceDraft $price) - { - $this->price = $price; - - return $this; - } - /** * @param ?bool $staged * @return $this @@ -167,24 +77,11 @@ public function withStaged(?bool $staged) return $this; } - /** - * @deprecated use withPrice() instead - * @return $this - */ - public function withPriceBuilder(?PriceDraftBuilder $price) - { - $this->price = $price; - - return $this; - } public function build(): ProductRemovePriceAction { return new ProductRemovePriceActionModel( $this->priceId, - $this->sku, - $this->variantId, - $this->price instanceof PriceDraftBuilder ? $this->price->build() : $this->price, $this->staged ); } diff --git a/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionModel.php b/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionModel.php index 7a5f2215c88..bce1f1f36f5 100644 --- a/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionModel.php +++ b/lib/commercetools-api/src/Models/Product/ProductRemovePriceActionModel.php @@ -34,24 +34,6 @@ final class ProductRemovePriceActionModel extends JsonObjectModel implements Pro */ protected $priceId; - /** - * - * @var ?string - */ - protected $sku; - - /** - * - * @var ?int - */ - protected $variantId; - - /** - * - * @var ?PriceDraft - */ - protected $price; - /** * * @var ?bool @@ -64,16 +46,10 @@ final class ProductRemovePriceActionModel extends JsonObjectModel implements Pro */ public function __construct( ?string $priceId = null, - ?string $sku = null, - ?int $variantId = null, - ?PriceDraft $price = null, ?bool $staged = null, ?string $action = null ) { $this->priceId = $priceId; - $this->sku = $sku; - $this->variantId = $variantId; - $this->price = $price; $this->staged = $staged; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -116,72 +92,6 @@ public function getPriceId() return $this->priceId; } - /** - *

The sku of the ProductVariant the provided Price should be removed from. - * Either 'variantId' or 'sku' is required" when priceId is not provided. - * This field is now deprecated, use 'priceId' instead.

- * - * - * @return null|string - */ - public function getSku() - { - if (is_null($this->sku)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_SKU); - if (is_null($data)) { - return null; - } - $this->sku = (string) $data; - } - - return $this->sku; - } - - /** - *

The id of the ProductVariant the provided Price should be removed from. - * Either 'variantId' or 'sku' is required" when priceId is not provided. - * This field is now deprecated, use 'priceId' instead.

- * - * - * @return null|int - */ - public function getVariantId() - { - if (is_null($this->variantId)) { - /** @psalm-var ?int $data */ - $data = $this->raw(self::FIELD_VARIANT_ID); - if (is_null($data)) { - return null; - } - $this->variantId = (int) $data; - } - - return $this->variantId; - } - - /** - *

The Price identical to the one to be removed from the ProductVariant. - * This field is now deprecated, use 'priceId' instead.

- * - * - * @return null|PriceDraft - */ - public function getPrice() - { - if (is_null($this->price)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_PRICE); - if (is_null($data)) { - return null; - } - - $this->price = PriceDraftModel::of($data); - } - - return $this->price; - } - /** *

If true, only the staged Embedded Price is removed. If false, both the current and staged Embedded Price are removed.

* @@ -211,30 +121,6 @@ public function setPriceId(?string $priceId): void $this->priceId = $priceId; } - /** - * @param ?string $sku - */ - public function setSku(?string $sku): void - { - $this->sku = $sku; - } - - /** - * @param ?int $variantId - */ - public function setVariantId(?int $variantId): void - { - $this->variantId = $variantId; - } - - /** - * @param ?PriceDraft $price - */ - public function setPrice(?PriceDraft $price): void - { - $this->price = $price; - } - /** * @param ?bool $staged */ diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php index 3db3d328bb6..29372aeabcc 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelection.php @@ -24,7 +24,6 @@ interface ProductSelection extends BaseResource public const FIELD_KEY = 'key'; public const FIELD_NAME = 'name'; public const FIELD_PRODUCT_COUNT = 'productCount'; - public const FIELD_TYPE = 'type'; public const FIELD_MODE = 'mode'; public const FIELD_CUSTOM = 'custom'; @@ -100,15 +99,6 @@ public function getName(); */ public function getProductCount(); - /** - *

Specifies in which way the Products are assigned to the ProductSelection. - * Currently, the only way of doing this is to specify each Product individually, either by including or excluding them explicitly.

- * - - * @return null|string - */ - public function getType(); - /** *

Specifies in which way the Products are assigned to the ProductSelection. * Currently, the only way of doing this is to specify each Product individually, either by including or excluding them explicitly.

@@ -171,11 +161,6 @@ public function setName(?LocalizedString $name): void; */ public function setProductCount(?int $productCount): void; - /** - * @param ?string $type - */ - public function setType(?string $type): void; - /** * @param ?string $mode */ diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php index d3a62bea90c..1c95ca023de 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionBuilder.php @@ -85,12 +85,6 @@ final class ProductSelectionBuilder implements Builder */ private $productCount; - /** - - * @var ?string - */ - private $type; - /** * @var ?string @@ -202,18 +196,6 @@ public function getProductCount() return $this->productCount; } - /** - *

Specifies in which way the Products are assigned to the ProductSelection. - * Currently, the only way of doing this is to specify each Product individually, either by including or excluding them explicitly.

- * - - * @return null|string - */ - public function getType() - { - return $this->type; - } - /** *

Specifies in which way the Products are assigned to the ProductSelection. * Currently, the only way of doing this is to specify each Product individually, either by including or excluding them explicitly.

@@ -336,17 +318,6 @@ public function withProductCount(?int $productCount) return $this; } - /** - * @param ?string $type - * @return $this - */ - public function withType(?string $type) - { - $this->type = $type; - - return $this; - } - /** * @param ?string $mode * @return $this @@ -425,7 +396,6 @@ public function build(): ProductSelection $this->key, $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, $this->productCount, - $this->type, $this->mode, $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom ); diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php index 1def18f156f..60cd87d6638 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraft.php @@ -18,7 +18,6 @@ interface ProductSelectionDraft extends JsonObject public const FIELD_KEY = 'key'; public const FIELD_NAME = 'name'; public const FIELD_CUSTOM = 'custom'; - public const FIELD_TYPE = 'type'; public const FIELD_MODE = 'mode'; /** @@ -45,14 +44,6 @@ public function getName(); */ public function getCustom(); - /** - *

Type of the Product Selection.

- * - - * @return null|string - */ - public function getType(); - /** *

Mode of the Product Selection.

* @@ -76,11 +67,6 @@ public function setName(?LocalizedString $name): void; */ public function setCustom(?CustomFieldsDraft $custom): void; - /** - * @param ?string $type - */ - public function setType(?string $type): void; - /** * @param ?string $mode */ diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php index ca4c0070f35..85d2c846189 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftBuilder.php @@ -42,12 +42,6 @@ final class ProductSelectionDraftBuilder implements Builder */ private $custom; - /** - - * @var ?string - */ - private $type; - /** * @var ?string @@ -87,17 +81,6 @@ public function getCustom() return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } - /** - *

Type of the Product Selection.

- * - - * @return null|string - */ - public function getType() - { - return $this->type; - } - /** *

Mode of the Product Selection.

* @@ -142,17 +125,6 @@ public function withCustom(?CustomFieldsDraft $custom) return $this; } - /** - * @param ?string $type - * @return $this - */ - public function withType(?string $type) - { - $this->type = $type; - - return $this; - } - /** * @param ?string $mode * @return $this @@ -192,7 +164,6 @@ public function build(): ProductSelectionDraft $this->key, $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, - $this->type, $this->mode ); } diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php index 19edcd085ef..0f3cc08911d 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionDraftModel.php @@ -41,12 +41,6 @@ final class ProductSelectionDraftModel extends JsonObjectModel implements Produc */ protected $custom; - /** - * - * @var ?string - */ - protected $type; - /** * * @var ?string @@ -61,13 +55,11 @@ public function __construct( ?string $key = null, ?LocalizedString $name = null, ?CustomFieldsDraft $custom = null, - ?string $type = null, ?string $mode = null ) { $this->key = $key; $this->name = $name; $this->custom = $custom; - $this->type = $type; $this->mode = $mode; } @@ -133,26 +125,6 @@ public function getCustom() return $this->custom; } - /** - *

Type of the Product Selection.

- * - * - * @return null|string - */ - public function getType() - { - if (is_null($this->type)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TYPE); - if (is_null($data)) { - return null; - } - $this->type = (string) $data; - } - - return $this->type; - } - /** *

Mode of the Product Selection.

* @@ -198,14 +170,6 @@ public function setCustom(?CustomFieldsDraft $custom): void $this->custom = $custom; } - /** - * @param ?string $type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - /** * @param ?string $mode */ diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php index c2a34257802..40a8991a04b 100644 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php +++ b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionModel.php @@ -84,12 +84,6 @@ final class ProductSelectionModel extends JsonObjectModel implements ProductSele */ protected $productCount; - /** - * - * @var ?string - */ - protected $type; - /** * * @var ?string @@ -116,7 +110,6 @@ public function __construct( ?string $key = null, ?LocalizedString $name = null, ?int $productCount = null, - ?string $type = null, ?string $mode = null, ?CustomFields $custom = null ) { @@ -129,7 +122,6 @@ public function __construct( $this->key = $key; $this->name = $name; $this->productCount = $productCount; - $this->type = $type; $this->mode = $mode; $this->custom = $custom; } @@ -325,27 +317,6 @@ public function getProductCount() return $this->productCount; } - /** - *

Specifies in which way the Products are assigned to the ProductSelection. - * Currently, the only way of doing this is to specify each Product individually, either by including or excluding them explicitly.

- * - * - * @return null|string - */ - public function getType() - { - if (is_null($this->type)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TYPE); - if (is_null($data)) { - return null; - } - $this->type = (string) $data; - } - - return $this->type; - } - /** *

Specifies in which way the Products are assigned to the ProductSelection. * Currently, the only way of doing this is to specify each Product individually, either by including or excluding them explicitly.

@@ -461,14 +432,6 @@ public function setProductCount(?int $productCount): void $this->productCount = $productCount; } - /** - * @param ?string $type - */ - public function setType(?string $type): void - { - $this->type = $type; - } - /** * @param ?string $mode */ diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php deleted file mode 100644 index 0c275fac2ce..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionType.php +++ /dev/null @@ -1,26 +0,0 @@ -The following types of Product Selections are supported:

- * - - * @return null|string - */ - public function getType(); -} diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeCollection.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeCollection.php deleted file mode 100644 index 44f064a7d49..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeCollection.php +++ /dev/null @@ -1,60 +0,0 @@ - - * @psalm-method T current() - * @psalm-method T end() - * @psalm-method T at($offset) - * @method ProductSelectionType current() - * @method ProductSelectionType end() - * @method ProductSelectionType at($offset) - */ -class ProductSelectionTypeCollection extends MapperSequence -{ - /** - * @psalm-assert T $value - * @psalm-param T|stdClass $value - * @throws InvalidArgumentException - * - * @return ProductSelectionTypeCollection - */ - public function add($value) - { - if (!$value instanceof ProductSelectionType) { - throw new InvalidArgumentException(); - } - $this->store($value); - - return $this; - } - - /** - * @psalm-return callable(int):?T - */ - protected function mapper() - { - return function (?int $index): ?ProductSelectionType { - $data = $this->get($index); - if ($data instanceof stdClass) { - /** @var T $data */ - $data = ProductSelectionTypeModel::of($data); - $this->set($data, $index); - } - - return $data; - }; - } -} diff --git a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php b/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php deleted file mode 100644 index bc6ded06ac5..00000000000 --- a/lib/commercetools-api/src/Models/ProductSelection/ProductSelectionTypeModel.php +++ /dev/null @@ -1,95 +0,0 @@ - > - * - */ - private static $discriminatorClasses = [ - ]; - - /** - * @psalm-suppress MissingParamType - */ - public function __construct( - ?string $type = null - ) { - $this->type = $type; - } - - /** - *

The following types of Product Selections are supported:

- * - * - * @return null|string - */ - public function getType() - { - if (is_null($this->type)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_TYPE); - if (is_null($data)) { - return null; - } - $this->type = (string) $data; - } - - return $this->type; - } - - - - - - /** - * @psalm-param stdClass|array $value - * @psalm-return class-string - */ - public static function resolveDiscriminatorClass($value): string - { - $fieldName = ProductSelectionType::DISCRIMINATOR_FIELD; - if (is_object($value) && isset($value->$fieldName)) { - /** @psalm-var string $discriminatorValue */ - $discriminatorValue = $value->$fieldName; - if (isset(self::$discriminatorClasses[$discriminatorValue])) { - return self::$discriminatorClasses[$discriminatorValue]; - } - } - if (is_array($value) && isset($value[$fieldName])) { - /** @psalm-var string $discriminatorValue */ - $discriminatorValue = $value[$fieldName]; - if (isset(self::$discriminatorClasses[$discriminatorValue])) { - return self::$discriminatorClasses[$discriminatorValue]; - } - } - - /** @psalm-var class-string */ - $type = ProductSelectionTypeModel::class; - return $type; - } -} diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequest.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequest.php index 565bfc06132..c09a5130946 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequest.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequest.php @@ -9,6 +9,7 @@ namespace Commercetools\Api\Models\QuoteRequest; use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; +use Commercetools\Api\Models\Cart\CartReference; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\LineItemCollection; @@ -60,6 +61,7 @@ interface QuoteRequest extends BaseResource public const FIELD_CUSTOM = 'custom'; public const FIELD_STATE = 'state'; public const FIELD_PURCHASE_ORDER_NUMBER = 'purchaseOrderNumber'; + public const FIELD_CART = 'cart'; public const FIELD_BUSINESS_UNIT = 'businessUnit'; /** @@ -321,6 +323,14 @@ public function getState(); */ public function getPurchaseOrderNumber(); + /** + *

The Cart from which a Quote is requested.

+ * + + * @return null|CartReference + */ + public function getCart(); + /** *

The BusinessUnit for the Quote Request.

* @@ -484,6 +494,11 @@ public function setState(?StateReference $state): void; */ public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void; + /** + * @param ?CartReference $cart + */ + public function setCart(?CartReference $cart): void; + /** * @param ?BusinessUnitKeyReference $businessUnit */ diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestBuilder.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestBuilder.php index bc44acef1e2..d0ab038aea0 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestBuilder.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestBuilder.php @@ -10,6 +10,8 @@ use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceBuilder; +use Commercetools\Api\Models\Cart\CartReference; +use Commercetools\Api\Models\Cart\CartReferenceBuilder; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\LineItemCollection; @@ -241,6 +243,12 @@ final class QuoteRequestBuilder implements Builder */ private $purchaseOrderNumber; + /** + + * @var null|CartReference|CartReferenceBuilder + */ + private $cart; + /** * @var null|BusinessUnitKeyReference|BusinessUnitKeyReferenceBuilder @@ -599,6 +607,17 @@ public function getPurchaseOrderNumber() return $this->purchaseOrderNumber; } + /** + *

The Cart from which a Quote is requested.

+ * + + * @return null|CartReference + */ + public function getCart() + { + return $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart; + } + /** *

The BusinessUnit for the Quote Request.

* @@ -951,6 +970,17 @@ public function withPurchaseOrderNumber(?string $purchaseOrderNumber) return $this; } + /** + * @param ?CartReference $cart + * @return $this + */ + public function withCart(?CartReference $cart) + { + $this->cart = $cart; + + return $this; + } + /** * @param ?BusinessUnitKeyReference $businessUnit * @return $this @@ -1116,6 +1146,17 @@ public function withStateBuilder(?StateReferenceBuilder $state) return $this; } + /** + * @deprecated use withCart() instead + * @return $this + */ + public function withCartBuilder(?CartReferenceBuilder $cart) + { + $this->cart = $cart; + + return $this; + } + /** * @deprecated use withBusinessUnit() instead * @return $this @@ -1161,6 +1202,7 @@ public function build(): QuoteRequest $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, $this->state instanceof StateReferenceBuilder ? $this->state->build() : $this->state, $this->purchaseOrderNumber, + $this->cart instanceof CartReferenceBuilder ? $this->cart->build() : $this->cart, $this->businessUnit instanceof BusinessUnitKeyReferenceBuilder ? $this->businessUnit->build() : $this->businessUnit ); } diff --git a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestModel.php b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestModel.php index 6439e91a53b..669aa13f794 100644 --- a/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestModel.php +++ b/lib/commercetools-api/src/Models/QuoteRequest/QuoteRequestModel.php @@ -10,6 +10,8 @@ use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReference; use Commercetools\Api\Models\BusinessUnit\BusinessUnitKeyReferenceModel; +use Commercetools\Api\Models\Cart\CartReference; +use Commercetools\Api\Models\Cart\CartReferenceModel; use Commercetools\Api\Models\Cart\CustomLineItemCollection; use Commercetools\Api\Models\Cart\DirectDiscountCollection; use Commercetools\Api\Models\Cart\LineItemCollection; @@ -240,6 +242,12 @@ final class QuoteRequestModel extends JsonObjectModel implements QuoteRequest */ protected $purchaseOrderNumber; + /** + * + * @var ?CartReference + */ + protected $cart; + /** * * @var ?BusinessUnitKeyReference @@ -282,6 +290,7 @@ public function __construct( ?CustomFields $custom = null, ?StateReference $state = null, ?string $purchaseOrderNumber = null, + ?CartReference $cart = null, ?BusinessUnitKeyReference $businessUnit = null ) { $this->id = $id; @@ -315,6 +324,7 @@ public function __construct( $this->custom = $custom; $this->state = $state; $this->purchaseOrderNumber = $purchaseOrderNumber; + $this->cart = $cart; $this->businessUnit = $businessUnit; } @@ -971,6 +981,27 @@ public function getPurchaseOrderNumber() return $this->purchaseOrderNumber; } + /** + *

The Cart from which a Quote is requested.

+ * + * + * @return null|CartReference + */ + public function getCart() + { + if (is_null($this->cart)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CART); + if (is_null($data)) { + return null; + } + + $this->cart = CartReferenceModel::of($data); + } + + return $this->cart; + } + /** *

The BusinessUnit for the Quote Request.

* @@ -1241,6 +1272,14 @@ public function setPurchaseOrderNumber(?string $purchaseOrderNumber): void $this->purchaseOrderNumber = $purchaseOrderNumber; } + /** + * @param ?CartReference $cart + */ + public function setCart(?CartReference $cart): void + { + $this->cart = $cart; + } + /** * @param ?BusinessUnitKeyReference $businessUnit */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemAction.php index 23271440d7e..67e92e85c3c 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemAction.php @@ -15,6 +15,7 @@ interface ShoppingListAddLineItemAction extends ShoppingListUpdateAction { + public const FIELD_KEY = 'key'; public const FIELD_SKU = 'sku'; public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_VARIANT_ID = 'variantId'; @@ -22,6 +23,14 @@ interface ShoppingListAddLineItemAction extends ShoppingListUpdateAction public const FIELD_ADDED_AT = 'addedAt'; public const FIELD_CUSTOM = 'custom'; + /** + *

User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey(); + /** *

sku of the ProductVariant.

* @@ -70,6 +79,11 @@ public function getAddedAt(); */ public function getCustom(); + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?string $sku */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionBuilder.php index adc07d10a8e..8d4b25c0f81 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionBuilder.php @@ -23,6 +23,12 @@ */ final class ShoppingListAddLineItemActionBuilder implements Builder { + /** + + * @var ?string + */ + private $key; + /** * @var ?string @@ -59,6 +65,17 @@ final class ShoppingListAddLineItemActionBuilder implements Builder */ private $custom; + /** + *

User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

sku of the ProductVariant.

* @@ -125,6 +142,17 @@ public function getCustom() return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?string $sku * @return $this @@ -205,6 +233,7 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) public function build(): ShoppingListAddLineItemAction { return new ShoppingListAddLineItemActionModel( + $this->key, $this->sku, $this->productId, $this->variantId, diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionModel.php index 923a2b8a3e5..1f3d2f6338e 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddLineItemActionModel.php @@ -29,6 +29,12 @@ final class ShoppingListAddLineItemActionModel extends JsonObjectModel implement */ protected $action; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?string @@ -70,6 +76,7 @@ final class ShoppingListAddLineItemActionModel extends JsonObjectModel implement * @psalm-suppress MissingParamType */ public function __construct( + ?string $key = null, ?string $sku = null, ?string $productId = null, ?int $variantId = null, @@ -78,6 +85,7 @@ public function __construct( ?CustomFieldsDraft $custom = null, ?string $action = null ) { + $this->key = $key; $this->sku = $sku; $this->productId = $productId; $this->variantId = $variantId; @@ -105,6 +113,26 @@ public function getAction() return $this->action; } + /** + *

User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

sku of the ProductVariant.

* @@ -231,6 +259,14 @@ public function getCustom() } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?string $sku */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemAction.php index cb049ae8aa2..7ed1b566b47 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemAction.php @@ -17,6 +17,7 @@ interface ShoppingListAddTextLineItemAction extends ShoppingListUpdateAction { public const FIELD_NAME = 'name'; + public const FIELD_KEY = 'key'; public const FIELD_DESCRIPTION = 'description'; public const FIELD_QUANTITY = 'quantity'; public const FIELD_ADDED_AT = 'addedAt'; @@ -30,6 +31,14 @@ interface ShoppingListAddTextLineItemAction extends ShoppingListUpdateAction */ public function getName(); + /** + *

User-defined identifier of the TextLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Description of the TextLineItem.

* @@ -67,6 +76,11 @@ public function getCustom(); */ public function setName(?LocalizedString $name): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?LocalizedString $description */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionBuilder.php index 989095a5e1c..47d40d9f144 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionBuilder.php @@ -31,6 +31,12 @@ final class ShoppingListAddTextLineItemActionBuilder implements Builder */ private $name; + /** + + * @var ?string + */ + private $key; + /** * @var null|LocalizedString|LocalizedStringBuilder @@ -66,6 +72,17 @@ public function getName() return $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name; } + /** + *

User-defined identifier of the TextLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Description of the TextLineItem.

* @@ -121,6 +138,17 @@ public function withName(?LocalizedString $name) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?LocalizedString $description * @return $this @@ -202,6 +230,7 @@ public function build(): ShoppingListAddTextLineItemAction { return new ShoppingListAddTextLineItemActionModel( $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, + $this->key, $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description, $this->quantity, $this->addedAt, diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionModel.php index f0717f1364b..e7b07607b25 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListAddTextLineItemActionModel.php @@ -37,6 +37,12 @@ final class ShoppingListAddTextLineItemActionModel extends JsonObjectModel imple */ protected $name; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?LocalizedString @@ -67,6 +73,7 @@ final class ShoppingListAddTextLineItemActionModel extends JsonObjectModel imple */ public function __construct( ?LocalizedString $name = null, + ?string $key = null, ?LocalizedString $description = null, ?int $quantity = null, ?DateTimeImmutable $addedAt = null, @@ -74,6 +81,7 @@ public function __construct( ?string $action = null ) { $this->name = $name; + $this->key = $key; $this->description = $description; $this->quantity = $quantity; $this->addedAt = $addedAt; @@ -120,6 +128,26 @@ public function getName() return $this->name; } + /** + *

User-defined identifier of the TextLineItem. Must be unique per ShoppingList.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Description of the TextLineItem.

* @@ -215,6 +243,14 @@ public function setName(?LocalizedString $name): void $this->name = $name; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?LocalizedString $description */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityAction.php index 5f000f3d759..7673dcea806 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityAction.php @@ -14,16 +14,25 @@ interface ShoppingListChangeLineItemQuantityAction extends ShoppingListUpdateAction { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_QUANTITY = 'quantity'; /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getLineItemId(); + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

New value to set. If 0, the ShoppingListLineItem is removed from the ShoppingList.

* @@ -37,6 +46,11 @@ public function getQuantity(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionBuilder.php index 814ab102ba9..834c79fe0c3 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionBuilder.php @@ -26,6 +26,12 @@ final class ShoppingListChangeLineItemQuantityActionBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?int @@ -33,7 +39,7 @@ final class ShoppingListChangeLineItemQuantityActionBuilder implements Builder private $quantity; /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

New value to set. If 0, the ShoppingListLineItem is removed from the ShoppingList.

* @@ -65,6 +82,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -81,6 +109,7 @@ public function build(): ShoppingListChangeLineItemQuantityAction { return new ShoppingListChangeLineItemQuantityActionModel( $this->lineItemId, + $this->lineItemKey, $this->quantity ); } diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionModel.php index 648a4f00763..5b4249a5bfb 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeLineItemQuantityActionModel.php @@ -32,6 +32,12 @@ final class ShoppingListChangeLineItemQuantityActionModel extends JsonObjectMode */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?int @@ -44,10 +50,12 @@ final class ShoppingListChangeLineItemQuantityActionModel extends JsonObjectMode */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?int $quantity = null, ?string $action = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->quantity = $quantity; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

New value to set. If 0, the ShoppingListLineItem is removed from the ShoppingList.

* @@ -119,6 +147,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameAction.php index aa0d9a11b6e..000e619b746 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameAction.php @@ -15,16 +15,25 @@ interface ShoppingListChangeTextLineItemNameAction extends ShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_NAME = 'name'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

New value to set. Must not be empty.

* @@ -38,6 +47,11 @@ public function getName(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?LocalizedString $name */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionBuilder.php index 529a0702072..46c02f4a5fc 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionBuilder.php @@ -28,6 +28,12 @@ final class ShoppingListChangeTextLineItemNameActionBuilder implements Builder */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var null|LocalizedString|LocalizedStringBuilder @@ -35,7 +41,7 @@ final class ShoppingListChangeTextLineItemNameActionBuilder implements Builder private $name; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -45,6 +51,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

New value to set. Must not be empty.

* @@ -67,6 +84,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?LocalizedString $name * @return $this @@ -93,6 +121,7 @@ public function build(): ShoppingListChangeTextLineItemNameAction { return new ShoppingListChangeTextLineItemNameActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name ); } diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionModel.php index 2981c850aab..c9eb18feed0 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemNameActionModel.php @@ -34,6 +34,12 @@ final class ShoppingListChangeTextLineItemNameActionModel extends JsonObjectMode */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?LocalizedString @@ -46,10 +52,12 @@ final class ShoppingListChangeTextLineItemNameActionModel extends JsonObjectMode */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?LocalizedString $name = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->name = $name; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -73,7 +81,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -92,6 +100,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

New value to set. Must not be empty.

* @@ -122,6 +150,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?LocalizedString $name */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityAction.php index 0486230c8d1..41e85216a9d 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityAction.php @@ -14,16 +14,25 @@ interface ShoppingListChangeTextLineItemQuantityAction extends ShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_QUANTITY = 'quantity'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

New value to set. If 0, the TextLineItem is removed from the ShoppingList.

* @@ -37,6 +46,11 @@ public function getQuantity(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionBuilder.php index b7f02d6e21c..098aa6961ee 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionBuilder.php @@ -26,6 +26,12 @@ final class ShoppingListChangeTextLineItemQuantityActionBuilder implements Build */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var ?int @@ -33,7 +39,7 @@ final class ShoppingListChangeTextLineItemQuantityActionBuilder implements Build private $quantity; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

New value to set. If 0, the TextLineItem is removed from the ShoppingList.

* @@ -65,6 +82,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -81,6 +109,7 @@ public function build(): ShoppingListChangeTextLineItemQuantityAction { return new ShoppingListChangeTextLineItemQuantityActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->quantity ); } diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionModel.php index 19d5c3e637f..c3e8bdf9869 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListChangeTextLineItemQuantityActionModel.php @@ -32,6 +32,12 @@ final class ShoppingListChangeTextLineItemQuantityActionModel extends JsonObject */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?int @@ -44,10 +50,12 @@ final class ShoppingListChangeTextLineItemQuantityActionModel extends JsonObject */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?int $quantity = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->quantity = $quantity; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

New value to set. If 0, the TextLineItem is removed from the ShoppingList.

* @@ -119,6 +147,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php index 75873d5fccf..c543eb24ed2 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItem.php @@ -22,6 +22,7 @@ interface ShoppingListLineItem extends JsonObject public const FIELD_CUSTOM = 'custom'; public const FIELD_DEACTIVATED_AT = 'deactivatedAt'; public const FIELD_ID = 'id'; + public const FIELD_KEY = 'key'; public const FIELD_NAME = 'name'; public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_PRODUCT_TYPE = 'productType'; @@ -63,6 +64,14 @@ public function getDeactivatedAt(); */ public function getId(); + /** + *

User-defined identifier of the ShoppingListLineItem. It is unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Name of the Product.

*

This data is updated in an eventual consistent manner when the Product's name changes.

@@ -142,6 +151,11 @@ public function setDeactivatedAt(?DateTimeImmutable $deactivatedAt): void; */ public function setId(?string $id): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?LocalizedString $name */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php index bb56c87384b..7eb691f377d 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemBuilder.php @@ -53,6 +53,12 @@ final class ShoppingListLineItemBuilder implements Builder */ private $id; + /** + + * @var ?string + */ + private $key; + /** * @var null|LocalizedString|LocalizedStringBuilder @@ -140,6 +146,17 @@ public function getId() return $this->id; } + /** + *

User-defined identifier of the ShoppingListLineItem. It is unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Name of the Product.

*

This data is updated in an eventual consistent manner when the Product's name changes.

@@ -264,6 +281,17 @@ public function withId(?string $id) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?LocalizedString $name * @return $this @@ -403,6 +431,7 @@ public function build(): ShoppingListLineItem $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, $this->deactivatedAt, $this->id, + $this->key, $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, $this->productId, $this->productType instanceof ProductTypeReferenceBuilder ? $this->productType->build() : $this->productType, diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraft.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraft.php index 306391d1c74..001c248d175 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraft.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraft.php @@ -15,6 +15,7 @@ interface ShoppingListLineItemDraft extends JsonObject { + public const FIELD_KEY = 'key'; public const FIELD_PRODUCT_ID = 'productId'; public const FIELD_VARIANT_ID = 'variantId'; public const FIELD_SKU = 'sku'; @@ -22,6 +23,14 @@ interface ShoppingListLineItemDraft extends JsonObject public const FIELD_CUSTOM = 'custom'; public const FIELD_QUANTITY = 'quantity'; + /** + *

User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Unique identifier of a Product.

* @@ -70,6 +79,11 @@ public function getCustom(); */ public function getQuantity(); + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?string $productId */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftBuilder.php index eab3edc3a9e..6f1066984c5 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftBuilder.php @@ -23,6 +23,12 @@ */ final class ShoppingListLineItemDraftBuilder implements Builder { + /** + + * @var ?string + */ + private $key; + /** * @var ?string @@ -59,6 +65,17 @@ final class ShoppingListLineItemDraftBuilder implements Builder */ private $quantity; + /** + *

User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Unique identifier of a Product.

* @@ -125,6 +142,17 @@ public function getQuantity() return $this->quantity; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?string $productId * @return $this @@ -205,6 +233,7 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) public function build(): ShoppingListLineItemDraft { return new ShoppingListLineItemDraftModel( + $this->key, $this->productId, $this->variantId, $this->sku, diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftModel.php index 54fc1029572..08ec4e75da2 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemDraftModel.php @@ -22,6 +22,12 @@ */ final class ShoppingListLineItemDraftModel extends JsonObjectModel implements ShoppingListLineItemDraft { + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?string @@ -63,6 +69,7 @@ final class ShoppingListLineItemDraftModel extends JsonObjectModel implements Sh * @psalm-suppress MissingParamType */ public function __construct( + ?string $key = null, ?string $productId = null, ?int $variantId = null, ?string $sku = null, @@ -70,6 +77,7 @@ public function __construct( ?CustomFieldsDraft $custom = null, ?int $quantity = null ) { + $this->key = $key; $this->productId = $productId; $this->variantId = $variantId; $this->sku = $sku; @@ -78,6 +86,26 @@ public function __construct( $this->quantity = $quantity; } + /** + *

User-defined identifier of the ShoppingListLineItem. Must be unique per ShoppingList.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Unique identifier of a Product.

* @@ -204,6 +232,14 @@ public function getQuantity() } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?string $productId */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php index a33dd44f8a1..e177f698b62 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListLineItemModel.php @@ -52,6 +52,12 @@ final class ShoppingListLineItemModel extends JsonObjectModel implements Shoppin */ protected $id; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?LocalizedString @@ -103,6 +109,7 @@ public function __construct( ?CustomFields $custom = null, ?DateTimeImmutable $deactivatedAt = null, ?string $id = null, + ?string $key = null, ?LocalizedString $name = null, ?string $productId = null, ?ProductTypeReference $productType = null, @@ -115,6 +122,7 @@ public function __construct( $this->custom = $custom; $this->deactivatedAt = $deactivatedAt; $this->id = $id; + $this->key = $key; $this->name = $name; $this->productId = $productId; $this->productType = $productType; @@ -214,6 +222,26 @@ public function getId() return $this->id; } + /** + *

User-defined identifier of the ShoppingListLineItem. It is unique per ShoppingList.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Name of the Product.

*

This data is updated in an eventual consistent manner when the Product's name changes.

@@ -394,6 +422,14 @@ public function setId(?string $id): void $this->id = $id; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?LocalizedString $name */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemAction.php index 52c1af29f7b..e721857d5a1 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemAction.php @@ -14,16 +14,25 @@ interface ShoppingListRemoveLineItemAction extends ShoppingListUpdateAction { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_QUANTITY = 'quantity'; /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getLineItemId(); + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Amount to remove from the quantity of the ShoppingListLineItem. If not set, the ShoppingListLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the ShoppingListLineItem, the ShoppingListLineItem is removed from the ShoppingList.

* @@ -37,6 +46,11 @@ public function getQuantity(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionBuilder.php index 0e157ff3949..4c2bdc23043 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionBuilder.php @@ -26,6 +26,12 @@ final class ShoppingListRemoveLineItemActionBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?int @@ -33,7 +39,7 @@ final class ShoppingListRemoveLineItemActionBuilder implements Builder private $quantity; /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Amount to remove from the quantity of the ShoppingListLineItem. If not set, the ShoppingListLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the ShoppingListLineItem, the ShoppingListLineItem is removed from the ShoppingList.

* @@ -65,6 +82,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -81,6 +109,7 @@ public function build(): ShoppingListRemoveLineItemAction { return new ShoppingListRemoveLineItemActionModel( $this->lineItemId, + $this->lineItemKey, $this->quantity ); } diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionModel.php index 2102ca39077..d0c30fac86e 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveLineItemActionModel.php @@ -32,6 +32,12 @@ final class ShoppingListRemoveLineItemActionModel extends JsonObjectModel implem */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?int @@ -44,10 +50,12 @@ final class ShoppingListRemoveLineItemActionModel extends JsonObjectModel implem */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?int $quantity = null, ?string $action = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->quantity = $quantity; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Amount to remove from the quantity of the ShoppingListLineItem. If not set, the ShoppingListLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the ShoppingListLineItem, the ShoppingListLineItem is removed from the ShoppingList.

* @@ -119,6 +147,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemAction.php index 85dc609edd6..41a4e3e5f6b 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemAction.php @@ -14,16 +14,25 @@ interface ShoppingListRemoveTextLineItemAction extends ShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_QUANTITY = 'quantity'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

Amount to remove from the quantity of the TextLineItem. If not set, the TextLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the TextLineItem, the TextLineItem is removed from the ShoppingList.

* @@ -37,6 +46,11 @@ public function getQuantity(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionBuilder.php index 5b2a2d21c04..526d24e1a8f 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionBuilder.php @@ -26,6 +26,12 @@ final class ShoppingListRemoveTextLineItemActionBuilder implements Builder */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var ?int @@ -33,7 +39,7 @@ final class ShoppingListRemoveTextLineItemActionBuilder implements Builder private $quantity; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -43,6 +49,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

Amount to remove from the quantity of the TextLineItem. If not set, the TextLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the TextLineItem, the TextLineItem is removed from the ShoppingList.

* @@ -65,6 +82,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?int $quantity * @return $this @@ -81,6 +109,7 @@ public function build(): ShoppingListRemoveTextLineItemAction { return new ShoppingListRemoveTextLineItemActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->quantity ); } diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionModel.php index 93f06d4f619..13a1c988247 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListRemoveTextLineItemActionModel.php @@ -32,6 +32,12 @@ final class ShoppingListRemoveTextLineItemActionModel extends JsonObjectModel im */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?int @@ -44,10 +50,12 @@ final class ShoppingListRemoveTextLineItemActionModel extends JsonObjectModel im */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?int $quantity = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->quantity = $quantity; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -71,7 +79,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -90,6 +98,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

Amount to remove from the quantity of the TextLineItem. If not set, the TextLineItem is removed from the ShoppingList. If this value matches or exceeds the current quantity of the TextLineItem, the TextLineItem is removed from the ShoppingList.

* @@ -119,6 +147,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?int $quantity */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldAction.php index e11753d2320..4afbefcd183 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldAction.php @@ -14,17 +14,26 @@ interface ShoppingListSetLineItemCustomFieldAction extends ShoppingListUpdateAction { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_NAME = 'name'; public const FIELD_VALUE = 'value'; /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getLineItemId(); + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Name of the Custom Field.

* @@ -48,6 +57,11 @@ public function getValue(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionBuilder.php index a7a66fd8f33..1e0add7b5dd 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionBuilder.php @@ -26,6 +26,12 @@ final class ShoppingListSetLineItemCustomFieldActionBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var ?string @@ -39,7 +45,7 @@ final class ShoppingListSetLineItemCustomFieldActionBuilder implements Builder private $value; /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -49,6 +55,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Name of the Custom Field.

* @@ -84,6 +101,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?string $name * @return $this @@ -111,6 +139,7 @@ public function build(): ShoppingListSetLineItemCustomFieldAction { return new ShoppingListSetLineItemCustomFieldActionModel( $this->lineItemId, + $this->lineItemKey, $this->name, $this->value ); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionModel.php index 4a22f49c0fb..2241f105f0e 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomFieldActionModel.php @@ -32,6 +32,12 @@ final class ShoppingListSetLineItemCustomFieldActionModel extends JsonObjectMode */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?string @@ -50,11 +56,13 @@ final class ShoppingListSetLineItemCustomFieldActionModel extends JsonObjectMode */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?string $name = null, $value = null, ?string $action = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->name = $name; $this->value = $value; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -79,7 +87,7 @@ public function getAction() } /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -98,6 +106,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Name of the Custom Field.

* @@ -149,6 +177,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeAction.php index 1e8cee323c0..0e2e432ba04 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeAction.php @@ -16,17 +16,26 @@ interface ShoppingListSetLineItemCustomTypeAction extends ShoppingListUpdateAction { public const FIELD_LINE_ITEM_ID = 'lineItemId'; + public const FIELD_LINE_ITEM_KEY = 'lineItemKey'; public const FIELD_TYPE = 'type'; public const FIELD_FIELDS = 'fields'; /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getLineItemId(); + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey(); + /** *

Defines the Type that extends the ShoppingListLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ShoppingListLineItem.

@@ -49,6 +58,11 @@ public function getFields(); */ public function setLineItemId(?string $lineItemId): void; + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void; + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionBuilder.php index 8d533933d9a..ea6d50832bc 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionBuilder.php @@ -30,6 +30,12 @@ final class ShoppingListSetLineItemCustomTypeActionBuilder implements Builder */ private $lineItemId; + /** + + * @var ?string + */ + private $lineItemKey; + /** * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder @@ -43,7 +49,7 @@ final class ShoppingListSetLineItemCustomTypeActionBuilder implements Builder private $fields; /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -53,6 +59,17 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getLineItemKey() + { + return $this->lineItemKey; + } + /** *

Defines the Type that extends the ShoppingListLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ShoppingListLineItem.

@@ -87,6 +104,17 @@ public function withLineItemId(?string $lineItemId) return $this; } + /** + * @param ?string $lineItemKey + * @return $this + */ + public function withLineItemKey(?string $lineItemKey) + { + $this->lineItemKey = $lineItemKey; + + return $this; + } + /** * @param ?TypeResourceIdentifier $type * @return $this @@ -135,6 +163,7 @@ public function build(): ShoppingListSetLineItemCustomTypeAction { return new ShoppingListSetLineItemCustomTypeActionModel( $this->lineItemId, + $this->lineItemKey, $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields ); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionModel.php index e13ddde0935..5aaba3b6272 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetLineItemCustomTypeActionModel.php @@ -36,6 +36,12 @@ final class ShoppingListSetLineItemCustomTypeActionModel extends JsonObjectModel */ protected $lineItemId; + /** + * + * @var ?string + */ + protected $lineItemKey; + /** * * @var ?TypeResourceIdentifier @@ -54,11 +60,13 @@ final class ShoppingListSetLineItemCustomTypeActionModel extends JsonObjectModel */ public function __construct( ?string $lineItemId = null, + ?string $lineItemKey = null, ?TypeResourceIdentifier $type = null, ?FieldContainer $fields = null, ?string $action = null ) { $this->lineItemId = $lineItemId; + $this->lineItemKey = $lineItemKey; $this->type = $type; $this->fields = $fields; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -83,7 +91,7 @@ public function getAction() } /** - *

The id of the ShoppingListLineItem to update.

+ *

The id of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -102,6 +110,26 @@ public function getLineItemId() return $this->lineItemId; } + /** + *

The key of the ShoppingListLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getLineItemKey() + { + if (is_null($this->lineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->lineItemKey = (string) $data; + } + + return $this->lineItemKey; + } + /** *

Defines the Type that extends the ShoppingListLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the ShoppingListLineItem.

@@ -154,6 +182,14 @@ public function setLineItemId(?string $lineItemId): void $this->lineItemId = $lineItemId; } + /** + * @param ?string $lineItemKey + */ + public function setLineItemKey(?string $lineItemKey): void + { + $this->lineItemKey = $lineItemKey; + } + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldAction.php index 32b84944021..136c9d49768 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldAction.php @@ -14,17 +14,26 @@ interface ShoppingListSetTextLineItemCustomFieldAction extends ShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_NAME = 'name'; public const FIELD_VALUE = 'value'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

Name of the Custom Field.

* @@ -48,6 +57,11 @@ public function getValue(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionBuilder.php index 670e97a4040..d09177af60a 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionBuilder.php @@ -26,6 +26,12 @@ final class ShoppingListSetTextLineItemCustomFieldActionBuilder implements Build */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var ?string @@ -39,7 +45,7 @@ final class ShoppingListSetTextLineItemCustomFieldActionBuilder implements Build private $value; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -49,6 +55,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

Name of the Custom Field.

* @@ -84,6 +101,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?string $name * @return $this @@ -111,6 +139,7 @@ public function build(): ShoppingListSetTextLineItemCustomFieldAction { return new ShoppingListSetTextLineItemCustomFieldActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->name, $this->value ); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionModel.php index 35df7fb1a7b..2d75fe560b8 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomFieldActionModel.php @@ -32,6 +32,12 @@ final class ShoppingListSetTextLineItemCustomFieldActionModel extends JsonObject */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?string @@ -50,11 +56,13 @@ final class ShoppingListSetTextLineItemCustomFieldActionModel extends JsonObject */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?string $name = null, $value = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->name = $name; $this->value = $value; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -79,7 +87,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -98,6 +106,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

Name of the Custom Field.

* @@ -149,6 +177,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?string $name */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeAction.php index c12b04d290d..e586590065f 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeAction.php @@ -16,17 +16,26 @@ interface ShoppingListSetTextLineItemCustomTypeAction extends ShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_TYPE = 'type'; public const FIELD_FIELDS = 'fields'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

@@ -49,6 +58,11 @@ public function getFields(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionBuilder.php index 2a6c06224c0..6da84313aa8 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionBuilder.php @@ -30,6 +30,12 @@ final class ShoppingListSetTextLineItemCustomTypeActionBuilder implements Builde */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var null|TypeResourceIdentifier|TypeResourceIdentifierBuilder @@ -43,7 +49,7 @@ final class ShoppingListSetTextLineItemCustomTypeActionBuilder implements Builde private $fields; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -53,6 +59,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

@@ -87,6 +104,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?TypeResourceIdentifier $type * @return $this @@ -135,6 +163,7 @@ public function build(): ShoppingListSetTextLineItemCustomTypeAction { return new ShoppingListSetTextLineItemCustomTypeActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->type instanceof TypeResourceIdentifierBuilder ? $this->type->build() : $this->type, $this->fields instanceof FieldContainerBuilder ? $this->fields->build() : $this->fields ); diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionModel.php index a5d8c9b609a..8fe78b43296 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemCustomTypeActionModel.php @@ -36,6 +36,12 @@ final class ShoppingListSetTextLineItemCustomTypeActionModel extends JsonObjectM */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?TypeResourceIdentifier @@ -54,11 +60,13 @@ final class ShoppingListSetTextLineItemCustomTypeActionModel extends JsonObjectM */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?TypeResourceIdentifier $type = null, ?FieldContainer $fields = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->type = $type; $this->fields = $fields; $this->action = $action ?? self::DISCRIMINATOR_VALUE; @@ -83,7 +91,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -102,6 +110,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

Defines the Type that extends the TextLineItem with Custom Fields. * If absent, any existing Type and Custom Fields are removed from the TextLineItem.

@@ -154,6 +182,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?TypeResourceIdentifier $type */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionAction.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionAction.php index ba0be619c9f..d84b80bd5a5 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionAction.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionAction.php @@ -15,16 +15,25 @@ interface ShoppingListSetTextLineItemDescriptionAction extends ShoppingListUpdateAction { public const FIELD_TEXT_LINE_ITEM_ID = 'textLineItemId'; + public const FIELD_TEXT_LINE_ITEM_KEY = 'textLineItemKey'; public const FIELD_DESCRIPTION = 'description'; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string */ public function getTextLineItemId(); + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey(); + /** *

Value to set. If empty, any existing value will be removed.

* @@ -38,6 +47,11 @@ public function getDescription(); */ public function setTextLineItemId(?string $textLineItemId): void; + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void; + /** * @param ?LocalizedString $description */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionBuilder.php index f0ca66fe2e0..808e7d01410 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionBuilder.php @@ -28,6 +28,12 @@ final class ShoppingListSetTextLineItemDescriptionActionBuilder implements Build */ private $textLineItemId; + /** + + * @var ?string + */ + private $textLineItemKey; + /** * @var null|LocalizedString|LocalizedStringBuilder @@ -35,7 +41,7 @@ final class ShoppingListSetTextLineItemDescriptionActionBuilder implements Build private $description; /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * @return null|string @@ -45,6 +51,17 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + + * @return null|string + */ + public function getTextLineItemKey() + { + return $this->textLineItemKey; + } + /** *

Value to set. If empty, any existing value will be removed.

* @@ -67,6 +84,17 @@ public function withTextLineItemId(?string $textLineItemId) return $this; } + /** + * @param ?string $textLineItemKey + * @return $this + */ + public function withTextLineItemKey(?string $textLineItemKey) + { + $this->textLineItemKey = $textLineItemKey; + + return $this; + } + /** * @param ?LocalizedString $description * @return $this @@ -93,6 +121,7 @@ public function build(): ShoppingListSetTextLineItemDescriptionAction { return new ShoppingListSetTextLineItemDescriptionActionModel( $this->textLineItemId, + $this->textLineItemKey, $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description ); } diff --git a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionModel.php b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionModel.php index 35302bfed1c..a4d137d5c04 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/ShoppingListSetTextLineItemDescriptionActionModel.php @@ -34,6 +34,12 @@ final class ShoppingListSetTextLineItemDescriptionActionModel extends JsonObject */ protected $textLineItemId; + /** + * + * @var ?string + */ + protected $textLineItemKey; + /** * * @var ?LocalizedString @@ -46,10 +52,12 @@ final class ShoppingListSetTextLineItemDescriptionActionModel extends JsonObject */ public function __construct( ?string $textLineItemId = null, + ?string $textLineItemKey = null, ?LocalizedString $description = null, ?string $action = null ) { $this->textLineItemId = $textLineItemId; + $this->textLineItemKey = $textLineItemKey; $this->description = $description; $this->action = $action ?? self::DISCRIMINATOR_VALUE; } @@ -73,7 +81,7 @@ public function getAction() } /** - *

The id of the TextLineItem to update.

+ *

The id of the TextLineItem to update. Either lineItemId or lineItemKey is required.

* * * @return null|string @@ -92,6 +100,26 @@ public function getTextLineItemId() return $this->textLineItemId; } + /** + *

The key of the TextLineItem to update. Either lineItemId or lineItemKey is required.

+ * + * + * @return null|string + */ + public function getTextLineItemKey() + { + if (is_null($this->textLineItemKey)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_TEXT_LINE_ITEM_KEY); + if (is_null($data)) { + return null; + } + $this->textLineItemKey = (string) $data; + } + + return $this->textLineItemKey; + } + /** *

Value to set. If empty, any existing value will be removed.

* @@ -122,6 +150,14 @@ public function setTextLineItemId(?string $textLineItemId): void $this->textLineItemId = $textLineItemId; } + /** + * @param ?string $textLineItemKey + */ + public function setTextLineItemKey(?string $textLineItemKey): void + { + $this->textLineItemKey = $textLineItemKey; + } + /** * @param ?LocalizedString $description */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItem.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItem.php index 0390247cd42..7a71e6a9e1f 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItem.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItem.php @@ -20,6 +20,7 @@ interface TextLineItem extends JsonObject public const FIELD_CUSTOM = 'custom'; public const FIELD_DESCRIPTION = 'description'; public const FIELD_ID = 'id'; + public const FIELD_KEY = 'key'; public const FIELD_NAME = 'name'; public const FIELD_QUANTITY = 'quantity'; @@ -55,6 +56,14 @@ public function getDescription(); */ public function getId(); + /** + *

User-defined identifier of the TextLineItem. It is unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Name of the TextLineItem.

* @@ -91,6 +100,11 @@ public function setDescription(?LocalizedString $description): void; */ public function setId(?string $id): void; + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?LocalizedString $name */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemBuilder.php index ded427948c8..3ee00f16ac1 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemBuilder.php @@ -49,6 +49,12 @@ final class TextLineItemBuilder implements Builder */ private $id; + /** + + * @var ?string + */ + private $key; + /** * @var null|LocalizedString|LocalizedStringBuilder @@ -105,6 +111,17 @@ public function getId() return $this->id; } + /** + *

User-defined identifier of the TextLineItem. It is unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Name of the TextLineItem.

* @@ -171,6 +188,17 @@ public function withId(?string $id) return $this; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?LocalizedString $name * @return $this @@ -233,6 +261,7 @@ public function build(): TextLineItem $this->custom instanceof CustomFieldsBuilder ? $this->custom->build() : $this->custom, $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description, $this->id, + $this->key, $this->name instanceof LocalizedStringBuilder ? $this->name->build() : $this->name, $this->quantity ); diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraft.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraft.php index f4817b0d61d..71efde60003 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraft.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraft.php @@ -16,12 +16,21 @@ interface TextLineItemDraft extends JsonObject { + public const FIELD_KEY = 'key'; public const FIELD_ADDED_AT = 'addedAt'; public const FIELD_CUSTOM = 'custom'; public const FIELD_DESCRIPTION = 'description'; public const FIELD_NAME = 'name'; public const FIELD_QUANTITY = 'quantity'; + /** + *

User-defined unique identifier of the TextLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey(); + /** *

Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.

* @@ -62,6 +71,11 @@ public function getName(); */ public function getQuantity(); + /** + * @param ?string $key + */ + public function setKey(?string $key): void; + /** * @param ?DateTimeImmutable $addedAt */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftBuilder.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftBuilder.php index d3ce18af5e8..32bfc097f63 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftBuilder.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftBuilder.php @@ -25,6 +25,12 @@ */ final class TextLineItemDraftBuilder implements Builder { + /** + + * @var ?string + */ + private $key; + /** * @var ?DateTimeImmutable @@ -55,6 +61,17 @@ final class TextLineItemDraftBuilder implements Builder */ private $quantity; + /** + *

User-defined unique identifier of the TextLineItem. Must be unique per ShoppingList.

+ * + + * @return null|string + */ + public function getKey() + { + return $this->key; + } + /** *

Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.

* @@ -110,6 +127,17 @@ public function getQuantity() return $this->quantity; } + /** + * @param ?string $key + * @return $this + */ + public function withKey(?string $key) + { + $this->key = $key; + + return $this; + } + /** * @param ?DateTimeImmutable $addedAt * @return $this @@ -201,6 +229,7 @@ public function withNameBuilder(?LocalizedStringBuilder $name) public function build(): TextLineItemDraft { return new TextLineItemDraftModel( + $this->key, $this->addedAt, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, $this->description instanceof LocalizedStringBuilder ? $this->description->build() : $this->description, diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftModel.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftModel.php index 72d75028d0d..0be813c4c78 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemDraftModel.php @@ -24,6 +24,12 @@ */ final class TextLineItemDraftModel extends JsonObjectModel implements TextLineItemDraft { + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?DateTimeImmutable @@ -59,12 +65,14 @@ final class TextLineItemDraftModel extends JsonObjectModel implements TextLineIt * @psalm-suppress MissingParamType */ public function __construct( + ?string $key = null, ?DateTimeImmutable $addedAt = null, ?CustomFieldsDraft $custom = null, ?LocalizedString $description = null, ?LocalizedString $name = null, ?int $quantity = null ) { + $this->key = $key; $this->addedAt = $addedAt; $this->custom = $custom; $this->description = $description; @@ -72,6 +80,26 @@ public function __construct( $this->quantity = $quantity; } + /** + *

User-defined unique identifier of the TextLineItem. Must be unique per ShoppingList.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Date and time the TextLineItem is added to the ShoppingList. If not set, the current date and time (UTC) is used.

* @@ -180,6 +208,14 @@ public function getQuantity() } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?DateTimeImmutable $addedAt */ diff --git a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemModel.php b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemModel.php index e145c6e08ec..47d4ae1dbb0 100644 --- a/lib/commercetools-api/src/Models/ShoppingList/TextLineItemModel.php +++ b/lib/commercetools-api/src/Models/ShoppingList/TextLineItemModel.php @@ -48,6 +48,12 @@ final class TextLineItemModel extends JsonObjectModel implements TextLineItem */ protected $id; + /** + * + * @var ?string + */ + protected $key; + /** * * @var ?LocalizedString @@ -69,6 +75,7 @@ public function __construct( ?CustomFields $custom = null, ?LocalizedString $description = null, ?string $id = null, + ?string $key = null, ?LocalizedString $name = null, ?int $quantity = null ) { @@ -76,6 +83,7 @@ public function __construct( $this->custom = $custom; $this->description = $description; $this->id = $id; + $this->key = $key; $this->name = $name; $this->quantity = $quantity; } @@ -166,6 +174,26 @@ public function getId() return $this->id; } + /** + *

User-defined identifier of the TextLineItem. It is unique per ShoppingList.

+ * + * + * @return null|string + */ + public function getKey() + { + if (is_null($this->key)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_KEY); + if (is_null($data)) { + return null; + } + $this->key = (string) $data; + } + + return $this->key; + } + /** *

Name of the TextLineItem.

* @@ -240,6 +268,14 @@ public function setId(?string $id): void $this->id = $id; } + /** + * @param ?string $key + */ + public function setKey(?string $key): void + { + $this->key = $key; + } + /** * @param ?LocalizedString $name */ diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraft.php b/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraft.php new file mode 100644 index 00000000000..f7eac1dcdbe --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraft.php @@ -0,0 +1,31 @@ +Money value for the StagedPriceDraft.

+ * + + * @return null|TypedMoneyDraft + */ + public function getValue(); + + /** + * @param ?TypedMoneyDraft $value + */ + public function setValue(?TypedMoneyDraft $value): void; +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftBuilder.php new file mode 100644 index 00000000000..c262ec69046 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftBuilder.php @@ -0,0 +1,75 @@ + + */ +final class StagedPriceDraftBuilder implements Builder +{ + /** + + * @var null|TypedMoneyDraft|TypedMoneyDraftBuilder + */ + private $value; + + /** + *

Money value for the StagedPriceDraft.

+ * + + * @return null|TypedMoneyDraft + */ + public function getValue() + { + return $this->value instanceof TypedMoneyDraftBuilder ? $this->value->build() : $this->value; + } + + /** + * @param ?TypedMoneyDraft $value + * @return $this + */ + public function withValue(?TypedMoneyDraft $value) + { + $this->value = $value; + + return $this; + } + + /** + * @deprecated use withValue() instead + * @return $this + */ + public function withValueBuilder(?TypedMoneyDraftBuilder $value) + { + $this->value = $value; + + return $this; + } + + public function build(): StagedPriceDraft + { + return new StagedPriceDraftModel( + $this->value instanceof TypedMoneyDraftBuilder ? $this->value->build() : $this->value + ); + } + + public static function of(): StagedPriceDraftBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftCollection.php b/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftCollection.php new file mode 100644 index 00000000000..53de8b67bf7 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftCollection.php @@ -0,0 +1,56 @@ + + * @method StagedPriceDraft current() + * @method StagedPriceDraft end() + * @method StagedPriceDraft at($offset) + */ +class StagedPriceDraftCollection extends MapperSequence +{ + /** + * @psalm-assert StagedPriceDraft $value + * @psalm-param StagedPriceDraft|stdClass $value + * @throws InvalidArgumentException + * + * @return StagedPriceDraftCollection + */ + public function add($value) + { + if (!$value instanceof StagedPriceDraft) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StagedPriceDraft + */ + protected function mapper() + { + return function (?int $index): ?StagedPriceDraft { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StagedPriceDraft $data */ + $data = StagedPriceDraftModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftModel.php new file mode 100644 index 00000000000..60386db5c0c --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StagedPriceDraftModel.php @@ -0,0 +1,69 @@ +value = $value; + } + + /** + *

Money value for the StagedPriceDraft.

+ * + * + * @return null|TypedMoneyDraft + */ + public function getValue() + { + if (is_null($this->value)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_VALUE); + if (is_null($data)) { + return null; + } + $className = TypedMoneyDraftModel::resolveDiscriminatorClass($data); + $this->value = $className::of($data); + } + + return $this->value; + } + + + /** + * @param ?TypedMoneyDraft $value + */ + public function setValue(?TypedMoneyDraft $value): void + { + $this->value = $value; + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraft.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraft.php index a29a01221ab..e87d2cda91e 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraft.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraft.php @@ -31,6 +31,7 @@ interface StandalonePriceDraft extends JsonObject public const FIELD_TIERS = 'tiers'; public const FIELD_DISCOUNTED = 'discounted'; public const FIELD_CUSTOM = 'custom'; + public const FIELD_STAGED = 'staged'; public const FIELD_ACTIVE = 'active'; /** @@ -122,6 +123,14 @@ public function getDiscounted(); */ public function getCustom(); + /** + *

Staged changes for the StandalonePrice.

+ * + + * @return null|StagedPriceDraft + */ + public function getStaged(); + /** *

Set to false, if the StandalonePrice should not be considered during price selection.

* @@ -185,6 +194,11 @@ public function setDiscounted(?DiscountedPriceDraft $discounted): void; */ public function setCustom(?CustomFieldsDraft $custom): void; + /** + * @param ?StagedPriceDraft $staged + */ + public function setStaged(?StagedPriceDraft $staged): void; + /** * @param ?bool $active */ diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftBuilder.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftBuilder.php index 71ca3d00959..e35ef4556ae 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftBuilder.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftBuilder.php @@ -98,6 +98,12 @@ final class StandalonePriceDraftBuilder implements Builder */ private $custom; + /** + + * @var null|StagedPriceDraft|StagedPriceDraftBuilder + */ + private $staged; + /** * @var ?bool @@ -226,6 +232,17 @@ public function getCustom() return $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom; } + /** + *

Staged changes for the StandalonePrice.

+ * + + * @return null|StagedPriceDraft + */ + public function getStaged() + { + return $this->staged instanceof StagedPriceDraftBuilder ? $this->staged->build() : $this->staged; + } + /** *

Set to false, if the StandalonePrice should not be considered during price selection.

* @@ -358,6 +375,17 @@ public function withCustom(?CustomFieldsDraft $custom) return $this; } + /** + * @param ?StagedPriceDraft $staged + * @return $this + */ + public function withStaged(?StagedPriceDraft $staged) + { + $this->staged = $staged; + + return $this; + } + /** * @param ?bool $active * @return $this @@ -424,6 +452,17 @@ public function withCustomBuilder(?CustomFieldsDraftBuilder $custom) return $this; } + /** + * @deprecated use withStaged() instead + * @return $this + */ + public function withStagedBuilder(?StagedPriceDraftBuilder $staged) + { + $this->staged = $staged; + + return $this; + } + public function build(): StandalonePriceDraft { return new StandalonePriceDraftModel( @@ -438,6 +477,7 @@ public function build(): StandalonePriceDraft $this->tiers, $this->discounted instanceof DiscountedPriceDraftBuilder ? $this->discounted->build() : $this->discounted, $this->custom instanceof CustomFieldsDraftBuilder ? $this->custom->build() : $this->custom, + $this->staged instanceof StagedPriceDraftBuilder ? $this->staged->build() : $this->staged, $this->active ); } diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftModel.php index 7cd7ec9e563..d007ea0cec8 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceDraftModel.php @@ -97,6 +97,12 @@ final class StandalonePriceDraftModel extends JsonObjectModel implements Standal */ protected $custom; + /** + * + * @var ?StagedPriceDraft + */ + protected $staged; + /** * * @var ?bool @@ -119,6 +125,7 @@ public function __construct( ?PriceTierDraftCollection $tiers = null, ?DiscountedPriceDraft $discounted = null, ?CustomFieldsDraft $custom = null, + ?StagedPriceDraft $staged = null, ?bool $active = null ) { $this->key = $key; @@ -132,6 +139,7 @@ public function __construct( $this->tiers = $tiers; $this->discounted = $discounted; $this->custom = $custom; + $this->staged = $staged; $this->active = $active; } @@ -369,6 +377,27 @@ public function getCustom() return $this->custom; } + /** + *

Staged changes for the StandalonePrice.

+ * + * + * @return null|StagedPriceDraft + */ + public function getStaged() + { + if (is_null($this->staged)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_STAGED); + if (is_null($data)) { + return null; + } + + $this->staged = StagedPriceDraftModel::of($data); + } + + return $this->staged; + } + /** *

Set to false, if the StandalonePrice should not be considered during price selection.

* @@ -478,6 +507,14 @@ public function setCustom(?CustomFieldsDraft $custom): void $this->custom = $custom; } + /** + * @param ?StagedPriceDraft $staged + */ + public function setStaged(?StagedPriceDraft $staged): void + { + $this->staged = $staged; + } + /** * @param ?bool $active */ diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesAction.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesAction.php new file mode 100644 index 00000000000..54ebc9538fb --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesAction.php @@ -0,0 +1,16 @@ + + */ +final class StandalonePriceRemoveStagedChangesActionBuilder implements Builder +{ + public function build(): StandalonePriceRemoveStagedChangesAction + { + return new StandalonePriceRemoveStagedChangesActionModel( + ); + } + + public static function of(): StandalonePriceRemoveStagedChangesActionBuilder + { + return new self(); + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesActionCollection.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesActionCollection.php new file mode 100644 index 00000000000..2b69363e455 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesActionCollection.php @@ -0,0 +1,56 @@ + + * @method StandalonePriceRemoveStagedChangesAction current() + * @method StandalonePriceRemoveStagedChangesAction end() + * @method StandalonePriceRemoveStagedChangesAction at($offset) + */ +class StandalonePriceRemoveStagedChangesActionCollection extends StandalonePriceUpdateActionCollection +{ + /** + * @psalm-assert StandalonePriceRemoveStagedChangesAction $value + * @psalm-param StandalonePriceRemoveStagedChangesAction|stdClass $value + * @throws InvalidArgumentException + * + * @return StandalonePriceRemoveStagedChangesActionCollection + */ + public function add($value) + { + if (!$value instanceof StandalonePriceRemoveStagedChangesAction) { + throw new InvalidArgumentException(); + } + $this->store($value); + + return $this; + } + + /** + * @psalm-return callable(int):?StandalonePriceRemoveStagedChangesAction + */ + protected function mapper() + { + return function (?int $index): ?StandalonePriceRemoveStagedChangesAction { + $data = $this->get($index); + if ($data instanceof stdClass) { + /** @var StandalonePriceRemoveStagedChangesAction $data */ + $data = StandalonePriceRemoveStagedChangesActionModel::of($data); + $this->set($data, $index); + } + + return $data; + }; + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesActionModel.php new file mode 100644 index 00000000000..c7e821572c7 --- /dev/null +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceRemoveStagedChangesActionModel.php @@ -0,0 +1,56 @@ +action = $action ?? self::DISCRIMINATOR_VALUE; + } + + /** + * + * @return null|string + */ + public function getAction() + { + if (is_null($this->action)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_ACTION); + if (is_null($data)) { + return null; + } + $this->action = (string) $data; + } + + return $this->action; + } +} diff --git a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php index 8b0db41de5c..43d74293534 100644 --- a/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php +++ b/lib/commercetools-api/src/Models/StandalonePrice/StandalonePriceUpdateActionModel.php @@ -36,6 +36,7 @@ final class StandalonePriceUpdateActionModel extends JsonObjectModel implements 'changeActive' => StandalonePriceChangeActiveActionModel::class, 'changeValue' => StandalonePriceChangeValueActionModel::class, 'removePriceTier' => StandalonePriceRemovePriceTierActionModel::class, + 'removeStagedChanges' => StandalonePriceRemoveStagedChangesActionModel::class, 'setCustomField' => StandalonePriceSetCustomFieldActionModel::class, 'setCustomType' => StandalonePriceSetCustomTypeActionModel::class, 'setDiscountedPrice' => StandalonePriceSetDiscountedPriceActionModel::class, diff --git a/lib/commercetools-base/src/Base/MapperFactory.php b/lib/commercetools-base/src/Base/MapperFactory.php index 7b39371ae02..150dfdf1513 100644 --- a/lib/commercetools-base/src/Base/MapperFactory.php +++ b/lib/commercetools-base/src/Base/MapperFactory.php @@ -24,13 +24,13 @@ class MapperFactory public static function stringMapper() { return - /** @psalm-param ?mixed $data */ - function ($data): ?string { - if (is_null($data)) { - return null; - } - return (string)$data; - }; + /** @psalm-param ?mixed $data */ + function ($data): ?string { + if (is_null($data)) { + return null; + } + return (string)$data; + }; } /** @@ -39,13 +39,13 @@ function ($data): ?string { public static function numberMapper() { return - /** @psalm-param ?mixed $data */ - function ($data): ?float { - if (is_null($data)) { - return null; - } - return (float)$data; - }; + /** @psalm-param ?mixed $data */ + function ($data): ?float { + if (is_null($data)) { + return null; + } + return (float)$data; + }; } /** @@ -54,13 +54,13 @@ function ($data): ?float { public static function integerMapper() { return - /** @psalm-param ?mixed $data */ - function ($data): ?int { - if (is_null($data)) { - return null; - } - return (int)$data; - }; + /** @psalm-param ?mixed $data */ + function ($data): ?int { + if (is_null($data)) { + return null; + } + return (int)$data; + }; } /** @@ -69,16 +69,16 @@ function ($data): ?int { public static function dateTimeMapper(string $format = self::DATETIME_FORMAT) { return - /** @psalm-param ?string $data */ - function ($data) use ($format): ?DateTimeImmutable { - if (is_null($data)) { - return null; - } - $date = DateTimeImmutable::createFromFormat($format, $data); - if ($date === false) { - return null; - } - return $date; - }; + /** @psalm-param ?string $data */ + function ($data) use ($format): ?DateTimeImmutable { + if (is_null($data)) { + return null; + } + $date = DateTimeImmutable::createFromFormat($format, $data); + if ($date === false) { + return null; + } + return $date; + }; } } diff --git a/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyByResourceTypeByIDTest.php b/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyByResourceTypeByIDTest.php index 4b4237e8d02..476fdeb085b 100644 --- a/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyByResourceTypeByIDTest.php +++ b/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyByResourceTypeByIDTest.php @@ -150,77 +150,89 @@ function (HistoryRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/test_resourceType/test_ID?userId=userId', ], - 'ByProjectKeyByResourceTypeByIDGet_withType' => [ + 'ByProjectKeyByResourceTypeByIDGet_withClientId' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder ->withProjectKeyValue('test_projectKey') ->withResourceTypeValue('test_resourceType') ->withIDValue('test_ID') ->get() - ->withType('type'); + ->withClientId('clientId'); }, 'get', - 'test_projectKey/test_resourceType/test_ID?type=type', + 'test_projectKey/test_resourceType/test_ID?clientId=clientId', ], - 'ByProjectKeyByResourceTypeByIDGet_withClientId' => [ + 'ByProjectKeyByResourceTypeByIDGet_withCustomerId' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder ->withProjectKeyValue('test_projectKey') ->withResourceTypeValue('test_resourceType') ->withIDValue('test_ID') ->get() - ->withClientId('clientId'); + ->withCustomerId('customerId'); }, 'get', - 'test_projectKey/test_resourceType/test_ID?clientId=clientId', + 'test_projectKey/test_resourceType/test_ID?customerId=customerId', ], - 'ByProjectKeyByResourceTypeByIDGet_withSource' => [ + 'ByProjectKeyByResourceTypeByIDGet_withAssociateId' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder ->withProjectKeyValue('test_projectKey') ->withResourceTypeValue('test_resourceType') ->withIDValue('test_ID') ->get() - ->withSource('source'); + ->withAssociateId('associateId'); }, 'get', - 'test_projectKey/test_resourceType/test_ID?source=source', + 'test_projectKey/test_resourceType/test_ID?associateId=associateId', ], - 'ByProjectKeyByResourceTypeByIDGet_withChanges' => [ + 'ByProjectKeyByResourceTypeByIDGet_withType' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder ->withProjectKeyValue('test_projectKey') ->withResourceTypeValue('test_resourceType') ->withIDValue('test_ID') ->get() - ->withChanges('changes'); + ->withType('type'); }, 'get', - 'test_projectKey/test_resourceType/test_ID?changes=changes', + 'test_projectKey/test_resourceType/test_ID?type=type', ], - 'ByProjectKeyByResourceTypeByIDGet_withStores' => [ + 'ByProjectKeyByResourceTypeByIDGet_withSource' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder ->withProjectKeyValue('test_projectKey') ->withResourceTypeValue('test_resourceType') ->withIDValue('test_ID') ->get() - ->withStores('stores'); + ->withSource('source'); }, 'get', - 'test_projectKey/test_resourceType/test_ID?stores=stores', + 'test_projectKey/test_resourceType/test_ID?source=source', ], - 'ByProjectKeyByResourceTypeByIDGet_withCustomerId' => [ + 'ByProjectKeyByResourceTypeByIDGet_withChanges' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder ->withProjectKeyValue('test_projectKey') ->withResourceTypeValue('test_resourceType') ->withIDValue('test_ID') ->get() - ->withCustomerId('customerId'); + ->withChanges('changes'); }, 'get', - 'test_projectKey/test_resourceType/test_ID?customerId=customerId', + 'test_projectKey/test_resourceType/test_ID?changes=changes', + ], + 'ByProjectKeyByResourceTypeByIDGet_withStores' => [ + function (HistoryRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->withResourceTypeValue('test_resourceType') + ->withIDValue('test_ID') + ->get() + ->withStores('stores'); + }, + 'get', + 'test_projectKey/test_resourceType/test_ID?stores=stores', ], 'ByProjectKeyByResourceTypeByIDGet_withExcludePlatformInitiatedChanges' => [ function (HistoryRequestBuilder $builder): RequestInterface { diff --git a/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyByResourceTypeTest.php b/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyByResourceTypeTest.php index cf4356c1017..de9798da4b3 100644 --- a/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyByResourceTypeTest.php +++ b/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyByResourceTypeTest.php @@ -155,27 +155,49 @@ function (HistoryRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/test_resourceType?userId=userId', ], - 'ByProjectKeyByResourceTypeGet_withType' => [ + 'ByProjectKeyByResourceTypeGet_withClientId' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder ->withProjectKeyValue('test_projectKey') ->withResourceTypeValue('test_resourceType') ->get() - ->withType('type'); + ->withClientId('clientId'); }, 'get', - 'test_projectKey/test_resourceType?type=type', + 'test_projectKey/test_resourceType?clientId=clientId', ], - 'ByProjectKeyByResourceTypeGet_withClientId' => [ + 'ByProjectKeyByResourceTypeGet_withCustomerId' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder ->withProjectKeyValue('test_projectKey') ->withResourceTypeValue('test_resourceType') ->get() - ->withClientId('clientId'); + ->withCustomerId('customerId'); }, 'get', - 'test_projectKey/test_resourceType?clientId=clientId', + 'test_projectKey/test_resourceType?customerId=customerId', + ], + 'ByProjectKeyByResourceTypeGet_withAssociateId' => [ + function (HistoryRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->withResourceTypeValue('test_resourceType') + ->get() + ->withAssociateId('associateId'); + }, + 'get', + 'test_projectKey/test_resourceType?associateId=associateId', + ], + 'ByProjectKeyByResourceTypeGet_withType' => [ + function (HistoryRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->withResourceTypeValue('test_resourceType') + ->get() + ->withType('type'); + }, + 'get', + 'test_projectKey/test_resourceType?type=type', ], 'ByProjectKeyByResourceTypeGet_withResourceKey' => [ function (HistoryRequestBuilder $builder): RequestInterface { @@ -221,17 +243,6 @@ function (HistoryRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey/test_resourceType?stores=stores', ], - 'ByProjectKeyByResourceTypeGet_withCustomerId' => [ - function (HistoryRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKeyValue('test_projectKey') - ->withResourceTypeValue('test_resourceType') - ->get() - ->withCustomerId('customerId'); - }, - 'get', - 'test_projectKey/test_resourceType?customerId=customerId', - ], 'ByProjectKeyByResourceTypeGet_withExcludePlatformInitiatedChanges' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php b/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php index c70cd552873..680aa856a5f 100644 --- a/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php +++ b/lib/commercetools-history-tests/test/unit/Client/Resource/ResourceByProjectKeyTest.php @@ -160,25 +160,45 @@ function (HistoryRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey?userId=userId', ], - 'ByProjectKeyGet_withType' => [ + 'ByProjectKeyGet_withClientId' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder ->withProjectKeyValue('test_projectKey') ->get() - ->withType('type'); + ->withClientId('clientId'); }, 'get', - 'test_projectKey?type=type', + 'test_projectKey?clientId=clientId', ], - 'ByProjectKeyGet_withClientId' => [ + 'ByProjectKeyGet_withCustomerId' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder ->withProjectKeyValue('test_projectKey') ->get() - ->withClientId('clientId'); + ->withCustomerId('customerId'); }, 'get', - 'test_projectKey?clientId=clientId', + 'test_projectKey?customerId=customerId', + ], + 'ByProjectKeyGet_withAssociateId' => [ + function (HistoryRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->get() + ->withAssociateId('associateId'); + }, + 'get', + 'test_projectKey?associateId=associateId', + ], + 'ByProjectKeyGet_withType' => [ + function (HistoryRequestBuilder $builder): RequestInterface { + return $builder + ->withProjectKeyValue('test_projectKey') + ->get() + ->withType('type'); + }, + 'get', + 'test_projectKey?type=type', ], 'ByProjectKeyGet_withResourceId' => [ function (HistoryRequestBuilder $builder): RequestInterface { @@ -230,16 +250,6 @@ function (HistoryRequestBuilder $builder): RequestInterface { 'get', 'test_projectKey?stores=stores', ], - 'ByProjectKeyGet_withCustomerId' => [ - function (HistoryRequestBuilder $builder): RequestInterface { - return $builder - ->withProjectKeyValue('test_projectKey') - ->get() - ->withCustomerId('customerId'); - }, - 'get', - 'test_projectKey?customerId=customerId', - ], 'ByProjectKeyGet_withExcludePlatformInitiatedChanges' => [ function (HistoryRequestBuilder $builder): RequestInterface { return $builder diff --git a/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeByIDGet.php b/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeByIDGet.php index 3ac287b4511..cc8f00dd110 100644 --- a/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeByIDGet.php +++ b/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeByIDGet.php @@ -185,20 +185,38 @@ public function withUserId($userId): ByProjectKeyByResourceTypeByIDGet /** * - * @psalm-param scalar|scalar[] $type + * @psalm-param scalar|scalar[] $clientId */ - public function withType($type): ByProjectKeyByResourceTypeByIDGet + public function withClientId($clientId): ByProjectKeyByResourceTypeByIDGet { - return $this->withQueryParam('type', $type); + return $this->withQueryParam('clientId', $clientId); } /** * - * @psalm-param scalar|scalar[] $clientId + * @psalm-param scalar|scalar[] $customerId */ - public function withClientId($clientId): ByProjectKeyByResourceTypeByIDGet + public function withCustomerId($customerId): ByProjectKeyByResourceTypeByIDGet { - return $this->withQueryParam('clientId', $clientId); + return $this->withQueryParam('customerId', $customerId); + } + + /** + * + * @psalm-param scalar|scalar[] $associateId + */ + public function withAssociateId($associateId): ByProjectKeyByResourceTypeByIDGet + { + return $this->withQueryParam('associateId', $associateId); + } + + /** + * + * @psalm-param scalar|scalar[] $type + */ + public function withType($type): ByProjectKeyByResourceTypeByIDGet + { + return $this->withQueryParam('type', $type); } /** @@ -228,15 +246,6 @@ public function withStores($stores): ByProjectKeyByResourceTypeByIDGet return $this->withQueryParam('stores', $stores); } - /** - * - * @psalm-param scalar|scalar[] $customerId - */ - public function withCustomerId($customerId): ByProjectKeyByResourceTypeByIDGet - { - return $this->withQueryParam('customerId', $customerId); - } - /** * * @psalm-param scalar|scalar[] $excludePlatformInitiatedChanges diff --git a/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeGet.php b/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeGet.php index cacb20a3a85..42016c7cee8 100644 --- a/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeGet.php +++ b/lib/commercetools-history/src/Client/Resource/ByProjectKeyByResourceTypeGet.php @@ -185,20 +185,38 @@ public function withUserId($userId): ByProjectKeyByResourceTypeGet /** * - * @psalm-param scalar|scalar[] $type + * @psalm-param scalar|scalar[] $clientId */ - public function withType($type): ByProjectKeyByResourceTypeGet + public function withClientId($clientId): ByProjectKeyByResourceTypeGet { - return $this->withQueryParam('type', $type); + return $this->withQueryParam('clientId', $clientId); } /** * - * @psalm-param scalar|scalar[] $clientId + * @psalm-param scalar|scalar[] $customerId */ - public function withClientId($clientId): ByProjectKeyByResourceTypeGet + public function withCustomerId($customerId): ByProjectKeyByResourceTypeGet { - return $this->withQueryParam('clientId', $clientId); + return $this->withQueryParam('customerId', $customerId); + } + + /** + * + * @psalm-param scalar|scalar[] $associateId + */ + public function withAssociateId($associateId): ByProjectKeyByResourceTypeGet + { + return $this->withQueryParam('associateId', $associateId); + } + + /** + * + * @psalm-param scalar|scalar[] $type + */ + public function withType($type): ByProjectKeyByResourceTypeGet + { + return $this->withQueryParam('type', $type); } /** @@ -237,15 +255,6 @@ public function withStores($stores): ByProjectKeyByResourceTypeGet return $this->withQueryParam('stores', $stores); } - /** - * - * @psalm-param scalar|scalar[] $customerId - */ - public function withCustomerId($customerId): ByProjectKeyByResourceTypeGet - { - return $this->withQueryParam('customerId', $customerId); - } - /** * * @psalm-param scalar|scalar[] $excludePlatformInitiatedChanges diff --git a/lib/commercetools-history/src/Client/Resource/ByProjectKeyGet.php b/lib/commercetools-history/src/Client/Resource/ByProjectKeyGet.php index 8cbd44410f1..916decaf2ff 100644 --- a/lib/commercetools-history/src/Client/Resource/ByProjectKeyGet.php +++ b/lib/commercetools-history/src/Client/Resource/ByProjectKeyGet.php @@ -194,20 +194,38 @@ public function withUserId($userId): ByProjectKeyGet /** * - * @psalm-param scalar|scalar[] $type + * @psalm-param scalar|scalar[] $clientId */ - public function withType($type): ByProjectKeyGet + public function withClientId($clientId): ByProjectKeyGet { - return $this->withQueryParam('type', $type); + return $this->withQueryParam('clientId', $clientId); } /** * - * @psalm-param scalar|scalar[] $clientId + * @psalm-param scalar|scalar[] $customerId */ - public function withClientId($clientId): ByProjectKeyGet + public function withCustomerId($customerId): ByProjectKeyGet { - return $this->withQueryParam('clientId', $clientId); + return $this->withQueryParam('customerId', $customerId); + } + + /** + * + * @psalm-param scalar|scalar[] $associateId + */ + public function withAssociateId($associateId): ByProjectKeyGet + { + return $this->withQueryParam('associateId', $associateId); + } + + /** + * + * @psalm-param scalar|scalar[] $type + */ + public function withType($type): ByProjectKeyGet + { + return $this->withQueryParam('type', $type); } /** @@ -255,15 +273,6 @@ public function withStores($stores): ByProjectKeyGet return $this->withQueryParam('stores', $stores); } - /** - * - * @psalm-param scalar|scalar[] $customerId - */ - public function withCustomerId($customerId): ByProjectKeyGet - { - return $this->withQueryParam('customerId', $customerId); - } - /** * * @psalm-param scalar|scalar[] $excludePlatformInitiatedChanges diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedBy.php b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedBy.php index 78e0e531b5f..ae7c05a019a 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedBy.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedBy.php @@ -17,9 +17,10 @@ interface ModifiedBy extends JsonObject public const FIELD_ID = 'id'; public const FIELD_TYPE = 'type'; - public const FIELD_CUSTOMER = 'customer'; - public const FIELD_ANONYMOUS_ID = 'anonymousId'; public const FIELD_CLIENT_ID = 'clientId'; + public const FIELD_ANONYMOUS_ID = 'anonymousId'; + public const FIELD_CUSTOMER = 'customer'; + public const FIELD_ASSOCIATE = 'associate'; public const FIELD_IS_PLATFORM_CLIENT = 'isPlatformClient'; /** @@ -36,6 +37,7 @@ public function getId(); *
    *
  • If the change was made by a user, the value is "user".
  • *
  • If the change was made by an API Client with or without an external user ID, the value is "external-user".
  • + *
  • If the change was made by an Associate, the value is "associate".
  • *
* @@ -44,13 +46,13 @@ public function getId(); public function getType(); /** - *

Reference to the Customer who made the change.

- *

Present only if the change was made using a token from the password flow.

+ *

ID of the API Client that made the change.

+ *

Present only if the change was made using an API Client.

* - * @return null|Reference + * @return null|string */ - public function getCustomer(); + public function getClientId(); /** *

Present only if the change was made using a token from an anonymous session.

@@ -61,13 +63,21 @@ public function getCustomer(); public function getAnonymousId(); /** - *

ID of the API Client that made the change.

- *

Present only if the change was made using an API Client.

+ *

The Customer who made the change.

+ *

Present only if the change was made using a token from the password flow.

* - * @return null|string + * @return null|Reference */ - public function getClientId(); + public function getCustomer(); + + /** + *

The Associate who made the change in the context of a Business Unit. Present only if the Associate acts on behalf of a company using the associate endpoints.

+ * + + * @return null|Reference + */ + public function getAssociate(); /** *

true if the change was made using the Merchant Center or ImpEx.

@@ -88,9 +98,9 @@ public function setId(?string $id): void; public function setType(?string $type): void; /** - * @param ?Reference $customer + * @param ?string $clientId */ - public function setCustomer(?Reference $customer): void; + public function setClientId(?string $clientId): void; /** * @param ?string $anonymousId @@ -98,9 +108,14 @@ public function setCustomer(?Reference $customer): void; public function setAnonymousId(?string $anonymousId): void; /** - * @param ?string $clientId + * @param ?Reference $customer */ - public function setClientId(?string $clientId): void; + public function setCustomer(?Reference $customer): void; + + /** + * @param ?Reference $associate + */ + public function setAssociate(?Reference $associate): void; /** * @param ?bool $isPlatformClient diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByBuilder.php b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByBuilder.php index 8897de2a9e8..422fb23a915 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByBuilder.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByBuilder.php @@ -36,9 +36,9 @@ final class ModifiedByBuilder implements Builder /** - * @var null|Reference|ReferenceBuilder + * @var ?string */ - private $customer; + private $clientId; /** @@ -48,9 +48,15 @@ final class ModifiedByBuilder implements Builder /** - * @var ?string + * @var null|Reference|ReferenceBuilder */ - private $clientId; + private $customer; + + /** + + * @var null|Reference|ReferenceBuilder + */ + private $associate; /** @@ -75,6 +81,7 @@ public function getId() *
    *
  • If the change was made by a user, the value is "user".
  • *
  • If the change was made by an API Client with or without an external user ID, the value is "external-user".
  • + *
  • If the change was made by an Associate, the value is "associate".
  • *
* @@ -86,15 +93,15 @@ public function getType() } /** - *

Reference to the Customer who made the change.

- *

Present only if the change was made using a token from the password flow.

+ *

ID of the API Client that made the change.

+ *

Present only if the change was made using an API Client.

* - * @return null|Reference + * @return null|string */ - public function getCustomer() + public function getClientId() { - return $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer; + return $this->clientId; } /** @@ -109,15 +116,26 @@ public function getAnonymousId() } /** - *

ID of the API Client that made the change.

- *

Present only if the change was made using an API Client.

+ *

The Customer who made the change.

+ *

Present only if the change was made using a token from the password flow.

* - * @return null|string + * @return null|Reference */ - public function getClientId() + public function getCustomer() { - return $this->clientId; + return $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer; + } + + /** + *

The Associate who made the change in the context of a Business Unit. Present only if the Associate acts on behalf of a company using the associate endpoints.

+ * + + * @return null|Reference + */ + public function getAssociate() + { + return $this->associate instanceof ReferenceBuilder ? $this->associate->build() : $this->associate; } /** @@ -154,12 +172,12 @@ public function withType(?string $type) } /** - * @param ?Reference $customer + * @param ?string $clientId * @return $this */ - public function withCustomer(?Reference $customer) + public function withClientId(?string $clientId) { - $this->customer = $customer; + $this->clientId = $clientId; return $this; } @@ -176,12 +194,23 @@ public function withAnonymousId(?string $anonymousId) } /** - * @param ?string $clientId + * @param ?Reference $customer * @return $this */ - public function withClientId(?string $clientId) + public function withCustomer(?Reference $customer) { - $this->clientId = $clientId; + $this->customer = $customer; + + return $this; + } + + /** + * @param ?Reference $associate + * @return $this + */ + public function withAssociate(?Reference $associate) + { + $this->associate = $associate; return $this; } @@ -208,14 +237,26 @@ public function withCustomerBuilder(?ReferenceBuilder $customer) return $this; } + /** + * @deprecated use withAssociate() instead + * @return $this + */ + public function withAssociateBuilder(?ReferenceBuilder $associate) + { + $this->associate = $associate; + + return $this; + } + public function build(): ModifiedBy { return new ModifiedByModel( $this->id, $this->type, - $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer, - $this->anonymousId, $this->clientId, + $this->anonymousId, + $this->customer instanceof ReferenceBuilder ? $this->customer->build() : $this->customer, + $this->associate instanceof ReferenceBuilder ? $this->associate->build() : $this->associate, $this->isPlatformClient ); } diff --git a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByModel.php b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByModel.php index 47e716ea3b6..304a310d785 100644 --- a/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByModel.php +++ b/lib/commercetools-history/src/Models/ChangeHistory/ModifiedByModel.php @@ -37,9 +37,9 @@ final class ModifiedByModel extends JsonObjectModel implements ModifiedBy /** * - * @var ?Reference + * @var ?string */ - protected $customer; + protected $clientId; /** * @@ -49,9 +49,15 @@ final class ModifiedByModel extends JsonObjectModel implements ModifiedBy /** * - * @var ?string + * @var ?Reference */ - protected $clientId; + protected $customer; + + /** + * + * @var ?Reference + */ + protected $associate; /** * @@ -66,16 +72,18 @@ final class ModifiedByModel extends JsonObjectModel implements ModifiedBy public function __construct( ?string $id = null, ?string $type = null, - ?Reference $customer = null, - ?string $anonymousId = null, ?string $clientId = null, + ?string $anonymousId = null, + ?Reference $customer = null, + ?Reference $associate = null, ?bool $isPlatformClient = null ) { $this->id = $id; $this->type = $type; - $this->customer = $customer; - $this->anonymousId = $anonymousId; $this->clientId = $clientId; + $this->anonymousId = $anonymousId; + $this->customer = $customer; + $this->associate = $associate; $this->isPlatformClient = $isPlatformClient; } @@ -106,6 +114,7 @@ public function getId() *
    *
  • If the change was made by a user, the value is "user".
  • *
  • If the change was made by an API Client with or without an external user ID, the value is "external-user".
  • + *
  • If the change was made by an Associate, the value is "associate".
  • *
* * @@ -126,25 +135,24 @@ public function getType() } /** - *

Reference to the Customer who made the change.

- *

Present only if the change was made using a token from the password flow.

+ *

ID of the API Client that made the change.

+ *

Present only if the change was made using an API Client.

* * - * @return null|Reference + * @return null|string */ - public function getCustomer() + public function getClientId() { - if (is_null($this->customer)) { - /** @psalm-var stdClass|array|null $data */ - $data = $this->raw(self::FIELD_CUSTOMER); + if (is_null($this->clientId)) { + /** @psalm-var ?string $data */ + $data = $this->raw(self::FIELD_CLIENT_ID); if (is_null($data)) { return null; } - - $this->customer = ReferenceModel::of($data); + $this->clientId = (string) $data; } - return $this->customer; + return $this->clientId; } /** @@ -168,24 +176,46 @@ public function getAnonymousId() } /** - *

ID of the API Client that made the change.

- *

Present only if the change was made using an API Client.

+ *

The Customer who made the change.

+ *

Present only if the change was made using a token from the password flow.

* * - * @return null|string + * @return null|Reference */ - public function getClientId() + public function getCustomer() { - if (is_null($this->clientId)) { - /** @psalm-var ?string $data */ - $data = $this->raw(self::FIELD_CLIENT_ID); + if (is_null($this->customer)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_CUSTOMER); if (is_null($data)) { return null; } - $this->clientId = (string) $data; + + $this->customer = ReferenceModel::of($data); } - return $this->clientId; + return $this->customer; + } + + /** + *

The Associate who made the change in the context of a Business Unit. Present only if the Associate acts on behalf of a company using the associate endpoints.

+ * + * + * @return null|Reference + */ + public function getAssociate() + { + if (is_null($this->associate)) { + /** @psalm-var stdClass|array|null $data */ + $data = $this->raw(self::FIELD_ASSOCIATE); + if (is_null($data)) { + return null; + } + + $this->associate = ReferenceModel::of($data); + } + + return $this->associate; } /** @@ -226,11 +256,11 @@ public function setType(?string $type): void } /** - * @param ?Reference $customer + * @param ?string $clientId */ - public function setCustomer(?Reference $customer): void + public function setClientId(?string $clientId): void { - $this->customer = $customer; + $this->clientId = $clientId; } /** @@ -242,11 +272,19 @@ public function setAnonymousId(?string $anonymousId): void } /** - * @param ?string $clientId + * @param ?Reference $customer */ - public function setClientId(?string $clientId): void + public function setCustomer(?Reference $customer): void { - $this->clientId = $clientId; + $this->customer = $customer; + } + + /** + * @param ?Reference $associate + */ + public function setAssociate(?Reference $associate): void + { + $this->associate = $associate; } /** diff --git a/lib/commercetools-import/src/Models/Customfields/Custom.php b/lib/commercetools-import/src/Models/Customfields/Custom.php index 4c029563e1e..24ab1d386c5 100644 --- a/lib/commercetools-import/src/Models/Customfields/Custom.php +++ b/lib/commercetools-import/src/Models/Customfields/Custom.php @@ -26,7 +26,7 @@ interface Custom extends JsonObject public function getType(); /** - *

The custom fields of this object.

+ *

The Custom Fields of this object.

* * @return null|FieldContainer diff --git a/lib/commercetools-import/src/Models/Customfields/CustomBuilder.php b/lib/commercetools-import/src/Models/Customfields/CustomBuilder.php index 179a366fde4..ab55daefdcd 100644 --- a/lib/commercetools-import/src/Models/Customfields/CustomBuilder.php +++ b/lib/commercetools-import/src/Models/Customfields/CustomBuilder.php @@ -46,7 +46,7 @@ public function getType() } /** - *

The custom fields of this object.

+ *

The Custom Fields of this object.

* * @return null|FieldContainer diff --git a/lib/commercetools-import/src/Models/Customfields/CustomModel.php b/lib/commercetools-import/src/Models/Customfields/CustomModel.php index 8963237d340..9fd4ac2f0b6 100644 --- a/lib/commercetools-import/src/Models/Customfields/CustomModel.php +++ b/lib/commercetools-import/src/Models/Customfields/CustomModel.php @@ -67,7 +67,7 @@ public function getType() } /** - *

The custom fields of this object.

+ *

The Custom Fields of this object.

* * * @return null|FieldContainer diff --git a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionError.php b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionError.php index 5cc7633db24..51d22c47301 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionError.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionError.php @@ -17,7 +17,7 @@ interface InvalidStateTransitionError extends ErrorObject public const FIELD_NEW_STATE = 'newState'; /** - *

Every Import Operation is assigned with one of the following states.

+ *

Every Import Operation is assigned one of the following states.

* * @return null|string @@ -25,7 +25,7 @@ interface InvalidStateTransitionError extends ErrorObject public function getCurrentState(); /** - *

Every Import Operation is assigned with one of the following states.

+ *

Every Import Operation is assigned one of the following states.

* * @return null|string diff --git a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorBuilder.php b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorBuilder.php index 17e03ab8583..91bf9d75ebe 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorBuilder.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorBuilder.php @@ -48,7 +48,7 @@ public function getMessage() } /** - *

Every Import Operation is assigned with one of the following states.

+ *

Every Import Operation is assigned one of the following states.

* * @return null|string @@ -59,7 +59,7 @@ public function getCurrentState() } /** - *

Every Import Operation is assigned with one of the following states.

+ *

Every Import Operation is assigned one of the following states.

* * @return null|string diff --git a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorModel.php b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorModel.php index 6a43f491950..5a7486edc30 100644 --- a/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorModel.php +++ b/lib/commercetools-import/src/Models/Errors/InvalidStateTransitionErrorModel.php @@ -97,7 +97,7 @@ public function getMessage() } /** - *

Every Import Operation is assigned with one of the following states.

+ *

Every Import Operation is assigned one of the following states.

* * * @return null|string @@ -117,7 +117,7 @@ public function getCurrentState() } /** - *

Every Import Operation is assigned with one of the following states.

+ *

Every Import Operation is assigned one of the following states.

* * * @return null|string diff --git a/lib/commercetools-import/src/Models/Importsummaries/OperationStates.php b/lib/commercetools-import/src/Models/Importsummaries/OperationStates.php index b61739f42fc..68402a91755 100644 --- a/lib/commercetools-import/src/Models/Importsummaries/OperationStates.php +++ b/lib/commercetools-import/src/Models/Importsummaries/OperationStates.php @@ -19,6 +19,7 @@ interface OperationStates extends JsonObject public const FIELD_WAIT_FOR_MASTER_VARIANT = 'waitForMasterVariant'; public const FIELD_IMPORTED = 'imported'; public const FIELD_REJECTED = 'rejected'; + public const FIELD_CANCELED = 'canceled'; /** *

The number of resources in the processing state.

@@ -68,6 +69,14 @@ public function getImported(); */ public function getRejected(); + /** + *

The number of resources in the canceled state.

+ * + + * @return null|int + */ + public function getCanceled(); + /** * @param ?int $processing */ @@ -97,4 +106,9 @@ public function setImported(?int $imported): void; * @param ?int $rejected */ public function setRejected(?int $rejected): void; + + /** + * @param ?int $canceled + */ + public function setCanceled(?int $canceled): void; } diff --git a/lib/commercetools-import/src/Models/Importsummaries/OperationStatesBuilder.php b/lib/commercetools-import/src/Models/Importsummaries/OperationStatesBuilder.php index a8f94ea2886..43d24094863 100644 --- a/lib/commercetools-import/src/Models/Importsummaries/OperationStatesBuilder.php +++ b/lib/commercetools-import/src/Models/Importsummaries/OperationStatesBuilder.php @@ -56,6 +56,12 @@ final class OperationStatesBuilder implements Builder */ private $rejected; + /** + + * @var ?int + */ + private $canceled; + /** *

The number of resources in the processing state.

* @@ -122,6 +128,17 @@ public function getRejected() return $this->rejected; } + /** + *

The number of resources in the canceled state.

+ * + + * @return null|int + */ + public function getCanceled() + { + return $this->canceled; + } + /** * @param ?int $processing * @return $this @@ -188,6 +205,17 @@ public function withRejected(?int $rejected) return $this; } + /** + * @param ?int $canceled + * @return $this + */ + public function withCanceled(?int $canceled) + { + $this->canceled = $canceled; + + return $this; + } + public function build(): OperationStates { @@ -197,7 +225,8 @@ public function build(): OperationStates $this->unresolved, $this->waitForMasterVariant, $this->imported, - $this->rejected + $this->rejected, + $this->canceled ); } diff --git a/lib/commercetools-import/src/Models/Importsummaries/OperationStatesModel.php b/lib/commercetools-import/src/Models/Importsummaries/OperationStatesModel.php index 7de8524da60..1b50719b061 100644 --- a/lib/commercetools-import/src/Models/Importsummaries/OperationStatesModel.php +++ b/lib/commercetools-import/src/Models/Importsummaries/OperationStatesModel.php @@ -55,6 +55,12 @@ final class OperationStatesModel extends JsonObjectModel implements OperationSta */ protected $rejected; + /** + * + * @var ?int + */ + protected $canceled; + /** * @psalm-suppress MissingParamType @@ -65,7 +71,8 @@ public function __construct( ?int $unresolved = null, ?int $waitForMasterVariant = null, ?int $imported = null, - ?int $rejected = null + ?int $rejected = null, + ?int $canceled = null ) { $this->processing = $processing; $this->validationFailed = $validationFailed; @@ -73,6 +80,7 @@ public function __construct( $this->waitForMasterVariant = $waitForMasterVariant; $this->imported = $imported; $this->rejected = $rejected; + $this->canceled = $canceled; } /** @@ -195,6 +203,26 @@ public function getRejected() return $this->rejected; } + /** + *

The number of resources in the canceled state.

+ * + * + * @return null|int + */ + public function getCanceled() + { + if (is_null($this->canceled)) { + /** @psalm-var ?int $data */ + $data = $this->raw(self::FIELD_CANCELED); + if (is_null($data)) { + return null; + } + $this->canceled = (int) $data; + } + + return $this->canceled; + } + /** * @param ?int $processing @@ -243,4 +271,12 @@ public function setRejected(?int $rejected): void { $this->rejected = $rejected; } + + /** + * @param ?int $canceled + */ + public function setCanceled(?int $canceled): void + { + $this->canceled = $canceled; + } } diff --git a/lib/commercetools-import/src/Models/Orders/Parcel.php b/lib/commercetools-import/src/Models/Orders/Parcel.php index 8381b151d34..0db1945d823 100644 --- a/lib/commercetools-import/src/Models/Orders/Parcel.php +++ b/lib/commercetools-import/src/Models/Orders/Parcel.php @@ -53,7 +53,7 @@ public function getTrackingData(); public function getItems(); /** - *

The representation to be sent to the server when creating a resource with custom fields.

+ *

The representation to be sent to the server when creating a resource with Custom Fields.

* * @return null|Custom diff --git a/lib/commercetools-import/src/Models/Orders/ParcelBuilder.php b/lib/commercetools-import/src/Models/Orders/ParcelBuilder.php index ad1cb987e24..87e40711461 100644 --- a/lib/commercetools-import/src/Models/Orders/ParcelBuilder.php +++ b/lib/commercetools-import/src/Models/Orders/ParcelBuilder.php @@ -105,7 +105,7 @@ public function getItems() } /** - *

The representation to be sent to the server when creating a resource with custom fields.

+ *

The representation to be sent to the server when creating a resource with Custom Fields.

* * @return null|Custom diff --git a/lib/commercetools-import/src/Models/Orders/ParcelModel.php b/lib/commercetools-import/src/Models/Orders/ParcelModel.php index f61d3c69680..d5a9006c66b 100644 --- a/lib/commercetools-import/src/Models/Orders/ParcelModel.php +++ b/lib/commercetools-import/src/Models/Orders/ParcelModel.php @@ -175,7 +175,7 @@ public function getItems() } /** - *

The representation to be sent to the server when creating a resource with custom fields.

+ *

The representation to be sent to the server when creating a resource with Custom Fields.

* * * @return null|Custom diff --git a/references.txt b/references.txt index 68889528168..8a373f1f7e7 100644 --- a/references.txt +++ b/references.txt @@ -103,3 +103,4 @@ d842da41f5bb7448d8ec3f7ad959c1e46626bc2f e87bf15e82d10768771e954e60a6fc971a68142a 593bb9958df2b6a0a49fd0fdb2c0bd965f0ffb98 611b2ef31a338db391bb58aab4beb98f9d342439 +2a8532351bf108ca992365b163d769b4cc12de2c diff --git a/src/Api/Models/Product/AttributeAccessor.php b/src/Api/Models/Product/AttributeAccessor.php index 11c3838ac62..1bed7be71aa 100644 --- a/src/Api/Models/Product/AttributeAccessor.php +++ b/src/Api/Models/Product/AttributeAccessor.php @@ -270,79 +270,79 @@ public function getValueAsNestedSet(): NestedAttributeCollection return NestedAttributeCollection::fromArray($value); } -// public function getTypedValue() -// { -// $value = $this->attribute->getValue(); -// if (is_scalar($value)) { -// return $value; -// } -// if ($value instanceof stdClass) { -// return $this->objectToValue($value); -// } -// if (is_array($value)) { -// return $this->arrayToValue($value); -// } -// return $value; -// } -// -// private function objectToValue(stdClass $value) -// { -// if (isset($value->key)) { -// if ($value->label instanceof stdClass) { -// return AttributeLocalizedEnumValueModel::fromStdClass($value); -// } -// return AttributePlainEnumValueModel::fromStdClass($value); -// } -// if (isset($value->currencyCode)) { -// return MoneyModel::fromStdClass($value); -// } -// if (isset($value->typeId)) { -// $refClass = ReferenceModel::resolveDiscriminatorClass($value); -// return $refClass::fromStdClass($value); -// } -// return LocalizedStringModel::fromStdClass($value); -// } -// -// private function arrayToValue(array $value) -// { -// $firstItem = current($value); -// if (is_array($firstItem)) { -// return $this->objectToValueCollection($firstItem, $value); -// } -// if (isset($value['key'])) { -// if ($value['label'] instanceof stdClass) { -// return AttributeLocalizedEnumValueModel::fromArray($value); -// } -// return AttributePlainEnumValueModel::fromArray($value); -// } -// if (isset($value['currencyCode'])) { -// return MoneyModel::fromArray($value); -// } -// if (isset($value['typeId'])) { -// $refClass = ReferenceModel::resolveDiscriminatorClass($value); -// return $refClass::fromArray($value); -// } -// if (is_string(key($value))) { -// return LocalizedStringModel::fromArray($value); -// } -// return $value; -// } -// -// private function objectToValueCollection($firstItem, array $value) -// { -// if (isset($firstItem->key)) { -// if ($firstItem->label instanceof stdClass) { -// return AttributeLocalizedEnumValueCollection::fromArray($value); -// } -// return AttributePlainEnumValueCollection::fromArray($value); -// } -// if (isset($firstItem->currencyCode)) { -// return MoneyCollection::fromArray($value); -// } -// if (isset($firstItem->typeId)) { -// $refClass = ReferenceModel::resolveDiscriminatorClass($value) . "Collection"; -// return $refClass::fromArray($value); -// } -// return LocalizedStringCollection::fromArray($value); -// } + // public function getTypedValue() + // { + // $value = $this->attribute->getValue(); + // if (is_scalar($value)) { + // return $value; + // } + // if ($value instanceof stdClass) { + // return $this->objectToValue($value); + // } + // if (is_array($value)) { + // return $this->arrayToValue($value); + // } + // return $value; + // } + // + // private function objectToValue(stdClass $value) + // { + // if (isset($value->key)) { + // if ($value->label instanceof stdClass) { + // return AttributeLocalizedEnumValueModel::fromStdClass($value); + // } + // return AttributePlainEnumValueModel::fromStdClass($value); + // } + // if (isset($value->currencyCode)) { + // return MoneyModel::fromStdClass($value); + // } + // if (isset($value->typeId)) { + // $refClass = ReferenceModel::resolveDiscriminatorClass($value); + // return $refClass::fromStdClass($value); + // } + // return LocalizedStringModel::fromStdClass($value); + // } + // + // private function arrayToValue(array $value) + // { + // $firstItem = current($value); + // if (is_array($firstItem)) { + // return $this->objectToValueCollection($firstItem, $value); + // } + // if (isset($value['key'])) { + // if ($value['label'] instanceof stdClass) { + // return AttributeLocalizedEnumValueModel::fromArray($value); + // } + // return AttributePlainEnumValueModel::fromArray($value); + // } + // if (isset($value['currencyCode'])) { + // return MoneyModel::fromArray($value); + // } + // if (isset($value['typeId'])) { + // $refClass = ReferenceModel::resolveDiscriminatorClass($value); + // return $refClass::fromArray($value); + // } + // if (is_string(key($value))) { + // return LocalizedStringModel::fromArray($value); + // } + // return $value; + // } + // + // private function objectToValueCollection($firstItem, array $value) + // { + // if (isset($firstItem->key)) { + // if ($firstItem->label instanceof stdClass) { + // return AttributeLocalizedEnumValueCollection::fromArray($value); + // } + // return AttributePlainEnumValueCollection::fromArray($value); + // } + // if (isset($firstItem->currencyCode)) { + // return MoneyCollection::fromArray($value); + // } + // if (isset($firstItem->typeId)) { + // $refClass = ReferenceModel::resolveDiscriminatorClass($value) . "Collection"; + // return $refClass::fromArray($value); + // } + // return LocalizedStringCollection::fromArray($value); + // } } diff --git a/test/unit/MiscTest.php b/test/unit/MiscTest.php index df8105e23b6..a7f616f51af 100644 --- a/test/unit/MiscTest.php +++ b/test/unit/MiscTest.php @@ -203,11 +203,11 @@ public function testAttributes() $this->assertSame("foo", $nested->current()->getValue()); $this->assertSame("foo", $nestedSet->current()->current()->getValue()); -// $this->assertSame("foo", $variant->getAttributes()->at(0)->with(AttributeAccessor::of())->getTypedValue()->getLabel()); -// $this->assertSame("foo", $variant->getAttributes()->at(1)->with(AttributeAccessor::of())->getTypedValue()->getLabel()['en']); -// $this->assertSame("foo", $variant->getAttributes()->at(2)->with(AttributeAccessor::of())->getTypedValue()); -// $this->assertSame("foo", $variant->getAttributes()->at(3)->with(AttributeAccessor::of())->getTypedValue()->current()->getValue()); -// $this->assertSame("foo", $variant->getAttributes()->at(4)->with(AttributeAccessor::of())->getTypedValue()->current()->current()->getValue()); + // $this->assertSame("foo", $variant->getAttributes()->at(0)->with(AttributeAccessor::of())->getTypedValue()->getLabel()); + // $this->assertSame("foo", $variant->getAttributes()->at(1)->with(AttributeAccessor::of())->getTypedValue()->getLabel()['en']); + // $this->assertSame("foo", $variant->getAttributes()->at(2)->with(AttributeAccessor::of())->getTypedValue()); + // $this->assertSame("foo", $variant->getAttributes()->at(3)->with(AttributeAccessor::of())->getTypedValue()->current()->getValue()); + // $this->assertSame("foo", $variant->getAttributes()->at(4)->with(AttributeAccessor::of())->getTypedValue()->current()->current()->getValue()); } public function testCustomFields() diff --git a/test/unit/ProductProjectionsTest.php b/test/unit/ProductProjectionsTest.php index fcb606dcb07..f1d743b3405 100644 --- a/test/unit/ProductProjectionsTest.php +++ b/test/unit/ProductProjectionsTest.php @@ -19,12 +19,12 @@ public function testAttributeMapping() $productsJson = json_decode(file_get_contents(__DIR__ . "/products.json")); $products = ProductProjectionPagedQueryResponseModel::fromStdClass($productsJson)->getResults(); -// /** @var ClientInterface $client */ -// $builder = new ApiRequestBuilder($client); -// $productResponse = $builder->withProjectKey("")->productProjections()->get()->execute(); -// $products = $productResponse->getResults(); + // /** @var ClientInterface $client */ + // $builder = new ApiRequestBuilder($client); + // $productResponse = $builder->withProjectKey("")->productProjections()->get()->execute(); + // $products = $productResponse->getResults(); -// /** @var ProductProjection $product */ + // /** @var ProductProjection $product */ foreach ($products as $product) { foreach ($product->getMasterVariant()->getAttributes() as $attribute) { /** @var AttributeAccessor $attrAccessor */