Skip to content

Commit 0a355d1

Browse files
authored
StoredValueAPI generation (#1462)
* Generate StoredValue API with OpenAPI Generator v7.11.0 * Move StoredValueAPI class, deprecate old one * Generate StoredValue models to include comments * Correct deprecation
1 parent 6eeeb90 commit 0a355d1

17 files changed

+724
-590
lines changed

src/main/java/com/adyen/model/storedvalue/AbstractOpenApiSchema.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
package com.adyen.model.storedvalue;
1414

1515
import java.util.Objects;
16-
import java.lang.reflect.Type;
1716
import java.util.Map;
1817
import jakarta.ws.rs.core.GenericType;
1918

@@ -22,7 +21,6 @@
2221
/**
2322
* Abstract class for oneOf,anyOf schemas defined in OpenAPI spec
2423
*/
25-
2624
public abstract class AbstractOpenApiSchema {
2725

2826
// store the actual instance of the schema/object
@@ -34,6 +32,11 @@ public abstract class AbstractOpenApiSchema {
3432
// schema type (e.g. oneOf, anyOf)
3533
private final String schemaType;
3634

35+
/**
36+
*
37+
* @param schemaType the schema type
38+
* @param isNullable whether the instance is nullable
39+
*/
3740
public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
3841
this.schemaType = schemaType;
3942
this.isNullable = isNullable;
@@ -44,7 +47,7 @@ public AbstractOpenApiSchema(String schemaType, Boolean isNullable) {
4447
*
4548
* @return an instance of the actual schema/object
4649
*/
47-
public abstract Map<String, GenericType> getSchemas();
50+
public abstract Map<String, GenericType<?>> getSchemas();
4851

4952
/**
5053
* Get the actual instance
@@ -144,4 +147,4 @@ public Boolean isNullable() {
144147

145148

146149

147-
}
150+
}

src/main/java/com/adyen/model/storedvalue/Amount.java

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,14 @@
1313
package com.adyen.model.storedvalue;
1414

1515
import java.util.Objects;
16-
import java.util.Arrays;
1716
import java.util.Map;
1817
import java.util.HashMap;
1918
import com.fasterxml.jackson.annotation.JsonInclude;
2019
import com.fasterxml.jackson.annotation.JsonProperty;
2120
import com.fasterxml.jackson.annotation.JsonCreator;
2221
import com.fasterxml.jackson.annotation.JsonTypeName;
2322
import com.fasterxml.jackson.annotation.JsonValue;
24-
import io.swagger.annotations.ApiModel;
25-
import io.swagger.annotations.ApiModelProperty;
23+
import java.util.Arrays;
2624
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
2725
import com.fasterxml.jackson.core.JsonProcessingException;
2826

@@ -48,7 +46,7 @@ public Amount() {
4846
/**
4947
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
5048
*
51-
* @param currency
49+
* @param currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
5250
* @return the current {@code Amount} instance, allowing for method chaining
5351
*/
5452
public Amount currency(String currency) {
@@ -58,9 +56,8 @@ public Amount currency(String currency) {
5856

5957
/**
6058
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
61-
* @return currency
59+
* @return currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
6260
*/
63-
@ApiModelProperty(required = true, value = "The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).")
6461
@JsonProperty(JSON_PROPERTY_CURRENCY)
6562
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
6663
public String getCurrency() {
@@ -70,8 +67,8 @@ public String getCurrency() {
7067
/**
7168
* The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
7269
*
73-
* @param currency
74-
*/
70+
* @param currency The three-character [ISO currency code](https://docs.adyen.com/development-resources/currency-codes).
71+
*/
7572
@JsonProperty(JSON_PROPERTY_CURRENCY)
7673
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
7774
public void setCurrency(String currency) {
@@ -81,7 +78,7 @@ public void setCurrency(String currency) {
8178
/**
8279
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
8380
*
84-
* @param value
81+
* @param value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
8582
* @return the current {@code Amount} instance, allowing for method chaining
8683
*/
8784
public Amount value(Long value) {
@@ -91,9 +88,8 @@ public Amount value(Long value) {
9188

9289
/**
9390
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
94-
* @return value
91+
* @return value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
9592
*/
96-
@ApiModelProperty(required = true, value = "The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).")
9793
@JsonProperty(JSON_PROPERTY_VALUE)
9894
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
9995
public Long getValue() {
@@ -103,8 +99,8 @@ public Long getValue() {
10399
/**
104100
* The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
105101
*
106-
* @param value
107-
*/
102+
* @param value The amount of the transaction, in [minor units](https://docs.adyen.com/development-resources/currency-codes).
103+
*/
108104
@JsonProperty(JSON_PROPERTY_VALUE)
109105
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
110106
public void setValue(Long value) {

src/main/java/com/adyen/model/storedvalue/ServiceError.java

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,15 @@
1313
package com.adyen.model.storedvalue;
1414

1515
import java.util.Objects;
16-
import java.util.Arrays;
1716
import java.util.Map;
1817
import java.util.HashMap;
1918
import com.fasterxml.jackson.annotation.JsonInclude;
2019
import com.fasterxml.jackson.annotation.JsonProperty;
2120
import com.fasterxml.jackson.annotation.JsonCreator;
2221
import com.fasterxml.jackson.annotation.JsonTypeName;
2322
import com.fasterxml.jackson.annotation.JsonValue;
24-
import io.swagger.annotations.ApiModel;
25-
import io.swagger.annotations.ApiModelProperty;
23+
import java.util.Arrays;
2624
import java.util.HashMap;
27-
import java.util.List;
2825
import java.util.Map;
2926
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
3027
import com.fasterxml.jackson.core.JsonProcessingException;
@@ -44,7 +41,7 @@
4441

4542
public class ServiceError {
4643
public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additionalData";
47-
private Map<String, String> additionalData = null;
44+
private Map<String, String> additionalData;
4845

4946
public static final String JSON_PROPERTY_ERROR_CODE = "errorCode";
5047
private String errorCode;
@@ -67,7 +64,7 @@ public ServiceError() {
6764
/**
6865
* Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** &gt; **Developers** &gt; **Additional data**.
6966
*
70-
* @param additionalData
67+
* @param additionalData Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** &gt; **Developers** &gt; **Additional data**.
7168
* @return the current {@code ServiceError} instance, allowing for method chaining
7269
*/
7370
public ServiceError additionalData(Map<String, String> additionalData) {
@@ -85,9 +82,8 @@ public ServiceError putAdditionalDataItem(String key, String additionalDataItem)
8582

8683
/**
8784
* Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** &gt; **Developers** &gt; **Additional data**.
88-
* @return additionalData
85+
* @return additionalData Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** &gt; **Developers** &gt; **Additional data**.
8986
*/
90-
@ApiModelProperty(value = "Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** > **Developers** > **Additional data**.")
9187
@JsonProperty(JSON_PROPERTY_ADDITIONAL_DATA)
9288
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
9389
public Map<String, String> getAdditionalData() {
@@ -97,8 +93,8 @@ public Map<String, String> getAdditionalData() {
9793
/**
9894
* Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** &gt; **Developers** &gt; **Additional data**.
9995
*
100-
* @param additionalData
101-
*/
96+
* @param additionalData Contains additional information about the payment. Some data fields are included only if you select them first. Go to **Customer Area** &gt; **Developers** &gt; **Additional data**.
97+
*/
10298
@JsonProperty(JSON_PROPERTY_ADDITIONAL_DATA)
10399
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
104100
public void setAdditionalData(Map<String, String> additionalData) {
@@ -108,7 +104,7 @@ public void setAdditionalData(Map<String, String> additionalData) {
108104
/**
109105
* The error code mapped to the error message.
110106
*
111-
* @param errorCode
107+
* @param errorCode The error code mapped to the error message.
112108
* @return the current {@code ServiceError} instance, allowing for method chaining
113109
*/
114110
public ServiceError errorCode(String errorCode) {
@@ -118,9 +114,8 @@ public ServiceError errorCode(String errorCode) {
118114

119115
/**
120116
* The error code mapped to the error message.
121-
* @return errorCode
117+
* @return errorCode The error code mapped to the error message.
122118
*/
123-
@ApiModelProperty(value = "The error code mapped to the error message.")
124119
@JsonProperty(JSON_PROPERTY_ERROR_CODE)
125120
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
126121
public String getErrorCode() {
@@ -130,8 +125,8 @@ public String getErrorCode() {
130125
/**
131126
* The error code mapped to the error message.
132127
*
133-
* @param errorCode
134-
*/
128+
* @param errorCode The error code mapped to the error message.
129+
*/
135130
@JsonProperty(JSON_PROPERTY_ERROR_CODE)
136131
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
137132
public void setErrorCode(String errorCode) {
@@ -141,7 +136,7 @@ public void setErrorCode(String errorCode) {
141136
/**
142137
* The category of the error.
143138
*
144-
* @param errorType
139+
* @param errorType The category of the error.
145140
* @return the current {@code ServiceError} instance, allowing for method chaining
146141
*/
147142
public ServiceError errorType(String errorType) {
@@ -151,9 +146,8 @@ public ServiceError errorType(String errorType) {
151146

152147
/**
153148
* The category of the error.
154-
* @return errorType
149+
* @return errorType The category of the error.
155150
*/
156-
@ApiModelProperty(value = "The category of the error.")
157151
@JsonProperty(JSON_PROPERTY_ERROR_TYPE)
158152
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
159153
public String getErrorType() {
@@ -163,8 +157,8 @@ public String getErrorType() {
163157
/**
164158
* The category of the error.
165159
*
166-
* @param errorType
167-
*/
160+
* @param errorType The category of the error.
161+
*/
168162
@JsonProperty(JSON_PROPERTY_ERROR_TYPE)
169163
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
170164
public void setErrorType(String errorType) {
@@ -174,7 +168,7 @@ public void setErrorType(String errorType) {
174168
/**
175169
* A short explanation of the issue.
176170
*
177-
* @param message
171+
* @param message A short explanation of the issue.
178172
* @return the current {@code ServiceError} instance, allowing for method chaining
179173
*/
180174
public ServiceError message(String message) {
@@ -184,9 +178,8 @@ public ServiceError message(String message) {
184178

185179
/**
186180
* A short explanation of the issue.
187-
* @return message
181+
* @return message A short explanation of the issue.
188182
*/
189-
@ApiModelProperty(value = "A short explanation of the issue.")
190183
@JsonProperty(JSON_PROPERTY_MESSAGE)
191184
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
192185
public String getMessage() {
@@ -196,8 +189,8 @@ public String getMessage() {
196189
/**
197190
* A short explanation of the issue.
198191
*
199-
* @param message
200-
*/
192+
* @param message A short explanation of the issue.
193+
*/
201194
@JsonProperty(JSON_PROPERTY_MESSAGE)
202195
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
203196
public void setMessage(String message) {
@@ -207,7 +200,7 @@ public void setMessage(String message) {
207200
/**
208201
* The PSP reference of the payment.
209202
*
210-
* @param pspReference
203+
* @param pspReference The PSP reference of the payment.
211204
* @return the current {@code ServiceError} instance, allowing for method chaining
212205
*/
213206
public ServiceError pspReference(String pspReference) {
@@ -217,9 +210,8 @@ public ServiceError pspReference(String pspReference) {
217210

218211
/**
219212
* The PSP reference of the payment.
220-
* @return pspReference
213+
* @return pspReference The PSP reference of the payment.
221214
*/
222-
@ApiModelProperty(value = "The PSP reference of the payment.")
223215
@JsonProperty(JSON_PROPERTY_PSP_REFERENCE)
224216
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
225217
public String getPspReference() {
@@ -229,8 +221,8 @@ public String getPspReference() {
229221
/**
230222
* The PSP reference of the payment.
231223
*
232-
* @param pspReference
233-
*/
224+
* @param pspReference The PSP reference of the payment.
225+
*/
234226
@JsonProperty(JSON_PROPERTY_PSP_REFERENCE)
235227
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
236228
public void setPspReference(String pspReference) {
@@ -240,7 +232,7 @@ public void setPspReference(String pspReference) {
240232
/**
241233
* The HTTP response status.
242234
*
243-
* @param status
235+
* @param status The HTTP response status.
244236
* @return the current {@code ServiceError} instance, allowing for method chaining
245237
*/
246238
public ServiceError status(Integer status) {
@@ -250,9 +242,8 @@ public ServiceError status(Integer status) {
250242

251243
/**
252244
* The HTTP response status.
253-
* @return status
245+
* @return status The HTTP response status.
254246
*/
255-
@ApiModelProperty(value = "The HTTP response status.")
256247
@JsonProperty(JSON_PROPERTY_STATUS)
257248
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
258249
public Integer getStatus() {
@@ -262,8 +253,8 @@ public Integer getStatus() {
262253
/**
263254
* The HTTP response status.
264255
*
265-
* @param status
266-
*/
256+
* @param status The HTTP response status.
257+
*/
267258
@JsonProperty(JSON_PROPERTY_STATUS)
268259
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
269260
public void setStatus(Integer status) {

0 commit comments

Comments
 (0)