diff --git a/sdk-generation-log/softposconfiguration.json b/sdk-generation-log/softposconfiguration.json new file mode 100644 index 000000000..46635f509 --- /dev/null +++ b/sdk-generation-log/softposconfiguration.json @@ -0,0 +1,8 @@ +{ + "service": "softposconfiguration", + "project": "java", + "generatedAt": "2026-11-09T15:34:20Z", + "openapiCommitSha": "d449f090b9a4842b63b562cd057fe12dfbf4bcad", + "automationCommitSha": "ae7e57613c3a29391a4adb4ff02e9ddda4611b16", + "libraryCommitSha": "a0311148dd88e802816e5e63c9cea41df2276cd3" +} diff --git a/src/main/java/com/adyen/model/softposconfiguration/AbstractOpenApiSchema.java b/src/main/java/com/adyen/model/softposconfiguration/AbstractOpenApiSchema.java new file mode 100644 index 000000000..b62a1ca72 --- /dev/null +++ b/src/main/java/com/adyen/model/softposconfiguration/AbstractOpenApiSchema.java @@ -0,0 +1,142 @@ +/* + * SoftPOS configuration API + * + * The version of the OpenAPI document: 3 + * + * + * 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.softposconfiguration; + +import com.fasterxml.jackson.annotation.JsonValue; +import jakarta.ws.rs.core.GenericType; +import java.util.Map; +import java.util.Objects; + +/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */ +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + /** + * @param schemaType the schema type + * @param isNullable whether the instance is nullable + */ + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + @JsonValue + public Object getActualInstance() { + return instance; + } + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) { + this.instance = instance; + } + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf + * schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema) object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 "); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) + && Objects.equals(this.isNullable, a.isNullable) + && Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + return Boolean.TRUE.equals(isNullable); + } +} diff --git a/src/main/java/com/adyen/model/softposconfiguration/CertificateLoadingRequest.java b/src/main/java/com/adyen/model/softposconfiguration/CertificateLoadingRequest.java new file mode 100644 index 000000000..014ffeedc --- /dev/null +++ b/src/main/java/com/adyen/model/softposconfiguration/CertificateLoadingRequest.java @@ -0,0 +1,374 @@ +/* + * SoftPOS configuration API + * + * The version of the OpenAPI document: 3 + * + * + * 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.softposconfiguration; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CertificateLoadingRequest */ +@JsonPropertyOrder({ + CertificateLoadingRequest.JSON_PROPERTY_MERCHANT_ACCOUNT, + CertificateLoadingRequest.JSON_PROPERTY_SETUP_TOKEN, + CertificateLoadingRequest.JSON_PROPERTY_STORE, + CertificateLoadingRequest.JSON_PROPERTY_SUB_MERCHANT_DATA +}) +public class CertificateLoadingRequest { + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; + private String merchantAccount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + + public static final String JSON_PROPERTY_SETUP_TOKEN = "setupToken"; + private String setupToken; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSetupToken = false; + + public static final String JSON_PROPERTY_STORE = "store"; + private String store; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + public static final String JSON_PROPERTY_SUB_MERCHANT_DATA = "subMerchantData"; + private SubMerchantData subMerchantData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSubMerchantData = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CertificateLoadingRequest() {} + + /** + * The unique identifier of your merchant account. + * + * @param merchantAccount The unique identifier of your merchant account. + * @return the current {@code CertificateLoadingRequest} instance, allowing for method chaining + */ + public CertificateLoadingRequest merchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set + return this; + } + + /** + * The unique identifier of your merchant account. + * + * @return merchantAccount The unique identifier of your merchant account. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMerchantAccount() { + return merchantAccount; + } + + /** + * The unique identifier of your merchant account. + * + * @param merchantAccount The unique identifier of your merchant account. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set + } + + /** + * The setup token provided by the SDK in a Mobile solution for in-person payments. - When using + * the Android SDK, obtain the token through the + * `MerchantAuthenticationService.authenticate(setupToken)` callback of + * `AuthenticationService`. - When using the iOS SDK, obtain the token through the + * `PaymentServiceDelegate.register(with:)` callback of + * `PaymentServiceDelegate`. + * + * @param setupToken The setup token provided by the SDK in a Mobile solution for in-person + * payments. - When using the Android SDK, obtain the token through the + * `MerchantAuthenticationService.authenticate(setupToken)` callback of + * `AuthenticationService`. - When using the iOS SDK, obtain the token through the + * `PaymentServiceDelegate.register(with:)` callback of + * `PaymentServiceDelegate`. + * @return the current {@code CertificateLoadingRequest} instance, allowing for method chaining + */ + public CertificateLoadingRequest setupToken(String setupToken) { + this.setupToken = setupToken; + isSetSetupToken = true; // mark as set + return this; + } + + /** + * The setup token provided by the SDK in a Mobile solution for in-person payments. - When using + * the Android SDK, obtain the token through the + * `MerchantAuthenticationService.authenticate(setupToken)` callback of + * `AuthenticationService`. - When using the iOS SDK, obtain the token through the + * `PaymentServiceDelegate.register(with:)` callback of + * `PaymentServiceDelegate`. + * + * @return setupToken The setup token provided by the SDK in a Mobile solution for in-person + * payments. - When using the Android SDK, obtain the token through the + * `MerchantAuthenticationService.authenticate(setupToken)` callback of + * `AuthenticationService`. - When using the iOS SDK, obtain the token through the + * `PaymentServiceDelegate.register(with:)` callback of + * `PaymentServiceDelegate`. + */ + @JsonProperty(JSON_PROPERTY_SETUP_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSetupToken() { + return setupToken; + } + + /** + * The setup token provided by the SDK in a Mobile solution for in-person payments. - When using + * the Android SDK, obtain the token through the + * `MerchantAuthenticationService.authenticate(setupToken)` callback of + * `AuthenticationService`. - When using the iOS SDK, obtain the token through the + * `PaymentServiceDelegate.register(with:)` callback of + * `PaymentServiceDelegate`. + * + * @param setupToken The setup token provided by the SDK in a Mobile solution for in-person + * payments. - When using the Android SDK, obtain the token through the + * `MerchantAuthenticationService.authenticate(setupToken)` callback of + * `AuthenticationService`. - When using the iOS SDK, obtain the token through the + * `PaymentServiceDelegate.register(with:)` callback of + * `PaymentServiceDelegate`. + */ + @JsonProperty(JSON_PROPERTY_SETUP_TOKEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSetupToken(String setupToken) { + this.setupToken = setupToken; + isSetSetupToken = true; // mark as set + } + + /** + * The reference of the store that you want to process transactions for. Do not include this + * parameter if your account structure uses merchant accounts as stores, or if you are a + * registered payment facilitator. + * + * @param store The reference of the store that you want to process transactions for. Do not + * include this parameter if your account structure uses merchant accounts as stores, or if + * you are a registered payment facilitator. + * @return the current {@code CertificateLoadingRequest} instance, allowing for method chaining + */ + public CertificateLoadingRequest store(String store) { + this.store = store; + isSetStore = true; // mark as set + return this; + } + + /** + * The reference of the store that you want to process transactions for. Do not include this + * parameter if your account structure uses merchant accounts as stores, or if you are a + * registered payment facilitator. + * + * @return store The reference of the store that you want to process transactions for. Do not + * include this parameter if your account structure uses merchant accounts as stores, or if + * you are a registered payment facilitator. + */ + @JsonProperty(JSON_PROPERTY_STORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStore() { + return store; + } + + /** + * The reference of the store that you want to process transactions for. Do not include this + * parameter if your account structure uses merchant accounts as stores, or if you are a + * registered payment facilitator. + * + * @param store The reference of the store that you want to process transactions for. Do not + * include this parameter if your account structure uses merchant accounts as stores, or if + * you are a registered payment facilitator. + */ + @JsonProperty(JSON_PROPERTY_STORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStore(String store) { + this.store = store; + isSetStore = true; // mark as set + } + + /** + * subMerchantData + * + * @param subMerchantData + * @return the current {@code CertificateLoadingRequest} instance, allowing for method chaining + */ + public CertificateLoadingRequest subMerchantData(SubMerchantData subMerchantData) { + this.subMerchantData = subMerchantData; + isSetSubMerchantData = true; // mark as set + return this; + } + + /** + * Get subMerchantData + * + * @return subMerchantData + */ + @JsonProperty(JSON_PROPERTY_SUB_MERCHANT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SubMerchantData getSubMerchantData() { + return subMerchantData; + } + + /** + * subMerchantData + * + * @param subMerchantData + */ + @JsonProperty(JSON_PROPERTY_SUB_MERCHANT_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSubMerchantData(SubMerchantData subMerchantData) { + this.subMerchantData = subMerchantData; + isSetSubMerchantData = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CertificateLoadingRequest includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CertificateLoadingRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CertificateLoadingRequest certificateLoadingRequest = (CertificateLoadingRequest) o; + return Objects.equals(this.merchantAccount, certificateLoadingRequest.merchantAccount) + && Objects.equals(this.isSetMerchantAccount, certificateLoadingRequest.isSetMerchantAccount) + && Objects.equals(this.setupToken, certificateLoadingRequest.setupToken) + && Objects.equals(this.isSetSetupToken, certificateLoadingRequest.isSetSetupToken) + && Objects.equals(this.store, certificateLoadingRequest.store) + && Objects.equals(this.isSetStore, certificateLoadingRequest.isSetStore) + && Objects.equals(this.subMerchantData, certificateLoadingRequest.subMerchantData) + && Objects.equals( + this.isSetSubMerchantData, certificateLoadingRequest.isSetSubMerchantData); + } + + @Override + public int hashCode() { + return Objects.hash( + merchantAccount, + isSetMerchantAccount, + setupToken, + isSetSetupToken, + store, + isSetStore, + subMerchantData, + isSetSubMerchantData); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CertificateLoadingRequest {\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" setupToken: ").append(toIndentedString(setupToken)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).append("\n"); + sb.append(" subMerchantData: ").append(toIndentedString(subMerchantData)).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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetSetupToken) { + addIfNull(nulls, JSON_PROPERTY_SETUP_TOKEN, this.setupToken); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + if (isSetSubMerchantData) { + addIfNull(nulls, JSON_PROPERTY_SUB_MERCHANT_DATA, this.subMerchantData); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CertificateLoadingRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CertificateLoadingRequest + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CertificateLoadingRequest + */ + public static CertificateLoadingRequest fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CertificateLoadingRequest.class); + } + + /** + * Convert an instance of CertificateLoadingRequest to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/softposconfiguration/CertificateLoadingResponse.java b/src/main/java/com/adyen/model/softposconfiguration/CertificateLoadingResponse.java new file mode 100644 index 000000000..5b568ff0f --- /dev/null +++ b/src/main/java/com/adyen/model/softposconfiguration/CertificateLoadingResponse.java @@ -0,0 +1,406 @@ +/* + * SoftPOS configuration API + * + * The version of the OpenAPI document: 3 + * + * + * 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.softposconfiguration; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** CertificateLoadingResponse */ +@JsonPropertyOrder({ + CertificateLoadingResponse.JSON_PROPERTY_ID, + CertificateLoadingResponse.JSON_PROPERTY_INSTALLATION_ID, + CertificateLoadingResponse.JSON_PROPERTY_MERCHANT_ACCOUNT, + CertificateLoadingResponse.JSON_PROPERTY_SDK_DATA, + CertificateLoadingResponse.JSON_PROPERTY_STORE +}) +public class CertificateLoadingResponse { + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_INSTALLATION_ID = "installationId"; + private String installationId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstallationId = false; + + public static final String JSON_PROPERTY_MERCHANT_ACCOUNT = "merchantAccount"; + private String merchantAccount; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMerchantAccount = false; + + public static final String JSON_PROPERTY_SDK_DATA = "sdkData"; + private String sdkData; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetSdkData = false; + + public static final String JSON_PROPERTY_STORE = "store"; + private String store; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStore = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public CertificateLoadingResponse() {} + + /** + * The unique identifier of the communication session. + * + * @param id The unique identifier of the communication session. + * @return the current {@code CertificateLoadingResponse} instance, allowing for method chaining + */ + public CertificateLoadingResponse id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * The unique identifier of the communication session. + * + * @return id The unique identifier of the communication session. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * The unique identifier of the communication session. + * + * @param id The unique identifier of the communication session. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * The unique identifier of the SDK installation. If you create the [Terminal + * API](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/) transaction + * request on your backend, use this as the `POIID` in the `MessageHeader` of + * the request. + * + * @param installationId The unique identifier of the SDK installation. If you create the + * [Terminal API](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/) + * transaction request on your backend, use this as the `POIID` in the + * `MessageHeader` of the request. + * @return the current {@code CertificateLoadingResponse} instance, allowing for method chaining + */ + public CertificateLoadingResponse installationId(String installationId) { + this.installationId = installationId; + isSetInstallationId = true; // mark as set + return this; + } + + /** + * The unique identifier of the SDK installation. If you create the [Terminal + * API](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/) transaction + * request on your backend, use this as the `POIID` in the `MessageHeader` of + * the request. + * + * @return installationId The unique identifier of the SDK installation. If you create the + * [Terminal API](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/) + * transaction request on your backend, use this as the `POIID` in the + * `MessageHeader` of the request. + */ + @JsonProperty(JSON_PROPERTY_INSTALLATION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstallationId() { + return installationId; + } + + /** + * The unique identifier of the SDK installation. If you create the [Terminal + * API](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/) transaction + * request on your backend, use this as the `POIID` in the `MessageHeader` of + * the request. + * + * @param installationId The unique identifier of the SDK installation. If you create the + * [Terminal API](https://docs.adyen.com/point-of-sale/design-your-integration/terminal-api/) + * transaction request on your backend, use this as the `POIID` in the + * `MessageHeader` of the request. + */ + @JsonProperty(JSON_PROPERTY_INSTALLATION_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstallationId(String installationId) { + this.installationId = installationId; + isSetInstallationId = true; // mark as set + } + + /** + * The unique identifier of your merchant account. + * + * @param merchantAccount The unique identifier of your merchant account. + * @return the current {@code CertificateLoadingResponse} instance, allowing for method chaining + */ + public CertificateLoadingResponse merchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set + return this; + } + + /** + * The unique identifier of your merchant account. + * + * @return merchantAccount The unique identifier of your merchant account. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMerchantAccount() { + return merchantAccount; + } + + /** + * The unique identifier of your merchant account. + * + * @param merchantAccount The unique identifier of your merchant account. + */ + @JsonProperty(JSON_PROPERTY_MERCHANT_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMerchantAccount(String merchantAccount) { + this.merchantAccount = merchantAccount; + isSetMerchantAccount = true; // mark as set + } + + /** + * The data that the SDK uses to authenticate responses from the Adyen payments platform. Pass + * this value to your POS app. + * + * @param sdkData The data that the SDK uses to authenticate responses from the Adyen payments + * platform. Pass this value to your POS app. + * @return the current {@code CertificateLoadingResponse} instance, allowing for method chaining + */ + public CertificateLoadingResponse sdkData(String sdkData) { + this.sdkData = sdkData; + isSetSdkData = true; // mark as set + return this; + } + + /** + * The data that the SDK uses to authenticate responses from the Adyen payments platform. Pass + * this value to your POS app. + * + * @return sdkData The data that the SDK uses to authenticate responses from the Adyen payments + * platform. Pass this value to your POS app. + */ + @JsonProperty(JSON_PROPERTY_SDK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSdkData() { + return sdkData; + } + + /** + * The data that the SDK uses to authenticate responses from the Adyen payments platform. Pass + * this value to your POS app. + * + * @param sdkData The data that the SDK uses to authenticate responses from the Adyen payments + * platform. Pass this value to your POS app. + */ + @JsonProperty(JSON_PROPERTY_SDK_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setSdkData(String sdkData) { + this.sdkData = sdkData; + isSetSdkData = true; // mark as set + } + + /** + * The reference of the store that the transactions are processed for. + * + * @param store The reference of the store that the transactions are processed for. + * @return the current {@code CertificateLoadingResponse} instance, allowing for method chaining + */ + public CertificateLoadingResponse store(String store) { + this.store = store; + isSetStore = true; // mark as set + return this; + } + + /** + * The reference of the store that the transactions are processed for. + * + * @return store The reference of the store that the transactions are processed for. + */ + @JsonProperty(JSON_PROPERTY_STORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStore() { + return store; + } + + /** + * The reference of the store that the transactions are processed for. + * + * @param store The reference of the store that the transactions are processed for. + */ + @JsonProperty(JSON_PROPERTY_STORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStore(String store) { + this.store = store; + isSetStore = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public CertificateLoadingResponse includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this CertificateLoadingResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CertificateLoadingResponse certificateLoadingResponse = (CertificateLoadingResponse) o; + return Objects.equals(this.id, certificateLoadingResponse.id) + && Objects.equals(this.isSetId, certificateLoadingResponse.isSetId) + && Objects.equals(this.installationId, certificateLoadingResponse.installationId) + && Objects.equals(this.isSetInstallationId, certificateLoadingResponse.isSetInstallationId) + && Objects.equals(this.merchantAccount, certificateLoadingResponse.merchantAccount) + && Objects.equals( + this.isSetMerchantAccount, certificateLoadingResponse.isSetMerchantAccount) + && Objects.equals(this.sdkData, certificateLoadingResponse.sdkData) + && Objects.equals(this.isSetSdkData, certificateLoadingResponse.isSetSdkData) + && Objects.equals(this.store, certificateLoadingResponse.store) + && Objects.equals(this.isSetStore, certificateLoadingResponse.isSetStore); + } + + @Override + public int hashCode() { + return Objects.hash( + id, + isSetId, + installationId, + isSetInstallationId, + merchantAccount, + isSetMerchantAccount, + sdkData, + isSetSdkData, + store, + isSetStore); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CertificateLoadingResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" installationId: ").append(toIndentedString(installationId)).append("\n"); + sb.append(" merchantAccount: ").append(toIndentedString(merchantAccount)).append("\n"); + sb.append(" sdkData: ").append(toIndentedString(sdkData)).append("\n"); + sb.append(" store: ").append(toIndentedString(store)).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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetInstallationId) { + addIfNull(nulls, JSON_PROPERTY_INSTALLATION_ID, this.installationId); + } + if (isSetMerchantAccount) { + addIfNull(nulls, JSON_PROPERTY_MERCHANT_ACCOUNT, this.merchantAccount); + } + if (isSetSdkData) { + addIfNull(nulls, JSON_PROPERTY_SDK_DATA, this.sdkData); + } + if (isSetStore) { + addIfNull(nulls, JSON_PROPERTY_STORE, this.store); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of CertificateLoadingResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CertificateLoadingResponse + * @throws JsonProcessingException if the JSON string is invalid with respect to + * CertificateLoadingResponse + */ + public static CertificateLoadingResponse fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, CertificateLoadingResponse.class); + } + + /** + * Convert an instance of CertificateLoadingResponse to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/softposconfiguration/DefaultErrorResponseEntity.java b/src/main/java/com/adyen/model/softposconfiguration/DefaultErrorResponseEntity.java new file mode 100644 index 000000000..0d318f637 --- /dev/null +++ b/src/main/java/com/adyen/model/softposconfiguration/DefaultErrorResponseEntity.java @@ -0,0 +1,547 @@ +/* + * SoftPOS configuration API + * + * The version of the OpenAPI document: 3 + * + * + * 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.softposconfiguration; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; +import java.util.ArrayList; +import java.util.List; + +/** Standardized error response following RFC-7807 format */ +@JsonPropertyOrder({ + DefaultErrorResponseEntity.JSON_PROPERTY_DETAIL, + DefaultErrorResponseEntity.JSON_PROPERTY_ERROR_CODE, + DefaultErrorResponseEntity.JSON_PROPERTY_INSTANCE, + DefaultErrorResponseEntity.JSON_PROPERTY_INVALID_FIELDS, + DefaultErrorResponseEntity.JSON_PROPERTY_REQUEST_ID, + DefaultErrorResponseEntity.JSON_PROPERTY_STATUS, + DefaultErrorResponseEntity.JSON_PROPERTY_TITLE, + DefaultErrorResponseEntity.JSON_PROPERTY_TYPE +}) +public class DefaultErrorResponseEntity { + public static final String JSON_PROPERTY_DETAIL = "detail"; + private String detail; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDetail = false; + + public static final String JSON_PROPERTY_ERROR_CODE = "errorCode"; + private String errorCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetErrorCode = false; + + public static final String JSON_PROPERTY_INSTANCE = "instance"; + private String instance; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInstance = false; + + public static final String JSON_PROPERTY_INVALID_FIELDS = "invalidFields"; + private List invalidFields; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetInvalidFields = false; + + public static final String JSON_PROPERTY_REQUEST_ID = "requestId"; + private String requestId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetRequestId = false; + + public static final String JSON_PROPERTY_STATUS = "status"; + private Integer status; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStatus = false; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTitle = false; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetType = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public DefaultErrorResponseEntity() {} + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @param detail A human-readable explanation specific to this occurrence of the problem. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity detail(String detail) { + this.detail = detail; + isSetDetail = true; // mark as set + return this; + } + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @return detail A human-readable explanation specific to this occurrence of the problem. + */ + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDetail() { + return detail; + } + + /** + * A human-readable explanation specific to this occurrence of the problem. + * + * @param detail A human-readable explanation specific to this occurrence of the problem. + */ + @JsonProperty(JSON_PROPERTY_DETAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDetail(String detail) { + this.detail = detail; + isSetDetail = true; // mark as set + } + + /** + * Unique business error code. + * + * @param errorCode Unique business error code. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity errorCode(String errorCode) { + this.errorCode = errorCode; + isSetErrorCode = true; // mark as set + return this; + } + + /** + * Unique business error code. + * + * @return errorCode Unique business error code. + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getErrorCode() { + return errorCode; + } + + /** + * Unique business error code. + * + * @param errorCode Unique business error code. + */ + @JsonProperty(JSON_PROPERTY_ERROR_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setErrorCode(String errorCode) { + this.errorCode = errorCode; + isSetErrorCode = true; // mark as set + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @param instance A URI that identifies the specific occurrence of the problem if applicable. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity instance(String instance) { + this.instance = instance; + isSetInstance = true; // mark as set + return this; + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @return instance A URI that identifies the specific occurrence of the problem if applicable. + */ + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getInstance() { + return instance; + } + + /** + * A URI that identifies the specific occurrence of the problem if applicable. + * + * @param instance A URI that identifies the specific occurrence of the problem if applicable. + */ + @JsonProperty(JSON_PROPERTY_INSTANCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInstance(String instance) { + this.instance = instance; + isSetInstance = true; // mark as set + } + + /** + * Array of fields with validation errors when applicable. + * + * @param invalidFields Array of fields with validation errors when applicable. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity invalidFields(List invalidFields) { + this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set + return this; + } + + public DefaultErrorResponseEntity addInvalidFieldsItem(InvalidField invalidFieldsItem) { + if (this.invalidFields == null) { + this.invalidFields = new ArrayList<>(); + } + this.invalidFields.add(invalidFieldsItem); + return this; + } + + /** + * Array of fields with validation errors when applicable. + * + * @return invalidFields Array of fields with validation errors when applicable. + */ + @JsonProperty(JSON_PROPERTY_INVALID_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getInvalidFields() { + return invalidFields; + } + + /** + * Array of fields with validation errors when applicable. + * + * @param invalidFields Array of fields with validation errors when applicable. + */ + @JsonProperty(JSON_PROPERTY_INVALID_FIELDS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setInvalidFields(List invalidFields) { + this.invalidFields = invalidFields; + isSetInvalidFields = true; // mark as set + } + + /** + * The unique reference for the request. + * + * @param requestId The unique reference for the request. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity requestId(String requestId) { + this.requestId = requestId; + isSetRequestId = true; // mark as set + return this; + } + + /** + * The unique reference for the request. + * + * @return requestId The unique reference for the request. + */ + @JsonProperty(JSON_PROPERTY_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getRequestId() { + return requestId; + } + + /** + * The unique reference for the request. + * + * @param requestId The unique reference for the request. + */ + @JsonProperty(JSON_PROPERTY_REQUEST_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setRequestId(String requestId) { + this.requestId = requestId; + isSetRequestId = true; // mark as set + } + + /** + * The HTTP status code. + * + * @param status The HTTP status code. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity status(Integer status) { + this.status = status; + isSetStatus = true; // mark as set + return this; + } + + /** + * The HTTP status code. + * + * @return status The HTTP status code. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getStatus() { + return status; + } + + /** + * The HTTP status code. + * + * @param status The HTTP status code. + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStatus(Integer status) { + this.status = status; + isSetStatus = true; // mark as set + } + + /** + * A short, human-readable summary of the problem type. + * + * @param title A short, human-readable summary of the problem type. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity title(String title) { + this.title = title; + isSetTitle = true; // mark as set + return this; + } + + /** + * A short, human-readable summary of the problem type. + * + * @return title A short, human-readable summary of the problem type. + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + /** + * A short, human-readable summary of the problem type. + * + * @param title A short, human-readable summary of the problem type. + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTitle(String title) { + this.title = title; + isSetTitle = true; // mark as set + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @param type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + * @return the current {@code DefaultErrorResponseEntity} instance, allowing for method chaining + */ + public DefaultErrorResponseEntity type(String type) { + this.type = type; + isSetType = true; // mark as set + return this; + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @return type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + /** + * A URI that identifies the validation error type. It points to human-readable documentation for + * the problem type. + * + * @param type A URI that identifies the validation error type. It points to human-readable + * documentation for the problem type. + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setType(String type) { + this.type = type; + isSetType = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public DefaultErrorResponseEntity includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this DefaultErrorResponseEntity object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultErrorResponseEntity defaultErrorResponseEntity = (DefaultErrorResponseEntity) o; + return Objects.equals(this.detail, defaultErrorResponseEntity.detail) + && Objects.equals(this.isSetDetail, defaultErrorResponseEntity.isSetDetail) + && Objects.equals(this.errorCode, defaultErrorResponseEntity.errorCode) + && Objects.equals(this.isSetErrorCode, defaultErrorResponseEntity.isSetErrorCode) + && Objects.equals(this.instance, defaultErrorResponseEntity.instance) + && Objects.equals(this.isSetInstance, defaultErrorResponseEntity.isSetInstance) + && Objects.equals(this.invalidFields, defaultErrorResponseEntity.invalidFields) + && Objects.equals(this.isSetInvalidFields, defaultErrorResponseEntity.isSetInvalidFields) + && Objects.equals(this.requestId, defaultErrorResponseEntity.requestId) + && Objects.equals(this.isSetRequestId, defaultErrorResponseEntity.isSetRequestId) + && Objects.equals(this.status, defaultErrorResponseEntity.status) + && Objects.equals(this.isSetStatus, defaultErrorResponseEntity.isSetStatus) + && Objects.equals(this.title, defaultErrorResponseEntity.title) + && Objects.equals(this.isSetTitle, defaultErrorResponseEntity.isSetTitle) + && Objects.equals(this.type, defaultErrorResponseEntity.type) + && Objects.equals(this.isSetType, defaultErrorResponseEntity.isSetType); + } + + @Override + public int hashCode() { + return Objects.hash( + detail, + isSetDetail, + errorCode, + isSetErrorCode, + instance, + isSetInstance, + invalidFields, + isSetInvalidFields, + requestId, + isSetRequestId, + status, + isSetStatus, + title, + isSetTitle, + type, + isSetType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultErrorResponseEntity {\n"); + sb.append(" detail: ").append(toIndentedString(detail)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" invalidFields: ").append(toIndentedString(invalidFields)).append("\n"); + sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetDetail) { + addIfNull(nulls, JSON_PROPERTY_DETAIL, this.detail); + } + if (isSetErrorCode) { + addIfNull(nulls, JSON_PROPERTY_ERROR_CODE, this.errorCode); + } + if (isSetInstance) { + addIfNull(nulls, JSON_PROPERTY_INSTANCE, this.instance); + } + if (isSetInvalidFields) { + addIfNull(nulls, JSON_PROPERTY_INVALID_FIELDS, this.invalidFields); + } + if (isSetRequestId) { + addIfNull(nulls, JSON_PROPERTY_REQUEST_ID, this.requestId); + } + if (isSetStatus) { + addIfNull(nulls, JSON_PROPERTY_STATUS, this.status); + } + if (isSetTitle) { + addIfNull(nulls, JSON_PROPERTY_TITLE, this.title); + } + if (isSetType) { + addIfNull(nulls, JSON_PROPERTY_TYPE, this.type); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of DefaultErrorResponseEntity given an JSON string + * + * @param jsonString JSON string + * @return An instance of DefaultErrorResponseEntity + * @throws JsonProcessingException if the JSON string is invalid with respect to + * DefaultErrorResponseEntity + */ + public static DefaultErrorResponseEntity fromJson(String jsonString) + throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, DefaultErrorResponseEntity.class); + } + + /** + * Convert an instance of DefaultErrorResponseEntity to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/softposconfiguration/InvalidField.java b/src/main/java/com/adyen/model/softposconfiguration/InvalidField.java new file mode 100644 index 000000000..876f7539b --- /dev/null +++ b/src/main/java/com/adyen/model/softposconfiguration/InvalidField.java @@ -0,0 +1,273 @@ +/* + * SoftPOS configuration API + * + * The version of the OpenAPI document: 3 + * + * + * 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.softposconfiguration; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** InvalidField */ +@JsonPropertyOrder({ + InvalidField.JSON_PROPERTY_MESSAGE, + InvalidField.JSON_PROPERTY_NAME, + InvalidField.JSON_PROPERTY_VALUE +}) +public class InvalidField { + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMessage = false; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + public static final String JSON_PROPERTY_VALUE = "value"; + private String value; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetValue = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public InvalidField() {} + + /** + * Description of the validation error. + * + * @param message Description of the validation error. + * @return the current {@code InvalidField} instance, allowing for method chaining + */ + public InvalidField message(String message) { + this.message = message; + isSetMessage = true; // mark as set + return this; + } + + /** + * Description of the validation error. + * + * @return message Description of the validation error. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMessage() { + return message; + } + + /** + * Description of the validation error. + * + * @param message Description of the validation error. + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMessage(String message) { + this.message = message; + isSetMessage = true; // mark as set + } + + /** + * The field that has an invalid value. + * + * @param name The field that has an invalid value. + * @return the current {@code InvalidField} instance, allowing for method chaining + */ + public InvalidField name(String name) { + this.name = name; + isSetName = true; // mark as set + return this; + } + + /** + * The field that has an invalid value. + * + * @return name The field that has an invalid value. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The field that has an invalid value. + * + * @param name The field that has an invalid value. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + isSetName = true; // mark as set + } + + /** + * The invalid value. + * + * @param value The invalid value. + * @return the current {@code InvalidField} instance, allowing for method chaining + */ + public InvalidField value(String value) { + this.value = value; + isSetValue = true; // mark as set + return this; + } + + /** + * The invalid value. + * + * @return value The invalid value. + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getValue() { + return value; + } + + /** + * The invalid value. + * + * @param value The invalid value. + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setValue(String value) { + this.value = value; + isSetValue = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public InvalidField includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this InvalidField object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvalidField invalidField = (InvalidField) o; + return Objects.equals(this.message, invalidField.message) + && Objects.equals(this.isSetMessage, invalidField.isSetMessage) + && Objects.equals(this.name, invalidField.name) + && Objects.equals(this.isSetName, invalidField.isSetName) + && Objects.equals(this.value, invalidField.value) + && Objects.equals(this.isSetValue, invalidField.isSetValue); + } + + @Override + public int hashCode() { + return Objects.hash(message, isSetMessage, name, isSetName, value, isSetValue); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvalidField {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetMessage) { + addIfNull(nulls, JSON_PROPERTY_MESSAGE, this.message); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetValue) { + addIfNull(nulls, JSON_PROPERTY_VALUE, this.value); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of InvalidField given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvalidField + * @throws JsonProcessingException if the JSON string is invalid with respect to InvalidField + */ + public static InvalidField fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, InvalidField.class); + } + + /** + * Convert an instance of InvalidField to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/model/softposconfiguration/JSON.java b/src/main/java/com/adyen/model/softposconfiguration/JSON.java new file mode 100644 index 000000000..6972bb2e4 --- /dev/null +++ b/src/main/java/com/adyen/model/softposconfiguration/JSON.java @@ -0,0 +1,251 @@ +package com.adyen.model.softposconfiguration; + +import com.adyen.serializer.ByteArrayDeserializer; +import com.adyen.serializer.ByteArraySerializer; +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.module.SimpleModule; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +import jakarta.ws.rs.core.GenericType; +import jakarta.ws.rs.ext.ContextResolver; +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +public class JSON implements ContextResolver { + private static ObjectMapper mapper; + + private JSON() { + mapper = new ObjectMapper(); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + mapper.configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, true); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true); + mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); + mapper.disable(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE); + mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); + mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); + mapper.registerModule(new JavaTimeModule()); + // Custom ByteSerializer + SimpleModule simpleModule = new SimpleModule(); + simpleModule.addSerializer(byte[].class, new ByteArraySerializer()); + simpleModule.addDeserializer(byte[].class, new ByteArrayDeserializer()); + mapper.registerModule(simpleModule); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public static ObjectMapper getMapper() { + return mapper; + } + + /** + * Returns the target model class that should be used to deserialize the input data. The + * discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet<>()); + } + return null; + } + + /** Helper class to register the discriminator mappings. */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap<>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the name of the discriminator property for this model class. + String getDiscriminatorPropertyName() { + return discriminatorName; + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. This + * function can be invoked for anyOf/oneOf composed models with discriminator mappings. The + * discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + *

The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, so + * it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf( + Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (GenericType childType : descendants.values()) { + if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** A map of discriminators for all model classes. */ + private static final Map, ClassDiscriminatorMapping> modelDiscriminators = + new HashMap, ClassDiscriminatorMapping>(); + + /** A map of oneOf/anyOf descendants for each model class. */ + private static final Map, Map> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator( + Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = + new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants( + Class modelClass, Map descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/src/main/java/com/adyen/model/softposconfiguration/SubMerchantData.java b/src/main/java/com/adyen/model/softposconfiguration/SubMerchantData.java new file mode 100644 index 000000000..cfe2988d5 --- /dev/null +++ b/src/main/java/com/adyen/model/softposconfiguration/SubMerchantData.java @@ -0,0 +1,765 @@ +/* + * SoftPOS configuration API + * + * The version of the OpenAPI document: 3 + * + * + * 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.softposconfiguration; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fasterxml.jackson.core.JsonProcessingException; +import java.util.*; + +/** SubMerchantData */ +@JsonPropertyOrder({ + SubMerchantData.JSON_PROPERTY_CITY, + SubMerchantData.JSON_PROPERTY_COUNTRY, + SubMerchantData.JSON_PROPERTY_DISPLAY_NAME, + SubMerchantData.JSON_PROPERTY_EMAIL, + SubMerchantData.JSON_PROPERTY_ID, + SubMerchantData.JSON_PROPERTY_MCC, + SubMerchantData.JSON_PROPERTY_NAME, + SubMerchantData.JSON_PROPERTY_PHONE_NUMBER, + SubMerchantData.JSON_PROPERTY_POSTAL_CODE, + SubMerchantData.JSON_PROPERTY_STATE, + SubMerchantData.JSON_PROPERTY_STREET, + SubMerchantData.JSON_PROPERTY_TAX_ID +}) +public class SubMerchantData { + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCity = false; + + public static final String JSON_PROPERTY_COUNTRY = "country"; + private String country; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetCountry = false; + + public static final String JSON_PROPERTY_DISPLAY_NAME = "displayName"; + private String displayName; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetDisplayName = false; + + public static final String JSON_PROPERTY_EMAIL = "email"; + private String email; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetEmail = false; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetId = false; + + public static final String JSON_PROPERTY_MCC = "mcc"; + private String mcc; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetMcc = false; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetName = false; + + public static final String JSON_PROPERTY_PHONE_NUMBER = "phoneNumber"; + private String phoneNumber; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPhoneNumber = false; + + public static final String JSON_PROPERTY_POSTAL_CODE = "postalCode"; + private String postalCode; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetPostalCode = false; + + public static final String JSON_PROPERTY_STATE = "state"; + private String state; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetState = false; + + public static final String JSON_PROPERTY_STREET = "street"; + private String street; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetStreet = false; + + public static final String JSON_PROPERTY_TAX_ID = "taxId"; + private String taxId; + + /** Mark when the attribute has been explicitly set. */ + private boolean isSetTaxId = false; + + /** + * Sets whether attributes with null values should be explicitly included in the JSON payload. + * Default is false. + */ + @JsonIgnore private boolean includeNullValues = false; + + public SubMerchantData() {} + + /** + * The city of the sub-merchant's address. + * + * @param city The city of the sub-merchant's address. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData city(String city) { + this.city = city; + isSetCity = true; // mark as set + return this; + } + + /** + * The city of the sub-merchant's address. + * + * @return city The city of the sub-merchant's address. + */ + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCity() { + return city; + } + + /** + * The city of the sub-merchant's address. + * + * @param city The city of the sub-merchant's address. + */ + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCity(String city) { + this.city = city; + isSetCity = true; // mark as set + } + + /** + * The country/region of the sub-merchant's address, specified as the three-letter country + * code in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + * + * @param country The country/region of the sub-merchant's address, specified as the + * three-letter country code in [ISO 3166-1 + * alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData country(String country) { + this.country = country; + isSetCountry = true; // mark as set + return this; + } + + /** + * The country/region of the sub-merchant's address, specified as the three-letter country + * code in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + * + * @return country The country/region of the sub-merchant's address, specified as the + * three-letter country code in [ISO 3166-1 + * alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountry() { + return country; + } + + /** + * The country/region of the sub-merchant's address, specified as the three-letter country + * code in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + * + * @param country The country/region of the sub-merchant's address, specified as the + * three-letter country code in [ISO 3166-1 + * alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format. + */ + @JsonProperty(JSON_PROPERTY_COUNTRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setCountry(String country) { + this.country = country; + isSetCountry = true; // mark as set + } + + /** + * The name of the sub-merchant as it should appear on the display of the mobile device during + * transactions. + * + * @param displayName The name of the sub-merchant as it should appear on the display of the + * mobile device during transactions. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData displayName(String displayName) { + this.displayName = displayName; + isSetDisplayName = true; // mark as set + return this; + } + + /** + * The name of the sub-merchant as it should appear on the display of the mobile device during + * transactions. + * + * @return displayName The name of the sub-merchant as it should appear on the display of the + * mobile device during transactions. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDisplayName() { + return displayName; + } + + /** + * The name of the sub-merchant as it should appear on the display of the mobile device during + * transactions. + * + * @param displayName The name of the sub-merchant as it should appear on the display of the + * mobile device during transactions. + */ + @JsonProperty(JSON_PROPERTY_DISPLAY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setDisplayName(String displayName) { + this.displayName = displayName; + isSetDisplayName = true; // mark as set + } + + /** + * The email address of the sub-merchant. Required for American Express. + * + * @param email The email address of the sub-merchant. Required for American Express. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData email(String email) { + this.email = email; + isSetEmail = true; // mark as set + return this; + } + + /** + * The email address of the sub-merchant. Required for American Express. + * + * @return email The email address of the sub-merchant. Required for American Express. + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEmail() { + return email; + } + + /** + * The email address of the sub-merchant. Required for American Express. + * + * @param email The email address of the sub-merchant. Required for American Express. + */ + @JsonProperty(JSON_PROPERTY_EMAIL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setEmail(String email) { + this.email = email; + isSetEmail = true; // mark as set + } + + /** + * Your unique identifier of the sub-merchant. + * + * @param id Your unique identifier of the sub-merchant. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData id(String id) { + this.id = id; + isSetId = true; // mark as set + return this; + } + + /** + * Your unique identifier of the sub-merchant. + * + * @return id Your unique identifier of the sub-merchant. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + /** + * Your unique identifier of the sub-merchant. + * + * @param id Your unique identifier of the sub-merchant. + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setId(String id) { + this.id = id; + isSetId = true; // mark as set + } + + /** + * The sub-merchant's four-digit Merchant Category Code (MCC). This parameter is used to + * correctly route the transaction. + * + * @param mcc The sub-merchant's four-digit Merchant Category Code (MCC). This parameter is + * used to correctly route the transaction. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData mcc(String mcc) { + this.mcc = mcc; + isSetMcc = true; // mark as set + return this; + } + + /** + * The sub-merchant's four-digit Merchant Category Code (MCC). This parameter is used to + * correctly route the transaction. + * + * @return mcc The sub-merchant's four-digit Merchant Category Code (MCC). This parameter is + * used to correctly route the transaction. + */ + @JsonProperty(JSON_PROPERTY_MCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMcc() { + return mcc; + } + + /** + * The sub-merchant's four-digit Merchant Category Code (MCC). This parameter is used to + * correctly route the transaction. + * + * @param mcc The sub-merchant's four-digit Merchant Category Code (MCC). This parameter is + * used to correctly route the transaction. + */ + @JsonProperty(JSON_PROPERTY_MCC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setMcc(String mcc) { + this.mcc = mcc; + isSetMcc = true; // mark as set + } + + /** + * The name of the sub-merchant. + * + * @param name The name of the sub-merchant. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData name(String name) { + this.name = name; + isSetName = true; // mark as set + return this; + } + + /** + * The name of the sub-merchant. + * + * @return name The name of the sub-merchant. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + /** + * The name of the sub-merchant. + * + * @param name The name of the sub-merchant. + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setName(String name) { + this.name = name; + isSetName = true; // mark as set + } + + /** + * The phone number of the sub-merchant. Required for American Express. + * + * @param phoneNumber The phone number of the sub-merchant. Required for American Express. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData phoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set + return this; + } + + /** + * The phone number of the sub-merchant. Required for American Express. + * + * @return phoneNumber The phone number of the sub-merchant. Required for American Express. + */ + @JsonProperty(JSON_PROPERTY_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPhoneNumber() { + return phoneNumber; + } + + /** + * The phone number of the sub-merchant. Required for American Express. + * + * @param phoneNumber The phone number of the sub-merchant. Required for American Express. + */ + @JsonProperty(JSON_PROPERTY_PHONE_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + isSetPhoneNumber = true; // mark as set + } + + /** + * The postal code of the sub-merchant's address, without dashes. + * + * @param postalCode The postal code of the sub-merchant's address, without dashes. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData postalCode(String postalCode) { + this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + return this; + } + + /** + * The postal code of the sub-merchant's address, without dashes. + * + * @return postalCode The postal code of the sub-merchant's address, without dashes. + */ + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPostalCode() { + return postalCode; + } + + /** + * The postal code of the sub-merchant's address, without dashes. + * + * @param postalCode The postal code of the sub-merchant's address, without dashes. + */ + @JsonProperty(JSON_PROPERTY_POSTAL_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + isSetPostalCode = true; // mark as set + } + + /** + * The state code of the sub-merchant's address, if applicable for the country or region. + * + * @param state The state code of the sub-merchant's address, if applicable for the country or + * region. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData state(String state) { + this.state = state; + isSetState = true; // mark as set + return this; + } + + /** + * The state code of the sub-merchant's address, if applicable for the country or region. + * + * @return state The state code of the sub-merchant's address, if applicable for the country + * or region. + */ + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getState() { + return state; + } + + /** + * The state code of the sub-merchant's address, if applicable for the country or region. + * + * @param state The state code of the sub-merchant's address, if applicable for the country or + * region. + */ + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setState(String state) { + this.state = state; + isSetState = true; // mark as set + } + + /** + * The street name and house number of the sub-merchant's address. + * + * @param street The street name and house number of the sub-merchant's address. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData street(String street) { + this.street = street; + isSetStreet = true; // mark as set + return this; + } + + /** + * The street name and house number of the sub-merchant's address. + * + * @return street The street name and house number of the sub-merchant's address. + */ + @JsonProperty(JSON_PROPERTY_STREET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getStreet() { + return street; + } + + /** + * The street name and house number of the sub-merchant's address. + * + * @param street The street name and house number of the sub-merchant's address. + */ + @JsonProperty(JSON_PROPERTY_STREET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setStreet(String street) { + this.street = street; + isSetStreet = true; // mark as set + } + + /** + * The tax ID of the sub-merchant. Required only in Brazil and for Cartes Bancaires in France. For + * Brazil, this is the 11-digit CPF or 14-digit CNPJ. For France, this is the SIRET, with a + * maximum of 14 digits. + * + * @param taxId The tax ID of the sub-merchant. Required only in Brazil and for Cartes Bancaires + * in France. For Brazil, this is the 11-digit CPF or 14-digit CNPJ. For France, this is the + * SIRET, with a maximum of 14 digits. + * @return the current {@code SubMerchantData} instance, allowing for method chaining + */ + public SubMerchantData taxId(String taxId) { + this.taxId = taxId; + isSetTaxId = true; // mark as set + return this; + } + + /** + * The tax ID of the sub-merchant. Required only in Brazil and for Cartes Bancaires in France. For + * Brazil, this is the 11-digit CPF or 14-digit CNPJ. For France, this is the SIRET, with a + * maximum of 14 digits. + * + * @return taxId The tax ID of the sub-merchant. Required only in Brazil and for Cartes Bancaires + * in France. For Brazil, this is the 11-digit CPF or 14-digit CNPJ. For France, this is the + * SIRET, with a maximum of 14 digits. + */ + @JsonProperty(JSON_PROPERTY_TAX_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTaxId() { + return taxId; + } + + /** + * The tax ID of the sub-merchant. Required only in Brazil and for Cartes Bancaires in France. For + * Brazil, this is the 11-digit CPF or 14-digit CNPJ. For France, this is the SIRET, with a + * maximum of 14 digits. + * + * @param taxId The tax ID of the sub-merchant. Required only in Brazil and for Cartes Bancaires + * in France. For Brazil, this is the 11-digit CPF or 14-digit CNPJ. For France, this is the + * SIRET, with a maximum of 14 digits. + */ + @JsonProperty(JSON_PROPERTY_TAX_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public void setTaxId(String taxId) { + this.taxId = taxId; + isSetTaxId = true; // mark as set + } + + /** + * Configures whether null values are explicitly serialized in the JSON payload. Default is false. + */ + public SubMerchantData includeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + return this; + } + + /** Returns whether null values are explicitly serialized in the JSON payload. */ + public boolean isIncludeNullValues() { + return includeNullValues; + } + + /** + * Sets whether null values should be explicitly serialized in the JSON payload. Default is false. + */ + public void setIncludeNullValues(boolean includeNullValues) { + this.includeNullValues = includeNullValues; + } + + /** Return true if this SubMerchantData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SubMerchantData subMerchantData = (SubMerchantData) o; + return Objects.equals(this.city, subMerchantData.city) + && Objects.equals(this.isSetCity, subMerchantData.isSetCity) + && Objects.equals(this.country, subMerchantData.country) + && Objects.equals(this.isSetCountry, subMerchantData.isSetCountry) + && Objects.equals(this.displayName, subMerchantData.displayName) + && Objects.equals(this.isSetDisplayName, subMerchantData.isSetDisplayName) + && Objects.equals(this.email, subMerchantData.email) + && Objects.equals(this.isSetEmail, subMerchantData.isSetEmail) + && Objects.equals(this.id, subMerchantData.id) + && Objects.equals(this.isSetId, subMerchantData.isSetId) + && Objects.equals(this.mcc, subMerchantData.mcc) + && Objects.equals(this.isSetMcc, subMerchantData.isSetMcc) + && Objects.equals(this.name, subMerchantData.name) + && Objects.equals(this.isSetName, subMerchantData.isSetName) + && Objects.equals(this.phoneNumber, subMerchantData.phoneNumber) + && Objects.equals(this.isSetPhoneNumber, subMerchantData.isSetPhoneNumber) + && Objects.equals(this.postalCode, subMerchantData.postalCode) + && Objects.equals(this.isSetPostalCode, subMerchantData.isSetPostalCode) + && Objects.equals(this.state, subMerchantData.state) + && Objects.equals(this.isSetState, subMerchantData.isSetState) + && Objects.equals(this.street, subMerchantData.street) + && Objects.equals(this.isSetStreet, subMerchantData.isSetStreet) + && Objects.equals(this.taxId, subMerchantData.taxId) + && Objects.equals(this.isSetTaxId, subMerchantData.isSetTaxId); + } + + @Override + public int hashCode() { + return Objects.hash( + city, + isSetCity, + country, + isSetCountry, + displayName, + isSetDisplayName, + email, + isSetEmail, + id, + isSetId, + mcc, + isSetMcc, + name, + isSetName, + phoneNumber, + isSetPhoneNumber, + postalCode, + isSetPostalCode, + state, + isSetState, + street, + isSetStreet, + taxId, + isSetTaxId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SubMerchantData {\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" mcc: ").append(toIndentedString(mcc)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" street: ").append(toIndentedString(street)).append("\n"); + sb.append(" taxId: ").append(toIndentedString(taxId)).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 "); + } + + /** Returns a map of properties to be merged into the JSON payload as explicit null values. */ + @JsonInclude(JsonInclude.Include.ALWAYS) + @JsonAnyGetter + public Map getExplicitNulls() { + if (!this.includeNullValues) { + return Collections.emptyMap(); + } + + Map nulls = new HashMap<>(); + + if (isSetCity) { + addIfNull(nulls, JSON_PROPERTY_CITY, this.city); + } + if (isSetCountry) { + addIfNull(nulls, JSON_PROPERTY_COUNTRY, this.country); + } + if (isSetDisplayName) { + addIfNull(nulls, JSON_PROPERTY_DISPLAY_NAME, this.displayName); + } + if (isSetEmail) { + addIfNull(nulls, JSON_PROPERTY_EMAIL, this.email); + } + if (isSetId) { + addIfNull(nulls, JSON_PROPERTY_ID, this.id); + } + if (isSetMcc) { + addIfNull(nulls, JSON_PROPERTY_MCC, this.mcc); + } + if (isSetName) { + addIfNull(nulls, JSON_PROPERTY_NAME, this.name); + } + if (isSetPhoneNumber) { + addIfNull(nulls, JSON_PROPERTY_PHONE_NUMBER, this.phoneNumber); + } + if (isSetPostalCode) { + addIfNull(nulls, JSON_PROPERTY_POSTAL_CODE, this.postalCode); + } + if (isSetState) { + addIfNull(nulls, JSON_PROPERTY_STATE, this.state); + } + if (isSetStreet) { + addIfNull(nulls, JSON_PROPERTY_STREET, this.street); + } + if (isSetTaxId) { + addIfNull(nulls, JSON_PROPERTY_TAX_ID, this.taxId); + } + + return nulls; + } + + // add to map when value is null + private void addIfNull(Map map, String key, Object value) { + if (value == null) { + map.put(key, null); + } + } + + /** + * Create an instance of SubMerchantData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SubMerchantData + * @throws JsonProcessingException if the JSON string is invalid with respect to SubMerchantData + */ + public static SubMerchantData fromJson(String jsonString) throws JsonProcessingException { + return JSON.getMapper().readValue(jsonString, SubMerchantData.class); + } + + /** + * Convert an instance of SubMerchantData to an JSON string + * + * @return JSON string + */ + public String toJson() throws JsonProcessingException { + return JSON.getMapper().writeValueAsString(this); + } +} diff --git a/src/main/java/com/adyen/service/softposconfiguration/SessionAuthenticationApi.java b/src/main/java/com/adyen/service/softposconfiguration/SessionAuthenticationApi.java new file mode 100644 index 000000000..3276f319b --- /dev/null +++ b/src/main/java/com/adyen/service/softposconfiguration/SessionAuthenticationApi.java @@ -0,0 +1,83 @@ +/* + * SoftPOS configuration API + * + * The version of the OpenAPI document: 3 + * + * + * 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.service.softposconfiguration; + +import com.adyen.Client; +import com.adyen.Service; +import com.adyen.constants.ApiConstants; +import com.adyen.model.RequestOptions; +import com.adyen.model.softposconfiguration.CertificateLoadingRequest; +import com.adyen.model.softposconfiguration.CertificateLoadingResponse; +import com.adyen.service.exception.ApiException; +import com.adyen.service.resource.Resource; +import java.io.IOException; + +public class SessionAuthenticationApi extends Service { + + public static final String API_VERSION = "3"; + + protected String baseURL; + + /** + * Session authentication constructor in {@link com.adyen.service.softposconfiguration package}. + * + * @param client {@link Client } (required) + */ + public SessionAuthenticationApi(Client client) { + super(client); + this.baseURL = createBaseURL("https://softposconfig-test.adyen.com/softposconfig/v3"); + } + + /** + * Session authentication constructor in {@link com.adyen.service.softposconfiguration package}. + * Please use this constructor only if you would like to pass along your own url for routing or + * testing purposes. The latest API version is defined in this class as a constant. + * + * @param client {@link Client } (required) + * @param baseURL {@link String } (required) + */ + public SessionAuthenticationApi(Client client, String baseURL) { + super(client); + this.baseURL = baseURL; + } + + /** + * Create a communication session + * + * @param certificateLoadingRequest {@link CertificateLoadingRequest } (required) + * @return {@link CertificateLoadingResponse } + * @throws ApiException if fails to make API call + */ + public CertificateLoadingResponse issueCertificates( + CertificateLoadingRequest certificateLoadingRequest) throws ApiException, IOException { + return issueCertificates(certificateLoadingRequest, null); + } + + /** + * Create a communication session + * + * @param certificateLoadingRequest {@link CertificateLoadingRequest } (required) + * @param requestOptions {@link RequestOptions } Object to store additional HTTP headers such as + * idempotency-keys (optional) + * @return {@link CertificateLoadingResponse } + * @throws ApiException if fails to make API call + */ + public CertificateLoadingResponse issueCertificates( + CertificateLoadingRequest certificateLoadingRequest, RequestOptions requestOptions) + throws ApiException, IOException { + String requestBody = certificateLoadingRequest.toJson(); + Resource resource = new Resource(this, this.baseURL + "/auth/certificate", null); + String jsonResult = + resource.request(requestBody, requestOptions, ApiConstants.HttpMethod.POST, null); + return CertificateLoadingResponse.fromJson(jsonResult); + } +}