Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,12 @@ public void setPostalCode(String postalCode) {
}

/**
* The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in
* Canada. > Required for the US and Canada.
* The state or province code, maximum 3 characters. For example, **CA** for California in the US
* or **ON** for Ontario in Canada. > Required for the US and Canada.
*
* @param stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in
* the US or **ON** in Canada. > Required for the US and Canada.
* @param stateOrProvince The state or province code, maximum 3 characters. For example, **CA**
* for California in the US or **ON** for Ontario in Canada. > Required for the US and
* Canada.
* @return the current {@code DeliveryAddress} instance, allowing for method chaining
*/
public DeliveryAddress stateOrProvince(String stateOrProvince) {
Expand All @@ -293,11 +294,12 @@ public DeliveryAddress stateOrProvince(String stateOrProvince) {
}

/**
* The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in
* Canada. > Required for the US and Canada.
* The state or province code, maximum 3 characters. For example, **CA** for California in the US
* or **ON** for Ontario in Canada. > Required for the US and Canada.
*
* @return stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA**
* in the US or **ON** in Canada. > Required for the US and Canada.
* @return stateOrProvince The state or province code, maximum 3 characters. For example, **CA**
* for California in the US or **ON** for Ontario in Canada. > Required for the US and
* Canada.
*/
@JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
Expand All @@ -306,11 +308,12 @@ public String getStateOrProvince() {
}

/**
* The two-letter ISO 3166-2 state or province code. For example, **CA** in the US or **ON** in
* Canada. > Required for the US and Canada.
* The state or province code, maximum 3 characters. For example, **CA** for California in the US
* or **ON** for Ontario in Canada. > Required for the US and Canada.
*
* @param stateOrProvince The two-letter ISO 3166-2 state or province code. For example, **CA** in
* the US or **ON** in Canada. > Required for the US and Canada.
* @param stateOrProvince The state or province code, maximum 3 characters. For example, **CA**
* for California in the US or **ON** for Ontario in Canada. > Required for the US and
* Canada.
*/
@JsonProperty(JSON_PROPERTY_STATE_OR_PROVINCE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,35 @@ public TransferRouteRequirementsInner deserialize(JsonParser jp, Deserialization
e);
}

// deserialize USInternationalAchPriorityRequirement
try {
boolean attemptParsing = true;
if (attemptParsing) {
// Checks if the unique type of the oneOf json matches any of the object TypeEnum values
boolean typeMatch =
Arrays.stream(USInternationalAchPriorityRequirement.TypeEnum.values())
.anyMatch((t) -> t.getValue().contains(tree.findValue("type").asText()));

if (typeMatch) {
deserialized =
tree.traverse(jp.getCodec())
.readValueAs(USInternationalAchPriorityRequirement.class);
// TODO: there is no validation against JSON schema constraints
// (min, max, enum, pattern...), this does not perform a strict JSON
// validation, which means the 'match' count may be higher than it should be.
match++;
log.log(
Level.FINER, "Input data matches schema 'USInternationalAchPriorityRequirement'");
}
}
} catch (Exception e) {
// deserialization failed, continue
log.log(
Level.FINER,
"Input data does not match schema 'USInternationalAchPriorityRequirement'",
e);
}

if (match == 1) {
TransferRouteRequirementsInner ret = new TransferRouteRequirementsInner();
ret.setActualInstance(deserialized);
Expand Down Expand Up @@ -386,6 +415,11 @@ public TransferRouteRequirementsInner(USInternationalAchAddressRequirement o) {
setActualInstance(o);
}

public TransferRouteRequirementsInner(USInternationalAchPriorityRequirement o) {
super("oneOf", Boolean.FALSE);
setActualInstance(o);
}

static {
schemas.put(
"AdditionalBankIdentificationRequirement",
Expand All @@ -407,6 +441,9 @@ public TransferRouteRequirementsInner(USInternationalAchAddressRequirement o) {
schemas.put(
"USInternationalAchAddressRequirement",
new GenericType<USInternationalAchAddressRequirement>() {});
schemas.put(
"USInternationalAchPriorityRequirement",
new GenericType<USInternationalAchPriorityRequirement>() {});
JSON.registerDescendants(
TransferRouteRequirementsInner.class, Collections.unmodifiableMap(schemas));
}
Expand All @@ -422,7 +459,7 @@ public Map<String, GenericType<?>> getSchemas() {
* AmountMinMaxRequirement, AmountNonZeroDecimalsRequirement,
* BankAccountIdentificationTypeRequirement, IbanAccountIdentificationRequirement,
* PaymentInstrumentRequirement, USInstantPayoutAddressRequirement,
* USInternationalAchAddressRequirement
* USInternationalAchAddressRequirement, USInternationalAchPriorityRequirement
*
* <p>It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a
* composed schema (allOf, anyOf, oneOf).
Expand Down Expand Up @@ -476,22 +513,27 @@ public void setActualInstance(Object instance) {
return;
}

if (JSON.isInstanceOf(USInternationalAchPriorityRequirement.class, instance, new HashSet<>())) {
super.setActualInstance(instance);
return;
}

throw new RuntimeException(
"Invalid instance type. Must be AdditionalBankIdentificationRequirement, AddressRequirement, AmountMinMaxRequirement, AmountNonZeroDecimalsRequirement, BankAccountIdentificationTypeRequirement, IbanAccountIdentificationRequirement, PaymentInstrumentRequirement, USInstantPayoutAddressRequirement, USInternationalAchAddressRequirement");
"Invalid instance type. Must be AdditionalBankIdentificationRequirement, AddressRequirement, AmountMinMaxRequirement, AmountNonZeroDecimalsRequirement, BankAccountIdentificationTypeRequirement, IbanAccountIdentificationRequirement, PaymentInstrumentRequirement, USInstantPayoutAddressRequirement, USInternationalAchAddressRequirement, USInternationalAchPriorityRequirement");
}

/**
* Get the actual instance, which can be the following: AdditionalBankIdentificationRequirement,
* AddressRequirement, AmountMinMaxRequirement, AmountNonZeroDecimalsRequirement,
* BankAccountIdentificationTypeRequirement, IbanAccountIdentificationRequirement,
* PaymentInstrumentRequirement, USInstantPayoutAddressRequirement,
* USInternationalAchAddressRequirement
* USInternationalAchAddressRequirement, USInternationalAchPriorityRequirement
*
* @return The actual instance (AdditionalBankIdentificationRequirement, AddressRequirement,
* AmountMinMaxRequirement, AmountNonZeroDecimalsRequirement,
* BankAccountIdentificationTypeRequirement, IbanAccountIdentificationRequirement,
* PaymentInstrumentRequirement, USInstantPayoutAddressRequirement,
* USInternationalAchAddressRequirement)
* USInternationalAchAddressRequirement, USInternationalAchPriorityRequirement)
*/
@Override
public Object getActualInstance() {
Expand Down Expand Up @@ -603,6 +645,18 @@ public USInternationalAchAddressRequirement getUSInternationalAchAddressRequirem
return (USInternationalAchAddressRequirement) super.getActualInstance();
}

/**
* Get the actual instance of `USInternationalAchPriorityRequirement`. If the actual instance is
* not `USInternationalAchPriorityRequirement`, the ClassCastException will be thrown.
*
* @return The actual instance of `USInternationalAchPriorityRequirement`
* @throws ClassCastException if the instance is not `USInternationalAchPriorityRequirement`
*/
public USInternationalAchPriorityRequirement getUSInternationalAchPriorityRequirement()
throws ClassCastException {
return (USInternationalAchPriorityRequirement) super.getActualInstance();
}

/**
* Create an instance of TransferRouteRequirementsInner given an JSON string
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
/*
* Configuration API
*
* The version of the OpenAPI document: 2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/

package com.adyen.model.balanceplatform;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.util.*;
import java.util.Arrays;
import java.util.logging.Logger;

/** USInternationalAchPriorityRequirement */
@JsonPropertyOrder({
USInternationalAchPriorityRequirement.JSON_PROPERTY_DESCRIPTION,
USInternationalAchPriorityRequirement.JSON_PROPERTY_TYPE
})
public class USInternationalAchPriorityRequirement {
public static final String JSON_PROPERTY_DESCRIPTION = "description";
private String description;

/** **usInternationalAchPriorityRequirement** */
public enum TypeEnum {
USINTERNATIONALACHPRIORITYREQUIREMENT(String.valueOf("usInternationalAchPriorityRequirement"));

private static final Logger LOG = Logger.getLogger(TypeEnum.class.getName());

private String value;

TypeEnum(String value) {
this.value = value;
}

@JsonValue
public String getValue() {
return value;
}

@Override
public String toString() {
return String.valueOf(value);
}

@JsonCreator
public static TypeEnum fromValue(String value) {
for (TypeEnum b : TypeEnum.values()) {
if (b.value.equals(value)) {
return b;
}
}
// handling unexpected value
LOG.warning(
"TypeEnum: unexpected enum value '"
+ value
+ "' - Supported values are "
+ Arrays.toString(TypeEnum.values()));
return null;
}
}

public static final String JSON_PROPERTY_TYPE = "type";
private TypeEnum type;

public USInternationalAchPriorityRequirement() {}

/**
* Specifies that transactions deemed to be International ACH (IAT) per OFAC/NACHA rules cannot
* have fast priority.
*
* @param description Specifies that transactions deemed to be International ACH (IAT) per
* OFAC/NACHA rules cannot have fast priority.
* @return the current {@code USInternationalAchPriorityRequirement} instance, allowing for method
* chaining
*/
public USInternationalAchPriorityRequirement description(String description) {
this.description = description;
return this;
}

/**
* Specifies that transactions deemed to be International ACH (IAT) per OFAC/NACHA rules cannot
* have fast priority.
*
* @return description Specifies that transactions deemed to be International ACH (IAT) per
* OFAC/NACHA rules cannot have fast priority.
*/
@JsonProperty(JSON_PROPERTY_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getDescription() {
return description;
}

/**
* Specifies that transactions deemed to be International ACH (IAT) per OFAC/NACHA rules cannot
* have fast priority.
*
* @param description Specifies that transactions deemed to be International ACH (IAT) per
* OFAC/NACHA rules cannot have fast priority.
*/
@JsonProperty(JSON_PROPERTY_DESCRIPTION)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDescription(String description) {
this.description = description;
}

/**
* **usInternationalAchPriorityRequirement**
*
* @param type **usInternationalAchPriorityRequirement**
* @return the current {@code USInternationalAchPriorityRequirement} instance, allowing for method
* chaining
*/
public USInternationalAchPriorityRequirement type(TypeEnum type) {
this.type = type;
return this;
}

/**
* **usInternationalAchPriorityRequirement**
*
* @return type **usInternationalAchPriorityRequirement**
*/
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public TypeEnum getType() {
return type;
}

/**
* **usInternationalAchPriorityRequirement**
*
* @param type **usInternationalAchPriorityRequirement**
*/
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setType(TypeEnum type) {
this.type = type;
}

/** Return true if this USInternationalAchPriorityRequirement object is equal to o. */
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
USInternationalAchPriorityRequirement usInternationalAchPriorityRequirement =
(USInternationalAchPriorityRequirement) o;
return Objects.equals(this.description, usInternationalAchPriorityRequirement.description)
&& Objects.equals(this.type, usInternationalAchPriorityRequirement.type);
}

@Override
public int hashCode() {
return Objects.hash(description, type);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class USInternationalAchPriorityRequirement {\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append("}");
return sb.toString();
}

/**
* Convert the given object to string with each line indented by 4 spaces (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}

/**
* Create an instance of USInternationalAchPriorityRequirement given an JSON string
*
* @param jsonString JSON string
* @return An instance of USInternationalAchPriorityRequirement
* @throws JsonProcessingException if the JSON string is invalid with respect to
* USInternationalAchPriorityRequirement
*/
public static USInternationalAchPriorityRequirement fromJson(String jsonString)
throws JsonProcessingException {
return JSON.getMapper().readValue(jsonString, USInternationalAchPriorityRequirement.class);
}

/**
* Convert an instance of USInternationalAchPriorityRequirement to an JSON string
*
* @return JSON string
*/
public String toJson() throws JsonProcessingException {
return JSON.getMapper().writeValueAsString(this);
}
}
Loading