Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated SDKs #561

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
**Api changes**

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

- added type `CartDiscountCreatedMessage`
- added type `CartDiscountDeletedMessage`
- added type `CartDiscountStoreAddedMessage`
- added type `CartDiscountStoreRemovedMessage`
- added type `CartDiscountStoresSetMessage`
- added type `CartDiscountCreatedMessagePayload`
- added type `CartDiscountDeletedMessagePayload`
- added type `CartDiscountStoreAddedMessagePayload`
- added type `CartDiscountStoreRemovedMessagePayload`
- added type `CartDiscountStoresSetMessagePayload`
- added property `shippingMode` to type `MyCartDraft`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import com.commercetools.api.models.business_unit.BusinessUnitResourceIdentifier;
import com.commercetools.api.models.cart.InventoryMode;
import com.commercetools.api.models.cart.ShippingMode;
import com.commercetools.api.models.cart.TaxMode;
import com.commercetools.api.models.common.BaseAddress;
import com.commercetools.api.models.shipping_method.ShippingMethodResourceIdentifier;
Expand Down Expand Up @@ -129,6 +130,17 @@ public interface MyCartDraft extends com.commercetools.api.models.CustomizableDr
@JsonProperty("itemShippingAddresses")
public List<BaseAddress> getItemShippingAddresses();

/**
* <ul>
* <li>If set to <code>Single</code>, only a single Shipping Method can be added to the Cart.</li>
* <li>If set to <code>Multiple</code>, multiple Shipping Methods can be added to the Cart.</li>
* </ul>
* @return shippingMode
*/

@JsonProperty("shippingMode")
public ShippingMode getShippingMode();

/**
* <p><code>code</code> of the existing DiscountCodes to add to the Cart.</p>
* @return discountCodes
Expand Down Expand Up @@ -265,6 +277,16 @@ public interface MyCartDraft extends com.commercetools.api.models.CustomizableDr

public void setItemShippingAddresses(final List<BaseAddress> itemShippingAddresses);

/**
* <ul>
* <li>If set to <code>Single</code>, only a single Shipping Method can be added to the Cart.</li>
* <li>If set to <code>Multiple</code>, multiple Shipping Methods can be added to the Cart.</li>
* </ul>
* @param shippingMode value to be set
*/

public void setShippingMode(final ShippingMode shippingMode);

/**
* <p><code>code</code> of the existing DiscountCodes to add to the Cart.</p>
* @param discountCodes values to be set
Expand Down Expand Up @@ -335,6 +357,7 @@ public static MyCartDraft of(final MyCartDraft template) {
instance.setShippingAddress(template.getShippingAddress());
instance.setShippingMethod(template.getShippingMethod());
instance.setItemShippingAddresses(template.getItemShippingAddresses());
instance.setShippingMode(template.getShippingMode());
instance.setDiscountCodes(template.getDiscountCodes());
instance.setCountry(template.getCountry());
instance.setLocale(template.getLocale());
Expand Down Expand Up @@ -377,6 +400,7 @@ public static MyCartDraft deepCopy(@Nullable final MyCartDraft template) {
.map(com.commercetools.api.models.common.BaseAddress::deepCopy)
.collect(Collectors.toList()))
.orElse(null));
instance.setShippingMode(template.getShippingMode());
instance.setDiscountCodes(Optional.ofNullable(template.getDiscountCodes()).map(ArrayList::new).orElse(null));
instance.setCountry(template.getCountry());
instance.setLocale(template.getLocale());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ public class MyCartDraftBuilder implements Builder<MyCartDraft> {
@Nullable
private java.util.List<com.commercetools.api.models.common.BaseAddress> itemShippingAddresses;

@Nullable
private com.commercetools.api.models.cart.ShippingMode shippingMode;

@Nullable
private java.util.List<String> discountCodes;

Expand Down Expand Up @@ -487,6 +490,21 @@ public MyCartDraftBuilder setItemShippingAddresses(
return itemShippingAddresses(builder.apply(com.commercetools.api.models.common.BaseAddressBuilder.of()));
}

/**
* <ul>
* <li>If set to <code>Single</code>, only a single Shipping Method can be added to the Cart.</li>
* <li>If set to <code>Multiple</code>, multiple Shipping Methods can be added to the Cart.</li>
* </ul>
* @param shippingMode value to be set
* @return Builder
*/

public MyCartDraftBuilder shippingMode(
@Nullable final com.commercetools.api.models.cart.ShippingMode shippingMode) {
this.shippingMode = shippingMode;
return this;
}

/**
* <p><code>code</code> of the existing DiscountCodes to add to the Cart.</p>
* @param discountCodes value to be set
Expand Down Expand Up @@ -702,6 +720,19 @@ public java.util.List<com.commercetools.api.models.common.BaseAddress> getItemSh
return this.itemShippingAddresses;
}

/**
* <ul>
* <li>If set to <code>Single</code>, only a single Shipping Method can be added to the Cart.</li>
* <li>If set to <code>Multiple</code>, multiple Shipping Methods can be added to the Cart.</li>
* </ul>
* @return shippingMode
*/

@Nullable
public com.commercetools.api.models.cart.ShippingMode getShippingMode() {
return this.shippingMode;
}

/**
* <p><code>code</code> of the existing DiscountCodes to add to the Cart.</p>
* @return discountCodes
Expand Down Expand Up @@ -760,8 +791,8 @@ public com.commercetools.api.models.type.CustomFieldsDraft getCustom() {
public MyCartDraft build() {
Objects.requireNonNull(currency, MyCartDraft.class + ": currency is missing");
return new MyCartDraftImpl(currency, customerEmail, businessUnit, store, lineItems, taxMode, inventoryMode,
billingAddress, shippingAddress, shippingMethod, itemShippingAddresses, discountCodes, country, locale,
deleteDaysAfterLastModification, custom);
billingAddress, shippingAddress, shippingMethod, itemShippingAddresses, shippingMode, discountCodes,
country, locale, deleteDaysAfterLastModification, custom);
}

/**
Expand All @@ -770,8 +801,8 @@ public MyCartDraft build() {
*/
public MyCartDraft buildUnchecked() {
return new MyCartDraftImpl(currency, customerEmail, businessUnit, store, lineItems, taxMode, inventoryMode,
billingAddress, shippingAddress, shippingMethod, itemShippingAddresses, discountCodes, country, locale,
deleteDaysAfterLastModification, custom);
billingAddress, shippingAddress, shippingMethod, itemShippingAddresses, shippingMode, discountCodes,
country, locale, deleteDaysAfterLastModification, custom);
}

/**
Expand Down Expand Up @@ -800,6 +831,7 @@ public static MyCartDraftBuilder of(final MyCartDraft template) {
builder.shippingAddress = template.getShippingAddress();
builder.shippingMethod = template.getShippingMethod();
builder.itemShippingAddresses = template.getItemShippingAddresses();
builder.shippingMode = template.getShippingMode();
builder.discountCodes = template.getDiscountCodes();
builder.country = template.getCountry();
builder.locale = template.getLocale();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public class MyCartDraftImpl implements MyCartDraft, ModelBase {

private java.util.List<com.commercetools.api.models.common.BaseAddress> itemShippingAddresses;

private com.commercetools.api.models.cart.ShippingMode shippingMode;

private java.util.List<String> discountCodes;

private String country;
Expand All @@ -69,6 +71,7 @@ public class MyCartDraftImpl implements MyCartDraft, ModelBase {
@JsonProperty("shippingAddress") final com.commercetools.api.models.common.BaseAddress shippingAddress,
@JsonProperty("shippingMethod") final com.commercetools.api.models.shipping_method.ShippingMethodResourceIdentifier shippingMethod,
@JsonProperty("itemShippingAddresses") final java.util.List<com.commercetools.api.models.common.BaseAddress> itemShippingAddresses,
@JsonProperty("shippingMode") final com.commercetools.api.models.cart.ShippingMode shippingMode,
@JsonProperty("discountCodes") final java.util.List<String> discountCodes,
@JsonProperty("country") final String country, @JsonProperty("locale") final String locale,
@JsonProperty("deleteDaysAfterLastModification") final Long deleteDaysAfterLastModification,
Expand All @@ -84,6 +87,7 @@ public class MyCartDraftImpl implements MyCartDraft, ModelBase {
this.shippingAddress = shippingAddress;
this.shippingMethod = shippingMethod;
this.itemShippingAddresses = itemShippingAddresses;
this.shippingMode = shippingMode;
this.discountCodes = discountCodes;
this.country = country;
this.locale = locale;
Expand Down Expand Up @@ -186,6 +190,17 @@ public java.util.List<com.commercetools.api.models.common.BaseAddress> getItemSh
return this.itemShippingAddresses;
}

/**
* <ul>
* <li>If set to <code>Single</code>, only a single Shipping Method can be added to the Cart.</li>
* <li>If set to <code>Multiple</code>, multiple Shipping Methods can be added to the Cart.</li>
* </ul>
*/

public com.commercetools.api.models.cart.ShippingMode getShippingMode() {
return this.shippingMode;
}

/**
* <p><code>code</code> of the existing DiscountCodes to add to the Cart.</p>
*/
Expand Down Expand Up @@ -283,6 +298,10 @@ public void setItemShippingAddresses(
this.itemShippingAddresses = itemShippingAddresses;
}

public void setShippingMode(final com.commercetools.api.models.cart.ShippingMode shippingMode) {
this.shippingMode = shippingMode;
}

public void setDiscountCodes(final String... discountCodes) {
this.discountCodes = new ArrayList<>(Arrays.asList(discountCodes));
}
Expand Down Expand Up @@ -328,6 +347,7 @@ public boolean equals(Object o) {
.append(shippingAddress, that.shippingAddress)
.append(shippingMethod, that.shippingMethod)
.append(itemShippingAddresses, that.itemShippingAddresses)
.append(shippingMode, that.shippingMode)
.append(discountCodes, that.discountCodes)
.append(country, that.country)
.append(locale, that.locale)
Expand All @@ -344,6 +364,7 @@ public boolean equals(Object o) {
.append(shippingAddress, that.shippingAddress)
.append(shippingMethod, that.shippingMethod)
.append(itemShippingAddresses, that.itemShippingAddresses)
.append(shippingMode, that.shippingMode)
.append(discountCodes, that.discountCodes)
.append(country, that.country)
.append(locale, that.locale)
Expand All @@ -365,6 +386,7 @@ public int hashCode() {
.append(shippingAddress)
.append(shippingMethod)
.append(itemShippingAddresses)
.append(shippingMode)
.append(discountCodes)
.append(country)
.append(locale)
Expand All @@ -386,6 +408,7 @@ public String toString() {
.append("shippingAddress", shippingAddress)
.append("shippingMethod", shippingMethod)
.append("itemShippingAddresses", itemShippingAddresses)
.append("shippingMode", shippingMode)
.append("discountCodes", discountCodes)
.append("country", country)
.append("locale", locale)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@
p -> new CombinationQueryPredicate<>(p, MyCartDraftQueryBuilderDsl::of));
}

public StringComparisonPredicateBuilder<MyCartDraftQueryBuilderDsl> shippingMode() {
return new StringComparisonPredicateBuilder<>(
BinaryQueryPredicate.of().left(new ConstantQueryPredicate("shippingMode")),
p -> new CombinationQueryPredicate<>(p, MyCartDraftQueryBuilderDsl::of));

Check warning on line 120 in commercetools/commercetools-sdk-java-api/src/main/java-predicates-generated/com/commercetools/api/predicates/query/me/MyCartDraftQueryBuilderDsl.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/me/MyCartDraftQueryBuilderDsl.java#L118-L120

Added lines #L118 - L120 were not covered by tests
}

public StringCollectionPredicateBuilder<MyCartDraftQueryBuilderDsl> discountCodes() {
return new StringCollectionPredicateBuilder<>(
BinaryQueryPredicate.of().left(new ConstantQueryPredicate("discountCodes")),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ public static Object[][] objectBuilder() {
MyCartDraft.builder()
.itemShippingAddresses(Collections
.singletonList(new com.commercetools.api.models.common.BaseAddressImpl())) },
new Object[] { MyCartDraft.builder()
.shippingMode(com.commercetools.api.models.cart.ShippingMode.findEnum("Single")) },
new Object[] { MyCartDraft.builder().discountCodes(Collections.singletonList("discountCodes")) },
new Object[] { MyCartDraft.builder().country("country") },
new Object[] { MyCartDraft.builder().locale("locale") },
Expand Down Expand Up @@ -147,6 +149,14 @@ public void itemShippingAddresses() {
.isEqualTo(Collections.singletonList(new com.commercetools.api.models.common.BaseAddressImpl()));
}

@Test
public void shippingMode() {
MyCartDraft value = MyCartDraft.of();
value.setShippingMode(com.commercetools.api.models.cart.ShippingMode.findEnum("Single"));
Assertions.assertThat(value.getShippingMode())
.isEqualTo(com.commercetools.api.models.cart.ShippingMode.findEnum("Single"));
}

@Test
public void discountCodes() {
MyCartDraft value = MyCartDraft.of();
Expand Down
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,4 @@ c640bc7c38e111f9df252979cc5c2ab22568a3d8
2e6876d6e80db67518bc18caed1e630372cae607
455326d83ec0750dfaec9afc7ec640f15412a68f
bbed21a27bf83c8ac16f323969d71a8855623523
e3a178953d3d929a58092a0c86d666fee6400c75
Loading