Skip to content

Commit a9f4ed5

Browse files
committed
build(codegen): updating SDK
1 parent f0a40d3 commit a9f4ed5

File tree

105 files changed

+3668
-103
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+3668
-103
lines changed

changes.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@
2323
- added type `DiscountGroupDeletedMessagePayload`
2424
- added type `DiscountGroupKeySetMessagePayload`
2525
- added type `DiscountGroupSortOrderSetMessagePayload`
26+
- added type `ProductTailoringSetProductAttributeAction`
27+
- added type `AttributeLevelEnum`
28+
- added type `ProductSetProductAttributeAction`
2629
</details>
2730

2831

@@ -47,6 +50,16 @@
4750

4851
- added property `discountGroup` to type `CartDiscount`
4952
- added property `discountGroup` to type `CartDiscountDraft`
53+
- added property `attributes` to type `ProductTailoringCreatedMessage`
54+
- added property `attributes` to type `ProductTailoringCreatedMessagePayload`
55+
- added property `attributes` to type `ProductTailoringData`
56+
- added property `attributes` to type `ProductTailoringDraft`
57+
- added property `attributes` to type `ProductTailoringInStoreDraft`
58+
- added property `level` to type `AttributeDefinition`
59+
- added property `level` to type `AttributeDefinitionDraft`
60+
- added property `attributes` to type `ProductData`
61+
- added property `attributes` to type `ProductDraft`
62+
- added property `attributes` to type `ProductProjection`
5063
</details>
5164

5265

@@ -74,6 +87,23 @@
7487
- added enum `discount-group` to type `ReferenceTypeId`
7588
</details>
7689

90+
**Import changes**
91+
92+
<details>
93+
<summary>Added Type(s)</summary>
94+
95+
- added type `AttributeLevel`
96+
</details>
97+
98+
99+
<details>
100+
<summary>Added Property(s)</summary>
101+
102+
- added property `attributes` to type `ProductImport`
103+
- added property `attributes` to type `ProductDraftImport`
104+
- added property `level` to type `AttributeDefinition`
105+
</details>
106+
77107
**History changes**
78108

79109
<details>

commercetools/commercetools-graphql-api/src/main/resources/graphql/schema.graphqls

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4802,6 +4802,7 @@ interface HasProductTailoringData {
48024802
acceptLanguage: [Locale!]): String
48034803
metaKeywordsAllLocales: [LocalizedString!]
48044804
variants: [ProductVariantTailoring!]!
4805+
attributesRaw: [RawProductAttribute!]!
48054806
}
48064807

48074808
type HighPrecisionMoney implements BaseMoney {
@@ -5246,6 +5247,15 @@ type KeyReference {
52465247
"A key that references a resource."
52475248
scalar KeyReferenceInput
52485249

5250+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
5251+
enum Level {
5252+
"The attribute can be used on the variant level"
5253+
Variant
5254+
5255+
"The attribute can be used on the product level"
5256+
Product
5257+
}
5258+
52495259
type Limit {
52505260
limit: Long
52515261
}
@@ -8065,6 +8075,9 @@ type ProductData {
80658075
"Queries for a [ProductVariant](https://docs.commercetools.com/api/projects/products#productvariant) with specified `key`"
80668076
key: String): ProductVariant
80678077
skus: [String!]!
8078+
8079+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
8080+
attributesRaw: [RawProductAttribute!]!
80688081
}
80698082

80708083
type ProductDeleted implements MessagePayload {
@@ -8170,6 +8183,9 @@ input ProductDraft {
81708183
metaDescription: [LocalizedStringItemInputType!]
81718184
metaKeywords: [LocalizedStringItemInputType!]
81728185
masterVariant: ProductVariantInput
8186+
8187+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
8188+
attributes: [ProductAttributeInput!] = []
81738189
variants: [ProductVariantInput!] = []
81748190
taxCategory: ResourceIdentifierInput
81758191
state: ResourceIdentifierInput
@@ -8185,6 +8201,37 @@ type ProductImageAdded implements MessagePayload {
81858201
type: String!
81868202
}
81878203

8204+
"""
8205+
An input object used to define a ProductAttribute. You should pass `value` in the form of an escaped JSON.
8206+
8207+
8208+
Here are a few examples for `value`:
8209+
8210+
* FieldType `String`: `"\"This is a string\""`
8211+
* FieldType `DateTimeType`: `"\"2018-10-12T14:00:00.000Z\""`
8212+
* FieldType `Number`: `"4"`
8213+
* FieldType `Set` with an elementType of `String`: `"[\"This is a string\", \"This is another string\"]"`
8214+
* FieldType `Reference`: `"{\"id\": \"b911b62d-353a-4388-93ee-8d488d9af962\", \"typeId\": \"product\"}"`
8215+
"""
8216+
input ProductLevelAttributeInput {
8217+
name: String!
8218+
8219+
"""
8220+
An input object used to define a ProductLevelAttribute. You should pass `value` in the form of an escaped JSON.
8221+
8222+
8223+
Here are a few examples for `value`:
8224+
8225+
* FieldType `String`: `"\"This is a string\""`
8226+
* FieldType `DateTimeType`: `"\"2018-10-12T14:00:00.000Z\""`
8227+
* FieldType `Number`: `"4"`
8228+
* FieldType `Set` with an elementType of `String`: `"[\"This is a string\", \"This is another string\"]"`
8229+
* FieldType `Reference`: `"{\"id\": \"b911b62d-353a-4388-93ee-8d488d9af962\", \"typeId\": \"product\"}"`
8230+
"""
8231+
value: String
8232+
staged: Boolean = true
8233+
}
8234+
81888235
type ProductLimitsProjection {
81898236
pricesPerVariant: Limit!
81908237
variants: Limit!
@@ -8498,6 +8545,9 @@ type ProductProjectionMessagePayload {
84988545
published: Boolean!
84998546
masterVariant: ProductVariant!
85008547
variants: [ProductVariant!]!
8548+
8549+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
8550+
attributes: [RawProductAttribute!]!
85018551
taxCategoryRef: Reference
85028552
taxCategory: TaxCategory
85038553
stateRef: Reference
@@ -8831,6 +8881,7 @@ type ProductTailoringCreated implements MessagePayload & HasProductTailoringData
88318881
acceptLanguage: [Locale!]): String
88328882
metaKeywordsAllLocales: [LocalizedString!]
88338883
variants: [ProductVariantTailoring!]!
8884+
attributesRaw: [RawProductAttribute!]!
88348885
}
88358886

88368887
type ProductTailoringData implements HasProductTailoringData {
@@ -8877,6 +8928,7 @@ type ProductTailoringData implements HasProductTailoringData {
88778928
acceptLanguage: [Locale!]): String
88788929
metaKeywordsAllLocales: [LocalizedString!]
88798930
variants: [ProductVariantTailoring!]!
8931+
attributesRaw: [RawProductAttribute!]!
88808932
}
88818933

88828934
type ProductTailoringDeleted implements MessagePayload {
@@ -8918,6 +8970,9 @@ input ProductTailoringDraft {
89188970
metaKeywords: [LocalizedStringItemInputType!]
89198971
publish: Boolean
89208972
variants: [ProductVariantTailoringInput!] = []
8973+
8974+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
8975+
attributes: [ProductAttributeInput!] = []
89218976
}
89228977

89238978
type ProductTailoringImageAdded implements MessagePayload {
@@ -9009,6 +9064,9 @@ input ProductTailoringUpdateAction {
90099064
removeVariant: RemoveProductVariantTailoring
90109065
publish: PublishTailoring
90119066
unpublish: UnpublishTailoring
9067+
9068+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
9069+
setProductAttribute: SetProductLevelTailoringAttribute
90129070
addAsset: AddProductTailoringAsset
90139071
addExternalImage: AddProductTailoringExternalImage
90149072
changeAssetName: ChangeProductTailoringAssetName
@@ -9117,6 +9175,9 @@ input ProductUpdateAction {
91179175
revertStagedChanges: RevertStagedChanges
91189176
revertStagedVariantChanges: RevertStagedVariantChanges
91199177
publish: PublishProduct
9178+
9179+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
9180+
setProductAttribute: ProductLevelAttributeInput
91209181
unpublish: UnpublishProduct
91219182
transitionState: TransitionProductState
91229183
removePrice: RemoveProductPrice
@@ -12165,6 +12226,12 @@ input SetProductKey {
1216512226
key: String
1216612227
}
1216712228

12229+
input SetProductLevelTailoringAttribute {
12230+
name: String!
12231+
value: String
12232+
staged: Boolean = true
12233+
}
12234+
1216812235
input SetProductMetaAttributes {
1216912236
metaDescription: [LocalizedStringItemInputType!]
1217012237
metaKeywords: [LocalizedStringItemInputType!]

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ public interface CartRecalculateAction extends CartUpdateAction {
3737

3838
/**
3939
* <ul>
40-
* <li>Leave empty or set to <code>false</code> to only update the Prices and TaxRates of the Line Items.</li>
41-
* <li>Set to <code>true</code> to update the Line Items' product data (like <code>name</code>, <code>variant</code> and <code>productType</code>) also.</li>
40+
* <li>Leave empty or set as <code>false</code> to update only the Prices and TaxRates of the Line Items.</li>
41+
* <li>Set as <code>true</code> to update the Product data (such as <code>name</code>, <code>variant</code>, <code>productType</code>, and Product Attributes) of the Line Items.</li>
4242
* </ul>
4343
* @return updateProductData
4444
*/
@@ -48,8 +48,8 @@ public interface CartRecalculateAction extends CartUpdateAction {
4848

4949
/**
5050
* <ul>
51-
* <li>Leave empty or set to <code>false</code> to only update the Prices and TaxRates of the Line Items.</li>
52-
* <li>Set to <code>true</code> to update the Line Items' product data (like <code>name</code>, <code>variant</code> and <code>productType</code>) also.</li>
51+
* <li>Leave empty or set as <code>false</code> to update only the Prices and TaxRates of the Line Items.</li>
52+
* <li>Set as <code>true</code> to update the Product data (such as <code>name</code>, <code>variant</code>, <code>productType</code>, and Product Attributes) of the Line Items.</li>
5353
* </ul>
5454
* @param updateProductData value to be set
5555
*/

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public class CartRecalculateActionBuilder implements Builder<CartRecalculateActi
2727

2828
/**
2929
* <ul>
30-
* <li>Leave empty or set to <code>false</code> to only update the Prices and TaxRates of the Line Items.</li>
31-
* <li>Set to <code>true</code> to update the Line Items' product data (like <code>name</code>, <code>variant</code> and <code>productType</code>) also.</li>
30+
* <li>Leave empty or set as <code>false</code> to update only the Prices and TaxRates of the Line Items.</li>
31+
* <li>Set as <code>true</code> to update the Product data (such as <code>name</code>, <code>variant</code>, <code>productType</code>, and Product Attributes) of the Line Items.</li>
3232
* </ul>
3333
* @param updateProductData value to be set
3434
* @return Builder
@@ -41,8 +41,8 @@ public CartRecalculateActionBuilder updateProductData(@Nullable final Boolean up
4141

4242
/**
4343
* <ul>
44-
* <li>Leave empty or set to <code>false</code> to only update the Prices and TaxRates of the Line Items.</li>
45-
* <li>Set to <code>true</code> to update the Line Items' product data (like <code>name</code>, <code>variant</code> and <code>productType</code>) also.</li>
44+
* <li>Leave empty or set as <code>false</code> to update only the Prices and TaxRates of the Line Items.</li>
45+
* <li>Set as <code>true</code> to update the Product data (such as <code>name</code>, <code>variant</code>, <code>productType</code>, and Product Attributes) of the Line Items.</li>
4646
* </ul>
4747
* @return updateProductData
4848
*/

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public String getAction() {
5353

5454
/**
5555
* <ul>
56-
* <li>Leave empty or set to <code>false</code> to only update the Prices and TaxRates of the Line Items.</li>
57-
* <li>Set to <code>true</code> to update the Line Items' product data (like <code>name</code>, <code>variant</code> and <code>productType</code>) also.</li>
56+
* <li>Leave empty or set as <code>false</code> to update only the Prices and TaxRates of the Line Items.</li>
57+
* <li>Set as <code>true</code> to update the Product data (such as <code>name</code>, <code>variant</code>, <code>productType</code>, and Product Attributes) of the Line Items.</li>
5858
* </ul>
5959
*/
6060

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import jakarta.validation.Valid;
2121

2222
/**
23-
* <p>For Product Variant identification, either the <code>productId</code> and <code>variantId</code>, or <code>sku</code> must be provided.</p>
23+
* <p>For Product Variant identification, either the <code>productId</code> and <code>variantId</code>, or <code>sku</code> must be provided. Product Attributes are merged with Variant Attributes to ensure the full Attribute context of the Product Variant.</p>
2424
*
2525
* <hr>
2626
* Example to create an instance using the builder pattern

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import org.apache.commons.lang3.builder.ToStringStyle;
1818

1919
/**
20-
* <p>For Product Variant identification, either the <code>productId</code> and <code>variantId</code>, or <code>sku</code> must be provided.</p>
20+
* <p>For Product Variant identification, either the <code>productId</code> and <code>variantId</code>, or <code>sku</code> must be provided. Product Attributes are merged with Variant Attributes to ensure the full Attribute context of the Product Variant.</p>
2121
*/
2222
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
2323
public class LineItemDraftImpl implements LineItemDraft, ModelBase {

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/message/ProductTailoringCreatedMessage.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
import com.commercetools.api.models.common.LocalizedString;
1212
import com.commercetools.api.models.product.ProductReference;
13+
import com.commercetools.api.models.product_tailoring.ProductTailoringAttribute;
1314
import com.commercetools.api.models.product_tailoring.ProductVariantTailoring;
1415
import com.commercetools.api.models.store.StoreKeyReference;
1516
import com.fasterxml.jackson.annotation.*;
@@ -142,6 +143,14 @@ public interface ProductTailoringCreatedMessage extends Message {
142143
@JsonProperty("variants")
143144
public List<ProductVariantTailoring> getVariants();
144145

146+
/**
147+
* <p>Attributes of the tailored Product. If available, these Attributes are selectively merged into the <code>attributes</code> of the corresponding Product. If the Product contains an Attribute with the same <code>name</code>, then its <code>value</code> is overwritten. Otherwise, the Attribute and its <code>value</code> are added to the Product.</p>
148+
* @return attributes
149+
*/
150+
@Valid
151+
@JsonProperty("attributes")
152+
public List<ProductTailoringAttribute> getAttributes();
153+
145154
/**
146155
* <p><code>true</code> if the ProductTailoring is published.</p>
147156
* @return published
@@ -235,6 +244,21 @@ public interface ProductTailoringCreatedMessage extends Message {
235244

236245
public void setVariants(final List<ProductVariantTailoring> variants);
237246

247+
/**
248+
* <p>Attributes of the tailored Product. If available, these Attributes are selectively merged into the <code>attributes</code> of the corresponding Product. If the Product contains an Attribute with the same <code>name</code>, then its <code>value</code> is overwritten. Otherwise, the Attribute and its <code>value</code> are added to the Product.</p>
249+
* @param attributes values to be set
250+
*/
251+
252+
@JsonIgnore
253+
public void setAttributes(final ProductTailoringAttribute... attributes);
254+
255+
/**
256+
* <p>Attributes of the tailored Product. If available, these Attributes are selectively merged into the <code>attributes</code> of the corresponding Product. If the Product contains an Attribute with the same <code>name</code>, then its <code>value</code> is overwritten. Otherwise, the Attribute and its <code>value</code> are added to the Product.</p>
257+
* @param attributes values to be set
258+
*/
259+
260+
public void setAttributes(final List<ProductTailoringAttribute> attributes);
261+
238262
/**
239263
* <p><code>true</code> if the ProductTailoring is published.</p>
240264
* @param published value to be set
@@ -278,6 +302,7 @@ public static ProductTailoringCreatedMessage of(final ProductTailoringCreatedMes
278302
instance.setMetaDescription(template.getMetaDescription());
279303
instance.setMetaKeywords(template.getMetaKeywords());
280304
instance.setVariants(template.getVariants());
305+
instance.setAttributes(template.getAttributes());
281306
instance.setPublished(template.getPublished());
282307
return instance;
283308
}
@@ -325,6 +350,11 @@ public static ProductTailoringCreatedMessage deepCopy(@Nullable final ProductTai
325350
.map(com.commercetools.api.models.product_tailoring.ProductVariantTailoring::deepCopy)
326351
.collect(Collectors.toList()))
327352
.orElse(null));
353+
instance.setAttributes(Optional.ofNullable(template.getAttributes())
354+
.map(t -> t.stream()
355+
.map(com.commercetools.api.models.product_tailoring.ProductTailoringAttribute::deepCopy)
356+
.collect(Collectors.toList()))
357+
.orElse(null));
328358
instance.setPublished(template.getPublished());
329359
return instance;
330360
}

0 commit comments

Comments
 (0)