Skip to content

Commit 32e9d32

Browse files
committed
build(codegen): updating SDK
1 parent 6cc727c commit 32e9d32

File tree

11 files changed

+384
-5
lines changed

11 files changed

+384
-5
lines changed

changes.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<summary>Added Type(s)</summary>
1313

1414
- added type `InvalidFieldsUpdateError`
15+
- added type `NewMasterVariantAdditionNotAllowedError`
1516
</details>
1617

commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/errors/ErrorObject.java

+13
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
@JsonSubTypes.Type(value = com.commercetools.importapi.models.errors.InvalidScopeErrorImpl.class, name = InvalidScopeError.INVALID_SCOPE),
4747
@JsonSubTypes.Type(value = com.commercetools.importapi.models.errors.InvalidStateTransitionErrorImpl.class, name = InvalidStateTransitionError.INVALID_TRANSITION),
4848
@JsonSubTypes.Type(value = com.commercetools.importapi.models.errors.InvalidTokenErrorImpl.class, name = InvalidTokenError.INVALID_TOKEN),
49+
@JsonSubTypes.Type(value = com.commercetools.importapi.models.errors.NewMasterVariantAdditionNotAllowedErrorImpl.class, name = NewMasterVariantAdditionNotAllowedError.NEW_MASTER_VARIANT_ADDITION_NOT_ALLOWED),
4950
@JsonSubTypes.Type(value = com.commercetools.importapi.models.errors.ReferencedResourceNotFoundImpl.class, name = ReferencedResourceNotFound.REFERENCED_RESOURCE_NOT_FOUND),
5051
@JsonSubTypes.Type(value = com.commercetools.importapi.models.errors.RequiredFieldErrorImpl.class, name = RequiredFieldError.REQUIRED_FIELD),
5152
@JsonSubTypes.Type(value = com.commercetools.importapi.models.errors.ResourceCreationErrorImpl.class, name = ResourceCreationError.RESOURCE_CREATION),
@@ -162,6 +163,10 @@ public static ErrorObject deepCopy(@Nullable final ErrorObject template) {
162163
return com.commercetools.importapi.models.errors.InvalidTokenError
163164
.deepCopy((com.commercetools.importapi.models.errors.InvalidTokenError) template);
164165
}
166+
if (template instanceof com.commercetools.importapi.models.errors.NewMasterVariantAdditionNotAllowedError) {
167+
return com.commercetools.importapi.models.errors.NewMasterVariantAdditionNotAllowedError.deepCopy(
168+
(com.commercetools.importapi.models.errors.NewMasterVariantAdditionNotAllowedError) template);
169+
}
165170
if (template instanceof com.commercetools.importapi.models.errors.ReferencedResourceNotFound) {
166171
return com.commercetools.importapi.models.errors.ReferencedResourceNotFound
167172
.deepCopy((com.commercetools.importapi.models.errors.ReferencedResourceNotFound) template);
@@ -335,6 +340,14 @@ public static com.commercetools.importapi.models.errors.InvalidTokenErrorBuilder
335340
return com.commercetools.importapi.models.errors.InvalidTokenErrorBuilder.of();
336341
}
337342

343+
/**
344+
* builder for newMasterVariantAdditionNotAllowed subtype
345+
* @return builder
346+
*/
347+
public static com.commercetools.importapi.models.errors.NewMasterVariantAdditionNotAllowedErrorBuilder newMasterVariantAdditionNotAllowedBuilder() {
348+
return com.commercetools.importapi.models.errors.NewMasterVariantAdditionNotAllowedErrorBuilder.of();
349+
}
350+
338351
/**
339352
* builder for referencedResourceNotFound subtype
340353
* @return builder

commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/errors/ErrorObjectBuilder.java

+4
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ public com.commercetools.importapi.models.errors.InvalidTokenErrorBuilder invali
8383
return com.commercetools.importapi.models.errors.InvalidTokenErrorBuilder.of();
8484
}
8585

86+
public com.commercetools.importapi.models.errors.NewMasterVariantAdditionNotAllowedErrorBuilder newMasterVariantAdditionNotAllowedBuilder() {
87+
return com.commercetools.importapi.models.errors.NewMasterVariantAdditionNotAllowedErrorBuilder.of();
88+
}
89+
8690
public com.commercetools.importapi.models.errors.ReferencedResourceNotFoundBuilder referencedResourceNotFoundBuilder() {
8791
return com.commercetools.importapi.models.errors.ReferencedResourceNotFoundBuilder.of();
8892
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
2+
package com.commercetools.importapi.models.errors;
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>Returned when attempting to create a ProductVariant and set it as the Master Variant in the same ProductVariantImport.</p>
19+
*
20+
* <hr>
21+
* Example to create an instance using the builder pattern
22+
* <div class=code-example>
23+
* <pre><code class='java'>
24+
* NewMasterVariantAdditionNotAllowedError newMasterVariantAdditionNotAllowedError = NewMasterVariantAdditionNotAllowedError.builder()
25+
* .message("{message}")
26+
* .build()
27+
* </code></pre>
28+
* </div>
29+
*/
30+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
31+
@JsonDeserialize(as = NewMasterVariantAdditionNotAllowedErrorImpl.class)
32+
public interface NewMasterVariantAdditionNotAllowedError extends ErrorObject {
33+
34+
/**
35+
* discriminator value for NewMasterVariantAdditionNotAllowedError
36+
*/
37+
String NEW_MASTER_VARIANT_ADDITION_NOT_ALLOWED = "NewMasterVariantAdditionNotAllowed";
38+
39+
/**
40+
* <p><code>"Adding a new variant as master variant is not allowed."</code></p>
41+
* @return message
42+
*/
43+
@NotNull
44+
@JsonProperty("message")
45+
public String getMessage();
46+
47+
/**
48+
* <p><code>"Adding a new variant as master variant is not allowed."</code></p>
49+
* @param message value to be set
50+
*/
51+
52+
public void setMessage(final String message);
53+
54+
/**
55+
* factory method
56+
* @return instance of NewMasterVariantAdditionNotAllowedError
57+
*/
58+
public static NewMasterVariantAdditionNotAllowedError of() {
59+
return new NewMasterVariantAdditionNotAllowedErrorImpl();
60+
}
61+
62+
/**
63+
* factory method to create a shallow copy NewMasterVariantAdditionNotAllowedError
64+
* @param template instance to be copied
65+
* @return copy instance
66+
*/
67+
public static NewMasterVariantAdditionNotAllowedError of(final NewMasterVariantAdditionNotAllowedError template) {
68+
NewMasterVariantAdditionNotAllowedErrorImpl instance = new NewMasterVariantAdditionNotAllowedErrorImpl();
69+
instance.setMessage(template.getMessage());
70+
return instance;
71+
}
72+
73+
/**
74+
* factory method to create a deep copy of NewMasterVariantAdditionNotAllowedError
75+
* @param template instance to be copied
76+
* @return copy instance
77+
*/
78+
@Nullable
79+
public static NewMasterVariantAdditionNotAllowedError deepCopy(
80+
@Nullable final NewMasterVariantAdditionNotAllowedError template) {
81+
if (template == null) {
82+
return null;
83+
}
84+
NewMasterVariantAdditionNotAllowedErrorImpl instance = new NewMasterVariantAdditionNotAllowedErrorImpl();
85+
instance.setMessage(template.getMessage());
86+
return instance;
87+
}
88+
89+
/**
90+
* builder factory method for NewMasterVariantAdditionNotAllowedError
91+
* @return builder
92+
*/
93+
public static NewMasterVariantAdditionNotAllowedErrorBuilder builder() {
94+
return NewMasterVariantAdditionNotAllowedErrorBuilder.of();
95+
}
96+
97+
/**
98+
* create builder for NewMasterVariantAdditionNotAllowedError instance
99+
* @param template instance with prefilled values for the builder
100+
* @return builder
101+
*/
102+
public static NewMasterVariantAdditionNotAllowedErrorBuilder builder(
103+
final NewMasterVariantAdditionNotAllowedError template) {
104+
return NewMasterVariantAdditionNotAllowedErrorBuilder.of(template);
105+
}
106+
107+
/**
108+
* accessor map function
109+
* @param <T> mapped type
110+
* @param helper function to map the object
111+
* @return mapped value
112+
*/
113+
default <T> T withNewMasterVariantAdditionNotAllowedError(
114+
Function<NewMasterVariantAdditionNotAllowedError, T> helper) {
115+
return helper.apply(this);
116+
}
117+
118+
/**
119+
* gives a TypeReference for usage with Jackson DataBind
120+
* @return TypeReference
121+
*/
122+
public static com.fasterxml.jackson.core.type.TypeReference<NewMasterVariantAdditionNotAllowedError> typeReference() {
123+
return new com.fasterxml.jackson.core.type.TypeReference<NewMasterVariantAdditionNotAllowedError>() {
124+
@Override
125+
public String toString() {
126+
return "TypeReference<NewMasterVariantAdditionNotAllowedError>";
127+
}
128+
};
129+
}
130+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
2+
package com.commercetools.importapi.models.errors;
3+
4+
import java.util.*;
5+
6+
import io.vrap.rmf.base.client.Builder;
7+
import io.vrap.rmf.base.client.utils.Generated;
8+
9+
/**
10+
* NewMasterVariantAdditionNotAllowedErrorBuilder
11+
* <hr>
12+
* Example to create an instance using the builder pattern
13+
* <div class=code-example>
14+
* <pre><code class='java'>
15+
* NewMasterVariantAdditionNotAllowedError newMasterVariantAdditionNotAllowedError = NewMasterVariantAdditionNotAllowedError.builder()
16+
* .message("{message}")
17+
* .build()
18+
* </code></pre>
19+
* </div>
20+
*/
21+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
22+
public class NewMasterVariantAdditionNotAllowedErrorBuilder
23+
implements Builder<NewMasterVariantAdditionNotAllowedError> {
24+
25+
private String message;
26+
27+
/**
28+
* <p><code>"Adding a new variant as master variant is not allowed."</code></p>
29+
* @param message value to be set
30+
* @return Builder
31+
*/
32+
33+
public NewMasterVariantAdditionNotAllowedErrorBuilder message(final String message) {
34+
this.message = message;
35+
return this;
36+
}
37+
38+
/**
39+
* <p><code>"Adding a new variant as master variant is not allowed."</code></p>
40+
* @return message
41+
*/
42+
43+
public String getMessage() {
44+
return this.message;
45+
}
46+
47+
/**
48+
* builds NewMasterVariantAdditionNotAllowedError with checking for non-null required values
49+
* @return NewMasterVariantAdditionNotAllowedError
50+
*/
51+
public NewMasterVariantAdditionNotAllowedError build() {
52+
Objects.requireNonNull(message, NewMasterVariantAdditionNotAllowedError.class + ": message is missing");
53+
return new NewMasterVariantAdditionNotAllowedErrorImpl(message);
54+
}
55+
56+
/**
57+
* builds NewMasterVariantAdditionNotAllowedError without checking for non-null required values
58+
* @return NewMasterVariantAdditionNotAllowedError
59+
*/
60+
public NewMasterVariantAdditionNotAllowedError buildUnchecked() {
61+
return new NewMasterVariantAdditionNotAllowedErrorImpl(message);
62+
}
63+
64+
/**
65+
* factory method for an instance of NewMasterVariantAdditionNotAllowedErrorBuilder
66+
* @return builder
67+
*/
68+
public static NewMasterVariantAdditionNotAllowedErrorBuilder of() {
69+
return new NewMasterVariantAdditionNotAllowedErrorBuilder();
70+
}
71+
72+
/**
73+
* create builder for NewMasterVariantAdditionNotAllowedError instance
74+
* @param template instance with prefilled values for the builder
75+
* @return builder
76+
*/
77+
public static NewMasterVariantAdditionNotAllowedErrorBuilder of(
78+
final NewMasterVariantAdditionNotAllowedError template) {
79+
NewMasterVariantAdditionNotAllowedErrorBuilder builder = new NewMasterVariantAdditionNotAllowedErrorBuilder();
80+
builder.message = template.getMessage();
81+
return builder;
82+
}
83+
84+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
2+
package com.commercetools.importapi.models.errors;
3+
4+
import java.time.*;
5+
import java.util.*;
6+
7+
import com.fasterxml.jackson.annotation.JsonCreator;
8+
import com.fasterxml.jackson.annotation.JsonProperty;
9+
import com.fasterxml.jackson.databind.annotation.*;
10+
11+
import io.vrap.rmf.base.client.ModelBase;
12+
import io.vrap.rmf.base.client.utils.Generated;
13+
14+
import org.apache.commons.lang3.builder.EqualsBuilder;
15+
import org.apache.commons.lang3.builder.HashCodeBuilder;
16+
import org.apache.commons.lang3.builder.ToStringBuilder;
17+
import org.apache.commons.lang3.builder.ToStringStyle;
18+
19+
/**
20+
* <p>Returned when attempting to create a ProductVariant and set it as the Master Variant in the same ProductVariantImport.</p>
21+
*/
22+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
23+
public class NewMasterVariantAdditionNotAllowedErrorImpl implements NewMasterVariantAdditionNotAllowedError, ModelBase {
24+
25+
private String code;
26+
27+
private String message;
28+
29+
/**
30+
* create instance with all properties
31+
*/
32+
@JsonCreator
33+
NewMasterVariantAdditionNotAllowedErrorImpl(@JsonProperty("message") final String message) {
34+
this.message = message;
35+
this.code = NEW_MASTER_VARIANT_ADDITION_NOT_ALLOWED;
36+
}
37+
38+
/**
39+
* create empty instance
40+
*/
41+
public NewMasterVariantAdditionNotAllowedErrorImpl() {
42+
this.code = NEW_MASTER_VARIANT_ADDITION_NOT_ALLOWED;
43+
}
44+
45+
/**
46+
*
47+
*/
48+
49+
public String getCode() {
50+
return this.code;
51+
}
52+
53+
/**
54+
* <p><code>"Adding a new variant as master variant is not allowed."</code></p>
55+
*/
56+
57+
public String getMessage() {
58+
return this.message;
59+
}
60+
61+
public void setMessage(final String message) {
62+
this.message = message;
63+
}
64+
65+
@Override
66+
public boolean equals(Object o) {
67+
if (this == o)
68+
return true;
69+
70+
if (o == null || getClass() != o.getClass())
71+
return false;
72+
73+
NewMasterVariantAdditionNotAllowedErrorImpl that = (NewMasterVariantAdditionNotAllowedErrorImpl) o;
74+
75+
return new EqualsBuilder().append(code, that.code)
76+
.append(message, that.message)
77+
.append(code, that.code)
78+
.append(message, that.message)
79+
.isEquals();
80+
}
81+
82+
@Override
83+
public int hashCode() {
84+
return new HashCodeBuilder(17, 37).append(code).append(message).toHashCode();
85+
}
86+
87+
@Override
88+
public String toString() {
89+
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("code", code)
90+
.append("message", message)
91+
.build();
92+
}
93+
94+
}

commercetools/commercetools-sdk-java-importapi/src/main/java-generated/com/commercetools/importapi/models/productvariants/ProductVariantImport.java

+8-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,10 @@ public interface ProductVariantImport extends ImportResource {
5656
public String getSku();
5757

5858
/**
59-
* <p>Maps to <code>ProductVariant.isMasterVariant</code>.</p>
59+
* <ul>
60+
* <li>When creating a new ProductVariant, set to <code>false</code>; otherwise, the import operation will fail with a NewMasterVariantAdditionNotAllowed error.</li>
61+
* <li>Set to <code>true</code> if the ProductVariant exists and you want to set this ProductVariant as the Master Variant.</li>
62+
* </ul>
6063
* @return isMasterVariant
6164
*/
6265
@NotNull
@@ -122,7 +125,10 @@ public interface ProductVariantImport extends ImportResource {
122125
public void setSku(final String sku);
123126

124127
/**
125-
* <p>Maps to <code>ProductVariant.isMasterVariant</code>.</p>
128+
* <ul>
129+
* <li>When creating a new ProductVariant, set to <code>false</code>; otherwise, the import operation will fail with a NewMasterVariantAdditionNotAllowed error.</li>
130+
* <li>Set to <code>true</code> if the ProductVariant exists and you want to set this ProductVariant as the Master Variant.</li>
131+
* </ul>
126132
* @param isMasterVariant value to be set
127133
*/
128134

0 commit comments

Comments
 (0)