Skip to content

Commit 0bd4508

Browse files
Merge pull request #952 from commercetools/gen-sdk-updates
Update generated SDKs
2 parents a59ee3d + 9a918eb commit 0bd4508

21 files changed

+1014
-13
lines changed

changes.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,20 @@
2525
- added method `apiRoot.withProjectKey().recurringOrders().withKey().delete()`
2626
</details>
2727

28+
**History changes**
29+
30+
<details>
31+
<summary>Added Type(s)</summary>
32+
33+
- added type `TooManyRequestsError`
34+
- added type `GraphQLTooManyRequestsError`
35+
- added type `GraphQLErrorObject`
36+
</details>
37+
38+
39+
<details>
40+
<summary>Changed Property(s)</summary>
41+
42+
- :warning: changed property `extensions` of type `GraphQLError` from type `object` to `GraphQLErrorObject`
43+
</details>
44+

commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyByResourceTypeByIDGet.java

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

2424
/**
2525
* <p>The <code>view_audit_log:{projectKey}</code> scope is required, and depending on the resource type queried, their respective scopes must be granted.</p>
26+
* <p>If the request exceeds the rate limit, a TooManyRequests error is returned.</p>
2627
*
2728
* <hr>
2829
* <div class=code-example>

commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyByResourceTypeGet.java

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

2424
/**
2525
* <p>The <code>view_audit_log:{projectKey}</code> scope is required, and depending on the resource type queried, their respective scopes must be granted.</p>
26+
* <p>If the request exceeds the rate limit, a TooManyRequests error is returned.</p>
2627
*
2728
* <hr>
2829
* <div class=code-example>

commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGet.java

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

2525
/**
2626
* <p>The <code>view_audit_log:{projectKey}</code> scope is required, and depending on the resource type queried, their respective scopes must be granted.</p>
27+
* <p>If the request exceeds the rate limit, a TooManyRequests error is returned.</p>
2728
*
2829
* <hr>
2930
* <div class=code-example>

commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/change_history/ErrorObject.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ public static ErrorObject deepCopy(@Nullable final ErrorObject template) {
9494
if (template == null) {
9595
return null;
9696
}
97+
98+
if (!(template instanceof ErrorObjectImpl)) {
99+
return template.copyDeep();
100+
}
97101
ErrorObjectImpl instance = new ErrorObjectImpl();
98102
instance.setCode(template.getCode());
99103
instance.setMessage(template.getMessage());
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
2+
package com.commercetools.history.models.error;
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>Represents a single error.</p>
19+
*
20+
* <hr>
21+
* Example to create a subtype instance using the builder pattern
22+
* <div class=code-example>
23+
* <pre><code class='java'>
24+
* GraphQLErrorObject graphQLErrorObject = GraphQLErrorObject.tooManyRequestsBuilder()
25+
* .build()
26+
* </code></pre>
27+
* </div>
28+
*/
29+
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "code", defaultImpl = GraphQLErrorObjectImpl.class, visible = true)
30+
@JsonDeserialize(as = GraphQLErrorObjectImpl.class)
31+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
32+
public interface GraphQLErrorObject {
33+
34+
/**
35+
* <p>One of the error codes that is listed on the Errors page.</p>
36+
* @return code
37+
*/
38+
@NotNull
39+
@JsonProperty("code")
40+
public String getCode();
41+
42+
/**
43+
* <p>Error-specific additional fields.</p>
44+
* @return map of the pattern property values
45+
*/
46+
@NotNull
47+
@JsonAnyGetter
48+
public Map<String, Object> values();
49+
50+
/**
51+
* <p>Error-specific additional fields.</p>
52+
* @param key property name
53+
* @param value property value
54+
*/
55+
56+
@JsonAnySetter
57+
public void setValue(String key, Object value);
58+
59+
public GraphQLErrorObject copyDeep();
60+
61+
/**
62+
* factory method to create a deep copy of GraphQLErrorObject
63+
* @param template instance to be copied
64+
* @return copy instance
65+
*/
66+
@Nullable
67+
public static GraphQLErrorObject deepCopy(@Nullable final GraphQLErrorObject template) {
68+
if (template == null) {
69+
return null;
70+
}
71+
72+
if (!(template instanceof GraphQLErrorObjectImpl)) {
73+
return template.copyDeep();
74+
}
75+
GraphQLErrorObjectImpl instance = new GraphQLErrorObjectImpl();
76+
Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue));
77+
return instance;
78+
}
79+
80+
/**
81+
* builder for tooManyRequests subtype
82+
* @return builder
83+
*/
84+
public static com.commercetools.history.models.error.GraphQLTooManyRequestsErrorBuilder tooManyRequestsBuilder() {
85+
return com.commercetools.history.models.error.GraphQLTooManyRequestsErrorBuilder.of();
86+
}
87+
88+
/**
89+
* accessor map function
90+
* @param <T> mapped type
91+
* @param helper function to map the object
92+
* @return mapped value
93+
*/
94+
default <T> T withGraphQLErrorObject(Function<GraphQLErrorObject, T> helper) {
95+
return helper.apply(this);
96+
}
97+
98+
/**
99+
* gives a TypeReference for usage with Jackson DataBind
100+
* @return TypeReference
101+
*/
102+
public static com.fasterxml.jackson.core.type.TypeReference<GraphQLErrorObject> typeReference() {
103+
return new com.fasterxml.jackson.core.type.TypeReference<GraphQLErrorObject>() {
104+
@Override
105+
public String toString() {
106+
return "TypeReference<GraphQLErrorObject>";
107+
}
108+
};
109+
}
110+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
package com.commercetools.history.models.error;
3+
4+
import java.util.*;
5+
6+
import io.vrap.rmf.base.client.utils.Generated;
7+
8+
/**
9+
* GraphQLErrorObjectBuilder
10+
*/
11+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
12+
public class GraphQLErrorObjectBuilder {
13+
14+
public com.commercetools.history.models.error.GraphQLTooManyRequestsErrorBuilder tooManyRequestsBuilder() {
15+
return com.commercetools.history.models.error.GraphQLTooManyRequestsErrorBuilder.of();
16+
}
17+
18+
/**
19+
* factory method for an instance of GraphQLErrorObjectBuilder
20+
* @return builder
21+
*/
22+
public static GraphQLErrorObjectBuilder of() {
23+
return new GraphQLErrorObjectBuilder();
24+
}
25+
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
2+
package com.commercetools.history.models.error;
3+
4+
import java.time.*;
5+
import java.util.*;
6+
7+
import com.fasterxml.jackson.annotation.JsonAnySetter;
8+
import com.fasterxml.jackson.annotation.JsonCreator;
9+
import com.fasterxml.jackson.annotation.JsonProperty;
10+
import com.fasterxml.jackson.databind.annotation.*;
11+
12+
import io.vrap.rmf.base.client.ModelBase;
13+
import io.vrap.rmf.base.client.utils.Generated;
14+
15+
import org.apache.commons.lang3.builder.EqualsBuilder;
16+
import org.apache.commons.lang3.builder.HashCodeBuilder;
17+
import org.apache.commons.lang3.builder.ToStringBuilder;
18+
import org.apache.commons.lang3.builder.ToStringStyle;
19+
20+
/**
21+
* <p>Represents a single error.</p>
22+
*/
23+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
24+
public class GraphQLErrorObjectImpl implements GraphQLErrorObject, ModelBase {
25+
26+
private String code;
27+
28+
private Map<String, java.lang.Object> values;
29+
30+
/**
31+
* create instance with all properties
32+
*/
33+
@JsonCreator
34+
GraphQLErrorObjectImpl(@JsonProperty("code") final String code,
35+
@JsonAnySetter @JsonProperty("values") final Map<String, java.lang.Object> values) {
36+
this.code = code;
37+
this.values = values;
38+
}
39+
40+
/**
41+
* create empty instance
42+
*/
43+
public GraphQLErrorObjectImpl() {
44+
}
45+
46+
/**
47+
* <p>One of the error codes that is listed on the Errors page.</p>
48+
*/
49+
50+
public String getCode() {
51+
return this.code;
52+
}
53+
54+
/**
55+
* <p>Error-specific additional fields.</p>
56+
*/
57+
58+
public Map<String, java.lang.Object> values() {
59+
return values;
60+
}
61+
62+
public void setValue(String key, java.lang.Object value) {
63+
if (values == null) {
64+
values = new HashMap<>();
65+
}
66+
values.put(key, value);
67+
}
68+
69+
@Override
70+
public boolean equals(Object o) {
71+
if (this == o)
72+
return true;
73+
74+
if (o == null || getClass() != o.getClass())
75+
return false;
76+
77+
GraphQLErrorObjectImpl that = (GraphQLErrorObjectImpl) o;
78+
79+
return new EqualsBuilder().append(code, that.code)
80+
.append(values, that.values)
81+
.append(code, that.code)
82+
.append(values, that.values)
83+
.isEquals();
84+
}
85+
86+
@Override
87+
public int hashCode() {
88+
return new HashCodeBuilder(17, 37).append(code).append(values).toHashCode();
89+
}
90+
91+
@Override
92+
public String toString() {
93+
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("code", code)
94+
.append("values", values)
95+
.build();
96+
}
97+
98+
@Override
99+
public GraphQLErrorObject copyDeep() {
100+
return GraphQLErrorObject.deepCopy(this);
101+
}
102+
}

0 commit comments

Comments
 (0)