From fe1e74a8568e8bce4e6b4f7b180988b5a8b456bb Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Tue, 17 Dec 2024 14:14:37 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 27 ++ .../main/resources/graphql/schema.graphqls | 79 +++++ .../cart/CartAddCustomLineItemAction.java | 4 +- .../CartAddCustomLineItemActionBuilder.java | 4 +- .../cart/CartAddCustomLineItemActionImpl.java | 2 +- .../api/models/cart/CustomLineItem.java | 4 +- .../models/cart/CustomLineItemBuilder.java | 4 +- .../api/models/cart/CustomLineItemDraft.java | 4 +- .../cart/CustomLineItemDraftBuilder.java | 4 +- .../models/cart/CustomLineItemDraftImpl.java | 2 +- .../api/models/cart/CustomLineItemImpl.java | 2 +- .../models/cart/CustomLineItemPriceMode.java | 2 +- .../CartDiscountPatternTarget.java | 218 +++++++++++++ .../CartDiscountPatternTargetBuilder.java | 297 ++++++++++++++++++ .../CartDiscountPatternTargetImpl.java | 172 ++++++++++ .../cart_discount/CartDiscountTarget.java | 13 + .../CartDiscountTargetBuilder.java | 4 + .../cart_discount/CartDiscountValueFixed.java | 19 ++ .../CartDiscountValueFixedBuilder.java | 34 +- .../CartDiscountValueFixedDraft.java | 19 ++ .../CartDiscountValueFixedDraftBuilder.java | 34 +- .../CartDiscountValueFixedDraftImpl.java | 25 +- .../CartDiscountValueFixedImpl.java | 25 +- .../CountOnCustomLineItemUnits.java | 184 +++++++++++ .../CountOnCustomLineItemUnitsBuilder.java | 165 ++++++++++ .../CountOnCustomLineItemUnitsImpl.java | 158 ++++++++++ .../cart_discount/CountOnLineItemUnits.java | 184 +++++++++++ .../CountOnLineItemUnitsBuilder.java | 165 ++++++++++ .../CountOnLineItemUnitsImpl.java | 158 ++++++++++ .../cart_discount/PatternComponent.java | 106 +++++++ .../PatternComponentBuilder.java | 30 ++ .../cart_discount/PatternComponentImpl.java | 72 +++++ .../order/CustomLineItemImportDraft.java | 4 +- .../CustomLineItemImportDraftBuilder.java | 4 +- .../order/CustomLineItemImportDraftImpl.java | 2 +- .../StagedOrderAddCustomLineItemAction.java | 4 +- ...edOrderAddCustomLineItemActionBuilder.java | 4 +- ...tagedOrderAddCustomLineItemActionImpl.java | 2 +- .../ProductSelectionAssignment.java | 8 +- .../ProductSelectionAssignmentBuilder.java | 14 +- .../ProductSelectionAssignmentImpl.java | 4 +- ...tDiscountPatternTargetQueryBuilderDsl.java | 66 ++++ .../CartDiscountTargetQueryBuilderDsl.java | 8 + ...iscountValueFixedDraftQueryBuilderDsl.java | 6 + ...CartDiscountValueFixedQueryBuilderDsl.java | 6 + ...tOnCustomLineItemUnitsQueryBuilderDsl.java | 44 +++ .../CountOnLineItemUnitsQueryBuilderDsl.java | 44 +++ .../PatternComponentQueryBuilderDsl.java | 36 +++ .../CartDiscountPatternTargetTest.java | 76 +++++ .../CartDiscountValueFixedDraftTest.java | 18 +- .../CartDiscountValueFixedTest.java | 18 +- .../CountOnCustomLineItemUnitsTest.java | 60 ++++ .../CountOnLineItemUnitsTest.java | 60 ++++ .../cart_discount/PatternComponent.java | 76 +++++ .../PatternComponentBuilder.java | 22 ++ .../cart_discount/PatternComponentImpl.java | 72 +++++ .../change_value/ChangeTargetChangeValue.java | 13 + .../ChangeTargetChangeValueBuilder.java | 4 + .../ChangeTargetPatternChangeValue.java | 218 +++++++++++++ ...ChangeTargetPatternChangeValueBuilder.java | 279 ++++++++++++++++ .../ChangeTargetPatternChangeValueImpl.java | 170 ++++++++++ .../ChangeTargetPatternChangeValueTest.java | 75 +++++ references.txt | 1 + 63 files changed, 3587 insertions(+), 51 deletions(-) create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTarget.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnits.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnits.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponent.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponentBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponentImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountPatternTargetQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CountOnCustomLineItemUnitsQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CountOnLineItemUnitsQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/PatternComponentQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsTest.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsTest.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponent.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponentBuilder.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponentImpl.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValue.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueBuilder.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueImpl.java create mode 100644 commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueTest.java diff --git a/changes.md b/changes.md index 3bc82431285..e34d29611cd 100644 --- a/changes.md +++ b/changes.md @@ -16,3 +16,30 @@ - added method `apiRoot.withProjectKey().channels().withKey().delete()` + +
+Added Type(s) + +- added type `CartDiscountPatternTarget` +- added type `CountOnCustomLineItemUnits` +- added type `CountOnLineItemUnits` +- added type `PatternComponent` +
+ + +
+Added Property(s) + +- added property `applicationMode` to type `CartDiscountValueFixed` +- added property `applicationMode` to type `CartDiscountValueFixedDraft` +
+ +**History changes** + +
+Added Type(s) + +- added type `ChangeTargetPatternChangeValue` +- added type `PatternComponent` +
+ diff --git a/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls b/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls index 74ab61aaf12..56fd361b8e5 100644 --- a/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls +++ b/commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls @@ -1827,6 +1827,23 @@ type CartDiscountLimitsProjection { totalActiveWithoutDiscountCodes: CartDiscountLimitWithCurrent! } +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +type CartDiscountPatternTarget implements CartDiscountTarget { + triggerPattern: [PatternComponent!]! + targetPattern: [PatternComponent!]! + maxOccurrence: Int + selectionMode: SelectionMode! + type: String! +} + +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +input CartDiscountPatternTargetInput { + triggerPattern: [PatternComponentInput!]! + targetPattern: [PatternComponentInput!]! + maxOccurrence: Int + selectionMode: SelectionMode +} + "Fields to access cartDiscounts. Includes direct access to a single cartDiscount and searching for cartDiscounts." interface CartDiscountQueryInterface { cartDiscount( @@ -1875,6 +1892,9 @@ input CartDiscountTargetInput { multiBuyLineItems: MultiBuyLineItemsTargetInput multiBuyCustomLineItems: MultiBuyCustomLineItemsTargetInput totalPrice: CartDiscountTotalPriceTargetInput + + "BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" + pattern: CartDiscountPatternTargetInput } type CartDiscountTotalPriceTarget implements CartDiscountTarget { @@ -1921,11 +1941,13 @@ input CartDiscountValueBaseMoneyInput { centAmount: Long } + input CartDiscountValueInput { relative: RelativeDiscountValueInput absolute: AbsoluteDiscountValueInput absoluteCart: AbsoluteCartDiscountValueInput fixed: FixedPriceDiscountValueInput + fixedCart: FixedPriceCartDiscountValueInput giftLineItem: GiftLineItemValueInput } @@ -3063,6 +3085,41 @@ input ConfluentCloudDestinationInput { key: String } + +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +type CountOnCustomLineItemUnits implements PatternComponent { + predicate: String! + minCount: Int + maxCount: Int + excludeCount: Int + type: String! +} + +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +input CountOnCustomLineItemUnitsInput { + predicate: String! + minCount: Int = 1 + maxCount: Int + excludeCount: Int +} + +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +type CountOnLineItemUnits implements PatternComponent { + predicate: String! + minCount: Int + maxCount: Int + excludeCount: Int + type: String! +} + +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +input CountOnLineItemUnitsInput { + predicate: String! + minCount: Int = 1 + maxCount: Int + excludeCount: Int +} + "[ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) country code." scalar Country @@ -4447,6 +4504,17 @@ input FieldTypeSetTypeDraft { elementType: FieldTypeSetElementTypeDraft! } +type FixedPriceCartDiscountValue implements CartDiscountValue { + type: String! + money: [BaseMoney!]! + applicationMode: DiscountApplicationMode! +} + +input FixedPriceCartDiscountValueInput { + money: [CartDiscountValueBaseMoneyInput!]! + applicationMode: DiscountApplicationMode! +} + type FixedPriceDiscountValue implements CartDiscountValue { type: String! money: [BaseMoney!]! @@ -7283,6 +7351,17 @@ type ParcelTrackingDataUpdated implements MessagePayload & OrderMessagePayload { type: String! } +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +interface PatternComponent { + type: String! +} + +"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta" +input PatternComponentInput { + CountOnLineItemUnits: CountOnLineItemUnitsInput + CountOnCustomLineItemUnits: CountOnCustomLineItemUnitsInput +} + """ Payments hold information about the current state of receiving and/or refunding money. [documentation](https://docs.commercetools.com/api/projects/payments) diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemAction.java index 7b3124d325c..7d89afac558 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemAction.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemAction.java @@ -123,7 +123,7 @@ public interface CartAddCustomLineItemAction /** * * @return priceMode @@ -198,7 +198,7 @@ public interface CartAddCustomLineItemAction /** * * @param priceMode value to be set diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemActionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemActionBuilder.java index 8ef82068b37..ea4b32f601a 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemActionBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemActionBuilder.java @@ -310,7 +310,7 @@ public CartAddCustomLineItemActionBuilder custom( /** * * @param priceMode value to be set @@ -413,7 +413,7 @@ public com.commercetools.api.models.type.CustomFieldsDraft getCustom() { /** * * @return priceMode diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemActionImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemActionImpl.java index a9ea22df03f..1251e6cffba 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemActionImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddCustomLineItemActionImpl.java @@ -162,7 +162,7 @@ public com.commercetools.api.models.type.CustomFieldsDraft getCustom() { /** * */ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItem.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItem.java index 0b4555635ae..31ba7ab9e51 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItem.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItem.java @@ -190,7 +190,7 @@ public interface CustomLineItem extends com.commercetools.api.models.Customizabl public ItemShippingDetails getShippingDetails(); /** - *

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.

+ *

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.

* @return priceMode */ @NotNull @@ -347,7 +347,7 @@ public void setDiscountedPricePerQuantity( public void setShippingDetails(final ItemShippingDetails shippingDetails); /** - *

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.

+ *

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.

* @param priceMode value to be set */ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemBuilder.java index 1ac54c63c94..bb3e08b1566 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemBuilder.java @@ -762,7 +762,7 @@ public CustomLineItemBuilder shippingDetails( } /** - *

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.

+ *

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.

* @param priceMode value to be set * @return Builder */ @@ -927,7 +927,7 @@ public com.commercetools.api.models.cart.ItemShippingDetails getShippingDetails( } /** - *

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.

+ *

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.

* @return priceMode */ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraft.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraft.java index 1c56d19cc13..a3a4f174039 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraft.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraft.java @@ -115,7 +115,7 @@ public interface CustomLineItemDraft extends com.commercetools.api.models.Custom /** * * @return priceMode @@ -189,7 +189,7 @@ public interface CustomLineItemDraft extends com.commercetools.api.models.Custom /** * * @param priceMode value to be set diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraftBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraftBuilder.java index b83150adee4..a5b6752b98a 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraftBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraftBuilder.java @@ -307,7 +307,7 @@ public CustomLineItemDraftBuilder shippingDetails( /** * * @param priceMode value to be set @@ -409,7 +409,7 @@ public com.commercetools.api.models.cart.ItemShippingDetailsDraft getShippingDet /** * * @return priceMode diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraftImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraftImpl.java index 6daebaa3fcb..a6e1e99bd3a 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraftImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemDraftImpl.java @@ -147,7 +147,7 @@ public com.commercetools.api.models.cart.ItemShippingDetailsDraft getShippingDet /** * */ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemImpl.java index c831cb77907..2240b5c70c2 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemImpl.java @@ -233,7 +233,7 @@ public com.commercetools.api.models.cart.ItemShippingDetails getShippingDetails( } /** - *

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.

+ *

Indicates whether Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.

*/ public com.commercetools.api.models.cart.CustomLineItemPriceMode getPriceMode() { diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemPriceMode.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemPriceMode.java index 1fa9d7e1a5c..0b0f8121dae 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemPriceMode.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CustomLineItemPriceMode.java @@ -21,7 +21,7 @@ public interface CustomLineItemPriceMode extends JsonEnum {

This is the default mode for backwards compatibility.

*/ CustomLineItemPriceMode STANDARD = CustomLineItemPriceModeEnum.STANDARD; /** -

Deactivates application of Cart Discounts for the Custom Line Item, despite a matching CartDiscountCustomLineItemsTarget and MultiBuyCustomLineItemsTarget.

*/ +

Deactivates application of Cart Discounts for the Custom Line Item despite a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget.

*/ CustomLineItemPriceMode EXTERNAL = CustomLineItemPriceModeEnum.EXTERNAL; /** diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTarget.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTarget.java new file mode 100644 index 00000000000..066b5797db0 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTarget.java @@ -0,0 +1,218 @@ + +package com.commercetools.api.models.cart_discount; + +import java.time.*; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + *

Pattern targets can be used to model Buy and Get discounts.

+ *

Unlike CartDiscountLineItemsTarget and CartDiscountCustomLineItemsTarget, it does not apply to a (Custom) Line Item as a whole, but to individual units of a (Custom) Line Item. The discounts can apply multiple times on the same cart, but each unit can be discounted only once.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     CartDiscountPatternTarget cartDiscountPatternTarget = CartDiscountPatternTarget.builder()
+ *             .plusTargetPattern(targetPatternBuilder -> targetPatternBuilder)
+ *             .selectionMode(SelectionMode.CHEAPEST)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = CartDiscountPatternTargetImpl.class) +public interface CartDiscountPatternTarget extends CartDiscountTarget { + + /** + * discriminator value for CartDiscountPatternTarget + */ + String PATTERN = "pattern"; + + /** + *

Units of a (Custom) Line Item that trigger a discount application.

+ *

Based on the availability of matching units, the triggerPattern can match multiple times, effecting the number of times the discount will be applied. To further limit the discount application, set the maxOccurrence.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @return triggerPattern + */ + @Valid + @JsonProperty("triggerPattern") + public List getTriggerPattern(); + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ *

Based on the availability of matching units and the limits from the triggerPattern or maxOccurence, the targetPattern can match multiple times.

+ * @return targetPattern + */ + @NotNull + @Valid + @JsonProperty("targetPattern") + public List getTargetPattern(); + + /** + *

Maximum number of times the Discount can apply on a Cart.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @return maxOccurrence + */ + + @JsonProperty("maxOccurrence") + public Integer getMaxOccurrence(); + + /** + *

Determines which of the matching units of (Custom) Line Items are discounted.

+ * @return selectionMode + */ + @NotNull + @JsonProperty("selectionMode") + public SelectionMode getSelectionMode(); + + /** + *

Units of a (Custom) Line Item that trigger a discount application.

+ *

Based on the availability of matching units, the triggerPattern can match multiple times, effecting the number of times the discount will be applied. To further limit the discount application, set the maxOccurrence.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @param triggerPattern values to be set + */ + + @JsonIgnore + public void setTriggerPattern(final PatternComponent... triggerPattern); + + /** + *

Units of a (Custom) Line Item that trigger a discount application.

+ *

Based on the availability of matching units, the triggerPattern can match multiple times, effecting the number of times the discount will be applied. To further limit the discount application, set the maxOccurrence.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @param triggerPattern values to be set + */ + + public void setTriggerPattern(final List triggerPattern); + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ *

Based on the availability of matching units and the limits from the triggerPattern or maxOccurence, the targetPattern can match multiple times.

+ * @param targetPattern values to be set + */ + + @JsonIgnore + public void setTargetPattern(final PatternComponent... targetPattern); + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ *

Based on the availability of matching units and the limits from the triggerPattern or maxOccurence, the targetPattern can match multiple times.

+ * @param targetPattern values to be set + */ + + public void setTargetPattern(final List targetPattern); + + /** + *

Maximum number of times the Discount can apply on a Cart.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @param maxOccurrence value to be set + */ + + public void setMaxOccurrence(final Integer maxOccurrence); + + /** + *

Determines which of the matching units of (Custom) Line Items are discounted.

+ * @param selectionMode value to be set + */ + + public void setSelectionMode(final SelectionMode selectionMode); + + /** + * factory method + * @return instance of CartDiscountPatternTarget + */ + public static CartDiscountPatternTarget of() { + return new CartDiscountPatternTargetImpl(); + } + + /** + * factory method to create a shallow copy CartDiscountPatternTarget + * @param template instance to be copied + * @return copy instance + */ + public static CartDiscountPatternTarget of(final CartDiscountPatternTarget template) { + CartDiscountPatternTargetImpl instance = new CartDiscountPatternTargetImpl(); + instance.setTriggerPattern(template.getTriggerPattern()); + instance.setTargetPattern(template.getTargetPattern()); + instance.setMaxOccurrence(template.getMaxOccurrence()); + instance.setSelectionMode(template.getSelectionMode()); + return instance; + } + + /** + * factory method to create a deep copy of CartDiscountPatternTarget + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static CartDiscountPatternTarget deepCopy(@Nullable final CartDiscountPatternTarget template) { + if (template == null) { + return null; + } + CartDiscountPatternTargetImpl instance = new CartDiscountPatternTargetImpl(); + instance.setTriggerPattern(Optional.ofNullable(template.getTriggerPattern()) + .map(t -> t.stream() + .map(com.commercetools.api.models.cart_discount.PatternComponent::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); + instance.setTargetPattern(Optional.ofNullable(template.getTargetPattern()) + .map(t -> t.stream() + .map(com.commercetools.api.models.cart_discount.PatternComponent::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); + instance.setMaxOccurrence(template.getMaxOccurrence()); + instance.setSelectionMode(template.getSelectionMode()); + return instance; + } + + /** + * builder factory method for CartDiscountPatternTarget + * @return builder + */ + public static CartDiscountPatternTargetBuilder builder() { + return CartDiscountPatternTargetBuilder.of(); + } + + /** + * create builder for CartDiscountPatternTarget instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static CartDiscountPatternTargetBuilder builder(final CartDiscountPatternTarget template) { + return CartDiscountPatternTargetBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withCartDiscountPatternTarget(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetBuilder.java new file mode 100644 index 00000000000..8f8172c8afe --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetBuilder.java @@ -0,0 +1,297 @@ + +package com.commercetools.api.models.cart_discount; + +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * CartDiscountPatternTargetBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     CartDiscountPatternTarget cartDiscountPatternTarget = CartDiscountPatternTarget.builder()
+ *             .plusTargetPattern(targetPatternBuilder -> targetPatternBuilder)
+ *             .selectionMode(SelectionMode.CHEAPEST)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class CartDiscountPatternTargetBuilder implements Builder { + + @Nullable + private java.util.List triggerPattern; + + private java.util.List targetPattern; + + @Nullable + private Integer maxOccurrence; + + private com.commercetools.api.models.cart_discount.SelectionMode selectionMode; + + /** + *

Units of a (Custom) Line Item that trigger a discount application.

+ *

Based on the availability of matching units, the triggerPattern can match multiple times, effecting the number of times the discount will be applied. To further limit the discount application, set the maxOccurrence.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @param triggerPattern value to be set + * @return Builder + */ + + public CartDiscountPatternTargetBuilder triggerPattern( + @Nullable final com.commercetools.api.models.cart_discount.PatternComponent... triggerPattern) { + this.triggerPattern = new ArrayList<>(Arrays.asList(triggerPattern)); + return this; + } + + /** + *

Units of a (Custom) Line Item that trigger a discount application.

+ *

Based on the availability of matching units, the triggerPattern can match multiple times, effecting the number of times the discount will be applied. To further limit the discount application, set the maxOccurrence.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @param triggerPattern value to be set + * @return Builder + */ + + public CartDiscountPatternTargetBuilder triggerPattern( + @Nullable final java.util.List triggerPattern) { + this.triggerPattern = triggerPattern; + return this; + } + + /** + *

Units of a (Custom) Line Item that trigger a discount application.

+ *

Based on the availability of matching units, the triggerPattern can match multiple times, effecting the number of times the discount will be applied. To further limit the discount application, set the maxOccurrence.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @param triggerPattern value to be set + * @return Builder + */ + + public CartDiscountPatternTargetBuilder plusTriggerPattern( + @Nullable final com.commercetools.api.models.cart_discount.PatternComponent... triggerPattern) { + if (this.triggerPattern == null) { + this.triggerPattern = new ArrayList<>(); + } + this.triggerPattern.addAll(Arrays.asList(triggerPattern)); + return this; + } + + /** + *

Units of a (Custom) Line Item that trigger a discount application.

+ *

Based on the availability of matching units, the triggerPattern can match multiple times, effecting the number of times the discount will be applied. To further limit the discount application, set the maxOccurrence.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @param builder function to build the triggerPattern value + * @return Builder + */ + + public CartDiscountPatternTargetBuilder plusTriggerPattern( + Function> builder) { + if (this.triggerPattern == null) { + this.triggerPattern = new ArrayList<>(); + } + this.triggerPattern + .add(builder.apply(com.commercetools.api.models.cart_discount.PatternComponentBuilder.of()).build()); + return this; + } + + /** + *

Units of a (Custom) Line Item that trigger a discount application.

+ *

Based on the availability of matching units, the triggerPattern can match multiple times, effecting the number of times the discount will be applied. To further limit the discount application, set the maxOccurrence.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @param builder function to build the triggerPattern value + * @return Builder + */ + + public CartDiscountPatternTargetBuilder withTriggerPattern( + Function> builder) { + this.triggerPattern = new ArrayList<>(); + this.triggerPattern + .add(builder.apply(com.commercetools.api.models.cart_discount.PatternComponentBuilder.of()).build()); + return this; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ *

Based on the availability of matching units and the limits from the triggerPattern or maxOccurence, the targetPattern can match multiple times.

+ * @param targetPattern value to be set + * @return Builder + */ + + public CartDiscountPatternTargetBuilder targetPattern( + final com.commercetools.api.models.cart_discount.PatternComponent... targetPattern) { + this.targetPattern = new ArrayList<>(Arrays.asList(targetPattern)); + return this; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ *

Based on the availability of matching units and the limits from the triggerPattern or maxOccurence, the targetPattern can match multiple times.

+ * @param targetPattern value to be set + * @return Builder + */ + + public CartDiscountPatternTargetBuilder targetPattern( + final java.util.List targetPattern) { + this.targetPattern = targetPattern; + return this; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ *

Based on the availability of matching units and the limits from the triggerPattern or maxOccurence, the targetPattern can match multiple times.

+ * @param targetPattern value to be set + * @return Builder + */ + + public CartDiscountPatternTargetBuilder plusTargetPattern( + final com.commercetools.api.models.cart_discount.PatternComponent... targetPattern) { + if (this.targetPattern == null) { + this.targetPattern = new ArrayList<>(); + } + this.targetPattern.addAll(Arrays.asList(targetPattern)); + return this; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ *

Based on the availability of matching units and the limits from the triggerPattern or maxOccurence, the targetPattern can match multiple times.

+ * @param builder function to build the targetPattern value + * @return Builder + */ + + public CartDiscountPatternTargetBuilder plusTargetPattern( + Function> builder) { + if (this.targetPattern == null) { + this.targetPattern = new ArrayList<>(); + } + this.targetPattern + .add(builder.apply(com.commercetools.api.models.cart_discount.PatternComponentBuilder.of()).build()); + return this; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ *

Based on the availability of matching units and the limits from the triggerPattern or maxOccurence, the targetPattern can match multiple times.

+ * @param builder function to build the targetPattern value + * @return Builder + */ + + public CartDiscountPatternTargetBuilder withTargetPattern( + Function> builder) { + this.targetPattern = new ArrayList<>(); + this.targetPattern + .add(builder.apply(com.commercetools.api.models.cart_discount.PatternComponentBuilder.of()).build()); + return this; + } + + /** + *

Maximum number of times the Discount can apply on a Cart.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @param maxOccurrence value to be set + * @return Builder + */ + + public CartDiscountPatternTargetBuilder maxOccurrence(@Nullable final Integer maxOccurrence) { + this.maxOccurrence = maxOccurrence; + return this; + } + + /** + *

Determines which of the matching units of (Custom) Line Items are discounted.

+ * @param selectionMode value to be set + * @return Builder + */ + + public CartDiscountPatternTargetBuilder selectionMode( + final com.commercetools.api.models.cart_discount.SelectionMode selectionMode) { + this.selectionMode = selectionMode; + return this; + } + + /** + *

Units of a (Custom) Line Item that trigger a discount application.

+ *

Based on the availability of matching units, the triggerPattern can match multiple times, effecting the number of times the discount will be applied. To further limit the discount application, set the maxOccurrence.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @return triggerPattern + */ + + @Nullable + public java.util.List getTriggerPattern() { + return this.triggerPattern; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ *

Based on the availability of matching units and the limits from the triggerPattern or maxOccurence, the targetPattern can match multiple times.

+ * @return targetPattern + */ + + public java.util.List getTargetPattern() { + return this.targetPattern; + } + + /** + *

Maximum number of times the Discount can apply on a Cart.

+ *

If empty or not set, the Discount will apply indefinitely.

+ * @return maxOccurrence + */ + + @Nullable + public Integer getMaxOccurrence() { + return this.maxOccurrence; + } + + /** + *

Determines which of the matching units of (Custom) Line Items are discounted.

+ * @return selectionMode + */ + + public com.commercetools.api.models.cart_discount.SelectionMode getSelectionMode() { + return this.selectionMode; + } + + /** + * builds CartDiscountPatternTarget with checking for non-null required values + * @return CartDiscountPatternTarget + */ + public CartDiscountPatternTarget build() { + Objects.requireNonNull(targetPattern, CartDiscountPatternTarget.class + ": targetPattern is missing"); + Objects.requireNonNull(selectionMode, CartDiscountPatternTarget.class + ": selectionMode is missing"); + return new CartDiscountPatternTargetImpl(triggerPattern, targetPattern, maxOccurrence, selectionMode); + } + + /** + * builds CartDiscountPatternTarget without checking for non-null required values + * @return CartDiscountPatternTarget + */ + public CartDiscountPatternTarget buildUnchecked() { + return new CartDiscountPatternTargetImpl(triggerPattern, targetPattern, maxOccurrence, selectionMode); + } + + /** + * factory method for an instance of CartDiscountPatternTargetBuilder + * @return builder + */ + public static CartDiscountPatternTargetBuilder of() { + return new CartDiscountPatternTargetBuilder(); + } + + /** + * create builder for CartDiscountPatternTarget instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static CartDiscountPatternTargetBuilder of(final CartDiscountPatternTarget template) { + CartDiscountPatternTargetBuilder builder = new CartDiscountPatternTargetBuilder(); + builder.triggerPattern = template.getTriggerPattern(); + builder.targetPattern = template.getTargetPattern(); + builder.maxOccurrence = template.getMaxOccurrence(); + builder.selectionMode = template.getSelectionMode(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetImpl.java new file mode 100644 index 00000000000..00efbfe4887 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetImpl.java @@ -0,0 +1,172 @@ + +package com.commercetools.api.models.cart_discount; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + *

Pattern targets can be used to model Buy and Get discounts.

+ *

Unlike CartDiscountLineItemsTarget and CartDiscountCustomLineItemsTarget, it does not apply to a (Custom) Line Item as a whole, but to individual units of a (Custom) Line Item. The discounts can apply multiple times on the same cart, but each unit can be discounted only once.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class CartDiscountPatternTargetImpl implements CartDiscountPatternTarget, ModelBase { + + private String type; + + private java.util.List triggerPattern; + + private java.util.List targetPattern; + + private Integer maxOccurrence; + + private com.commercetools.api.models.cart_discount.SelectionMode selectionMode; + + /** + * create instance with all properties + */ + @JsonCreator + CartDiscountPatternTargetImpl( + @JsonProperty("triggerPattern") final java.util.List triggerPattern, + @JsonProperty("targetPattern") final java.util.List targetPattern, + @JsonProperty("maxOccurrence") final Integer maxOccurrence, + @JsonProperty("selectionMode") final com.commercetools.api.models.cart_discount.SelectionMode selectionMode) { + this.triggerPattern = triggerPattern; + this.targetPattern = targetPattern; + this.maxOccurrence = maxOccurrence; + this.selectionMode = selectionMode; + this.type = PATTERN; + } + + /** + * create empty instance + */ + public CartDiscountPatternTargetImpl() { + this.type = PATTERN; + } + + /** + * + */ + + public String getType() { + return this.type; + } + + /** + *

Units of a (Custom) Line Item that trigger a discount application.

+ *

Based on the availability of matching units, the triggerPattern can match multiple times, effecting the number of times the discount will be applied. To further limit the discount application, set the maxOccurrence.

+ *

If empty or not set, the Discount will apply indefinitely.

+ */ + + public java.util.List getTriggerPattern() { + return this.triggerPattern; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ *

Based on the availability of matching units and the limits from the triggerPattern or maxOccurence, the targetPattern can match multiple times.

+ */ + + public java.util.List getTargetPattern() { + return this.targetPattern; + } + + /** + *

Maximum number of times the Discount can apply on a Cart.

+ *

If empty or not set, the Discount will apply indefinitely.

+ */ + + public Integer getMaxOccurrence() { + return this.maxOccurrence; + } + + /** + *

Determines which of the matching units of (Custom) Line Items are discounted.

+ */ + + public com.commercetools.api.models.cart_discount.SelectionMode getSelectionMode() { + return this.selectionMode; + } + + public void setTriggerPattern(final com.commercetools.api.models.cart_discount.PatternComponent... triggerPattern) { + this.triggerPattern = new ArrayList<>(Arrays.asList(triggerPattern)); + } + + public void setTriggerPattern( + final java.util.List triggerPattern) { + this.triggerPattern = triggerPattern; + } + + public void setTargetPattern(final com.commercetools.api.models.cart_discount.PatternComponent... targetPattern) { + this.targetPattern = new ArrayList<>(Arrays.asList(targetPattern)); + } + + public void setTargetPattern( + final java.util.List targetPattern) { + this.targetPattern = targetPattern; + } + + public void setMaxOccurrence(final Integer maxOccurrence) { + this.maxOccurrence = maxOccurrence; + } + + public void setSelectionMode(final com.commercetools.api.models.cart_discount.SelectionMode selectionMode) { + this.selectionMode = selectionMode; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + CartDiscountPatternTargetImpl that = (CartDiscountPatternTargetImpl) o; + + return new EqualsBuilder().append(type, that.type) + .append(triggerPattern, that.triggerPattern) + .append(targetPattern, that.targetPattern) + .append(maxOccurrence, that.maxOccurrence) + .append(selectionMode, that.selectionMode) + .append(type, that.type) + .append(triggerPattern, that.triggerPattern) + .append(targetPattern, that.targetPattern) + .append(maxOccurrence, that.maxOccurrence) + .append(selectionMode, that.selectionMode) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type) + .append(triggerPattern) + .append(targetPattern) + .append(maxOccurrence) + .append(selectionMode) + .toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type) + .append("triggerPattern", triggerPattern) + .append("targetPattern", targetPattern) + .append("maxOccurrence", maxOccurrence) + .append("selectionMode", selectionMode) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountTarget.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountTarget.java index e20c8493967..1fbfccd43a5 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountTarget.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountTarget.java @@ -30,6 +30,7 @@ @JsonSubTypes({ @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CartDiscountCustomLineItemsTargetImpl.class, name = CartDiscountCustomLineItemsTarget.CUSTOM_LINE_ITEMS), @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CartDiscountLineItemsTargetImpl.class, name = CartDiscountLineItemsTarget.LINE_ITEMS), + @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CartDiscountPatternTargetImpl.class, name = CartDiscountPatternTarget.PATTERN), @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CartDiscountShippingCostTargetImpl.class, name = CartDiscountShippingCostTarget.SHIPPING), @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CartDiscountTotalPriceTargetImpl.class, name = CartDiscountTotalPriceTarget.TOTAL_PRICE), @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.MultiBuyCustomLineItemsTargetImpl.class, name = MultiBuyCustomLineItemsTarget.MULTI_BUY_CUSTOM_LINE_ITEMS), @@ -65,6 +66,10 @@ public static CartDiscountTarget deepCopy(@Nullable final CartDiscountTarget tem return com.commercetools.api.models.cart_discount.CartDiscountLineItemsTarget .deepCopy((com.commercetools.api.models.cart_discount.CartDiscountLineItemsTarget) template); } + if (template instanceof com.commercetools.api.models.cart_discount.CartDiscountPatternTarget) { + return com.commercetools.api.models.cart_discount.CartDiscountPatternTarget + .deepCopy((com.commercetools.api.models.cart_discount.CartDiscountPatternTarget) template); + } if (template instanceof com.commercetools.api.models.cart_discount.CartDiscountShippingCostTarget) { return com.commercetools.api.models.cart_discount.CartDiscountShippingCostTarget .deepCopy((com.commercetools.api.models.cart_discount.CartDiscountShippingCostTarget) template); @@ -101,6 +106,14 @@ public static com.commercetools.api.models.cart_discount.CartDiscountLineItemsTa return com.commercetools.api.models.cart_discount.CartDiscountLineItemsTargetBuilder.of(); } + /** + * builder for pattern subtype + * @return builder + */ + public static com.commercetools.api.models.cart_discount.CartDiscountPatternTargetBuilder patternBuilder() { + return com.commercetools.api.models.cart_discount.CartDiscountPatternTargetBuilder.of(); + } + /** * builder for shipping subtype * @return builder diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountTargetBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountTargetBuilder.java index 842af07d730..e1428c0d964 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountTargetBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountTargetBuilder.java @@ -19,6 +19,10 @@ public com.commercetools.api.models.cart_discount.CartDiscountLineItemsTargetBui return com.commercetools.api.models.cart_discount.CartDiscountLineItemsTargetBuilder.of(); } + public com.commercetools.api.models.cart_discount.CartDiscountPatternTargetBuilder patternBuilder() { + return com.commercetools.api.models.cart_discount.CartDiscountPatternTargetBuilder.of(); + } + public com.commercetools.api.models.cart_discount.CartDiscountShippingCostTargetBuilder shippingBuilder() { return com.commercetools.api.models.cart_discount.CartDiscountShippingCostTargetBuilder.of(); } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixed.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixed.java index 4eef9dd9ca7..5ddc84a8558 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixed.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixed.java @@ -48,6 +48,15 @@ public interface CartDiscountValueFixed extends CartDiscountValue, CartDiscountV @JsonProperty("money") public List getMoney(); + /** + *

Indicates how the discount is applied on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

+ *

For CartDiscountPatternTarget, the mode can also be ProportionateDistribution or EvenDistribution.

+ * @return applicationMode + */ + + @JsonProperty("applicationMode") + public DiscountApplicationMode getApplicationMode(); + /** *

Money values in cent precision or high precision of different currencies.

* @param money values to be set @@ -63,6 +72,14 @@ public interface CartDiscountValueFixed extends CartDiscountValue, CartDiscountV public void setMoney(final List money); + /** + *

Indicates how the discount is applied on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

+ *

For CartDiscountPatternTarget, the mode can also be ProportionateDistribution or EvenDistribution.

+ * @param applicationMode value to be set + */ + + public void setApplicationMode(final DiscountApplicationMode applicationMode); + /** * factory method * @return instance of CartDiscountValueFixed @@ -79,6 +96,7 @@ public static CartDiscountValueFixed of() { public static CartDiscountValueFixed of(final CartDiscountValueFixed template) { CartDiscountValueFixedImpl instance = new CartDiscountValueFixedImpl(); instance.setMoney(template.getMoney()); + instance.setApplicationMode(template.getApplicationMode()); return instance; } @@ -98,6 +116,7 @@ public static CartDiscountValueFixed deepCopy(@Nullable final CartDiscountValueF .map(com.commercetools.api.models.common.TypedMoney::deepCopy) .collect(Collectors.toList())) .orElse(null)); + instance.setApplicationMode(template.getApplicationMode()); return instance; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedBuilder.java index a192098d30b..5d31b2ebcda 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedBuilder.java @@ -4,6 +4,8 @@ import java.util.*; import java.util.function.Function; +import javax.annotation.Nullable; + import io.vrap.rmf.base.client.Builder; import io.vrap.rmf.base.client.utils.Generated; @@ -24,6 +26,9 @@ public class CartDiscountValueFixedBuilder implements Builder money; + @Nullable + private com.commercetools.api.models.cart_discount.DiscountApplicationMode applicationMode; + /** *

Money values in cent precision or high precision of different currencies.

* @param money value to be set @@ -89,6 +94,19 @@ public CartDiscountValueFixedBuilder withMoney( return this; } + /** + *

Indicates how the discount is applied on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

+ *

For CartDiscountPatternTarget, the mode can also be ProportionateDistribution or EvenDistribution.

+ * @param applicationMode value to be set + * @return Builder + */ + + public CartDiscountValueFixedBuilder applicationMode( + @Nullable final com.commercetools.api.models.cart_discount.DiscountApplicationMode applicationMode) { + this.applicationMode = applicationMode; + return this; + } + /** *

Money values in cent precision or high precision of different currencies.

* @return money @@ -98,13 +116,24 @@ public java.util.List getMoney() return this.money; } + /** + *

Indicates how the discount is applied on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

+ *

For CartDiscountPatternTarget, the mode can also be ProportionateDistribution or EvenDistribution.

+ * @return applicationMode + */ + + @Nullable + public com.commercetools.api.models.cart_discount.DiscountApplicationMode getApplicationMode() { + return this.applicationMode; + } + /** * builds CartDiscountValueFixed with checking for non-null required values * @return CartDiscountValueFixed */ public CartDiscountValueFixed build() { Objects.requireNonNull(money, CartDiscountValueFixed.class + ": money is missing"); - return new CartDiscountValueFixedImpl(money); + return new CartDiscountValueFixedImpl(money, applicationMode); } /** @@ -112,7 +141,7 @@ public CartDiscountValueFixed build() { * @return CartDiscountValueFixed */ public CartDiscountValueFixed buildUnchecked() { - return new CartDiscountValueFixedImpl(money); + return new CartDiscountValueFixedImpl(money, applicationMode); } /** @@ -131,6 +160,7 @@ public static CartDiscountValueFixedBuilder of() { public static CartDiscountValueFixedBuilder of(final CartDiscountValueFixed template) { CartDiscountValueFixedBuilder builder = new CartDiscountValueFixedBuilder(); builder.money = template.getMoney(); + builder.applicationMode = template.getApplicationMode(); return builder; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraft.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraft.java index c128f6de226..20c551ac435 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraft.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraft.java @@ -50,6 +50,15 @@ public interface CartDiscountValueFixedDraft @JsonProperty("money") public List getMoney(); + /** + *

Determines how the discount applies on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

+ *

For CartDiscountPatternTarget, you can also set the mode to ProportionateDistribution or EvenDistribution.

+ * @return applicationMode + */ + + @JsonProperty("applicationMode") + public DiscountApplicationMode getApplicationMode(); + /** *

Money values provided either in cent precision or high precision for different currencies. A fixed Cart Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$. If the array has multiple values of the same currency, the API returns an InvalidOperation error.

*

If the array is empty, the discount does not apply.

@@ -67,6 +76,14 @@ public interface CartDiscountValueFixedDraft public void setMoney(final List money); + /** + *

Determines how the discount applies on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

+ *

For CartDiscountPatternTarget, you can also set the mode to ProportionateDistribution or EvenDistribution.

+ * @param applicationMode value to be set + */ + + public void setApplicationMode(final DiscountApplicationMode applicationMode); + /** * factory method * @return instance of CartDiscountValueFixedDraft @@ -83,6 +100,7 @@ public static CartDiscountValueFixedDraft of() { public static CartDiscountValueFixedDraft of(final CartDiscountValueFixedDraft template) { CartDiscountValueFixedDraftImpl instance = new CartDiscountValueFixedDraftImpl(); instance.setMoney(template.getMoney()); + instance.setApplicationMode(template.getApplicationMode()); return instance; } @@ -102,6 +120,7 @@ public static CartDiscountValueFixedDraft deepCopy(@Nullable final CartDiscountV .map(com.commercetools.api.models.common.Money::deepCopy) .collect(Collectors.toList())) .orElse(null)); + instance.setApplicationMode(template.getApplicationMode()); return instance; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftBuilder.java index 067402bb73b..04d2b95a4d7 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftBuilder.java @@ -4,6 +4,8 @@ import java.util.*; import java.util.function.Function; +import javax.annotation.Nullable; + import io.vrap.rmf.base.client.Builder; import io.vrap.rmf.base.client.utils.Generated; @@ -24,6 +26,9 @@ public class CartDiscountValueFixedDraftBuilder implements Builder money; + @Nullable + private com.commercetools.api.models.cart_discount.DiscountApplicationMode applicationMode; + /** *

Money values provided either in cent precision or high precision for different currencies. A fixed Cart Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$. If the array has multiple values of the same currency, the API returns an InvalidOperation error.

*

If the array is empty, the discount does not apply.

@@ -118,6 +123,19 @@ public CartDiscountValueFixedDraftBuilder setMoney( return money(builder.apply(com.commercetools.api.models.common.MoneyBuilder.of())); } + /** + *

Determines how the discount applies on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

+ *

For CartDiscountPatternTarget, you can also set the mode to ProportionateDistribution or EvenDistribution.

+ * @param applicationMode value to be set + * @return Builder + */ + + public CartDiscountValueFixedDraftBuilder applicationMode( + @Nullable final com.commercetools.api.models.cart_discount.DiscountApplicationMode applicationMode) { + this.applicationMode = applicationMode; + return this; + } + /** *

Money values provided either in cent precision or high precision for different currencies. A fixed Cart Discount will match a price only if the array contains a value with the same currency. For example, if it contains 10€ and 15$, the matching € price will be discounted by 10€ and the matching $ price will be discounted to 15$. If the array has multiple values of the same currency, the API returns an InvalidOperation error.

*

If the array is empty, the discount does not apply.

@@ -128,13 +146,24 @@ public java.util.List getMoney() { return this.money; } + /** + *

Determines how the discount applies on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

+ *

For CartDiscountPatternTarget, you can also set the mode to ProportionateDistribution or EvenDistribution.

+ * @return applicationMode + */ + + @Nullable + public com.commercetools.api.models.cart_discount.DiscountApplicationMode getApplicationMode() { + return this.applicationMode; + } + /** * builds CartDiscountValueFixedDraft with checking for non-null required values * @return CartDiscountValueFixedDraft */ public CartDiscountValueFixedDraft build() { Objects.requireNonNull(money, CartDiscountValueFixedDraft.class + ": money is missing"); - return new CartDiscountValueFixedDraftImpl(money); + return new CartDiscountValueFixedDraftImpl(money, applicationMode); } /** @@ -142,7 +171,7 @@ public CartDiscountValueFixedDraft build() { * @return CartDiscountValueFixedDraft */ public CartDiscountValueFixedDraft buildUnchecked() { - return new CartDiscountValueFixedDraftImpl(money); + return new CartDiscountValueFixedDraftImpl(money, applicationMode); } /** @@ -161,6 +190,7 @@ public static CartDiscountValueFixedDraftBuilder of() { public static CartDiscountValueFixedDraftBuilder of(final CartDiscountValueFixedDraft template) { CartDiscountValueFixedDraftBuilder builder = new CartDiscountValueFixedDraftBuilder(); builder.money = template.getMoney(); + builder.applicationMode = template.getApplicationMode(); return builder; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftImpl.java index e7b840aa903..16cc1817934 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftImpl.java @@ -26,13 +26,17 @@ public class CartDiscountValueFixedDraftImpl implements CartDiscountValueFixedDr private java.util.List money; + private com.commercetools.api.models.cart_discount.DiscountApplicationMode applicationMode; + /** * create instance with all properties */ @JsonCreator CartDiscountValueFixedDraftImpl( - @JsonProperty("money") final java.util.List money) { + @JsonProperty("money") final java.util.List money, + @JsonProperty("applicationMode") final com.commercetools.api.models.cart_discount.DiscountApplicationMode applicationMode) { this.money = money; + this.applicationMode = applicationMode; this.type = FIXED; } @@ -60,6 +64,15 @@ public java.util.List getMoney() { return this.money; } + /** + *

Determines how the discount applies on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

+ *

For CartDiscountPatternTarget, you can also set the mode to ProportionateDistribution or EvenDistribution.

+ */ + + public com.commercetools.api.models.cart_discount.DiscountApplicationMode getApplicationMode() { + return this.applicationMode; + } + public void setMoney(final com.commercetools.api.models.common.Money... money) { this.money = new ArrayList<>(Arrays.asList(money)); } @@ -68,6 +81,11 @@ public void setMoney(final java.util.List money; + private com.commercetools.api.models.cart_discount.DiscountApplicationMode applicationMode; + /** * create instance with all properties */ @JsonCreator CartDiscountValueFixedImpl( - @JsonProperty("money") final java.util.List money) { + @JsonProperty("money") final java.util.List money, + @JsonProperty("applicationMode") final com.commercetools.api.models.cart_discount.DiscountApplicationMode applicationMode) { this.money = money; + this.applicationMode = applicationMode; this.type = FIXED; } @@ -59,6 +63,15 @@ public java.util.List getMoney() return this.money; } + /** + *

Indicates how the discount is applied on CartDiscountLineItemTarget or CartDiscountCustomLineItemTarget.

+ *

For CartDiscountPatternTarget, the mode can also be ProportionateDistribution or EvenDistribution.

+ */ + + public com.commercetools.api.models.cart_discount.DiscountApplicationMode getApplicationMode() { + return this.applicationMode; + } + public void setMoney(final com.commercetools.api.models.common.TypedMoney... money) { this.money = new ArrayList<>(Arrays.asList(money)); } @@ -67,6 +80,11 @@ public void setMoney(final java.util.List + * Example to create an instance using the builder pattern + *
+ *

+ *     CountOnCustomLineItemUnits countOnCustomLineItemUnits = CountOnCustomLineItemUnits.builder()
+ *             .predicate("{predicate}")
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = CountOnCustomLineItemUnitsImpl.class) +public interface CountOnCustomLineItemUnits extends PatternComponent { + + /** + * discriminator value for CountOnCustomLineItemUnits + */ + String COUNT_ON_CUSTOM_LINE_ITEM_UNITS = "CountOnCustomLineItemUnits"; + + /** + *

Valid CustomLineItem predicate that determines the units participating in the Discount.

+ * @return predicate + */ + @NotNull + @JsonProperty("predicate") + public String getPredicate(); + + /** + *

Minimum number of units of a Custom Line Item that match the predicate.

+ * @return minCount + */ + + @JsonProperty("minCount") + public Integer getMinCount(); + + /** + *

Maximum number of units of a Custom Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.

+ *

The value must be greater than or equal to minCount. If not provided, the component will match all units that satisfy the predicate.

+ * @return maxCount + */ + + @JsonProperty("maxCount") + public Integer getMaxCount(); + + /** + *

Number of units of a Custom Line Item to exclude on every application of the Discount.

+ *

Set only when configuring the targetPattern.

+ *

The units matched first (satisfying the pattern component) will be excluded from the resulting set. The minCountand maxCount are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, the excludeCount value must be 2.

+ * @return excludeCount + */ + + @JsonProperty("excludeCount") + public Integer getExcludeCount(); + + /** + *

Valid CustomLineItem predicate that determines the units participating in the Discount.

+ * @param predicate value to be set + */ + + public void setPredicate(final String predicate); + + /** + *

Minimum number of units of a Custom Line Item that match the predicate.

+ * @param minCount value to be set + */ + + public void setMinCount(final Integer minCount); + + /** + *

Maximum number of units of a Custom Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.

+ *

The value must be greater than or equal to minCount. If not provided, the component will match all units that satisfy the predicate.

+ * @param maxCount value to be set + */ + + public void setMaxCount(final Integer maxCount); + + /** + *

Number of units of a Custom Line Item to exclude on every application of the Discount.

+ *

Set only when configuring the targetPattern.

+ *

The units matched first (satisfying the pattern component) will be excluded from the resulting set. The minCountand maxCount are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, the excludeCount value must be 2.

+ * @param excludeCount value to be set + */ + + public void setExcludeCount(final Integer excludeCount); + + /** + * factory method + * @return instance of CountOnCustomLineItemUnits + */ + public static CountOnCustomLineItemUnits of() { + return new CountOnCustomLineItemUnitsImpl(); + } + + /** + * factory method to create a shallow copy CountOnCustomLineItemUnits + * @param template instance to be copied + * @return copy instance + */ + public static CountOnCustomLineItemUnits of(final CountOnCustomLineItemUnits template) { + CountOnCustomLineItemUnitsImpl instance = new CountOnCustomLineItemUnitsImpl(); + instance.setPredicate(template.getPredicate()); + instance.setMinCount(template.getMinCount()); + instance.setMaxCount(template.getMaxCount()); + instance.setExcludeCount(template.getExcludeCount()); + return instance; + } + + /** + * factory method to create a deep copy of CountOnCustomLineItemUnits + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static CountOnCustomLineItemUnits deepCopy(@Nullable final CountOnCustomLineItemUnits template) { + if (template == null) { + return null; + } + CountOnCustomLineItemUnitsImpl instance = new CountOnCustomLineItemUnitsImpl(); + instance.setPredicate(template.getPredicate()); + instance.setMinCount(template.getMinCount()); + instance.setMaxCount(template.getMaxCount()); + instance.setExcludeCount(template.getExcludeCount()); + return instance; + } + + /** + * builder factory method for CountOnCustomLineItemUnits + * @return builder + */ + public static CountOnCustomLineItemUnitsBuilder builder() { + return CountOnCustomLineItemUnitsBuilder.of(); + } + + /** + * create builder for CountOnCustomLineItemUnits instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static CountOnCustomLineItemUnitsBuilder builder(final CountOnCustomLineItemUnits template) { + return CountOnCustomLineItemUnitsBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withCountOnCustomLineItemUnits(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsBuilder.java new file mode 100644 index 00000000000..198317fea46 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsBuilder.java @@ -0,0 +1,165 @@ + +package com.commercetools.api.models.cart_discount; + +import java.util.*; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * CountOnCustomLineItemUnitsBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     CountOnCustomLineItemUnits countOnCustomLineItemUnits = CountOnCustomLineItemUnits.builder()
+ *             .predicate("{predicate}")
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class CountOnCustomLineItemUnitsBuilder implements Builder { + + private String predicate; + + @Nullable + private Integer minCount; + + @Nullable + private Integer maxCount; + + @Nullable + private Integer excludeCount; + + /** + *

Valid CustomLineItem predicate that determines the units participating in the Discount.

+ * @param predicate value to be set + * @return Builder + */ + + public CountOnCustomLineItemUnitsBuilder predicate(final String predicate) { + this.predicate = predicate; + return this; + } + + /** + *

Minimum number of units of a Custom Line Item that match the predicate.

+ * @param minCount value to be set + * @return Builder + */ + + public CountOnCustomLineItemUnitsBuilder minCount(@Nullable final Integer minCount) { + this.minCount = minCount; + return this; + } + + /** + *

Maximum number of units of a Custom Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.

+ *

The value must be greater than or equal to minCount. If not provided, the component will match all units that satisfy the predicate.

+ * @param maxCount value to be set + * @return Builder + */ + + public CountOnCustomLineItemUnitsBuilder maxCount(@Nullable final Integer maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + *

Number of units of a Custom Line Item to exclude on every application of the Discount.

+ *

Set only when configuring the targetPattern.

+ *

The units matched first (satisfying the pattern component) will be excluded from the resulting set. The minCountand maxCount are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, the excludeCount value must be 2.

+ * @param excludeCount value to be set + * @return Builder + */ + + public CountOnCustomLineItemUnitsBuilder excludeCount(@Nullable final Integer excludeCount) { + this.excludeCount = excludeCount; + return this; + } + + /** + *

Valid CustomLineItem predicate that determines the units participating in the Discount.

+ * @return predicate + */ + + public String getPredicate() { + return this.predicate; + } + + /** + *

Minimum number of units of a Custom Line Item that match the predicate.

+ * @return minCount + */ + + @Nullable + public Integer getMinCount() { + return this.minCount; + } + + /** + *

Maximum number of units of a Custom Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.

+ *

The value must be greater than or equal to minCount. If not provided, the component will match all units that satisfy the predicate.

+ * @return maxCount + */ + + @Nullable + public Integer getMaxCount() { + return this.maxCount; + } + + /** + *

Number of units of a Custom Line Item to exclude on every application of the Discount.

+ *

Set only when configuring the targetPattern.

+ *

The units matched first (satisfying the pattern component) will be excluded from the resulting set. The minCountand maxCount are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, the excludeCount value must be 2.

+ * @return excludeCount + */ + + @Nullable + public Integer getExcludeCount() { + return this.excludeCount; + } + + /** + * builds CountOnCustomLineItemUnits with checking for non-null required values + * @return CountOnCustomLineItemUnits + */ + public CountOnCustomLineItemUnits build() { + Objects.requireNonNull(predicate, CountOnCustomLineItemUnits.class + ": predicate is missing"); + return new CountOnCustomLineItemUnitsImpl(predicate, minCount, maxCount, excludeCount); + } + + /** + * builds CountOnCustomLineItemUnits without checking for non-null required values + * @return CountOnCustomLineItemUnits + */ + public CountOnCustomLineItemUnits buildUnchecked() { + return new CountOnCustomLineItemUnitsImpl(predicate, minCount, maxCount, excludeCount); + } + + /** + * factory method for an instance of CountOnCustomLineItemUnitsBuilder + * @return builder + */ + public static CountOnCustomLineItemUnitsBuilder of() { + return new CountOnCustomLineItemUnitsBuilder(); + } + + /** + * create builder for CountOnCustomLineItemUnits instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static CountOnCustomLineItemUnitsBuilder of(final CountOnCustomLineItemUnits template) { + CountOnCustomLineItemUnitsBuilder builder = new CountOnCustomLineItemUnitsBuilder(); + builder.predicate = template.getPredicate(); + builder.minCount = template.getMinCount(); + builder.maxCount = template.getMaxCount(); + builder.excludeCount = template.getExcludeCount(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsImpl.java new file mode 100644 index 00000000000..9e69d29b631 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsImpl.java @@ -0,0 +1,158 @@ + +package com.commercetools.api.models.cart_discount; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * CountOnCustomLineItemUnits + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class CountOnCustomLineItemUnitsImpl implements CountOnCustomLineItemUnits, ModelBase { + + private String type; + + private String predicate; + + private Integer minCount; + + private Integer maxCount; + + private Integer excludeCount; + + /** + * create instance with all properties + */ + @JsonCreator + CountOnCustomLineItemUnitsImpl(@JsonProperty("predicate") final String predicate, + @JsonProperty("minCount") final Integer minCount, @JsonProperty("maxCount") final Integer maxCount, + @JsonProperty("excludeCount") final Integer excludeCount) { + this.predicate = predicate; + this.minCount = minCount; + this.maxCount = maxCount; + this.excludeCount = excludeCount; + this.type = COUNT_ON_CUSTOM_LINE_ITEM_UNITS; + } + + /** + * create empty instance + */ + public CountOnCustomLineItemUnitsImpl() { + this.type = COUNT_ON_CUSTOM_LINE_ITEM_UNITS; + } + + /** + * + */ + + public String getType() { + return this.type; + } + + /** + *

Valid CustomLineItem predicate that determines the units participating in the Discount.

+ */ + + public String getPredicate() { + return this.predicate; + } + + /** + *

Minimum number of units of a Custom Line Item that match the predicate.

+ */ + + public Integer getMinCount() { + return this.minCount; + } + + /** + *

Maximum number of units of a Custom Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.

+ *

The value must be greater than or equal to minCount. If not provided, the component will match all units that satisfy the predicate.

+ */ + + public Integer getMaxCount() { + return this.maxCount; + } + + /** + *

Number of units of a Custom Line Item to exclude on every application of the Discount.

+ *

Set only when configuring the targetPattern.

+ *

The units matched first (satisfying the pattern component) will be excluded from the resulting set. The minCountand maxCount are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, the excludeCount value must be 2.

+ */ + + public Integer getExcludeCount() { + return this.excludeCount; + } + + public void setPredicate(final String predicate) { + this.predicate = predicate; + } + + public void setMinCount(final Integer minCount) { + this.minCount = minCount; + } + + public void setMaxCount(final Integer maxCount) { + this.maxCount = maxCount; + } + + public void setExcludeCount(final Integer excludeCount) { + this.excludeCount = excludeCount; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + CountOnCustomLineItemUnitsImpl that = (CountOnCustomLineItemUnitsImpl) o; + + return new EqualsBuilder().append(type, that.type) + .append(predicate, that.predicate) + .append(minCount, that.minCount) + .append(maxCount, that.maxCount) + .append(excludeCount, that.excludeCount) + .append(type, that.type) + .append(predicate, that.predicate) + .append(minCount, that.minCount) + .append(maxCount, that.maxCount) + .append(excludeCount, that.excludeCount) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type) + .append(predicate) + .append(minCount) + .append(maxCount) + .append(excludeCount) + .toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type) + .append("predicate", predicate) + .append("minCount", minCount) + .append("maxCount", maxCount) + .append("excludeCount", excludeCount) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnits.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnits.java new file mode 100644 index 00000000000..c4f7d5e5dfd --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnits.java @@ -0,0 +1,184 @@ + +package com.commercetools.api.models.cart_discount; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.constraints.NotNull; + +/** + * CountOnLineItemUnits + * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     CountOnLineItemUnits countOnLineItemUnits = CountOnLineItemUnits.builder()
+ *             .predicate("{predicate}")
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = CountOnLineItemUnitsImpl.class) +public interface CountOnLineItemUnits extends PatternComponent { + + /** + * discriminator value for CountOnLineItemUnits + */ + String COUNT_ON_LINE_ITEM_UNITS = "CountOnLineItemUnits"; + + /** + *

Valid LineItem predicate that determines the units participating in the Discount.

+ * @return predicate + */ + @NotNull + @JsonProperty("predicate") + public String getPredicate(); + + /** + *

Minimum number of units of a Line Item that match the predicate.

+ * @return minCount + */ + + @JsonProperty("minCount") + public Integer getMinCount(); + + /** + *

Maximum number of units of a Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.

+ *

The value must be greater than or equal to minCount. If not provided, the component will match all units that satisfy the predicate.

+ * @return maxCount + */ + + @JsonProperty("maxCount") + public Integer getMaxCount(); + + /** + *

Number of units of a Line Item to exclude on every application of the Discount.

+ *

Set only when configuring the targetPattern.

+ *

The units matched first (satisfying the pattern component) will be excluded from the resulting set. The minCountand maxCount are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, the excludeCount value must be 2.

+ * @return excludeCount + */ + + @JsonProperty("excludeCount") + public Integer getExcludeCount(); + + /** + *

Valid LineItem predicate that determines the units participating in the Discount.

+ * @param predicate value to be set + */ + + public void setPredicate(final String predicate); + + /** + *

Minimum number of units of a Line Item that match the predicate.

+ * @param minCount value to be set + */ + + public void setMinCount(final Integer minCount); + + /** + *

Maximum number of units of a Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.

+ *

The value must be greater than or equal to minCount. If not provided, the component will match all units that satisfy the predicate.

+ * @param maxCount value to be set + */ + + public void setMaxCount(final Integer maxCount); + + /** + *

Number of units of a Line Item to exclude on every application of the Discount.

+ *

Set only when configuring the targetPattern.

+ *

The units matched first (satisfying the pattern component) will be excluded from the resulting set. The minCountand maxCount are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, the excludeCount value must be 2.

+ * @param excludeCount value to be set + */ + + public void setExcludeCount(final Integer excludeCount); + + /** + * factory method + * @return instance of CountOnLineItemUnits + */ + public static CountOnLineItemUnits of() { + return new CountOnLineItemUnitsImpl(); + } + + /** + * factory method to create a shallow copy CountOnLineItemUnits + * @param template instance to be copied + * @return copy instance + */ + public static CountOnLineItemUnits of(final CountOnLineItemUnits template) { + CountOnLineItemUnitsImpl instance = new CountOnLineItemUnitsImpl(); + instance.setPredicate(template.getPredicate()); + instance.setMinCount(template.getMinCount()); + instance.setMaxCount(template.getMaxCount()); + instance.setExcludeCount(template.getExcludeCount()); + return instance; + } + + /** + * factory method to create a deep copy of CountOnLineItemUnits + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static CountOnLineItemUnits deepCopy(@Nullable final CountOnLineItemUnits template) { + if (template == null) { + return null; + } + CountOnLineItemUnitsImpl instance = new CountOnLineItemUnitsImpl(); + instance.setPredicate(template.getPredicate()); + instance.setMinCount(template.getMinCount()); + instance.setMaxCount(template.getMaxCount()); + instance.setExcludeCount(template.getExcludeCount()); + return instance; + } + + /** + * builder factory method for CountOnLineItemUnits + * @return builder + */ + public static CountOnLineItemUnitsBuilder builder() { + return CountOnLineItemUnitsBuilder.of(); + } + + /** + * create builder for CountOnLineItemUnits instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static CountOnLineItemUnitsBuilder builder(final CountOnLineItemUnits template) { + return CountOnLineItemUnitsBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withCountOnLineItemUnits(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsBuilder.java new file mode 100644 index 00000000000..11784937cf9 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsBuilder.java @@ -0,0 +1,165 @@ + +package com.commercetools.api.models.cart_discount; + +import java.util.*; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * CountOnLineItemUnitsBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     CountOnLineItemUnits countOnLineItemUnits = CountOnLineItemUnits.builder()
+ *             .predicate("{predicate}")
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class CountOnLineItemUnitsBuilder implements Builder { + + private String predicate; + + @Nullable + private Integer minCount; + + @Nullable + private Integer maxCount; + + @Nullable + private Integer excludeCount; + + /** + *

Valid LineItem predicate that determines the units participating in the Discount.

+ * @param predicate value to be set + * @return Builder + */ + + public CountOnLineItemUnitsBuilder predicate(final String predicate) { + this.predicate = predicate; + return this; + } + + /** + *

Minimum number of units of a Line Item that match the predicate.

+ * @param minCount value to be set + * @return Builder + */ + + public CountOnLineItemUnitsBuilder minCount(@Nullable final Integer minCount) { + this.minCount = minCount; + return this; + } + + /** + *

Maximum number of units of a Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.

+ *

The value must be greater than or equal to minCount. If not provided, the component will match all units that satisfy the predicate.

+ * @param maxCount value to be set + * @return Builder + */ + + public CountOnLineItemUnitsBuilder maxCount(@Nullable final Integer maxCount) { + this.maxCount = maxCount; + return this; + } + + /** + *

Number of units of a Line Item to exclude on every application of the Discount.

+ *

Set only when configuring the targetPattern.

+ *

The units matched first (satisfying the pattern component) will be excluded from the resulting set. The minCountand maxCount are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, the excludeCount value must be 2.

+ * @param excludeCount value to be set + * @return Builder + */ + + public CountOnLineItemUnitsBuilder excludeCount(@Nullable final Integer excludeCount) { + this.excludeCount = excludeCount; + return this; + } + + /** + *

Valid LineItem predicate that determines the units participating in the Discount.

+ * @return predicate + */ + + public String getPredicate() { + return this.predicate; + } + + /** + *

Minimum number of units of a Line Item that match the predicate.

+ * @return minCount + */ + + @Nullable + public Integer getMinCount() { + return this.minCount; + } + + /** + *

Maximum number of units of a Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.

+ *

The value must be greater than or equal to minCount. If not provided, the component will match all units that satisfy the predicate.

+ * @return maxCount + */ + + @Nullable + public Integer getMaxCount() { + return this.maxCount; + } + + /** + *

Number of units of a Line Item to exclude on every application of the Discount.

+ *

Set only when configuring the targetPattern.

+ *

The units matched first (satisfying the pattern component) will be excluded from the resulting set. The minCountand maxCount are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, the excludeCount value must be 2.

+ * @return excludeCount + */ + + @Nullable + public Integer getExcludeCount() { + return this.excludeCount; + } + + /** + * builds CountOnLineItemUnits with checking for non-null required values + * @return CountOnLineItemUnits + */ + public CountOnLineItemUnits build() { + Objects.requireNonNull(predicate, CountOnLineItemUnits.class + ": predicate is missing"); + return new CountOnLineItemUnitsImpl(predicate, minCount, maxCount, excludeCount); + } + + /** + * builds CountOnLineItemUnits without checking for non-null required values + * @return CountOnLineItemUnits + */ + public CountOnLineItemUnits buildUnchecked() { + return new CountOnLineItemUnitsImpl(predicate, minCount, maxCount, excludeCount); + } + + /** + * factory method for an instance of CountOnLineItemUnitsBuilder + * @return builder + */ + public static CountOnLineItemUnitsBuilder of() { + return new CountOnLineItemUnitsBuilder(); + } + + /** + * create builder for CountOnLineItemUnits instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static CountOnLineItemUnitsBuilder of(final CountOnLineItemUnits template) { + CountOnLineItemUnitsBuilder builder = new CountOnLineItemUnitsBuilder(); + builder.predicate = template.getPredicate(); + builder.minCount = template.getMinCount(); + builder.maxCount = template.getMaxCount(); + builder.excludeCount = template.getExcludeCount(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsImpl.java new file mode 100644 index 00000000000..d60ee386354 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsImpl.java @@ -0,0 +1,158 @@ + +package com.commercetools.api.models.cart_discount; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * CountOnLineItemUnits + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class CountOnLineItemUnitsImpl implements CountOnLineItemUnits, ModelBase { + + private String type; + + private String predicate; + + private Integer minCount; + + private Integer maxCount; + + private Integer excludeCount; + + /** + * create instance with all properties + */ + @JsonCreator + CountOnLineItemUnitsImpl(@JsonProperty("predicate") final String predicate, + @JsonProperty("minCount") final Integer minCount, @JsonProperty("maxCount") final Integer maxCount, + @JsonProperty("excludeCount") final Integer excludeCount) { + this.predicate = predicate; + this.minCount = minCount; + this.maxCount = maxCount; + this.excludeCount = excludeCount; + this.type = COUNT_ON_LINE_ITEM_UNITS; + } + + /** + * create empty instance + */ + public CountOnLineItemUnitsImpl() { + this.type = COUNT_ON_LINE_ITEM_UNITS; + } + + /** + * + */ + + public String getType() { + return this.type; + } + + /** + *

Valid LineItem predicate that determines the units participating in the Discount.

+ */ + + public String getPredicate() { + return this.predicate; + } + + /** + *

Minimum number of units of a Line Item that match the predicate.

+ */ + + public Integer getMinCount() { + return this.minCount; + } + + /** + *

Maximum number of units of a Line Item that match the predicate. There might be more units matching the predicate, but they will not be participating to the resulting set.

+ *

The value must be greater than or equal to minCount. If not provided, the component will match all units that satisfy the predicate.

+ */ + + public Integer getMaxCount() { + return this.maxCount; + } + + /** + *

Number of units of a Line Item to exclude on every application of the Discount.

+ *

Set only when configuring the targetPattern.

+ *

The units matched first (satisfying the pattern component) will be excluded from the resulting set. The minCountand maxCount are considered only after the exclusion. Pattern components are matched only if any further units satisfying the pattern component exist. For example, if 5 jeans are required but only 3 should be discounted, the excludeCount value must be 2.

+ */ + + public Integer getExcludeCount() { + return this.excludeCount; + } + + public void setPredicate(final String predicate) { + this.predicate = predicate; + } + + public void setMinCount(final Integer minCount) { + this.minCount = minCount; + } + + public void setMaxCount(final Integer maxCount) { + this.maxCount = maxCount; + } + + public void setExcludeCount(final Integer excludeCount) { + this.excludeCount = excludeCount; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + CountOnLineItemUnitsImpl that = (CountOnLineItemUnitsImpl) o; + + return new EqualsBuilder().append(type, that.type) + .append(predicate, that.predicate) + .append(minCount, that.minCount) + .append(maxCount, that.maxCount) + .append(excludeCount, that.excludeCount) + .append(type, that.type) + .append(predicate, that.predicate) + .append(minCount, that.minCount) + .append(maxCount, that.maxCount) + .append(excludeCount, that.excludeCount) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type) + .append(predicate) + .append(minCount) + .append(maxCount) + .append(excludeCount) + .toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type) + .append("predicate", predicate) + .append("minCount", minCount) + .append("maxCount", maxCount) + .append("excludeCount", excludeCount) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponent.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponent.java new file mode 100644 index 00000000000..94d797e20b2 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponent.java @@ -0,0 +1,106 @@ + +package com.commercetools.api.models.cart_discount; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.constraints.NotNull; + +/** + *

The pattern component it used to define a set of units based on some criteria. The criteria depends on the type of component used.

+ * + *
+ * Example to create a subtype instance using the builder pattern + *
+ *

+ *     PatternComponent patternComponent = PatternComponent.countOnCustomLineItemUnitsBuilder()
+ *             predicate("{predicate}")
+ *             .build()
+ * 
+ *
+ */ +@JsonSubTypes({ + @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CountOnCustomLineItemUnitsImpl.class, name = CountOnCustomLineItemUnits.COUNT_ON_CUSTOM_LINE_ITEM_UNITS), + @JsonSubTypes.Type(value = com.commercetools.api.models.cart_discount.CountOnLineItemUnitsImpl.class, name = CountOnLineItemUnits.COUNT_ON_LINE_ITEM_UNITS) }) +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", defaultImpl = PatternComponentImpl.class, visible = true) +@JsonDeserialize(as = PatternComponentImpl.class) +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public interface PatternComponent { + + /** + * + * @return type + */ + @NotNull + @JsonProperty("type") + public String getType(); + + /** + * factory method to create a deep copy of PatternComponent + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static PatternComponent deepCopy(@Nullable final PatternComponent template) { + if (template == null) { + return null; + } + if (template instanceof com.commercetools.api.models.cart_discount.CountOnCustomLineItemUnits) { + return com.commercetools.api.models.cart_discount.CountOnCustomLineItemUnits + .deepCopy((com.commercetools.api.models.cart_discount.CountOnCustomLineItemUnits) template); + } + if (template instanceof com.commercetools.api.models.cart_discount.CountOnLineItemUnits) { + return com.commercetools.api.models.cart_discount.CountOnLineItemUnits + .deepCopy((com.commercetools.api.models.cart_discount.CountOnLineItemUnits) template); + } + PatternComponentImpl instance = new PatternComponentImpl(); + return instance; + } + + /** + * builder for countOnCustomLineItemUnits subtype + * @return builder + */ + public static com.commercetools.api.models.cart_discount.CountOnCustomLineItemUnitsBuilder countOnCustomLineItemUnitsBuilder() { + return com.commercetools.api.models.cart_discount.CountOnCustomLineItemUnitsBuilder.of(); + } + + /** + * builder for countOnLineItemUnits subtype + * @return builder + */ + public static com.commercetools.api.models.cart_discount.CountOnLineItemUnitsBuilder countOnLineItemUnitsBuilder() { + return com.commercetools.api.models.cart_discount.CountOnLineItemUnitsBuilder.of(); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withPatternComponent(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponentBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponentBuilder.java new file mode 100644 index 00000000000..615f7e71ef7 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponentBuilder.java @@ -0,0 +1,30 @@ + +package com.commercetools.api.models.cart_discount; + +import java.util.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + * PatternComponentBuilder + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class PatternComponentBuilder { + + public com.commercetools.api.models.cart_discount.CountOnCustomLineItemUnitsBuilder countOnCustomLineItemUnitsBuilder() { + return com.commercetools.api.models.cart_discount.CountOnCustomLineItemUnitsBuilder.of(); + } + + public com.commercetools.api.models.cart_discount.CountOnLineItemUnitsBuilder countOnLineItemUnitsBuilder() { + return com.commercetools.api.models.cart_discount.CountOnLineItemUnitsBuilder.of(); + } + + /** + * factory method for an instance of PatternComponentBuilder + * @return builder + */ + public static PatternComponentBuilder of() { + return new PatternComponentBuilder(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponentImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponentImpl.java new file mode 100644 index 00000000000..6ec21722975 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart_discount/PatternComponentImpl.java @@ -0,0 +1,72 @@ + +package com.commercetools.api.models.cart_discount; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + *

The pattern component it used to define a set of units based on some criteria. The criteria depends on the type of component used.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class PatternComponentImpl implements PatternComponent, ModelBase { + + private String type; + + /** + * create instance with all properties + */ + @JsonCreator + PatternComponentImpl(@JsonProperty("type") final String type) { + this.type = type; + } + + /** + * create empty instance + */ + public PatternComponentImpl() { + } + + /** + * + */ + + public String getType() { + return this.type; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + PatternComponentImpl that = (PatternComponentImpl) o; + + return new EqualsBuilder().append(type, that.type).append(type, that.type).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type).build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraft.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraft.java index 11961740cdc..c35d8112aea 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraft.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraft.java @@ -105,7 +105,7 @@ public interface CustomLineItemImportDraft /** *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
  • + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.
  • *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • *
* @return priceMode @@ -189,7 +189,7 @@ public interface CustomLineItemImportDraft /** *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
  • + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.
  • *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • *
* @param priceMode value to be set diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraftBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraftBuilder.java index 850fe65c576..f684ef18411 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraftBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraftBuilder.java @@ -236,7 +236,7 @@ public CustomLineItemImportDraftBuilder taxCategory( /** *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
  • + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.
  • *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • *
* @param priceMode value to be set @@ -479,7 +479,7 @@ public com.commercetools.api.models.tax_category.TaxCategoryResourceIdentifier g /** *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
  • + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.
  • *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • *
* @return priceMode diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraftImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraftImpl.java index 105208c5dc6..aaceb6cb2a2 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraftImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/CustomLineItemImportDraftImpl.java @@ -135,7 +135,7 @@ public com.commercetools.api.models.tax_category.TaxCategoryResourceIdentifier g /** *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
  • + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.
  • *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • *
*/ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemAction.java index f7cd926be62..9f650e2f32f 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemAction.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemAction.java @@ -118,7 +118,7 @@ public interface StagedOrderAddCustomLineItemAction extends StagedOrderUpdateAct /** *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
  • + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.
  • *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • *
* @return priceMode @@ -193,7 +193,7 @@ public interface StagedOrderAddCustomLineItemAction extends StagedOrderUpdateAct /** *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
  • + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.
  • *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • *
* @param priceMode value to be set diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemActionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemActionBuilder.java index 096a505fdef..a40c1ac8eeb 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemActionBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemActionBuilder.java @@ -272,7 +272,7 @@ public StagedOrderAddCustomLineItemActionBuilder shippingDetails( /** *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
  • + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.
  • *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • *
* @param priceMode value to be set @@ -400,7 +400,7 @@ public com.commercetools.api.models.cart.ItemShippingDetailsDraft getShippingDet /** *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
  • + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.
  • *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • *
* @return priceMode diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemActionImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemActionImpl.java index 460521b341f..f588e276a3e 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemActionImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order_edit/StagedOrderAddCustomLineItemActionImpl.java @@ -153,7 +153,7 @@ public com.commercetools.api.models.cart.ItemShippingDetailsDraft getShippingDet /** *
    - *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget are applied to the Custom Line Item.
  • + *
  • If Standard, Cart Discounts with a matching CartDiscountCustomLineItemsTarget, MultiBuyCustomLineItemsTarget, or CartDiscountPatternTarget are applied to the Custom Line Item.
  • *
  • If External, Cart Discounts are not considered on the Custom Line Item.
  • *
*/ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignment.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignment.java index 18ee235d9d8..250c48cbd36 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignment.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignment.java @@ -57,7 +57,7 @@ public interface ProductSelectionAssignment { public ProductSelectionReference getProductSelection(); /** - *

Define which Variants of the added Product will be included in the Product Selection.

+ *

Defines which particular Variants of the Product are included in the Product Selection. If undefined all Variants of the referenced Product are included.

*

This field is only available for assignments to a Product Selection with Individual ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @return variantSelection */ @@ -66,7 +66,7 @@ public interface ProductSelectionAssignment { public ProductVariantSelection getVariantSelection(); /** - *

Defines which Variants of the Product will be excluded from the Product Selection.

+ *

Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

*

This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @return variantExclusion */ @@ -89,7 +89,7 @@ public interface ProductSelectionAssignment { public void setProductSelection(final ProductSelectionReference productSelection); /** - *

Define which Variants of the added Product will be included in the Product Selection.

+ *

Defines which particular Variants of the Product are included in the Product Selection. If undefined all Variants of the referenced Product are included.

*

This field is only available for assignments to a Product Selection with Individual ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @param variantSelection value to be set */ @@ -97,7 +97,7 @@ public interface ProductSelectionAssignment { public void setVariantSelection(final ProductVariantSelection variantSelection); /** - *

Defines which Variants of the Product will be excluded from the Product Selection.

+ *

Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

*

This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @param variantExclusion value to be set */ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignmentBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignmentBuilder.java index e0a8c3ce3e8..9e8f42e49fb 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignmentBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignmentBuilder.java @@ -111,7 +111,7 @@ public ProductSelectionAssignmentBuilder productSelection( } /** - *

Define which Variants of the added Product will be included in the Product Selection.

+ *

Defines which particular Variants of the Product are included in the Product Selection. If undefined all Variants of the referenced Product are included.

*

This field is only available for assignments to a Product Selection with Individual ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @param variantSelection value to be set * @return Builder @@ -124,7 +124,7 @@ public ProductSelectionAssignmentBuilder variantSelection( } /** - *

Define which Variants of the added Product will be included in the Product Selection.

+ *

Defines which particular Variants of the Product are included in the Product Selection. If undefined all Variants of the referenced Product are included.

*

This field is only available for assignments to a Product Selection with Individual ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @param builder function to build the variantSelection value * @return Builder @@ -139,7 +139,7 @@ public ProductSelectionAssignmentBuilder variantSelection( } /** - *

Defines which Variants of the Product will be excluded from the Product Selection.

+ *

Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

*

This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @param builder function to build the variantExclusion value * @return Builder @@ -154,7 +154,7 @@ public ProductSelectionAssignmentBuilder variantExclusion( } /** - *

Defines which Variants of the Product will be excluded from the Product Selection.

+ *

Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

*

This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @param builder function to build the variantExclusion value * @return Builder @@ -168,7 +168,7 @@ public ProductSelectionAssignmentBuilder withVariantExclusion( } /** - *

Defines which Variants of the Product will be excluded from the Product Selection.

+ *

Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

*

This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @param variantExclusion value to be set * @return Builder @@ -199,7 +199,7 @@ public com.commercetools.api.models.product_selection.ProductSelectionReference } /** - *

Define which Variants of the added Product will be included in the Product Selection.

+ *

Defines which particular Variants of the Product are included in the Product Selection. If undefined all Variants of the referenced Product are included.

*

This field is only available for assignments to a Product Selection with Individual ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @return variantSelection */ @@ -210,7 +210,7 @@ public com.commercetools.api.models.product_selection.ProductVariantSelection ge } /** - *

Defines which Variants of the Product will be excluded from the Product Selection.

+ *

Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

*

This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

* @return variantExclusion */ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignmentImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignmentImpl.java index 4d1d19efb33..21acbe449cb 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignmentImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/product_selection/ProductSelectionAssignmentImpl.java @@ -72,7 +72,7 @@ public com.commercetools.api.models.product_selection.ProductSelectionReference } /** - *

Define which Variants of the added Product will be included in the Product Selection.

+ *

Defines which particular Variants of the Product are included in the Product Selection. If undefined all Variants of the referenced Product are included.

*

This field is only available for assignments to a Product Selection with Individual ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

*/ @@ -81,7 +81,7 @@ public com.commercetools.api.models.product_selection.ProductVariantSelection ge } /** - *

Defines which Variants of the Product will be excluded from the Product Selection.

+ *

Defines which particular Variants of the Product are excluded from the Product Selection. If undefined all Variants of the referenced Product are excluded.

*

This field is only available for assignments to a Product Selection with IndividualExclusion ProductSelectionMode. The list of SKUs will be updated automatically on any change of those performed on the respective Product itself.

*/ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountPatternTargetQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountPatternTargetQueryBuilderDsl.java new file mode 100644 index 00000000000..8dae4d192c0 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountPatternTargetQueryBuilderDsl.java @@ -0,0 +1,66 @@ + +package com.commercetools.api.predicates.query.cart_discount; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class CartDiscountPatternTargetQueryBuilderDsl { + public CartDiscountPatternTargetQueryBuilderDsl() { + } + + public static CartDiscountPatternTargetQueryBuilderDsl of() { + return new CartDiscountPatternTargetQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, CartDiscountPatternTargetQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate triggerPattern( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("triggerPattern")) + .inner(fn.apply( + com.commercetools.api.predicates.query.cart_discount.PatternComponentQueryBuilderDsl.of())), + CartDiscountPatternTargetQueryBuilderDsl::of); + } + + public CollectionPredicateBuilder triggerPattern() { + return new CollectionPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("triggerPattern")), + p -> new CombinationQueryPredicate<>(p, CartDiscountPatternTargetQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate targetPattern( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("targetPattern")) + .inner(fn.apply( + com.commercetools.api.predicates.query.cart_discount.PatternComponentQueryBuilderDsl.of())), + CartDiscountPatternTargetQueryBuilderDsl::of); + } + + public CollectionPredicateBuilder targetPattern() { + return new CollectionPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("targetPattern")), + p -> new CombinationQueryPredicate<>(p, CartDiscountPatternTargetQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder maxOccurrence() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("maxOccurrence")), + p -> new CombinationQueryPredicate<>(p, CartDiscountPatternTargetQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder selectionMode() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("selectionMode")), + p -> new CombinationQueryPredicate<>(p, CartDiscountPatternTargetQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountTargetQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountTargetQueryBuilderDsl.java index 69ce8d4daa4..7b644f80ff5 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountTargetQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountTargetQueryBuilderDsl.java @@ -34,6 +34,14 @@ public CombinationQueryPredicate asLineItems( CartDiscountTargetQueryBuilderDsl::of); } + public CombinationQueryPredicate asPattern( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply( + com.commercetools.api.predicates.query.cart_discount.CartDiscountPatternTargetQueryBuilderDsl.of()), + CartDiscountTargetQueryBuilderDsl::of); + } + public CombinationQueryPredicate asShipping( Function> fn) { return new CombinationQueryPredicate<>(fn.apply( diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountValueFixedDraftQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountValueFixedDraftQueryBuilderDsl.java index 81344662a61..7b6e991ea74 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountValueFixedDraftQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountValueFixedDraftQueryBuilderDsl.java @@ -33,4 +33,10 @@ public CollectionPredicateBuilder mo p -> new CombinationQueryPredicate<>(p, CartDiscountValueFixedDraftQueryBuilderDsl::of)); } + public StringComparisonPredicateBuilder applicationMode() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("applicationMode")), + p -> new CombinationQueryPredicate<>(p, CartDiscountValueFixedDraftQueryBuilderDsl::of)); + } + } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountValueFixedQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountValueFixedQueryBuilderDsl.java index 71195d27243..9fc8c64adfb 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountValueFixedQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CartDiscountValueFixedQueryBuilderDsl.java @@ -33,4 +33,10 @@ public CollectionPredicateBuilder money() p -> new CombinationQueryPredicate<>(p, CartDiscountValueFixedQueryBuilderDsl::of)); } + public StringComparisonPredicateBuilder applicationMode() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("applicationMode")), + p -> new CombinationQueryPredicate<>(p, CartDiscountValueFixedQueryBuilderDsl::of)); + } + } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CountOnCustomLineItemUnitsQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CountOnCustomLineItemUnitsQueryBuilderDsl.java new file mode 100644 index 00000000000..b2bfdc8fdd9 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CountOnCustomLineItemUnitsQueryBuilderDsl.java @@ -0,0 +1,44 @@ + +package com.commercetools.api.predicates.query.cart_discount; + +import com.commercetools.api.predicates.query.*; + +public class CountOnCustomLineItemUnitsQueryBuilderDsl { + public CountOnCustomLineItemUnitsQueryBuilderDsl() { + } + + public static CountOnCustomLineItemUnitsQueryBuilderDsl of() { + return new CountOnCustomLineItemUnitsQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, CountOnCustomLineItemUnitsQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder predicate() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("predicate")), + p -> new CombinationQueryPredicate<>(p, CountOnCustomLineItemUnitsQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder minCount() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("minCount")), + p -> new CombinationQueryPredicate<>(p, CountOnCustomLineItemUnitsQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder maxCount() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("maxCount")), + p -> new CombinationQueryPredicate<>(p, CountOnCustomLineItemUnitsQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder excludeCount() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("excludeCount")), + p -> new CombinationQueryPredicate<>(p, CountOnCustomLineItemUnitsQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CountOnLineItemUnitsQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CountOnLineItemUnitsQueryBuilderDsl.java new file mode 100644 index 00000000000..9d3b912f5e5 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/CountOnLineItemUnitsQueryBuilderDsl.java @@ -0,0 +1,44 @@ + +package com.commercetools.api.predicates.query.cart_discount; + +import com.commercetools.api.predicates.query.*; + +public class CountOnLineItemUnitsQueryBuilderDsl { + public CountOnLineItemUnitsQueryBuilderDsl() { + } + + public static CountOnLineItemUnitsQueryBuilderDsl of() { + return new CountOnLineItemUnitsQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, CountOnLineItemUnitsQueryBuilderDsl::of)); + } + + public StringComparisonPredicateBuilder predicate() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("predicate")), + p -> new CombinationQueryPredicate<>(p, CountOnLineItemUnitsQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder minCount() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("minCount")), + p -> new CombinationQueryPredicate<>(p, CountOnLineItemUnitsQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder maxCount() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("maxCount")), + p -> new CombinationQueryPredicate<>(p, CountOnLineItemUnitsQueryBuilderDsl::of)); + } + + public LongComparisonPredicateBuilder excludeCount() { + return new LongComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("excludeCount")), + p -> new CombinationQueryPredicate<>(p, CountOnLineItemUnitsQueryBuilderDsl::of)); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/PatternComponentQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/PatternComponentQueryBuilderDsl.java new file mode 100644 index 00000000000..d340d659b13 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart_discount/PatternComponentQueryBuilderDsl.java @@ -0,0 +1,36 @@ + +package com.commercetools.api.predicates.query.cart_discount; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class PatternComponentQueryBuilderDsl { + public PatternComponentQueryBuilderDsl() { + } + + public static PatternComponentQueryBuilderDsl of() { + return new PatternComponentQueryBuilderDsl(); + } + + public StringComparisonPredicateBuilder type() { + return new StringComparisonPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("type")), + p -> new CombinationQueryPredicate<>(p, PatternComponentQueryBuilderDsl::of)); + } + + public CombinationQueryPredicate asCountOnCustomLineItemUnits( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply( + com.commercetools.api.predicates.query.cart_discount.CountOnCustomLineItemUnitsQueryBuilderDsl.of()), + PatternComponentQueryBuilderDsl::of); + } + + public CombinationQueryPredicate asCountOnLineItemUnits( + Function> fn) { + return new CombinationQueryPredicate<>( + fn.apply(com.commercetools.api.predicates.query.cart_discount.CountOnLineItemUnitsQueryBuilderDsl.of()), + PatternComponentQueryBuilderDsl::of); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetTest.java new file mode 100644 index 00000000000..98e06504e4e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountPatternTargetTest.java @@ -0,0 +1,76 @@ + +package com.commercetools.api.models.cart_discount; + +import java.util.Collections; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class CartDiscountPatternTargetTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(CartDiscountPatternTargetBuilder builder) { + CartDiscountPatternTarget cartDiscountPatternTarget = builder.buildUnchecked(); + Assertions.assertThat(cartDiscountPatternTarget).isInstanceOf(CartDiscountPatternTarget.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { + new Object[] { CartDiscountPatternTarget.builder() + .triggerPattern(Collections.singletonList( + new com.commercetools.api.models.cart_discount.PatternComponentImpl())) }, + new Object[] { CartDiscountPatternTarget.builder() + .targetPattern(Collections.singletonList( + new com.commercetools.api.models.cart_discount.PatternComponentImpl())) }, + new Object[] { CartDiscountPatternTarget.builder().maxOccurrence(7) }, + new Object[] { CartDiscountPatternTarget.builder() + .selectionMode( + com.commercetools.api.models.cart_discount.SelectionMode.findEnum("Cheapest")) } }; + } + + @Test + public void triggerPattern() { + CartDiscountPatternTarget value = CartDiscountPatternTarget.of(); + value.setTriggerPattern( + Collections.singletonList(new com.commercetools.api.models.cart_discount.PatternComponentImpl())); + Assertions.assertThat(value.getTriggerPattern()) + .isEqualTo( + Collections.singletonList(new com.commercetools.api.models.cart_discount.PatternComponentImpl())); + } + + @Test + public void targetPattern() { + CartDiscountPatternTarget value = CartDiscountPatternTarget.of(); + value.setTargetPattern( + Collections.singletonList(new com.commercetools.api.models.cart_discount.PatternComponentImpl())); + Assertions.assertThat(value.getTargetPattern()) + .isEqualTo( + Collections.singletonList(new com.commercetools.api.models.cart_discount.PatternComponentImpl())); + } + + @Test + public void maxOccurrence() { + CartDiscountPatternTarget value = CartDiscountPatternTarget.of(); + value.setMaxOccurrence(7); + Assertions.assertThat(value.getMaxOccurrence()).isEqualTo(7); + } + + @Test + public void selectionMode() { + CartDiscountPatternTarget value = CartDiscountPatternTarget.of(); + value.setSelectionMode(com.commercetools.api.models.cart_discount.SelectionMode.findEnum("Cheapest")); + Assertions.assertThat(value.getSelectionMode()) + .isEqualTo(com.commercetools.api.models.cart_discount.SelectionMode.findEnum("Cheapest")); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftTest.java index c2237281d1c..4e04f075fcf 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedDraftTest.java @@ -26,8 +26,12 @@ public void buildUnchecked(CartDiscountValueFixedDraftBuilder builder) { @DataProvider public static Object[][] objectBuilder() { - return new Object[][] { new Object[] { CartDiscountValueFixedDraft.builder() - .money(Collections.singletonList(new com.commercetools.api.models.common.MoneyImpl())) } }; + return new Object[][] { + new Object[] { CartDiscountValueFixedDraft.builder() + .money(Collections.singletonList(new com.commercetools.api.models.common.MoneyImpl())) }, + new Object[] { CartDiscountValueFixedDraft.builder() + .applicationMode(com.commercetools.api.models.cart_discount.DiscountApplicationMode + .findEnum("ProportionateDistribution")) } }; } @Test @@ -37,4 +41,14 @@ public void money() { Assertions.assertThat(value.getMoney()) .isEqualTo(Collections.singletonList(new com.commercetools.api.models.common.MoneyImpl())); } + + @Test + public void applicationMode() { + CartDiscountValueFixedDraft value = CartDiscountValueFixedDraft.of(); + value.setApplicationMode( + com.commercetools.api.models.cart_discount.DiscountApplicationMode.findEnum("ProportionateDistribution")); + Assertions.assertThat(value.getApplicationMode()) + .isEqualTo(com.commercetools.api.models.cart_discount.DiscountApplicationMode + .findEnum("ProportionateDistribution")); + } } diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedTest.java index e42475aedce..670502ecb11 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CartDiscountValueFixedTest.java @@ -26,8 +26,12 @@ public void buildUnchecked(CartDiscountValueFixedBuilder builder) { @DataProvider public static Object[][] objectBuilder() { - return new Object[][] { new Object[] { CartDiscountValueFixed.builder() - .money(Collections.singletonList(new com.commercetools.api.models.common.TypedMoneyImpl())) } }; + return new Object[][] { + new Object[] { CartDiscountValueFixed.builder() + .money(Collections.singletonList(new com.commercetools.api.models.common.TypedMoneyImpl())) }, + new Object[] { CartDiscountValueFixed.builder() + .applicationMode(com.commercetools.api.models.cart_discount.DiscountApplicationMode + .findEnum("ProportionateDistribution")) } }; } @Test @@ -37,4 +41,14 @@ public void money() { Assertions.assertThat(value.getMoney()) .isEqualTo(Collections.singletonList(new com.commercetools.api.models.common.TypedMoneyImpl())); } + + @Test + public void applicationMode() { + CartDiscountValueFixed value = CartDiscountValueFixed.of(); + value.setApplicationMode( + com.commercetools.api.models.cart_discount.DiscountApplicationMode.findEnum("ProportionateDistribution")); + Assertions.assertThat(value.getApplicationMode()) + .isEqualTo(com.commercetools.api.models.cart_discount.DiscountApplicationMode + .findEnum("ProportionateDistribution")); + } } diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsTest.java new file mode 100644 index 00000000000..df5ab00086e --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CountOnCustomLineItemUnitsTest.java @@ -0,0 +1,60 @@ + +package com.commercetools.api.models.cart_discount; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class CountOnCustomLineItemUnitsTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(CountOnCustomLineItemUnitsBuilder builder) { + CountOnCustomLineItemUnits countOnCustomLineItemUnits = builder.buildUnchecked(); + Assertions.assertThat(countOnCustomLineItemUnits).isInstanceOf(CountOnCustomLineItemUnits.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { CountOnCustomLineItemUnits.builder().predicate("predicate") }, + new Object[] { CountOnCustomLineItemUnits.builder().minCount(1) }, + new Object[] { CountOnCustomLineItemUnits.builder().maxCount(8) }, + new Object[] { CountOnCustomLineItemUnits.builder().excludeCount(4) } }; + } + + @Test + public void predicate() { + CountOnCustomLineItemUnits value = CountOnCustomLineItemUnits.of(); + value.setPredicate("predicate"); + Assertions.assertThat(value.getPredicate()).isEqualTo("predicate"); + } + + @Test + public void minCount() { + CountOnCustomLineItemUnits value = CountOnCustomLineItemUnits.of(); + value.setMinCount(1); + Assertions.assertThat(value.getMinCount()).isEqualTo(1); + } + + @Test + public void maxCount() { + CountOnCustomLineItemUnits value = CountOnCustomLineItemUnits.of(); + value.setMaxCount(8); + Assertions.assertThat(value.getMaxCount()).isEqualTo(8); + } + + @Test + public void excludeCount() { + CountOnCustomLineItemUnits value = CountOnCustomLineItemUnits.of(); + value.setExcludeCount(4); + Assertions.assertThat(value.getExcludeCount()).isEqualTo(4); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsTest.java new file mode 100644 index 00000000000..b7116828f9f --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart_discount/CountOnLineItemUnitsTest.java @@ -0,0 +1,60 @@ + +package com.commercetools.api.models.cart_discount; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class CountOnLineItemUnitsTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(CountOnLineItemUnitsBuilder builder) { + CountOnLineItemUnits countOnLineItemUnits = builder.buildUnchecked(); + Assertions.assertThat(countOnLineItemUnits).isInstanceOf(CountOnLineItemUnits.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { CountOnLineItemUnits.builder().predicate("predicate") }, + new Object[] { CountOnLineItemUnits.builder().minCount(1) }, + new Object[] { CountOnLineItemUnits.builder().maxCount(8) }, + new Object[] { CountOnLineItemUnits.builder().excludeCount(4) } }; + } + + @Test + public void predicate() { + CountOnLineItemUnits value = CountOnLineItemUnits.of(); + value.setPredicate("predicate"); + Assertions.assertThat(value.getPredicate()).isEqualTo("predicate"); + } + + @Test + public void minCount() { + CountOnLineItemUnits value = CountOnLineItemUnits.of(); + value.setMinCount(1); + Assertions.assertThat(value.getMinCount()).isEqualTo(1); + } + + @Test + public void maxCount() { + CountOnLineItemUnits value = CountOnLineItemUnits.of(); + value.setMaxCount(8); + Assertions.assertThat(value.getMaxCount()).isEqualTo(8); + } + + @Test + public void excludeCount() { + CountOnLineItemUnits value = CountOnLineItemUnits.of(); + value.setExcludeCount(4); + Assertions.assertThat(value.getExcludeCount()).isEqualTo(4); + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponent.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponent.java new file mode 100644 index 00000000000..8cba0f99fdc --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponent.java @@ -0,0 +1,76 @@ + +package com.commercetools.history.models.cart_discount; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.constraints.NotNull; + +/** + * PatternComponent + * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     PatternComponent patternComponent = PatternComponent.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public interface PatternComponent { + + /** + * + * @return type + */ + @NotNull + @JsonProperty("type") + public String getType(); + + /** + * factory method to create a deep copy of PatternComponent + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static PatternComponent deepCopy(@Nullable final PatternComponent template) { + if (template == null) { + return null; + } + PatternComponentImpl instance = new PatternComponentImpl(); + return instance; + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withPatternComponent(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponentBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponentBuilder.java new file mode 100644 index 00000000000..626dd0f027d --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponentBuilder.java @@ -0,0 +1,22 @@ + +package com.commercetools.history.models.cart_discount; + +import java.util.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + * PatternComponentBuilder + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class PatternComponentBuilder { + + /** + * factory method for an instance of PatternComponentBuilder + * @return builder + */ + public static PatternComponentBuilder of() { + return new PatternComponentBuilder(); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponentImpl.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponentImpl.java new file mode 100644 index 00000000000..e2d3ce88759 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/cart_discount/PatternComponentImpl.java @@ -0,0 +1,72 @@ + +package com.commercetools.history.models.cart_discount; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * PatternComponent + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class PatternComponentImpl implements PatternComponent, ModelBase { + + private String type; + + /** + * create instance with all properties + */ + @JsonCreator + PatternComponentImpl(@JsonProperty("type") final String type) { + this.type = type; + } + + /** + * create empty instance + */ + public PatternComponentImpl() { + } + + /** + * + */ + + public String getType() { + return this.type; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + PatternComponentImpl that = (PatternComponentImpl) o; + + return new EqualsBuilder().append(type, that.type).append(type, that.type).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type).build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetChangeValue.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetChangeValue.java index 957849d60a5..97a32833f00 100644 --- a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetChangeValue.java +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetChangeValue.java @@ -32,6 +32,7 @@ @JsonSubTypes.Type(value = com.commercetools.history.models.change_value.ChangeTargetLineItemsChangeValueImpl.class, name = ChangeTargetLineItemsChangeValue.LINE_ITEMS), @JsonSubTypes.Type(value = com.commercetools.history.models.change_value.ChangeTargetMultiBuyCustomLineItemsChangeValueImpl.class, name = ChangeTargetMultiBuyCustomLineItemsChangeValue.MULTI_BUY_CUSTOM_LINE_ITEMS), @JsonSubTypes.Type(value = com.commercetools.history.models.change_value.ChangeTargetMultiBuyLineItemsChangeValueImpl.class, name = ChangeTargetMultiBuyLineItemsChangeValue.MULTI_BUY_LINE_ITEMS), + @JsonSubTypes.Type(value = com.commercetools.history.models.change_value.ChangeTargetPatternChangeValueImpl.class, name = ChangeTargetPatternChangeValue.PATTERN), @JsonSubTypes.Type(value = com.commercetools.history.models.change_value.ChangeTargetShippingChangeValueImpl.class, name = ChangeTargetShippingChangeValue.SHIPPING) }) @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "type", defaultImpl = ChangeTargetChangeValueImpl.class, visible = true) @JsonDeserialize(as = ChangeTargetChangeValueImpl.class) @@ -73,6 +74,10 @@ public static ChangeTargetChangeValue deepCopy(@Nullable final ChangeTargetChang return com.commercetools.history.models.change_value.ChangeTargetMultiBuyLineItemsChangeValue.deepCopy( (com.commercetools.history.models.change_value.ChangeTargetMultiBuyLineItemsChangeValue) template); } + if (template instanceof com.commercetools.history.models.change_value.ChangeTargetPatternChangeValue) { + return com.commercetools.history.models.change_value.ChangeTargetPatternChangeValue + .deepCopy((com.commercetools.history.models.change_value.ChangeTargetPatternChangeValue) template); + } if (template instanceof com.commercetools.history.models.change_value.ChangeTargetShippingChangeValue) { return com.commercetools.history.models.change_value.ChangeTargetShippingChangeValue .deepCopy((com.commercetools.history.models.change_value.ChangeTargetShippingChangeValue) template); @@ -113,6 +118,14 @@ public static com.commercetools.history.models.change_value.ChangeTargetMultiBuy return com.commercetools.history.models.change_value.ChangeTargetMultiBuyLineItemsChangeValueBuilder.of(); } + /** + * builder for pattern subtype + * @return builder + */ + public static com.commercetools.history.models.change_value.ChangeTargetPatternChangeValueBuilder patternBuilder() { + return com.commercetools.history.models.change_value.ChangeTargetPatternChangeValueBuilder.of(); + } + /** * builder for shipping subtype * @return builder diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetChangeValueBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetChangeValueBuilder.java index 21293179ea9..a724dff0ec7 100644 --- a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetChangeValueBuilder.java +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetChangeValueBuilder.java @@ -27,6 +27,10 @@ public com.commercetools.history.models.change_value.ChangeTargetMultiBuyLineIte return com.commercetools.history.models.change_value.ChangeTargetMultiBuyLineItemsChangeValueBuilder.of(); } + public com.commercetools.history.models.change_value.ChangeTargetPatternChangeValueBuilder patternBuilder() { + return com.commercetools.history.models.change_value.ChangeTargetPatternChangeValueBuilder.of(); + } + public com.commercetools.history.models.change_value.ChangeTargetShippingChangeValueBuilder shippingBuilder() { return com.commercetools.history.models.change_value.ChangeTargetShippingChangeValueBuilder.of(); } diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValue.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValue.java new file mode 100644 index 00000000000..79fe8ac91e3 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValue.java @@ -0,0 +1,218 @@ + +package com.commercetools.history.models.change_value; + +import java.time.*; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.annotation.Nullable; + +import com.commercetools.history.models.cart_discount.PatternComponent; +import com.commercetools.history.models.common.SelectionMode; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + * ChangeTargetPatternChangeValue + * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     ChangeTargetPatternChangeValue changeTargetPatternChangeValue = ChangeTargetPatternChangeValue.builder()
+ *             .plusTargetPattern(targetPatternBuilder -> targetPatternBuilder)
+ *             .selectionMode(SelectionMode.CHEAPEST)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = ChangeTargetPatternChangeValueImpl.class) +public interface ChangeTargetPatternChangeValue extends ChangeTargetChangeValue { + + /** + * discriminator value for ChangeTargetPatternChangeValue + */ + String PATTERN = "pattern"; + + /** + * + * @return type + */ + @NotNull + @JsonProperty("type") + public String getType(); + + /** + *

Units of a (Custom) Line Item that triggered the discount application.

+ * @return triggerPattern + */ + @Valid + @JsonProperty("triggerPattern") + public List getTriggerPattern(); + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ * @return targetPattern + */ + @NotNull + @Valid + @JsonProperty("targetPattern") + public List getTargetPattern(); + + /** + *

Maximum number of times the Discount applies on a Cart.

+ *

If empty, the Discount applies indefinitely.

+ * @return maxOccurrence + */ + + @JsonProperty("maxOccurrence") + public Integer getMaxOccurrence(); + + /** + *

Indicates which of the matching units of (Custom) Line Items were discounted.

+ * @return selectionMode + */ + @NotNull + @JsonProperty("selectionMode") + public SelectionMode getSelectionMode(); + + /** + *

Units of a (Custom) Line Item that triggered the discount application.

+ * @param triggerPattern values to be set + */ + + @JsonIgnore + public void setTriggerPattern(final PatternComponent... triggerPattern); + + /** + *

Units of a (Custom) Line Item that triggered the discount application.

+ * @param triggerPattern values to be set + */ + + public void setTriggerPattern(final List triggerPattern); + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ * @param targetPattern values to be set + */ + + @JsonIgnore + public void setTargetPattern(final PatternComponent... targetPattern); + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ * @param targetPattern values to be set + */ + + public void setTargetPattern(final List targetPattern); + + /** + *

Maximum number of times the Discount applies on a Cart.

+ *

If empty, the Discount applies indefinitely.

+ * @param maxOccurrence value to be set + */ + + public void setMaxOccurrence(final Integer maxOccurrence); + + /** + *

Indicates which of the matching units of (Custom) Line Items were discounted.

+ * @param selectionMode value to be set + */ + + public void setSelectionMode(final SelectionMode selectionMode); + + /** + * factory method + * @return instance of ChangeTargetPatternChangeValue + */ + public static ChangeTargetPatternChangeValue of() { + return new ChangeTargetPatternChangeValueImpl(); + } + + /** + * factory method to create a shallow copy ChangeTargetPatternChangeValue + * @param template instance to be copied + * @return copy instance + */ + public static ChangeTargetPatternChangeValue of(final ChangeTargetPatternChangeValue template) { + ChangeTargetPatternChangeValueImpl instance = new ChangeTargetPatternChangeValueImpl(); + instance.setTriggerPattern(template.getTriggerPattern()); + instance.setTargetPattern(template.getTargetPattern()); + instance.setMaxOccurrence(template.getMaxOccurrence()); + instance.setSelectionMode(template.getSelectionMode()); + return instance; + } + + /** + * factory method to create a deep copy of ChangeTargetPatternChangeValue + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static ChangeTargetPatternChangeValue deepCopy(@Nullable final ChangeTargetPatternChangeValue template) { + if (template == null) { + return null; + } + ChangeTargetPatternChangeValueImpl instance = new ChangeTargetPatternChangeValueImpl(); + instance.setTriggerPattern(Optional.ofNullable(template.getTriggerPattern()) + .map(t -> t.stream() + .map(com.commercetools.history.models.cart_discount.PatternComponent::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); + instance.setTargetPattern(Optional.ofNullable(template.getTargetPattern()) + .map(t -> t.stream() + .map(com.commercetools.history.models.cart_discount.PatternComponent::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); + instance.setMaxOccurrence(template.getMaxOccurrence()); + instance.setSelectionMode(template.getSelectionMode()); + return instance; + } + + /** + * builder factory method for ChangeTargetPatternChangeValue + * @return builder + */ + public static ChangeTargetPatternChangeValueBuilder builder() { + return ChangeTargetPatternChangeValueBuilder.of(); + } + + /** + * create builder for ChangeTargetPatternChangeValue instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static ChangeTargetPatternChangeValueBuilder builder(final ChangeTargetPatternChangeValue template) { + return ChangeTargetPatternChangeValueBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withChangeTargetPatternChangeValue(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueBuilder.java new file mode 100644 index 00000000000..ef6c1655155 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueBuilder.java @@ -0,0 +1,279 @@ + +package com.commercetools.history.models.change_value; + +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * ChangeTargetPatternChangeValueBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     ChangeTargetPatternChangeValue changeTargetPatternChangeValue = ChangeTargetPatternChangeValue.builder()
+ *             .plusTargetPattern(targetPatternBuilder -> targetPatternBuilder)
+ *             .selectionMode(SelectionMode.CHEAPEST)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ChangeTargetPatternChangeValueBuilder implements Builder { + + @Nullable + private java.util.List triggerPattern; + + private java.util.List targetPattern; + + @Nullable + private Integer maxOccurrence; + + private com.commercetools.history.models.common.SelectionMode selectionMode; + + /** + *

Units of a (Custom) Line Item that triggered the discount application.

+ * @param triggerPattern value to be set + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder triggerPattern( + @Nullable final com.commercetools.history.models.cart_discount.PatternComponent... triggerPattern) { + this.triggerPattern = new ArrayList<>(Arrays.asList(triggerPattern)); + return this; + } + + /** + *

Units of a (Custom) Line Item that triggered the discount application.

+ * @param triggerPattern value to be set + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder triggerPattern( + @Nullable final java.util.List triggerPattern) { + this.triggerPattern = triggerPattern; + return this; + } + + /** + *

Units of a (Custom) Line Item that triggered the discount application.

+ * @param triggerPattern value to be set + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder plusTriggerPattern( + @Nullable final com.commercetools.history.models.cart_discount.PatternComponent... triggerPattern) { + if (this.triggerPattern == null) { + this.triggerPattern = new ArrayList<>(); + } + this.triggerPattern.addAll(Arrays.asList(triggerPattern)); + return this; + } + + /** + *

Units of a (Custom) Line Item that triggered the discount application.

+ * @param builder function to build the triggerPattern value + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder plusTriggerPattern( + Function> builder) { + if (this.triggerPattern == null) { + this.triggerPattern = new ArrayList<>(); + } + this.triggerPattern.add( + builder.apply(com.commercetools.history.models.cart_discount.PatternComponentBuilder.of()).build()); + return this; + } + + /** + *

Units of a (Custom) Line Item that triggered the discount application.

+ * @param builder function to build the triggerPattern value + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder withTriggerPattern( + Function> builder) { + this.triggerPattern = new ArrayList<>(); + this.triggerPattern.add( + builder.apply(com.commercetools.history.models.cart_discount.PatternComponentBuilder.of()).build()); + return this; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ * @param targetPattern value to be set + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder targetPattern( + final com.commercetools.history.models.cart_discount.PatternComponent... targetPattern) { + this.targetPattern = new ArrayList<>(Arrays.asList(targetPattern)); + return this; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ * @param targetPattern value to be set + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder targetPattern( + final java.util.List targetPattern) { + this.targetPattern = targetPattern; + return this; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ * @param targetPattern value to be set + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder plusTargetPattern( + final com.commercetools.history.models.cart_discount.PatternComponent... targetPattern) { + if (this.targetPattern == null) { + this.targetPattern = new ArrayList<>(); + } + this.targetPattern.addAll(Arrays.asList(targetPattern)); + return this; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ * @param builder function to build the targetPattern value + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder plusTargetPattern( + Function> builder) { + if (this.targetPattern == null) { + this.targetPattern = new ArrayList<>(); + } + this.targetPattern.add( + builder.apply(com.commercetools.history.models.cart_discount.PatternComponentBuilder.of()).build()); + return this; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ * @param builder function to build the targetPattern value + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder withTargetPattern( + Function> builder) { + this.targetPattern = new ArrayList<>(); + this.targetPattern.add( + builder.apply(com.commercetools.history.models.cart_discount.PatternComponentBuilder.of()).build()); + return this; + } + + /** + *

Maximum number of times the Discount applies on a Cart.

+ *

If empty, the Discount applies indefinitely.

+ * @param maxOccurrence value to be set + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder maxOccurrence(@Nullable final Integer maxOccurrence) { + this.maxOccurrence = maxOccurrence; + return this; + } + + /** + *

Indicates which of the matching units of (Custom) Line Items were discounted.

+ * @param selectionMode value to be set + * @return Builder + */ + + public ChangeTargetPatternChangeValueBuilder selectionMode( + final com.commercetools.history.models.common.SelectionMode selectionMode) { + this.selectionMode = selectionMode; + return this; + } + + /** + *

Units of a (Custom) Line Item that triggered the discount application.

+ * @return triggerPattern + */ + + @Nullable + public java.util.List getTriggerPattern() { + return this.triggerPattern; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ * @return targetPattern + */ + + public java.util.List getTargetPattern() { + return this.targetPattern; + } + + /** + *

Maximum number of times the Discount applies on a Cart.

+ *

If empty, the Discount applies indefinitely.

+ * @return maxOccurrence + */ + + @Nullable + public Integer getMaxOccurrence() { + return this.maxOccurrence; + } + + /** + *

Indicates which of the matching units of (Custom) Line Items were discounted.

+ * @return selectionMode + */ + + public com.commercetools.history.models.common.SelectionMode getSelectionMode() { + return this.selectionMode; + } + + /** + * builds ChangeTargetPatternChangeValue with checking for non-null required values + * @return ChangeTargetPatternChangeValue + */ + public ChangeTargetPatternChangeValue build() { + Objects.requireNonNull(targetPattern, ChangeTargetPatternChangeValue.class + ": targetPattern is missing"); + Objects.requireNonNull(selectionMode, ChangeTargetPatternChangeValue.class + ": selectionMode is missing"); + return new ChangeTargetPatternChangeValueImpl(triggerPattern, targetPattern, maxOccurrence, selectionMode); + } + + /** + * builds ChangeTargetPatternChangeValue without checking for non-null required values + * @return ChangeTargetPatternChangeValue + */ + public ChangeTargetPatternChangeValue buildUnchecked() { + return new ChangeTargetPatternChangeValueImpl(triggerPattern, targetPattern, maxOccurrence, selectionMode); + } + + /** + * factory method for an instance of ChangeTargetPatternChangeValueBuilder + * @return builder + */ + public static ChangeTargetPatternChangeValueBuilder of() { + return new ChangeTargetPatternChangeValueBuilder(); + } + + /** + * create builder for ChangeTargetPatternChangeValue instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static ChangeTargetPatternChangeValueBuilder of(final ChangeTargetPatternChangeValue template) { + ChangeTargetPatternChangeValueBuilder builder = new ChangeTargetPatternChangeValueBuilder(); + builder.triggerPattern = template.getTriggerPattern(); + builder.targetPattern = template.getTargetPattern(); + builder.maxOccurrence = template.getMaxOccurrence(); + builder.selectionMode = template.getSelectionMode(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueImpl.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueImpl.java new file mode 100644 index 00000000000..90dc81960c2 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueImpl.java @@ -0,0 +1,170 @@ + +package com.commercetools.history.models.change_value; + +import java.time.*; +import java.util.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.ModelBase; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * ChangeTargetPatternChangeValue + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ChangeTargetPatternChangeValueImpl implements ChangeTargetPatternChangeValue, ModelBase { + + private String type; + + private java.util.List triggerPattern; + + private java.util.List targetPattern; + + private Integer maxOccurrence; + + private com.commercetools.history.models.common.SelectionMode selectionMode; + + /** + * create instance with all properties + */ + @JsonCreator + ChangeTargetPatternChangeValueImpl( + @JsonProperty("triggerPattern") final java.util.List triggerPattern, + @JsonProperty("targetPattern") final java.util.List targetPattern, + @JsonProperty("maxOccurrence") final Integer maxOccurrence, + @JsonProperty("selectionMode") final com.commercetools.history.models.common.SelectionMode selectionMode) { + this.triggerPattern = triggerPattern; + this.targetPattern = targetPattern; + this.maxOccurrence = maxOccurrence; + this.selectionMode = selectionMode; + this.type = PATTERN; + } + + /** + * create empty instance + */ + public ChangeTargetPatternChangeValueImpl() { + this.type = PATTERN; + } + + /** + * + */ + + public String getType() { + return this.type; + } + + /** + *

Units of a (Custom) Line Item that triggered the discount application.

+ */ + + public java.util.List getTriggerPattern() { + return this.triggerPattern; + } + + /** + *

Units of (Custom) Line Items on which the Discount is applied.

+ */ + + public java.util.List getTargetPattern() { + return this.targetPattern; + } + + /** + *

Maximum number of times the Discount applies on a Cart.

+ *

If empty, the Discount applies indefinitely.

+ */ + + public Integer getMaxOccurrence() { + return this.maxOccurrence; + } + + /** + *

Indicates which of the matching units of (Custom) Line Items were discounted.

+ */ + + public com.commercetools.history.models.common.SelectionMode getSelectionMode() { + return this.selectionMode; + } + + public void setTriggerPattern( + final com.commercetools.history.models.cart_discount.PatternComponent... triggerPattern) { + this.triggerPattern = new ArrayList<>(Arrays.asList(triggerPattern)); + } + + public void setTriggerPattern( + final java.util.List triggerPattern) { + this.triggerPattern = triggerPattern; + } + + public void setTargetPattern( + final com.commercetools.history.models.cart_discount.PatternComponent... targetPattern) { + this.targetPattern = new ArrayList<>(Arrays.asList(targetPattern)); + } + + public void setTargetPattern( + final java.util.List targetPattern) { + this.targetPattern = targetPattern; + } + + public void setMaxOccurrence(final Integer maxOccurrence) { + this.maxOccurrence = maxOccurrence; + } + + public void setSelectionMode(final com.commercetools.history.models.common.SelectionMode selectionMode) { + this.selectionMode = selectionMode; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ChangeTargetPatternChangeValueImpl that = (ChangeTargetPatternChangeValueImpl) o; + + return new EqualsBuilder().append(type, that.type) + .append(triggerPattern, that.triggerPattern) + .append(targetPattern, that.targetPattern) + .append(maxOccurrence, that.maxOccurrence) + .append(selectionMode, that.selectionMode) + .append(type, that.type) + .append(triggerPattern, that.triggerPattern) + .append(targetPattern, that.targetPattern) + .append(maxOccurrence, that.maxOccurrence) + .append(selectionMode, that.selectionMode) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(type) + .append(triggerPattern) + .append(targetPattern) + .append(maxOccurrence) + .append(selectionMode) + .toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("type", type) + .append("triggerPattern", triggerPattern) + .append("targetPattern", targetPattern) + .append("maxOccurrence", maxOccurrence) + .append("selectionMode", selectionMode) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueTest.java b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueTest.java new file mode 100644 index 00000000000..c5f9fdfec8a --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/change_value/ChangeTargetPatternChangeValueTest.java @@ -0,0 +1,75 @@ + +package com.commercetools.history.models.change_value; + +import java.util.Collections; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class ChangeTargetPatternChangeValueTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(ChangeTargetPatternChangeValueBuilder builder) { + ChangeTargetPatternChangeValue changeTargetPatternChangeValue = builder.buildUnchecked(); + Assertions.assertThat(changeTargetPatternChangeValue).isInstanceOf(ChangeTargetPatternChangeValue.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { + new Object[] { ChangeTargetPatternChangeValue.builder() + .triggerPattern(Collections.singletonList( + new com.commercetools.history.models.cart_discount.PatternComponentImpl())) }, + new Object[] { ChangeTargetPatternChangeValue.builder() + .targetPattern(Collections.singletonList( + new com.commercetools.history.models.cart_discount.PatternComponentImpl())) }, + new Object[] { ChangeTargetPatternChangeValue.builder().maxOccurrence(7) }, + new Object[] { ChangeTargetPatternChangeValue.builder() + .selectionMode(com.commercetools.history.models.common.SelectionMode.findEnum("Cheapest")) } }; + } + + @Test + public void triggerPattern() { + ChangeTargetPatternChangeValue value = ChangeTargetPatternChangeValue.of(); + value.setTriggerPattern( + Collections.singletonList(new com.commercetools.history.models.cart_discount.PatternComponentImpl())); + Assertions.assertThat(value.getTriggerPattern()) + .isEqualTo(Collections + .singletonList(new com.commercetools.history.models.cart_discount.PatternComponentImpl())); + } + + @Test + public void targetPattern() { + ChangeTargetPatternChangeValue value = ChangeTargetPatternChangeValue.of(); + value.setTargetPattern( + Collections.singletonList(new com.commercetools.history.models.cart_discount.PatternComponentImpl())); + Assertions.assertThat(value.getTargetPattern()) + .isEqualTo(Collections + .singletonList(new com.commercetools.history.models.cart_discount.PatternComponentImpl())); + } + + @Test + public void maxOccurrence() { + ChangeTargetPatternChangeValue value = ChangeTargetPatternChangeValue.of(); + value.setMaxOccurrence(7); + Assertions.assertThat(value.getMaxOccurrence()).isEqualTo(7); + } + + @Test + public void selectionMode() { + ChangeTargetPatternChangeValue value = ChangeTargetPatternChangeValue.of(); + value.setSelectionMode(com.commercetools.history.models.common.SelectionMode.findEnum("Cheapest")); + Assertions.assertThat(value.getSelectionMode()) + .isEqualTo(com.commercetools.history.models.common.SelectionMode.findEnum("Cheapest")); + } +} diff --git a/references.txt b/references.txt index b9e17c2aabc..4d520c01883 100644 --- a/references.txt +++ b/references.txt @@ -341,3 +341,4 @@ df53588d26d7953dfdf44166866ca03045f0a70b 99e7aa1c7e3ba67a59b6df3efbaf4e320611c549 269027575a6fd5a2a29387930064a06f22f09bbf 9c2f053d7f45e95984760f59a344e9630d90d843 +f4f3c42381257c319000e05bd5b61074d18b0a5f