Skip to content

Commit

Permalink
build(codegen): updating SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Jan 31, 2024
1 parent ba0833f commit 666e283
Show file tree
Hide file tree
Showing 7 changed files with 199 additions and 2 deletions.
1 change: 1 addition & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<details>
<summary>Added Property(s)</summary>

- added property `perMethodExternalTaxRate` to type `CartAddLineItemAction`
- added property `shippingMode` to type `MyCartDraft`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -133,6 +134,14 @@ public interface CartAddLineItemAction
@JsonProperty("externalTaxRate")
public ExternalTaxRateDraft getExternalTaxRate();

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @return perMethodExternalTaxRate
*/
@Valid
@JsonProperty("perMethodExternalTaxRate")
public List<MethodExternalTaxRateDraft> getPerMethodExternalTaxRate();

/**
* <p>Inventory mode specific to the Line Item only, and valid for the entire <code>quantity</code> of the Line Item. Set only if the inventory mode should be different from the <code>inventoryMode</code> specified on the Cart.</p>
* @return inventoryMode
Expand Down Expand Up @@ -238,6 +247,21 @@ public interface CartAddLineItemAction

public void setExternalTaxRate(final ExternalTaxRateDraft externalTaxRate);

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @param perMethodExternalTaxRate values to be set
*/

@JsonIgnore
public void setPerMethodExternalTaxRate(final MethodExternalTaxRateDraft... perMethodExternalTaxRate);

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @param perMethodExternalTaxRate values to be set
*/

public void setPerMethodExternalTaxRate(final List<MethodExternalTaxRateDraft> perMethodExternalTaxRate);

/**
* <p>Inventory mode specific to the Line Item only, and valid for the entire <code>quantity</code> of the Line Item. Set only if the inventory mode should be different from the <code>inventoryMode</code> specified on the Cart.</p>
* @param inventoryMode value to be set
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public class CartAddLineItemActionBuilder implements Builder<CartAddLineItemActi
@Nullable
private com.commercetools.api.models.cart.ExternalTaxRateDraft externalTaxRate;

@Nullable
private java.util.List<com.commercetools.api.models.cart.MethodExternalTaxRateDraft> perMethodExternalTaxRate;

@Nullable
private com.commercetools.api.models.cart.InventoryMode inventoryMode;

Expand Down Expand Up @@ -323,6 +326,99 @@ public CartAddLineItemActionBuilder externalTaxRate(
return this;
}

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @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;
}

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @param perMethodExternalTaxRate value to be set
* @return Builder
*/

public CartAddLineItemActionBuilder perMethodExternalTaxRate(
@Nullable final java.util.List<com.commercetools.api.models.cart.MethodExternalTaxRateDraft> perMethodExternalTaxRate) {
this.perMethodExternalTaxRate = perMethodExternalTaxRate;
return this;
}

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @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;
}

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @param builder function to build the perMethodExternalTaxRate value
* @return Builder
*/

public CartAddLineItemActionBuilder plusPerMethodExternalTaxRate(
Function<com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder, com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder> builder) {
if (this.perMethodExternalTaxRate == null) {
this.perMethodExternalTaxRate = new ArrayList<>();
}
this.perMethodExternalTaxRate
.add(builder.apply(com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder.of()).build());
return this;
}

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @param builder function to build the perMethodExternalTaxRate value
* @return Builder
*/

public CartAddLineItemActionBuilder withPerMethodExternalTaxRate(
Function<com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder, com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder> builder) {
this.perMethodExternalTaxRate = new ArrayList<>();
this.perMethodExternalTaxRate
.add(builder.apply(com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder.of()).build());
return this;
}

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @param builder function to build the perMethodExternalTaxRate value
* @return Builder
*/

public CartAddLineItemActionBuilder addPerMethodExternalTaxRate(
Function<com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder, com.commercetools.api.models.cart.MethodExternalTaxRateDraft> builder) {
return plusPerMethodExternalTaxRate(
builder.apply(com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder.of()));
}

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @param builder function to build the perMethodExternalTaxRate value
* @return Builder
*/

public CartAddLineItemActionBuilder setPerMethodExternalTaxRate(
Function<com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder, com.commercetools.api.models.cart.MethodExternalTaxRateDraft> builder) {
return perMethodExternalTaxRate(
builder.apply(com.commercetools.api.models.cart.MethodExternalTaxRateDraftBuilder.of()));
}

/**
* <p>Inventory mode specific to the Line Item only, and valid for the entire <code>quantity</code> of the Line Item. Set only if the inventory mode should be different from the <code>inventoryMode</code> specified on the Cart.</p>
* @param inventoryMode value to be set
Expand Down Expand Up @@ -522,6 +618,16 @@ public com.commercetools.api.models.cart.ExternalTaxRateDraft getExternalTaxRate
return this.externalTaxRate;
}

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
* @return perMethodExternalTaxRate
*/

@Nullable
public java.util.List<com.commercetools.api.models.cart.MethodExternalTaxRateDraft> getPerMethodExternalTaxRate() {
return this.perMethodExternalTaxRate;
}

/**
* <p>Inventory mode specific to the Line Item only, and valid for the entire <code>quantity</code> of the Line Item. Set only if the inventory mode should be different from the <code>inventoryMode</code> specified on the Cart.</p>
* @return inventoryMode
Expand Down Expand Up @@ -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);
}

/**
Expand All @@ -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);
}

/**
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public class CartAddLineItemActionImpl implements CartAddLineItemAction, ModelBa

private com.commercetools.api.models.cart.ExternalTaxRateDraft externalTaxRate;

private java.util.List<com.commercetools.api.models.cart.MethodExternalTaxRateDraft> perMethodExternalTaxRate;

private com.commercetools.api.models.cart.InventoryMode inventoryMode;

private com.commercetools.api.models.cart.ItemShippingDetailsDraft shippingDetails;
Expand All @@ -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<com.commercetools.api.models.cart.MethodExternalTaxRateDraft> 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) {
Expand All @@ -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;
Expand Down Expand Up @@ -194,6 +198,14 @@ public com.commercetools.api.models.cart.ExternalTaxRateDraft getExternalTaxRate
return this.externalTaxRate;
}

/**
* <p>Sets the external Tax Rates for individual Shipping Methods, if the Cart has the <code>External</code> TaxMode and <code>Multiple</code> ShippingMode.</p>
*/

public java.util.List<com.commercetools.api.models.cart.MethodExternalTaxRateDraft> getPerMethodExternalTaxRate() {
return this.perMethodExternalTaxRate;
}

/**
* <p>Inventory mode specific to the Line Item only, and valid for the entire <code>quantity</code> of the Line Item. Set only if the inventory mode should be different from the <code>inventoryMode</code> specified on the Cart.</p>
*/
Expand Down Expand Up @@ -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<com.commercetools.api.models.cart.MethodExternalTaxRateDraft> perMethodExternalTaxRate) {
this.perMethodExternalTaxRate = perMethodExternalTaxRate;
}

public void setInventoryMode(final com.commercetools.api.models.cart.InventoryMode inventoryMode) {
this.inventoryMode = inventoryMode;
}
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -333,6 +357,7 @@ public int hashCode() {
.append(externalPrice)
.append(externalTotalPrice)
.append(externalTaxRate)
.append(perMethodExternalTaxRate)
.append(inventoryMode)
.append(shippingDetails)
.append(custom)
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,22 @@ public CombinationQueryPredicate<CartAddLineItemActionQueryBuilderDsl> externalT
CartAddLineItemActionQueryBuilderDsl::of);
}

public CombinationQueryPredicate<CartAddLineItemActionQueryBuilderDsl> perMethodExternalTaxRate(
Function<com.commercetools.api.predicates.query.cart.MethodExternalTaxRateDraftQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.cart.MethodExternalTaxRateDraftQueryBuilderDsl>> 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<CartAddLineItemActionQueryBuilderDsl> perMethodExternalTaxRate() {
return new CollectionPredicateBuilder<>(
BinaryQueryPredicate.of().left(new ConstantQueryPredicate("perMethodExternalTaxRate")),
p -> new CombinationQueryPredicate<>(p, CartAddLineItemActionQueryBuilderDsl::of));
}

public StringComparisonPredicateBuilder<CartAddLineItemActionQueryBuilderDsl> inventoryMode() {
return new StringComparisonPredicateBuilder<>(
BinaryQueryPredicate.of().left(new ConstantQueryPredicate("inventoryMode")),
Expand Down
Loading

0 comments on commit 666e283

Please sign in to comment.