From 333332e9e2bad1c7e5a4d7bd115c7a25a91b2878 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 10:17:55 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 34 +--- .../cart/DiscountedLineItemPortion.java | 8 +- .../DiscountedLineItemPortionBuilder.java | 12 +- .../cart/DiscountedLineItemPortionDraft.java | 145 ++++++++++++++++++ ...DiscountedLineItemPortionDraftBuilder.java | 135 ++++++++++++++++ .../DiscountedLineItemPortionDraftImpl.java | 99 ++++++++++++ .../cart/DiscountedLineItemPortionImpl.java | 4 +- .../order/DiscountedLineItemPriceDraft.java | 10 +- .../DiscountedLineItemPriceDraftBuilder.java | 30 ++-- .../DiscountedLineItemPriceDraftImpl.java | 10 +- ...edLineItemPortionDraftQueryBuilderDsl.java | 34 ++++ ...ntedLineItemPriceDraftQueryBuilderDsl.java | 11 +- .../DiscountedLineItemPortionDraftTest.java | 48 ++++++ .../DiscountedLineItemPriceDraftTest.java | 8 +- references.txt | 1 + 15 files changed, 512 insertions(+), 77 deletions(-) create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraft.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftBuilder.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftImpl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/DiscountedLineItemPortionDraftQueryBuilderDsl.java create mode 100644 commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftTest.java diff --git a/changes.md b/changes.md index 104b9c31004..667b540416c 100644 --- a/changes.md +++ b/changes.md @@ -1,41 +1,15 @@ **Api changes**
-Added Method(s) - -- added method `apiRoot.withProjectKey().discountCodes().withKey().get()` -- added method `apiRoot.withProjectKey().discountCodes().withKey().head()` -- added method `apiRoot.withProjectKey().discountCodes().withKey().post()` -- added method `apiRoot.withProjectKey().discountCodes().withKey().delete()` -
- - -
-Added Property(s) - -- added property `perMethodExternalTaxRate` to type `CartAddLineItemAction` -- added property `key` to type `DiscountCode` -- added property `key` to type `DiscountCodeDraft` -- added property `shippingMode` to type `MyCartDraft` -
- - -
-Added Resource(s) +Added Type(s) -- added resource `/{projectKey}/discount-codes/key={key}` +- added type `DiscountedLineItemPortionDraft`
-Added Type(s) +Changed Property(s) -- added type `DiscountCodeSetKeyAction` -- added type `DiscountCodeCreatedMessage` -- added type `DiscountCodeDeletedMessage` -- added type `DiscountCodeKeySetMessage` -- added type `DiscountCodeCreatedMessagePayload` -- added type `DiscountCodeDeletedMessagePayload` -- added type `DiscountCodeKeySetMessagePayload` +- :warning: changed property `includedDiscounts` of type `DiscountedLineItemPriceDraft` from type `DiscountedLineItemPortion[]` to `DiscountedLineItemPortionDraft[]`
diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortion.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortion.java index 734a23a8994..d70c5c82a3f 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortion.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortion.java @@ -35,7 +35,7 @@ public interface DiscountedLineItemPortion { /** - *

A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.

+ *

A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.

* @return discount */ @NotNull @@ -44,7 +44,7 @@ public interface DiscountedLineItemPortion { public Reference getDiscount(); /** - *

Money value of the discount applicable.

+ *

Money value of the applicable discount.

* @return discountedAmount */ @NotNull @@ -53,14 +53,14 @@ public interface DiscountedLineItemPortion { public TypedMoney getDiscountedAmount(); /** - *

A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.

+ *

A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.

* @param discount value to be set */ public void setDiscount(final Reference discount); /** - *

Money value of the discount applicable.

+ *

Money value of the applicable discount.

* @param discountedAmount value to be set */ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionBuilder.java index 6d6a084d2af..1003c821472 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionBuilder.java @@ -28,7 +28,7 @@ public class DiscountedLineItemPortionBuilder implements BuilderA CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.

+ *

A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.

* @param discount value to be set * @return Builder */ @@ -39,7 +39,7 @@ public DiscountedLineItemPortionBuilder discount(final com.commercetools.api.mod } /** - *

A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.

+ *

A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.

* @param builder function to build the discount value * @return Builder */ @@ -51,7 +51,7 @@ public DiscountedLineItemPortionBuilder discount( } /** - *

Money value of the discount applicable.

+ *

Money value of the applicable discount.

* @param discountedAmount value to be set * @return Builder */ @@ -63,7 +63,7 @@ public DiscountedLineItemPortionBuilder discountedAmount( } /** - *

Money value of the discount applicable.

+ *

Money value of the applicable discount.

* @param builder function to build the discountedAmount value * @return Builder */ @@ -75,7 +75,7 @@ public DiscountedLineItemPortionBuilder discountedAmount( } /** - *

A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.

+ *

A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.

* @return discount */ @@ -84,7 +84,7 @@ public com.commercetools.api.models.common.Reference getDiscount() { } /** - *

Money value of the discount applicable.

+ *

Money value of the applicable discount.

* @return discountedAmount */ diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraft.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraft.java new file mode 100644 index 00000000000..ce7e0aab154 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraft.java @@ -0,0 +1,145 @@ + +package com.commercetools.api.models.cart; + +import java.time.*; +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; +import javax.validation.Valid; +import javax.validation.constraints.NotNull; + +import com.commercetools.api.models.common.Reference; +import com.commercetools.api.models.common.TypedMoneyDraft; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +/** + * DiscountedLineItemPortionDraft + * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountedLineItemPortionDraft discountedLineItemPortionDraft = DiscountedLineItemPortionDraft.builder()
+ *             .discount(discountBuilder -> discountBuilder)
+ *             .discountedAmount(discountedAmountBuilder -> discountedAmountBuilder)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = DiscountedLineItemPortionDraftImpl.class) +public interface DiscountedLineItemPortionDraft extends io.vrap.rmf.base.client.Draft { + + /** + *

A CartDiscountReference or DirectDiscountReference for the discount applicable on the Line Item.

+ * @return discount + */ + @NotNull + @Valid + @JsonProperty("discount") + public Reference getDiscount(); + + /** + *

Money value for the discount applicable.

+ * @return discountedAmount + */ + @NotNull + @Valid + @JsonProperty("discountedAmount") + public TypedMoneyDraft getDiscountedAmount(); + + /** + *

A CartDiscountReference or DirectDiscountReference for the discount applicable on the Line Item.

+ * @param discount value to be set + */ + + public void setDiscount(final Reference discount); + + /** + *

Money value for the discount applicable.

+ * @param discountedAmount value to be set + */ + + public void setDiscountedAmount(final TypedMoneyDraft discountedAmount); + + /** + * factory method + * @return instance of DiscountedLineItemPortionDraft + */ + public static DiscountedLineItemPortionDraft of() { + return new DiscountedLineItemPortionDraftImpl(); + } + + /** + * factory method to create a shallow copy DiscountedLineItemPortionDraft + * @param template instance to be copied + * @return copy instance + */ + public static DiscountedLineItemPortionDraft of(final DiscountedLineItemPortionDraft template) { + DiscountedLineItemPortionDraftImpl instance = new DiscountedLineItemPortionDraftImpl(); + instance.setDiscount(template.getDiscount()); + instance.setDiscountedAmount(template.getDiscountedAmount()); + return instance; + } + + /** + * factory method to create a deep copy of DiscountedLineItemPortionDraft + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static DiscountedLineItemPortionDraft deepCopy(@Nullable final DiscountedLineItemPortionDraft template) { + if (template == null) { + return null; + } + DiscountedLineItemPortionDraftImpl instance = new DiscountedLineItemPortionDraftImpl(); + instance.setDiscount(com.commercetools.api.models.common.Reference.deepCopy(template.getDiscount())); + instance.setDiscountedAmount( + com.commercetools.api.models.common.TypedMoneyDraft.deepCopy(template.getDiscountedAmount())); + return instance; + } + + /** + * builder factory method for DiscountedLineItemPortionDraft + * @return builder + */ + public static DiscountedLineItemPortionDraftBuilder builder() { + return DiscountedLineItemPortionDraftBuilder.of(); + } + + /** + * create builder for DiscountedLineItemPortionDraft instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountedLineItemPortionDraftBuilder builder(final DiscountedLineItemPortionDraft template) { + return DiscountedLineItemPortionDraftBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withDiscountedLineItemPortionDraft(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/DiscountedLineItemPortionDraftBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftBuilder.java new file mode 100644 index 00000000000..323fd0e48ea --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftBuilder.java @@ -0,0 +1,135 @@ + +package com.commercetools.api.models.cart; + +import java.util.*; +import java.util.function.Function; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * DiscountedLineItemPortionDraftBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     DiscountedLineItemPortionDraft discountedLineItemPortionDraft = DiscountedLineItemPortionDraft.builder()
+ *             .discount(discountBuilder -> discountBuilder)
+ *             .discountedAmount(discountedAmountBuilder -> discountedAmountBuilder)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountedLineItemPortionDraftBuilder implements Builder { + + private com.commercetools.api.models.common.Reference discount; + + private com.commercetools.api.models.common.TypedMoneyDraft discountedAmount; + + /** + *

A CartDiscountReference or DirectDiscountReference for the discount applicable on the Line Item.

+ * @param discount value to be set + * @return Builder + */ + + public DiscountedLineItemPortionDraftBuilder discount( + final com.commercetools.api.models.common.Reference discount) { + this.discount = discount; + return this; + } + + /** + *

A CartDiscountReference or DirectDiscountReference for the discount applicable on the Line Item.

+ * @param builder function to build the discount value + * @return Builder + */ + + public DiscountedLineItemPortionDraftBuilder discount( + Function> builder) { + this.discount = builder.apply(com.commercetools.api.models.common.ReferenceBuilder.of()).build(); + return this; + } + + /** + *

Money value for the discount applicable.

+ * @param discountedAmount value to be set + * @return Builder + */ + + public DiscountedLineItemPortionDraftBuilder discountedAmount( + final com.commercetools.api.models.common.TypedMoneyDraft discountedAmount) { + this.discountedAmount = discountedAmount; + return this; + } + + /** + *

Money value for the discount applicable.

+ * @param builder function to build the discountedAmount value + * @return Builder + */ + + public DiscountedLineItemPortionDraftBuilder discountedAmount( + Function> builder) { + this.discountedAmount = builder.apply(com.commercetools.api.models.common.TypedMoneyDraftBuilder.of()).build(); + return this; + } + + /** + *

A CartDiscountReference or DirectDiscountReference for the discount applicable on the Line Item.

+ * @return discount + */ + + public com.commercetools.api.models.common.Reference getDiscount() { + return this.discount; + } + + /** + *

Money value for the discount applicable.

+ * @return discountedAmount + */ + + public com.commercetools.api.models.common.TypedMoneyDraft getDiscountedAmount() { + return this.discountedAmount; + } + + /** + * builds DiscountedLineItemPortionDraft with checking for non-null required values + * @return DiscountedLineItemPortionDraft + */ + public DiscountedLineItemPortionDraft build() { + Objects.requireNonNull(discount, DiscountedLineItemPortionDraft.class + ": discount is missing"); + Objects.requireNonNull(discountedAmount, + DiscountedLineItemPortionDraft.class + ": discountedAmount is missing"); + return new DiscountedLineItemPortionDraftImpl(discount, discountedAmount); + } + + /** + * builds DiscountedLineItemPortionDraft without checking for non-null required values + * @return DiscountedLineItemPortionDraft + */ + public DiscountedLineItemPortionDraft buildUnchecked() { + return new DiscountedLineItemPortionDraftImpl(discount, discountedAmount); + } + + /** + * factory method for an instance of DiscountedLineItemPortionDraftBuilder + * @return builder + */ + public static DiscountedLineItemPortionDraftBuilder of() { + return new DiscountedLineItemPortionDraftBuilder(); + } + + /** + * create builder for DiscountedLineItemPortionDraft instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static DiscountedLineItemPortionDraftBuilder of(final DiscountedLineItemPortionDraft template) { + DiscountedLineItemPortionDraftBuilder builder = new DiscountedLineItemPortionDraftBuilder(); + builder.discount = template.getDiscount(); + builder.discountedAmount = template.getDiscountedAmount(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftImpl.java new file mode 100644 index 00000000000..8313d2e542f --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftImpl.java @@ -0,0 +1,99 @@ + +package com.commercetools.api.models.cart; + +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; + +/** + * DiscountedLineItemPortionDraft + */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class DiscountedLineItemPortionDraftImpl implements DiscountedLineItemPortionDraft, ModelBase { + + private com.commercetools.api.models.common.Reference discount; + + private com.commercetools.api.models.common.TypedMoneyDraft discountedAmount; + + /** + * create instance with all properties + */ + @JsonCreator + DiscountedLineItemPortionDraftImpl( + @JsonProperty("discount") final com.commercetools.api.models.common.Reference discount, + @JsonProperty("discountedAmount") final com.commercetools.api.models.common.TypedMoneyDraft discountedAmount) { + this.discount = discount; + this.discountedAmount = discountedAmount; + } + + /** + * create empty instance + */ + public DiscountedLineItemPortionDraftImpl() { + } + + /** + *

A CartDiscountReference or DirectDiscountReference for the discount applicable on the Line Item.

+ */ + + public com.commercetools.api.models.common.Reference getDiscount() { + return this.discount; + } + + /** + *

Money value for the discount applicable.

+ */ + + public com.commercetools.api.models.common.TypedMoneyDraft getDiscountedAmount() { + return this.discountedAmount; + } + + public void setDiscount(final com.commercetools.api.models.common.Reference discount) { + this.discount = discount; + } + + public void setDiscountedAmount(final com.commercetools.api.models.common.TypedMoneyDraft discountedAmount) { + this.discountedAmount = discountedAmount; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + DiscountedLineItemPortionDraftImpl that = (DiscountedLineItemPortionDraftImpl) o; + + return new EqualsBuilder().append(discount, that.discount) + .append(discountedAmount, that.discountedAmount) + .append(discount, that.discount) + .append(discountedAmount, that.discountedAmount) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(discount).append(discountedAmount).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("discount", discount) + .append("discountedAmount", discountedAmount) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionImpl.java index 4009a119e50..7c81e483306 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionImpl.java @@ -44,7 +44,7 @@ public DiscountedLineItemPortionImpl() { } /** - *

A CartDiscountReference or DirectDiscountReference for the applicable discount on the Line Item.

+ *

A CartDiscountReference or DirectDiscountReference of the applicable discount on the Line Item.

*/ public com.commercetools.api.models.common.Reference getDiscount() { @@ -52,7 +52,7 @@ public com.commercetools.api.models.common.Reference getDiscount() { } /** - *

Money value of the discount applicable.

+ *

Money value of the applicable discount.

*/ public com.commercetools.api.models.common.TypedMoney getDiscountedAmount() { diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraft.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraft.java index 95dea235f8d..5d3412daccf 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraft.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraft.java @@ -10,7 +10,7 @@ import javax.validation.Valid; import javax.validation.constraints.NotNull; -import com.commercetools.api.models.cart.DiscountedLineItemPortion; +import com.commercetools.api.models.cart.DiscountedLineItemPortionDraft; import com.commercetools.api.models.common.Money; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.annotation.*; @@ -51,7 +51,7 @@ public interface DiscountedLineItemPriceDraft extends io.vrap.rmf.base.client.Dr @NotNull @Valid @JsonProperty("includedDiscounts") - public List getIncludedDiscounts(); + public List getIncludedDiscounts(); /** *

Discounted money value.

@@ -66,14 +66,14 @@ public interface DiscountedLineItemPriceDraft extends io.vrap.rmf.base.client.Dr */ @JsonIgnore - public void setIncludedDiscounts(final DiscountedLineItemPortion... includedDiscounts); + public void setIncludedDiscounts(final DiscountedLineItemPortionDraft... includedDiscounts); /** *

Discounts to be applied.

* @param includedDiscounts values to be set */ - public void setIncludedDiscounts(final List includedDiscounts); + public void setIncludedDiscounts(final List includedDiscounts); /** * factory method @@ -109,7 +109,7 @@ public static DiscountedLineItemPriceDraft deepCopy(@Nullable final DiscountedLi instance.setValue(com.commercetools.api.models.common.Money.deepCopy(template.getValue())); instance.setIncludedDiscounts(Optional.ofNullable(template.getIncludedDiscounts()) .map(t -> t.stream() - .map(com.commercetools.api.models.cart.DiscountedLineItemPortion::deepCopy) + .map(com.commercetools.api.models.cart.DiscountedLineItemPortionDraft::deepCopy) .collect(Collectors.toList())) .orElse(null)); return instance; diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftBuilder.java index 973c1cbbe5e..2dea8def2a1 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftBuilder.java @@ -25,7 +25,7 @@ public class DiscountedLineItemPriceDraftBuilder implements Builder includedDiscounts; + private java.util.List includedDiscounts; /** *

Discounted money value.

@@ -69,7 +69,7 @@ public DiscountedLineItemPriceDraftBuilder value(final com.commercetools.api.mod */ public DiscountedLineItemPriceDraftBuilder includedDiscounts( - final com.commercetools.api.models.cart.DiscountedLineItemPortion... includedDiscounts) { + final com.commercetools.api.models.cart.DiscountedLineItemPortionDraft... includedDiscounts) { this.includedDiscounts = new ArrayList<>(Arrays.asList(includedDiscounts)); return this; } @@ -81,7 +81,7 @@ public DiscountedLineItemPriceDraftBuilder includedDiscounts( */ public DiscountedLineItemPriceDraftBuilder includedDiscounts( - final java.util.List includedDiscounts) { + final java.util.List includedDiscounts) { this.includedDiscounts = includedDiscounts; return this; } @@ -93,7 +93,7 @@ public DiscountedLineItemPriceDraftBuilder includedDiscounts( */ public DiscountedLineItemPriceDraftBuilder plusIncludedDiscounts( - final com.commercetools.api.models.cart.DiscountedLineItemPortion... includedDiscounts) { + final com.commercetools.api.models.cart.DiscountedLineItemPortionDraft... includedDiscounts) { if (this.includedDiscounts == null) { this.includedDiscounts = new ArrayList<>(); } @@ -108,12 +108,12 @@ public DiscountedLineItemPriceDraftBuilder plusIncludedDiscounts( */ public DiscountedLineItemPriceDraftBuilder plusIncludedDiscounts( - Function builder) { + Function builder) { if (this.includedDiscounts == null) { this.includedDiscounts = new ArrayList<>(); } - this.includedDiscounts - .add(builder.apply(com.commercetools.api.models.cart.DiscountedLineItemPortionBuilder.of()).build()); + this.includedDiscounts.add( + builder.apply(com.commercetools.api.models.cart.DiscountedLineItemPortionDraftBuilder.of()).build()); return this; } @@ -124,10 +124,10 @@ public DiscountedLineItemPriceDraftBuilder plusIncludedDiscounts( */ public DiscountedLineItemPriceDraftBuilder withIncludedDiscounts( - Function builder) { + Function builder) { this.includedDiscounts = new ArrayList<>(); - this.includedDiscounts - .add(builder.apply(com.commercetools.api.models.cart.DiscountedLineItemPortionBuilder.of()).build()); + this.includedDiscounts.add( + builder.apply(com.commercetools.api.models.cart.DiscountedLineItemPortionDraftBuilder.of()).build()); return this; } @@ -138,9 +138,9 @@ public DiscountedLineItemPriceDraftBuilder withIncludedDiscounts( */ public DiscountedLineItemPriceDraftBuilder addIncludedDiscounts( - Function builder) { + Function builder) { return plusIncludedDiscounts( - builder.apply(com.commercetools.api.models.cart.DiscountedLineItemPortionBuilder.of())); + builder.apply(com.commercetools.api.models.cart.DiscountedLineItemPortionDraftBuilder.of())); } /** @@ -150,9 +150,9 @@ public DiscountedLineItemPriceDraftBuilder addIncludedDiscounts( */ public DiscountedLineItemPriceDraftBuilder setIncludedDiscounts( - Function builder) { + Function builder) { return includedDiscounts( - builder.apply(com.commercetools.api.models.cart.DiscountedLineItemPortionBuilder.of())); + builder.apply(com.commercetools.api.models.cart.DiscountedLineItemPortionDraftBuilder.of())); } /** @@ -169,7 +169,7 @@ public com.commercetools.api.models.common.Money getValue() { * @return includedDiscounts */ - public java.util.List getIncludedDiscounts() { + public java.util.List getIncludedDiscounts() { return this.includedDiscounts; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftImpl.java index ce17e6d07c5..48877699e55 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftImpl.java @@ -24,14 +24,14 @@ public class DiscountedLineItemPriceDraftImpl implements DiscountedLineItemPrice private com.commercetools.api.models.common.Money value; - private java.util.List includedDiscounts; + private java.util.List includedDiscounts; /** * create instance with all properties */ @JsonCreator DiscountedLineItemPriceDraftImpl(@JsonProperty("value") final com.commercetools.api.models.common.Money value, - @JsonProperty("includedDiscounts") final java.util.List includedDiscounts) { + @JsonProperty("includedDiscounts") final java.util.List includedDiscounts) { this.value = value; this.includedDiscounts = includedDiscounts; } @@ -54,7 +54,7 @@ public com.commercetools.api.models.common.Money getValue() { *

Discounts to be applied.

*/ - public java.util.List getIncludedDiscounts() { + public java.util.List getIncludedDiscounts() { return this.includedDiscounts; } @@ -63,12 +63,12 @@ public void setValue(final com.commercetools.api.models.common.Money value) { } public void setIncludedDiscounts( - final com.commercetools.api.models.cart.DiscountedLineItemPortion... includedDiscounts) { + final com.commercetools.api.models.cart.DiscountedLineItemPortionDraft... includedDiscounts) { this.includedDiscounts = new ArrayList<>(Arrays.asList(includedDiscounts)); } public void setIncludedDiscounts( - final java.util.List includedDiscounts) { + final java.util.List includedDiscounts) { this.includedDiscounts = includedDiscounts; } diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/DiscountedLineItemPortionDraftQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/DiscountedLineItemPortionDraftQueryBuilderDsl.java new file mode 100644 index 00000000000..c9778f7393d --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/DiscountedLineItemPortionDraftQueryBuilderDsl.java @@ -0,0 +1,34 @@ + +package com.commercetools.api.predicates.query.cart; + +import java.util.function.Function; + +import com.commercetools.api.predicates.query.*; + +public class DiscountedLineItemPortionDraftQueryBuilderDsl { + public DiscountedLineItemPortionDraftQueryBuilderDsl() { + } + + public static DiscountedLineItemPortionDraftQueryBuilderDsl of() { + return new DiscountedLineItemPortionDraftQueryBuilderDsl(); + } + + public CombinationQueryPredicate discount( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("discount")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.ReferenceQueryBuilderDsl.of())), + DiscountedLineItemPortionDraftQueryBuilderDsl::of); + } + + public CombinationQueryPredicate discountedAmount( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("discountedAmount")) + .inner(fn.apply(com.commercetools.api.predicates.query.common.TypedMoneyDraftQueryBuilderDsl.of())), + DiscountedLineItemPortionDraftQueryBuilderDsl::of); + } + +} diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order/DiscountedLineItemPriceDraftQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order/DiscountedLineItemPriceDraftQueryBuilderDsl.java index 71953e8fb36..f057af50915 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order/DiscountedLineItemPriceDraftQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order/DiscountedLineItemPriceDraftQueryBuilderDsl.java @@ -23,12 +23,11 @@ public CombinationQueryPredicate va } public CombinationQueryPredicate includedDiscounts( - Function> fn) { - return new CombinationQueryPredicate<>( - ContainerQueryPredicate.of() - .parent(ConstantQueryPredicate.of().constant("includedDiscounts")) - .inner(fn.apply( - com.commercetools.api.predicates.query.cart.DiscountedLineItemPortionQueryBuilderDsl.of())), + Function> fn) { + return new CombinationQueryPredicate<>(ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("includedDiscounts")) + .inner(fn.apply( + com.commercetools.api.predicates.query.cart.DiscountedLineItemPortionDraftQueryBuilderDsl.of())), DiscountedLineItemPriceDraftQueryBuilderDsl::of); } diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftTest.java new file mode 100644 index 00000000000..5096e597596 --- /dev/null +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/DiscountedLineItemPortionDraftTest.java @@ -0,0 +1,48 @@ + +package com.commercetools.api.models.cart; + +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 DiscountedLineItemPortionDraftTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(DiscountedLineItemPortionDraftBuilder builder) { + DiscountedLineItemPortionDraft discountedLineItemPortionDraft = builder.buildUnchecked(); + Assertions.assertThat(discountedLineItemPortionDraft).isInstanceOf(DiscountedLineItemPortionDraft.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { + new Object[] { DiscountedLineItemPortionDraft.builder() + .discount(new com.commercetools.api.models.common.ReferenceImpl()) }, + new Object[] { DiscountedLineItemPortionDraft.builder() + .discountedAmount(new com.commercetools.api.models.common.TypedMoneyDraftImpl()) } }; + } + + @Test + public void discount() { + DiscountedLineItemPortionDraft value = DiscountedLineItemPortionDraft.of(); + value.setDiscount(new com.commercetools.api.models.common.ReferenceImpl()); + Assertions.assertThat(value.getDiscount()).isEqualTo(new com.commercetools.api.models.common.ReferenceImpl()); + } + + @Test + public void discountedAmount() { + DiscountedLineItemPortionDraft value = DiscountedLineItemPortionDraft.of(); + value.setDiscountedAmount(new com.commercetools.api.models.common.TypedMoneyDraftImpl()); + Assertions.assertThat(value.getDiscountedAmount()) + .isEqualTo(new com.commercetools.api.models.common.TypedMoneyDraftImpl()); + } +} diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftTest.java index d6fc5aff15a..dfe00912d6f 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/order/DiscountedLineItemPriceDraftTest.java @@ -31,7 +31,7 @@ public static Object[][] objectBuilder() { .value(new com.commercetools.api.models.common.MoneyImpl()) }, new Object[] { DiscountedLineItemPriceDraft.builder() .includedDiscounts(Collections.singletonList( - new com.commercetools.api.models.cart.DiscountedLineItemPortionImpl())) } }; + new com.commercetools.api.models.cart.DiscountedLineItemPortionDraftImpl())) } }; } @Test @@ -45,9 +45,9 @@ public void value() { public void includedDiscounts() { DiscountedLineItemPriceDraft value = DiscountedLineItemPriceDraft.of(); value.setIncludedDiscounts( - Collections.singletonList(new com.commercetools.api.models.cart.DiscountedLineItemPortionImpl())); + Collections.singletonList(new com.commercetools.api.models.cart.DiscountedLineItemPortionDraftImpl())); Assertions.assertThat(value.getIncludedDiscounts()) - .isEqualTo( - Collections.singletonList(new com.commercetools.api.models.cart.DiscountedLineItemPortionImpl())); + .isEqualTo(Collections + .singletonList(new com.commercetools.api.models.cart.DiscountedLineItemPortionDraftImpl())); } } diff --git a/references.txt b/references.txt index 549ed4b6f98..b3d0259591d 100644 --- a/references.txt +++ b/references.txt @@ -196,3 +196,4 @@ d10443de67d8c8e684b4e63415b5720fc3bcf169 941e8656001becbc52907ad541f2c61e461d865d d281cfbc160ad09ae2b259b5d65336e7d8107455 be578831c2178be70f96067afc7f51dc08a513e3 +ffed231e91d01608e1bb08ecc1883cf00d9d9293