From 666e283e245a066f650d406f7433af2ca97c2af9 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:52:23 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 1 + .../models/cart/CartAddLineItemAction.java | 30 +++++ .../cart/CartAddLineItemActionBuilder.java | 113 +++++++++++++++++- .../cart/CartAddLineItemActionImpl.java | 26 ++++ .../CartAddLineItemActionQueryBuilderDsl.java | 16 +++ .../cart/CartAddLineItemActionTest.java | 14 +++ references.txt | 1 + 7 files changed, 199 insertions(+), 2 deletions(-) diff --git a/changes.md b/changes.md index 9d6922d508d..71a6410f897 100644 --- a/changes.md +++ b/changes.md @@ -3,6 +3,7 @@
Added Property(s) +- added property `perMethodExternalTaxRate` to type `CartAddLineItemAction` - added property `shippingMode` to type `MyCartDraft`
diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemAction.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemAction.java index 529898a84b3..f82886a12a5 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemAction.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemAction.java @@ -5,6 +5,7 @@ import java.time.ZonedDateTime; import java.util.*; import java.util.function.Function; +import java.util.stream.Collectors; import javax.annotation.Nullable; import javax.validation.Valid; @@ -133,6 +134,14 @@ public interface CartAddLineItemAction @JsonProperty("externalTaxRate") public ExternalTaxRateDraft getExternalTaxRate(); + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ * @return perMethodExternalTaxRate + */ + @Valid + @JsonProperty("perMethodExternalTaxRate") + public List getPerMethodExternalTaxRate(); + /** *

Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

* @return inventoryMode @@ -238,6 +247,21 @@ public interface CartAddLineItemAction public void setExternalTaxRate(final ExternalTaxRateDraft externalTaxRate); + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ * @param perMethodExternalTaxRate values to be set + */ + + @JsonIgnore + public void setPerMethodExternalTaxRate(final MethodExternalTaxRateDraft... perMethodExternalTaxRate); + + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

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

Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

* @param inventoryMode value to be set @@ -285,6 +309,7 @@ public static CartAddLineItemAction of(final CartAddLineItemAction template) { instance.setExternalPrice(template.getExternalPrice()); instance.setExternalTotalPrice(template.getExternalTotalPrice()); instance.setExternalTaxRate(template.getExternalTaxRate()); + instance.setPerMethodExternalTaxRate(template.getPerMethodExternalTaxRate()); instance.setInventoryMode(template.getInventoryMode()); instance.setShippingDetails(template.getShippingDetails()); instance.setCustom(template.getCustom()); @@ -317,6 +342,11 @@ public static CartAddLineItemAction deepCopy(@Nullable final CartAddLineItemActi com.commercetools.api.models.cart.ExternalLineItemTotalPrice.deepCopy(template.getExternalTotalPrice())); instance.setExternalTaxRate( com.commercetools.api.models.cart.ExternalTaxRateDraft.deepCopy(template.getExternalTaxRate())); + instance.setPerMethodExternalTaxRate(Optional.ofNullable(template.getPerMethodExternalTaxRate()) + .map(t -> t.stream() + .map(com.commercetools.api.models.cart.MethodExternalTaxRateDraft::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); instance.setInventoryMode(template.getInventoryMode()); instance.setShippingDetails( com.commercetools.api.models.cart.ItemShippingDetailsDraft.deepCopy(template.getShippingDetails())); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionBuilder.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionBuilder.java index e493c86cdbf..62807827217 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionBuilder.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionBuilder.java @@ -56,6 +56,9 @@ public class CartAddLineItemActionBuilder implements Builder perMethodExternalTaxRate; + @Nullable private com.commercetools.api.models.cart.InventoryMode inventoryMode; @@ -323,6 +326,99 @@ public CartAddLineItemActionBuilder externalTaxRate( return this; } + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

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

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

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

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ * @param perMethodExternalTaxRate value to be set + * @return Builder + */ + + public CartAddLineItemActionBuilder plusPerMethodExternalTaxRate( + @Nullable final com.commercetools.api.models.cart.MethodExternalTaxRateDraft... perMethodExternalTaxRate) { + if (this.perMethodExternalTaxRate == null) { + this.perMethodExternalTaxRate = new ArrayList<>(); + } + this.perMethodExternalTaxRate.addAll(Arrays.asList(perMethodExternalTaxRate)); + return this; + } + + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ * @param builder function to build the perMethodExternalTaxRate value + * @return Builder + */ + + public CartAddLineItemActionBuilder plusPerMethodExternalTaxRate( + Function builder) { + if (this.perMethodExternalTaxRate == null) { + this.perMethodExternalTaxRate = new ArrayList<>(); + } + this.perMethodExternalTaxRate + .add(builder.apply(com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder.of()).build()); + return this; + } + + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ * @param builder function to build the perMethodExternalTaxRate value + * @return Builder + */ + + public CartAddLineItemActionBuilder withPerMethodExternalTaxRate( + Function builder) { + this.perMethodExternalTaxRate = new ArrayList<>(); + this.perMethodExternalTaxRate + .add(builder.apply(com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder.of()).build()); + return this; + } + + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ * @param builder function to build the perMethodExternalTaxRate value + * @return Builder + */ + + public CartAddLineItemActionBuilder addPerMethodExternalTaxRate( + Function builder) { + return plusPerMethodExternalTaxRate( + builder.apply(com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder.of())); + } + + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ * @param builder function to build the perMethodExternalTaxRate value + * @return Builder + */ + + public CartAddLineItemActionBuilder setPerMethodExternalTaxRate( + Function builder) { + return perMethodExternalTaxRate( + builder.apply(com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder.of())); + } + /** *

Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

* @param inventoryMode value to be set @@ -522,6 +618,16 @@ public com.commercetools.api.models.cart.ExternalTaxRateDraft getExternalTaxRate return this.externalTaxRate; } + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

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

Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

* @return inventoryMode @@ -558,7 +664,8 @@ public com.commercetools.api.models.type.CustomFieldsDraft getCustom() { */ public CartAddLineItemAction build() { return new CartAddLineItemActionImpl(key, productId, variantId, sku, quantity, addedAt, distributionChannel, - supplyChannel, externalPrice, externalTotalPrice, externalTaxRate, inventoryMode, shippingDetails, custom); + supplyChannel, externalPrice, externalTotalPrice, externalTaxRate, perMethodExternalTaxRate, inventoryMode, + shippingDetails, custom); } /** @@ -567,7 +674,8 @@ public CartAddLineItemAction build() { */ public CartAddLineItemAction buildUnchecked() { return new CartAddLineItemActionImpl(key, productId, variantId, sku, quantity, addedAt, distributionChannel, - supplyChannel, externalPrice, externalTotalPrice, externalTaxRate, inventoryMode, shippingDetails, custom); + supplyChannel, externalPrice, externalTotalPrice, externalTaxRate, perMethodExternalTaxRate, inventoryMode, + shippingDetails, custom); } /** @@ -596,6 +704,7 @@ public static CartAddLineItemActionBuilder of(final CartAddLineItemAction templa builder.externalPrice = template.getExternalPrice(); builder.externalTotalPrice = template.getExternalTotalPrice(); builder.externalTaxRate = template.getExternalTaxRate(); + builder.perMethodExternalTaxRate = template.getPerMethodExternalTaxRate(); builder.inventoryMode = template.getInventoryMode(); builder.shippingDetails = template.getShippingDetails(); builder.custom = template.getCustom(); diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionImpl.java b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionImpl.java index 56e0c0905db..a2b18246536 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionImpl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionImpl.java @@ -48,6 +48,8 @@ public class CartAddLineItemActionImpl implements CartAddLineItemAction, ModelBa private com.commercetools.api.models.cart.ExternalTaxRateDraft externalTaxRate; + private java.util.List perMethodExternalTaxRate; + private com.commercetools.api.models.cart.InventoryMode inventoryMode; private com.commercetools.api.models.cart.ItemShippingDetailsDraft shippingDetails; @@ -67,6 +69,7 @@ public class CartAddLineItemActionImpl implements CartAddLineItemAction, ModelBa @JsonProperty("externalPrice") final com.commercetools.api.models.common.Money externalPrice, @JsonProperty("externalTotalPrice") final com.commercetools.api.models.cart.ExternalLineItemTotalPrice externalTotalPrice, @JsonProperty("externalTaxRate") final com.commercetools.api.models.cart.ExternalTaxRateDraft externalTaxRate, + @JsonProperty("perMethodExternalTaxRate") final java.util.List perMethodExternalTaxRate, @JsonProperty("inventoryMode") final com.commercetools.api.models.cart.InventoryMode inventoryMode, @JsonProperty("shippingDetails") final com.commercetools.api.models.cart.ItemShippingDetailsDraft shippingDetails, @JsonProperty("custom") final com.commercetools.api.models.type.CustomFieldsDraft custom) { @@ -81,6 +84,7 @@ public class CartAddLineItemActionImpl implements CartAddLineItemAction, ModelBa this.externalPrice = externalPrice; this.externalTotalPrice = externalTotalPrice; this.externalTaxRate = externalTaxRate; + this.perMethodExternalTaxRate = perMethodExternalTaxRate; this.inventoryMode = inventoryMode; this.shippingDetails = shippingDetails; this.custom = custom; @@ -194,6 +198,14 @@ public com.commercetools.api.models.cart.ExternalTaxRateDraft getExternalTaxRate return this.externalTaxRate; } + /** + *

Sets the external Tax Rates for individual Shipping Methods, if the Cart has the External TaxMode and Multiple ShippingMode.

+ */ + + public java.util.List getPerMethodExternalTaxRate() { + return this.perMethodExternalTaxRate; + } + /** *

Inventory mode specific to the Line Item only, and valid for the entire quantity of the Line Item. Set only if the inventory mode should be different from the inventoryMode specified on the Cart.

*/ @@ -264,6 +276,16 @@ public void setExternalTaxRate(final com.commercetools.api.models.cart.ExternalT this.externalTaxRate = externalTaxRate; } + public void setPerMethodExternalTaxRate( + final com.commercetools.api.models.cart.MethodExternalTaxRateDraft... perMethodExternalTaxRate) { + this.perMethodExternalTaxRate = new ArrayList<>(Arrays.asList(perMethodExternalTaxRate)); + } + + public void setPerMethodExternalTaxRate( + final java.util.List perMethodExternalTaxRate) { + this.perMethodExternalTaxRate = perMethodExternalTaxRate; + } + public void setInventoryMode(final com.commercetools.api.models.cart.InventoryMode inventoryMode) { this.inventoryMode = inventoryMode; } @@ -298,6 +320,7 @@ public boolean equals(Object o) { .append(externalPrice, that.externalPrice) .append(externalTotalPrice, that.externalTotalPrice) .append(externalTaxRate, that.externalTaxRate) + .append(perMethodExternalTaxRate, that.perMethodExternalTaxRate) .append(inventoryMode, that.inventoryMode) .append(shippingDetails, that.shippingDetails) .append(custom, that.custom) @@ -313,6 +336,7 @@ public boolean equals(Object o) { .append(externalPrice, that.externalPrice) .append(externalTotalPrice, that.externalTotalPrice) .append(externalTaxRate, that.externalTaxRate) + .append(perMethodExternalTaxRate, that.perMethodExternalTaxRate) .append(inventoryMode, that.inventoryMode) .append(shippingDetails, that.shippingDetails) .append(custom, that.custom) @@ -333,6 +357,7 @@ public int hashCode() { .append(externalPrice) .append(externalTotalPrice) .append(externalTaxRate) + .append(perMethodExternalTaxRate) .append(inventoryMode) .append(shippingDetails) .append(custom) @@ -353,6 +378,7 @@ public String toString() { .append("externalPrice", externalPrice) .append("externalTotalPrice", externalTotalPrice) .append("externalTaxRate", externalTaxRate) + .append("perMethodExternalTaxRate", perMethodExternalTaxRate) .append("inventoryMode", inventoryMode) .append("shippingDetails", shippingDetails) .append("custom", custom) diff --git a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/CartAddLineItemActionQueryBuilderDsl.java b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/CartAddLineItemActionQueryBuilderDsl.java index 73f629c41a0..7077c1dbd2e 100644 --- a/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/CartAddLineItemActionQueryBuilderDsl.java +++ b/commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/CartAddLineItemActionQueryBuilderDsl.java @@ -100,6 +100,22 @@ public CombinationQueryPredicate externalT CartAddLineItemActionQueryBuilderDsl::of); } + public CombinationQueryPredicate perMethodExternalTaxRate( + Function> fn) { + return new CombinationQueryPredicate<>( + ContainerQueryPredicate.of() + .parent(ConstantQueryPredicate.of().constant("perMethodExternalTaxRate")) + .inner(fn.apply( + com.commercetools.api.predicates.query.cart.MethodExternalTaxRateDraftQueryBuilderDsl.of())), + CartAddLineItemActionQueryBuilderDsl::of); + } + + public CollectionPredicateBuilder perMethodExternalTaxRate() { + return new CollectionPredicateBuilder<>( + BinaryQueryPredicate.of().left(new ConstantQueryPredicate("perMethodExternalTaxRate")), + p -> new CombinationQueryPredicate<>(p, CartAddLineItemActionQueryBuilderDsl::of)); + } + public StringComparisonPredicateBuilder inventoryMode() { return new StringComparisonPredicateBuilder<>( BinaryQueryPredicate.of().left(new ConstantQueryPredicate("inventoryMode")), diff --git a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionTest.java b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionTest.java index 42e9a4847c3..ec0f0fd8a6d 100644 --- a/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionTest.java +++ b/commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/CartAddLineItemActionTest.java @@ -2,6 +2,7 @@ package com.commercetools.api.models.cart; import java.time.ZonedDateTime; +import java.util.Collections; import com.tngtech.junit.dataprovider.DataProvider; import com.tngtech.junit.dataprovider.DataProviderExtension; @@ -43,6 +44,9 @@ public static Object[][] objectBuilder() { .externalTotalPrice(new com.commercetools.api.models.cart.ExternalLineItemTotalPriceImpl()) }, new Object[] { CartAddLineItemAction.builder() .externalTaxRate(new com.commercetools.api.models.cart.ExternalTaxRateDraftImpl()) }, + new Object[] { CartAddLineItemAction.builder() + .perMethodExternalTaxRate(Collections.singletonList( + new com.commercetools.api.models.cart.MethodExternalTaxRateDraftImpl())) }, new Object[] { CartAddLineItemAction.builder() .inventoryMode(com.commercetools.api.models.cart.InventoryMode.findEnum("None")) }, new Object[] { CartAddLineItemAction.builder() @@ -132,6 +136,16 @@ public void externalTaxRate() { .isEqualTo(new com.commercetools.api.models.cart.ExternalTaxRateDraftImpl()); } + @Test + public void perMethodExternalTaxRate() { + CartAddLineItemAction value = CartAddLineItemAction.of(); + value.setPerMethodExternalTaxRate( + Collections.singletonList(new com.commercetools.api.models.cart.MethodExternalTaxRateDraftImpl())); + Assertions.assertThat(value.getPerMethodExternalTaxRate()) + .isEqualTo( + Collections.singletonList(new com.commercetools.api.models.cart.MethodExternalTaxRateDraftImpl())); + } + @Test public void inventoryMode() { CartAddLineItemAction value = CartAddLineItemAction.of(); diff --git a/references.txt b/references.txt index b69b0513f2a..fe06814e0ba 100644 --- a/references.txt +++ b/references.txt @@ -191,3 +191,4 @@ bbed21a27bf83c8ac16f323969d71a8855623523 e3a178953d3d929a58092a0c86d666fee6400c75 d10443de67d8c8e684b4e63415b5720fc3bcf169 886f8d7e51ee9afd3dea683e0b6ed042eec469f1 +5b5166eedb28e48364c82c3fcf2d795983fe9fa8