-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
61424ec
commit 3b9ffb6
Showing
30 changed files
with
2,983 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 126 additions & 0 deletions
126
...ory/src/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlPost.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
/** | ||
* <p>Execute a GraphQL request.</p> | ||
* | ||
* <hr> | ||
* <div class=code-example> | ||
* <pre><code class='java'>{@code | ||
* CompletableFuture<ApiHttpResponse<com.commercetools.history.models.graph_ql.GraphQLResponse>> result = apiRoot | ||
* .withProjectKeyValue("{projectKey}") | ||
* .graphql() | ||
* .post(null) | ||
* .execute() | ||
* }</code></pre> | ||
* </div> | ||
*/ | ||
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") | ||
public class ByProjectKeyGraphqlPost extends | ||
TypeBodyApiMethod<ByProjectKeyGraphqlPost, com.commercetools.history.models.graph_ql.GraphQLResponse, com.commercetools.history.models.graph_ql.GraphQLRequest> { | ||
|
||
@Override | ||
public TypeReference<com.commercetools.history.models.graph_ql.GraphQLResponse> resultType() { | ||
return new TypeReference<com.commercetools.history.models.graph_ql.GraphQLResponse>() { | ||
}; | ||
} | ||
|
||
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<String> 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<com.commercetools.history.models.graph_ql.GraphQLResponse> executeBlocking( | ||
final ApiHttpClient client, final Duration timeout) { | ||
return executeBlocking(client, timeout, com.commercetools.history.models.graph_ql.GraphQLResponse.class); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<ApiHttpResponse<com.commercetools.history.models.graph_ql.GraphQLResponse>> 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); | ||
} | ||
} |
125 changes: 125 additions & 0 deletions
125
...c/main/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlPostString.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
/** | ||
* <p>Execute a GraphQL request.</p> | ||
* | ||
* <hr> | ||
* <div class=code-example> | ||
* <pre><code class='java'>{@code | ||
* CompletableFuture<ApiHttpResponse<com.commercetools.history.models.graph_ql.GraphQLResponse>> result = apiRoot | ||
* .withProjectKeyValue("{projectKey}") | ||
* .graphql() | ||
* .post("") | ||
* .execute() | ||
* }</code></pre> | ||
* </div> | ||
*/ | ||
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen") | ||
public class ByProjectKeyGraphqlPostString extends | ||
StringBodyApiMethod<ByProjectKeyGraphqlPostString, com.commercetools.history.models.graph_ql.GraphQLResponse> { | ||
|
||
@Override | ||
public TypeReference<com.commercetools.history.models.graph_ql.GraphQLResponse> resultType() { | ||
return new TypeReference<com.commercetools.history.models.graph_ql.GraphQLResponse>() { | ||
}; | ||
} | ||
|
||
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<String> 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<com.commercetools.history.models.graph_ql.GraphQLResponse> executeBlocking( | ||
final ApiHttpClient client, final Duration timeout) { | ||
return executeBlocking(client, timeout, com.commercetools.history.models.graph_ql.GraphQLResponse.class); | ||
} | ||
|
||
@Override | ||
public CompletableFuture<ApiHttpResponse<com.commercetools.history.models.graph_ql.GraphQLResponse>> 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); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...in/java-generated/com/commercetools/history/client/ByProjectKeyGraphqlRequestBuilder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<com.commercetools.history.models.graph_ql.GraphQLRequestBuilder> op) { | ||
return post(op.apply(com.commercetools.history.models.graph_ql.GraphQLRequestBuilder.of()).build()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.