Skip to content

Commit c8dcbd1

Browse files
Merge pull request #588 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents 2dfcba7 + 6ba69b5 commit c8dcbd1

File tree

7 files changed

+115
-6
lines changed

7 files changed

+115
-6
lines changed

changes.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@
1414
</details>
1515

1616

17+
<details>
18+
<summary>Added Property(s)</summary>
19+
20+
- added property `totalTax` to type `TaxedPriceDraft`
21+
</details>
22+
23+
1724
<details>
1825
<summary>Required Property(s)</summary>
1926

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/TaxedPriceDraft.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import javax.validation.constraints.NotNull;
1212

1313
import com.commercetools.api.models.common.Money;
14+
import com.commercetools.api.models.common.TypedMoneyDraft;
1415
import com.fasterxml.jackson.annotation.*;
1516
import com.fasterxml.jackson.databind.annotation.*;
1617

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

67+
/**
68+
* <p>Total tax applicable for the Cart or Order.</p>
69+
* @return totalTax
70+
*/
71+
@Valid
72+
@JsonProperty("totalTax")
73+
public TypedMoneyDraft getTotalTax();
74+
6675
/**
6776
* <p>Total net price of the Cart or Order.</p>
6877
* @param totalNet value to be set
@@ -94,6 +103,13 @@ public interface TaxedPriceDraft extends io.vrap.rmf.base.client.Draft<TaxedPric
94103

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

106+
/**
107+
* <p>Total tax applicable for the Cart or Order.</p>
108+
* @param totalTax value to be set
109+
*/
110+
111+
public void setTotalTax(final TypedMoneyDraft totalTax);
112+
97113
/**
98114
* factory method
99115
* @return instance of TaxedPriceDraft
@@ -112,6 +128,7 @@ public static TaxedPriceDraft of(final TaxedPriceDraft template) {
112128
instance.setTotalNet(template.getTotalNet());
113129
instance.setTotalGross(template.getTotalGross());
114130
instance.setTaxPortions(template.getTaxPortions());
131+
instance.setTotalTax(template.getTotalTax());
115132
return instance;
116133
}
117134

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

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/TaxedPriceDraftBuilder.java

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import java.util.*;
55
import java.util.function.Function;
66

7+
import javax.annotation.Nullable;
8+
79
import io.vrap.rmf.base.client.Builder;
810
import io.vrap.rmf.base.client.utils.Generated;
911

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

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

35+
@Nullable
36+
private com.commercetools.api.models.common.TypedMoneyDraft totalTax;
37+
3338
/**
3439
* <p>Total net price of the Cart or Order.</p>
3540
* @param builder function to build the totalNet value
@@ -195,6 +200,30 @@ public TaxedPriceDraftBuilder setTaxPortions(
195200
return taxPortions(builder.apply(com.commercetools.api.models.cart.TaxPortionDraftBuilder.of()));
196201
}
197202

203+
/**
204+
* <p>Total tax applicable for the Cart or Order.</p>
205+
* @param totalTax value to be set
206+
* @return Builder
207+
*/
208+
209+
public TaxedPriceDraftBuilder totalTax(
210+
@Nullable final com.commercetools.api.models.common.TypedMoneyDraft totalTax) {
211+
this.totalTax = totalTax;
212+
return this;
213+
}
214+
215+
/**
216+
* <p>Total tax applicable for the Cart or Order.</p>
217+
* @param builder function to build the totalTax value
218+
* @return Builder
219+
*/
220+
221+
public TaxedPriceDraftBuilder totalTax(
222+
Function<com.commercetools.api.models.common.TypedMoneyDraftBuilder, Builder<? extends com.commercetools.api.models.common.TypedMoneyDraft>> builder) {
223+
this.totalTax = builder.apply(com.commercetools.api.models.common.TypedMoneyDraftBuilder.of()).build();
224+
return this;
225+
}
226+
198227
/**
199228
* <p>Total net price of the Cart or Order.</p>
200229
* @return totalNet
@@ -223,6 +252,16 @@ public java.util.List<com.commercetools.api.models.cart.TaxPortionDraft> getTaxP
223252
return this.taxPortions;
224253
}
225254

255+
/**
256+
* <p>Total tax applicable for the Cart or Order.</p>
257+
* @return totalTax
258+
*/
259+
260+
@Nullable
261+
public com.commercetools.api.models.common.TypedMoneyDraft getTotalTax() {
262+
return this.totalTax;
263+
}
264+
226265
/**
227266
* builds TaxedPriceDraft with checking for non-null required values
228267
* @return TaxedPriceDraft
@@ -231,15 +270,15 @@ public TaxedPriceDraft build() {
231270
Objects.requireNonNull(totalNet, TaxedPriceDraft.class + ": totalNet is missing");
232271
Objects.requireNonNull(totalGross, TaxedPriceDraft.class + ": totalGross is missing");
233272
Objects.requireNonNull(taxPortions, TaxedPriceDraft.class + ": taxPortions is missing");
234-
return new TaxedPriceDraftImpl(totalNet, totalGross, taxPortions);
273+
return new TaxedPriceDraftImpl(totalNet, totalGross, taxPortions, totalTax);
235274
}
236275

237276
/**
238277
* builds TaxedPriceDraft without checking for non-null required values
239278
* @return TaxedPriceDraft
240279
*/
241280
public TaxedPriceDraft buildUnchecked() {
242-
return new TaxedPriceDraftImpl(totalNet, totalGross, taxPortions);
281+
return new TaxedPriceDraftImpl(totalNet, totalGross, taxPortions, totalTax);
243282
}
244283

245284
/**
@@ -260,6 +299,7 @@ public static TaxedPriceDraftBuilder of(final TaxedPriceDraft template) {
260299
builder.totalNet = template.getTotalNet();
261300
builder.totalGross = template.getTotalGross();
262301
builder.taxPortions = template.getTaxPortions();
302+
builder.totalTax = template.getTotalTax();
263303
return builder;
264304
}
265305

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/cart/TaxedPriceDraftImpl.java

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,20 @@ public class TaxedPriceDraftImpl implements TaxedPriceDraft, ModelBase {
2828

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

31+
private com.commercetools.api.models.common.TypedMoneyDraft totalTax;
32+
3133
/**
3234
* create instance with all properties
3335
*/
3436
@JsonCreator
3537
TaxedPriceDraftImpl(@JsonProperty("totalNet") final com.commercetools.api.models.common.Money totalNet,
3638
@JsonProperty("totalGross") final com.commercetools.api.models.common.Money totalGross,
37-
@JsonProperty("taxPortions") final java.util.List<com.commercetools.api.models.cart.TaxPortionDraft> taxPortions) {
39+
@JsonProperty("taxPortions") final java.util.List<com.commercetools.api.models.cart.TaxPortionDraft> taxPortions,
40+
@JsonProperty("totalTax") final com.commercetools.api.models.common.TypedMoneyDraft totalTax) {
3841
this.totalNet = totalNet;
3942
this.totalGross = totalGross;
4043
this.taxPortions = taxPortions;
44+
this.totalTax = totalTax;
4145
}
4246

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

78+
/**
79+
* <p>Total tax applicable for the Cart or Order.</p>
80+
*/
81+
82+
public com.commercetools.api.models.common.TypedMoneyDraft getTotalTax() {
83+
return this.totalTax;
84+
}
85+
7486
public void setTotalNet(final com.commercetools.api.models.common.Money totalNet) {
7587
this.totalNet = totalNet;
7688
}
@@ -87,6 +99,10 @@ public void setTaxPortions(final java.util.List<com.commercetools.api.models.car
8799
this.taxPortions = taxPortions;
88100
}
89101

102+
public void setTotalTax(final com.commercetools.api.models.common.TypedMoneyDraft totalTax) {
103+
this.totalTax = totalTax;
104+
}
105+
90106
@Override
91107
public boolean equals(Object o) {
92108
if (this == o)
@@ -100,22 +116,29 @@ public boolean equals(Object o) {
100116
return new EqualsBuilder().append(totalNet, that.totalNet)
101117
.append(totalGross, that.totalGross)
102118
.append(taxPortions, that.taxPortions)
119+
.append(totalTax, that.totalTax)
103120
.append(totalNet, that.totalNet)
104121
.append(totalGross, that.totalGross)
105122
.append(taxPortions, that.taxPortions)
123+
.append(totalTax, that.totalTax)
106124
.isEquals();
107125
}
108126

109127
@Override
110128
public int hashCode() {
111-
return new HashCodeBuilder(17, 37).append(totalNet).append(totalGross).append(taxPortions).toHashCode();
129+
return new HashCodeBuilder(17, 37).append(totalNet)
130+
.append(totalGross)
131+
.append(taxPortions)
132+
.append(totalTax)
133+
.toHashCode();
112134
}
113135

114136
@Override
115137
public String toString() {
116138
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("totalNet", totalNet)
117139
.append("totalGross", totalGross)
118140
.append("taxPortions", taxPortions)
141+
.append("totalTax", totalTax)
119142
.build();
120143
}
121144

commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/cart/TaxedPriceDraftQueryBuilderDsl.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,13 @@ public CollectionPredicateBuilder<TaxedPriceDraftQueryBuilderDsl> taxPortions()
4646
p -> new CombinationQueryPredicate<>(p, TaxedPriceDraftQueryBuilderDsl::of));
4747
}
4848

49+
public CombinationQueryPredicate<TaxedPriceDraftQueryBuilderDsl> totalTax(
50+
Function<com.commercetools.api.predicates.query.common.TypedMoneyDraftQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.common.TypedMoneyDraftQueryBuilderDsl>> fn) {
51+
return new CombinationQueryPredicate<>(
52+
ContainerQueryPredicate.of()
53+
.parent(ConstantQueryPredicate.of().constant("totalTax"))
54+
.inner(fn.apply(com.commercetools.api.predicates.query.common.TypedMoneyDraftQueryBuilderDsl.of())),
55+
TaxedPriceDraftQueryBuilderDsl::of);
56+
}
57+
4958
}

commercetools/commercetools-sdk-java-api/src/test/java-generated/com/commercetools/api/models/cart/TaxedPriceDraftTest.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,12 @@ public static Object[][] objectBuilder() {
3131
TaxedPriceDraft.builder().totalNet(new com.commercetools.api.models.common.MoneyImpl()) },
3232
new Object[] {
3333
TaxedPriceDraft.builder().totalGross(new com.commercetools.api.models.common.MoneyImpl()) },
34+
new Object[] {
35+
TaxedPriceDraft.builder()
36+
.taxPortions(Collections
37+
.singletonList(new com.commercetools.api.models.cart.TaxPortionDraftImpl())) },
3438
new Object[] { TaxedPriceDraft.builder()
35-
.taxPortions(
36-
Collections.singletonList(new com.commercetools.api.models.cart.TaxPortionDraftImpl())) } };
39+
.totalTax(new com.commercetools.api.models.common.TypedMoneyDraftImpl()) } };
3740
}
3841

3942
@Test
@@ -57,4 +60,12 @@ public void taxPortions() {
5760
Assertions.assertThat(value.getTaxPortions())
5861
.isEqualTo(Collections.singletonList(new com.commercetools.api.models.cart.TaxPortionDraftImpl()));
5962
}
63+
64+
@Test
65+
public void totalTax() {
66+
TaxedPriceDraft value = TaxedPriceDraft.of();
67+
value.setTotalTax(new com.commercetools.api.models.common.TypedMoneyDraftImpl());
68+
Assertions.assertThat(value.getTotalTax())
69+
.isEqualTo(new com.commercetools.api.models.common.TypedMoneyDraftImpl());
70+
}
6071
}

references.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,4 @@ ffed231e91d01608e1bb08ecc1883cf00d9d9293
201201
85b828533f486b4a2906e3b93c08761f9d723732
202202
65619eef7e065950cbb92467d72eaacc68004a14
203203
4aa1e888d0003de63e2b21493c61c1c5e342bfe4
204+
48bbac8851ae864319c404607e9f10b874df0e3f

0 commit comments

Comments
 (0)