Skip to content

Commit 422beb6

Browse files
committed
DEVX-624: generating files with codegentool
1 parent 6466ede commit 422beb6

File tree

319 files changed

+46987
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

319 files changed

+46987
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
2+
package com.commercetools.checkout.client;
3+
4+
import java.io.Closeable;
5+
6+
import io.vrap.rmf.base.client.ApiHttpClient;
7+
import io.vrap.rmf.base.client.SerializerOnlyApiHttpClient;
8+
import io.vrap.rmf.base.client.utils.Generated;
9+
10+
/**
11+
* Entrypoint for building requests against the API
12+
*/
13+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
14+
public class ApiRoot implements Closeable {
15+
16+
private final ApiHttpClient apiHttpClient;
17+
18+
private ApiRoot(final ApiHttpClient apiHttpClient) {
19+
this.apiHttpClient = apiHttpClient;
20+
}
21+
22+
public static ApiRoot of() {
23+
return new ApiRoot(SerializerOnlyApiHttpClient.of());
24+
}
25+
26+
public static ApiRoot fromClient(final ApiHttpClient apiHttpClient) {
27+
return new ApiRoot(apiHttpClient);
28+
}
29+
30+
public ByProjectKeyRequestBuilder withProjectKey(String projectKey) {
31+
return new ByProjectKeyRequestBuilder(this.apiHttpClient, projectKey);
32+
}
33+
34+
@Override
35+
public void close() {
36+
if (apiHttpClient == null) {
37+
return;
38+
}
39+
try {
40+
apiHttpClient.close();
41+
}
42+
catch (final Throwable ignored) {
43+
}
44+
}
45+
46+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
2+
package com.commercetools.checkout.client;
3+
4+
import java.net.URI;
5+
import java.time.Duration;
6+
import java.util.ArrayList;
7+
import java.util.List;
8+
import java.util.concurrent.CompletableFuture;
9+
10+
import com.fasterxml.jackson.core.type.TypeReference;
11+
12+
import io.vrap.rmf.base.client.*;
13+
import io.vrap.rmf.base.client.utils.Generated;
14+
15+
import org.apache.commons.lang3.builder.EqualsBuilder;
16+
import org.apache.commons.lang3.builder.HashCodeBuilder;
17+
18+
/**
19+
* <p>Specific Error Codes:</p>
20+
* <ul>
21+
* <li><a href="https://docs.commercetools.com/apis/ctp:checkout:type:MultipleActionsNotAllowedError" rel="nofollow">MultipleActionsNotAllowed</a></li>
22+
* <li><a href="https://docs.commercetools.com/apis/ctp:checkout:type:RequiredFieldError" rel="nofollow">RequiredField</a></li>
23+
* <li><a href="https://docs.commercetools.com/apis/ctp:checkout:type:ResourceNotFoundError" rel="nofollow">ResourceNotFound</a></li>
24+
* </ul>
25+
*
26+
* <hr>
27+
* <div class=code-example>
28+
* <pre><code class='java'>{@code
29+
* CompletableFuture<ApiHttpResponse<java.lang.Object>> result = apiRoot
30+
* .withProjectKey("{projectKey}")
31+
* .paymentIntents()
32+
* .withPaymentId("{paymentId}")
33+
* .post(null)
34+
* .execute()
35+
* }</code></pre>
36+
* </div>
37+
*/
38+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
39+
public class ByProjectKeyPaymentIntentsByPaymentIdPost extends
40+
TypeBodyApiMethod<ByProjectKeyPaymentIntentsByPaymentIdPost, java.lang.Object, com.commercetools.checkout.models.payment_intents.PaymentIntent>
41+
implements
42+
com.commercetools.checkout.client.Secured_by_manage_paymentsTrait<ByProjectKeyPaymentIntentsByPaymentIdPost> {
43+
44+
@Override
45+
public TypeReference<java.lang.Object> resultType() {
46+
return new TypeReference<java.lang.Object>() {
47+
};
48+
}
49+
50+
private String projectKey;
51+
private String paymentId;
52+
53+
private com.commercetools.checkout.models.payment_intents.PaymentIntent paymentIntent;
54+
55+
public ByProjectKeyPaymentIntentsByPaymentIdPost(final ApiHttpClient apiHttpClient, String projectKey,
56+
String paymentId, com.commercetools.checkout.models.payment_intents.PaymentIntent paymentIntent) {
57+
super(apiHttpClient);
58+
this.projectKey = projectKey;
59+
this.paymentId = paymentId;
60+
this.paymentIntent = paymentIntent;
61+
}
62+
63+
public ByProjectKeyPaymentIntentsByPaymentIdPost(ByProjectKeyPaymentIntentsByPaymentIdPost t) {
64+
super(t);
65+
this.projectKey = t.projectKey;
66+
this.paymentId = t.paymentId;
67+
this.paymentIntent = t.paymentIntent;
68+
}
69+
70+
@Override
71+
protected ApiHttpRequest buildHttpRequest() {
72+
List<String> params = new ArrayList<>(getQueryParamUriStrings());
73+
String httpRequestPath = String.format("%s/payment-intents/%s", encodePathParam(this.projectKey),
74+
encodePathParam(this.paymentId));
75+
if (!params.isEmpty()) {
76+
httpRequestPath += "?" + String.join("&", params);
77+
}
78+
return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(),
79+
io.vrap.rmf.base.client.utils.json.JsonUtils
80+
.executing(() -> apiHttpClient().getSerializerService().toJsonByteArray(paymentIntent)));
81+
82+
}
83+
84+
@Override
85+
public ApiHttpResponse<java.lang.Object> executeBlocking(final ApiHttpClient client, final Duration timeout) {
86+
return executeBlocking(client, timeout, java.lang.Object.class);
87+
}
88+
89+
@Override
90+
public CompletableFuture<ApiHttpResponse<java.lang.Object>> execute(final ApiHttpClient client) {
91+
return execute(client, java.lang.Object.class);
92+
}
93+
94+
public String getProjectKey() {
95+
return this.projectKey;
96+
}
97+
98+
public String getPaymentId() {
99+
return this.paymentId;
100+
}
101+
102+
public void setProjectKey(final String projectKey) {
103+
this.projectKey = projectKey;
104+
}
105+
106+
public void setPaymentId(final String paymentId) {
107+
this.paymentId = paymentId;
108+
}
109+
110+
public com.commercetools.checkout.models.payment_intents.PaymentIntent getBody() {
111+
return paymentIntent;
112+
}
113+
114+
public ByProjectKeyPaymentIntentsByPaymentIdPost withBody(
115+
com.commercetools.checkout.models.payment_intents.PaymentIntent paymentIntent) {
116+
ByProjectKeyPaymentIntentsByPaymentIdPost t = copy();
117+
t.paymentIntent = paymentIntent;
118+
return t;
119+
}
120+
121+
@Override
122+
public boolean equals(Object o) {
123+
if (this == o)
124+
return true;
125+
126+
if (o == null || getClass() != o.getClass())
127+
return false;
128+
129+
ByProjectKeyPaymentIntentsByPaymentIdPost that = (ByProjectKeyPaymentIntentsByPaymentIdPost) o;
130+
131+
return new EqualsBuilder().append(projectKey, that.projectKey)
132+
.append(paymentId, that.paymentId)
133+
.append(paymentIntent, that.paymentIntent)
134+
.isEquals();
135+
}
136+
137+
@Override
138+
public int hashCode() {
139+
return new HashCodeBuilder(17, 37).append(projectKey).append(paymentId).append(paymentIntent).toHashCode();
140+
}
141+
142+
@Override
143+
protected ByProjectKeyPaymentIntentsByPaymentIdPost copy() {
144+
return new ByProjectKeyPaymentIntentsByPaymentIdPost(this);
145+
}
146+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
2+
package com.commercetools.checkout.client;
3+
4+
import java.net.URI;
5+
import java.nio.charset.StandardCharsets;
6+
import java.time.Duration;
7+
import java.util.ArrayList;
8+
import java.util.List;
9+
import java.util.concurrent.CompletableFuture;
10+
11+
import com.fasterxml.jackson.core.type.TypeReference;
12+
13+
import io.vrap.rmf.base.client.*;
14+
import io.vrap.rmf.base.client.utils.Generated;
15+
16+
import org.apache.commons.lang3.builder.EqualsBuilder;
17+
import org.apache.commons.lang3.builder.HashCodeBuilder;
18+
19+
/**
20+
* <p>Specific Error Codes:</p>
21+
* <ul>
22+
* <li><a href="https://docs.commercetools.com/apis/ctp:checkout:type:MultipleActionsNotAllowedError" rel="nofollow">MultipleActionsNotAllowed</a></li>
23+
* <li><a href="https://docs.commercetools.com/apis/ctp:checkout:type:RequiredFieldError" rel="nofollow">RequiredField</a></li>
24+
* <li><a href="https://docs.commercetools.com/apis/ctp:checkout:type:ResourceNotFoundError" rel="nofollow">ResourceNotFound</a></li>
25+
* </ul>
26+
*
27+
* <hr>
28+
* <div class=code-example>
29+
* <pre><code class='java'>{@code
30+
* CompletableFuture<ApiHttpResponse<java.lang.Object>> result = apiRoot
31+
* .withProjectKey("{projectKey}")
32+
* .paymentIntents()
33+
* .withPaymentId("{paymentId}")
34+
* .post("")
35+
* .execute()
36+
* }</code></pre>
37+
* </div>
38+
*/
39+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
40+
public class ByProjectKeyPaymentIntentsByPaymentIdPostString
41+
extends StringBodyApiMethod<ByProjectKeyPaymentIntentsByPaymentIdPostString, java.lang.Object> implements
42+
com.commercetools.checkout.client.Secured_by_manage_paymentsTrait<ByProjectKeyPaymentIntentsByPaymentIdPostString> {
43+
44+
@Override
45+
public TypeReference<java.lang.Object> resultType() {
46+
return new TypeReference<java.lang.Object>() {
47+
};
48+
}
49+
50+
private String projectKey;
51+
private String paymentId;
52+
53+
private String paymentIntent;
54+
55+
public ByProjectKeyPaymentIntentsByPaymentIdPostString(final ApiHttpClient apiHttpClient, String projectKey,
56+
String paymentId, String paymentIntent) {
57+
super(apiHttpClient);
58+
this.projectKey = projectKey;
59+
this.paymentId = paymentId;
60+
this.paymentIntent = paymentIntent;
61+
}
62+
63+
public ByProjectKeyPaymentIntentsByPaymentIdPostString(ByProjectKeyPaymentIntentsByPaymentIdPostString t) {
64+
super(t);
65+
this.projectKey = t.projectKey;
66+
this.paymentId = t.paymentId;
67+
this.paymentIntent = t.paymentIntent;
68+
}
69+
70+
@Override
71+
protected ApiHttpRequest buildHttpRequest() {
72+
List<String> params = new ArrayList<>(getQueryParamUriStrings());
73+
String httpRequestPath = String.format("%s/payment-intents/%s", this.projectKey, this.paymentId);
74+
if (!params.isEmpty()) {
75+
httpRequestPath += "?" + String.join("&", params);
76+
}
77+
return new ApiHttpRequest(ApiHttpMethod.POST, URI.create(httpRequestPath), getHeaders(),
78+
paymentIntent.getBytes(StandardCharsets.UTF_8));
79+
80+
}
81+
82+
@Override
83+
public ApiHttpResponse<java.lang.Object> executeBlocking(final ApiHttpClient client, final Duration timeout) {
84+
return executeBlocking(client, timeout, java.lang.Object.class);
85+
}
86+
87+
@Override
88+
public CompletableFuture<ApiHttpResponse<java.lang.Object>> execute(final ApiHttpClient client) {
89+
return execute(client, java.lang.Object.class);
90+
}
91+
92+
public String getProjectKey() {
93+
return this.projectKey;
94+
}
95+
96+
public String getPaymentId() {
97+
return this.paymentId;
98+
}
99+
100+
public void setProjectKey(final String projectKey) {
101+
this.projectKey = projectKey;
102+
}
103+
104+
public void setPaymentId(final String paymentId) {
105+
this.paymentId = paymentId;
106+
}
107+
108+
public String getBody() {
109+
return paymentIntent;
110+
}
111+
112+
public ByProjectKeyPaymentIntentsByPaymentIdPostString withBody(String paymentIntent) {
113+
ByProjectKeyPaymentIntentsByPaymentIdPostString t = copy();
114+
t.paymentIntent = paymentIntent;
115+
return t;
116+
}
117+
118+
@Override
119+
public boolean equals(Object o) {
120+
if (this == o)
121+
return true;
122+
123+
if (o == null || getClass() != o.getClass())
124+
return false;
125+
126+
ByProjectKeyPaymentIntentsByPaymentIdPostString that = (ByProjectKeyPaymentIntentsByPaymentIdPostString) o;
127+
128+
return new EqualsBuilder().append(projectKey, that.projectKey)
129+
.append(paymentId, that.paymentId)
130+
.append(paymentIntent, that.paymentIntent)
131+
.isEquals();
132+
}
133+
134+
@Override
135+
public int hashCode() {
136+
return new HashCodeBuilder(17, 37).append(projectKey).append(paymentId).append(paymentIntent).toHashCode();
137+
}
138+
139+
@Override
140+
protected ByProjectKeyPaymentIntentsByPaymentIdPostString copy() {
141+
return new ByProjectKeyPaymentIntentsByPaymentIdPostString(this);
142+
}
143+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
package com.commercetools.checkout.client;
3+
4+
import java.util.function.UnaryOperator;
5+
6+
import io.vrap.rmf.base.client.ApiHttpClient;
7+
import io.vrap.rmf.base.client.utils.Generated;
8+
9+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
10+
public class ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder {
11+
12+
private final ApiHttpClient apiHttpClient;
13+
private final String projectKey;
14+
private final String paymentId;
15+
16+
public ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder(final ApiHttpClient apiHttpClient,
17+
final String projectKey, final String paymentId) {
18+
this.apiHttpClient = apiHttpClient;
19+
this.projectKey = projectKey;
20+
this.paymentId = paymentId;
21+
}
22+
23+
public ByProjectKeyPaymentIntentsByPaymentIdPost post(
24+
com.commercetools.checkout.models.payment_intents.PaymentIntent paymentIntent) {
25+
return new ByProjectKeyPaymentIntentsByPaymentIdPost(apiHttpClient, projectKey, paymentId, paymentIntent);
26+
}
27+
28+
public ByProjectKeyPaymentIntentsByPaymentIdPostString post(final String paymentIntent) {
29+
return new ByProjectKeyPaymentIntentsByPaymentIdPostString(apiHttpClient, projectKey, paymentId, paymentIntent);
30+
}
31+
32+
public ByProjectKeyPaymentIntentsByPaymentIdPost post(
33+
UnaryOperator<com.commercetools.checkout.models.payment_intents.PaymentIntentBuilder> op) {
34+
return post(op.apply(com.commercetools.checkout.models.payment_intents.PaymentIntentBuilder.of()).build());
35+
}
36+
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
package com.commercetools.checkout.client;
3+
4+
import io.vrap.rmf.base.client.ApiHttpClient;
5+
import io.vrap.rmf.base.client.utils.Generated;
6+
7+
@Generated(value = "io.vrap.rmf.codegen.rendering.CoreCodeGenerator", comments = "https://github.com/commercetools/rmf-codegen")
8+
public class ByProjectKeyPaymentIntentsRequestBuilder {
9+
10+
private final ApiHttpClient apiHttpClient;
11+
private final String projectKey;
12+
13+
public ByProjectKeyPaymentIntentsRequestBuilder(final ApiHttpClient apiHttpClient, final String projectKey) {
14+
this.apiHttpClient = apiHttpClient;
15+
this.projectKey = projectKey;
16+
}
17+
18+
public ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder withPaymentId(String paymentId) {
19+
return new ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder(apiHttpClient, projectKey, paymentId);
20+
}
21+
22+
}

0 commit comments

Comments
 (0)