Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,20 @@
- added method `apiRoot.withProjectKey().recurringOrders().withKey().delete()`
</details>

**History changes**

<details>
<summary>Added Type(s)</summary>

- added type `TooManyRequestsError`
- added type `GraphQLTooManyRequestsError`
- added type `GraphQLErrorObject`
</details>


<details>
<summary>Changed Property(s)</summary>

- :warning: changed property `extensions` of type `GraphQLError` from type `object` to `GraphQLErrorObject`
</details>

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/**
* <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>
* <p>If the request exceeds the rate limit, a TooManyRequests error is returned.</p>
*
* <hr>
* <div class=code-example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

/**
* <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>
* <p>If the request exceeds the rate limit, a TooManyRequests error is returned.</p>
*
* <hr>
* <div class=code-example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

/**
* <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>
* <p>If the request exceeds the rate limit, a TooManyRequests error is returned.</p>
*
* <hr>
* <div class=code-example>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ public static ErrorObject deepCopy(@Nullable final ErrorObject template) {
if (template == null) {
return null;
}

if (!(template instanceof ErrorObjectImpl)) {
return template.copyDeep();
}
ErrorObjectImpl instance = new ErrorObjectImpl();
instance.setCode(template.getCode());
instance.setMessage(template.getMessage());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@

package com.commercetools.history.models.error;

import java.time.*;
import java.util.*;
import java.util.function.Function;

import javax.annotation.Nullable;

import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.*;

import io.vrap.rmf.base.client.utils.Generated;

import jakarta.validation.constraints.NotNull;

/**
* <p>Represents a single error.</p>
*
* <hr>
* Example to create a subtype instance using the builder pattern
* <div class=code-example>
* <pre><code class='java'>
* GraphQLErrorObject graphQLErrorObject = GraphQLErrorObject.tooManyRequestsBuilder()
* .build()
* </code></pre>
* </div>
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.EXISTING_PROPERTY, property = "code", defaultImpl = GraphQLErrorObjectImpl.class, visible = true)
@JsonDeserialize(as = GraphQLErrorObjectImpl.class)
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public interface GraphQLErrorObject {

/**
* <p>One of the error codes that is listed on the Errors page.</p>
* @return code
*/
@NotNull
@JsonProperty("code")
public String getCode();

/**
* <p>Error-specific additional fields.</p>
* @return map of the pattern property values
*/
@NotNull
@JsonAnyGetter
public Map<String, Object> values();

/**
* <p>Error-specific additional fields.</p>
* @param key property name
* @param value property value
*/

@JsonAnySetter
public void setValue(String key, Object value);

public GraphQLErrorObject copyDeep();

/**
* factory method to create a deep copy of GraphQLErrorObject
* @param template instance to be copied
* @return copy instance
*/
@Nullable
public static GraphQLErrorObject deepCopy(@Nullable final GraphQLErrorObject template) {
if (template == null) {
return null;
}

if (!(template instanceof GraphQLErrorObjectImpl)) {
return template.copyDeep();
}
GraphQLErrorObjectImpl instance = new GraphQLErrorObjectImpl();
Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue));
return instance;
}

/**
* builder for tooManyRequests subtype
* @return builder
*/
public static com.commercetools.history.models.error.GraphQLTooManyRequestsErrorBuilder tooManyRequestsBuilder() {
return com.commercetools.history.models.error.GraphQLTooManyRequestsErrorBuilder.of();
}

/**
* accessor map function
* @param <T> mapped type
* @param helper function to map the object
* @return mapped value
*/
default <T> T withGraphQLErrorObject(Function<GraphQLErrorObject, T> helper) {
return helper.apply(this);
}

/**
* gives a TypeReference for usage with Jackson DataBind
* @return TypeReference
*/
public static com.fasterxml.jackson.core.type.TypeReference<GraphQLErrorObject> typeReference() {
return new com.fasterxml.jackson.core.type.TypeReference<GraphQLErrorObject>() {
@Override
public String toString() {
return "TypeReference<GraphQLErrorObject>";
}
};
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@

package com.commercetools.history.models.error;

import java.util.*;

import io.vrap.rmf.base.client.utils.Generated;

/**
* GraphQLErrorObjectBuilder
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class GraphQLErrorObjectBuilder {

public com.commercetools.history.models.error.GraphQLTooManyRequestsErrorBuilder tooManyRequestsBuilder() {
return com.commercetools.history.models.error.GraphQLTooManyRequestsErrorBuilder.of();
}

/**
* factory method for an instance of GraphQLErrorObjectBuilder
* @return builder
*/
public static GraphQLErrorObjectBuilder of() {
return new GraphQLErrorObjectBuilder();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@

package com.commercetools.history.models.error;

import java.time.*;
import java.util.*;

import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.*;

import io.vrap.rmf.base.client.ModelBase;
import io.vrap.rmf.base.client.utils.Generated;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
* <p>Represents a single error.</p>
*/
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
public class GraphQLErrorObjectImpl implements GraphQLErrorObject, ModelBase {

private String code;

private Map<String, java.lang.Object> values;

/**
* create instance with all properties
*/
@JsonCreator
GraphQLErrorObjectImpl(@JsonProperty("code") final String code,
@JsonAnySetter @JsonProperty("values") final Map<String, java.lang.Object> values) {
this.code = code;
this.values = values;
}

/**
* create empty instance
*/
public GraphQLErrorObjectImpl() {
}

/**
* <p>One of the error codes that is listed on the Errors page.</p>
*/

public String getCode() {
return this.code;
}

/**
* <p>Error-specific additional fields.</p>
*/

public Map<String, java.lang.Object> values() {
return values;
}

public void setValue(String key, java.lang.Object value) {
if (values == null) {
values = new HashMap<>();
}
values.put(key, value);
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;

if (o == null || getClass() != o.getClass())
return false;

GraphQLErrorObjectImpl that = (GraphQLErrorObjectImpl) o;

return new EqualsBuilder().append(code, that.code)
.append(values, that.values)
.append(code, that.code)
.append(values, that.values)
.isEquals();
}

@Override
public int hashCode() {
return new HashCodeBuilder(17, 37).append(code).append(values).toHashCode();
}

@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("code", code)
.append("values", values)
.build();
}

@Override
public GraphQLErrorObject copyDeep() {
return GraphQLErrorObject.deepCopy(this);
}
}
Loading