Skip to content

Commit 196b680

Browse files
AdyenAutomationBotAdyenAutomationBot
andauthored
Code generation: update services and models (#1529)
* false[adyen-sdk-automation] automated change * style(fmt): code formatted --------- Co-authored-by: AdyenAutomationBot <AdyenAutomationBot 38424300+AdyenAutomationBot@users.noreply.github.com>
1 parent ce9367f commit 196b680

39 files changed

+2479
-632
lines changed

src/main/java/com/adyen/model/balanceplatform/DeliveryAddress.java

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,12 @@ public void setPostalCode(String postalCode) {
280280
}
281281

282282
/**
283-
* The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in
284-
* Canada. &gt; Required for the US and Canada.
283+
* The state or province code, maximum 3 characters. For example, **CA** for California in the US
284+
* or **ON** for Ontario in Canada. &gt; Required for the US and Canada.
285285
*
286-
* @param stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in
287-
* the US or **ON** in Canada. &gt; Required for the US and Canada.
286+
* @param stateOrProvince The state or province code, maximum 3 characters. For example, **CA**
287+
* for California in the US or **ON** for Ontario in Canada. &gt; Required for the US and
288+
* Canada.
288289
* @return the current {@code DeliveryAddress} instance, allowing for method chaining
289290
*/
290291
public DeliveryAddress stateOrProvince(String stateOrProvince) {
@@ -293,11 +294,12 @@ public DeliveryAddress stateOrProvince(String stateOrProvince) {
293294
}
294295

295296
/**
296-
* The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in
297-
* Canada. &gt; Required for the US and Canada.
297+
* The state or province code, maximum 3 characters. For example, **CA** for California in the US
298+
* or **ON** for Ontario in Canada. &gt; Required for the US and Canada.
298299
*
299-
* @return stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA**
300-
* in the US or **ON** in Canada. &gt; Required for the US and Canada.
300+
* @return stateOrProvince The state or province code, maximum 3 characters. For example, **CA**
301+
* for California in the US or **ON** for Ontario in Canada. &gt; Required for the US and
302+
* Canada.
301303
*/
302304
@JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE)
303305
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
@@ -306,11 +308,12 @@ public String getStateOrProvince() {
306308
}
307309

308310
/**
309-
* The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in
310-
* Canada. &gt; Required for the US and Canada.
311+
* The state or province code, maximum 3 characters. For example, **CA** for California in the US
312+
* or **ON** for Ontario in Canada. &gt; Required for the US and Canada.
311313
*
312-
* @param stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in
313-
* the US or **ON** in Canada. &gt; Required for the US and Canada.
314+
* @param stateOrProvince The state or province code, maximum 3 characters. For example, **CA**
315+
* for California in the US or **ON** for Ontario in Canada. &gt; Required for the US and
316+
* Canada.
314317
*/
315318
@JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE)
316319
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

src/main/java/com/adyen/model/balanceplatform/TransferRouteRequirementsInner.java

Lines changed: 58 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,35 @@ public TransferRouteRequirementsInner deserialize(JsonParser jp, Deserialization
314314
e);
315315
}
316316

317+
// deserialize USInternationalAchPriorityRequirement
318+
try {
319+
boolean attemptParsing = true;
320+
if (attemptParsing) {
321+
// Checks if the unique type of the oneOf json matches any of the object TypeEnum values
322+
boolean typeMatch =
323+
Arrays.stream(USInternationalAchPriorityRequirement.TypeEnum.values())
324+
.anyMatch((t) -> t.getValue().contains(tree.findValue("type").asText()));
325+
326+
if (typeMatch) {
327+
deserialized =
328+
tree.traverse(jp.getCodec())
329+
.readValueAs(USInternationalAchPriorityRequirement.class);
330+
// TODO: there is no validation against JSON schema constraints
331+
// (min, max, enum, pattern...), this does not perform a strict JSON
332+
// validation, which means the 'match' count may be higher than it should be.
333+
match++;
334+
log.log(
335+
Level.FINER, "Input data matches schema 'USInternationalAchPriorityRequirement'");
336+
}
337+
}
338+
} catch (Exception e) {
339+
// deserialization failed, continue
340+
log.log(
341+
Level.FINER,
342+
"Input data does not match schema 'USInternationalAchPriorityRequirement'",
343+
e);
344+
}
345+
317346
if (match == 1) {
318347
TransferRouteRequirementsInner ret = new TransferRouteRequirementsInner();
319348
ret.setActualInstance(deserialized);
@@ -386,6 +415,11 @@ public TransferRouteRequirementsInner(USInternationalAchAddressRequirement o) {
386415
setActualInstance(o);
387416
}
388417

418+
public TransferRouteRequirementsInner(USInternationalAchPriorityRequirement o) {
419+
super("oneOf", Boolean.FALSE);
420+
setActualInstance(o);
421+
}
422+
389423
static {
390424
schemas.put(
391425
"AdditionalBankIdentificationRequirement",
@@ -407,6 +441,9 @@ public TransferRouteRequirementsInner(USInternationalAchAddressRequirement o) {
407441
schemas.put(
408442
"USInternationalAchAddressRequirement",
409443
new GenericType<USInternationalAchAddressRequirement>() {});
444+
schemas.put(
445+
"USInternationalAchPriorityRequirement",
446+
new GenericType<USInternationalAchPriorityRequirement>() {});
410447
JSON.registerDescendants(
411448
TransferRouteRequirementsInner.class, Collections.unmodifiableMap(schemas));
412449
}
@@ -422,7 +459,7 @@ public Map<String, GenericType<?>> getSchemas() {
422459
* AmountMinMaxRequirement, AmountNonZeroDecimalsRequirement,
423460
* BankAccountIdentificationTypeRequirement, IbanAccountIdentificationRequirement,
424461
* PaymentInstrumentRequirement, USInstantPayoutAddressRequirement,
425-
* USInternationalAchAddressRequirement
462+
* USInternationalAchAddressRequirement, USInternationalAchPriorityRequirement
426463
*
427464
* <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
428465
* composed schema (allOf, anyOf, oneOf).
@@ -476,22 +513,27 @@ public void setActualInstance(Object instance) {
476513
return;
477514
}
478515

516+
if (JSON.isInstanceOf(USInternationalAchPriorityRequirement.class, instance, new HashSet<>())) {
517+
super.setActualInstance(instance);
518+
return;
519+
}
520+
479521
throw new RuntimeException(
480-
"Invalid instance type. Must be AdditionalBankIdentificationRequirement, AddressRequirement, AmountMinMaxRequirement, AmountNonZeroDecimalsRequirement, BankAccountIdentificationTypeRequirement, IbanAccountIdentificationRequirement, PaymentInstrumentRequirement, USInstantPayoutAddressRequirement, USInternationalAchAddressRequirement");
522+
"Invalid instance type. Must be AdditionalBankIdentificationRequirement, AddressRequirement, AmountMinMaxRequirement, AmountNonZeroDecimalsRequirement, BankAccountIdentificationTypeRequirement, IbanAccountIdentificationRequirement, PaymentInstrumentRequirement, USInstantPayoutAddressRequirement, USInternationalAchAddressRequirement, USInternationalAchPriorityRequirement");
481523
}
482524

483525
/**
484526
* Get the actual instance, which can be the following: AdditionalBankIdentificationRequirement,
485527
* AddressRequirement, AmountMinMaxRequirement, AmountNonZeroDecimalsRequirement,
486528
* BankAccountIdentificationTypeRequirement, IbanAccountIdentificationRequirement,
487529
* PaymentInstrumentRequirement, USInstantPayoutAddressRequirement,
488-
* USInternationalAchAddressRequirement
530+
* USInternationalAchAddressRequirement, USInternationalAchPriorityRequirement
489531
*
490532
* @return The actual instance (AdditionalBankIdentificationRequirement, AddressRequirement,
491533
* AmountMinMaxRequirement, AmountNonZeroDecimalsRequirement,
492534
* BankAccountIdentificationTypeRequirement, IbanAccountIdentificationRequirement,
493535
* PaymentInstrumentRequirement, USInstantPayoutAddressRequirement,
494-
* USInternationalAchAddressRequirement)
536+
* USInternationalAchAddressRequirement, USInternationalAchPriorityRequirement)
495537
*/
496538
@Override
497539
public Object getActualInstance() {
@@ -603,6 +645,18 @@ public USInternationalAchAddressRequirement getUSInternationalAchAddressRequirem
603645
return (USInternationalAchAddressRequirement) super.getActualInstance();
604646
}
605647

648+
/**
649+
* Get the actual instance of `USInternationalAchPriorityRequirement`. If the actual instance is
650+
* not `USInternationalAchPriorityRequirement`, the ClassCastException will be thrown.
651+
*
652+
* @return The actual instance of `USInternationalAchPriorityRequirement`
653+
* @throws ClassCastException if the instance is not `USInternationalAchPriorityRequirement`
654+
*/
655+
public USInternationalAchPriorityRequirement getUSInternationalAchPriorityRequirement()
656+
throws ClassCastException {
657+
return (USInternationalAchPriorityRequirement) super.getActualInstance();
658+
}
659+
606660
/**
607661
* Create an instance of TransferRouteRequirementsInner given an JSON string
608662
*
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
/*
2+
* Configuration API
3+
*
4+
* The version of the OpenAPI document: 2
5+
*
6+
*
7+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8+
* https://openapi-generator.tech
9+
* Do not edit the class manually.
10+
*/
11+
12+
package com.adyen.model.balanceplatform;
13+
14+
import com.fasterxml.jackson.annotation.JsonCreator;
15+
import com.fasterxml.jackson.annotation.JsonInclude;
16+
import com.fasterxml.jackson.annotation.JsonProperty;
17+
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
18+
import com.fasterxml.jackson.annotation.JsonValue;
19+
import com.fasterxml.jackson.core.JsonProcessingException;
20+
import java.util.*;
21+
import java.util.Arrays;
22+
import java.util.logging.Logger;
23+
24+
/** USInternationalAchPriorityRequirement */
25+
@JsonPropertyOrder({
26+
USInternationalAchPriorityRequirement.JSON_PROPERTY_DESCRIPTION,
27+
USInternationalAchPriorityRequirement.JSON_PROPERTY_TYPE
28+
})
29+
public class USInternationalAchPriorityRequirement {
30+
public static final String JSON_PROPERTY_DESCRIPTION = "description";
31+
private String description;
32+
33+
/** **usInternationalAchPriorityRequirement** */
34+
public enum TypeEnum {
35+
USINTERNATIONALACHPRIORITYREQUIREMENT(String.valueOf("usInternationalAchPriorityRequirement"));
36+
37+
private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName());
38+
39+
private String value;
40+
41+
TypeEnum(String value) {
42+
this.value = value;
43+
}
44+
45+
@JsonValue
46+
public String getValue() {
47+
return value;
48+
}
49+
50+
@Override
51+
public String toString() {
52+
return String.valueOf(value);
53+
}
54+
55+
@JsonCreator
56+
public static TypeEnum fromValue(String value) {
57+
for (TypeEnum b : TypeEnum.values()) {
58+
if (b.value.equals(value)) {
59+
return b;
60+
}
61+
}
62+
// handling unexpected value
63+
LOG.warning(
64+
"TypeEnum: unexpected enum value '"
65+
+ value
66+
+ "' - Supported values are "
67+
+ Arrays.toString(TypeEnum.values()));
68+
return null;
69+
}
70+
}
71+
72+
public static final String JSON_PROPERTY_TYPE = "type";
73+
private TypeEnum type;
74+
75+
public USInternationalAchPriorityRequirement() {}
76+
77+
/**
78+
* Specifies that transactions deemed to be International ACH (IAT) per OFAC/NACHA rules cannot
79+
* have fast priority.
80+
*
81+
* @param description Specifies that transactions deemed to be International ACH (IAT) per
82+
* OFAC/NACHA rules cannot have fast priority.
83+
* @return the current {@code USInternationalAchPriorityRequirement} instance, allowing for method
84+
* chaining
85+
*/
86+
public USInternationalAchPriorityRequirement description(String description) {
87+
this.description = description;
88+
return this;
89+
}
90+
91+
/**
92+
* Specifies that transactions deemed to be International ACH (IAT) per OFAC/NACHA rules cannot
93+
* have fast priority.
94+
*
95+
* @return description Specifies that transactions deemed to be International ACH (IAT) per
96+
* OFAC/NACHA rules cannot have fast priority.
97+
*/
98+
@JsonProperty(JSON_PROPERTY_DESCRIPTION)
99+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
100+
public String getDescription() {
101+
return description;
102+
}
103+
104+
/**
105+
* Specifies that transactions deemed to be International ACH (IAT) per OFAC/NACHA rules cannot
106+
* have fast priority.
107+
*
108+
* @param description Specifies that transactions deemed to be International ACH (IAT) per
109+
* OFAC/NACHA rules cannot have fast priority.
110+
*/
111+
@JsonProperty(JSON_PROPERTY_DESCRIPTION)
112+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
113+
public void setDescription(String description) {
114+
this.description = description;
115+
}
116+
117+
/**
118+
* **usInternationalAchPriorityRequirement**
119+
*
120+
* @param type **usInternationalAchPriorityRequirement**
121+
* @return the current {@code USInternationalAchPriorityRequirement} instance, allowing for method
122+
* chaining
123+
*/
124+
public USInternationalAchPriorityRequirement type(TypeEnum type) {
125+
this.type = type;
126+
return this;
127+
}
128+
129+
/**
130+
* **usInternationalAchPriorityRequirement**
131+
*
132+
* @return type **usInternationalAchPriorityRequirement**
133+
*/
134+
@JsonProperty(JSON_PROPERTY_TYPE)
135+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
136+
public TypeEnum getType() {
137+
return type;
138+
}
139+
140+
/**
141+
* **usInternationalAchPriorityRequirement**
142+
*
143+
* @param type **usInternationalAchPriorityRequirement**
144+
*/
145+
@JsonProperty(JSON_PROPERTY_TYPE)
146+
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
147+
public void setType(TypeEnum type) {
148+
this.type = type;
149+
}
150+
151+
/** Return true if this USInternationalAchPriorityRequirement object is equal to o. */
152+
@Override
153+
public boolean equals(Object o) {
154+
if (this == o) {
155+
return true;
156+
}
157+
if (o == null || getClass() != o.getClass()) {
158+
return false;
159+
}
160+
USInternationalAchPriorityRequirement usInternationalAchPriorityRequirement =
161+
(USInternationalAchPriorityRequirement) o;
162+
return Objects.equals(this.description, usInternationalAchPriorityRequirement.description)
163+
&& Objects.equals(this.type, usInternationalAchPriorityRequirement.type);
164+
}
165+
166+
@Override
167+
public int hashCode() {
168+
return Objects.hash(description, type);
169+
}
170+
171+
@Override
172+
public String toString() {
173+
StringBuilder sb = new StringBuilder();
174+
sb.append("class USInternationalAchPriorityRequirement {\n");
175+
sb.append(" description: ").append(toIndentedString(description)).append("\n");
176+
sb.append(" type: ").append(toIndentedString(type)).append("\n");
177+
sb.append("}");
178+
return sb.toString();
179+
}
180+
181+
/**
182+
* Convert the given object to string with each line indented by 4 spaces (except the first line).
183+
*/
184+
private String toIndentedString(Object o) {
185+
if (o == null) {
186+
return "null";
187+
}
188+
return o.toString().replace("\n", "\n ");
189+
}
190+
191+
/**
192+
* Create an instance of USInternationalAchPriorityRequirement given an JSON string
193+
*
194+
* @param jsonString JSON string
195+
* @return An instance of USInternationalAchPriorityRequirement
196+
* @throws JsonProcessingException if the JSON string is invalid with respect to
197+
* USInternationalAchPriorityRequirement
198+
*/
199+
public static USInternationalAchPriorityRequirement fromJson(String jsonString)
200+
throws JsonProcessingException {
201+
return JSON.getMapper().readValue(jsonString, USInternationalAchPriorityRequirement.class);
202+
}
203+
204+
/**
205+
* Convert an instance of USInternationalAchPriorityRequirement to an JSON string
206+
*
207+
* @return JSON string
208+
*/
209+
public String toJson() throws JsonProcessingException {
210+
return JSON.getMapper().writeValueAsString(this);
211+
}
212+
}

0 commit comments

Comments
 (0)