From 3b9ffb6888a7f71c9a572cbef8d5f6e06135c9e3 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:32:41 +0000 Subject: [PATCH] build(codegen): updating SDK --- changes.md | 27 ++ .../client/ByProjectKeyGraphqlPost.java | 126 ++++++++ .../client/ByProjectKeyGraphqlPostString.java | 125 ++++++++ .../ByProjectKeyGraphqlRequestBuilder.java | 33 +++ .../client/ByProjectKeyRequestBuilder.java | 4 + .../models/error/GraphQLErrorObject.java | 94 ++++++ .../error/GraphQLErrorObjectBuilder.java | 22 ++ .../models/error/GraphQLErrorObjectImpl.java | 98 +++++++ .../history/models/graph_ql/GraphQLError.java | 201 +++++++++++++ .../models/graph_ql/GraphQLErrorBuilder.java | 277 ++++++++++++++++++ .../models/graph_ql/GraphQLErrorImpl.java | 149 ++++++++++ .../models/graph_ql/GraphQLErrorLocation.java | 140 +++++++++ .../graph_ql/GraphQLErrorLocationBuilder.java | 107 +++++++ .../graph_ql/GraphQLErrorLocationImpl.java | 97 ++++++ .../models/graph_ql/GraphQLRequest.java | 158 ++++++++++ .../graph_ql/GraphQLRequestBuilder.java | 161 ++++++++++ .../models/graph_ql/GraphQLRequestImpl.java | 117 ++++++++ .../models/graph_ql/GraphQLResponse.java | 151 ++++++++++ .../graph_ql/GraphQLResponseBuilder.java | 188 ++++++++++++ .../models/graph_ql/GraphQLResponseImpl.java | 102 +++++++ .../models/graph_ql/GraphQLVariablesMap.java | 123 ++++++++ .../graph_ql/GraphQLVariablesMapBuilder.java | 95 ++++++ .../graph_ql/GraphQLVariablesMapImpl.java | 80 +++++ .../resource/ByProjectKeyGraphqlTest.java | 78 +++++ .../graph_ql/GraphQLErrorLocationTest.java | 44 +++ .../models/graph_ql/GraphQLErrorTest.java | 69 +++++ .../models/graph_ql/GraphQLRequestTest.java | 54 ++++ .../models/graph_ql/GraphQLResponseTest.java | 49 ++++ .../graph_ql/GraphQLVariablesMapTest.java | 13 + references.txt | 1 + 30 files changed, 2983 insertions(+) create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlPost.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlPostString.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlRequestBuilder.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObject.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObjectBuilder.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObjectImpl.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLError.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorBuilder.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorImpl.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocation.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationBuilder.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationImpl.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequest.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestBuilder.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestImpl.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponse.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseBuilder.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseImpl.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMap.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapBuilder.java create mode 100644 commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapImpl.java create mode 100644 commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/client/resource/ByProjectKeyGraphqlTest.java create mode 100644 commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationTest.java create mode 100644 commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorTest.java create mode 100644 commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestTest.java create mode 100644 commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseTest.java create mode 100644 commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapTest.java diff --git a/changes.md b/changes.md index 98d26bd9c0d..42244cf42cb 100644 --- a/changes.md +++ b/changes.md @@ -45,3 +45,30 @@ - added type `SearchExactValue` +**History changes** + +
+Added Resource(s) + +- added resource `/{projectKey}/graphql` +
+ + +
+Added Method(s) + +- added method `apiRoot.withProjectKeyValue().graphql().post()` +
+ + +
+Added Type(s) + +- added type `GraphQLRequest` +- added type `GraphQLResponse` +- added type `GraphQLError` +- added type `GraphQLErrorLocation` +- added type `GraphQLVariablesMap` +- added type `GraphQLErrorObject` +
+ diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlPost.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlPost.java new file mode 100644 index 00000000000..20dcfaa646e --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlPost.java @@ -0,0 +1,126 @@ + +package com.commercetools.history.client; + +import java.net.URI; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

Execute a GraphQL request.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKeyValue("{projectKey}")
+ *            .graphql()
+ *            .post(null)
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyGraphqlPost extends + TypeBodyApiMethod { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + + private com.commercetools.history.models.graph_ql.GraphQLRequest graphQLRequest; + + public ByProjectKeyGraphqlPost(final ApiHttpClient apiHttpClient, String projectKey, + com.commercetools.history.models.graph_ql.GraphQLRequest graphQLRequest) { + super(apiHttpClient); + this.projectKey = projectKey; + this.graphQLRequest = graphQLRequest; + } + + public ByProjectKeyGraphqlPost(ByProjectKeyGraphqlPost t) { + super(t); + this.projectKey = t.projectKey; + this.graphQLRequest = t.graphQLRequest; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/graphql", encodePathParam(this.projectKey)); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + io.vrap.rmf.base.client.utils.json.JsonUtils + .executing(() -> apiHttpClient().getSerializerService().toJsonByteArray(graphQLRequest))); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.history.models.graph_ql.GraphQLResponse.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.history.models.graph_ql.GraphQLResponse.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public com.commercetools.history.models.graph_ql.GraphQLRequest getBody() { + return graphQLRequest; + } + + public ByProjectKeyGraphqlPost withBody(com.commercetools.history.models.graph_ql.GraphQLRequest graphQLRequest) { + ByProjectKeyGraphqlPost t = copy(); + t.graphQLRequest = graphQLRequest; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyGraphqlPost that = (ByProjectKeyGraphqlPost) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(graphQLRequest, that.graphQLRequest) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(graphQLRequest).toHashCode(); + } + + @Override + protected ByProjectKeyGraphqlPost copy() { + return new ByProjectKeyGraphqlPost(this); + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlPostString.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlPostString.java new file mode 100644 index 00000000000..b40ff96ed36 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlPostString.java @@ -0,0 +1,125 @@ + +package com.commercetools.history.client; + +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CompletableFuture; + +import com.fasterxml.jackson.core.type.TypeReference; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.utils.Generated; + +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +/** + *

Execute a GraphQL request.

+ * + *
+ *
+ *
{@code
+ *   CompletableFuture> result = apiRoot
+ *            .withProjectKeyValue("{projectKey}")
+ *            .graphql()
+ *            .post("")
+ *            .execute()
+ * }
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyGraphqlPostString extends + StringBodyApiMethod { + + @Override + public TypeReference resultType() { + return new TypeReference() { + }; + } + + private String projectKey; + + private String graphQLRequest; + + public ByProjectKeyGraphqlPostString(final ApiHttpClient apiHttpClient, String projectKey, String graphQLRequest) { + super(apiHttpClient); + this.projectKey = projectKey; + this.graphQLRequest = graphQLRequest; + } + + public ByProjectKeyGraphqlPostString(ByProjectKeyGraphqlPostString t) { + super(t); + this.projectKey = t.projectKey; + this.graphQLRequest = t.graphQLRequest; + } + + @Override + protected ApiHttpRequest buildHttpRequest() { + List params = new ArrayList<>(getQueryParamUriStrings()); + String httpRequestPath = String.format("%s/graphql", this.projectKey); + if (!params.isEmpty()) { + httpRequestPath += "?" + String.join("&", params); + } + return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(), + graphQLRequest.getBytes(StandardCharsets.UTF_8)); + + } + + @Override + public ApiHttpResponse executeBlocking( + final ApiHttpClient client, final Duration timeout) { + return executeBlocking(client, timeout, com.commercetools.history.models.graph_ql.GraphQLResponse.class); + } + + @Override + public CompletableFuture> execute( + final ApiHttpClient client) { + return execute(client, com.commercetools.history.models.graph_ql.GraphQLResponse.class); + } + + public String getProjectKey() { + return this.projectKey; + } + + public void setProjectKey(final String projectKey) { + this.projectKey = projectKey; + } + + public String getBody() { + return graphQLRequest; + } + + public ByProjectKeyGraphqlPostString withBody(String graphQLRequest) { + ByProjectKeyGraphqlPostString t = copy(); + t.graphQLRequest = graphQLRequest; + return t; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + ByProjectKeyGraphqlPostString that = (ByProjectKeyGraphqlPostString) o; + + return new EqualsBuilder().append(projectKey, that.projectKey) + .append(graphQLRequest, that.graphQLRequest) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(projectKey).append(graphQLRequest).toHashCode(); + } + + @Override + protected ByProjectKeyGraphqlPostString copy() { + return new ByProjectKeyGraphqlPostString(this); + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlRequestBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlRequestBuilder.java new file mode 100644 index 00000000000..1d5c2ff0803 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlRequestBuilder.java @@ -0,0 +1,33 @@ + +package com.commercetools.history.client; + +import java.util.function.UnaryOperator; + +import io.vrap.rmf.base.client.ApiHttpClient; +import io.vrap.rmf.base.client.utils.Generated; + +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class ByProjectKeyGraphqlRequestBuilder { + + private final ApiHttpClient apiHttpClient; + private final String projectKey; + + public ByProjectKeyGraphqlRequestBuilder(final ApiHttpClient apiHttpClient, final String projectKey) { + this.apiHttpClient = apiHttpClient; + this.projectKey = projectKey; + } + + public ByProjectKeyGraphqlPost post(com.commercetools.history.models.graph_ql.GraphQLRequest graphQLRequest) { + return new ByProjectKeyGraphqlPost(apiHttpClient, projectKey, graphQLRequest); + } + + public ByProjectKeyGraphqlPostString post(final String graphQLRequest) { + return new ByProjectKeyGraphqlPostString(apiHttpClient, projectKey, graphQLRequest); + } + + public ByProjectKeyGraphqlPost post( + UnaryOperator op) { + return post(op.apply(com.commercetools.history.models.graph_ql.GraphQLRequestBuilder.of()).build()); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyRequestBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyRequestBuilder.java index 4968a7bcfec..6f05979e515 100644 --- a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyRequestBuilder.java +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/client/ByProjectKeyRequestBuilder.java @@ -19,6 +19,10 @@ public ByProjectKeyGet get() { return new ByProjectKeyGet(apiHttpClient, projectKey); } + public ByProjectKeyGraphqlRequestBuilder graphql() { + return new ByProjectKeyGraphqlRequestBuilder(apiHttpClient, projectKey); + } + public ByProjectKeyByResourceTypeRequestBuilder withResourceTypeValue(String resourceType) { return new ByProjectKeyByResourceTypeRequestBuilder(apiHttpClient, projectKey, resourceType); } diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObject.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObject.java new file mode 100644 index 00000000000..0202b59701e --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObject.java @@ -0,0 +1,94 @@ + +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; + +/** + *

Represents a single error.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLErrorObject graphQLErrorObject = GraphQLErrorObject.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public interface GraphQLErrorObject { + + /** + *

One of the error codes that is listed on the Errors page.

+ * @return code + */ + @NotNull + @JsonProperty("code") + public String getCode(); + + /** + *

Error-specific additional fields.

+ * @return map of the pattern property values + */ + @NotNull + @JsonAnyGetter + public Map values(); + + /** + *

Error-specific additional fields.

+ * @param key property name + * @param value property value + */ + + @JsonAnySetter + public void setValue(String key, Object value); + + /** + * 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; + } + GraphQLErrorObjectImpl instance = new GraphQLErrorObjectImpl(); + Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue)); + return instance; + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withGraphQLErrorObject(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObjectBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObjectBuilder.java new file mode 100644 index 00000000000..97c01877248 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObjectBuilder.java @@ -0,0 +1,22 @@ + +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 { + + /** + * factory method for an instance of GraphQLErrorObjectBuilder + * @return builder + */ + public static GraphQLErrorObjectBuilder of() { + return new GraphQLErrorObjectBuilder(); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObjectImpl.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObjectImpl.java new file mode 100644 index 00000000000..5e06401dcf7 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/error/GraphQLErrorObjectImpl.java @@ -0,0 +1,98 @@ + +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; + +/** + *

Represents a single error.

+ */ +@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 values; + + /** + * create instance with all properties + */ + @JsonCreator + GraphQLErrorObjectImpl(@JsonProperty("code") final String code, + @JsonAnySetter @JsonProperty("values") final Map values) { + this.code = code; + this.values = values; + } + + /** + * create empty instance + */ + public GraphQLErrorObjectImpl() { + } + + /** + *

One of the error codes that is listed on the Errors page.

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

Error-specific additional fields.

+ */ + + public Map 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(); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLError.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLError.java new file mode 100644 index 00000000000..d197aca65db --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLError.java @@ -0,0 +1,201 @@ + +package com.commercetools.history.models.graph_ql; + +import java.time.*; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +import javax.annotation.Nullable; + +import com.commercetools.history.models.error.GraphQLErrorObject; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +import io.vrap.rmf.base.client.utils.Generated; + +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; + +/** + *

Contains an error message, the location of the code that caused the error, and other information to help you correct the error.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLError graphQLError = GraphQLError.builder()
+ *             .message("{message}")
+ *             .plusLocations(locationsBuilder -> locationsBuilder)
+ *             .extensions(extensionsBuilder -> extensionsBuilder)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = GraphQLErrorImpl.class) +public interface GraphQLError { + + /** + *

Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.

+ * @return message + */ + @NotNull + @JsonProperty("message") + public String getMessage(); + + /** + *

Location within your query where the error occurred.

+ * @return locations + */ + @NotNull + @Valid + @JsonProperty("locations") + public List getLocations(); + + /** + *

Query fields listed in order from the root of the query response up to the field in which the error occurred. path is displayed in the response only if an error is associated with a particular field in the query result.

+ * @return path + */ + + @JsonProperty("path") + public List getPath(); + + /** + *

Dictionary with additional information where applicable.

+ * @return extensions + */ + @NotNull + @Valid + @JsonProperty("extensions") + public GraphQLErrorObject getExtensions(); + + /** + *

Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.

+ * @param message value to be set + */ + + public void setMessage(final String message); + + /** + *

Location within your query where the error occurred.

+ * @param locations values to be set + */ + + @JsonIgnore + public void setLocations(final GraphQLErrorLocation... locations); + + /** + *

Location within your query where the error occurred.

+ * @param locations values to be set + */ + + public void setLocations(final List locations); + + /** + *

Query fields listed in order from the root of the query response up to the field in which the error occurred. path is displayed in the response only if an error is associated with a particular field in the query result.

+ * @param path values to be set + */ + + @JsonIgnore + public void setPath(final Object... path); + + /** + *

Query fields listed in order from the root of the query response up to the field in which the error occurred. path is displayed in the response only if an error is associated with a particular field in the query result.

+ * @param path values to be set + */ + + public void setPath(final List path); + + /** + *

Dictionary with additional information where applicable.

+ * @param extensions value to be set + */ + + public void setExtensions(final GraphQLErrorObject extensions); + + /** + * factory method + * @return instance of GraphQLError + */ + public static GraphQLError of() { + return new GraphQLErrorImpl(); + } + + /** + * factory method to create a shallow copy GraphQLError + * @param template instance to be copied + * @return copy instance + */ + public static GraphQLError of(final GraphQLError template) { + GraphQLErrorImpl instance = new GraphQLErrorImpl(); + instance.setMessage(template.getMessage()); + instance.setLocations(template.getLocations()); + instance.setPath(template.getPath()); + instance.setExtensions(template.getExtensions()); + return instance; + } + + /** + * factory method to create a deep copy of GraphQLError + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static GraphQLError deepCopy(@Nullable final GraphQLError template) { + if (template == null) { + return null; + } + GraphQLErrorImpl instance = new GraphQLErrorImpl(); + instance.setMessage(template.getMessage()); + instance.setLocations(Optional.ofNullable(template.getLocations()) + .map(t -> t.stream() + .map(com.commercetools.history.models.graph_ql.GraphQLErrorLocation::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); + instance.setPath(Optional.ofNullable(template.getPath()).map(ArrayList::new).orElse(null)); + instance.setExtensions( + com.commercetools.history.models.error.GraphQLErrorObject.deepCopy(template.getExtensions())); + return instance; + } + + /** + * builder factory method for GraphQLError + * @return builder + */ + public static GraphQLErrorBuilder builder() { + return GraphQLErrorBuilder.of(); + } + + /** + * create builder for GraphQLError instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static GraphQLErrorBuilder builder(final GraphQLError template) { + return GraphQLErrorBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withGraphQLError(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorBuilder.java new file mode 100644 index 00000000000..4fc95316498 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorBuilder.java @@ -0,0 +1,277 @@ + +package com.commercetools.history.models.graph_ql; + +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * GraphQLErrorBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLError graphQLError = GraphQLError.builder()
+ *             .message("{message}")
+ *             .plusLocations(locationsBuilder -> locationsBuilder)
+ *             .extensions(extensionsBuilder -> extensionsBuilder)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class GraphQLErrorBuilder implements Builder { + + private String message; + + private java.util.List locations; + + @Nullable + private java.util.List path; + + private com.commercetools.history.models.error.GraphQLErrorObject extensions; + + /** + *

Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.

+ * @param message value to be set + * @return Builder + */ + + public GraphQLErrorBuilder message(final String message) { + this.message = message; + return this; + } + + /** + *

Location within your query where the error occurred.

+ * @param locations value to be set + * @return Builder + */ + + public GraphQLErrorBuilder locations( + final com.commercetools.history.models.graph_ql.GraphQLErrorLocation... locations) { + this.locations = new ArrayList<>(Arrays.asList(locations)); + return this; + } + + /** + *

Location within your query where the error occurred.

+ * @param locations value to be set + * @return Builder + */ + + public GraphQLErrorBuilder locations( + final java.util.List locations) { + this.locations = locations; + return this; + } + + /** + *

Location within your query where the error occurred.

+ * @param locations value to be set + * @return Builder + */ + + public GraphQLErrorBuilder plusLocations( + final com.commercetools.history.models.graph_ql.GraphQLErrorLocation... locations) { + if (this.locations == null) { + this.locations = new ArrayList<>(); + } + this.locations.addAll(Arrays.asList(locations)); + return this; + } + + /** + *

Location within your query where the error occurred.

+ * @param builder function to build the locations value + * @return Builder + */ + + public GraphQLErrorBuilder plusLocations( + Function builder) { + if (this.locations == null) { + this.locations = new ArrayList<>(); + } + this.locations + .add(builder.apply(com.commercetools.history.models.graph_ql.GraphQLErrorLocationBuilder.of()).build()); + return this; + } + + /** + *

Location within your query where the error occurred.

+ * @param builder function to build the locations value + * @return Builder + */ + + public GraphQLErrorBuilder withLocations( + Function builder) { + this.locations = new ArrayList<>(); + this.locations + .add(builder.apply(com.commercetools.history.models.graph_ql.GraphQLErrorLocationBuilder.of()).build()); + return this; + } + + /** + *

Location within your query where the error occurred.

+ * @param builder function to build the locations value + * @return Builder + */ + + public GraphQLErrorBuilder addLocations( + Function builder) { + return plusLocations(builder.apply(com.commercetools.history.models.graph_ql.GraphQLErrorLocationBuilder.of())); + } + + /** + *

Location within your query where the error occurred.

+ * @param builder function to build the locations value + * @return Builder + */ + + public GraphQLErrorBuilder setLocations( + Function builder) { + return locations(builder.apply(com.commercetools.history.models.graph_ql.GraphQLErrorLocationBuilder.of())); + } + + /** + *

Query fields listed in order from the root of the query response up to the field in which the error occurred. path is displayed in the response only if an error is associated with a particular field in the query result.

+ * @param path value to be set + * @return Builder + */ + + public GraphQLErrorBuilder path(@Nullable final java.lang.Object... path) { + this.path = new ArrayList<>(Arrays.asList(path)); + return this; + } + + /** + *

Query fields listed in order from the root of the query response up to the field in which the error occurred. path is displayed in the response only if an error is associated with a particular field in the query result.

+ * @param path value to be set + * @return Builder + */ + + public GraphQLErrorBuilder path(@Nullable final java.util.List path) { + this.path = path; + return this; + } + + /** + *

Query fields listed in order from the root of the query response up to the field in which the error occurred. path is displayed in the response only if an error is associated with a particular field in the query result.

+ * @param path value to be set + * @return Builder + */ + + public GraphQLErrorBuilder plusPath(@Nullable final java.lang.Object... path) { + if (this.path == null) { + this.path = new ArrayList<>(); + } + this.path.addAll(Arrays.asList(path)); + return this; + } + + /** + *

Dictionary with additional information where applicable.

+ * @param extensions value to be set + * @return Builder + */ + + public GraphQLErrorBuilder extensions(final com.commercetools.history.models.error.GraphQLErrorObject extensions) { + this.extensions = extensions; + return this; + } + + /** + *

Dictionary with additional information where applicable.

+ * @param builder function to build the extensions value + * @return Builder + */ + + public GraphQLErrorBuilder extensions( + Function> builder) { + this.extensions = builder.apply(com.commercetools.history.models.error.GraphQLErrorObjectBuilder.of()).build(); + return this; + } + + /** + *

Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.

+ * @return message + */ + + public String getMessage() { + return this.message; + } + + /** + *

Location within your query where the error occurred.

+ * @return locations + */ + + public java.util.List getLocations() { + return this.locations; + } + + /** + *

Query fields listed in order from the root of the query response up to the field in which the error occurred. path is displayed in the response only if an error is associated with a particular field in the query result.

+ * @return path + */ + + @Nullable + public java.util.List getPath() { + return this.path; + } + + /** + *

Dictionary with additional information where applicable.

+ * @return extensions + */ + + public com.commercetools.history.models.error.GraphQLErrorObject getExtensions() { + return this.extensions; + } + + /** + * builds GraphQLError with checking for non-null required values + * @return GraphQLError + */ + public GraphQLError build() { + Objects.requireNonNull(message, GraphQLError.class + ": message is missing"); + Objects.requireNonNull(locations, GraphQLError.class + ": locations is missing"); + Objects.requireNonNull(extensions, GraphQLError.class + ": extensions is missing"); + return new GraphQLErrorImpl(message, locations, path, extensions); + } + + /** + * builds GraphQLError without checking for non-null required values + * @return GraphQLError + */ + public GraphQLError buildUnchecked() { + return new GraphQLErrorImpl(message, locations, path, extensions); + } + + /** + * factory method for an instance of GraphQLErrorBuilder + * @return builder + */ + public static GraphQLErrorBuilder of() { + return new GraphQLErrorBuilder(); + } + + /** + * create builder for GraphQLError instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static GraphQLErrorBuilder of(final GraphQLError template) { + GraphQLErrorBuilder builder = new GraphQLErrorBuilder(); + builder.message = template.getMessage(); + builder.locations = template.getLocations(); + builder.path = template.getPath(); + builder.extensions = template.getExtensions(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorImpl.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorImpl.java new file mode 100644 index 00000000000..a40e15b0400 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorImpl.java @@ -0,0 +1,149 @@ + +package com.commercetools.history.models.graph_ql; + +import java.time.*; +import java.util.*; + +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; + +/** + *

Contains an error message, the location of the code that caused the error, and other information to help you correct the error.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class GraphQLErrorImpl implements GraphQLError, ModelBase { + + private String message; + + private java.util.List locations; + + private java.util.List path; + + private com.commercetools.history.models.error.GraphQLErrorObject extensions; + + /** + * create instance with all properties + */ + @JsonCreator + GraphQLErrorImpl(@JsonProperty("message") final String message, + @JsonProperty("locations") final java.util.List locations, + @JsonProperty("path") final java.util.List path, + @JsonProperty("extensions") final com.commercetools.history.models.error.GraphQLErrorObject extensions) { + this.message = message; + this.locations = locations; + this.path = path; + this.extensions = extensions; + } + + /** + * create empty instance + */ + public GraphQLErrorImpl() { + } + + /** + *

Detailed description of the error explaining the root cause of the problem and suggesting how to correct the error.

+ */ + + public String getMessage() { + return this.message; + } + + /** + *

Location within your query where the error occurred.

+ */ + + public java.util.List getLocations() { + return this.locations; + } + + /** + *

Query fields listed in order from the root of the query response up to the field in which the error occurred. path is displayed in the response only if an error is associated with a particular field in the query result.

+ */ + + public java.util.List getPath() { + return this.path; + } + + /** + *

Dictionary with additional information where applicable.

+ */ + + public com.commercetools.history.models.error.GraphQLErrorObject getExtensions() { + return this.extensions; + } + + public void setMessage(final String message) { + this.message = message; + } + + public void setLocations(final com.commercetools.history.models.graph_ql.GraphQLErrorLocation... locations) { + this.locations = new ArrayList<>(Arrays.asList(locations)); + } + + public void setLocations( + final java.util.List locations) { + this.locations = locations; + } + + public void setPath(final java.lang.Object... path) { + this.path = new ArrayList<>(Arrays.asList(path)); + } + + public void setPath(final java.util.List path) { + this.path = path; + } + + public void setExtensions(final com.commercetools.history.models.error.GraphQLErrorObject extensions) { + this.extensions = extensions; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + GraphQLErrorImpl that = (GraphQLErrorImpl) o; + + return new EqualsBuilder().append(message, that.message) + .append(locations, that.locations) + .append(path, that.path) + .append(extensions, that.extensions) + .append(message, that.message) + .append(locations, that.locations) + .append(path, that.path) + .append(extensions, that.extensions) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(message) + .append(locations) + .append(path) + .append(extensions) + .toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("message", message) + .append("locations", locations) + .append("path", path) + .append("extensions", extensions) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocation.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocation.java new file mode 100644 index 00000000000..f1c7982681c --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocation.java @@ -0,0 +1,140 @@ + +package com.commercetools.history.models.graph_ql; + +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; + +/** + *

Represents the location within your query where the error occurred.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLErrorLocation graphQLErrorLocation = GraphQLErrorLocation.builder()
+ *             .line(0.3)
+ *             .column(0.3)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = GraphQLErrorLocationImpl.class) +public interface GraphQLErrorLocation { + + /** + *

Line number of the query where the error occurred.

+ * @return line + */ + @NotNull + @JsonProperty("line") + public Long getLine(); + + /** + *

Position in line where the error occurred.

+ * @return column + */ + @NotNull + @JsonProperty("column") + public Long getColumn(); + + /** + *

Line number of the query where the error occurred.

+ * @param line value to be set + */ + + public void setLine(final Long line); + + /** + *

Position in line where the error occurred.

+ * @param column value to be set + */ + + public void setColumn(final Long column); + + /** + * factory method + * @return instance of GraphQLErrorLocation + */ + public static GraphQLErrorLocation of() { + return new GraphQLErrorLocationImpl(); + } + + /** + * factory method to create a shallow copy GraphQLErrorLocation + * @param template instance to be copied + * @return copy instance + */ + public static GraphQLErrorLocation of(final GraphQLErrorLocation template) { + GraphQLErrorLocationImpl instance = new GraphQLErrorLocationImpl(); + instance.setLine(template.getLine()); + instance.setColumn(template.getColumn()); + return instance; + } + + /** + * factory method to create a deep copy of GraphQLErrorLocation + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static GraphQLErrorLocation deepCopy(@Nullable final GraphQLErrorLocation template) { + if (template == null) { + return null; + } + GraphQLErrorLocationImpl instance = new GraphQLErrorLocationImpl(); + instance.setLine(template.getLine()); + instance.setColumn(template.getColumn()); + return instance; + } + + /** + * builder factory method for GraphQLErrorLocation + * @return builder + */ + public static GraphQLErrorLocationBuilder builder() { + return GraphQLErrorLocationBuilder.of(); + } + + /** + * create builder for GraphQLErrorLocation instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static GraphQLErrorLocationBuilder builder(final GraphQLErrorLocation template) { + return GraphQLErrorLocationBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withGraphQLErrorLocation(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationBuilder.java new file mode 100644 index 00000000000..1f35a9d166e --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationBuilder.java @@ -0,0 +1,107 @@ + +package com.commercetools.history.models.graph_ql; + +import java.util.*; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * GraphQLErrorLocationBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLErrorLocation graphQLErrorLocation = GraphQLErrorLocation.builder()
+ *             .line(0.3)
+ *             .column(0.3)
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class GraphQLErrorLocationBuilder implements Builder { + + private Long line; + + private Long column; + + /** + *

Line number of the query where the error occurred.

+ * @param line value to be set + * @return Builder + */ + + public GraphQLErrorLocationBuilder line(final Long line) { + this.line = line; + return this; + } + + /** + *

Position in line where the error occurred.

+ * @param column value to be set + * @return Builder + */ + + public GraphQLErrorLocationBuilder column(final Long column) { + this.column = column; + return this; + } + + /** + *

Line number of the query where the error occurred.

+ * @return line + */ + + public Long getLine() { + return this.line; + } + + /** + *

Position in line where the error occurred.

+ * @return column + */ + + public Long getColumn() { + return this.column; + } + + /** + * builds GraphQLErrorLocation with checking for non-null required values + * @return GraphQLErrorLocation + */ + public GraphQLErrorLocation build() { + Objects.requireNonNull(line, GraphQLErrorLocation.class + ": line is missing"); + Objects.requireNonNull(column, GraphQLErrorLocation.class + ": column is missing"); + return new GraphQLErrorLocationImpl(line, column); + } + + /** + * builds GraphQLErrorLocation without checking for non-null required values + * @return GraphQLErrorLocation + */ + public GraphQLErrorLocation buildUnchecked() { + return new GraphQLErrorLocationImpl(line, column); + } + + /** + * factory method for an instance of GraphQLErrorLocationBuilder + * @return builder + */ + public static GraphQLErrorLocationBuilder of() { + return new GraphQLErrorLocationBuilder(); + } + + /** + * create builder for GraphQLErrorLocation instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static GraphQLErrorLocationBuilder of(final GraphQLErrorLocation template) { + GraphQLErrorLocationBuilder builder = new GraphQLErrorLocationBuilder(); + builder.line = template.getLine(); + builder.column = template.getColumn(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationImpl.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationImpl.java new file mode 100644 index 00000000000..e3ca04c0d10 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationImpl.java @@ -0,0 +1,97 @@ + +package com.commercetools.history.models.graph_ql; + +import java.time.*; +import java.util.*; + +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; + +/** + *

Represents the location within your query where the error occurred.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class GraphQLErrorLocationImpl implements GraphQLErrorLocation, ModelBase { + + private Long line; + + private Long column; + + /** + * create instance with all properties + */ + @JsonCreator + GraphQLErrorLocationImpl(@JsonProperty("line") final Long line, @JsonProperty("column") final Long column) { + this.line = line; + this.column = column; + } + + /** + * create empty instance + */ + public GraphQLErrorLocationImpl() { + } + + /** + *

Line number of the query where the error occurred.

+ */ + + public Long getLine() { + return this.line; + } + + /** + *

Position in line where the error occurred.

+ */ + + public Long getColumn() { + return this.column; + } + + public void setLine(final Long line) { + this.line = line; + } + + public void setColumn(final Long column) { + this.column = column; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + GraphQLErrorLocationImpl that = (GraphQLErrorLocationImpl) o; + + return new EqualsBuilder().append(line, that.line) + .append(column, that.column) + .append(line, that.line) + .append(column, that.column) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(line).append(column).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("line", line) + .append("column", column) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequest.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequest.java new file mode 100644 index 00000000000..882804c02a4 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequest.java @@ -0,0 +1,158 @@ + +package com.commercetools.history.models.graph_ql; + +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.Valid; +import jakarta.validation.constraints.NotNull; + +/** + *

The query, operation name, and variables that are sent to the GraphQL API.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLRequest graphQLRequest = GraphQLRequest.builder()
+ *             .query("{query}")
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = GraphQLRequestImpl.class) +public interface GraphQLRequest { + + /** + *

String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.

+ * @return query + */ + @NotNull + @JsonProperty("query") + public String getQuery(); + + /** + *

Name of the operation, if you defined several operations in query.

+ * @return operationName + */ + + @JsonProperty("operationName") + public String getOperationName(); + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @return variables + */ + @Valid + @JsonProperty("variables") + public GraphQLVariablesMap getVariables(); + + /** + *

String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.

+ * @param query value to be set + */ + + public void setQuery(final String query); + + /** + *

Name of the operation, if you defined several operations in query.

+ * @param operationName value to be set + */ + + public void setOperationName(final String operationName); + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @param variables value to be set + */ + + public void setVariables(final GraphQLVariablesMap variables); + + /** + * factory method + * @return instance of GraphQLRequest + */ + public static GraphQLRequest of() { + return new GraphQLRequestImpl(); + } + + /** + * factory method to create a shallow copy GraphQLRequest + * @param template instance to be copied + * @return copy instance + */ + public static GraphQLRequest of(final GraphQLRequest template) { + GraphQLRequestImpl instance = new GraphQLRequestImpl(); + instance.setQuery(template.getQuery()); + instance.setOperationName(template.getOperationName()); + instance.setVariables(template.getVariables()); + return instance; + } + + /** + * factory method to create a deep copy of GraphQLRequest + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static GraphQLRequest deepCopy(@Nullable final GraphQLRequest template) { + if (template == null) { + return null; + } + GraphQLRequestImpl instance = new GraphQLRequestImpl(); + instance.setQuery(template.getQuery()); + instance.setOperationName(template.getOperationName()); + instance.setVariables( + com.commercetools.history.models.graph_ql.GraphQLVariablesMap.deepCopy(template.getVariables())); + return instance; + } + + /** + * builder factory method for GraphQLRequest + * @return builder + */ + public static GraphQLRequestBuilder builder() { + return GraphQLRequestBuilder.of(); + } + + /** + * create builder for GraphQLRequest instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static GraphQLRequestBuilder builder(final GraphQLRequest template) { + return GraphQLRequestBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withGraphQLRequest(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestBuilder.java new file mode 100644 index 00000000000..bc1c309aded --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestBuilder.java @@ -0,0 +1,161 @@ + +package com.commercetools.history.models.graph_ql; + +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * GraphQLRequestBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLRequest graphQLRequest = GraphQLRequest.builder()
+ *             .query("{query}")
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class GraphQLRequestBuilder implements Builder { + + private String query; + + @Nullable + private String operationName; + + @Nullable + private com.commercetools.history.models.graph_ql.GraphQLVariablesMap variables; + + /** + *

String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.

+ * @param query value to be set + * @return Builder + */ + + public GraphQLRequestBuilder query(final String query) { + this.query = query; + return this; + } + + /** + *

Name of the operation, if you defined several operations in query.

+ * @param operationName value to be set + * @return Builder + */ + + public GraphQLRequestBuilder operationName(@Nullable final String operationName) { + this.operationName = operationName; + return this; + } + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @param builder function to build the variables value + * @return Builder + */ + + public GraphQLRequestBuilder variables( + Function builder) { + this.variables = builder.apply(com.commercetools.history.models.graph_ql.GraphQLVariablesMapBuilder.of()) + .build(); + return this; + } + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @param builder function to build the variables value + * @return Builder + */ + + public GraphQLRequestBuilder withVariables( + Function builder) { + this.variables = builder.apply(com.commercetools.history.models.graph_ql.GraphQLVariablesMapBuilder.of()); + return this; + } + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @param variables value to be set + * @return Builder + */ + + public GraphQLRequestBuilder variables( + @Nullable final com.commercetools.history.models.graph_ql.GraphQLVariablesMap variables) { + this.variables = variables; + return this; + } + + /** + *

String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.

+ * @return query + */ + + public String getQuery() { + return this.query; + } + + /** + *

Name of the operation, if you defined several operations in query.

+ * @return operationName + */ + + @Nullable + public String getOperationName() { + return this.operationName; + } + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @return variables + */ + + @Nullable + public com.commercetools.history.models.graph_ql.GraphQLVariablesMap getVariables() { + return this.variables; + } + + /** + * builds GraphQLRequest with checking for non-null required values + * @return GraphQLRequest + */ + public GraphQLRequest build() { + Objects.requireNonNull(query, GraphQLRequest.class + ": query is missing"); + return new GraphQLRequestImpl(query, operationName, variables); + } + + /** + * builds GraphQLRequest without checking for non-null required values + * @return GraphQLRequest + */ + public GraphQLRequest buildUnchecked() { + return new GraphQLRequestImpl(query, operationName, variables); + } + + /** + * factory method for an instance of GraphQLRequestBuilder + * @return builder + */ + public static GraphQLRequestBuilder of() { + return new GraphQLRequestBuilder(); + } + + /** + * create builder for GraphQLRequest instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static GraphQLRequestBuilder of(final GraphQLRequest template) { + GraphQLRequestBuilder builder = new GraphQLRequestBuilder(); + builder.query = template.getQuery(); + builder.operationName = template.getOperationName(); + builder.variables = template.getVariables(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestImpl.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestImpl.java new file mode 100644 index 00000000000..9f66e45162e --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestImpl.java @@ -0,0 +1,117 @@ + +package com.commercetools.history.models.graph_ql; + +import java.time.*; +import java.util.*; + +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; + +/** + *

The query, operation name, and variables that are sent to the GraphQL API.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class GraphQLRequestImpl implements GraphQLRequest, ModelBase { + + private String query; + + private String operationName; + + private com.commercetools.history.models.graph_ql.GraphQLVariablesMap variables; + + /** + * create instance with all properties + */ + @JsonCreator + GraphQLRequestImpl(@JsonProperty("query") final String query, + @JsonProperty("operationName") final String operationName, + @JsonProperty("variables") final com.commercetools.history.models.graph_ql.GraphQLVariablesMap variables) { + this.query = query; + this.operationName = operationName; + this.variables = variables; + } + + /** + * create empty instance + */ + public GraphQLRequestImpl() { + } + + /** + *

String representation of the Source Text of the Document that is specified in the Language section of the GraphQL specification.

+ */ + + public String getQuery() { + return this.query; + } + + /** + *

Name of the operation, if you defined several operations in query.

+ */ + + public String getOperationName() { + return this.operationName; + } + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ */ + + public com.commercetools.history.models.graph_ql.GraphQLVariablesMap getVariables() { + return this.variables; + } + + public void setQuery(final String query) { + this.query = query; + } + + public void setOperationName(final String operationName) { + this.operationName = operationName; + } + + public void setVariables(final com.commercetools.history.models.graph_ql.GraphQLVariablesMap variables) { + this.variables = variables; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + GraphQLRequestImpl that = (GraphQLRequestImpl) o; + + return new EqualsBuilder().append(query, that.query) + .append(operationName, that.operationName) + .append(variables, that.variables) + .append(query, that.query) + .append(operationName, that.operationName) + .append(variables, that.variables) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(query).append(operationName).append(variables).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("query", query) + .append("operationName", operationName) + .append("variables", variables) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponse.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponse.java new file mode 100644 index 00000000000..fc3d8f556ab --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponse.java @@ -0,0 +1,151 @@ + +package com.commercetools.history.models.graph_ql; + +import java.time.*; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; + +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.Valid; + +/** + *

error is present in the response only if the GraphQL query was unsuccessful.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLResponse graphQLResponse = GraphQLResponse.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = GraphQLResponseImpl.class) +public interface GraphQLResponse { + + /** + *

JSON object that contains the results of a GraphQL query.

+ * @return data + */ + + @JsonProperty("data") + public Object getData(); + + /** + *

Errors that the GraphQL query returns.

+ * @return errors + */ + @Valid + @JsonProperty("errors") + public List getErrors(); + + /** + *

JSON object that contains the results of a GraphQL query.

+ * @param data value to be set + */ + + public void setData(final Object data); + + /** + *

Errors that the GraphQL query returns.

+ * @param errors values to be set + */ + + @JsonIgnore + public void setErrors(final GraphQLError... errors); + + /** + *

Errors that the GraphQL query returns.

+ * @param errors values to be set + */ + + public void setErrors(final List errors); + + /** + * factory method + * @return instance of GraphQLResponse + */ + public static GraphQLResponse of() { + return new GraphQLResponseImpl(); + } + + /** + * factory method to create a shallow copy GraphQLResponse + * @param template instance to be copied + * @return copy instance + */ + public static GraphQLResponse of(final GraphQLResponse template) { + GraphQLResponseImpl instance = new GraphQLResponseImpl(); + instance.setData(template.getData()); + instance.setErrors(template.getErrors()); + return instance; + } + + /** + * factory method to create a deep copy of GraphQLResponse + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static GraphQLResponse deepCopy(@Nullable final GraphQLResponse template) { + if (template == null) { + return null; + } + GraphQLResponseImpl instance = new GraphQLResponseImpl(); + instance.setData(template.getData()); + instance.setErrors(Optional.ofNullable(template.getErrors()) + .map(t -> t.stream() + .map(com.commercetools.history.models.graph_ql.GraphQLError::deepCopy) + .collect(Collectors.toList())) + .orElse(null)); + return instance; + } + + /** + * builder factory method for GraphQLResponse + * @return builder + */ + public static GraphQLResponseBuilder builder() { + return GraphQLResponseBuilder.of(); + } + + /** + * create builder for GraphQLResponse instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static GraphQLResponseBuilder builder(final GraphQLResponse template) { + return GraphQLResponseBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withGraphQLResponse(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseBuilder.java new file mode 100644 index 00000000000..ceedfecd819 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseBuilder.java @@ -0,0 +1,188 @@ + +package com.commercetools.history.models.graph_ql; + +import java.util.*; +import java.util.function.Function; + +import javax.annotation.Nullable; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * GraphQLResponseBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLResponse graphQLResponse = GraphQLResponse.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class GraphQLResponseBuilder implements Builder { + + @Nullable + private java.lang.Object data; + + @Nullable + private java.util.List errors; + + /** + *

JSON object that contains the results of a GraphQL query.

+ * @param data value to be set + * @return Builder + */ + + public GraphQLResponseBuilder data(@Nullable final java.lang.Object data) { + this.data = data; + return this; + } + + /** + *

Errors that the GraphQL query returns.

+ * @param errors value to be set + * @return Builder + */ + + public GraphQLResponseBuilder errors( + @Nullable final com.commercetools.history.models.graph_ql.GraphQLError... errors) { + this.errors = new ArrayList<>(Arrays.asList(errors)); + return this; + } + + /** + *

Errors that the GraphQL query returns.

+ * @param errors value to be set + * @return Builder + */ + + public GraphQLResponseBuilder errors( + @Nullable final java.util.List errors) { + this.errors = errors; + return this; + } + + /** + *

Errors that the GraphQL query returns.

+ * @param errors value to be set + * @return Builder + */ + + public GraphQLResponseBuilder plusErrors( + @Nullable final com.commercetools.history.models.graph_ql.GraphQLError... errors) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.addAll(Arrays.asList(errors)); + return this; + } + + /** + *

Errors that the GraphQL query returns.

+ * @param builder function to build the errors value + * @return Builder + */ + + public GraphQLResponseBuilder plusErrors( + Function builder) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(builder.apply(com.commercetools.history.models.graph_ql.GraphQLErrorBuilder.of()).build()); + return this; + } + + /** + *

Errors that the GraphQL query returns.

+ * @param builder function to build the errors value + * @return Builder + */ + + public GraphQLResponseBuilder withErrors( + Function builder) { + this.errors = new ArrayList<>(); + this.errors.add(builder.apply(com.commercetools.history.models.graph_ql.GraphQLErrorBuilder.of()).build()); + return this; + } + + /** + *

Errors that the GraphQL query returns.

+ * @param builder function to build the errors value + * @return Builder + */ + + public GraphQLResponseBuilder addErrors( + Function builder) { + return plusErrors(builder.apply(com.commercetools.history.models.graph_ql.GraphQLErrorBuilder.of())); + } + + /** + *

Errors that the GraphQL query returns.

+ * @param builder function to build the errors value + * @return Builder + */ + + public GraphQLResponseBuilder setErrors( + Function builder) { + return errors(builder.apply(com.commercetools.history.models.graph_ql.GraphQLErrorBuilder.of())); + } + + /** + *

JSON object that contains the results of a GraphQL query.

+ * @return data + */ + + @Nullable + public java.lang.Object getData() { + return this.data; + } + + /** + *

Errors that the GraphQL query returns.

+ * @return errors + */ + + @Nullable + public java.util.List getErrors() { + return this.errors; + } + + /** + * builds GraphQLResponse with checking for non-null required values + * @return GraphQLResponse + */ + public GraphQLResponse build() { + return new GraphQLResponseImpl(data, errors); + } + + /** + * builds GraphQLResponse without checking for non-null required values + * @return GraphQLResponse + */ + public GraphQLResponse buildUnchecked() { + return new GraphQLResponseImpl(data, errors); + } + + /** + * factory method for an instance of GraphQLResponseBuilder + * @return builder + */ + public static GraphQLResponseBuilder of() { + return new GraphQLResponseBuilder(); + } + + /** + * create builder for GraphQLResponse instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static GraphQLResponseBuilder of(final GraphQLResponse template) { + GraphQLResponseBuilder builder = new GraphQLResponseBuilder(); + builder.data = template.getData(); + builder.errors = template.getErrors(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseImpl.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseImpl.java new file mode 100644 index 00000000000..3daa037c42e --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseImpl.java @@ -0,0 +1,102 @@ + +package com.commercetools.history.models.graph_ql; + +import java.time.*; +import java.util.*; + +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; + +/** + *

error is present in the response only if the GraphQL query was unsuccessful.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class GraphQLResponseImpl implements GraphQLResponse, ModelBase { + + private java.lang.Object data; + + private java.util.List errors; + + /** + * create instance with all properties + */ + @JsonCreator + GraphQLResponseImpl(@JsonProperty("data") final java.lang.Object data, + @JsonProperty("errors") final java.util.List errors) { + this.data = data; + this.errors = errors; + } + + /** + * create empty instance + */ + public GraphQLResponseImpl() { + } + + /** + *

JSON object that contains the results of a GraphQL query.

+ */ + + public java.lang.Object getData() { + return this.data; + } + + /** + *

Errors that the GraphQL query returns.

+ */ + + public java.util.List getErrors() { + return this.errors; + } + + public void setData(final java.lang.Object data) { + this.data = data; + } + + public void setErrors(final com.commercetools.history.models.graph_ql.GraphQLError... errors) { + this.errors = new ArrayList<>(Arrays.asList(errors)); + } + + public void setErrors(final java.util.List errors) { + this.errors = errors; + } + + @Override + public boolean equals(Object o) { + if (this == o) + return true; + + if (o == null || getClass() != o.getClass()) + return false; + + GraphQLResponseImpl that = (GraphQLResponseImpl) o; + + return new EqualsBuilder().append(data, that.data) + .append(errors, that.errors) + .append(data, that.data) + .append(errors, that.errors) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(data).append(errors).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("data", data) + .append("errors", errors) + .build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMap.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMap.java new file mode 100644 index 00000000000..a2502da804c --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMap.java @@ -0,0 +1,123 @@ + +package com.commercetools.history.models.graph_ql; + +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; + +/** + *

The variables that the GraphQL query uses.

+ * + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLVariablesMap graphQLVariablesMap = GraphQLVariablesMap.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@JsonDeserialize(as = GraphQLVariablesMapImpl.class) +public interface GraphQLVariablesMap { + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @return map of the pattern property values + */ + @NotNull + @JsonAnyGetter + public Map values(); + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @param key property name + * @param value property value + */ + + @JsonAnySetter + public void setValue(String key, Object value); + + /** + * factory method + * @return instance of GraphQLVariablesMap + */ + public static GraphQLVariablesMap of() { + return new GraphQLVariablesMapImpl(); + } + + /** + * factory method to create a shallow copy GraphQLVariablesMap + * @param template instance to be copied + * @return copy instance + */ + public static GraphQLVariablesMap of(final GraphQLVariablesMap template) { + GraphQLVariablesMapImpl instance = new GraphQLVariablesMapImpl(); + Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue)); + return instance; + } + + /** + * factory method to create a deep copy of GraphQLVariablesMap + * @param template instance to be copied + * @return copy instance + */ + @Nullable + public static GraphQLVariablesMap deepCopy(@Nullable final GraphQLVariablesMap template) { + if (template == null) { + return null; + } + GraphQLVariablesMapImpl instance = new GraphQLVariablesMapImpl(); + Optional.ofNullable(template.values()).ifPresent(t -> t.forEach(instance::setValue)); + return instance; + } + + /** + * builder factory method for GraphQLVariablesMap + * @return builder + */ + public static GraphQLVariablesMapBuilder builder() { + return GraphQLVariablesMapBuilder.of(); + } + + /** + * create builder for GraphQLVariablesMap instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static GraphQLVariablesMapBuilder builder(final GraphQLVariablesMap template) { + return GraphQLVariablesMapBuilder.of(template); + } + + /** + * accessor map function + * @param mapped type + * @param helper function to map the object + * @return mapped value + */ + default T withGraphQLVariablesMap(Function helper) { + return helper.apply(this); + } + + /** + * gives a TypeReference for usage with Jackson DataBind + * @return TypeReference + */ + public static com.fasterxml.jackson.core.type.TypeReference typeReference() { + return new com.fasterxml.jackson.core.type.TypeReference() { + @Override + public String toString() { + return "TypeReference"; + } + }; + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapBuilder.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapBuilder.java new file mode 100644 index 00000000000..239ee4fd2d4 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapBuilder.java @@ -0,0 +1,95 @@ + +package com.commercetools.history.models.graph_ql; + +import java.util.*; + +import io.vrap.rmf.base.client.Builder; +import io.vrap.rmf.base.client.utils.Generated; + +/** + * GraphQLVariablesMapBuilder + *
+ * Example to create an instance using the builder pattern + *
+ *

+ *     GraphQLVariablesMap graphQLVariablesMap = GraphQLVariablesMap.builder()
+ *             .build()
+ * 
+ *
+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class GraphQLVariablesMapBuilder implements Builder { + + private Map values = new HashMap<>(); + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @param values properties to be set + * @return Builder + */ + + public GraphQLVariablesMapBuilder values(final Map values) { + this.values = values; + return this; + } + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @param key property name + * @param value property value + * @return Builder + */ + + public GraphQLVariablesMapBuilder addValue(final String key, final java.lang.Object value) { + if (this.values == null) { + values = new HashMap<>(); + } + values.put(key, value); + return this; + } + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ * @return pattern properties + */ + + public Map getValues() { + return this.values; + } + + /** + * builds GraphQLVariablesMap with checking for non-null required values + * @return GraphQLVariablesMap + */ + public GraphQLVariablesMap build() { + return new GraphQLVariablesMapImpl(values); + } + + /** + * builds GraphQLVariablesMap without checking for non-null required values + * @return GraphQLVariablesMap + */ + public GraphQLVariablesMap buildUnchecked() { + return new GraphQLVariablesMapImpl(values); + } + + /** + * factory method for an instance of GraphQLVariablesMapBuilder + * @return builder + */ + public static GraphQLVariablesMapBuilder of() { + return new GraphQLVariablesMapBuilder(); + } + + /** + * create builder for GraphQLVariablesMap instance + * @param template instance with prefilled values for the builder + * @return builder + */ + public static GraphQLVariablesMapBuilder of(final GraphQLVariablesMap template) { + GraphQLVariablesMapBuilder builder = new GraphQLVariablesMapBuilder(); + builder.values = template.values(); + return builder; + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapImpl.java b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapImpl.java new file mode 100644 index 00000000000..8de8e065fb3 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/main/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapImpl.java @@ -0,0 +1,80 @@ + +package com.commercetools.history.models.graph_ql; + +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; + +/** + *

The variables that the GraphQL query uses.

+ */ +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +public class GraphQLVariablesMapImpl implements GraphQLVariablesMap, ModelBase { + + private Map values; + + /** + * create instance with all properties + */ + @JsonCreator + GraphQLVariablesMapImpl(@JsonAnySetter @JsonProperty("values") final Map values) { + this.values = values; + } + + /** + * create empty instance + */ + public GraphQLVariablesMapImpl() { + } + + /** + *

JSON object that contains key-value pairs in which the keys are variable names and the values are variable values.

+ */ + + public Map 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; + + GraphQLVariablesMapImpl that = (GraphQLVariablesMapImpl) o; + + return new EqualsBuilder().append(values, that.values).append(values, that.values).isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37).append(values).toHashCode(); + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("values", values).build(); + } + +} diff --git a/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/client/resource/ByProjectKeyGraphqlTest.java b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/client/resource/ByProjectKeyGraphqlTest.java new file mode 100644 index 00000000000..8b8a0cfba83 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/client/resource/ByProjectKeyGraphqlTest.java @@ -0,0 +1,78 @@ + +package com.commercetools.history.client.resource; + +import java.nio.charset.StandardCharsets; +import java.util.concurrent.CompletableFuture; + +import com.commercetools.history.client.ApiRoot; +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import io.vrap.rmf.base.client.*; +import io.vrap.rmf.base.client.ApiHttpClient; +import io.vrap.rmf.base.client.ApiHttpRequest; +import io.vrap.rmf.base.client.VrapHttpClient; +import io.vrap.rmf.base.client.error.ApiClientException; +import io.vrap.rmf.base.client.error.ApiServerException; +import io.vrap.rmf.base.client.utils.Generated; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mockito; + +@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class ByProjectKeyGraphqlTest { + private final VrapHttpClient httpClientMock = Mockito.mock(VrapHttpClient.class); + private final String projectKey = "test_projectKey"; + private final static ApiRoot apiRoot = ApiRoot.of(); + private final ApiHttpClient client = ClientBuilder.of(httpClientMock).defaultClient("").build(); + + @TestTemplate + @UseDataProvider("requestWithMethodParameters") + public void withMethods(ApiHttpRequest request, String httpMethod, String uri) { + Assertions.assertThat(httpMethod).isEqualTo(request.getMethod().name().toLowerCase()); + Assertions.assertThat(uri).isEqualTo(request.getUri().toString()); + } + + @TestTemplate + @UseDataProvider("executeMethodParameters") + public void executeServerException(HttpRequestCommand httpRequest) throws Exception { + Mockito.when(httpClientMock.execute(Mockito.any())) + .thenReturn(CompletableFuture.completedFuture( + new ApiHttpResponse<>(500, null, "".getBytes(StandardCharsets.UTF_8), "Oops!"))); + + Assertions.assertThatThrownBy(() -> client.execute(httpRequest).toCompletableFuture().get()) + .hasCauseInstanceOf(ApiServerException.class); + } + + @TestTemplate + @UseDataProvider("executeMethodParameters") + public void executeClientException(HttpRequestCommand httpRequest) throws Exception { + Mockito.when(httpClientMock.execute(Mockito.any())) + .thenReturn(CompletableFuture.completedFuture( + new ApiHttpResponse<>(400, null, "".getBytes(StandardCharsets.UTF_8), "Oops!"))); + + Assertions.assertThatThrownBy(() -> client.execute(httpRequest).toCompletableFuture().get()) + .hasCauseInstanceOf(ApiClientException.class); + } + + @DataProvider + public static Object[][] requestWithMethodParameters() { + return new Object[][] { new Object[] { apiRoot.withProjectKeyValue("test_projectKey") + .graphql() + .post(com.commercetools.history.models.graph_ql.GraphQLRequest.of()) + .createHttpRequest(), "post", "test_projectKey/graphql", } }; + } + + @DataProvider + public static Object[][] executeMethodParameters() { + return new Object[][] { new Object[] { apiRoot.withProjectKeyValue("test_projectKey") + .graphql() + .post(com.commercetools.history.models.graph_ql.GraphQLRequest.of()), } }; + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationTest.java b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationTest.java new file mode 100644 index 00000000000..17714e56dbb --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorLocationTest.java @@ -0,0 +1,44 @@ + +package com.commercetools.history.models.graph_ql; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class GraphQLErrorLocationTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(GraphQLErrorLocationBuilder builder) { + GraphQLErrorLocation graphQLErrorLocation = builder.buildUnchecked(); + Assertions.assertThat(graphQLErrorLocation).isInstanceOf(GraphQLErrorLocation.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { GraphQLErrorLocation.builder().line(6L) }, + new Object[] { GraphQLErrorLocation.builder().column(2L) } }; + } + + @Test + public void line() { + GraphQLErrorLocation value = GraphQLErrorLocation.of(); + value.setLine(6L); + Assertions.assertThat(value.getLine()).isEqualTo(6L); + } + + @Test + public void column() { + GraphQLErrorLocation value = GraphQLErrorLocation.of(); + value.setColumn(2L); + Assertions.assertThat(value.getColumn()).isEqualTo(2L); + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorTest.java b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorTest.java new file mode 100644 index 00000000000..dfd63a8b3be --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLErrorTest.java @@ -0,0 +1,69 @@ + +package com.commercetools.history.models.graph_ql; + +import java.util.Collections; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class GraphQLErrorTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(GraphQLErrorBuilder builder) { + GraphQLError graphQLError = builder.buildUnchecked(); + Assertions.assertThat(graphQLError).isInstanceOf(GraphQLError.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { GraphQLError.builder().message("message") }, + new Object[] { GraphQLError.builder() + .locations(Collections.singletonList( + new com.commercetools.history.models.graph_ql.GraphQLErrorLocationImpl())) }, + new Object[] { GraphQLError.builder().path(Collections.singletonList("path")) }, + new Object[] { GraphQLError.builder() + .extensions(new com.commercetools.history.models.error.GraphQLErrorObjectImpl()) } }; + } + + @Test + public void message() { + GraphQLError value = GraphQLError.of(); + value.setMessage("message"); + Assertions.assertThat(value.getMessage()).isEqualTo("message"); + } + + @Test + public void locations() { + GraphQLError value = GraphQLError.of(); + value.setLocations( + Collections.singletonList(new com.commercetools.history.models.graph_ql.GraphQLErrorLocationImpl())); + Assertions.assertThat(value.getLocations()) + .isEqualTo(Collections + .singletonList(new com.commercetools.history.models.graph_ql.GraphQLErrorLocationImpl())); + } + + @Test + public void path() { + GraphQLError value = GraphQLError.of(); + value.setPath(Collections.singletonList("path")); + Assertions.assertThat(value.getPath()).isEqualTo(Collections.singletonList("path")); + } + + @Test + public void extensions() { + GraphQLError value = GraphQLError.of(); + value.setExtensions(new com.commercetools.history.models.error.GraphQLErrorObjectImpl()); + Assertions.assertThat(value.getExtensions()) + .isEqualTo(new com.commercetools.history.models.error.GraphQLErrorObjectImpl()); + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestTest.java b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestTest.java new file mode 100644 index 00000000000..565ad41dea2 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLRequestTest.java @@ -0,0 +1,54 @@ + +package com.commercetools.history.models.graph_ql; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class GraphQLRequestTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(GraphQLRequestBuilder builder) { + GraphQLRequest graphQLRequest = builder.buildUnchecked(); + Assertions.assertThat(graphQLRequest).isInstanceOf(GraphQLRequest.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { GraphQLRequest.builder().query("query") }, + new Object[] { GraphQLRequest.builder().operationName("operationName") }, + new Object[] { GraphQLRequest.builder() + .variables(new com.commercetools.history.models.graph_ql.GraphQLVariablesMapImpl()) } }; + } + + @Test + public void query() { + GraphQLRequest value = GraphQLRequest.of(); + value.setQuery("query"); + Assertions.assertThat(value.getQuery()).isEqualTo("query"); + } + + @Test + public void operationName() { + GraphQLRequest value = GraphQLRequest.of(); + value.setOperationName("operationName"); + Assertions.assertThat(value.getOperationName()).isEqualTo("operationName"); + } + + @Test + public void variables() { + GraphQLRequest value = GraphQLRequest.of(); + value.setVariables(new com.commercetools.history.models.graph_ql.GraphQLVariablesMapImpl()); + Assertions.assertThat(value.getVariables()) + .isEqualTo(new com.commercetools.history.models.graph_ql.GraphQLVariablesMapImpl()); + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseTest.java b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseTest.java new file mode 100644 index 00000000000..edc29ad0199 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLResponseTest.java @@ -0,0 +1,49 @@ + +package com.commercetools.history.models.graph_ql; + +import java.util.Collections; + +import com.tngtech.junit.dataprovider.DataProvider; +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProvider; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.assertj.core.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestTemplate; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class GraphQLResponseTest { + + @TestTemplate + @UseDataProvider("objectBuilder") + public void buildUnchecked(GraphQLResponseBuilder builder) { + GraphQLResponse graphQLResponse = builder.buildUnchecked(); + Assertions.assertThat(graphQLResponse).isInstanceOf(GraphQLResponse.class); + } + + @DataProvider + public static Object[][] objectBuilder() { + return new Object[][] { new Object[] { GraphQLResponse.builder().data("data") }, + new Object[] { GraphQLResponse.builder() + .errors(Collections + .singletonList(new com.commercetools.history.models.graph_ql.GraphQLErrorImpl())) } }; + } + + @Test + public void data() { + GraphQLResponse value = GraphQLResponse.of(); + value.setData("data"); + Assertions.assertThat(value.getData()).isEqualTo("data"); + } + + @Test + public void errors() { + GraphQLResponse value = GraphQLResponse.of(); + value.setErrors(Collections.singletonList(new com.commercetools.history.models.graph_ql.GraphQLErrorImpl())); + Assertions.assertThat(value.getErrors()) + .isEqualTo(Collections.singletonList(new com.commercetools.history.models.graph_ql.GraphQLErrorImpl())); + } +} diff --git a/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapTest.java b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapTest.java new file mode 100644 index 00000000000..d007b332019 --- /dev/null +++ b/commercetools/commercetools-sdk-java-history/src/test/java-generated/com/commercetools/history/models/graph_ql/GraphQLVariablesMapTest.java @@ -0,0 +1,13 @@ + +package com.commercetools.history.models.graph_ql; + +import com.tngtech.junit.dataprovider.DataProviderExtension; +import com.tngtech.junit.dataprovider.UseDataProviderExtension; + +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(UseDataProviderExtension.class) +@ExtendWith(DataProviderExtension.class) +public class GraphQLVariablesMapTest { + +} diff --git a/references.txt b/references.txt index d46a0574e3b..a44e5499437 100644 --- a/references.txt +++ b/references.txt @@ -353,3 +353,4 @@ e5666d7956fd6de53e41f965b052896d2a2ddd9b f8b69ab19d6be2bcc6732deee0647bd8494c15f1 e8f731a742ca2997342b1b5f98121d86c8189a3b 473d2c6f1a9e9da0d2a42408ccf11f27a838f8b5 +b7b82f5a701908239fcf39781bcbfa80823c9fa0