Skip to content

Commit 9a589c6

Browse files
Merge pull request #684 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents f26cec4 + 4e6deb0 commit 9a589c6

File tree

54 files changed

+2669
-23
lines changed

Some content is hidden

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

54 files changed

+2669
-23
lines changed

changes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
<details>
44
<summary>Added Property(s)</summary>
55

6+
- added property `approvalRuleMode` to type `BusinessUnit`
7+
- added property `approvalRuleMode` to type `BusinessUnitDraft`
8+
- added property `approvalRuleMode` to type `Company`
9+
- added property `approvalRuleMode` to type `CompanyDraft`
10+
- added property `approvalRuleMode` to type `Division`
11+
- added property `approvalRuleMode` to type `DivisionDraft`
612
- added property `metaTitle` to type `ProductTailoringCreatedMessage`
713
- added property `metaDescription` to type `ProductTailoringCreatedMessage`
814
- added property `metaKeywords` to type `ProductTailoringCreatedMessage`
@@ -101,16 +107,20 @@
101107
<details>
102108
<summary>Added Type(s)</summary>
103109

110+
- added type `BusinessUnitApprovalRuleMode`
111+
- added type `BusinessUnitChangeApprovalRuleModeAction`
104112
- added type `CustomerIndexingProgress`
105113
- added type `CustomerIndexingStatus`
106114
- added type `CustomerPagedSearchResponse`
107115
- added type `CustomerSearchIndexingStatusResponse`
108116
- added type `CustomerSearchRequest`
109117
- added type `CustomerSearchResult`
118+
- added type `BusinessUnitApprovalRuleModeChangedMessage`
110119
- added type `ProductTailoringImageAddedMessage`
111120
- added type `ProductTailoringImagesSetMessage`
112121
- added type `ProductVariantTailoringAddedMessage`
113122
- added type `ProductVariantTailoringRemovedMessage`
123+
- added type `BusinessUnitApprovalRuleModeChangedMessagePayload`
114124
- added type `ProductTailoringImageAddedMessagePayload`
115125
- added type `ProductTailoringImagesSetMessagePayload`
116126
- added type `ProductVariantTailoringAddedMessagePayload`

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,7 @@ type BusinessUnit implements Versioned & ReferenceExpandable {
13581358
inheritedStores: [InheritedStore!]
13591359
topLevelUnitRef: KeyReference
13601360
topLevelUnit: BusinessUnit!
1361+
approvalRuleMode: BusinessUnitApprovalRuleMode!
13611362
id: String!
13621363
version: Long!
13631364
createdAt: DateTime!
@@ -1410,6 +1411,17 @@ type BusinessUnitAddressRemoved implements MessagePayload {
14101411
type: String!
14111412
}
14121413

1414+
enum BusinessUnitApprovalRuleMode {
1415+
Explicit
1416+
ExplicitAndFromParent
1417+
}
1418+
1419+
type BusinessUnitApprovalRuleModeChanged implements MessagePayload {
1420+
approvalRuleMode: BusinessUnitApprovalRuleMode!
1421+
oldApprovalRuleMode: BusinessUnitApprovalRuleMode
1422+
type: String!
1423+
}
1424+
14131425
type BusinessUnitAssociateAdded implements MessagePayload {
14141426
associate: Associate!
14151427
type: String!
@@ -1543,6 +1555,7 @@ input BusinessUnitDraft {
15431555
stores: [ResourceIdentifierInput!]
15441556
associates: [AssociateDraft!]
15451557
associateMode: BusinessUnitAssociateMode
1558+
approvalRuleMode: BusinessUnitApprovalRuleMode
15461559
}
15471560

15481561
type BusinessUnitNameChanged implements MessagePayload {
@@ -1646,6 +1659,7 @@ input BusinessUnitUpdateAction {
16461659
setStores: SetBusinessUnitStores
16471660
setStoreMode: SetBusinessUnitStoreMode
16481661
changeAssociateMode: ChangeBusinessUnitAssociateMode
1662+
changeApprovalRuleMode: ChangeBusinessUnitApprovalRuleMode
16491663
}
16501664

16511665
input CancelQuoteRequest {
@@ -2248,6 +2262,10 @@ input ChangeBusinessUnitAddress {
22482262
address: AddressInput!
22492263
}
22502264

2265+
input ChangeBusinessUnitApprovalRuleMode {
2266+
approvalRuleMode: BusinessUnitApprovalRuleMode!
2267+
}
2268+
22512269
input ChangeBusinessUnitAssociate {
22522270
associate: AssociateDraft!
22532271
}

commercetools/commercetools-sdk-java-api/src/main/java-generated/com/commercetools/api/models/business_unit/BusinessUnit.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
* associateMode(BusinessUnitAssociateMode.EXPLICIT)
4444
* plusAssociates(associatesBuilder -> associatesBuilder)
4545
* topLevelUnit(topLevelUnitBuilder -> topLevelUnitBuilder)
46+
* approvalRuleMode(BusinessUnitApprovalRuleMode.EXPLICIT)
4647
* .build()
4748
* </code></pre>
4849
* </div>
@@ -252,6 +253,14 @@ public interface BusinessUnit extends BaseResource, com.commercetools.api.models
252253
@JsonProperty("topLevelUnit")
253254
public BusinessUnitKeyReference getTopLevelUnit();
254255

256+
/**
257+
* <p>Determines whether the Business Unit can inherit Approval Rules from a parent. Always <code>Explicit</code> for Companies and defaults to <code>ExplicitAndFromParent</code> for Divisions.</p>
258+
* @return approvalRuleMode
259+
*/
260+
@NotNull
261+
@JsonProperty("approvalRuleMode")
262+
public BusinessUnitApprovalRuleMode getApprovalRuleMode();
263+
255264
/**
256265
* <p>Unique identifier of the Business Unit.</p>
257266
* @param id value to be set
@@ -465,6 +474,13 @@ public interface BusinessUnit extends BaseResource, com.commercetools.api.models
465474

466475
public void setTopLevelUnit(final BusinessUnitKeyReference topLevelUnit);
467476

477+
/**
478+
* <p>Determines whether the Business Unit can inherit Approval Rules from a parent. Always <code>Explicit</code> for Companies and defaults to <code>ExplicitAndFromParent</code> for Divisions.</p>
479+
* @param approvalRuleMode value to be set
480+
*/
481+
482+
public void setApprovalRuleMode(final BusinessUnitApprovalRuleMode approvalRuleMode);
483+
468484
/**
469485
* factory method to create a deep copy of BusinessUnit
470486
* @param template instance to be copied
@@ -528,6 +544,7 @@ public static BusinessUnit deepCopy(@Nullable final BusinessUnit template) {
528544
com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getParentUnit()));
529545
instance.setTopLevelUnit(
530546
com.commercetools.api.models.business_unit.BusinessUnitKeyReference.deepCopy(template.getTopLevelUnit()));
547+
instance.setApprovalRuleMode(template.getApprovalRuleMode());
531548
return instance;
532549
}
533550

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
2+
package com.commercetools.api.models.business_unit;
3+
4+
import java.util.Arrays;
5+
import java.util.Optional;
6+
7+
import com.fasterxml.jackson.annotation.JsonCreator;
8+
import com.fasterxml.jackson.annotation.JsonValue;
9+
10+
import io.vrap.rmf.base.client.JsonEnum;
11+
import io.vrap.rmf.base.client.utils.Generated;
12+
13+
/**
14+
* <p>Determines whether a Business Unit can inherit Approval Rules from a parent. Only Business Units of type <code>Division</code> can use <code>ExplicitAndFromParent</code>.</p>
15+
*/
16+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
17+
public interface BusinessUnitApprovalRuleMode extends JsonEnum {
18+
19+
/**
20+
<p>Approval Rules of a Business Unit must be explicitly assigned. The Business Unit cannot inherit Approval Rules from a parent.</p> */
21+
BusinessUnitApprovalRuleMode EXPLICIT = BusinessUnitApprovalRuleModeEnum.EXPLICIT;
22+
/**
23+
<p>Approval Rules of a Business Unit are inherited from a parent and can also be explicitly assigned.</p> */
24+
BusinessUnitApprovalRuleMode EXPLICIT_AND_FROM_PARENT = BusinessUnitApprovalRuleModeEnum.EXPLICIT_AND_FROM_PARENT;
25+
26+
/**
27+
* possible values of BusinessUnitApprovalRuleMode
28+
*/
29+
enum BusinessUnitApprovalRuleModeEnum implements BusinessUnitApprovalRuleMode {
30+
/**
31+
* Explicit
32+
*/
33+
EXPLICIT("Explicit"),
34+
35+
/**
36+
* ExplicitAndFromParent
37+
*/
38+
EXPLICIT_AND_FROM_PARENT("ExplicitAndFromParent");
39+
private final String jsonName;
40+
41+
private BusinessUnitApprovalRuleModeEnum(final String jsonName) {
42+
this.jsonName = jsonName;
43+
}
44+
45+
public String getJsonName() {
46+
return jsonName;
47+
}
48+
49+
public String toString() {
50+
return jsonName;
51+
}
52+
}
53+
54+
/**
55+
* the JSON value
56+
* @return json value
57+
*/
58+
@JsonValue
59+
String getJsonName();
60+
61+
/**
62+
* the enum value
63+
* @return name
64+
*/
65+
String name();
66+
67+
/**
68+
* convert value to string
69+
* @return string representation
70+
*/
71+
String toString();
72+
73+
/**
74+
* factory method for a enum value of BusinessUnitApprovalRuleMode
75+
* if no enum has been found an anonymous instance will be created
76+
* @param value the enum value to be wrapped
77+
* @return enum instance
78+
*/
79+
@JsonCreator
80+
public static BusinessUnitApprovalRuleMode findEnum(String value) {
81+
return findEnumViaJsonName(value).orElse(new BusinessUnitApprovalRuleMode() {
82+
@Override
83+
public String getJsonName() {
84+
return value;
85+
}
86+
87+
@Override
88+
public String name() {
89+
return value.toUpperCase();
90+
}
91+
92+
public String toString() {
93+
return value;
94+
}
95+
});
96+
}
97+
98+
/**
99+
* method to find enum using the JSON value
100+
* @param jsonName the json value to be wrapped
101+
* @return optional of enum instance
102+
*/
103+
public static Optional<BusinessUnitApprovalRuleMode> findEnumViaJsonName(String jsonName) {
104+
return Arrays.stream(values()).filter(t -> t.getJsonName().equals(jsonName)).findFirst();
105+
}
106+
107+
/**
108+
* possible enum values
109+
* @return array of possible enum values
110+
*/
111+
public static BusinessUnitApprovalRuleMode[] values() {
112+
return BusinessUnitApprovalRuleModeEnum.values();
113+
}
114+
115+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
2+
package com.commercetools.api.models.business_unit;
3+
4+
import java.time.*;
5+
import java.util.*;
6+
import java.util.function.Function;
7+
8+
import javax.annotation.Nullable;
9+
10+
import com.fasterxml.jackson.annotation.*;
11+
import com.fasterxml.jackson.databind.annotation.*;
12+
13+
import io.vrap.rmf.base.client.utils.Generated;
14+
15+
import jakarta.validation.constraints.NotNull;
16+
17+
/**
18+
* <p>Updates Approval Rules inheritance behavior between Business Units.</p>
19+
* <p>Only Business Units of type <code>Division</code> can be changed to <code>ExplicitAndFromParent</code>.</p>
20+
* <p>This update action generates a BusinessUnitApprovalRuleModeChanged Message.</p>
21+
*
22+
* <hr>
23+
* Example to create an instance using the builder pattern
24+
* <div class=code-example>
25+
* <pre><code class='java'>
26+
* BusinessUnitChangeApprovalRuleModeAction businessUnitChangeApprovalRuleModeAction = BusinessUnitChangeApprovalRuleModeAction.builder()
27+
* .approvalRuleMode(BusinessUnitApprovalRuleMode.EXPLICIT)
28+
* .build()
29+
* </code></pre>
30+
* </div>
31+
*/
32+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
33+
@JsonDeserialize(as = BusinessUnitChangeApprovalRuleModeActionImpl.class)
34+
public interface BusinessUnitChangeApprovalRuleModeAction extends BusinessUnitUpdateAction {
35+
36+
/**
37+
* discriminator value for BusinessUnitChangeApprovalRuleModeAction
38+
*/
39+
String CHANGE_APPROVAL_RULE_MODE = "changeApprovalRuleMode";
40+
41+
/**
42+
* <p>The new value for <code>approvalRuleMode</code>.</p>
43+
* @return approvalRuleMode
44+
*/
45+
@NotNull
46+
@JsonProperty("approvalRuleMode")
47+
public BusinessUnitApprovalRuleMode getApprovalRuleMode();
48+
49+
/**
50+
* <p>The new value for <code>approvalRuleMode</code>.</p>
51+
* @param approvalRuleMode value to be set
52+
*/
53+
54+
public void setApprovalRuleMode(final BusinessUnitApprovalRuleMode approvalRuleMode);
55+
56+
/**
57+
* factory method
58+
* @return instance of BusinessUnitChangeApprovalRuleModeAction
59+
*/
60+
public static BusinessUnitChangeApprovalRuleModeAction of() {
61+
return new BusinessUnitChangeApprovalRuleModeActionImpl();
62+
}
63+
64+
/**
65+
* factory method to create a shallow copy BusinessUnitChangeApprovalRuleModeAction
66+
* @param template instance to be copied
67+
* @return copy instance
68+
*/
69+
public static BusinessUnitChangeApprovalRuleModeAction of(final BusinessUnitChangeApprovalRuleModeAction template) {
70+
BusinessUnitChangeApprovalRuleModeActionImpl instance = new BusinessUnitChangeApprovalRuleModeActionImpl();
71+
instance.setApprovalRuleMode(template.getApprovalRuleMode());
72+
return instance;
73+
}
74+
75+
/**
76+
* factory method to create a deep copy of BusinessUnitChangeApprovalRuleModeAction
77+
* @param template instance to be copied
78+
* @return copy instance
79+
*/
80+
@Nullable
81+
public static BusinessUnitChangeApprovalRuleModeAction deepCopy(
82+
@Nullable final BusinessUnitChangeApprovalRuleModeAction template) {
83+
if (template == null) {
84+
return null;
85+
}
86+
BusinessUnitChangeApprovalRuleModeActionImpl instance = new BusinessUnitChangeApprovalRuleModeActionImpl();
87+
instance.setApprovalRuleMode(template.getApprovalRuleMode());
88+
return instance;
89+
}
90+
91+
/**
92+
* builder factory method for BusinessUnitChangeApprovalRuleModeAction
93+
* @return builder
94+
*/
95+
public static BusinessUnitChangeApprovalRuleModeActionBuilder builder() {
96+
return BusinessUnitChangeApprovalRuleModeActionBuilder.of();
97+
}
98+
99+
/**
100+
* create builder for BusinessUnitChangeApprovalRuleModeAction instance
101+
* @param template instance with prefilled values for the builder
102+
* @return builder
103+
*/
104+
public static BusinessUnitChangeApprovalRuleModeActionBuilder builder(
105+
final BusinessUnitChangeApprovalRuleModeAction template) {
106+
return BusinessUnitChangeApprovalRuleModeActionBuilder.of(template);
107+
}
108+
109+
/**
110+
* accessor map function
111+
* @param <T> mapped type
112+
* @param helper function to map the object
113+
* @return mapped value
114+
*/
115+
default <T> T withBusinessUnitChangeApprovalRuleModeAction(
116+
Function<BusinessUnitChangeApprovalRuleModeAction, T> helper) {
117+
return helper.apply(this);
118+
}
119+
120+
/**
121+
* gives a TypeReference for usage with Jackson DataBind
122+
* @return TypeReference
123+
*/
124+
public static com.fasterxml.jackson.core.type.TypeReference<BusinessUnitChangeApprovalRuleModeAction> typeReference() {
125+
return new com.fasterxml.jackson.core.type.TypeReference<BusinessUnitChangeApprovalRuleModeAction>() {
126+
@Override
127+
public String toString() {
128+
return "TypeReference<BusinessUnitChangeApprovalRuleModeAction>";
129+
}
130+
};
131+
}
132+
}

0 commit comments

Comments
 (0)