Skip to content

Commit

Permalink
Merge pull request #805 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 Jan 22, 2025
2 parents 01bd9a8 + 258cbd1 commit 5bd41ac
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 106 deletions.
60 changes: 1 addition & 59 deletions changes.md
Original file line number Diff line number Diff line change
@@ -1,66 +1,8 @@
**Api changes**

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

- added resource `/{projectKey}/in-store/key={storeKey}/business-units`
- added resource `/{projectKey}/in-store/key={storeKey}/business-units/key={key}`
- added resource `/{projectKey}/in-store/key={storeKey}/business-units/{ID}`
</details>


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

- :warning: changed property `triggerPattern` of type `CartDiscountPatternTarget` to be required
- changed property `images` of type `ProductTailoringSetExternalImagesAction` to be optional
</details>


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

- added property `inheritedStores` to type `BusinessUnit`
- added property `inheritedStores` to type `Company`
- added property `inheritedStores` to type `Division`
</details>


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

- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().get()`
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().head()`
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().post()`
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withKey().get()`
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withKey().head()`
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withKey().post()`
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withKey().delete()`
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withId().get()`
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withId().head()`
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withId().post()`
- added method `apiRoot.withProjectKey().inStoreKeyWithStoreKeyValue().businessUnits().withId().delete()`
</details>

**History changes**

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

- :warning: changed property `extensions` of type `GraphQLError` from type `GraphQLErrorObject` to `object`
</details>


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

- :warning: changed property `triggerPattern` of type `ChangeTargetPatternChangeValue` to be required
</details>


<details>
<summary>Removed Type(s)</summary>

- :warning: removed type `GraphQLErrorObject`
- :warning: changed property `discount` of type `DiscountedTotalPricePortion` from type `CartDiscountReference` to `Reference`
</details>

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

import javax.annotation.Nullable;

import com.commercetools.api.models.cart_discount.CartDiscountReference;
import com.commercetools.api.models.common.Reference;
import com.commercetools.api.models.common.TypedMoney;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;
Expand Down Expand Up @@ -36,13 +36,13 @@
public interface DiscountedTotalPricePortion {

/**
* <p>Cart Discount related to the discounted price.</p>
* <p>A CartDiscountReference or DirectDiscountReference to the discount applied on the Cart <code>totalPrice</code>.</p>
* @return discount
*/
@NotNull
@Valid
@JsonProperty("discount")
public CartDiscountReference getDiscount();
public Reference getDiscount();

/**
* <p>Money value of the discount.</p>
Expand All @@ -54,11 +54,11 @@ public interface DiscountedTotalPricePortion {
public TypedMoney getDiscountedAmount();

/**
* <p>Cart Discount related to the discounted price.</p>
* <p>A CartDiscountReference or DirectDiscountReference to the discount applied on the Cart <code>totalPrice</code>.</p>
* @param discount value to be set
*/

public void setDiscount(final CartDiscountReference discount);
public void setDiscount(final Reference discount);

/**
* <p>Money value of the discount.</p>
Expand Down Expand Up @@ -98,8 +98,7 @@ public static DiscountedTotalPricePortion deepCopy(@Nullable final DiscountedTot
return null;
}
DiscountedTotalPricePortionImpl instance = new DiscountedTotalPricePortionImpl();
instance.setDiscount(
com.commercetools.api.models.cart_discount.CartDiscountReference.deepCopy(template.getDiscount()));
instance.setDiscount(com.commercetools.api.models.common.Reference.deepCopy(template.getDiscount()));
instance.setDiscountedAmount(
com.commercetools.api.models.common.TypedMoney.deepCopy(template.getDiscountedAmount()));
return instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,44 +23,30 @@
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class DiscountedTotalPricePortionBuilder implements Builder<DiscountedTotalPricePortion> {

private com.commercetools.api.models.cart_discount.CartDiscountReference discount;
private com.commercetools.api.models.common.Reference discount;

private com.commercetools.api.models.common.TypedMoney discountedAmount;

/**
* <p>Cart Discount related to the discounted price.</p>
* @param builder function to build the discount value
* <p>A CartDiscountReference or DirectDiscountReference to the discount applied on the Cart <code>totalPrice</code>.</p>
* @param discount value to be set
* @return Builder
*/

public DiscountedTotalPricePortionBuilder discount(
Function<com.commercetools.api.models.cart_discount.CartDiscountReferenceBuilder, com.commercetools.api.models.cart_discount.CartDiscountReferenceBuilder> builder) {
this.discount = builder.apply(com.commercetools.api.models.cart_discount.CartDiscountReferenceBuilder.of())
.build();
public DiscountedTotalPricePortionBuilder discount(final com.commercetools.api.models.common.Reference discount) {
this.discount = discount;
return this;
}

/**
* <p>Cart Discount related to the discounted price.</p>
* <p>A CartDiscountReference or DirectDiscountReference to the discount applied on the Cart <code>totalPrice</code>.</p>
* @param builder function to build the discount value
* @return Builder
*/

public DiscountedTotalPricePortionBuilder withDiscount(
Function<com.commercetools.api.models.cart_discount.CartDiscountReferenceBuilder, com.commercetools.api.models.cart_discount.CartDiscountReference> builder) {
this.discount = builder.apply(com.commercetools.api.models.cart_discount.CartDiscountReferenceBuilder.of());
return this;
}

/**
* <p>Cart Discount related to the discounted price.</p>
* @param discount value to be set
* @return Builder
*/

public DiscountedTotalPricePortionBuilder discount(
final com.commercetools.api.models.cart_discount.CartDiscountReference discount) {
this.discount = discount;
Function<com.commercetools.api.models.common.ReferenceBuilder, Builder<? extends com.commercetools.api.models.common.Reference>> builder) {
this.discount = builder.apply(com.commercetools.api.models.common.ReferenceBuilder.of()).build();
return this;
}

Expand Down Expand Up @@ -89,11 +75,11 @@ public DiscountedTotalPricePortionBuilder discountedAmount(
}

/**
* <p>Cart Discount related to the discounted price.</p>
* <p>A CartDiscountReference or DirectDiscountReference to the discount applied on the Cart <code>totalPrice</code>.</p>
* @return discount
*/

public com.commercetools.api.models.cart_discount.CartDiscountReference getDiscount() {
public com.commercetools.api.models.common.Reference getDiscount() {
return this.discount;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class DiscountedTotalPricePortionImpl implements DiscountedTotalPricePortion, ModelBase {

private com.commercetools.api.models.cart_discount.CartDiscountReference discount;
private com.commercetools.api.models.common.Reference discount;

private com.commercetools.api.models.common.TypedMoney discountedAmount;

Expand All @@ -31,7 +31,7 @@ public class DiscountedTotalPricePortionImpl implements DiscountedTotalPricePort
*/
@JsonCreator
DiscountedTotalPricePortionImpl(
@JsonProperty("discount") final com.commercetools.api.models.cart_discount.CartDiscountReference discount,
@JsonProperty("discount") final com.commercetools.api.models.common.Reference discount,
@JsonProperty("discountedAmount") final com.commercetools.api.models.common.TypedMoney discountedAmount) {
this.discount = discount;
this.discountedAmount = discountedAmount;
Expand All @@ -44,10 +44,10 @@ public DiscountedTotalPricePortionImpl() {
}

/**
* <p>Cart Discount related to the discounted price.</p>
* <p>A CartDiscountReference or DirectDiscountReference to the discount applied on the Cart <code>totalPrice</code>.</p>
*/

public com.commercetools.api.models.cart_discount.CartDiscountReference getDiscount() {
public com.commercetools.api.models.common.Reference getDiscount() {
return this.discount;
}

Expand All @@ -59,7 +59,7 @@ public com.commercetools.api.models.common.TypedMoney getDiscountedAmount() {
return this.discountedAmount;
}

public void setDiscount(final com.commercetools.api.models.cart_discount.CartDiscountReference discount) {
public void setDiscount(final com.commercetools.api.models.common.Reference discount) {
this.discount = discount;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public List<String> getPath() {
return path;
}

public com.commercetools.api.predicates.expansion.cart_discount.CartDiscountReferenceExpansionBuilderDsl discount() {
return com.commercetools.api.predicates.expansion.cart_discount.CartDiscountReferenceExpansionBuilderDsl
public com.commercetools.api.predicates.expansion.common.ReferenceExpansionBuilderDsl discount() {
return com.commercetools.api.predicates.expansion.common.ReferenceExpansionBuilderDsl
.of(appendOne(path, "discount"));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ public static DiscountedTotalPricePortionQueryBuilderDsl of() {
}

public CombinationQueryPredicate<DiscountedTotalPricePortionQueryBuilderDsl> discount(
Function<com.commercetools.api.predicates.query.cart_discount.CartDiscountReferenceQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.cart_discount.CartDiscountReferenceQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("discount"))
.inner(fn.apply(
com.commercetools.api.predicates.query.cart_discount.CartDiscountReferenceQueryBuilderDsl.of())),
Function<com.commercetools.api.predicates.query.common.ReferenceQueryBuilderDsl, CombinationQueryPredicate<com.commercetools.api.predicates.query.common.ReferenceQueryBuilderDsl>> fn) {
return new CombinationQueryPredicate<>(
ContainerQueryPredicate.of()
.parent(ConstantQueryPredicate.of().constant("discount"))
.inner(fn.apply(com.commercetools.api.predicates.query.common.ReferenceQueryBuilderDsl.of())),
DiscountedTotalPricePortionQueryBuilderDsl::of);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,16 @@ public void buildUnchecked(DiscountedTotalPricePortionBuilder builder) {
public static Object[][] objectBuilder() {
return new Object[][] {
new Object[] { DiscountedTotalPricePortion.builder()
.discount(new com.commercetools.api.models.cart_discount.CartDiscountReferenceImpl()) },
.discount(new com.commercetools.api.models.common.ReferenceImpl()) },
new Object[] { DiscountedTotalPricePortion.builder()
.discountedAmount(new com.commercetools.api.models.common.TypedMoneyImpl()) } };
}

@Test
public void discount() {
DiscountedTotalPricePortion value = DiscountedTotalPricePortion.of();
value.setDiscount(new com.commercetools.api.models.cart_discount.CartDiscountReferenceImpl());
Assertions.assertThat(value.getDiscount())
.isEqualTo(new com.commercetools.api.models.cart_discount.CartDiscountReferenceImpl());
value.setDiscount(new com.commercetools.api.models.common.ReferenceImpl());
Assertions.assertThat(value.getDiscount()).isEqualTo(new com.commercetools.api.models.common.ReferenceImpl());
}

@Test
Expand Down
1 change: 1 addition & 0 deletions reference.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
64c89a7773b97bd6425a82d7d8cee1a9f0f3e6e2
1 change: 1 addition & 0 deletions references.txt
Original file line number Diff line number Diff line change
Expand Up @@ -361,3 +361,4 @@ e3d5bc9cb69146c5d1dd755ed5e8cf2f54566b3a
591d5eaefd1d56fd350895ccea401cb42f2f0ee8
2cad0e3daf32cb4eacc6b08feef37acb27065b0b
64c89a7773b97bd6425a82d7d8cee1a9f0f3e6e2
f28a1461a4122eed74c423156f1969ba204e6948

0 comments on commit 5bd41ac

Please sign in to comment.