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[]`
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 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 + * + *
+ * DiscountedLineItemPortionDraft discountedLineItemPortionDraft = DiscountedLineItemPortionDraft.builder()
+ * .discount(discountBuilder -> discountBuilder)
+ * .discountedAmount(discountedAmountBuilder -> discountedAmountBuilder)
+ * .build()
+ *
+ * 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
+ * DiscountedLineItemPortionDraft discountedLineItemPortionDraft = DiscountedLineItemPortionDraft.builder()
+ * .discount(discountBuilder -> discountBuilder)
+ * .discountedAmount(discountedAmountBuilder -> discountedAmountBuilder)
+ * .build()
+ *
+ * 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( + FunctionMoney 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( + FunctionA 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 ListDiscounted 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 ListDiscounted 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.ListDiscounts to be applied.
*/ - public java.util.List