Skip to content

Commit 0521dfb

Browse files
Merge pull request #978 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents 8ab3163 + 30fb063 commit 0521dfb

File tree

56 files changed

+3089
-64
lines changed

Some content is hidden

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

56 files changed

+3089
-64
lines changed

changes.md

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,20 @@
11
**Api changes**
22

33
<details>
4-
<summary>Added Type(s)</summary>
5-
6-
- added type `CustomerDefaultBillingAddressSetMessage`
7-
- added type `CustomerDefaultShippingAddressSetMessage`
8-
- added type `CustomerStoresSetMessage`
9-
- added type `CustomerDefaultBillingAddressSetMessagePayload`
10-
- added type `CustomerDefaultShippingAddressSetMessagePayload`
11-
- added type `CustomerStoresSetMessagePayload`
12-
</details>
13-
14-
15-
<details>
16-
<summary>Added Method(s)</summary>
4+
<summary>Added Property(s)</summary>
175

18-
- added method `apiRoot.withProjectKey().recurrencePolicies().withKey().delete()`
19-
- added method `apiRoot.withProjectKey().recurrencePolicies().withId().delete()`
6+
- added property `isActive` to type `DiscountGroup`
7+
- added property `isActive` to type `DiscountGroupDraft`
208
</details>
219

22-
**Import changes**
2310

2411
<details>
2512
<summary>Added Type(s)</summary>
2613

27-
- added type `AssociateRoleKeyReference`
28-
- added type `BusinessUnitKeyReference`
29-
- added type `BusinessUnitImportRequest`
30-
- added type `AssociateRoleInheritanceMode`
31-
- added type `BusinessUnitStatus`
32-
- added type `BusinessUnitAssociateMode`
33-
- added type `BusinessUnitApprovalRuleMode`
34-
- added type `BusinessUnitStoreMode`
35-
- added type `BusinessUnitType`
36-
- added type `AssociateRoleAssignmentDraft`
37-
- added type `AssociateDraft`
38-
- added type `BusinessUnitImport`
39-
- added type `CompanyBusinessUnitImport`
40-
- added type `DivisionBusinessUnitImport`
41-
</details>
42-
43-
44-
<details>
45-
<summary>Added Method(s)</summary>
46-
47-
- added method `apiRoot.withProjectKeyValue().businessUnits().importContainers().withImportContainerKeyValue().post()`
48-
</details>
49-
50-
51-
<details>
52-
<summary>Added Resource(s)</summary>
53-
54-
- added resource `/{projectKey}/business-units`
55-
- added resource `/{projectKey}/business-units/import-containers`
56-
- added resource `/{projectKey}/business-units/import-containers/{importContainerKey}`
57-
</details>
58-
59-
60-
<details>
61-
<summary>Added Enum(s)</summary>
62-
63-
- added enum `business-unit` to type `ImportResourceType`
64-
- added enum `associate-role` to type `ReferenceType`
65-
- added enum `business-unit` to type `ReferenceType`
14+
- added type `DiscountGroupSetIsActiveAction`
15+
- added type `MaxDiscountGroupsReachedError`
16+
- added type `GraphQLMaxDiscountGroupsReachedError`
17+
- added type `DiscountGroupIsActiveSetMessage`
18+
- added type `DiscountGroupIsActiveSetMessagePayload`
6619
</details>
6720

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

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4336,18 +4336,46 @@ type DiscountCodeDeleted implements MessagePayload {
43364336
}
43374337

43384338
input DiscountCodeDraft {
4339+
"""
4340+
User-defined unique identifier for the DiscountCode that can be added to the Cart to apply the related CartDiscounts.
4341+
It cannot be modified after the DiscountCode is created.
4342+
"""
43394343
code: String!
4344+
4345+
"Name of the DiscountCode."
43404346
name: [LocalizedStringItemInputType!]
4347+
4348+
"User-defined unique identifier for the DiscountCode."
43414349
key: String
4350+
4351+
"The description of the DiscountCode."
43424352
description: [LocalizedStringItemInputType!]
4353+
4354+
"Specify what CartDiscounts the API applies when you add the DiscountCode to the Cart."
43434355
cartDiscounts: [ResourceIdentifierInput!]!
4356+
4357+
"Only active DiscountCodes can be applied to the Cart."
43444358
isActive: Boolean = true
4359+
4360+
"Number of times the DiscountCode can be applied. If not set, the DiscountCode can be applied any number of times."
43454361
maxApplications: Long
4362+
4363+
"Number of times the DiscountCode can be applied per Customer. If not set, the DiscountCode can be applied any number of times."
43464364
maxApplicationsPerCustomer: Long
4365+
4366+
"DiscountCode can only be applied to Carts that match this predicate."
43474367
cartPredicate: String
4368+
4369+
"Custom Fields for the DiscountCode."
43484370
custom: CustomFieldsDraft
4371+
4372+
"Date and time (UTC) from which the DiscountCode is effective. Must be earlier than `validUntil`."
43494373
validFrom: DateTime
4374+
4375+
"Date and time (UTC) until which the DiscountCode is effective. Must be later than `validFrom`."
43504376
validUntil: DateTime
4377+
4378+
"Groups to which the DiscountCode will belong to."
43514379
groups: [String!] = []
43524380
}
43534381

@@ -4416,6 +4444,7 @@ type DiscountGroup implements Versioned {
44164444
version: Long!
44174445
key: String!
44184446
sortOrder: String!
4447+
isActive: Boolean!
44194448
name(
44204449
"String is defined for different locales. This argument specifies the desired locale."
44214450
locale: Locale,
@@ -4451,9 +4480,16 @@ input DiscountGroupDraft {
44514480
key: String!
44524481
sortOrder: String!
44534482
name: [LocalizedStringItemInputType!]
4483+
isActive: Boolean = true
44544484
description: [LocalizedStringItemInputType!]
44554485
}
44564486

4487+
type DiscountGroupIsActiveSet implements MessagePayload {
4488+
isActive: Boolean!
4489+
discountGroupId: String!
4490+
type: String!
4491+
}
4492+
44574493
type DiscountGroupKeySet implements MessagePayload {
44584494
key: String!
44594495
discountGroupId: String!
@@ -4490,6 +4526,7 @@ input DiscountGroupUpdateAction {
44904526
setKey: SetDiscountGroupKey
44914527
setSortOrder: SetDiscountGroupSortOrder
44924528
setName: SetDiscountGroupName
4529+
setIsActive: SetDiscountGroupIsActive
44934530
setDescription: SetDiscountGroupDescription
44944531
}
44954532

@@ -8677,14 +8714,34 @@ type ProductDiscount implements Versioned & ReferenceExpandable {
86778714
}
86788715

86798716
input ProductDiscountDraft {
8717+
"Type of Discount and its corresponding value."
86808718
value: ProductDiscountValueInput!
8719+
8720+
"A valid ProductDiscount Predicate."
86818721
predicate: String!
8722+
8723+
"""
8724+
Decimal value between 0 and 1 (passed as String literal) that defines the order of ProductDiscounts to apply in case more than one is applicable and active. A ProductDiscount with a higher `sortOrder` is prioritized.
8725+
The value must be **unique** among all ProductDiscounts in the Project.
8726+
"""
86828727
sortOrder: String!
8728+
8729+
"Name of the ProductDiscount."
86838730
name: [LocalizedStringItemInputType!]!
8731+
8732+
"Description of the ProductDiscount."
86848733
description: [LocalizedStringItemInputType!]
8734+
8735+
"Date and time (UTC) from which the Discount is effective."
86858736
validFrom: DateTime
8737+
8738+
"Date and time (UTC) until which the Discount is effective."
86868739
validUntil: DateTime
8740+
8741+
"Set to `true` to activate the ProductDiscount, set to `false` to deactivate it (even though the `predicate` matches)."
86878742
isActive: Boolean = true
8743+
8744+
"User-defined unique identifier for the ProductDiscount."
86888745
key: String
86898746
}
86908747

@@ -12513,6 +12570,11 @@ input SetDiscountGroupDescription {
1251312570
description: [LocalizedStringItemInputType!]
1251412571
}
1251512572

12573+
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
12574+
input SetDiscountGroupIsActive {
12575+
isActive: Boolean!
12576+
}
12577+
1251612578
"BETA: This feature can be subject to change and should be used carefully in production. https://docs.commercetools.com/api/contract#public-beta"
1251712579
input SetDiscountGroupKey {
1251812580
key: String!
@@ -14821,8 +14883,8 @@ input ShippingTargetDraft {
1482114883
}
1482214884

1482314885
input ShippingTargetDraftType {
14824-
addressKey: String!
1482514886
quantity: Long!
14887+
addressKey: String!
1482614888
shippingMethodKey: String
1482714889
}
1482814890

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountGroupsPost.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
/**
2323
* <p>Creates a DiscountGroup in the Project. This request generates the <a href="https://docs.commercetools.com/apis/ctp:api:type:DiscountGroupCreatedMessage" rel="nofollow">DiscountGroupCreated</a> Message.</p>
24+
* <p>If the <span>limit</span> for active Discount Groups has been reached, a <a href="https://docs.commercetools.com/apis/ctp:api:type:MaxDiscountGroupsReachedError" rel="nofollow">MaxDiscountGroupsReached</a> error is returned.</p>
2425
*
2526
* <hr>
2627
* <div class=code-example>

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/client/ByProjectKeyDiscountGroupsPostString.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
/**
2424
* <p>Creates a DiscountGroup in the Project. This request generates the <a href="https://docs.commercetools.com/apis/ctp:api:type:DiscountGroupCreatedMessage" rel="nofollow">DiscountGroupCreated</a> Message.</p>
25+
* <p>If the <span>limit</span> for active Discount Groups has been reached, a <a href="https://docs.commercetools.com/apis/ctp:api:type:MaxDiscountGroupsReachedError" rel="nofollow">MaxDiscountGroupsReached</a> error is returned.</p>
2526
*
2627
* <hr>
2728
* <div class=code-example>

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_group/DiscountGroup.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
* .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
3535
* .key("{key}")
3636
* .sortOrder("{sortOrder}")
37+
* .isActive(true)
3738
* .build()
3839
* </code></pre>
3940
* </div>
@@ -91,6 +92,14 @@ public interface DiscountGroup extends BaseResource {
9192
@JsonProperty("sortOrder")
9293
public String getSortOrder();
9394

95+
/**
96+
* <p>A DiscountGroup must be active for its CartDiscounts to be considered during discount application.</p>
97+
* @return isActive
98+
*/
99+
@NotNull
100+
@JsonProperty("isActive")
101+
public Boolean getIsActive();
102+
94103
/**
95104
* <p>Date and time (UTC) the DiscountGroup was initially created.</p>
96105
* @return createdAt
@@ -166,6 +175,13 @@ public interface DiscountGroup extends BaseResource {
166175

167176
public void setSortOrder(final String sortOrder);
168177

178+
/**
179+
* <p>A DiscountGroup must be active for its CartDiscounts to be considered during discount application.</p>
180+
* @param isActive value to be set
181+
*/
182+
183+
public void setIsActive(final Boolean isActive);
184+
169185
/**
170186
* <p>Date and time (UTC) the DiscountGroup was initially created.</p>
171187
* @param createdAt value to be set
@@ -217,6 +233,7 @@ public static DiscountGroup of(final DiscountGroup template) {
217233
instance.setKey(template.getKey());
218234
instance.setDescription(template.getDescription());
219235
instance.setSortOrder(template.getSortOrder());
236+
instance.setIsActive(template.getIsActive());
220237
instance.setLastModifiedBy(template.getLastModifiedBy());
221238
instance.setCreatedBy(template.getCreatedBy());
222239
return instance;
@@ -244,6 +261,7 @@ public static DiscountGroup deepCopy(@Nullable final DiscountGroup template) {
244261
instance.setDescription(
245262
com.commercetools.api.models.common.LocalizedString.deepCopy(template.getDescription()));
246263
instance.setSortOrder(template.getSortOrder());
264+
instance.setIsActive(template.getIsActive());
247265
instance.setLastModifiedBy(
248266
com.commercetools.api.models.common.LastModifiedBy.deepCopy(template.getLastModifiedBy()));
249267
instance.setCreatedBy(com.commercetools.api.models.common.CreatedBy.deepCopy(template.getCreatedBy()));

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/discount_group/DiscountGroupBuilder.java

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
2323
* .key("{key}")
2424
* .sortOrder("{sortOrder}")
25+
* .isActive(true)
2526
* .build()
2627
* </code></pre>
2728
* </div>
@@ -47,6 +48,8 @@ public class DiscountGroupBuilder implements Builder<DiscountGroup> {
4748

4849
private String sortOrder;
4950

51+
private Boolean isActive;
52+
5053
@Nullable
5154
private com.commercetools.api.models.common.LastModifiedBy lastModifiedBy;
5255

@@ -191,6 +194,17 @@ public DiscountGroupBuilder sortOrder(final String sortOrder) {
191194
return this;
192195
}
193196

197+
/**
198+
* <p>A DiscountGroup must be active for its CartDiscounts to be considered during discount application.</p>
199+
* @param isActive value to be set
200+
* @return Builder
201+
*/
202+
203+
public DiscountGroupBuilder isActive(final Boolean isActive) {
204+
this.isActive = isActive;
205+
return this;
206+
}
207+
194208
/**
195209
* <p>IDs and references that last modified the DiscountGroup.</p>
196210
* @param builder function to build the lastModifiedBy value
@@ -337,6 +351,15 @@ public String getSortOrder() {
337351
return this.sortOrder;
338352
}
339353

354+
/**
355+
* <p>A DiscountGroup must be active for its CartDiscounts to be considered during discount application.</p>
356+
* @return isActive
357+
*/
358+
359+
public Boolean getIsActive() {
360+
return this.isActive;
361+
}
362+
340363
/**
341364
* <p>IDs and references that last modified the DiscountGroup.</p>
342365
* @return lastModifiedBy
@@ -368,8 +391,9 @@ public DiscountGroup build() {
368391
Objects.requireNonNull(lastModifiedAt, DiscountGroup.class + ": lastModifiedAt is missing");
369392
Objects.requireNonNull(key, DiscountGroup.class + ": key is missing");
370393
Objects.requireNonNull(sortOrder, DiscountGroup.class + ": sortOrder is missing");
394+
Objects.requireNonNull(isActive, DiscountGroup.class + ": isActive is missing");
371395
return new DiscountGroupImpl(id, version, createdAt, lastModifiedAt, name, key, description, sortOrder,
372-
lastModifiedBy, createdBy);
396+
isActive, lastModifiedBy, createdBy);
373397
}
374398

375399
/**
@@ -378,7 +402,7 @@ public DiscountGroup build() {
378402
*/
379403
public DiscountGroup buildUnchecked() {
380404
return new DiscountGroupImpl(id, version, createdAt, lastModifiedAt, name, key, description, sortOrder,
381-
lastModifiedBy, createdBy);
405+
isActive, lastModifiedBy, createdBy);
382406
}
383407

384408
/**
@@ -404,6 +428,7 @@ public static DiscountGroupBuilder of(final DiscountGroup template) {
404428
builder.key = template.getKey();
405429
builder.description = template.getDescription();
406430
builder.sortOrder = template.getSortOrder();
431+
builder.isActive = template.getIsActive();
407432
builder.lastModifiedBy = template.getLastModifiedBy();
408433
builder.createdBy = template.getCreatedBy();
409434
return builder;

0 commit comments

Comments
 (0)