Skip to content

Commit

Permalink
Merge pull request #588 from commercetools/gen-sdk-updates
Browse files Browse the repository at this point in the history
Update generated SDKs
  • Loading branch information
kodiakhq[bot] authored Feb 22, 2024
2 parents 2dfcba7 + 6ba69b5 commit c8dcbd1
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 6 deletions.
7 changes: 7 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@
</details>


<details>
<summary>Added Property(s)</summary>

- added property `totalTax` to type `TaxedPriceDraft`
</details>


<details>
<summary>Required Property(s)</summary>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import javax.validation.constraints.NotNull;

import com.commercetools.api.models.common.Money;
import com.commercetools.api.models.common.TypedMoneyDraft;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;

Expand Down Expand Up @@ -63,6 +64,14 @@ public interface TaxedPriceDraft extends io.vrap.rmf.base.client.Draft<TaxedPric
@JsonProperty("taxPortions")
public List<TaxPortionDraft> getTaxPortions();

/**
* <p>Total tax applicable for the Cart or Order.</p>
* @return totalTax
*/
@Valid
@JsonProperty("totalTax")
public TypedMoneyDraft getTotalTax();

/**
* <p>Total net price of the Cart or Order.</p>
* @param totalNet value to be set
Expand Down Expand Up @@ -94,6 +103,13 @@ public interface TaxedPriceDraft extends io.vrap.rmf.base.client.Draft<TaxedPric

public void setTaxPortions(final List<TaxPortionDraft> taxPortions);

/**
* <p>Total tax applicable for the Cart or Order.</p>
* @param totalTax value to be set
*/

public void setTotalTax(final TypedMoneyDraft totalTax);

/**
* factory method
* @return instance of TaxedPriceDraft
Expand All @@ -112,6 +128,7 @@ public static TaxedPriceDraft of(final TaxedPriceDraft template) {
instance.setTotalNet(template.getTotalNet());
instance.setTotalGross(template.getTotalGross());
instance.setTaxPortions(template.getTaxPortions());
instance.setTotalTax(template.getTotalTax());
return instance;
}

Expand All @@ -133,6 +150,7 @@ public static TaxedPriceDraft deepCopy(@Nullable final TaxedPriceDraft template)
.map(com.commercetools.api.models.cart.TaxPortionDraft::deepCopy)
.collect(Collectors.toList()))
.orElse(null));
instance.setTotalTax(com.commercetools.api.models.common.TypedMoneyDraft.deepCopy(template.getTotalTax()));
return instance;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import java.util.*;
import java.util.function.Function;

import javax.annotation.Nullable;

import io.vrap.rmf.base.client.Builder;
import io.vrap.rmf.base.client.utils.Generated;

Expand All @@ -30,6 +32,9 @@ public class TaxedPriceDraftBuilder implements Builder<TaxedPriceDraft> {

private java.util.List<com.commercetools.api.models.cart.TaxPortionDraft> taxPortions;

@Nullable
private com.commercetools.api.models.common.TypedMoneyDraft totalTax;

/**
* <p>Total net price of the Cart or Order.</p>
* @param builder function to build the totalNet value
Expand Down Expand Up @@ -195,6 +200,30 @@ public TaxedPriceDraftBuilder setTaxPortions(
return taxPortions(builder.apply(com.commercetools.api.models.cart.TaxPortionDraftBuilder.of()));
}

/**
* <p>Total tax applicable for the Cart or Order.</p>
* @param totalTax value to be set
* @return Builder
*/

public TaxedPriceDraftBuilder totalTax(
@Nullable final com.commercetools.api.models.common.TypedMoneyDraft totalTax) {
this.totalTax = totalTax;
return this;
}

/**
* <p>Total tax applicable for the Cart or Order.</p>
* @param builder function to build the totalTax value
* @return Builder
*/

public TaxedPriceDraftBuilder totalTax(
Function<com.commercetools.api.models.common.TypedMoneyDraftBuilder, Builder<? extends com.commercetools.api.models.common.TypedMoneyDraft>> builder) {
this.totalTax = builder.apply(com.commercetools.api.models.common.TypedMoneyDraftBuilder.of()).build();
return this;
}

/**
* <p>Total net price of the Cart or Order.</p>
* @return totalNet
Expand Down Expand Up @@ -223,6 +252,16 @@ public java.util.List<com.commercetools.api.models.cart.TaxPortionDraft> getTaxP
return this.taxPortions;
}

/**
* <p>Total tax applicable for the Cart or Order.</p>
* @return totalTax
*/

@Nullable
public com.commercetools.api.models.common.TypedMoneyDraft getTotalTax() {
return this.totalTax;
}

/**
* builds TaxedPriceDraft with checking for non-null required values
* @return TaxedPriceDraft
Expand All @@ -231,15 +270,15 @@ public TaxedPriceDraft build() {
Objects.requireNonNull(totalNet, TaxedPriceDraft.class + ": totalNet is missing");
Objects.requireNonNull(totalGross, TaxedPriceDraft.class + ": totalGross is missing");
Objects.requireNonNull(taxPortions, TaxedPriceDraft.class + ": taxPortions is missing");
return new TaxedPriceDraftImpl(totalNet, totalGross, taxPortions);
return new TaxedPriceDraftImpl(totalNet, totalGross, taxPortions, totalTax);
}

/**
* builds TaxedPriceDraft without checking for non-null required values
* @return TaxedPriceDraft
*/
public TaxedPriceDraft buildUnchecked() {
return new TaxedPriceDraftImpl(totalNet, totalGross, taxPortions);
return new TaxedPriceDraftImpl(totalNet, totalGross, taxPortions, totalTax);
}

/**
Expand All @@ -260,6 +299,7 @@ public static TaxedPriceDraftBuilder of(final TaxedPriceDraft template) {
builder.totalNet = template.getTotalNet();
builder.totalGross = template.getTotalGross();
builder.taxPortions = template.getTaxPortions();
builder.totalTax = template.getTotalTax();
return builder;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ public class TaxedPriceDraftImpl implements TaxedPriceDraft, ModelBase {

private java.util.List<com.commercetools.api.models.cart.TaxPortionDraft> taxPortions;

private com.commercetools.api.models.common.TypedMoneyDraft totalTax;

/**
* create instance with all properties
*/
@JsonCreator
TaxedPriceDraftImpl(@JsonProperty("totalNet") final com.commercetools.api.models.common.Money totalNet,
@JsonProperty("totalGross") final com.commercetools.api.models.common.Money totalGross,
@JsonProperty("taxPortions") final java.util.List<com.commercetools.api.models.cart.TaxPortionDraft> taxPortions) {
@JsonProperty("taxPortions") final java.util.List<com.commercetools.api.models.cart.TaxPortionDraft> taxPortions,
@JsonProperty("totalTax") final com.commercetools.api.models.common.TypedMoneyDraft totalTax) {
this.totalNet = totalNet;
this.totalGross = totalGross;
this.taxPortions = taxPortions;
this.totalTax = totalTax;
}

/**
Expand Down Expand Up @@ -71,6 +75,14 @@ public java.util.List<com.commercetools.api.models.cart.TaxPortionDraft> getTaxP
return this.taxPortions;
}

/**
* <p>Total tax applicable for the Cart or Order.</p>
*/

public com.commercetools.api.models.common.TypedMoneyDraft getTotalTax() {
return this.totalTax;
}

public void setTotalNet(final com.commercetools.api.models.common.Money totalNet) {
this.totalNet = totalNet;
}
Expand All @@ -87,6 +99,10 @@ public void setTaxPortions(final java.util.List<com.commercetools.api.models.car
this.taxPortions = taxPortions;
}

public void setTotalTax(final com.commercetools.api.models.common.TypedMoneyDraft totalTax) {
this.totalTax = totalTax;
}

@Override
public boolean equals(Object o) {
if (this == o)
Expand All @@ -100,22 +116,29 @@ public boolean equals(Object o) {
return new EqualsBuilder().append(totalNet, that.totalNet)
.append(totalGross, that.totalGross)
.append(taxPortions, that.taxPortions)
.append(totalTax, that.totalTax)
.append(totalNet, that.totalNet)
.append(totalGross, that.totalGross)
.append(taxPortions, that.taxPortions)
.append(totalTax, that.totalTax)
.isEquals();
}

@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(totalNet).append(totalGross).append(taxPortions).toHashCode();
return new HashCodeBuilder(17, 37).append(totalNet)
.append(totalGross)
.append(taxPortions)
.append(totalTax)
.toHashCode();
}

@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("totalNet", totalNet)
.append("totalGross", totalGross)
.append("taxPortions", taxPortions)
.append("totalTax", totalTax)
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,13 @@ public CollectionPredicateBuilder<TaxedPriceDraftQueryBuilderDsl> taxPortions()
p -> new CombinationQueryPredicate<>(p, TaxedPriceDraftQueryBuilderDsl::of));
}

public CombinationQueryPredicate<TaxedPriceDraftQueryBuilderDsl> totalTax(
Function<com.commercetools.api.predicates.query.common.TypedMoneyDraftQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.common.TypedMoneyDraftQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(
ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("totalTax"))
.inner(fn.apply(com.commercetools.api.predicates.query.common.TypedMoneyDraftQueryBuilderDsl.of())),
TaxedPriceDraftQueryBuilderDsl::of);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,12 @@ public static Object[][] objectBuilder() {
TaxedPriceDraft.builder().totalNet(new com.commercetools.api.models.common.MoneyImpl()) },
new Object[] {
TaxedPriceDraft.builder().totalGross(new com.commercetools.api.models.common.MoneyImpl()) },
new Object[] {
TaxedPriceDraft.builder()
.taxPortions(Collections
.singletonList(new com.commercetools.api.models.cart.TaxPortionDraftImpl())) },
new Object[] { TaxedPriceDraft.builder()
.taxPortions(
Collections.singletonList(new com.commercetools.api.models.cart.TaxPortionDraftImpl())) } };
.totalTax(new com.commercetools.api.models.common.TypedMoneyDraftImpl()) } };
}

@Test
Expand All @@ -57,4 +60,12 @@ public void taxPortions() {
Assertions.assertThat(value.getTaxPortions())
.isEqualTo(Collections.singletonList(new com.commercetools.api.models.cart.TaxPortionDraftImpl()));
}

@Test
public void totalTax() {
TaxedPriceDraft value = TaxedPriceDraft.of();
value.setTotalTax(new com.commercetools.api.models.common.TypedMoneyDraftImpl());
Assertions.assertThat(value.getTotalTax())
.isEqualTo(new com.commercetools.api.models.common.TypedMoneyDraftImpl());
}
}
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,4 @@ ffed231e91d01608e1bb08ecc1883cf00d9d9293
85b828533f486b4a2906e3b93c08761f9d723732
65619eef7e065950cbb92467d72eaacc68004a14
4aa1e888d0003de63e2b21493c61c1c5e342bfe4
48bbac8851ae864319c404607e9f10b874df0e3f

0 comments on commit c8dcbd1

Please sign in to comment.