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 Nov 20, 2024
1 parent fa7ebe0 commit b95d128
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 42 deletions.
2 changes: 2 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

- :warning: changed property `line` of type `GraphQLErrorLocation` from type `integer` to `number`
- :warning: changed property `column` of type `GraphQLErrorLocation` from type `integer` to `number`
- :warning: changed property `totalPrice` of type `StagedOrder` from type `TypedMoney` to `CentPrecisionMoney`
- :warning: changed property `totalPrice` of type `Order` from type `TypedMoney` to `CentPrecisionMoney`
</details>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
import com.commercetools.api.models.cart_discount.CartDiscountReference;
import com.commercetools.api.models.common.Address;
import com.commercetools.api.models.common.BaseResource;
import com.commercetools.api.models.common.CentPrecisionMoney;
import com.commercetools.api.models.common.CreatedBy;
import com.commercetools.api.models.common.LastModifiedBy;
import com.commercetools.api.models.common.TypedMoney;
import com.commercetools.api.models.customer_group.CustomerGroupReference;
import com.commercetools.api.models.quote.QuoteReference;
import com.commercetools.api.models.state.StateReference;
Expand Down Expand Up @@ -183,7 +183,7 @@ public interface Order extends BaseResource, OrderMixin, com.commercetools.api.m
@NotNull
@Valid
@JsonProperty("totalPrice")
public TypedMoney getTotalPrice();
public CentPrecisionMoney getTotalPrice();

/**
* <ul>
Expand Down Expand Up @@ -608,7 +608,7 @@ public interface Order extends BaseResource, OrderMixin, com.commercetools.api.m
* @param totalPrice value to be set
*/

public void setTotalPrice(final TypedMoney totalPrice);
public void setTotalPrice(final CentPrecisionMoney totalPrice);

/**
* <ul>
Expand Down Expand Up @@ -1049,7 +1049,8 @@ public static Order deepCopy(@Nullable final Order template) {
.map(com.commercetools.api.models.cart.CustomLineItem::deepCopy)
.collect(Collectors.toList()))
.orElse(null));
instance.setTotalPrice(com.commercetools.api.models.common.TypedMoney.deepCopy(template.getTotalPrice()));
instance.setTotalPrice(
com.commercetools.api.models.common.CentPrecisionMoney.deepCopy(template.getTotalPrice()));
instance.setTaxedPrice(com.commercetools.api.models.cart.TaxedPrice.deepCopy(template.getTaxedPrice()));
instance.setTaxedShippingPrice(
com.commercetools.api.models.cart.TaxedPrice.deepCopy(template.getTaxedShippingPrice()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class OrderBuilder implements Builder<Order> {

private java.util.List<com.commercetools.api.models.cart.CustomLineItem> customLineItems;

private com.commercetools.api.models.common.TypedMoney totalPrice;
private com.commercetools.api.models.common.CentPrecisionMoney totalPrice;

@Nullable
private com.commercetools.api.models.cart.TaxedPrice taxedPrice;
Expand Down Expand Up @@ -566,12 +566,13 @@ public OrderBuilder setCustomLineItems(
/**
* <p>Sum of the <code>totalPrice</code> field of all LineItems and CustomLineItems, and if available, the <code>price</code> field of ShippingInfo. If a discount applies on <code>totalPrice</code>, this field holds the discounted value.</p>
* <p>Taxes are included if TaxRate <code>includedInPrice</code> is <code>true</code> for each price.</p>
* @param totalPrice value to be set
* @param builder function to build the totalPrice value
* @return Builder
*/

public OrderBuilder totalPrice(final com.commercetools.api.models.common.TypedMoney totalPrice) {
this.totalPrice = totalPrice;
public OrderBuilder totalPrice(
Function<com.commercetools.api.models.common.CentPrecisionMoneyBuilder, com.commercetools.api.models.common.CentPrecisionMoneyBuilder> builder) {
this.totalPrice = builder.apply(com.commercetools.api.models.common.CentPrecisionMoneyBuilder.of()).build();
return this;
}

Expand All @@ -582,9 +583,21 @@ public OrderBuilder totalPrice(final com.commercetools.api.models.common.TypedMo
* @return Builder
*/

public OrderBuilder totalPrice(
Function<com.commercetools.api.models.common.TypedMoneyBuilder, Builder<? extends com.commercetools.api.models.common.TypedMoney>> builder) {
this.totalPrice = builder.apply(com.commercetools.api.models.common.TypedMoneyBuilder.of()).build();
public OrderBuilder withTotalPrice(
Function<com.commercetools.api.models.common.CentPrecisionMoneyBuilder, com.commercetools.api.models.common.CentPrecisionMoney> builder) {
this.totalPrice = builder.apply(com.commercetools.api.models.common.CentPrecisionMoneyBuilder.of());
return this;
}

/**
* <p>Sum of the <code>totalPrice</code> field of all LineItems and CustomLineItems, and if available, the <code>price</code> field of ShippingInfo. If a discount applies on <code>totalPrice</code>, this field holds the discounted value.</p>
* <p>Taxes are included if TaxRate <code>includedInPrice</code> is <code>true</code> for each price.</p>
* @param totalPrice value to be set
* @return Builder
*/

public OrderBuilder totalPrice(final com.commercetools.api.models.common.CentPrecisionMoney totalPrice) {
this.totalPrice = totalPrice;
return this;
}

Expand Down Expand Up @@ -2045,7 +2058,7 @@ public java.util.List<com.commercetools.api.models.cart.CustomLineItem> getCusto
* @return totalPrice
*/

public com.commercetools.api.models.common.TypedMoney getTotalPrice() {
public com.commercetools.api.models.common.CentPrecisionMoney getTotalPrice() {
return this.totalPrice;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class OrderImpl implements Order, ModelBase {

private java.util.List<com.commercetools.api.models.cart.CustomLineItem> customLineItems;

private com.commercetools.api.models.common.TypedMoney totalPrice;
private com.commercetools.api.models.common.CentPrecisionMoney totalPrice;

private com.commercetools.api.models.cart.TaxedPrice taxedPrice;

Expand Down Expand Up @@ -142,7 +142,7 @@ public class OrderImpl implements Order, ModelBase {
@JsonProperty("store") final com.commercetools.api.models.store.StoreKeyReference store,
@JsonProperty("lineItems") final java.util.List<com.commercetools.api.models.cart.LineItem> lineItems,
@JsonProperty("customLineItems") final java.util.List<com.commercetools.api.models.cart.CustomLineItem> customLineItems,
@JsonProperty("totalPrice") final com.commercetools.api.models.common.TypedMoney totalPrice,
@JsonProperty("totalPrice") final com.commercetools.api.models.common.CentPrecisionMoney totalPrice,
@JsonProperty("taxedPrice") final com.commercetools.api.models.cart.TaxedPrice taxedPrice,
@JsonProperty("taxedShippingPrice") final com.commercetools.api.models.cart.TaxedPrice taxedShippingPrice,
@JsonProperty("discountOnTotalPrice") final com.commercetools.api.models.cart.DiscountOnTotalPrice discountOnTotalPrice,
Expand Down Expand Up @@ -355,7 +355,7 @@ public java.util.List<com.commercetools.api.models.cart.CustomLineItem> getCusto
* <p>Taxes are included if TaxRate <code>includedInPrice</code> is <code>true</code> for each price.</p>
*/

public com.commercetools.api.models.common.TypedMoney getTotalPrice() {
public com.commercetools.api.models.common.CentPrecisionMoney getTotalPrice() {
return this.totalPrice;
}

Expand Down Expand Up @@ -723,7 +723,7 @@ public void setCustomLineItems(
this.customLineItems = customLineItems;
}

public void setTotalPrice(final com.commercetools.api.models.common.TypedMoney totalPrice) {
public void setTotalPrice(final com.commercetools.api.models.common.CentPrecisionMoney totalPrice) {
this.totalPrice = totalPrice;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,8 @@ public static StagedOrder deepCopy(@Nullable final StagedOrder template) {
.map(com.commercetools.api.models.cart.CustomLineItem::deepCopy)
.collect(Collectors.toList()))
.orElse(null));
instance.setTotalPrice(com.commercetools.api.models.common.TypedMoney.deepCopy(template.getTotalPrice()));
instance.setTotalPrice(
com.commercetools.api.models.common.CentPrecisionMoney.deepCopy(template.getTotalPrice()));
instance.setTaxedPrice(com.commercetools.api.models.cart.TaxedPrice.deepCopy(template.getTaxedPrice()));
instance.setTaxedShippingPrice(
com.commercetools.api.models.cart.TaxedPrice.deepCopy(template.getTaxedShippingPrice()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public class StagedOrderBuilder implements Builder<StagedOrder> {

private java.util.List<com.commercetools.api.models.cart.CustomLineItem> customLineItems;

private com.commercetools.api.models.common.TypedMoney totalPrice;
private com.commercetools.api.models.common.CentPrecisionMoney totalPrice;

@Nullable
private com.commercetools.api.models.cart.TaxedPrice taxedPrice;
Expand Down Expand Up @@ -568,12 +568,13 @@ public StagedOrderBuilder setCustomLineItems(
/**
* <p>Sum of the <code>totalPrice</code> field of all LineItems and CustomLineItems, and if available, the <code>price</code> field of ShippingInfo. If a discount applies on <code>totalPrice</code>, this field holds the discounted value.</p>
* <p>Taxes are included if TaxRate <code>includedInPrice</code> is <code>true</code> for each price.</p>
* @param totalPrice value to be set
* @param builder function to build the totalPrice value
* @return Builder
*/

public StagedOrderBuilder totalPrice(final com.commercetools.api.models.common.TypedMoney totalPrice) {
this.totalPrice = totalPrice;
public StagedOrderBuilder totalPrice(
Function<com.commercetools.api.models.common.CentPrecisionMoneyBuilder, com.commercetools.api.models.common.CentPrecisionMoneyBuilder> builder) {
this.totalPrice = builder.apply(com.commercetools.api.models.common.CentPrecisionMoneyBuilder.of()).build();
return this;
}

Expand All @@ -584,9 +585,21 @@ public StagedOrderBuilder totalPrice(final com.commercetools.api.models.common.T
* @return Builder
*/

public StagedOrderBuilder totalPrice(
Function<com.commercetools.api.models.common.TypedMoneyBuilder, Builder<? extends com.commercetools.api.models.common.TypedMoney>> builder) {
this.totalPrice = builder.apply(com.commercetools.api.models.common.TypedMoneyBuilder.of()).build();
public StagedOrderBuilder withTotalPrice(
Function<com.commercetools.api.models.common.CentPrecisionMoneyBuilder, com.commercetools.api.models.common.CentPrecisionMoney> builder) {
this.totalPrice = builder.apply(com.commercetools.api.models.common.CentPrecisionMoneyBuilder.of());
return this;
}

/**
* <p>Sum of the <code>totalPrice</code> field of all LineItems and CustomLineItems, and if available, the <code>price</code> field of ShippingInfo. If a discount applies on <code>totalPrice</code>, this field holds the discounted value.</p>
* <p>Taxes are included if TaxRate <code>includedInPrice</code> is <code>true</code> for each price.</p>
* @param totalPrice value to be set
* @return Builder
*/

public StagedOrderBuilder totalPrice(final com.commercetools.api.models.common.CentPrecisionMoney totalPrice) {
this.totalPrice = totalPrice;
return this;
}

Expand Down Expand Up @@ -2054,7 +2067,7 @@ public java.util.List<com.commercetools.api.models.cart.CustomLineItem> getCusto
* @return totalPrice
*/

public com.commercetools.api.models.common.TypedMoney getTotalPrice() {
public com.commercetools.api.models.common.CentPrecisionMoney getTotalPrice() {
return this.totalPrice;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class StagedOrderImpl implements StagedOrder, ModelBase {

private java.util.List<com.commercetools.api.models.cart.CustomLineItem> customLineItems;

private com.commercetools.api.models.common.TypedMoney totalPrice;
private com.commercetools.api.models.common.CentPrecisionMoney totalPrice;

private com.commercetools.api.models.cart.TaxedPrice taxedPrice;

Expand Down Expand Up @@ -142,7 +142,7 @@ public class StagedOrderImpl implements StagedOrder, ModelBase {
@JsonProperty("store") final com.commercetools.api.models.store.StoreKeyReference store,
@JsonProperty("lineItems") final java.util.List<com.commercetools.api.models.cart.LineItem> lineItems,
@JsonProperty("customLineItems") final java.util.List<com.commercetools.api.models.cart.CustomLineItem> customLineItems,
@JsonProperty("totalPrice") final com.commercetools.api.models.common.TypedMoney totalPrice,
@JsonProperty("totalPrice") final com.commercetools.api.models.common.CentPrecisionMoney totalPrice,
@JsonProperty("taxedPrice") final com.commercetools.api.models.cart.TaxedPrice taxedPrice,
@JsonProperty("taxedShippingPrice") final com.commercetools.api.models.cart.TaxedPrice taxedShippingPrice,
@JsonProperty("discountOnTotalPrice") final com.commercetools.api.models.cart.DiscountOnTotalPrice discountOnTotalPrice,
Expand Down Expand Up @@ -355,7 +355,7 @@ public java.util.List<com.commercetools.api.models.cart.CustomLineItem> getCusto
* <p>Taxes are included if TaxRate <code>includedInPrice</code> is <code>true</code> for each price.</p>
*/

public com.commercetools.api.models.common.TypedMoney getTotalPrice() {
public com.commercetools.api.models.common.CentPrecisionMoney getTotalPrice() {
return this.totalPrice;
}

Expand Down Expand Up @@ -723,7 +723,7 @@ public void setCustomLineItems(
this.customLineItems = customLineItems;
}

public void setTotalPrice(final com.commercetools.api.models.common.TypedMoney totalPrice) {
public void setTotalPrice(final com.commercetools.api.models.common.CentPrecisionMoney totalPrice) {
this.totalPrice = totalPrice;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,10 @@ public CollectionPredicateBuilder<OrderQueryBuilderDsl> customLineItems() {
}

public CombinationQueryPredicate<OrderQueryBuilderDsl> totalPrice(
Function<com.commercetools.api.predicates.query.common.TypedMoneyQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.common.TypedMoneyQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(
ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("totalPrice"))
.inner(fn.apply(com.commercetools.api.predicates.query.common.TypedMoneyQueryBuilderDsl.of())),
Function<com.commercetools.api.predicates.query.common.CentPrecisionMoneyQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.common.CentPrecisionMoneyQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("totalPrice"))
.inner(fn.apply(com.commercetools.api.predicates.query.common.CentPrecisionMoneyQueryBuilderDsl.of())),

Check warning on line 128 in commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order/OrderQueryBuilderDsl.java

View check run for this annotation

Codecov / codecov/patch

commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order/OrderQueryBuilderDsl.java#L126-L128

Added lines #L126 - L128 were not covered by tests
OrderQueryBuilderDsl::of);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,10 @@ public CollectionPredicateBuilder<StagedOrderQueryBuilderDsl> customLineItems()
}

public CombinationQueryPredicate<StagedOrderQueryBuilderDsl> totalPrice(
Function<com.commercetools.api.predicates.query.common.TypedMoneyQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.common.TypedMoneyQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(
ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("totalPrice"))
.inner(fn.apply(com.commercetools.api.predicates.query.common.TypedMoneyQueryBuilderDsl.of())),
Function<com.commercetools.api.predicates.query.common.CentPrecisionMoneyQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.common.CentPrecisionMoneyQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("totalPrice"))
.inner(fn.apply(com.commercetools.api.predicates.query.common.CentPrecisionMoneyQueryBuilderDsl.of())),

Check warning on line 128 in commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order_edit/StagedOrderQueryBuilderDsl.java

View check run for this annotation

Codecov / codecov/patch

commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/order_edit/StagedOrderQueryBuilderDsl.java#L126-L128

Added lines #L126 - L128 were not covered by tests
StagedOrderQueryBuilderDsl::of);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public static Object[][] objectBuilder() {
Order.builder()
.customLineItems(Collections
.singletonList(new com.commercetools.api.models.cart.CustomLineItemImpl())) },
new Object[] { Order.builder().totalPrice(new com.commercetools.api.models.common.TypedMoneyImpl()) },
new Object[] {
Order.builder().totalPrice(new com.commercetools.api.models.common.CentPrecisionMoneyImpl()) },
new Object[] { Order.builder().taxedPrice(new com.commercetools.api.models.cart.TaxedPriceImpl()) },
new Object[] {
Order.builder().taxedShippingPrice(new com.commercetools.api.models.cart.TaxedPriceImpl()) },
Expand Down Expand Up @@ -206,9 +207,9 @@ public void customLineItems() {
@Test
public void totalPrice() {
Order value = Order.of();
value.setTotalPrice(new com.commercetools.api.models.common.TypedMoneyImpl());
value.setTotalPrice(new com.commercetools.api.models.common.CentPrecisionMoneyImpl());
Assertions.assertThat(value.getTotalPrice())
.isEqualTo(new com.commercetools.api.models.common.TypedMoneyImpl());
.isEqualTo(new com.commercetools.api.models.common.CentPrecisionMoneyImpl());
}

@Test
Expand Down
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,4 @@ f254d17f05343dcc4299fc53ff9b335b5ef63d69
a639dbb1cfe5b434c350e7b47ca717c69b3aa369
6a8624fb41168a6a78ac836b7208c2790a686608
971c1b4ce06c29fcb8c2402dc2ca523b2907352c
b747e1fa4f246b748a89bccbfd8a43f5b6f51175

0 comments on commit b95d128

Please sign in to comment.