From bfba6a58b6f3ab2dafdf1f42e09b98ddff81fa28 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 20:59:50 +0000 Subject: [PATCH 1/3] chore(internal): upgrade AssertJ --- increase-java-client-okhttp/build.gradle.kts | 2 +- increase-java-core/build.gradle.kts | 2 +- increase-java-proguard-test/build.gradle.kts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/increase-java-client-okhttp/build.gradle.kts b/increase-java-client-okhttp/build.gradle.kts index 1b2dc95d0..9aed6d2c2 100644 --- a/increase-java-client-okhttp/build.gradle.kts +++ b/increase-java-client-okhttp/build.gradle.kts @@ -10,6 +10,6 @@ dependencies { implementation("com.squareup.okhttp3:logging-interceptor:4.12.0") testImplementation(kotlin("test")) - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") } diff --git a/increase-java-core/build.gradle.kts b/increase-java-core/build.gradle.kts index 8f3caebe6..b23d01548 100644 --- a/increase-java-core/build.gradle.kts +++ b/increase-java-core/build.gradle.kts @@ -35,7 +35,7 @@ dependencies { testImplementation(kotlin("test")) testImplementation(project(":increase-java-client-okhttp")) testImplementation("com.github.tomakehurst:wiremock-jre8:2.35.2") - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.3") testImplementation("org.junit-pioneer:junit-pioneer:1.9.1") diff --git a/increase-java-proguard-test/build.gradle.kts b/increase-java-proguard-test/build.gradle.kts index e699c3b03..fc8184a6a 100644 --- a/increase-java-proguard-test/build.gradle.kts +++ b/increase-java-proguard-test/build.gradle.kts @@ -18,7 +18,7 @@ dependencies { testImplementation(project(":increase-java")) testImplementation(kotlin("test")) testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") - testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("org.assertj:assertj-core:3.27.7") testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.14.0") } From 8cce3f5b9b8b10010953b2b6e2d9017fae724a8e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Feb 2026 01:32:24 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 +- .../accounttransfers/AccountTransfer.kt | 400 +- .../api/models/achtransfers/AchTransfer.kt | 414 +- .../api/models/carddisputes/CardDispute.kt | 904 ++- .../api/models/cardpayments/CardPayment.kt | 775 ++- .../cardpushtransfers/CardPushTransfer.kt | 400 +- .../models/cardvalidations/CardValidation.kt | 400 +- .../models/checktransfers/CheckTransfer.kt | 400 +- .../DeclinedTransaction.kt | 635 +- .../models/fednowtransfers/FednowTransfer.kt | 400 +- .../pendingtransactions/PendingTransaction.kt | 2137 +++---- .../RealTimePaymentsTransfer.kt | 400 +- .../models/swifttransfers/SwiftTransfer.kt | 400 +- .../api/models/transactions/Transaction.kt | 5628 ++++++++--------- .../api/models/wiretransfers/WireTransfer.kt | 412 +- .../AccountTransferListPageResponseTest.kt | 6 +- .../accounttransfers/AccountTransferTest.kt | 6 +- .../AchTransferListPageResponseTest.kt | 6 +- .../models/achtransfers/AchTransferTest.kt | 6 +- .../CardDisputeListPageResponseTest.kt | 72 +- .../models/carddisputes/CardDisputeTest.kt | 48 +- .../CardPaymentListPageResponseTest.kt | 48 +- .../models/cardpayments/CardPaymentTest.kt | 48 +- .../CardPushTransferListPageResponseTest.kt | 6 +- .../cardpushtransfers/CardPushTransferTest.kt | 6 +- .../CardValidationListPageResponseTest.kt | 6 +- .../cardvalidations/CardValidationTest.kt | 6 +- .../CheckTransferListPageResponseTest.kt | 6 +- .../checktransfers/CheckTransferTest.kt | 6 +- ...DeclinedTransactionListPageResponseTest.kt | 6 +- .../DeclinedTransactionTest.kt | 6 +- .../FednowTransferListPageResponseTest.kt | 6 +- .../fednowtransfers/FednowTransferTest.kt | 6 +- .../PendingTransactionListPageResponseTest.kt | 14 +- .../PendingTransactionTest.kt | 6 +- ...imePaymentsTransferListPageResponseTest.kt | 6 +- .../RealTimePaymentsTransferTest.kt | 6 +- .../CardAuthorizationCreateResponseTest.kt | 12 +- .../SwiftTransferListPageResponseTest.kt | 6 +- .../swifttransfers/SwiftTransferTest.kt | 6 +- .../TransactionListPageResponseTest.kt | 6 +- .../models/transactions/TransactionTest.kt | 6 +- .../WireTransferListPageResponseTest.kt | 6 +- .../models/wiretransfers/WireTransferTest.kt | 6 +- 44 files changed, 6907 insertions(+), 7182 deletions(-) diff --git a/.stats.yml b/.stats.yml index 625e421df..d4eadd590 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 232 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-cff24fe63c8cb06a46048b355f873c22def0798a38de892671d379e58d98bc03.yml -openapi_spec_hash: 4f7ae65440fefa73441023480d6ac9a4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-845aba046473ba39ae898570153537fb31dd6f8cb260dd8478a14fd4275ca97f.yml +openapi_spec_hash: 8afbe65f9d6614f0960f141ae0de0c39 config_hash: 27e44ed36b9c5617b580ead7231a594a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransfer.kt index 0bbc504cc..19c28b243 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransfer.kt @@ -1308,8 +1308,8 @@ private constructor( class CreatedBy @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val apiKey: JsonField, private val category: JsonField, + private val apiKey: JsonField, private val oauthApplication: JsonField, private val user: JsonField, private val additionalProperties: MutableMap, @@ -1317,23 +1317,15 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("oauth_application") @ExcludeMissing oauthApplication: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), - ) : this(apiKey, category, oauthApplication, user, mutableMapOf()) - - /** - * If present, details about the API key that created the transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun apiKey(): Optional = apiKey.getOptional("api_key") + ) : this(category, apiKey, oauthApplication, user, mutableMapOf()) /** * The type of object that created this transfer. @@ -1343,6 +1335,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * If present, details about the API key that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun apiKey(): Optional = apiKey.getOptional("api_key") + /** * If present, details about the OAuth Application that created the transfer. * @@ -1361,18 +1361,18 @@ private constructor( fun user(): Optional = user.getOptional("user") /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [category]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category /** - * Returns the raw JSON value of [category]. + * Returns the raw JSON value of [apiKey]. * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey /** * Returns the raw JSON value of [oauthApplication]. @@ -1410,10 +1410,7 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` */ @JvmStatic fun builder() = Builder() @@ -1422,21 +1419,33 @@ private constructor( /** A builder for [CreatedBy]. */ class Builder internal constructor() { - private var apiKey: JsonField? = null private var category: JsonField? = null - private var oauthApplication: JsonField? = null - private var user: JsonField? = null + private var apiKey: JsonField = JsonMissing.of() + private var oauthApplication: JsonField = JsonMissing.of() + private var user: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(createdBy: CreatedBy) = apply { - apiKey = createdBy.apiKey category = createdBy.category + apiKey = createdBy.apiKey oauthApplication = createdBy.oauthApplication user = createdBy.user additionalProperties = createdBy.additionalProperties.toMutableMap() } + /** The type of object that created this transfer. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** If present, details about the API key that created the transfer. */ fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey)) @@ -1452,18 +1461,6 @@ private constructor( */ fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } - /** The type of object that created this transfer. */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** If present, details about the OAuth Application that created the transfer. */ fun oauthApplication(oauthApplication: OAuthApplication?) = oauthApplication(JsonField.ofNullable(oauthApplication)) @@ -1526,20 +1523,17 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): CreatedBy = CreatedBy( - checkRequired("apiKey", apiKey), checkRequired("category", category), - checkRequired("oauthApplication", oauthApplication), - checkRequired("user", user), + apiKey, + oauthApplication, + user, additionalProperties.toMutableMap(), ) } @@ -1551,8 +1545,8 @@ private constructor( return@apply } - apiKey().ifPresent { it.validate() } category().validate() + apiKey().ifPresent { it.validate() } oauthApplication().ifPresent { it.validate() } user().ifPresent { it.validate() } validated = true @@ -1574,11 +1568,166 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (apiKey.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + (user.asKnown().getOrNull()?.validity() ?: 0) + /** The type of object that created this transfer. */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** If present, details about the API key that created the transfer. */ class ApiKey @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -1755,161 +1904,6 @@ private constructor( "ApiKey{description=$description, additionalProperties=$additionalProperties}" } - /** The type of object that created this transfer. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** An API key. Details will be under the `api_key` object. */ - @JvmField val API_KEY = of("api_key") - - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - @JvmField val OAUTH_APPLICATION = of("oauth_application") - - /** A User in the Increase dashboard. Details will be under the `user` object. */ - @JvmField val USER = of("user") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - API_KEY -> Value.API_KEY - OAUTH_APPLICATION -> Value.OAUTH_APPLICATION - USER -> Value.USER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - API_KEY -> Known.API_KEY - OAUTH_APPLICATION -> Known.OAUTH_APPLICATION - USER -> Known.USER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** If present, details about the OAuth Application that created the transfer. */ class OAuthApplication @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2241,21 +2235,21 @@ private constructor( } return other is CreatedBy && - apiKey == other.apiKey && category == other.category && + apiKey == other.apiKey && oauthApplication == other.oauthApplication && user == other.user && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + Objects.hash(category, apiKey, oauthApplication, user, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + "CreatedBy{category=$category, apiKey=$apiKey, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } /** The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt index c37b16986..b4c37f361 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt @@ -2072,8 +2072,6 @@ private constructor( * The following fields are required: * ```java * .category() - * .freeform() - * .paymentOrderRemittanceAdvice() * ``` */ @JvmStatic fun builder() = Builder() @@ -2083,9 +2081,9 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null - private var freeform: JsonField? = null - private var paymentOrderRemittanceAdvice: JsonField? = - null + private var freeform: JsonField = JsonMissing.of() + private var paymentOrderRemittanceAdvice: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -2180,8 +2178,6 @@ private constructor( * The following fields are required: * ```java * .category() - * .freeform() - * .paymentOrderRemittanceAdvice() * ``` * * @throws IllegalStateException if any required field is unset. @@ -2189,8 +2185,8 @@ private constructor( fun build(): Addenda = Addenda( checkRequired("category", category), - checkRequired("freeform", freeform), - checkRequired("paymentOrderRemittanceAdvice", paymentOrderRemittanceAdvice), + freeform, + paymentOrderRemittanceAdvice, additionalProperties.toMutableMap(), ) } @@ -3640,8 +3636,8 @@ private constructor( class CreatedBy @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val apiKey: JsonField, private val category: JsonField, + private val apiKey: JsonField, private val oauthApplication: JsonField, private val user: JsonField, private val additionalProperties: MutableMap, @@ -3649,23 +3645,15 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("oauth_application") @ExcludeMissing oauthApplication: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), - ) : this(apiKey, category, oauthApplication, user, mutableMapOf()) - - /** - * If present, details about the API key that created the transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun apiKey(): Optional = apiKey.getOptional("api_key") + ) : this(category, apiKey, oauthApplication, user, mutableMapOf()) /** * The type of object that created this transfer. @@ -3675,6 +3663,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * If present, details about the API key that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun apiKey(): Optional = apiKey.getOptional("api_key") + /** * If present, details about the OAuth Application that created the transfer. * @@ -3693,18 +3689,18 @@ private constructor( fun user(): Optional = user.getOptional("user") /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [category]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category /** - * Returns the raw JSON value of [category]. + * Returns the raw JSON value of [apiKey]. * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey /** * Returns the raw JSON value of [oauthApplication]. @@ -3742,10 +3738,7 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` */ @JvmStatic fun builder() = Builder() @@ -3754,21 +3747,33 @@ private constructor( /** A builder for [CreatedBy]. */ class Builder internal constructor() { - private var apiKey: JsonField? = null private var category: JsonField? = null - private var oauthApplication: JsonField? = null - private var user: JsonField? = null + private var apiKey: JsonField = JsonMissing.of() + private var oauthApplication: JsonField = JsonMissing.of() + private var user: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(createdBy: CreatedBy) = apply { - apiKey = createdBy.apiKey category = createdBy.category + apiKey = createdBy.apiKey oauthApplication = createdBy.oauthApplication user = createdBy.user additionalProperties = createdBy.additionalProperties.toMutableMap() } + /** The type of object that created this transfer. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** If present, details about the API key that created the transfer. */ fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey)) @@ -3784,18 +3789,6 @@ private constructor( */ fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } - /** The type of object that created this transfer. */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** If present, details about the OAuth Application that created the transfer. */ fun oauthApplication(oauthApplication: OAuthApplication?) = oauthApplication(JsonField.ofNullable(oauthApplication)) @@ -3858,20 +3851,17 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): CreatedBy = CreatedBy( - checkRequired("apiKey", apiKey), checkRequired("category", category), - checkRequired("oauthApplication", oauthApplication), - checkRequired("user", user), + apiKey, + oauthApplication, + user, additionalProperties.toMutableMap(), ) } @@ -3883,8 +3873,8 @@ private constructor( return@apply } - apiKey().ifPresent { it.validate() } category().validate() + apiKey().ifPresent { it.validate() } oauthApplication().ifPresent { it.validate() } user().ifPresent { it.validate() } validated = true @@ -3906,11 +3896,166 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (apiKey.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + (user.asKnown().getOrNull()?.validity() ?: 0) + /** The type of object that created this transfer. */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** If present, details about the API key that created the transfer. */ class ApiKey @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -4087,161 +4232,6 @@ private constructor( "ApiKey{description=$description, additionalProperties=$additionalProperties}" } - /** The type of object that created this transfer. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** An API key. Details will be under the `api_key` object. */ - @JvmField val API_KEY = of("api_key") - - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - @JvmField val OAUTH_APPLICATION = of("oauth_application") - - /** A User in the Increase dashboard. Details will be under the `user` object. */ - @JvmField val USER = of("user") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - API_KEY -> Value.API_KEY - OAUTH_APPLICATION -> Value.OAUTH_APPLICATION - USER -> Value.USER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - API_KEY -> Known.API_KEY - OAUTH_APPLICATION -> Known.OAUTH_APPLICATION - USER -> Known.USER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** If present, details about the OAuth Application that created the transfer. */ class OAuthApplication @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -4573,21 +4563,21 @@ private constructor( } return other is CreatedBy && - apiKey == other.apiKey && category == other.category && + apiKey == other.apiKey && oauthApplication == other.oauthApplication && user == other.user && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + Objects.hash(category, apiKey, oauthApplication, user, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + "CreatedBy{category=$category, apiKey=$apiKey, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt index 09175f8d9..31172bde1 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt @@ -1808,11 +1808,11 @@ private constructor( private constructor( private val attachmentFiles: JsonField>, private val category: JsonField, + private val createdAt: JsonField, + private val disputeFinancialTransactionId: JsonField, private val chargebackAccepted: JsonField, private val chargebackSubmitted: JsonField, private val chargebackTimedOut: JsonField, - private val createdAt: JsonField, - private val disputeFinancialTransactionId: JsonField, private val merchantPrearbitrationDeclineSubmitted: JsonField, private val merchantPrearbitrationReceived: JsonField, @@ -1835,6 +1835,12 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("dispute_financial_transaction_id") + @ExcludeMissing + disputeFinancialTransactionId: JsonField = JsonMissing.of(), @JsonProperty("chargeback_accepted") @ExcludeMissing chargebackAccepted: JsonField = JsonMissing.of(), @@ -1844,12 +1850,6 @@ private constructor( @JsonProperty("chargeback_timed_out") @ExcludeMissing chargebackTimedOut: JsonField = JsonMissing.of(), - @JsonProperty("created_at") - @ExcludeMissing - createdAt: JsonField = JsonMissing.of(), - @JsonProperty("dispute_financial_transaction_id") - @ExcludeMissing - disputeFinancialTransactionId: JsonField = JsonMissing.of(), @JsonProperty("merchant_prearbitration_decline_submitted") @ExcludeMissing merchantPrearbitrationDeclineSubmitted: @@ -1891,11 +1891,11 @@ private constructor( ) : this( attachmentFiles, category, + createdAt, + disputeFinancialTransactionId, chargebackAccepted, chargebackSubmitted, chargebackTimedOut, - createdAt, - disputeFinancialTransactionId, merchantPrearbitrationDeclineSubmitted, merchantPrearbitrationReceived, merchantPrearbitrationTimedOut, @@ -1929,6 +1929,25 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * Visa Card Dispute Network Event was created. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + + /** + * The dispute financial transaction that resulted from the network event, if any. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun disputeFinancialTransactionId(): Optional = + disputeFinancialTransactionId.getOptional("dispute_financial_transaction_id") + /** * A Card Dispute Chargeback Accepted Visa Network Event object. This field will be * present in the JSON response if and only if `category` is equal to @@ -1968,25 +1987,6 @@ private constructor( fun chargebackTimedOut(): Optional = chargebackTimedOut.getOptional("chargeback_timed_out") - /** - * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the - * Visa Card Dispute Network Event was created. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - - /** - * The dispute financial transaction that resulted from the network event, if any. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun disputeFinancialTransactionId(): Optional = - disputeFinancialTransactionId.getOptional("dispute_financial_transaction_id") - /** * A Card Dispute Merchant Pre-Arbitration Decline Submitted Visa Network Event object. * This field will be present in the JSON response if and only if `category` is equal to @@ -2140,6 +2140,26 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [createdAt]. + * + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("created_at") + @ExcludeMissing + fun _createdAt(): JsonField = createdAt + + /** + * Returns the raw JSON value of [disputeFinancialTransactionId]. + * + * Unlike [disputeFinancialTransactionId], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("dispute_financial_transaction_id") + @ExcludeMissing + fun _disputeFinancialTransactionId(): JsonField = disputeFinancialTransactionId + /** * Returns the raw JSON value of [chargebackAccepted]. * @@ -2170,26 +2190,6 @@ private constructor( @ExcludeMissing fun _chargebackTimedOut(): JsonField = chargebackTimedOut - /** - * Returns the raw JSON value of [createdAt]. - * - * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("created_at") - @ExcludeMissing - fun _createdAt(): JsonField = createdAt - - /** - * Returns the raw JSON value of [disputeFinancialTransactionId]. - * - * Unlike [disputeFinancialTransactionId], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("dispute_financial_transaction_id") - @ExcludeMissing - fun _disputeFinancialTransactionId(): JsonField = disputeFinancialTransactionId - /** * Returns the raw JSON value of [merchantPrearbitrationDeclineSubmitted]. * @@ -2320,21 +2320,8 @@ private constructor( * ```java * .attachmentFiles() * .category() - * .chargebackAccepted() - * .chargebackSubmitted() - * .chargebackTimedOut() * .createdAt() * .disputeFinancialTransactionId() - * .merchantPrearbitrationDeclineSubmitted() - * .merchantPrearbitrationReceived() - * .merchantPrearbitrationTimedOut() - * .represented() - * .representmentTimedOut() - * .userPrearbitrationAccepted() - * .userPrearbitrationDeclined() - * .userPrearbitrationSubmitted() - * .userPrearbitrationTimedOut() - * .userWithdrawalSubmitted() * ``` */ @JvmStatic fun builder() = Builder() @@ -2345,42 +2332,44 @@ private constructor( private var attachmentFiles: JsonField>? = null private var category: JsonField? = null - private var chargebackAccepted: JsonField? = null - private var chargebackSubmitted: JsonField? = null - private var chargebackTimedOut: JsonField? = null private var createdAt: JsonField? = null private var disputeFinancialTransactionId: JsonField? = null + private var chargebackAccepted: JsonField = JsonMissing.of() + private var chargebackSubmitted: JsonField = JsonMissing.of() + private var chargebackTimedOut: JsonField = JsonMissing.of() private var merchantPrearbitrationDeclineSubmitted: - JsonField? = - null + JsonField = + JsonMissing.of() private var merchantPrearbitrationReceived: - JsonField? = - null + JsonField = + JsonMissing.of() private var merchantPrearbitrationTimedOut: - JsonField? = - null - private var represented: JsonField? = null - private var representmentTimedOut: JsonField? = null - private var userPrearbitrationAccepted: JsonField? = - null - private var userPrearbitrationDeclined: JsonField? = - null - private var userPrearbitrationSubmitted: JsonField? = - null - private var userPrearbitrationTimedOut: JsonField? = - null - private var userWithdrawalSubmitted: JsonField? = null + JsonField = + JsonMissing.of() + private var represented: JsonField = JsonMissing.of() + private var representmentTimedOut: JsonField = + JsonMissing.of() + private var userPrearbitrationAccepted: JsonField = + JsonMissing.of() + private var userPrearbitrationDeclined: JsonField = + JsonMissing.of() + private var userPrearbitrationSubmitted: JsonField = + JsonMissing.of() + private var userPrearbitrationTimedOut: JsonField = + JsonMissing.of() + private var userWithdrawalSubmitted: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkEvent: NetworkEvent) = apply { attachmentFiles = networkEvent.attachmentFiles.map { it.toMutableList() } category = networkEvent.category + createdAt = networkEvent.createdAt + disputeFinancialTransactionId = networkEvent.disputeFinancialTransactionId chargebackAccepted = networkEvent.chargebackAccepted chargebackSubmitted = networkEvent.chargebackSubmitted chargebackTimedOut = networkEvent.chargebackTimedOut - createdAt = networkEvent.createdAt - disputeFinancialTransactionId = networkEvent.disputeFinancialTransactionId merchantPrearbitrationDeclineSubmitted = networkEvent.merchantPrearbitrationDeclineSubmitted merchantPrearbitrationReceived = networkEvent.merchantPrearbitrationReceived @@ -2438,6 +2427,49 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * Visa Card Dispute Network Event was created. + */ + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun createdAt(createdAt: JsonField) = apply { + this.createdAt = createdAt + } + + /** + * The dispute financial transaction that resulted from the network event, if any. + */ + fun disputeFinancialTransactionId(disputeFinancialTransactionId: String?) = + disputeFinancialTransactionId( + JsonField.ofNullable(disputeFinancialTransactionId) + ) + + /** + * Alias for calling [Builder.disputeFinancialTransactionId] with + * `disputeFinancialTransactionId.orElse(null)`. + */ + fun disputeFinancialTransactionId(disputeFinancialTransactionId: Optional) = + disputeFinancialTransactionId(disputeFinancialTransactionId.getOrNull()) + + /** + * Sets [Builder.disputeFinancialTransactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.disputeFinancialTransactionId] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun disputeFinancialTransactionId( + disputeFinancialTransactionId: JsonField + ) = apply { this.disputeFinancialTransactionId = disputeFinancialTransactionId } + /** * A Card Dispute Chargeback Accepted Visa Network Event object. This field will be * present in the JSON response if and only if `category` is equal to @@ -2523,49 +2555,6 @@ private constructor( this.chargebackTimedOut = chargebackTimedOut } - /** - * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the - * Visa Card Dispute Network Event was created. - */ - fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - - /** - * Sets [Builder.createdAt] to an arbitrary JSON value. - * - * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun createdAt(createdAt: JsonField) = apply { - this.createdAt = createdAt - } - - /** - * The dispute financial transaction that resulted from the network event, if any. - */ - fun disputeFinancialTransactionId(disputeFinancialTransactionId: String?) = - disputeFinancialTransactionId( - JsonField.ofNullable(disputeFinancialTransactionId) - ) - - /** - * Alias for calling [Builder.disputeFinancialTransactionId] with - * `disputeFinancialTransactionId.orElse(null)`. - */ - fun disputeFinancialTransactionId(disputeFinancialTransactionId: Optional) = - disputeFinancialTransactionId(disputeFinancialTransactionId.getOrNull()) - - /** - * Sets [Builder.disputeFinancialTransactionId] to an arbitrary JSON value. - * - * You should usually call [Builder.disputeFinancialTransactionId] with a well-typed - * [String] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun disputeFinancialTransactionId( - disputeFinancialTransactionId: JsonField - ) = apply { this.disputeFinancialTransactionId = disputeFinancialTransactionId } - /** * A Card Dispute Merchant Pre-Arbitration Decline Submitted Visa Network Event * object. This field will be present in the JSON response if and only if `category` @@ -2908,21 +2897,8 @@ private constructor( * ```java * .attachmentFiles() * .category() - * .chargebackAccepted() - * .chargebackSubmitted() - * .chargebackTimedOut() * .createdAt() * .disputeFinancialTransactionId() - * .merchantPrearbitrationDeclineSubmitted() - * .merchantPrearbitrationReceived() - * .merchantPrearbitrationTimedOut() - * .represented() - * .representmentTimedOut() - * .userPrearbitrationAccepted() - * .userPrearbitrationDeclined() - * .userPrearbitrationSubmitted() - * .userPrearbitrationTimedOut() - * .userWithdrawalSubmitted() * ``` * * @throws IllegalStateException if any required field is unset. @@ -2931,33 +2907,24 @@ private constructor( NetworkEvent( checkRequired("attachmentFiles", attachmentFiles).map { it.toImmutable() }, checkRequired("category", category), - checkRequired("chargebackAccepted", chargebackAccepted), - checkRequired("chargebackSubmitted", chargebackSubmitted), - checkRequired("chargebackTimedOut", chargebackTimedOut), checkRequired("createdAt", createdAt), checkRequired( "disputeFinancialTransactionId", disputeFinancialTransactionId, ), - checkRequired( - "merchantPrearbitrationDeclineSubmitted", - merchantPrearbitrationDeclineSubmitted, - ), - checkRequired( - "merchantPrearbitrationReceived", - merchantPrearbitrationReceived, - ), - checkRequired( - "merchantPrearbitrationTimedOut", - merchantPrearbitrationTimedOut, - ), - checkRequired("represented", represented), - checkRequired("representmentTimedOut", representmentTimedOut), - checkRequired("userPrearbitrationAccepted", userPrearbitrationAccepted), - checkRequired("userPrearbitrationDeclined", userPrearbitrationDeclined), - checkRequired("userPrearbitrationSubmitted", userPrearbitrationSubmitted), - checkRequired("userPrearbitrationTimedOut", userPrearbitrationTimedOut), - checkRequired("userWithdrawalSubmitted", userWithdrawalSubmitted), + chargebackAccepted, + chargebackSubmitted, + chargebackTimedOut, + merchantPrearbitrationDeclineSubmitted, + merchantPrearbitrationReceived, + merchantPrearbitrationTimedOut, + represented, + representmentTimedOut, + userPrearbitrationAccepted, + userPrearbitrationDeclined, + userPrearbitrationSubmitted, + userPrearbitrationTimedOut, + userWithdrawalSubmitted, additionalProperties.toMutableMap(), ) } @@ -2971,11 +2938,11 @@ private constructor( attachmentFiles().forEach { it.validate() } category().validate() + createdAt() + disputeFinancialTransactionId() chargebackAccepted().ifPresent { it.validate() } chargebackSubmitted().ifPresent { it.validate() } chargebackTimedOut().ifPresent { it.validate() } - createdAt() - disputeFinancialTransactionId() merchantPrearbitrationDeclineSubmitted().ifPresent { it.validate() } merchantPrearbitrationReceived().ifPresent { it.validate() } merchantPrearbitrationTimedOut().ifPresent { it.validate() } @@ -3007,11 +2974,11 @@ private constructor( internal fun validity(): Int = (attachmentFiles.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (category.asKnown().getOrNull()?.validity() ?: 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (if (disputeFinancialTransactionId.asKnown().isPresent) 1 else 0) + (chargebackAccepted.asKnown().getOrNull()?.validity() ?: 0) + (chargebackSubmitted.asKnown().getOrNull()?.validity() ?: 0) + (chargebackTimedOut.asKnown().getOrNull()?.validity() ?: 0) + - (if (createdAt.asKnown().isPresent) 1 else 0) + - (if (disputeFinancialTransactionId.asKnown().isPresent) 1 else 0) + (merchantPrearbitrationDeclineSubmitted.asKnown().getOrNull()?.validity() ?: 0) + (merchantPrearbitrationReceived.asKnown().getOrNull()?.validity() ?: 0) + @@ -11244,11 +11211,11 @@ private constructor( return other is NetworkEvent && attachmentFiles == other.attachmentFiles && category == other.category && + createdAt == other.createdAt && + disputeFinancialTransactionId == other.disputeFinancialTransactionId && chargebackAccepted == other.chargebackAccepted && chargebackSubmitted == other.chargebackSubmitted && chargebackTimedOut == other.chargebackTimedOut && - createdAt == other.createdAt && - disputeFinancialTransactionId == other.disputeFinancialTransactionId && merchantPrearbitrationDeclineSubmitted == other.merchantPrearbitrationDeclineSubmitted && merchantPrearbitrationReceived == other.merchantPrearbitrationReceived && @@ -11267,11 +11234,11 @@ private constructor( Objects.hash( attachmentFiles, category, + createdAt, + disputeFinancialTransactionId, chargebackAccepted, chargebackSubmitted, chargebackTimedOut, - createdAt, - disputeFinancialTransactionId, merchantPrearbitrationDeclineSubmitted, merchantPrearbitrationReceived, merchantPrearbitrationTimedOut, @@ -11289,7 +11256,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkEvent{attachmentFiles=$attachmentFiles, category=$category, chargebackAccepted=$chargebackAccepted, chargebackSubmitted=$chargebackSubmitted, chargebackTimedOut=$chargebackTimedOut, createdAt=$createdAt, disputeFinancialTransactionId=$disputeFinancialTransactionId, merchantPrearbitrationDeclineSubmitted=$merchantPrearbitrationDeclineSubmitted, merchantPrearbitrationReceived=$merchantPrearbitrationReceived, merchantPrearbitrationTimedOut=$merchantPrearbitrationTimedOut, represented=$represented, representmentTimedOut=$representmentTimedOut, userPrearbitrationAccepted=$userPrearbitrationAccepted, userPrearbitrationDeclined=$userPrearbitrationDeclined, userPrearbitrationSubmitted=$userPrearbitrationSubmitted, userPrearbitrationTimedOut=$userPrearbitrationTimedOut, userWithdrawalSubmitted=$userWithdrawalSubmitted, additionalProperties=$additionalProperties}" + "NetworkEvent{attachmentFiles=$attachmentFiles, category=$category, createdAt=$createdAt, disputeFinancialTransactionId=$disputeFinancialTransactionId, chargebackAccepted=$chargebackAccepted, chargebackSubmitted=$chargebackSubmitted, chargebackTimedOut=$chargebackTimedOut, merchantPrearbitrationDeclineSubmitted=$merchantPrearbitrationDeclineSubmitted, merchantPrearbitrationReceived=$merchantPrearbitrationReceived, merchantPrearbitrationTimedOut=$merchantPrearbitrationTimedOut, represented=$represented, representmentTimedOut=$representmentTimedOut, userPrearbitrationAccepted=$userPrearbitrationAccepted, userPrearbitrationDeclined=$userPrearbitrationDeclined, userPrearbitrationSubmitted=$userPrearbitrationSubmitted, userPrearbitrationTimedOut=$userPrearbitrationTimedOut, userWithdrawalSubmitted=$userWithdrawalSubmitted, additionalProperties=$additionalProperties}" } /** @@ -11458,14 +11425,14 @@ private constructor( private val amount: JsonField, private val attachmentFiles: JsonField>, private val category: JsonField, - private val chargeback: JsonField, private val createdAt: JsonField, private val explanation: JsonField, private val furtherInformationRequestedAt: JsonField, private val furtherInformationRequestedReason: JsonField, - private val merchantPrearbitrationDecline: JsonField, private val status: JsonField, private val updatedAt: JsonField, + private val chargeback: JsonField, + private val merchantPrearbitrationDecline: JsonField, private val userPrearbitration: JsonField, private val additionalProperties: MutableMap, ) { @@ -11482,9 +11449,6 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), - @JsonProperty("chargeback") - @ExcludeMissing - chargeback: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), @@ -11497,16 +11461,19 @@ private constructor( @JsonProperty("further_information_requested_reason") @ExcludeMissing furtherInformationRequestedReason: JsonField = JsonMissing.of(), - @JsonProperty("merchant_prearbitration_decline") - @ExcludeMissing - merchantPrearbitrationDecline: JsonField = - JsonMissing.of(), @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), @JsonProperty("updated_at") @ExcludeMissing updatedAt: JsonField = JsonMissing.of(), + @JsonProperty("chargeback") + @ExcludeMissing + chargeback: JsonField = JsonMissing.of(), + @JsonProperty("merchant_prearbitration_decline") + @ExcludeMissing + merchantPrearbitrationDecline: JsonField = + JsonMissing.of(), @JsonProperty("user_prearbitration") @ExcludeMissing userPrearbitration: JsonField = JsonMissing.of(), @@ -11515,14 +11482,14 @@ private constructor( amount, attachmentFiles, category, - chargeback, createdAt, explanation, furtherInformationRequestedAt, furtherInformationRequestedReason, - merchantPrearbitrationDecline, status, updatedAt, + chargeback, + merchantPrearbitrationDecline, userPrearbitration, mutableMapOf(), ) @@ -11565,17 +11532,6 @@ private constructor( */ fun category(): Category = category.getRequired("category") - /** - * A Visa Card Dispute Chargeback User Submission Chargeback Details object. This field - * will be present in the JSON response if and only if `category` is equal to - * `chargeback`. Contains the details specific to a Visa chargeback User Submission for - * a Card Dispute. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun chargeback(): Optional = chargeback.getOptional("chargeback") - /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the * Visa Card Dispute User Submission was created. @@ -11617,18 +11573,6 @@ private constructor( "further_information_requested_reason" ) - /** - * A Visa Card Dispute Merchant Pre-Arbitration Decline User Submission object. This - * field will be present in the JSON response if and only if `category` is equal to - * `merchant_prearbitration_decline`. Contains the details specific to a merchant - * prearbitration decline Visa Card Dispute User Submission. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun merchantPrearbitrationDecline(): Optional = - merchantPrearbitrationDecline.getOptional("merchant_prearbitration_decline") - /** * The status of the Visa Card Dispute User Submission. * @@ -11648,6 +11592,29 @@ private constructor( */ fun updatedAt(): OffsetDateTime = updatedAt.getRequired("updated_at") + /** + * A Visa Card Dispute Chargeback User Submission Chargeback Details object. This field + * will be present in the JSON response if and only if `category` is equal to + * `chargeback`. Contains the details specific to a Visa chargeback User Submission for + * a Card Dispute. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun chargeback(): Optional = chargeback.getOptional("chargeback") + + /** + * A Visa Card Dispute Merchant Pre-Arbitration Decline User Submission object. This + * field will be present in the JSON response if and only if `category` is equal to + * `merchant_prearbitration_decline`. Contains the details specific to a merchant + * prearbitration decline Visa Card Dispute User Submission. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun merchantPrearbitrationDecline(): Optional = + merchantPrearbitrationDecline.getOptional("merchant_prearbitration_decline") + /** * A Visa Card Dispute User-Initiated Pre-Arbitration User Submission object. This field * will be present in the JSON response if and only if `category` is equal to @@ -11697,16 +11664,6 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category - /** - * Returns the raw JSON value of [chargeback]. - * - * Unlike [chargeback], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("chargeback") - @ExcludeMissing - fun _chargeback(): JsonField = chargeback - /** * Returns the raw JSON value of [createdAt]. * @@ -11749,17 +11706,6 @@ private constructor( fun _furtherInformationRequestedReason(): JsonField = furtherInformationRequestedReason - /** - * Returns the raw JSON value of [merchantPrearbitrationDecline]. - * - * Unlike [merchantPrearbitrationDecline], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("merchant_prearbitration_decline") - @ExcludeMissing - fun _merchantPrearbitrationDecline(): JsonField = - merchantPrearbitrationDecline - /** * Returns the raw JSON value of [status]. * @@ -11777,6 +11723,27 @@ private constructor( @ExcludeMissing fun _updatedAt(): JsonField = updatedAt + /** + * Returns the raw JSON value of [chargeback]. + * + * Unlike [chargeback], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("chargeback") + @ExcludeMissing + fun _chargeback(): JsonField = chargeback + + /** + * Returns the raw JSON value of [merchantPrearbitrationDecline]. + * + * Unlike [merchantPrearbitrationDecline], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("merchant_prearbitration_decline") + @ExcludeMissing + fun _merchantPrearbitrationDecline(): JsonField = + merchantPrearbitrationDecline + /** * Returns the raw JSON value of [userPrearbitration]. * @@ -11810,15 +11777,12 @@ private constructor( * .amount() * .attachmentFiles() * .category() - * .chargeback() * .createdAt() * .explanation() * .furtherInformationRequestedAt() * .furtherInformationRequestedReason() - * .merchantPrearbitrationDecline() * .status() * .updatedAt() - * .userPrearbitration() * ``` */ @JvmStatic fun builder() = Builder() @@ -11831,17 +11795,17 @@ private constructor( private var amount: JsonField? = null private var attachmentFiles: JsonField>? = null private var category: JsonField? = null - private var chargeback: JsonField? = null private var createdAt: JsonField? = null private var explanation: JsonField? = null private var furtherInformationRequestedAt: JsonField? = null private var furtherInformationRequestedReason: JsonField? = null - private var merchantPrearbitrationDecline: - JsonField? = - null private var status: JsonField? = null private var updatedAt: JsonField? = null - private var userPrearbitration: JsonField? = null + private var chargeback: JsonField = JsonMissing.of() + private var merchantPrearbitrationDecline: + JsonField = + JsonMissing.of() + private var userPrearbitration: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -11850,15 +11814,15 @@ private constructor( amount = userSubmission.amount attachmentFiles = userSubmission.attachmentFiles.map { it.toMutableList() } category = userSubmission.category - chargeback = userSubmission.chargeback createdAt = userSubmission.createdAt explanation = userSubmission.explanation furtherInformationRequestedAt = userSubmission.furtherInformationRequestedAt furtherInformationRequestedReason = userSubmission.furtherInformationRequestedReason - merchantPrearbitrationDecline = userSubmission.merchantPrearbitrationDecline status = userSubmission.status updatedAt = userSubmission.updatedAt + chargeback = userSubmission.chargeback + merchantPrearbitrationDecline = userSubmission.merchantPrearbitrationDecline userPrearbitration = userSubmission.userPrearbitration additionalProperties = userSubmission.additionalProperties.toMutableMap() } @@ -11953,30 +11917,6 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } - /** - * A Visa Card Dispute Chargeback User Submission Chargeback Details object. This - * field will be present in the JSON response if and only if `category` is equal to - * `chargeback`. Contains the details specific to a Visa chargeback User Submission - * for a Card Dispute. - */ - fun chargeback(chargeback: Chargeback?) = - chargeback(JsonField.ofNullable(chargeback)) - - /** Alias for calling [Builder.chargeback] with `chargeback.orElse(null)`. */ - fun chargeback(chargeback: Optional) = - chargeback(chargeback.getOrNull()) - - /** - * Sets [Builder.chargeback] to an arbitrary JSON value. - * - * You should usually call [Builder.chargeback] with a well-typed [Chargeback] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun chargeback(chargeback: JsonField) = apply { - this.chargeback = chargeback - } - /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the * Visa Card Dispute User Submission was created. @@ -12074,6 +12014,59 @@ private constructor( this.furtherInformationRequestedReason = furtherInformationRequestedReason } + /** The status of the Visa Card Dispute User Submission. */ + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * Visa Card Dispute User Submission was updated. + */ + fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) + + /** + * Sets [Builder.updatedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.updatedAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun updatedAt(updatedAt: JsonField) = apply { + this.updatedAt = updatedAt + } + + /** + * A Visa Card Dispute Chargeback User Submission Chargeback Details object. This + * field will be present in the JSON response if and only if `category` is equal to + * `chargeback`. Contains the details specific to a Visa chargeback User Submission + * for a Card Dispute. + */ + fun chargeback(chargeback: Chargeback?) = + chargeback(JsonField.ofNullable(chargeback)) + + /** Alias for calling [Builder.chargeback] with `chargeback.orElse(null)`. */ + fun chargeback(chargeback: Optional) = + chargeback(chargeback.getOrNull()) + + /** + * Sets [Builder.chargeback] to an arbitrary JSON value. + * + * You should usually call [Builder.chargeback] with a well-typed [Chargeback] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun chargeback(chargeback: JsonField) = apply { + this.chargeback = chargeback + } + /** * A Visa Card Dispute Merchant Pre-Arbitration Decline User Submission object. This * field will be present in the JSON response if and only if `category` is equal to @@ -12106,35 +12099,6 @@ private constructor( merchantPrearbitrationDecline: JsonField ) = apply { this.merchantPrearbitrationDecline = merchantPrearbitrationDecline } - /** The status of the Visa Card Dispute User Submission. */ - fun status(status: Status) = status(JsonField.of(status)) - - /** - * Sets [Builder.status] to an arbitrary JSON value. - * - * You should usually call [Builder.status] with a well-typed [Status] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun status(status: JsonField) = apply { this.status = status } - - /** - * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the - * Visa Card Dispute User Submission was updated. - */ - fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) - - /** - * Sets [Builder.updatedAt] to an arbitrary JSON value. - * - * You should usually call [Builder.updatedAt] with a well-typed [OffsetDateTime] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun updatedAt(updatedAt: JsonField) = apply { - this.updatedAt = updatedAt - } - /** * A Visa Card Dispute User-Initiated Pre-Arbitration User Submission object. This * field will be present in the JSON response if and only if `category` is equal to @@ -12195,15 +12159,12 @@ private constructor( * .amount() * .attachmentFiles() * .category() - * .chargeback() * .createdAt() * .explanation() * .furtherInformationRequestedAt() * .furtherInformationRequestedReason() - * .merchantPrearbitrationDecline() * .status() * .updatedAt() - * .userPrearbitration() * ``` * * @throws IllegalStateException if any required field is unset. @@ -12214,7 +12175,6 @@ private constructor( checkRequired("amount", amount), checkRequired("attachmentFiles", attachmentFiles).map { it.toImmutable() }, checkRequired("category", category), - checkRequired("chargeback", chargeback), checkRequired("createdAt", createdAt), checkRequired("explanation", explanation), checkRequired( @@ -12225,13 +12185,11 @@ private constructor( "furtherInformationRequestedReason", furtherInformationRequestedReason, ), - checkRequired( - "merchantPrearbitrationDecline", - merchantPrearbitrationDecline, - ), checkRequired("status", status), checkRequired("updatedAt", updatedAt), - checkRequired("userPrearbitration", userPrearbitration), + chargeback, + merchantPrearbitrationDecline, + userPrearbitration, additionalProperties.toMutableMap(), ) } @@ -12247,14 +12205,14 @@ private constructor( amount() attachmentFiles().forEach { it.validate() } category().validate() - chargeback().ifPresent { it.validate() } createdAt() explanation() furtherInformationRequestedAt() furtherInformationRequestedReason() - merchantPrearbitrationDecline().ifPresent { it.validate() } status().validate() updatedAt() + chargeback().ifPresent { it.validate() } + merchantPrearbitrationDecline().ifPresent { it.validate() } userPrearbitration().ifPresent { it.validate() } validated = true } @@ -12279,14 +12237,14 @@ private constructor( (if (amount.asKnown().isPresent) 1 else 0) + (attachmentFiles.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (category.asKnown().getOrNull()?.validity() ?: 0) + - (chargeback.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (if (explanation.asKnown().isPresent) 1 else 0) + (if (furtherInformationRequestedAt.asKnown().isPresent) 1 else 0) + (if (furtherInformationRequestedReason.asKnown().isPresent) 1 else 0) + - (merchantPrearbitrationDecline.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (updatedAt.asKnown().isPresent) 1 else 0) + + (chargeback.asKnown().getOrNull()?.validity() ?: 0) + + (merchantPrearbitrationDecline.asKnown().getOrNull()?.validity() ?: 0) + (userPrearbitration.asKnown().getOrNull()?.validity() ?: 0) class AttachmentFile @@ -12634,6 +12592,172 @@ private constructor( override fun toString() = value.toString() } + /** The status of the Visa Card Dispute User Submission. */ + class Status @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** The User Submission was abandoned. */ + @JvmField val ABANDONED = of("abandoned") + + /** The User Submission was accepted. */ + @JvmField val ACCEPTED = of("accepted") + + /** + * Further information is requested, please resubmit with the requested + * information. + */ + @JvmField + val FURTHER_INFORMATION_REQUESTED = of("further_information_requested") + + /** The User Submission is pending review. */ + @JvmField val PENDING_REVIEWING = of("pending_reviewing") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + /** The User Submission was abandoned. */ + ABANDONED, + /** The User Submission was accepted. */ + ACCEPTED, + /** + * Further information is requested, please resubmit with the requested + * information. + */ + FURTHER_INFORMATION_REQUESTED, + /** The User Submission is pending review. */ + PENDING_REVIEWING, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** The User Submission was abandoned. */ + ABANDONED, + /** The User Submission was accepted. */ + ACCEPTED, + /** + * Further information is requested, please resubmit with the requested + * information. + */ + FURTHER_INFORMATION_REQUESTED, + /** The User Submission is pending review. */ + PENDING_REVIEWING, + /** + * An enum member indicating that [Status] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ABANDONED -> Value.ABANDONED + ACCEPTED -> Value.ACCEPTED + FURTHER_INFORMATION_REQUESTED -> Value.FURTHER_INFORMATION_REQUESTED + PENDING_REVIEWING -> Value.PENDING_REVIEWING + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + ABANDONED -> Known.ABANDONED + ACCEPTED -> Known.ACCEPTED + FURTHER_INFORMATION_REQUESTED -> Known.FURTHER_INFORMATION_REQUESTED + PENDING_REVIEWING -> Known.PENDING_REVIEWING + else -> throw IncreaseInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** * A Visa Card Dispute Chargeback User Submission Chargeback Details object. This field * will be present in the JSON response if and only if `category` is equal to @@ -40224,172 +40348,6 @@ private constructor( "MerchantPrearbitrationDecline{reason=$reason, additionalProperties=$additionalProperties}" } - /** The status of the Visa Card Dispute User Submission. */ - class Status @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that - * doesn't match any known member, and you want to know that value. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** The User Submission was abandoned. */ - @JvmField val ABANDONED = of("abandoned") - - /** The User Submission was accepted. */ - @JvmField val ACCEPTED = of("accepted") - - /** - * Further information is requested, please resubmit with the requested - * information. - */ - @JvmField - val FURTHER_INFORMATION_REQUESTED = of("further_information_requested") - - /** The User Submission is pending review. */ - @JvmField val PENDING_REVIEWING = of("pending_reviewing") - - @JvmStatic fun of(value: String) = Status(JsonField.of(value)) - } - - /** An enum containing [Status]'s known values. */ - enum class Known { - /** The User Submission was abandoned. */ - ABANDONED, - /** The User Submission was accepted. */ - ACCEPTED, - /** - * Further information is requested, please resubmit with the requested - * information. - */ - FURTHER_INFORMATION_REQUESTED, - /** The User Submission is pending review. */ - PENDING_REVIEWING, - } - - /** - * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Status] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, - * if the SDK is on an older version than the API, then the API may respond with - * new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** The User Submission was abandoned. */ - ABANDONED, - /** The User Submission was accepted. */ - ACCEPTED, - /** - * Further information is requested, please resubmit with the requested - * information. - */ - FURTHER_INFORMATION_REQUESTED, - /** The User Submission is pending review. */ - PENDING_REVIEWING, - /** - * An enum member indicating that [Status] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if - * you want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - ABANDONED -> Value.ABANDONED - ACCEPTED -> Value.ACCEPTED - FURTHER_INFORMATION_REQUESTED -> Value.FURTHER_INFORMATION_REQUESTED - PENDING_REVIEWING -> Value.PENDING_REVIEWING - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a - * known member. - */ - fun known(): Known = - when (this) { - ABANDONED -> Known.ABANDONED - ACCEPTED -> Known.ACCEPTED - FURTHER_INFORMATION_REQUESTED -> Known.FURTHER_INFORMATION_REQUESTED - PENDING_REVIEWING -> Known.PENDING_REVIEWING - else -> throw IncreaseInvalidDataException("Unknown Status: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have - * the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Status = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Status && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** * A Visa Card Dispute User-Initiated Pre-Arbitration User Submission object. This field * will be present in the JSON response if and only if `category` is equal to @@ -41195,14 +41153,14 @@ private constructor( amount == other.amount && attachmentFiles == other.attachmentFiles && category == other.category && - chargeback == other.chargeback && createdAt == other.createdAt && explanation == other.explanation && furtherInformationRequestedAt == other.furtherInformationRequestedAt && furtherInformationRequestedReason == other.furtherInformationRequestedReason && - merchantPrearbitrationDecline == other.merchantPrearbitrationDecline && status == other.status && updatedAt == other.updatedAt && + chargeback == other.chargeback && + merchantPrearbitrationDecline == other.merchantPrearbitrationDecline && userPrearbitration == other.userPrearbitration && additionalProperties == other.additionalProperties } @@ -41213,14 +41171,14 @@ private constructor( amount, attachmentFiles, category, - chargeback, createdAt, explanation, furtherInformationRequestedAt, furtherInformationRequestedReason, - merchantPrearbitrationDecline, status, updatedAt, + chargeback, + merchantPrearbitrationDecline, userPrearbitration, additionalProperties, ) @@ -41229,7 +41187,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "UserSubmission{acceptedAt=$acceptedAt, amount=$amount, attachmentFiles=$attachmentFiles, category=$category, chargeback=$chargeback, createdAt=$createdAt, explanation=$explanation, furtherInformationRequestedAt=$furtherInformationRequestedAt, furtherInformationRequestedReason=$furtherInformationRequestedReason, merchantPrearbitrationDecline=$merchantPrearbitrationDecline, status=$status, updatedAt=$updatedAt, userPrearbitration=$userPrearbitration, additionalProperties=$additionalProperties}" + "UserSubmission{acceptedAt=$acceptedAt, amount=$amount, attachmentFiles=$attachmentFiles, category=$category, createdAt=$createdAt, explanation=$explanation, furtherInformationRequestedAt=$furtherInformationRequestedAt, furtherInformationRequestedReason=$furtherInformationRequestedReason, status=$status, updatedAt=$updatedAt, chargeback=$chargeback, merchantPrearbitrationDecline=$merchantPrearbitrationDecline, userPrearbitration=$userPrearbitration, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index cc1701eb4..a5ac9d552 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -521,6 +521,8 @@ private constructor( class Element @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val category: JsonField, + private val createdAt: JsonField, private val cardAuthentication: JsonField, private val cardAuthorization: JsonField, private val cardAuthorizationExpiration: JsonField, @@ -533,14 +535,18 @@ private constructor( private val cardReversal: JsonField, private val cardSettlement: JsonField, private val cardValidation: JsonField, - private val category: JsonField, - private val createdAt: JsonField, private val other: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), @JsonProperty("card_authentication") @ExcludeMissing cardAuthentication: JsonField = JsonMissing.of(), @@ -577,14 +583,10 @@ private constructor( @JsonProperty("card_validation") @ExcludeMissing cardValidation: JsonField = JsonMissing.of(), - @JsonProperty("category") - @ExcludeMissing - category: JsonField = JsonMissing.of(), - @JsonProperty("created_at") - @ExcludeMissing - createdAt: JsonField = JsonMissing.of(), @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), ) : this( + category, + createdAt, cardAuthentication, cardAuthorization, cardAuthorizationExpiration, @@ -597,12 +599,28 @@ private constructor( cardReversal, cardSettlement, cardValidation, - category, - createdAt, other, mutableMapOf(), ) + /** + * The type of the resource. We may add additional possible values for this enum over time; + * your application should be able to handle such additions gracefully. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun category(): Category = category.getRequired("category") + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the card + * payment element was created. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + /** * A Card Authentication object. This field will be present in the JSON response if and only * if `category` is equal to `card_authentication`. Card Authentications are attempts to @@ -734,31 +752,29 @@ private constructor( cardValidation.getOptional("card_validation") /** - * The type of the resource. We may add additional possible values for this enum over time; - * your application should be able to handle such additions gracefully. + * If the category of this Transaction source is equal to `other`, this field will contain + * an empty object, otherwise it will contain null. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - fun category(): Category = category.getRequired("category") + fun other(): Optional = other.getOptional("other") /** - * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the card - * payment element was created. + * Returns the raw JSON value of [category]. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. */ - fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category /** - * If the category of this Transaction source is equal to `other`, this field will contain - * an empty object, otherwise it will contain null. + * Returns the raw JSON value of [createdAt]. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. */ - fun other(): Optional = other.getOptional("other") + @JsonProperty("created_at") + @ExcludeMissing + fun _createdAt(): JsonField = createdAt /** * Returns the raw JSON value of [cardAuthentication]. @@ -879,22 +895,6 @@ private constructor( @ExcludeMissing fun _cardValidation(): JsonField = cardValidation - /** - * Returns the raw JSON value of [category]. - * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category - - /** - * Returns the raw JSON value of [createdAt]. - * - * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("created_at") - @ExcludeMissing - fun _createdAt(): JsonField = createdAt - /** * Returns the raw JSON value of [other]. * @@ -921,21 +921,8 @@ private constructor( * * The following fields are required: * ```java - * .cardAuthentication() - * .cardAuthorization() - * .cardAuthorizationExpiration() - * .cardBalanceInquiry() - * .cardDecline() - * .cardFinancial() - * .cardFuelConfirmation() - * .cardIncrement() - * .cardRefund() - * .cardReversal() - * .cardSettlement() - * .cardValidation() * .category() * .createdAt() - * .other() * ``` */ @JvmStatic fun builder() = Builder() @@ -944,25 +931,28 @@ private constructor( /** A builder for [Element]. */ class Builder internal constructor() { - private var cardAuthentication: JsonField? = null - private var cardAuthorization: JsonField? = null - private var cardAuthorizationExpiration: JsonField? = null - private var cardBalanceInquiry: JsonField? = null - private var cardDecline: JsonField? = null - private var cardFinancial: JsonField? = null - private var cardFuelConfirmation: JsonField? = null - private var cardIncrement: JsonField? = null - private var cardRefund: JsonField? = null - private var cardReversal: JsonField? = null - private var cardSettlement: JsonField? = null - private var cardValidation: JsonField? = null private var category: JsonField? = null private var createdAt: JsonField? = null - private var other: JsonField? = null + private var cardAuthentication: JsonField = JsonMissing.of() + private var cardAuthorization: JsonField = JsonMissing.of() + private var cardAuthorizationExpiration: JsonField = + JsonMissing.of() + private var cardBalanceInquiry: JsonField = JsonMissing.of() + private var cardDecline: JsonField = JsonMissing.of() + private var cardFinancial: JsonField = JsonMissing.of() + private var cardFuelConfirmation: JsonField = JsonMissing.of() + private var cardIncrement: JsonField = JsonMissing.of() + private var cardRefund: JsonField = JsonMissing.of() + private var cardReversal: JsonField = JsonMissing.of() + private var cardSettlement: JsonField = JsonMissing.of() + private var cardValidation: JsonField = JsonMissing.of() + private var other: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(element: Element) = apply { + category = element.category + createdAt = element.createdAt cardAuthentication = element.cardAuthentication cardAuthorization = element.cardAuthorization cardAuthorizationExpiration = element.cardAuthorizationExpiration @@ -975,12 +965,42 @@ private constructor( cardReversal = element.cardReversal cardSettlement = element.cardSettlement cardValidation = element.cardValidation - category = element.category - createdAt = element.createdAt other = element.other additionalProperties = element.additionalProperties.toMutableMap() } + /** + * The type of the resource. We may add additional possible values for this enum over + * time; your application should be able to handle such additions gracefully. + */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * card payment element was created. + */ + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun createdAt(createdAt: JsonField) = apply { + this.createdAt = createdAt + } + /** * A Card Authentication object. This field will be present in the JSON response if and * only if `category` is equal to `card_authentication`. Card Authentications are @@ -1279,38 +1299,6 @@ private constructor( this.cardValidation = cardValidation } - /** - * The type of the resource. We may add additional possible values for this enum over - * time; your application should be able to handle such additions gracefully. - */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - - /** - * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the - * card payment element was created. - */ - fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - - /** - * Sets [Builder.createdAt] to an arbitrary JSON value. - * - * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun createdAt(createdAt: JsonField) = apply { - this.createdAt = createdAt - } - /** * If the category of this Transaction source is equal to `other`, this field will * contain an empty object, otherwise it will contain null. @@ -1355,42 +1343,29 @@ private constructor( * * The following fields are required: * ```java - * .cardAuthentication() - * .cardAuthorization() - * .cardAuthorizationExpiration() - * .cardBalanceInquiry() - * .cardDecline() - * .cardFinancial() - * .cardFuelConfirmation() - * .cardIncrement() - * .cardRefund() - * .cardReversal() - * .cardSettlement() - * .cardValidation() * .category() * .createdAt() - * .other() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): Element = Element( - checkRequired("cardAuthentication", cardAuthentication), - checkRequired("cardAuthorization", cardAuthorization), - checkRequired("cardAuthorizationExpiration", cardAuthorizationExpiration), - checkRequired("cardBalanceInquiry", cardBalanceInquiry), - checkRequired("cardDecline", cardDecline), - checkRequired("cardFinancial", cardFinancial), - checkRequired("cardFuelConfirmation", cardFuelConfirmation), - checkRequired("cardIncrement", cardIncrement), - checkRequired("cardRefund", cardRefund), - checkRequired("cardReversal", cardReversal), - checkRequired("cardSettlement", cardSettlement), - checkRequired("cardValidation", cardValidation), checkRequired("category", category), checkRequired("createdAt", createdAt), - checkRequired("other", other), + cardAuthentication, + cardAuthorization, + cardAuthorizationExpiration, + cardBalanceInquiry, + cardDecline, + cardFinancial, + cardFuelConfirmation, + cardIncrement, + cardRefund, + cardReversal, + cardSettlement, + cardValidation, + other, additionalProperties.toMutableMap(), ) } @@ -1402,6 +1377,8 @@ private constructor( return@apply } + category().validate() + createdAt() cardAuthentication().ifPresent { it.validate() } cardAuthorization().ifPresent { it.validate() } cardAuthorizationExpiration().ifPresent { it.validate() } @@ -1414,8 +1391,6 @@ private constructor( cardReversal().ifPresent { it.validate() } cardSettlement().ifPresent { it.validate() } cardValidation().ifPresent { it.validate() } - category().validate() - createdAt() other().ifPresent { it.validate() } validated = true } @@ -1436,7 +1411,9 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (cardAuthentication.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (cardAuthentication.asKnown().getOrNull()?.validity() ?: 0) + (cardAuthorization.asKnown().getOrNull()?.validity() ?: 0) + (cardAuthorizationExpiration.asKnown().getOrNull()?.validity() ?: 0) + (cardBalanceInquiry.asKnown().getOrNull()?.validity() ?: 0) + @@ -1448,10 +1425,271 @@ private constructor( (cardReversal.asKnown().getOrNull()?.validity() ?: 0) + (cardSettlement.asKnown().getOrNull()?.validity() ?: 0) + (cardValidation.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + - (if (createdAt.asKnown().isPresent) 1 else 0) + (other.asKnown().getOrNull()?.validity() ?: 0) + /** + * The type of the resource. We may add additional possible values for this enum over time; + * your application should be able to handle such additions gracefully. + */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** Card Authorization: details will be under the `card_authorization` object. */ + @JvmField val CARD_AUTHORIZATION = of("card_authorization") + + /** Card Authentication: details will be under the `card_authentication` object. */ + @JvmField val CARD_AUTHENTICATION = of("card_authentication") + + /** + * Card Balance Inquiry: details will be under the `card_balance_inquiry` object. + */ + @JvmField val CARD_BALANCE_INQUIRY = of("card_balance_inquiry") + + /** Inbound Card Validation: details will be under the `card_validation` object. */ + @JvmField val CARD_VALIDATION = of("card_validation") + + /** Card Decline: details will be under the `card_decline` object. */ + @JvmField val CARD_DECLINE = of("card_decline") + + /** Card Reversal: details will be under the `card_reversal` object. */ + @JvmField val CARD_REVERSAL = of("card_reversal") + + /** + * Card Authorization Expiration: details will be under the + * `card_authorization_expiration` object. + */ + @JvmField val CARD_AUTHORIZATION_EXPIRATION = of("card_authorization_expiration") + + /** Card Increment: details will be under the `card_increment` object. */ + @JvmField val CARD_INCREMENT = of("card_increment") + + /** Card Settlement: details will be under the `card_settlement` object. */ + @JvmField val CARD_SETTLEMENT = of("card_settlement") + + /** Card Refund: details will be under the `card_refund` object. */ + @JvmField val CARD_REFUND = of("card_refund") + + /** + * Card Fuel Confirmation: details will be under the `card_fuel_confirmation` + * object. + */ + @JvmField val CARD_FUEL_CONFIRMATION = of("card_fuel_confirmation") + + /** Card Financial: details will be under the `card_financial` object. */ + @JvmField val CARD_FINANCIAL = of("card_financial") + + /** Unknown card payment element. */ + @JvmField val OTHER = of("other") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** Card Authorization: details will be under the `card_authorization` object. */ + CARD_AUTHORIZATION, + /** Card Authentication: details will be under the `card_authentication` object. */ + CARD_AUTHENTICATION, + /** + * Card Balance Inquiry: details will be under the `card_balance_inquiry` object. + */ + CARD_BALANCE_INQUIRY, + /** Inbound Card Validation: details will be under the `card_validation` object. */ + CARD_VALIDATION, + /** Card Decline: details will be under the `card_decline` object. */ + CARD_DECLINE, + /** Card Reversal: details will be under the `card_reversal` object. */ + CARD_REVERSAL, + /** + * Card Authorization Expiration: details will be under the + * `card_authorization_expiration` object. + */ + CARD_AUTHORIZATION_EXPIRATION, + /** Card Increment: details will be under the `card_increment` object. */ + CARD_INCREMENT, + /** Card Settlement: details will be under the `card_settlement` object. */ + CARD_SETTLEMENT, + /** Card Refund: details will be under the `card_refund` object. */ + CARD_REFUND, + /** + * Card Fuel Confirmation: details will be under the `card_fuel_confirmation` + * object. + */ + CARD_FUEL_CONFIRMATION, + /** Card Financial: details will be under the `card_financial` object. */ + CARD_FINANCIAL, + /** Unknown card payment element. */ + OTHER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** Card Authorization: details will be under the `card_authorization` object. */ + CARD_AUTHORIZATION, + /** Card Authentication: details will be under the `card_authentication` object. */ + CARD_AUTHENTICATION, + /** + * Card Balance Inquiry: details will be under the `card_balance_inquiry` object. + */ + CARD_BALANCE_INQUIRY, + /** Inbound Card Validation: details will be under the `card_validation` object. */ + CARD_VALIDATION, + /** Card Decline: details will be under the `card_decline` object. */ + CARD_DECLINE, + /** Card Reversal: details will be under the `card_reversal` object. */ + CARD_REVERSAL, + /** + * Card Authorization Expiration: details will be under the + * `card_authorization_expiration` object. + */ + CARD_AUTHORIZATION_EXPIRATION, + /** Card Increment: details will be under the `card_increment` object. */ + CARD_INCREMENT, + /** Card Settlement: details will be under the `card_settlement` object. */ + CARD_SETTLEMENT, + /** Card Refund: details will be under the `card_refund` object. */ + CARD_REFUND, + /** + * Card Fuel Confirmation: details will be under the `card_fuel_confirmation` + * object. + */ + CARD_FUEL_CONFIRMATION, + /** Card Financial: details will be under the `card_financial` object. */ + CARD_FINANCIAL, + /** Unknown card payment element. */ + OTHER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + CARD_AUTHORIZATION -> Value.CARD_AUTHORIZATION + CARD_AUTHENTICATION -> Value.CARD_AUTHENTICATION + CARD_BALANCE_INQUIRY -> Value.CARD_BALANCE_INQUIRY + CARD_VALIDATION -> Value.CARD_VALIDATION + CARD_DECLINE -> Value.CARD_DECLINE + CARD_REVERSAL -> Value.CARD_REVERSAL + CARD_AUTHORIZATION_EXPIRATION -> Value.CARD_AUTHORIZATION_EXPIRATION + CARD_INCREMENT -> Value.CARD_INCREMENT + CARD_SETTLEMENT -> Value.CARD_SETTLEMENT + CARD_REFUND -> Value.CARD_REFUND + CARD_FUEL_CONFIRMATION -> Value.CARD_FUEL_CONFIRMATION + CARD_FINANCIAL -> Value.CARD_FINANCIAL + OTHER -> Value.OTHER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + CARD_AUTHORIZATION -> Known.CARD_AUTHORIZATION + CARD_AUTHENTICATION -> Known.CARD_AUTHENTICATION + CARD_BALANCE_INQUIRY -> Known.CARD_BALANCE_INQUIRY + CARD_VALIDATION -> Known.CARD_VALIDATION + CARD_DECLINE -> Known.CARD_DECLINE + CARD_REVERSAL -> Known.CARD_REVERSAL + CARD_AUTHORIZATION_EXPIRATION -> Known.CARD_AUTHORIZATION_EXPIRATION + CARD_INCREMENT -> Known.CARD_INCREMENT + CARD_SETTLEMENT -> Known.CARD_SETTLEMENT + CARD_REFUND -> Known.CARD_REFUND + CARD_FUEL_CONFIRMATION -> Known.CARD_FUEL_CONFIRMATION + CARD_FINANCIAL -> Known.CARD_FINANCIAL + OTHER -> Known.OTHER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** * A Card Authentication object. This field will be present in the JSON response if and only * if `category` is equal to `card_authentication`. Card Authentications are attempts to @@ -76145,269 +76383,6 @@ private constructor( "CardValidation{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, cardPaymentId=$cardPaymentId, currency=$currency, digitalWalletTokenId=$digitalWalletTokenId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, realTimeDecisionId=$realTimeDecisionId, terminalId=$terminalId, type=$type, verification=$verification, additionalProperties=$additionalProperties}" } - /** - * The type of the resource. We may add additional possible values for this enum over time; - * your application should be able to handle such additions gracefully. - */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** Card Authorization: details will be under the `card_authorization` object. */ - @JvmField val CARD_AUTHORIZATION = of("card_authorization") - - /** Card Authentication: details will be under the `card_authentication` object. */ - @JvmField val CARD_AUTHENTICATION = of("card_authentication") - - /** - * Card Balance Inquiry: details will be under the `card_balance_inquiry` object. - */ - @JvmField val CARD_BALANCE_INQUIRY = of("card_balance_inquiry") - - /** Inbound Card Validation: details will be under the `card_validation` object. */ - @JvmField val CARD_VALIDATION = of("card_validation") - - /** Card Decline: details will be under the `card_decline` object. */ - @JvmField val CARD_DECLINE = of("card_decline") - - /** Card Reversal: details will be under the `card_reversal` object. */ - @JvmField val CARD_REVERSAL = of("card_reversal") - - /** - * Card Authorization Expiration: details will be under the - * `card_authorization_expiration` object. - */ - @JvmField val CARD_AUTHORIZATION_EXPIRATION = of("card_authorization_expiration") - - /** Card Increment: details will be under the `card_increment` object. */ - @JvmField val CARD_INCREMENT = of("card_increment") - - /** Card Settlement: details will be under the `card_settlement` object. */ - @JvmField val CARD_SETTLEMENT = of("card_settlement") - - /** Card Refund: details will be under the `card_refund` object. */ - @JvmField val CARD_REFUND = of("card_refund") - - /** - * Card Fuel Confirmation: details will be under the `card_fuel_confirmation` - * object. - */ - @JvmField val CARD_FUEL_CONFIRMATION = of("card_fuel_confirmation") - - /** Card Financial: details will be under the `card_financial` object. */ - @JvmField val CARD_FINANCIAL = of("card_financial") - - /** Unknown card payment element. */ - @JvmField val OTHER = of("other") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** Card Authorization: details will be under the `card_authorization` object. */ - CARD_AUTHORIZATION, - /** Card Authentication: details will be under the `card_authentication` object. */ - CARD_AUTHENTICATION, - /** - * Card Balance Inquiry: details will be under the `card_balance_inquiry` object. - */ - CARD_BALANCE_INQUIRY, - /** Inbound Card Validation: details will be under the `card_validation` object. */ - CARD_VALIDATION, - /** Card Decline: details will be under the `card_decline` object. */ - CARD_DECLINE, - /** Card Reversal: details will be under the `card_reversal` object. */ - CARD_REVERSAL, - /** - * Card Authorization Expiration: details will be under the - * `card_authorization_expiration` object. - */ - CARD_AUTHORIZATION_EXPIRATION, - /** Card Increment: details will be under the `card_increment` object. */ - CARD_INCREMENT, - /** Card Settlement: details will be under the `card_settlement` object. */ - CARD_SETTLEMENT, - /** Card Refund: details will be under the `card_refund` object. */ - CARD_REFUND, - /** - * Card Fuel Confirmation: details will be under the `card_fuel_confirmation` - * object. - */ - CARD_FUEL_CONFIRMATION, - /** Card Financial: details will be under the `card_financial` object. */ - CARD_FINANCIAL, - /** Unknown card payment element. */ - OTHER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** Card Authorization: details will be under the `card_authorization` object. */ - CARD_AUTHORIZATION, - /** Card Authentication: details will be under the `card_authentication` object. */ - CARD_AUTHENTICATION, - /** - * Card Balance Inquiry: details will be under the `card_balance_inquiry` object. - */ - CARD_BALANCE_INQUIRY, - /** Inbound Card Validation: details will be under the `card_validation` object. */ - CARD_VALIDATION, - /** Card Decline: details will be under the `card_decline` object. */ - CARD_DECLINE, - /** Card Reversal: details will be under the `card_reversal` object. */ - CARD_REVERSAL, - /** - * Card Authorization Expiration: details will be under the - * `card_authorization_expiration` object. - */ - CARD_AUTHORIZATION_EXPIRATION, - /** Card Increment: details will be under the `card_increment` object. */ - CARD_INCREMENT, - /** Card Settlement: details will be under the `card_settlement` object. */ - CARD_SETTLEMENT, - /** Card Refund: details will be under the `card_refund` object. */ - CARD_REFUND, - /** - * Card Fuel Confirmation: details will be under the `card_fuel_confirmation` - * object. - */ - CARD_FUEL_CONFIRMATION, - /** Card Financial: details will be under the `card_financial` object. */ - CARD_FINANCIAL, - /** Unknown card payment element. */ - OTHER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - CARD_AUTHORIZATION -> Value.CARD_AUTHORIZATION - CARD_AUTHENTICATION -> Value.CARD_AUTHENTICATION - CARD_BALANCE_INQUIRY -> Value.CARD_BALANCE_INQUIRY - CARD_VALIDATION -> Value.CARD_VALIDATION - CARD_DECLINE -> Value.CARD_DECLINE - CARD_REVERSAL -> Value.CARD_REVERSAL - CARD_AUTHORIZATION_EXPIRATION -> Value.CARD_AUTHORIZATION_EXPIRATION - CARD_INCREMENT -> Value.CARD_INCREMENT - CARD_SETTLEMENT -> Value.CARD_SETTLEMENT - CARD_REFUND -> Value.CARD_REFUND - CARD_FUEL_CONFIRMATION -> Value.CARD_FUEL_CONFIRMATION - CARD_FINANCIAL -> Value.CARD_FINANCIAL - OTHER -> Value.OTHER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - CARD_AUTHORIZATION -> Known.CARD_AUTHORIZATION - CARD_AUTHENTICATION -> Known.CARD_AUTHENTICATION - CARD_BALANCE_INQUIRY -> Known.CARD_BALANCE_INQUIRY - CARD_VALIDATION -> Known.CARD_VALIDATION - CARD_DECLINE -> Known.CARD_DECLINE - CARD_REVERSAL -> Known.CARD_REVERSAL - CARD_AUTHORIZATION_EXPIRATION -> Known.CARD_AUTHORIZATION_EXPIRATION - CARD_INCREMENT -> Known.CARD_INCREMENT - CARD_SETTLEMENT -> Known.CARD_SETTLEMENT - CARD_REFUND -> Known.CARD_REFUND - CARD_FUEL_CONFIRMATION -> Known.CARD_FUEL_CONFIRMATION - CARD_FINANCIAL -> Known.CARD_FINANCIAL - OTHER -> Known.OTHER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** * If the category of this Transaction source is equal to `other`, this field will contain * an empty object, otherwise it will contain null. @@ -76523,6 +76498,8 @@ private constructor( } return other is Element && + category == other.category && + createdAt == other.createdAt && cardAuthentication == other.cardAuthentication && cardAuthorization == other.cardAuthorization && cardAuthorizationExpiration == other.cardAuthorizationExpiration && @@ -76535,14 +76512,14 @@ private constructor( cardReversal == other.cardReversal && cardSettlement == other.cardSettlement && cardValidation == other.cardValidation && - category == other.category && - createdAt == other.createdAt && this.other == other.other && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { Objects.hash( + category, + createdAt, cardAuthentication, cardAuthorization, cardAuthorizationExpiration, @@ -76555,8 +76532,6 @@ private constructor( cardReversal, cardSettlement, cardValidation, - category, - createdAt, other, additionalProperties, ) @@ -76565,7 +76540,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Element{cardAuthentication=$cardAuthentication, cardAuthorization=$cardAuthorization, cardAuthorizationExpiration=$cardAuthorizationExpiration, cardBalanceInquiry=$cardBalanceInquiry, cardDecline=$cardDecline, cardFinancial=$cardFinancial, cardFuelConfirmation=$cardFuelConfirmation, cardIncrement=$cardIncrement, cardRefund=$cardRefund, cardReversal=$cardReversal, cardSettlement=$cardSettlement, cardValidation=$cardValidation, category=$category, createdAt=$createdAt, other=$other, additionalProperties=$additionalProperties}" + "Element{category=$category, createdAt=$createdAt, cardAuthentication=$cardAuthentication, cardAuthorization=$cardAuthorization, cardAuthorizationExpiration=$cardAuthorizationExpiration, cardBalanceInquiry=$cardBalanceInquiry, cardDecline=$cardDecline, cardFinancial=$cardFinancial, cardFuelConfirmation=$cardFuelConfirmation, cardIncrement=$cardIncrement, cardRefund=$cardRefund, cardReversal=$cardReversal, cardSettlement=$cardSettlement, cardValidation=$cardValidation, other=$other, additionalProperties=$additionalProperties}" } /** The summarized state of this card payment. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt index 38886662f..cba95406a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransfer.kt @@ -2601,8 +2601,8 @@ private constructor( class CreatedBy @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val apiKey: JsonField, private val category: JsonField, + private val apiKey: JsonField, private val oauthApplication: JsonField, private val user: JsonField, private val additionalProperties: MutableMap, @@ -2610,23 +2610,15 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("oauth_application") @ExcludeMissing oauthApplication: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), - ) : this(apiKey, category, oauthApplication, user, mutableMapOf()) - - /** - * If present, details about the API key that created the transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun apiKey(): Optional = apiKey.getOptional("api_key") + ) : this(category, apiKey, oauthApplication, user, mutableMapOf()) /** * The type of object that created this transfer. @@ -2636,6 +2628,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * If present, details about the API key that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun apiKey(): Optional = apiKey.getOptional("api_key") + /** * If present, details about the OAuth Application that created the transfer. * @@ -2654,18 +2654,18 @@ private constructor( fun user(): Optional = user.getOptional("user") /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [category]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category /** - * Returns the raw JSON value of [category]. + * Returns the raw JSON value of [apiKey]. * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey /** * Returns the raw JSON value of [oauthApplication]. @@ -2703,10 +2703,7 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` */ @JvmStatic fun builder() = Builder() @@ -2715,21 +2712,33 @@ private constructor( /** A builder for [CreatedBy]. */ class Builder internal constructor() { - private var apiKey: JsonField? = null private var category: JsonField? = null - private var oauthApplication: JsonField? = null - private var user: JsonField? = null + private var apiKey: JsonField = JsonMissing.of() + private var oauthApplication: JsonField = JsonMissing.of() + private var user: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(createdBy: CreatedBy) = apply { - apiKey = createdBy.apiKey category = createdBy.category + apiKey = createdBy.apiKey oauthApplication = createdBy.oauthApplication user = createdBy.user additionalProperties = createdBy.additionalProperties.toMutableMap() } + /** The type of object that created this transfer. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** If present, details about the API key that created the transfer. */ fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey)) @@ -2745,18 +2754,6 @@ private constructor( */ fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } - /** The type of object that created this transfer. */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** If present, details about the OAuth Application that created the transfer. */ fun oauthApplication(oauthApplication: OAuthApplication?) = oauthApplication(JsonField.ofNullable(oauthApplication)) @@ -2819,20 +2816,17 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): CreatedBy = CreatedBy( - checkRequired("apiKey", apiKey), checkRequired("category", category), - checkRequired("oauthApplication", oauthApplication), - checkRequired("user", user), + apiKey, + oauthApplication, + user, additionalProperties.toMutableMap(), ) } @@ -2844,8 +2838,8 @@ private constructor( return@apply } - apiKey().ifPresent { it.validate() } category().validate() + apiKey().ifPresent { it.validate() } oauthApplication().ifPresent { it.validate() } user().ifPresent { it.validate() } validated = true @@ -2867,11 +2861,166 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (apiKey.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + (user.asKnown().getOrNull()?.validity() ?: 0) + /** The type of object that created this transfer. */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** If present, details about the API key that created the transfer. */ class ApiKey @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -3048,161 +3197,6 @@ private constructor( "ApiKey{description=$description, additionalProperties=$additionalProperties}" } - /** The type of object that created this transfer. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** An API key. Details will be under the `api_key` object. */ - @JvmField val API_KEY = of("api_key") - - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - @JvmField val OAUTH_APPLICATION = of("oauth_application") - - /** A User in the Increase dashboard. Details will be under the `user` object. */ - @JvmField val USER = of("user") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - API_KEY -> Value.API_KEY - OAUTH_APPLICATION -> Value.OAUTH_APPLICATION - USER -> Value.USER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - API_KEY -> Known.API_KEY - OAUTH_APPLICATION -> Known.OAUTH_APPLICATION - USER -> Known.USER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** If present, details about the OAuth Application that created the transfer. */ class OAuthApplication @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -3534,21 +3528,21 @@ private constructor( } return other is CreatedBy && - apiKey == other.apiKey && category == other.category && + apiKey == other.apiKey && oauthApplication == other.oauthApplication && user == other.user && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + Objects.hash(category, apiKey, oauthApplication, user, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + "CreatedBy{category=$category, apiKey=$apiKey, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidation.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidation.kt index becd95487..e027899e6 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidation.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidation.kt @@ -2841,8 +2841,8 @@ private constructor( class CreatedBy @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val apiKey: JsonField, private val category: JsonField, + private val apiKey: JsonField, private val oauthApplication: JsonField, private val user: JsonField, private val additionalProperties: MutableMap, @@ -2850,23 +2850,15 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("oauth_application") @ExcludeMissing oauthApplication: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), - ) : this(apiKey, category, oauthApplication, user, mutableMapOf()) - - /** - * If present, details about the API key that created the transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun apiKey(): Optional = apiKey.getOptional("api_key") + ) : this(category, apiKey, oauthApplication, user, mutableMapOf()) /** * The type of object that created this transfer. @@ -2876,6 +2868,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * If present, details about the API key that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun apiKey(): Optional = apiKey.getOptional("api_key") + /** * If present, details about the OAuth Application that created the transfer. * @@ -2894,18 +2894,18 @@ private constructor( fun user(): Optional = user.getOptional("user") /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [category]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category /** - * Returns the raw JSON value of [category]. + * Returns the raw JSON value of [apiKey]. * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey /** * Returns the raw JSON value of [oauthApplication]. @@ -2943,10 +2943,7 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` */ @JvmStatic fun builder() = Builder() @@ -2955,21 +2952,33 @@ private constructor( /** A builder for [CreatedBy]. */ class Builder internal constructor() { - private var apiKey: JsonField? = null private var category: JsonField? = null - private var oauthApplication: JsonField? = null - private var user: JsonField? = null + private var apiKey: JsonField = JsonMissing.of() + private var oauthApplication: JsonField = JsonMissing.of() + private var user: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(createdBy: CreatedBy) = apply { - apiKey = createdBy.apiKey category = createdBy.category + apiKey = createdBy.apiKey oauthApplication = createdBy.oauthApplication user = createdBy.user additionalProperties = createdBy.additionalProperties.toMutableMap() } + /** The type of object that created this transfer. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** If present, details about the API key that created the transfer. */ fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey)) @@ -2985,18 +2994,6 @@ private constructor( */ fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } - /** The type of object that created this transfer. */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** If present, details about the OAuth Application that created the transfer. */ fun oauthApplication(oauthApplication: OAuthApplication?) = oauthApplication(JsonField.ofNullable(oauthApplication)) @@ -3059,20 +3056,17 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): CreatedBy = CreatedBy( - checkRequired("apiKey", apiKey), checkRequired("category", category), - checkRequired("oauthApplication", oauthApplication), - checkRequired("user", user), + apiKey, + oauthApplication, + user, additionalProperties.toMutableMap(), ) } @@ -3084,8 +3078,8 @@ private constructor( return@apply } - apiKey().ifPresent { it.validate() } category().validate() + apiKey().ifPresent { it.validate() } oauthApplication().ifPresent { it.validate() } user().ifPresent { it.validate() } validated = true @@ -3107,11 +3101,166 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (apiKey.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + (user.asKnown().getOrNull()?.validity() ?: 0) + /** The type of object that created this transfer. */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** If present, details about the API key that created the transfer. */ class ApiKey @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -3288,161 +3437,6 @@ private constructor( "ApiKey{description=$description, additionalProperties=$additionalProperties}" } - /** The type of object that created this transfer. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** An API key. Details will be under the `api_key` object. */ - @JvmField val API_KEY = of("api_key") - - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - @JvmField val OAUTH_APPLICATION = of("oauth_application") - - /** A User in the Increase dashboard. Details will be under the `user` object. */ - @JvmField val USER = of("user") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - API_KEY -> Value.API_KEY - OAUTH_APPLICATION -> Value.OAUTH_APPLICATION - USER -> Value.USER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - API_KEY -> Known.API_KEY - OAUTH_APPLICATION -> Known.OAUTH_APPLICATION - USER -> Known.USER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** If present, details about the OAuth Application that created the transfer. */ class OAuthApplication @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -3774,21 +3768,21 @@ private constructor( } return other is CreatedBy && - apiKey == other.apiKey && category == other.category && + apiKey == other.apiKey && oauthApplication == other.oauthApplication && user == other.user && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + Objects.hash(category, apiKey, oauthApplication, user, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + "CreatedBy{category=$category, apiKey=$apiKey, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt index d36e84f73..fafdaef5c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt @@ -1889,8 +1889,8 @@ private constructor( class CreatedBy @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val apiKey: JsonField, private val category: JsonField, + private val apiKey: JsonField, private val oauthApplication: JsonField, private val user: JsonField, private val additionalProperties: MutableMap, @@ -1898,23 +1898,15 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("oauth_application") @ExcludeMissing oauthApplication: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), - ) : this(apiKey, category, oauthApplication, user, mutableMapOf()) - - /** - * If present, details about the API key that created the transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun apiKey(): Optional = apiKey.getOptional("api_key") + ) : this(category, apiKey, oauthApplication, user, mutableMapOf()) /** * The type of object that created this transfer. @@ -1924,6 +1916,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * If present, details about the API key that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun apiKey(): Optional = apiKey.getOptional("api_key") + /** * If present, details about the OAuth Application that created the transfer. * @@ -1942,18 +1942,18 @@ private constructor( fun user(): Optional = user.getOptional("user") /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [category]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category /** - * Returns the raw JSON value of [category]. + * Returns the raw JSON value of [apiKey]. * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey /** * Returns the raw JSON value of [oauthApplication]. @@ -1991,10 +1991,7 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` */ @JvmStatic fun builder() = Builder() @@ -2003,21 +2000,33 @@ private constructor( /** A builder for [CreatedBy]. */ class Builder internal constructor() { - private var apiKey: JsonField? = null private var category: JsonField? = null - private var oauthApplication: JsonField? = null - private var user: JsonField? = null + private var apiKey: JsonField = JsonMissing.of() + private var oauthApplication: JsonField = JsonMissing.of() + private var user: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(createdBy: CreatedBy) = apply { - apiKey = createdBy.apiKey category = createdBy.category + apiKey = createdBy.apiKey oauthApplication = createdBy.oauthApplication user = createdBy.user additionalProperties = createdBy.additionalProperties.toMutableMap() } + /** The type of object that created this transfer. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** If present, details about the API key that created the transfer. */ fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey)) @@ -2033,18 +2042,6 @@ private constructor( */ fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } - /** The type of object that created this transfer. */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** If present, details about the OAuth Application that created the transfer. */ fun oauthApplication(oauthApplication: OAuthApplication?) = oauthApplication(JsonField.ofNullable(oauthApplication)) @@ -2107,20 +2104,17 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): CreatedBy = CreatedBy( - checkRequired("apiKey", apiKey), checkRequired("category", category), - checkRequired("oauthApplication", oauthApplication), - checkRequired("user", user), + apiKey, + oauthApplication, + user, additionalProperties.toMutableMap(), ) } @@ -2132,8 +2126,8 @@ private constructor( return@apply } - apiKey().ifPresent { it.validate() } category().validate() + apiKey().ifPresent { it.validate() } oauthApplication().ifPresent { it.validate() } user().ifPresent { it.validate() } validated = true @@ -2155,11 +2149,166 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (apiKey.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + (user.asKnown().getOrNull()?.validity() ?: 0) + /** The type of object that created this transfer. */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** If present, details about the API key that created the transfer. */ class ApiKey @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2336,161 +2485,6 @@ private constructor( "ApiKey{description=$description, additionalProperties=$additionalProperties}" } - /** The type of object that created this transfer. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** An API key. Details will be under the `api_key` object. */ - @JvmField val API_KEY = of("api_key") - - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - @JvmField val OAUTH_APPLICATION = of("oauth_application") - - /** A User in the Increase dashboard. Details will be under the `user` object. */ - @JvmField val USER = of("user") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - API_KEY -> Value.API_KEY - OAUTH_APPLICATION -> Value.OAUTH_APPLICATION - USER -> Value.USER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - API_KEY -> Known.API_KEY - OAUTH_APPLICATION -> Known.OAUTH_APPLICATION - USER -> Known.USER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** If present, details about the OAuth Application that created the transfer. */ class OAuthApplication @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2822,21 +2816,21 @@ private constructor( } return other is CreatedBy && - apiKey == other.apiKey && category == other.category && + apiKey == other.apiKey && oauthApplication == other.oauthApplication && user == other.user && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + Objects.hash(category, apiKey, oauthApplication, user, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + "CreatedBy{category=$category, apiKey=$apiKey, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } /** The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the check's currency. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt index 7526acf21..ca0692460 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt @@ -825,9 +825,9 @@ private constructor( class Source @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val category: JsonField, private val achDecline: JsonField, private val cardDecline: JsonField, - private val category: JsonField, private val checkDecline: JsonField, private val checkDepositRejection: JsonField, private val inboundFednowTransferDecline: JsonField, @@ -840,15 +840,15 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), @JsonProperty("ach_decline") @ExcludeMissing achDecline: JsonField = JsonMissing.of(), @JsonProperty("card_decline") @ExcludeMissing cardDecline: JsonField = JsonMissing.of(), - @JsonProperty("category") - @ExcludeMissing - category: JsonField = JsonMissing.of(), @JsonProperty("check_decline") @ExcludeMissing checkDecline: JsonField = JsonMissing.of(), @@ -869,9 +869,9 @@ private constructor( @ExcludeMissing wireDecline: JsonField = JsonMissing.of(), ) : this( + category, achDecline, cardDecline, - category, checkDecline, checkDepositRejection, inboundFednowTransferDecline, @@ -881,6 +881,15 @@ private constructor( mutableMapOf(), ) + /** + * The type of the resource. We may add additional possible values for this enum over time; + * your application should be able to handle such additions gracefully. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun category(): Category = category.getRequired("category") + /** * An ACH Decline object. This field will be present in the JSON response if and only if * `category` is equal to `ach_decline`. @@ -899,15 +908,6 @@ private constructor( */ fun cardDecline(): Optional = cardDecline.getOptional("card_decline") - /** - * The type of the resource. We may add additional possible values for this enum over time; - * your application should be able to handle such additions gracefully. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun category(): Category = category.getRequired("category") - /** * A Check Decline object. This field will be present in the JSON response if and only if * `category` is equal to `check_decline`. @@ -969,6 +969,13 @@ private constructor( */ fun wireDecline(): Optional = wireDecline.getOptional("wire_decline") + /** + * Returns the raw JSON value of [category]. + * + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + /** * Returns the raw JSON value of [achDecline]. * @@ -987,13 +994,6 @@ private constructor( @ExcludeMissing fun _cardDecline(): JsonField = cardDecline - /** - * Returns the raw JSON value of [category]. - * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category - /** * Returns the raw JSON value of [checkDecline]. * @@ -1072,15 +1072,7 @@ private constructor( * * The following fields are required: * ```java - * .achDecline() - * .cardDecline() * .category() - * .checkDecline() - * .checkDepositRejection() - * .inboundFednowTransferDecline() - * .inboundRealTimePaymentsTransferDecline() - * .other() - * .wireDecline() * ``` */ @JvmStatic fun builder() = Builder() @@ -1089,25 +1081,25 @@ private constructor( /** A builder for [Source]. */ class Builder internal constructor() { - private var achDecline: JsonField? = null - private var cardDecline: JsonField? = null private var category: JsonField? = null - private var checkDecline: JsonField? = null - private var checkDepositRejection: JsonField? = null - private var inboundFednowTransferDecline: JsonField? = - null + private var achDecline: JsonField = JsonMissing.of() + private var cardDecline: JsonField = JsonMissing.of() + private var checkDecline: JsonField = JsonMissing.of() + private var checkDepositRejection: JsonField = JsonMissing.of() + private var inboundFednowTransferDecline: JsonField = + JsonMissing.of() private var inboundRealTimePaymentsTransferDecline: - JsonField? = - null - private var other: JsonField? = null - private var wireDecline: JsonField? = null + JsonField = + JsonMissing.of() + private var other: JsonField = JsonMissing.of() + private var wireDecline: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(source: Source) = apply { + category = source.category achDecline = source.achDecline cardDecline = source.cardDecline - category = source.category checkDecline = source.checkDecline checkDepositRejection = source.checkDepositRejection inboundFednowTransferDecline = source.inboundFednowTransferDecline @@ -1118,6 +1110,21 @@ private constructor( additionalProperties = source.additionalProperties.toMutableMap() } + /** + * The type of the resource. We may add additional possible values for this enum over + * time; your application should be able to handle such additions gracefully. + */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** * An ACH Decline object. This field will be present in the JSON response if and only if * `category` is equal to `ach_decline`. @@ -1160,21 +1167,6 @@ private constructor( this.cardDecline = cardDecline } - /** - * The type of the resource. We may add additional possible values for this enum over - * time; your application should be able to handle such additions gracefully. - */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** * A Check Decline object. This field will be present in the JSON response if and only * if `category` is equal to `check_decline`. @@ -1354,33 +1346,22 @@ private constructor( * * The following fields are required: * ```java - * .achDecline() - * .cardDecline() * .category() - * .checkDecline() - * .checkDepositRejection() - * .inboundFednowTransferDecline() - * .inboundRealTimePaymentsTransferDecline() - * .other() - * .wireDecline() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): Source = Source( - checkRequired("achDecline", achDecline), - checkRequired("cardDecline", cardDecline), checkRequired("category", category), - checkRequired("checkDecline", checkDecline), - checkRequired("checkDepositRejection", checkDepositRejection), - checkRequired("inboundFednowTransferDecline", inboundFednowTransferDecline), - checkRequired( - "inboundRealTimePaymentsTransferDecline", - inboundRealTimePaymentsTransferDecline, - ), - checkRequired("other", other), - checkRequired("wireDecline", wireDecline), + achDecline, + cardDecline, + checkDecline, + checkDepositRejection, + inboundFednowTransferDecline, + inboundRealTimePaymentsTransferDecline, + other, + wireDecline, additionalProperties.toMutableMap(), ) } @@ -1392,9 +1373,9 @@ private constructor( return@apply } + category().validate() achDecline().ifPresent { it.validate() } cardDecline().ifPresent { it.validate() } - category().validate() checkDecline().ifPresent { it.validate() } checkDepositRejection().ifPresent { it.validate() } inboundFednowTransferDecline().ifPresent { it.validate() } @@ -1404,31 +1385,257 @@ private constructor( validated = true } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (category.asKnown().getOrNull()?.validity() ?: 0) + + (achDecline.asKnown().getOrNull()?.validity() ?: 0) + + (cardDecline.asKnown().getOrNull()?.validity() ?: 0) + + (checkDecline.asKnown().getOrNull()?.validity() ?: 0) + + (checkDepositRejection.asKnown().getOrNull()?.validity() ?: 0) + + (inboundFednowTransferDecline.asKnown().getOrNull()?.validity() ?: 0) + + (inboundRealTimePaymentsTransferDecline.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + + (wireDecline.asKnown().getOrNull()?.validity() ?: 0) + + /** + * The type of the resource. We may add additional possible values for this enum over time; + * your application should be able to handle such additions gracefully. + */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** ACH Decline: details will be under the `ach_decline` object. */ + @JvmField val ACH_DECLINE = of("ach_decline") + + /** Card Decline: details will be under the `card_decline` object. */ + @JvmField val CARD_DECLINE = of("card_decline") + + /** Check Decline: details will be under the `check_decline` object. */ + @JvmField val CHECK_DECLINE = of("check_decline") + + /** + * Inbound Real-Time Payments Transfer Decline: details will be under the + * `inbound_real_time_payments_transfer_decline` object. + */ + @JvmField + val INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE = + of("inbound_real_time_payments_transfer_decline") + + /** + * Inbound FedNow Transfer Decline: details will be under the + * `inbound_fednow_transfer_decline` object. + */ + @JvmField + val INBOUND_FEDNOW_TRANSFER_DECLINE = of("inbound_fednow_transfer_decline") + + /** Wire Decline: details will be under the `wire_decline` object. */ + @JvmField val WIRE_DECLINE = of("wire_decline") + + /** + * Check Deposit Rejection: details will be under the `check_deposit_rejection` + * object. + */ + @JvmField val CHECK_DEPOSIT_REJECTION = of("check_deposit_rejection") + + /** The Declined Transaction was made for an undocumented or deprecated reason. */ + @JvmField val OTHER = of("other") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** ACH Decline: details will be under the `ach_decline` object. */ + ACH_DECLINE, + /** Card Decline: details will be under the `card_decline` object. */ + CARD_DECLINE, + /** Check Decline: details will be under the `check_decline` object. */ + CHECK_DECLINE, + /** + * Inbound Real-Time Payments Transfer Decline: details will be under the + * `inbound_real_time_payments_transfer_decline` object. + */ + INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE, + /** + * Inbound FedNow Transfer Decline: details will be under the + * `inbound_fednow_transfer_decline` object. + */ + INBOUND_FEDNOW_TRANSFER_DECLINE, + /** Wire Decline: details will be under the `wire_decline` object. */ + WIRE_DECLINE, + /** + * Check Deposit Rejection: details will be under the `check_deposit_rejection` + * object. + */ + CHECK_DEPOSIT_REJECTION, + /** The Declined Transaction was made for an undocumented or deprecated reason. */ + OTHER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** ACH Decline: details will be under the `ach_decline` object. */ + ACH_DECLINE, + /** Card Decline: details will be under the `card_decline` object. */ + CARD_DECLINE, + /** Check Decline: details will be under the `check_decline` object. */ + CHECK_DECLINE, + /** + * Inbound Real-Time Payments Transfer Decline: details will be under the + * `inbound_real_time_payments_transfer_decline` object. + */ + INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE, + /** + * Inbound FedNow Transfer Decline: details will be under the + * `inbound_fednow_transfer_decline` object. + */ + INBOUND_FEDNOW_TRANSFER_DECLINE, + /** Wire Decline: details will be under the `wire_decline` object. */ + WIRE_DECLINE, + /** + * Check Deposit Rejection: details will be under the `check_deposit_rejection` + * object. + */ + CHECK_DEPOSIT_REJECTION, + /** The Declined Transaction was made for an undocumented or deprecated reason. */ + OTHER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ACH_DECLINE -> Value.ACH_DECLINE + CARD_DECLINE -> Value.CARD_DECLINE + CHECK_DECLINE -> Value.CHECK_DECLINE + INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE -> + Value.INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE + INBOUND_FEDNOW_TRANSFER_DECLINE -> Value.INBOUND_FEDNOW_TRANSFER_DECLINE + WIRE_DECLINE -> Value.WIRE_DECLINE + CHECK_DEPOSIT_REJECTION -> Value.CHECK_DEPOSIT_REJECTION + OTHER -> Value.OTHER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ACH_DECLINE -> Known.ACH_DECLINE + CARD_DECLINE -> Known.CARD_DECLINE + CHECK_DECLINE -> Known.CHECK_DECLINE + INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE -> + Known.INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE + INBOUND_FEDNOW_TRANSFER_DECLINE -> Known.INBOUND_FEDNOW_TRANSFER_DECLINE + WIRE_DECLINE -> Known.WIRE_DECLINE + CHECK_DEPOSIT_REJECTION -> Known.CHECK_DEPOSIT_REJECTION + OTHER -> Known.OTHER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value } - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (achDecline.asKnown().getOrNull()?.validity() ?: 0) + - (cardDecline.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + - (checkDecline.asKnown().getOrNull()?.validity() ?: 0) + - (checkDepositRejection.asKnown().getOrNull()?.validity() ?: 0) + - (inboundFednowTransferDecline.asKnown().getOrNull()?.validity() ?: 0) + - (inboundRealTimePaymentsTransferDecline.asKnown().getOrNull()?.validity() ?: 0) + - (other.asKnown().getOrNull()?.validity() ?: 0) + - (wireDecline.asKnown().getOrNull()?.validity() ?: 0) + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } /** * An ACH Decline object. This field will be present in the JSON response if and only if @@ -12055,232 +12262,6 @@ private constructor( "CardDecline{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, declinedTransactionId=$declinedTransactionId, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, incrementedCardAuthorizationId=$incrementedCardAuthorizationId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, realTimeDecisionReason=$realTimeDecisionReason, reason=$reason, terminalId=$terminalId, verification=$verification, additionalProperties=$additionalProperties}" } - /** - * The type of the resource. We may add additional possible values for this enum over time; - * your application should be able to handle such additions gracefully. - */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** ACH Decline: details will be under the `ach_decline` object. */ - @JvmField val ACH_DECLINE = of("ach_decline") - - /** Card Decline: details will be under the `card_decline` object. */ - @JvmField val CARD_DECLINE = of("card_decline") - - /** Check Decline: details will be under the `check_decline` object. */ - @JvmField val CHECK_DECLINE = of("check_decline") - - /** - * Inbound Real-Time Payments Transfer Decline: details will be under the - * `inbound_real_time_payments_transfer_decline` object. - */ - @JvmField - val INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE = - of("inbound_real_time_payments_transfer_decline") - - /** - * Inbound FedNow Transfer Decline: details will be under the - * `inbound_fednow_transfer_decline` object. - */ - @JvmField - val INBOUND_FEDNOW_TRANSFER_DECLINE = of("inbound_fednow_transfer_decline") - - /** Wire Decline: details will be under the `wire_decline` object. */ - @JvmField val WIRE_DECLINE = of("wire_decline") - - /** - * Check Deposit Rejection: details will be under the `check_deposit_rejection` - * object. - */ - @JvmField val CHECK_DEPOSIT_REJECTION = of("check_deposit_rejection") - - /** The Declined Transaction was made for an undocumented or deprecated reason. */ - @JvmField val OTHER = of("other") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** ACH Decline: details will be under the `ach_decline` object. */ - ACH_DECLINE, - /** Card Decline: details will be under the `card_decline` object. */ - CARD_DECLINE, - /** Check Decline: details will be under the `check_decline` object. */ - CHECK_DECLINE, - /** - * Inbound Real-Time Payments Transfer Decline: details will be under the - * `inbound_real_time_payments_transfer_decline` object. - */ - INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE, - /** - * Inbound FedNow Transfer Decline: details will be under the - * `inbound_fednow_transfer_decline` object. - */ - INBOUND_FEDNOW_TRANSFER_DECLINE, - /** Wire Decline: details will be under the `wire_decline` object. */ - WIRE_DECLINE, - /** - * Check Deposit Rejection: details will be under the `check_deposit_rejection` - * object. - */ - CHECK_DEPOSIT_REJECTION, - /** The Declined Transaction was made for an undocumented or deprecated reason. */ - OTHER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** ACH Decline: details will be under the `ach_decline` object. */ - ACH_DECLINE, - /** Card Decline: details will be under the `card_decline` object. */ - CARD_DECLINE, - /** Check Decline: details will be under the `check_decline` object. */ - CHECK_DECLINE, - /** - * Inbound Real-Time Payments Transfer Decline: details will be under the - * `inbound_real_time_payments_transfer_decline` object. - */ - INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE, - /** - * Inbound FedNow Transfer Decline: details will be under the - * `inbound_fednow_transfer_decline` object. - */ - INBOUND_FEDNOW_TRANSFER_DECLINE, - /** Wire Decline: details will be under the `wire_decline` object. */ - WIRE_DECLINE, - /** - * Check Deposit Rejection: details will be under the `check_deposit_rejection` - * object. - */ - CHECK_DEPOSIT_REJECTION, - /** The Declined Transaction was made for an undocumented or deprecated reason. */ - OTHER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - ACH_DECLINE -> Value.ACH_DECLINE - CARD_DECLINE -> Value.CARD_DECLINE - CHECK_DECLINE -> Value.CHECK_DECLINE - INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE -> - Value.INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE - INBOUND_FEDNOW_TRANSFER_DECLINE -> Value.INBOUND_FEDNOW_TRANSFER_DECLINE - WIRE_DECLINE -> Value.WIRE_DECLINE - CHECK_DEPOSIT_REJECTION -> Value.CHECK_DEPOSIT_REJECTION - OTHER -> Value.OTHER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - ACH_DECLINE -> Known.ACH_DECLINE - CARD_DECLINE -> Known.CARD_DECLINE - CHECK_DECLINE -> Known.CHECK_DECLINE - INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE -> - Known.INBOUND_REAL_TIME_PAYMENTS_TRANSFER_DECLINE - INBOUND_FEDNOW_TRANSFER_DECLINE -> Known.INBOUND_FEDNOW_TRANSFER_DECLINE - WIRE_DECLINE -> Known.WIRE_DECLINE - CHECK_DEPOSIT_REJECTION -> Known.CHECK_DEPOSIT_REJECTION - OTHER -> Known.OTHER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** * A Check Decline object. This field will be present in the JSON response if and only if * `category` is equal to `check_decline`. @@ -15682,9 +15663,9 @@ private constructor( } return other is Source && + category == other.category && achDecline == other.achDecline && cardDecline == other.cardDecline && - category == other.category && checkDecline == other.checkDecline && checkDepositRejection == other.checkDepositRejection && inboundFednowTransferDecline == other.inboundFednowTransferDecline && @@ -15697,9 +15678,9 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + category, achDecline, cardDecline, - category, checkDecline, checkDepositRejection, inboundFednowTransferDecline, @@ -15713,7 +15694,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Source{achDecline=$achDecline, cardDecline=$cardDecline, category=$category, checkDecline=$checkDecline, checkDepositRejection=$checkDepositRejection, inboundFednowTransferDecline=$inboundFednowTransferDecline, inboundRealTimePaymentsTransferDecline=$inboundRealTimePaymentsTransferDecline, other=$other, wireDecline=$wireDecline, additionalProperties=$additionalProperties}" + "Source{category=$category, achDecline=$achDecline, cardDecline=$cardDecline, checkDecline=$checkDecline, checkDepositRejection=$checkDepositRejection, inboundFednowTransferDecline=$inboundFednowTransferDecline, inboundRealTimePaymentsTransferDecline=$inboundRealTimePaymentsTransferDecline, other=$other, wireDecline=$wireDecline, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt index c226c1653..31f19507e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt @@ -1293,8 +1293,8 @@ private constructor( class CreatedBy @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val apiKey: JsonField, private val category: JsonField, + private val apiKey: JsonField, private val oauthApplication: JsonField, private val user: JsonField, private val additionalProperties: MutableMap, @@ -1302,23 +1302,15 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("oauth_application") @ExcludeMissing oauthApplication: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), - ) : this(apiKey, category, oauthApplication, user, mutableMapOf()) - - /** - * If present, details about the API key that created the transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun apiKey(): Optional = apiKey.getOptional("api_key") + ) : this(category, apiKey, oauthApplication, user, mutableMapOf()) /** * The type of object that created this transfer. @@ -1328,6 +1320,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * If present, details about the API key that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun apiKey(): Optional = apiKey.getOptional("api_key") + /** * If present, details about the OAuth Application that created the transfer. * @@ -1346,18 +1346,18 @@ private constructor( fun user(): Optional = user.getOptional("user") /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [category]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category /** - * Returns the raw JSON value of [category]. + * Returns the raw JSON value of [apiKey]. * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey /** * Returns the raw JSON value of [oauthApplication]. @@ -1395,10 +1395,7 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` */ @JvmStatic fun builder() = Builder() @@ -1407,21 +1404,33 @@ private constructor( /** A builder for [CreatedBy]. */ class Builder internal constructor() { - private var apiKey: JsonField? = null private var category: JsonField? = null - private var oauthApplication: JsonField? = null - private var user: JsonField? = null + private var apiKey: JsonField = JsonMissing.of() + private var oauthApplication: JsonField = JsonMissing.of() + private var user: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(createdBy: CreatedBy) = apply { - apiKey = createdBy.apiKey category = createdBy.category + apiKey = createdBy.apiKey oauthApplication = createdBy.oauthApplication user = createdBy.user additionalProperties = createdBy.additionalProperties.toMutableMap() } + /** The type of object that created this transfer. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** If present, details about the API key that created the transfer. */ fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey)) @@ -1437,18 +1446,6 @@ private constructor( */ fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } - /** The type of object that created this transfer. */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** If present, details about the OAuth Application that created the transfer. */ fun oauthApplication(oauthApplication: OAuthApplication?) = oauthApplication(JsonField.ofNullable(oauthApplication)) @@ -1511,20 +1508,17 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): CreatedBy = CreatedBy( - checkRequired("apiKey", apiKey), checkRequired("category", category), - checkRequired("oauthApplication", oauthApplication), - checkRequired("user", user), + apiKey, + oauthApplication, + user, additionalProperties.toMutableMap(), ) } @@ -1536,8 +1530,8 @@ private constructor( return@apply } - apiKey().ifPresent { it.validate() } category().validate() + apiKey().ifPresent { it.validate() } oauthApplication().ifPresent { it.validate() } user().ifPresent { it.validate() } validated = true @@ -1559,11 +1553,166 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (apiKey.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + (user.asKnown().getOrNull()?.validity() ?: 0) + /** The type of object that created this transfer. */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** If present, details about the API key that created the transfer. */ class ApiKey @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -1740,161 +1889,6 @@ private constructor( "ApiKey{description=$description, additionalProperties=$additionalProperties}" } - /** The type of object that created this transfer. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** An API key. Details will be under the `api_key` object. */ - @JvmField val API_KEY = of("api_key") - - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - @JvmField val OAUTH_APPLICATION = of("oauth_application") - - /** A User in the Increase dashboard. Details will be under the `user` object. */ - @JvmField val USER = of("user") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - API_KEY -> Value.API_KEY - OAUTH_APPLICATION -> Value.OAUTH_APPLICATION - USER -> Value.USER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - API_KEY -> Known.API_KEY - OAUTH_APPLICATION -> Known.OAUTH_APPLICATION - USER -> Known.USER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** If present, details about the OAuth Application that created the transfer. */ class OAuthApplication @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2226,21 +2220,21 @@ private constructor( } return other is CreatedBy && - apiKey == other.apiKey && category == other.category && + apiKey == other.apiKey && oauthApplication == other.oauthApplication && user == other.user && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + Objects.hash(category, apiKey, oauthApplication, user, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + "CreatedBy{category=$category, apiKey=$apiKey, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt index 424f19557..3a5552e85 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt @@ -951,6 +951,7 @@ private constructor( class Source @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val category: JsonField, private val accountTransferInstruction: JsonField, private val achTransferInstruction: JsonField, private val blockchainOfframpTransferInstruction: @@ -959,7 +960,6 @@ private constructor( JsonField, private val cardAuthorization: JsonField, private val cardPushTransferInstruction: JsonField, - private val category: JsonField, private val checkDepositInstruction: JsonField, private val checkTransferInstruction: JsonField, private val fednowTransferInstruction: JsonField, @@ -976,6 +976,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), @JsonProperty("account_transfer_instruction") @ExcludeMissing accountTransferInstruction: JsonField = JsonMissing.of(), @@ -996,9 +999,6 @@ private constructor( @JsonProperty("card_push_transfer_instruction") @ExcludeMissing cardPushTransferInstruction: JsonField = JsonMissing.of(), - @JsonProperty("category") - @ExcludeMissing - category: JsonField = JsonMissing.of(), @JsonProperty("check_deposit_instruction") @ExcludeMissing checkDepositInstruction: JsonField = JsonMissing.of(), @@ -1029,13 +1029,13 @@ private constructor( @ExcludeMissing wireTransferInstruction: JsonField = JsonMissing.of(), ) : this( + category, accountTransferInstruction, achTransferInstruction, blockchainOfframpTransferInstruction, blockchainOnrampTransferInstruction, cardAuthorization, cardPushTransferInstruction, - category, checkDepositInstruction, checkTransferInstruction, fednowTransferInstruction, @@ -1049,6 +1049,15 @@ private constructor( mutableMapOf(), ) + /** + * The type of the resource. We may add additional possible values for this enum over time; + * your application should be able to handle such additions gracefully. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun category(): Category = category.getRequired("category") + /** * An Account Transfer Instruction object. This field will be present in the JSON response * if and only if `category` is equal to `account_transfer_instruction`. @@ -1114,15 +1123,6 @@ private constructor( fun cardPushTransferInstruction(): Optional = cardPushTransferInstruction.getOptional("card_push_transfer_instruction") - /** - * The type of the resource. We may add additional possible values for this enum over time; - * your application should be able to handle such additions gracefully. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun category(): Category = category.getRequired("category") - /** * A Check Deposit Instruction object. This field will be present in the JSON response if * and only if `category` is equal to `check_deposit_instruction`. @@ -1229,6 +1229,13 @@ private constructor( fun wireTransferInstruction(): Optional = wireTransferInstruction.getOptional("wire_transfer_instruction") + /** + * Returns the raw JSON value of [category]. + * + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + /** * Returns the raw JSON value of [accountTransferInstruction]. * @@ -1293,13 +1300,6 @@ private constructor( fun _cardPushTransferInstruction(): JsonField = cardPushTransferInstruction - /** - * Returns the raw JSON value of [category]. - * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category - /** * Returns the raw JSON value of [checkDepositInstruction]. * @@ -1421,23 +1421,7 @@ private constructor( * * The following fields are required: * ```java - * .accountTransferInstruction() - * .achTransferInstruction() - * .blockchainOfframpTransferInstruction() - * .blockchainOnrampTransferInstruction() - * .cardAuthorization() - * .cardPushTransferInstruction() * .category() - * .checkDepositInstruction() - * .checkTransferInstruction() - * .fednowTransferInstruction() - * .inboundFundsHold() - * .inboundWireTransferReversal() - * .other() - * .realTimePaymentsTransferInstruction() - * .swiftTransferInstruction() - * .userInitiatedHold() - * .wireTransferInstruction() * ``` */ @JvmStatic fun builder() = Builder() @@ -1446,40 +1430,48 @@ private constructor( /** A builder for [Source]. */ class Builder internal constructor() { - private var accountTransferInstruction: JsonField? = null - private var achTransferInstruction: JsonField? = null + private var category: JsonField? = null + private var accountTransferInstruction: JsonField = + JsonMissing.of() + private var achTransferInstruction: JsonField = JsonMissing.of() private var blockchainOfframpTransferInstruction: - JsonField? = - null + JsonField = + JsonMissing.of() private var blockchainOnrampTransferInstruction: - JsonField? = - null - private var cardAuthorization: JsonField? = null - private var cardPushTransferInstruction: JsonField? = null - private var category: JsonField? = null - private var checkDepositInstruction: JsonField? = null - private var checkTransferInstruction: JsonField? = null - private var fednowTransferInstruction: JsonField? = null - private var inboundFundsHold: JsonField? = null - private var inboundWireTransferReversal: JsonField? = null - private var other: JsonField? = null + JsonField = + JsonMissing.of() + private var cardAuthorization: JsonField = JsonMissing.of() + private var cardPushTransferInstruction: JsonField = + JsonMissing.of() + private var checkDepositInstruction: JsonField = + JsonMissing.of() + private var checkTransferInstruction: JsonField = + JsonMissing.of() + private var fednowTransferInstruction: JsonField = + JsonMissing.of() + private var inboundFundsHold: JsonField = JsonMissing.of() + private var inboundWireTransferReversal: JsonField = + JsonMissing.of() + private var other: JsonField = JsonMissing.of() private var realTimePaymentsTransferInstruction: - JsonField? = - null - private var swiftTransferInstruction: JsonField? = null - private var userInitiatedHold: JsonField? = null - private var wireTransferInstruction: JsonField? = null + JsonField = + JsonMissing.of() + private var swiftTransferInstruction: JsonField = + JsonMissing.of() + private var userInitiatedHold: JsonField = JsonMissing.of() + private var wireTransferInstruction: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(source: Source) = apply { + category = source.category accountTransferInstruction = source.accountTransferInstruction achTransferInstruction = source.achTransferInstruction blockchainOfframpTransferInstruction = source.blockchainOfframpTransferInstruction blockchainOnrampTransferInstruction = source.blockchainOnrampTransferInstruction cardAuthorization = source.cardAuthorization cardPushTransferInstruction = source.cardPushTransferInstruction - category = source.category checkDepositInstruction = source.checkDepositInstruction checkTransferInstruction = source.checkTransferInstruction fednowTransferInstruction = source.fednowTransferInstruction @@ -1493,6 +1485,21 @@ private constructor( additionalProperties = source.additionalProperties.toMutableMap() } + /** + * The type of the resource. We may add additional possible values for this enum over + * time; your application should be able to handle such additions gracefully. + */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** * An Account Transfer Instruction object. This field will be present in the JSON * response if and only if `category` is equal to `account_transfer_instruction`. @@ -1669,21 +1676,6 @@ private constructor( cardPushTransferInstruction: JsonField ) = apply { this.cardPushTransferInstruction = cardPushTransferInstruction } - /** - * The type of the resource. We may add additional possible values for this enum over - * time; your application should be able to handle such additions gracefully. - */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** * A Check Deposit Instruction object. This field will be present in the JSON response * if and only if `category` is equal to `check_deposit_instruction`. @@ -1971,55 +1963,30 @@ private constructor( * * The following fields are required: * ```java - * .accountTransferInstruction() - * .achTransferInstruction() - * .blockchainOfframpTransferInstruction() - * .blockchainOnrampTransferInstruction() - * .cardAuthorization() - * .cardPushTransferInstruction() * .category() - * .checkDepositInstruction() - * .checkTransferInstruction() - * .fednowTransferInstruction() - * .inboundFundsHold() - * .inboundWireTransferReversal() - * .other() - * .realTimePaymentsTransferInstruction() - * .swiftTransferInstruction() - * .userInitiatedHold() - * .wireTransferInstruction() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): Source = Source( - checkRequired("accountTransferInstruction", accountTransferInstruction), - checkRequired("achTransferInstruction", achTransferInstruction), - checkRequired( - "blockchainOfframpTransferInstruction", - blockchainOfframpTransferInstruction, - ), - checkRequired( - "blockchainOnrampTransferInstruction", - blockchainOnrampTransferInstruction, - ), - checkRequired("cardAuthorization", cardAuthorization), - checkRequired("cardPushTransferInstruction", cardPushTransferInstruction), checkRequired("category", category), - checkRequired("checkDepositInstruction", checkDepositInstruction), - checkRequired("checkTransferInstruction", checkTransferInstruction), - checkRequired("fednowTransferInstruction", fednowTransferInstruction), - checkRequired("inboundFundsHold", inboundFundsHold), - checkRequired("inboundWireTransferReversal", inboundWireTransferReversal), - checkRequired("other", other), - checkRequired( - "realTimePaymentsTransferInstruction", - realTimePaymentsTransferInstruction, - ), - checkRequired("swiftTransferInstruction", swiftTransferInstruction), - checkRequired("userInitiatedHold", userInitiatedHold), - checkRequired("wireTransferInstruction", wireTransferInstruction), + accountTransferInstruction, + achTransferInstruction, + blockchainOfframpTransferInstruction, + blockchainOnrampTransferInstruction, + cardAuthorization, + cardPushTransferInstruction, + checkDepositInstruction, + checkTransferInstruction, + fednowTransferInstruction, + inboundFundsHold, + inboundWireTransferReversal, + other, + realTimePaymentsTransferInstruction, + swiftTransferInstruction, + userInitiatedHold, + wireTransferInstruction, additionalProperties.toMutableMap(), ) } @@ -2031,13 +1998,13 @@ private constructor( return@apply } + category().validate() accountTransferInstruction().ifPresent { it.validate() } achTransferInstruction().ifPresent { it.validate() } blockchainOfframpTransferInstruction().ifPresent { it.validate() } blockchainOnrampTransferInstruction().ifPresent { it.validate() } cardAuthorization().ifPresent { it.validate() } cardPushTransferInstruction().ifPresent { it.validate() } - category().validate() checkDepositInstruction().ifPresent { it.validate() } checkTransferInstruction().ifPresent { it.validate() } fednowTransferInstruction().ifPresent { it.validate() } @@ -2067,13 +2034,13 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (accountTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (accountTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (achTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (blockchainOfframpTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (blockchainOnrampTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (cardAuthorization.asKnown().getOrNull()?.validity() ?: 0) + (cardPushTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + (checkDepositInstruction.asKnown().getOrNull()?.validity() ?: 0) + (checkTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (fednowTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + @@ -2086,414 +2053,400 @@ private constructor( (wireTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) /** - * An Account Transfer Instruction object. This field will be present in the JSON response - * if and only if `category` is equal to `account_transfer_instruction`. + * The type of the resource. We may add additional possible values for this enum over time; + * your application should be able to handle such additions gracefully. */ - class AccountTransferInstruction - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val amount: JsonField, - private val currency: JsonField, - private val transferId: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), - @JsonProperty("currency") - @ExcludeMissing - currency: JsonField = JsonMissing.of(), - @JsonProperty("transfer_id") - @ExcludeMissing - transferId: JsonField = JsonMissing.of(), - ) : this(amount, currency, transferId, mutableMapOf()) + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { /** - * The pending amount in the minor unit of the transaction's currency. For dollars, for - * example, this is cents. + * Returns this class instance's raw value. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. */ - fun amount(): Long = amount.getRequired("amount") + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun currency(): Currency = currency.getRequired("currency") + companion object { - /** - * The identifier of the Account Transfer that led to this Pending Transaction. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun transferId(): String = transferId.getRequired("transfer_id") + /** + * Account Transfer Instruction: details will be under the + * `account_transfer_instruction` object. + */ + @JvmField val ACCOUNT_TRANSFER_INSTRUCTION = of("account_transfer_instruction") - /** - * Returns the raw JSON value of [amount]. - * - * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + /** + * ACH Transfer Instruction: details will be under the `ach_transfer_instruction` + * object. + */ + @JvmField val ACH_TRANSFER_INSTRUCTION = of("ach_transfer_instruction") - /** - * Returns the raw JSON value of [currency]. - * - * Unlike [currency], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("currency") - @ExcludeMissing - fun _currency(): JsonField = currency + /** Card Authorization: details will be under the `card_authorization` object. */ + @JvmField val CARD_AUTHORIZATION = of("card_authorization") - /** - * Returns the raw JSON value of [transferId]. - * - * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("transfer_id") - @ExcludeMissing - fun _transferId(): JsonField = transferId + /** + * Check Deposit Instruction: details will be under the `check_deposit_instruction` + * object. + */ + @JvmField val CHECK_DEPOSIT_INSTRUCTION = of("check_deposit_instruction") - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } + /** + * Check Transfer Instruction: details will be under the + * `check_transfer_instruction` object. + */ + @JvmField val CHECK_TRANSFER_INSTRUCTION = of("check_transfer_instruction") - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + /** + * FedNow Transfer Instruction: details will be under the + * `fednow_transfer_instruction` object. + */ + @JvmField val FEDNOW_TRANSFER_INSTRUCTION = of("fednow_transfer_instruction") - fun toBuilder() = Builder().from(this) + /** Inbound Funds Hold: details will be under the `inbound_funds_hold` object. */ + @JvmField val INBOUND_FUNDS_HOLD = of("inbound_funds_hold") - companion object { + /** User Initiated Hold: details will be under the `user_initiated_hold` object. */ + @JvmField val USER_INITIATED_HOLD = of("user_initiated_hold") /** - * Returns a mutable builder for constructing an instance of - * [AccountTransferInstruction]. - * - * The following fields are required: - * ```java - * .amount() - * .currency() - * .transferId() - * ``` + * Real-Time Payments Transfer Instruction: details will be under the + * `real_time_payments_transfer_instruction` object. */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [AccountTransferInstruction]. */ - class Builder internal constructor() { - - private var amount: JsonField? = null - private var currency: JsonField? = null - private var transferId: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + @JvmField + val REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION = + of("real_time_payments_transfer_instruction") - @JvmSynthetic - internal fun from(accountTransferInstruction: AccountTransferInstruction) = apply { - amount = accountTransferInstruction.amount - currency = accountTransferInstruction.currency - transferId = accountTransferInstruction.transferId - additionalProperties = - accountTransferInstruction.additionalProperties.toMutableMap() - } + /** + * Wire Transfer Instruction: details will be under the `wire_transfer_instruction` + * object. + */ + @JvmField val WIRE_TRANSFER_INSTRUCTION = of("wire_transfer_instruction") /** - * The pending amount in the minor unit of the transaction's currency. For dollars, - * for example, this is cents. + * Inbound Wire Transfer Reversal: details will be under the + * `inbound_wire_transfer_reversal` object. */ - fun amount(amount: Long) = amount(JsonField.of(amount)) + @JvmField val INBOUND_WIRE_TRANSFER_REVERSAL = of("inbound_wire_transfer_reversal") /** - * Sets [Builder.amount] to an arbitrary JSON value. - * - * You should usually call [Builder.amount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. + * Swift Transfer Instruction: details will be under the + * `swift_transfer_instruction` object. */ - fun amount(amount: JsonField) = apply { this.amount = amount } + @JvmField val SWIFT_TRANSFER_INSTRUCTION = of("swift_transfer_instruction") /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. + * Card Push Transfer Instruction: details will be under the + * `card_push_transfer_instruction` object. */ - fun currency(currency: Currency) = currency(JsonField.of(currency)) + @JvmField val CARD_PUSH_TRANSFER_INSTRUCTION = of("card_push_transfer_instruction") /** - * Sets [Builder.currency] to an arbitrary JSON value. - * - * You should usually call [Builder.currency] with a well-typed [Currency] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * Blockchain On-Ramp Transfer Instruction: details will be under the + * `blockchain_onramp_transfer_instruction` object. */ - fun currency(currency: JsonField) = apply { this.currency = currency } - - /** The identifier of the Account Transfer that led to this Pending Transaction. */ - fun transferId(transferId: String) = transferId(JsonField.of(transferId)) + @JvmField + val BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION = + of("blockchain_onramp_transfer_instruction") /** - * Sets [Builder.transferId] to an arbitrary JSON value. - * - * You should usually call [Builder.transferId] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * Blockchain Off-Ramp Transfer Instruction: details will be under the + * `blockchain_offramp_transfer_instruction` object. */ - fun transferId(transferId: JsonField) = apply { - this.transferId = transferId - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } + @JvmField + val BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION = + of("blockchain_offramp_transfer_instruction") - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + /** The Pending Transaction was made for an undocumented or deprecated reason. */ + @JvmField val OTHER = of("other") - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + /** An enum containing [Category]'s known values. */ + enum class Known { /** - * Returns an immutable instance of [AccountTransferInstruction]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .amount() - * .currency() - * .transferId() - * ``` - * - * @throws IllegalStateException if any required field is unset. + * Account Transfer Instruction: details will be under the + * `account_transfer_instruction` object. */ - fun build(): AccountTransferInstruction = - AccountTransferInstruction( - checkRequired("amount", amount), - checkRequired("currency", currency), - checkRequired("transferId", transferId), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): AccountTransferInstruction = apply { - if (validated) { - return@apply - } - - amount() - currency().validate() - transferId() - validated = true + ACCOUNT_TRANSFER_INSTRUCTION, + /** + * ACH Transfer Instruction: details will be under the `ach_transfer_instruction` + * object. + */ + ACH_TRANSFER_INSTRUCTION, + /** Card Authorization: details will be under the `card_authorization` object. */ + CARD_AUTHORIZATION, + /** + * Check Deposit Instruction: details will be under the `check_deposit_instruction` + * object. + */ + CHECK_DEPOSIT_INSTRUCTION, + /** + * Check Transfer Instruction: details will be under the + * `check_transfer_instruction` object. + */ + CHECK_TRANSFER_INSTRUCTION, + /** + * FedNow Transfer Instruction: details will be under the + * `fednow_transfer_instruction` object. + */ + FEDNOW_TRANSFER_INSTRUCTION, + /** Inbound Funds Hold: details will be under the `inbound_funds_hold` object. */ + INBOUND_FUNDS_HOLD, + /** User Initiated Hold: details will be under the `user_initiated_hold` object. */ + USER_INITIATED_HOLD, + /** + * Real-Time Payments Transfer Instruction: details will be under the + * `real_time_payments_transfer_instruction` object. + */ + REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION, + /** + * Wire Transfer Instruction: details will be under the `wire_transfer_instruction` + * object. + */ + WIRE_TRANSFER_INSTRUCTION, + /** + * Inbound Wire Transfer Reversal: details will be under the + * `inbound_wire_transfer_reversal` object. + */ + INBOUND_WIRE_TRANSFER_REVERSAL, + /** + * Swift Transfer Instruction: details will be under the + * `swift_transfer_instruction` object. + */ + SWIFT_TRANSFER_INSTRUCTION, + /** + * Card Push Transfer Instruction: details will be under the + * `card_push_transfer_instruction` object. + */ + CARD_PUSH_TRANSFER_INSTRUCTION, + /** + * Blockchain On-Ramp Transfer Instruction: details will be under the + * `blockchain_onramp_transfer_instruction` object. + */ + BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION, + /** + * Blockchain Off-Ramp Transfer Instruction: details will be under the + * `blockchain_offramp_transfer_instruction` object. + */ + BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION, + /** The Pending Transaction was made for an undocumented or deprecated reason. */ + OTHER, } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (if (amount.asKnown().isPresent) 1 else 0) + - (currency.asKnown().getOrNull()?.validity() ?: 0) + - (if (transferId.asKnown().isPresent) 1 else 0) - - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. */ - class Currency @JsonCreator private constructor(private val value: JsonField) : - Enum { - + enum class Value { /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that - * doesn't match any known member, and you want to know that value. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. + * Account Transfer Instruction: details will be under the + * `account_transfer_instruction` object. */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** US Dollar (USD) */ - @JvmField val USD = of("USD") - - @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) - } - - /** An enum containing [Currency]'s known values. */ - enum class Known { - /** US Dollar (USD) */ - USD - } - + ACCOUNT_TRANSFER_INSTRUCTION, /** - * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Currency] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, - * if the SDK is on an older version than the API, then the API may respond with - * new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * ACH Transfer Instruction: details will be under the `ach_transfer_instruction` + * object. */ - enum class Value { - /** US Dollar (USD) */ - USD, - /** - * An enum member indicating that [Currency] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } - + ACH_TRANSFER_INSTRUCTION, + /** Card Authorization: details will be under the `card_authorization` object. */ + CARD_AUTHORIZATION, /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if - * you want to throw for the unknown case. + * Check Deposit Instruction: details will be under the `check_deposit_instruction` + * object. */ - fun value(): Value = - when (this) { - USD -> Value.USD - else -> Value._UNKNOWN - } - + CHECK_DEPOSIT_INSTRUCTION, /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a - * known member. + * Check Transfer Instruction: details will be under the + * `check_transfer_instruction` object. */ - fun known(): Known = - when (this) { - USD -> Known.USD - else -> throw IncreaseInvalidDataException("Unknown Currency: $value") - } - + CHECK_TRANSFER_INSTRUCTION, /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have - * the expected primitive type. + * FedNow Transfer Instruction: details will be under the + * `fednow_transfer_instruction` object. */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } + FEDNOW_TRANSFER_INSTRUCTION, + /** Inbound Funds Hold: details will be under the `inbound_funds_hold` object. */ + INBOUND_FUNDS_HOLD, + /** User Initiated Hold: details will be under the `user_initiated_hold` object. */ + USER_INITIATED_HOLD, + /** + * Real-Time Payments Transfer Instruction: details will be under the + * `real_time_payments_transfer_instruction` object. + */ + REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION, + /** + * Wire Transfer Instruction: details will be under the `wire_transfer_instruction` + * object. + */ + WIRE_TRANSFER_INSTRUCTION, + /** + * Inbound Wire Transfer Reversal: details will be under the + * `inbound_wire_transfer_reversal` object. + */ + INBOUND_WIRE_TRANSFER_REVERSAL, + /** + * Swift Transfer Instruction: details will be under the + * `swift_transfer_instruction` object. + */ + SWIFT_TRANSFER_INSTRUCTION, + /** + * Card Push Transfer Instruction: details will be under the + * `card_push_transfer_instruction` object. + */ + CARD_PUSH_TRANSFER_INSTRUCTION, + /** + * Blockchain On-Ramp Transfer Instruction: details will be under the + * `blockchain_onramp_transfer_instruction` object. + */ + BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION, + /** + * Blockchain Off-Ramp Transfer Instruction: details will be under the + * `blockchain_offramp_transfer_instruction` object. + */ + BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION, + /** The Pending Transaction was made for an undocumented or deprecated reason. */ + OTHER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } - private var validated: Boolean = false + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ACCOUNT_TRANSFER_INSTRUCTION -> Value.ACCOUNT_TRANSFER_INSTRUCTION + ACH_TRANSFER_INSTRUCTION -> Value.ACH_TRANSFER_INSTRUCTION + CARD_AUTHORIZATION -> Value.CARD_AUTHORIZATION + CHECK_DEPOSIT_INSTRUCTION -> Value.CHECK_DEPOSIT_INSTRUCTION + CHECK_TRANSFER_INSTRUCTION -> Value.CHECK_TRANSFER_INSTRUCTION + FEDNOW_TRANSFER_INSTRUCTION -> Value.FEDNOW_TRANSFER_INSTRUCTION + INBOUND_FUNDS_HOLD -> Value.INBOUND_FUNDS_HOLD + USER_INITIATED_HOLD -> Value.USER_INITIATED_HOLD + REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION -> + Value.REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION + WIRE_TRANSFER_INSTRUCTION -> Value.WIRE_TRANSFER_INSTRUCTION + INBOUND_WIRE_TRANSFER_REVERSAL -> Value.INBOUND_WIRE_TRANSFER_REVERSAL + SWIFT_TRANSFER_INSTRUCTION -> Value.SWIFT_TRANSFER_INSTRUCTION + CARD_PUSH_TRANSFER_INSTRUCTION -> Value.CARD_PUSH_TRANSFER_INSTRUCTION + BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION -> + Value.BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION + BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION -> + Value.BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION + OTHER -> Value.OTHER + else -> Value._UNKNOWN + } - fun validate(): Currency = apply { - if (validated) { - return@apply - } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ACCOUNT_TRANSFER_INSTRUCTION -> Known.ACCOUNT_TRANSFER_INSTRUCTION + ACH_TRANSFER_INSTRUCTION -> Known.ACH_TRANSFER_INSTRUCTION + CARD_AUTHORIZATION -> Known.CARD_AUTHORIZATION + CHECK_DEPOSIT_INSTRUCTION -> Known.CHECK_DEPOSIT_INSTRUCTION + CHECK_TRANSFER_INSTRUCTION -> Known.CHECK_TRANSFER_INSTRUCTION + FEDNOW_TRANSFER_INSTRUCTION -> Known.FEDNOW_TRANSFER_INSTRUCTION + INBOUND_FUNDS_HOLD -> Known.INBOUND_FUNDS_HOLD + USER_INITIATED_HOLD -> Known.USER_INITIATED_HOLD + REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION -> + Known.REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION + WIRE_TRANSFER_INSTRUCTION -> Known.WIRE_TRANSFER_INSTRUCTION + INBOUND_WIRE_TRANSFER_REVERSAL -> Known.INBOUND_WIRE_TRANSFER_REVERSAL + SWIFT_TRANSFER_INSTRUCTION -> Known.SWIFT_TRANSFER_INSTRUCTION + CARD_PUSH_TRANSFER_INSTRUCTION -> Known.CARD_PUSH_TRANSFER_INSTRUCTION + BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION -> + Known.BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION + BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION -> + Known.BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION + OTHER -> Known.OTHER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } - known() - validated = true + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + private var validated: Boolean = false - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + fun validate(): Category = apply { + if (validated) { + return@apply + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + known() + validated = true + } - return other is Currency && value == other.value + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false } - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is AccountTransferInstruction && - amount == other.amount && - currency == other.currency && - transferId == other.transferId && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(amount, currency, transferId, additionalProperties) + return other is Category && value == other.value } - override fun hashCode(): Int = hashCode + override fun hashCode() = value.hashCode() - override fun toString() = - "AccountTransferInstruction{amount=$amount, currency=$currency, transferId=$transferId, additionalProperties=$additionalProperties}" + override fun toString() = value.toString() } /** - * An ACH Transfer Instruction object. This field will be present in the JSON response if - * and only if `category` is equal to `ach_transfer_instruction`. + * An Account Transfer Instruction object. This field will be present in the JSON response + * if and only if `category` is equal to `account_transfer_instruction`. */ - class AchTransferInstruction + class AccountTransferInstruction @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val amount: JsonField, + private val currency: JsonField, private val transferId: JsonField, private val additionalProperties: MutableMap, ) { @@ -2501,13 +2454,17 @@ private constructor( @JsonCreator private constructor( @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), @JsonProperty("transfer_id") @ExcludeMissing transferId: JsonField = JsonMissing.of(), - ) : this(amount, transferId, mutableMapOf()) + ) : this(amount, currency, transferId, mutableMapOf()) /** - * The pending amount in USD cents. + * The pending amount in the minor unit of the transaction's currency. For dollars, for + * example, this is cents. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -2516,7 +2473,17 @@ private constructor( fun amount(): Long = amount.getRequired("amount") /** - * The identifier of the ACH Transfer that led to this Pending Transaction. + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun currency(): Currency = currency.getRequired("currency") + + /** + * The identifier of the Account Transfer that led to this Pending Transaction. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -2531,6 +2498,16 @@ private constructor( */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + /** * Returns the raw JSON value of [transferId]. * @@ -2557,33 +2534,39 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [AchTransferInstruction]. + * [AccountTransferInstruction]. * * The following fields are required: * ```java * .amount() + * .currency() * .transferId() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [AchTransferInstruction]. */ + /** A builder for [AccountTransferInstruction]. */ class Builder internal constructor() { private var amount: JsonField? = null + private var currency: JsonField? = null private var transferId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(achTransferInstruction: AchTransferInstruction) = apply { - amount = achTransferInstruction.amount - transferId = achTransferInstruction.transferId + internal fun from(accountTransferInstruction: AccountTransferInstruction) = apply { + amount = accountTransferInstruction.amount + currency = accountTransferInstruction.currency + transferId = accountTransferInstruction.transferId additionalProperties = - achTransferInstruction.additionalProperties.toMutableMap() + accountTransferInstruction.additionalProperties.toMutableMap() } - /** The pending amount in USD cents. */ + /** + * The pending amount in the minor unit of the transaction's currency. For dollars, + * for example, this is cents. + */ fun amount(amount: Long) = amount(JsonField.of(amount)) /** @@ -2595,7 +2578,22 @@ private constructor( */ fun amount(amount: JsonField) = apply { this.amount = amount } - /** The identifier of the ACH Transfer that led to this Pending Transaction. */ + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + */ + fun currency(currency: Currency) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [Currency] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** The identifier of the Account Transfer that led to this Pending Transaction. */ fun transferId(transferId: String) = transferId(JsonField.of(transferId)) /** @@ -2632,21 +2630,23 @@ private constructor( } /** - * Returns an immutable instance of [AchTransferInstruction]. + * Returns an immutable instance of [AccountTransferInstruction]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java * .amount() + * .currency() * .transferId() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): AchTransferInstruction = - AchTransferInstruction( + fun build(): AccountTransferInstruction = + AccountTransferInstruction( checkRequired("amount", amount), + checkRequired("currency", currency), checkRequired("transferId", transferId), additionalProperties.toMutableMap(), ) @@ -2654,12 +2654,13 @@ private constructor( private var validated: Boolean = false - fun validate(): AchTransferInstruction = apply { + fun validate(): AccountTransferInstruction = apply { if (validated) { return@apply } amount() + currency().validate() transferId() validated = true } @@ -2681,63 +2682,194 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (amount.asKnown().isPresent) 1 else 0) + + (currency.asKnown().getOrNull()?.validity() ?: 0) + (if (transferId.asKnown().isPresent) 1 else 0) + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + */ + class Currency @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** US Dollar (USD) */ + USD + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** US Dollar (USD) */ + USD, + /** + * An enum member indicating that [Currency] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USD -> Value.USD + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Currency = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is AchTransferInstruction && + return other is AccountTransferInstruction && amount == other.amount && + currency == other.currency && transferId == other.transferId && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(amount, transferId, additionalProperties) + Objects.hash(amount, currency, transferId, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "AchTransferInstruction{amount=$amount, transferId=$transferId, additionalProperties=$additionalProperties}" + "AccountTransferInstruction{amount=$amount, currency=$currency, transferId=$transferId, additionalProperties=$additionalProperties}" } /** - * A Blockchain Off-Ramp Transfer Instruction object. This field will be present in the JSON - * response if and only if `category` is equal to `blockchain_offramp_transfer_instruction`. + * An ACH Transfer Instruction object. This field will be present in the JSON response if + * and only if `category` is equal to `ach_transfer_instruction`. */ - class BlockchainOfframpTransferInstruction + class AchTransferInstruction @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val sourceBlockchainAddressId: JsonField, + private val amount: JsonField, private val transferId: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("source_blockchain_address_id") - @ExcludeMissing - sourceBlockchainAddressId: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), @JsonProperty("transfer_id") @ExcludeMissing transferId: JsonField = JsonMissing.of(), - ) : this(sourceBlockchainAddressId, transferId, mutableMapOf()) + ) : this(amount, transferId, mutableMapOf()) /** - * The identifier of the Blockchain Address the funds were received at. + * The pending amount in USD cents. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun sourceBlockchainAddressId(): String = - sourceBlockchainAddressId.getRequired("source_blockchain_address_id") + fun amount(): Long = amount.getRequired("amount") /** - * The identifier of the Blockchain Off-Ramp Transfer that led to this Transaction. + * The identifier of the ACH Transfer that led to this Pending Transaction. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -2746,14 +2878,11 @@ private constructor( fun transferId(): String = transferId.getRequired("transfer_id") /** - * Returns the raw JSON value of [sourceBlockchainAddressId]. + * Returns the raw JSON value of [amount]. * - * Unlike [sourceBlockchainAddressId], this method doesn't throw if the JSON field has - * an unexpected type. + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("source_blockchain_address_id") - @ExcludeMissing - fun _sourceBlockchainAddressId(): JsonField = sourceBlockchainAddressId + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount /** * Returns the raw JSON value of [transferId]. @@ -2781,54 +2910,45 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [BlockchainOfframpTransferInstruction]. + * [AchTransferInstruction]. * * The following fields are required: * ```java - * .sourceBlockchainAddressId() + * .amount() * .transferId() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [BlockchainOfframpTransferInstruction]. */ + /** A builder for [AchTransferInstruction]. */ class Builder internal constructor() { - private var sourceBlockchainAddressId: JsonField? = null + private var amount: JsonField? = null private var transferId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - blockchainOfframpTransferInstruction: BlockchainOfframpTransferInstruction - ) = apply { - sourceBlockchainAddressId = - blockchainOfframpTransferInstruction.sourceBlockchainAddressId - transferId = blockchainOfframpTransferInstruction.transferId + internal fun from(achTransferInstruction: AchTransferInstruction) = apply { + amount = achTransferInstruction.amount + transferId = achTransferInstruction.transferId additionalProperties = - blockchainOfframpTransferInstruction.additionalProperties.toMutableMap() + achTransferInstruction.additionalProperties.toMutableMap() } - /** The identifier of the Blockchain Address the funds were received at. */ - fun sourceBlockchainAddressId(sourceBlockchainAddressId: String) = - sourceBlockchainAddressId(JsonField.of(sourceBlockchainAddressId)) + /** The pending amount in USD cents. */ + fun amount(amount: Long) = amount(JsonField.of(amount)) /** - * Sets [Builder.sourceBlockchainAddressId] to an arbitrary JSON value. + * Sets [Builder.amount] to an arbitrary JSON value. * - * You should usually call [Builder.sourceBlockchainAddressId] with a well-typed - * [String] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. + * You should usually call [Builder.amount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun sourceBlockchainAddressId(sourceBlockchainAddressId: JsonField) = - apply { - this.sourceBlockchainAddressId = sourceBlockchainAddressId - } + fun amount(amount: JsonField) = apply { this.amount = amount } - /** - * The identifier of the Blockchain Off-Ramp Transfer that led to this Transaction. - */ + /** The identifier of the ACH Transfer that led to this Pending Transaction. */ fun transferId(transferId: String) = transferId(JsonField.of(transferId)) /** @@ -2865,21 +2985,21 @@ private constructor( } /** - * Returns an immutable instance of [BlockchainOfframpTransferInstruction]. + * Returns an immutable instance of [AchTransferInstruction]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .sourceBlockchainAddressId() + * .amount() * .transferId() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): BlockchainOfframpTransferInstruction = - BlockchainOfframpTransferInstruction( - checkRequired("sourceBlockchainAddressId", sourceBlockchainAddressId), + fun build(): AchTransferInstruction = + AchTransferInstruction( + checkRequired("amount", amount), checkRequired("transferId", transferId), additionalProperties.toMutableMap(), ) @@ -2887,12 +3007,245 @@ private constructor( private var validated: Boolean = false - fun validate(): BlockchainOfframpTransferInstruction = apply { + fun validate(): AchTransferInstruction = apply { if (validated) { return@apply } - sourceBlockchainAddressId() + amount() + transferId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (amount.asKnown().isPresent) 1 else 0) + + (if (transferId.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AchTransferInstruction && + amount == other.amount && + transferId == other.transferId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, transferId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AchTransferInstruction{amount=$amount, transferId=$transferId, additionalProperties=$additionalProperties}" + } + + /** + * A Blockchain Off-Ramp Transfer Instruction object. This field will be present in the JSON + * response if and only if `category` is equal to `blockchain_offramp_transfer_instruction`. + */ + class BlockchainOfframpTransferInstruction + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val sourceBlockchainAddressId: JsonField, + private val transferId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("source_blockchain_address_id") + @ExcludeMissing + sourceBlockchainAddressId: JsonField = JsonMissing.of(), + @JsonProperty("transfer_id") + @ExcludeMissing + transferId: JsonField = JsonMissing.of(), + ) : this(sourceBlockchainAddressId, transferId, mutableMapOf()) + + /** + * The identifier of the Blockchain Address the funds were received at. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun sourceBlockchainAddressId(): String = + sourceBlockchainAddressId.getRequired("source_blockchain_address_id") + + /** + * The identifier of the Blockchain Off-Ramp Transfer that led to this Transaction. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun transferId(): String = transferId.getRequired("transfer_id") + + /** + * Returns the raw JSON value of [sourceBlockchainAddressId]. + * + * Unlike [sourceBlockchainAddressId], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("source_blockchain_address_id") + @ExcludeMissing + fun _sourceBlockchainAddressId(): JsonField = sourceBlockchainAddressId + + /** + * Returns the raw JSON value of [transferId]. + * + * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transfer_id") + @ExcludeMissing + fun _transferId(): JsonField = transferId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [BlockchainOfframpTransferInstruction]. + * + * The following fields are required: + * ```java + * .sourceBlockchainAddressId() + * .transferId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BlockchainOfframpTransferInstruction]. */ + class Builder internal constructor() { + + private var sourceBlockchainAddressId: JsonField? = null + private var transferId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + blockchainOfframpTransferInstruction: BlockchainOfframpTransferInstruction + ) = apply { + sourceBlockchainAddressId = + blockchainOfframpTransferInstruction.sourceBlockchainAddressId + transferId = blockchainOfframpTransferInstruction.transferId + additionalProperties = + blockchainOfframpTransferInstruction.additionalProperties.toMutableMap() + } + + /** The identifier of the Blockchain Address the funds were received at. */ + fun sourceBlockchainAddressId(sourceBlockchainAddressId: String) = + sourceBlockchainAddressId(JsonField.of(sourceBlockchainAddressId)) + + /** + * Sets [Builder.sourceBlockchainAddressId] to an arbitrary JSON value. + * + * You should usually call [Builder.sourceBlockchainAddressId] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun sourceBlockchainAddressId(sourceBlockchainAddressId: JsonField) = + apply { + this.sourceBlockchainAddressId = sourceBlockchainAddressId + } + + /** + * The identifier of the Blockchain Off-Ramp Transfer that led to this Transaction. + */ + fun transferId(transferId: String) = transferId(JsonField.of(transferId)) + + /** + * Sets [Builder.transferId] to an arbitrary JSON value. + * + * You should usually call [Builder.transferId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun transferId(transferId: JsonField) = apply { + this.transferId = transferId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [BlockchainOfframpTransferInstruction]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .sourceBlockchainAddressId() + * .transferId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BlockchainOfframpTransferInstruction = + BlockchainOfframpTransferInstruction( + checkRequired("sourceBlockchainAddressId", sourceBlockchainAddressId), + checkRequired("transferId", transferId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): BlockchainOfframpTransferInstruction = apply { + if (validated) { + return@apply + } + + sourceBlockchainAddressId() transferId() validated = true } @@ -12137,592 +12490,195 @@ private constructor( realTimeDecisionId, terminalId, type, - verification, - additionalProperties, - ) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "CardAuthorization{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, expiresAt=$expiresAt, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, pendingTransactionId=$pendingTransactionId, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, terminalId=$terminalId, type=$type, verification=$verification, additionalProperties=$additionalProperties}" - } - - /** - * A Card Push Transfer Instruction object. This field will be present in the JSON response - * if and only if `category` is equal to `card_push_transfer_instruction`. - */ - class CardPushTransferInstruction - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val amount: JsonField, - private val transferId: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), - @JsonProperty("transfer_id") - @ExcludeMissing - transferId: JsonField = JsonMissing.of(), - ) : this(amount, transferId, mutableMapOf()) - - /** - * The transfer amount in USD cents. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun amount(): Long = amount.getRequired("amount") - - /** - * The identifier of the Card Push Transfer that led to this Pending Transaction. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun transferId(): String = transferId.getRequired("transfer_id") - - /** - * Returns the raw JSON value of [amount]. - * - * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount - - /** - * Returns the raw JSON value of [transferId]. - * - * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("transfer_id") - @ExcludeMissing - fun _transferId(): JsonField = transferId - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of - * [CardPushTransferInstruction]. - * - * The following fields are required: - * ```java - * .amount() - * .transferId() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [CardPushTransferInstruction]. */ - class Builder internal constructor() { - - private var amount: JsonField? = null - private var transferId: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(cardPushTransferInstruction: CardPushTransferInstruction) = - apply { - amount = cardPushTransferInstruction.amount - transferId = cardPushTransferInstruction.transferId - additionalProperties = - cardPushTransferInstruction.additionalProperties.toMutableMap() - } - - /** The transfer amount in USD cents. */ - fun amount(amount: Long) = amount(JsonField.of(amount)) - - /** - * Sets [Builder.amount] to an arbitrary JSON value. - * - * You should usually call [Builder.amount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun amount(amount: JsonField) = apply { this.amount = amount } - - /** - * The identifier of the Card Push Transfer that led to this Pending Transaction. - */ - fun transferId(transferId: String) = transferId(JsonField.of(transferId)) - - /** - * Sets [Builder.transferId] to an arbitrary JSON value. - * - * You should usually call [Builder.transferId] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun transferId(transferId: JsonField) = apply { - this.transferId = transferId - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [CardPushTransferInstruction]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .amount() - * .transferId() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): CardPushTransferInstruction = - CardPushTransferInstruction( - checkRequired("amount", amount), - checkRequired("transferId", transferId), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): CardPushTransferInstruction = apply { - if (validated) { - return@apply - } - - amount() - transferId() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (if (amount.asKnown().isPresent) 1 else 0) + - (if (transferId.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is CardPushTransferInstruction && - amount == other.amount && - transferId == other.transferId && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(amount, transferId, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "CardPushTransferInstruction{amount=$amount, transferId=$transferId, additionalProperties=$additionalProperties}" - } - - /** - * The type of the resource. We may add additional possible values for this enum over time; - * your application should be able to handle such additions gracefully. - */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** - * Account Transfer Instruction: details will be under the - * `account_transfer_instruction` object. - */ - @JvmField val ACCOUNT_TRANSFER_INSTRUCTION = of("account_transfer_instruction") - - /** - * ACH Transfer Instruction: details will be under the `ach_transfer_instruction` - * object. - */ - @JvmField val ACH_TRANSFER_INSTRUCTION = of("ach_transfer_instruction") - - /** Card Authorization: details will be under the `card_authorization` object. */ - @JvmField val CARD_AUTHORIZATION = of("card_authorization") - - /** - * Check Deposit Instruction: details will be under the `check_deposit_instruction` - * object. - */ - @JvmField val CHECK_DEPOSIT_INSTRUCTION = of("check_deposit_instruction") - - /** - * Check Transfer Instruction: details will be under the - * `check_transfer_instruction` object. - */ - @JvmField val CHECK_TRANSFER_INSTRUCTION = of("check_transfer_instruction") - - /** - * FedNow Transfer Instruction: details will be under the - * `fednow_transfer_instruction` object. - */ - @JvmField val FEDNOW_TRANSFER_INSTRUCTION = of("fednow_transfer_instruction") - - /** Inbound Funds Hold: details will be under the `inbound_funds_hold` object. */ - @JvmField val INBOUND_FUNDS_HOLD = of("inbound_funds_hold") - - /** User Initiated Hold: details will be under the `user_initiated_hold` object. */ - @JvmField val USER_INITIATED_HOLD = of("user_initiated_hold") - - /** - * Real-Time Payments Transfer Instruction: details will be under the - * `real_time_payments_transfer_instruction` object. - */ - @JvmField - val REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION = - of("real_time_payments_transfer_instruction") - - /** - * Wire Transfer Instruction: details will be under the `wire_transfer_instruction` - * object. - */ - @JvmField val WIRE_TRANSFER_INSTRUCTION = of("wire_transfer_instruction") - - /** - * Inbound Wire Transfer Reversal: details will be under the - * `inbound_wire_transfer_reversal` object. - */ - @JvmField val INBOUND_WIRE_TRANSFER_REVERSAL = of("inbound_wire_transfer_reversal") - - /** - * Swift Transfer Instruction: details will be under the - * `swift_transfer_instruction` object. - */ - @JvmField val SWIFT_TRANSFER_INSTRUCTION = of("swift_transfer_instruction") - - /** - * Card Push Transfer Instruction: details will be under the - * `card_push_transfer_instruction` object. - */ - @JvmField val CARD_PUSH_TRANSFER_INSTRUCTION = of("card_push_transfer_instruction") - - /** - * Blockchain On-Ramp Transfer Instruction: details will be under the - * `blockchain_onramp_transfer_instruction` object. - */ - @JvmField - val BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION = - of("blockchain_onramp_transfer_instruction") - - /** - * Blockchain Off-Ramp Transfer Instruction: details will be under the - * `blockchain_offramp_transfer_instruction` object. - */ - @JvmField - val BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION = - of("blockchain_offramp_transfer_instruction") - - /** The Pending Transaction was made for an undocumented or deprecated reason. */ - @JvmField val OTHER = of("other") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** - * Account Transfer Instruction: details will be under the - * `account_transfer_instruction` object. - */ - ACCOUNT_TRANSFER_INSTRUCTION, - /** - * ACH Transfer Instruction: details will be under the `ach_transfer_instruction` - * object. - */ - ACH_TRANSFER_INSTRUCTION, - /** Card Authorization: details will be under the `card_authorization` object. */ - CARD_AUTHORIZATION, - /** - * Check Deposit Instruction: details will be under the `check_deposit_instruction` - * object. - */ - CHECK_DEPOSIT_INSTRUCTION, - /** - * Check Transfer Instruction: details will be under the - * `check_transfer_instruction` object. - */ - CHECK_TRANSFER_INSTRUCTION, - /** - * FedNow Transfer Instruction: details will be under the - * `fednow_transfer_instruction` object. - */ - FEDNOW_TRANSFER_INSTRUCTION, - /** Inbound Funds Hold: details will be under the `inbound_funds_hold` object. */ - INBOUND_FUNDS_HOLD, - /** User Initiated Hold: details will be under the `user_initiated_hold` object. */ - USER_INITIATED_HOLD, - /** - * Real-Time Payments Transfer Instruction: details will be under the - * `real_time_payments_transfer_instruction` object. - */ - REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION, - /** - * Wire Transfer Instruction: details will be under the `wire_transfer_instruction` - * object. - */ - WIRE_TRANSFER_INSTRUCTION, - /** - * Inbound Wire Transfer Reversal: details will be under the - * `inbound_wire_transfer_reversal` object. - */ - INBOUND_WIRE_TRANSFER_REVERSAL, - /** - * Swift Transfer Instruction: details will be under the - * `swift_transfer_instruction` object. - */ - SWIFT_TRANSFER_INSTRUCTION, - /** - * Card Push Transfer Instruction: details will be under the - * `card_push_transfer_instruction` object. - */ - CARD_PUSH_TRANSFER_INSTRUCTION, - /** - * Blockchain On-Ramp Transfer Instruction: details will be under the - * `blockchain_onramp_transfer_instruction` object. - */ - BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION, - /** - * Blockchain Off-Ramp Transfer Instruction: details will be under the - * `blockchain_offramp_transfer_instruction` object. - */ - BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION, - /** The Pending Transaction was made for an undocumented or deprecated reason. */ - OTHER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** - * Account Transfer Instruction: details will be under the - * `account_transfer_instruction` object. - */ - ACCOUNT_TRANSFER_INSTRUCTION, - /** - * ACH Transfer Instruction: details will be under the `ach_transfer_instruction` - * object. - */ - ACH_TRANSFER_INSTRUCTION, - /** Card Authorization: details will be under the `card_authorization` object. */ - CARD_AUTHORIZATION, - /** - * Check Deposit Instruction: details will be under the `check_deposit_instruction` - * object. - */ - CHECK_DEPOSIT_INSTRUCTION, - /** - * Check Transfer Instruction: details will be under the - * `check_transfer_instruction` object. - */ - CHECK_TRANSFER_INSTRUCTION, - /** - * FedNow Transfer Instruction: details will be under the - * `fednow_transfer_instruction` object. - */ - FEDNOW_TRANSFER_INSTRUCTION, - /** Inbound Funds Hold: details will be under the `inbound_funds_hold` object. */ - INBOUND_FUNDS_HOLD, - /** User Initiated Hold: details will be under the `user_initiated_hold` object. */ - USER_INITIATED_HOLD, - /** - * Real-Time Payments Transfer Instruction: details will be under the - * `real_time_payments_transfer_instruction` object. - */ - REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION, - /** - * Wire Transfer Instruction: details will be under the `wire_transfer_instruction` - * object. - */ - WIRE_TRANSFER_INSTRUCTION, - /** - * Inbound Wire Transfer Reversal: details will be under the - * `inbound_wire_transfer_reversal` object. - */ - INBOUND_WIRE_TRANSFER_REVERSAL, - /** - * Swift Transfer Instruction: details will be under the - * `swift_transfer_instruction` object. - */ - SWIFT_TRANSFER_INSTRUCTION, - /** - * Card Push Transfer Instruction: details will be under the - * `card_push_transfer_instruction` object. - */ - CARD_PUSH_TRANSFER_INSTRUCTION, - /** - * Blockchain On-Ramp Transfer Instruction: details will be under the - * `blockchain_onramp_transfer_instruction` object. - */ - BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION, - /** - * Blockchain Off-Ramp Transfer Instruction: details will be under the - * `blockchain_offramp_transfer_instruction` object. - */ - BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION, - /** The Pending Transaction was made for an undocumented or deprecated reason. */ - OTHER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, + verification, + additionalProperties, + ) } + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardAuthorization{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, expiresAt=$expiresAt, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, pendingTransactionId=$pendingTransactionId, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, terminalId=$terminalId, type=$type, verification=$verification, additionalProperties=$additionalProperties}" + } + + /** + * A Card Push Transfer Instruction object. This field will be present in the JSON response + * if and only if `category` is equal to `card_push_transfer_instruction`. + */ + class CardPushTransferInstruction + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val transferId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("transfer_id") + @ExcludeMissing + transferId: JsonField = JsonMissing.of(), + ) : this(amount, transferId, mutableMapOf()) + /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * The transfer amount in USD cents. * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - fun value(): Value = - when (this) { - ACCOUNT_TRANSFER_INSTRUCTION -> Value.ACCOUNT_TRANSFER_INSTRUCTION - ACH_TRANSFER_INSTRUCTION -> Value.ACH_TRANSFER_INSTRUCTION - CARD_AUTHORIZATION -> Value.CARD_AUTHORIZATION - CHECK_DEPOSIT_INSTRUCTION -> Value.CHECK_DEPOSIT_INSTRUCTION - CHECK_TRANSFER_INSTRUCTION -> Value.CHECK_TRANSFER_INSTRUCTION - FEDNOW_TRANSFER_INSTRUCTION -> Value.FEDNOW_TRANSFER_INSTRUCTION - INBOUND_FUNDS_HOLD -> Value.INBOUND_FUNDS_HOLD - USER_INITIATED_HOLD -> Value.USER_INITIATED_HOLD - REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION -> - Value.REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION - WIRE_TRANSFER_INSTRUCTION -> Value.WIRE_TRANSFER_INSTRUCTION - INBOUND_WIRE_TRANSFER_REVERSAL -> Value.INBOUND_WIRE_TRANSFER_REVERSAL - SWIFT_TRANSFER_INSTRUCTION -> Value.SWIFT_TRANSFER_INSTRUCTION - CARD_PUSH_TRANSFER_INSTRUCTION -> Value.CARD_PUSH_TRANSFER_INSTRUCTION - BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION -> - Value.BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION - BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION -> - Value.BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION - OTHER -> Value.OTHER - else -> Value._UNKNOWN - } + fun amount(): Long = amount.getRequired("amount") /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. + * The identifier of the Card Push Transfer that led to this Pending Transaction. * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - fun known(): Known = - when (this) { - ACCOUNT_TRANSFER_INSTRUCTION -> Known.ACCOUNT_TRANSFER_INSTRUCTION - ACH_TRANSFER_INSTRUCTION -> Known.ACH_TRANSFER_INSTRUCTION - CARD_AUTHORIZATION -> Known.CARD_AUTHORIZATION - CHECK_DEPOSIT_INSTRUCTION -> Known.CHECK_DEPOSIT_INSTRUCTION - CHECK_TRANSFER_INSTRUCTION -> Known.CHECK_TRANSFER_INSTRUCTION - FEDNOW_TRANSFER_INSTRUCTION -> Known.FEDNOW_TRANSFER_INSTRUCTION - INBOUND_FUNDS_HOLD -> Known.INBOUND_FUNDS_HOLD - USER_INITIATED_HOLD -> Known.USER_INITIATED_HOLD - REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION -> - Known.REAL_TIME_PAYMENTS_TRANSFER_INSTRUCTION - WIRE_TRANSFER_INSTRUCTION -> Known.WIRE_TRANSFER_INSTRUCTION - INBOUND_WIRE_TRANSFER_REVERSAL -> Known.INBOUND_WIRE_TRANSFER_REVERSAL - SWIFT_TRANSFER_INSTRUCTION -> Known.SWIFT_TRANSFER_INSTRUCTION - CARD_PUSH_TRANSFER_INSTRUCTION -> Known.CARD_PUSH_TRANSFER_INSTRUCTION - BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION -> - Known.BLOCKCHAIN_ONRAMP_TRANSFER_INSTRUCTION - BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION -> - Known.BLOCKCHAIN_OFFRAMP_TRANSFER_INSTRUCTION - OTHER -> Known.OTHER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } + fun transferId(): String = transferId.getRequired("transfer_id") /** - * Returns this class instance's primitive wire representation. + * Returns the raw JSON value of [amount]. * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [transferId]. * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. + * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") + @JsonProperty("transfer_id") + @ExcludeMissing + fun _transferId(): JsonField = transferId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [CardPushTransferInstruction]. + * + * The following fields are required: + * ```java + * .amount() + * .transferId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardPushTransferInstruction]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var transferId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(cardPushTransferInstruction: CardPushTransferInstruction) = + apply { + amount = cardPushTransferInstruction.amount + transferId = cardPushTransferInstruction.transferId + additionalProperties = + cardPushTransferInstruction.additionalProperties.toMutableMap() + } + + /** The transfer amount in USD cents. */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The identifier of the Card Push Transfer that led to this Pending Transaction. + */ + fun transferId(transferId: String) = transferId(JsonField.of(transferId)) + + /** + * Sets [Builder.transferId] to an arbitrary JSON value. + * + * You should usually call [Builder.transferId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun transferId(transferId: JsonField) = apply { + this.transferId = transferId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) } + /** + * Returns an immutable instance of [CardPushTransferInstruction]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .transferId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardPushTransferInstruction = + CardPushTransferInstruction( + checkRequired("amount", amount), + checkRequired("transferId", transferId), + additionalProperties.toMutableMap(), + ) + } + private var validated: Boolean = false - fun validate(): Category = apply { + fun validate(): CardPushTransferInstruction = apply { if (validated) { return@apply } - known() + amount() + transferId() validated = true } @@ -12740,19 +12696,30 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic + internal fun validity(): Int = + (if (amount.asKnown().isPresent) 1 else 0) + + (if (transferId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Category && value == other.value + return other is CardPushTransferInstruction && + amount == other.amount && + transferId == other.transferId && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { + Objects.hash(amount, transferId, additionalProperties) + } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardPushTransferInstruction{amount=$amount, transferId=$transferId, additionalProperties=$additionalProperties}" } /** @@ -16017,6 +15984,7 @@ private constructor( } return other is Source && + category == other.category && accountTransferInstruction == other.accountTransferInstruction && achTransferInstruction == other.achTransferInstruction && blockchainOfframpTransferInstruction == @@ -16024,7 +15992,6 @@ private constructor( blockchainOnrampTransferInstruction == other.blockchainOnrampTransferInstruction && cardAuthorization == other.cardAuthorization && cardPushTransferInstruction == other.cardPushTransferInstruction && - category == other.category && checkDepositInstruction == other.checkDepositInstruction && checkTransferInstruction == other.checkTransferInstruction && fednowTransferInstruction == other.fednowTransferInstruction && @@ -16040,13 +16007,13 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + category, accountTransferInstruction, achTransferInstruction, blockchainOfframpTransferInstruction, blockchainOnrampTransferInstruction, cardAuthorization, cardPushTransferInstruction, - category, checkDepositInstruction, checkTransferInstruction, fednowTransferInstruction, @@ -16064,7 +16031,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Source{accountTransferInstruction=$accountTransferInstruction, achTransferInstruction=$achTransferInstruction, blockchainOfframpTransferInstruction=$blockchainOfframpTransferInstruction, blockchainOnrampTransferInstruction=$blockchainOnrampTransferInstruction, cardAuthorization=$cardAuthorization, cardPushTransferInstruction=$cardPushTransferInstruction, category=$category, checkDepositInstruction=$checkDepositInstruction, checkTransferInstruction=$checkTransferInstruction, fednowTransferInstruction=$fednowTransferInstruction, inboundFundsHold=$inboundFundsHold, inboundWireTransferReversal=$inboundWireTransferReversal, other=$other, realTimePaymentsTransferInstruction=$realTimePaymentsTransferInstruction, swiftTransferInstruction=$swiftTransferInstruction, userInitiatedHold=$userInitiatedHold, wireTransferInstruction=$wireTransferInstruction, additionalProperties=$additionalProperties}" + "Source{category=$category, accountTransferInstruction=$accountTransferInstruction, achTransferInstruction=$achTransferInstruction, blockchainOfframpTransferInstruction=$blockchainOfframpTransferInstruction, blockchainOnrampTransferInstruction=$blockchainOnrampTransferInstruction, cardAuthorization=$cardAuthorization, cardPushTransferInstruction=$cardPushTransferInstruction, checkDepositInstruction=$checkDepositInstruction, checkTransferInstruction=$checkTransferInstruction, fednowTransferInstruction=$fednowTransferInstruction, inboundFundsHold=$inboundFundsHold, inboundWireTransferReversal=$inboundWireTransferReversal, other=$other, realTimePaymentsTransferInstruction=$realTimePaymentsTransferInstruction, swiftTransferInstruction=$swiftTransferInstruction, userInitiatedHold=$userInitiatedHold, wireTransferInstruction=$wireTransferInstruction, additionalProperties=$additionalProperties}" } /** Whether the Pending Transaction has been confirmed and has an associated Transaction. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransfer.kt index 36e975801..2db944325 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransfer.kt @@ -1912,8 +1912,8 @@ private constructor( class CreatedBy @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val apiKey: JsonField, private val category: JsonField, + private val apiKey: JsonField, private val oauthApplication: JsonField, private val user: JsonField, private val additionalProperties: MutableMap, @@ -1921,23 +1921,15 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("oauth_application") @ExcludeMissing oauthApplication: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), - ) : this(apiKey, category, oauthApplication, user, mutableMapOf()) - - /** - * If present, details about the API key that created the transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun apiKey(): Optional = apiKey.getOptional("api_key") + ) : this(category, apiKey, oauthApplication, user, mutableMapOf()) /** * The type of object that created this transfer. @@ -1947,6 +1939,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * If present, details about the API key that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun apiKey(): Optional = apiKey.getOptional("api_key") + /** * If present, details about the OAuth Application that created the transfer. * @@ -1965,18 +1965,18 @@ private constructor( fun user(): Optional = user.getOptional("user") /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [category]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category /** - * Returns the raw JSON value of [category]. + * Returns the raw JSON value of [apiKey]. * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey /** * Returns the raw JSON value of [oauthApplication]. @@ -2014,10 +2014,7 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` */ @JvmStatic fun builder() = Builder() @@ -2026,21 +2023,33 @@ private constructor( /** A builder for [CreatedBy]. */ class Builder internal constructor() { - private var apiKey: JsonField? = null private var category: JsonField? = null - private var oauthApplication: JsonField? = null - private var user: JsonField? = null + private var apiKey: JsonField = JsonMissing.of() + private var oauthApplication: JsonField = JsonMissing.of() + private var user: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(createdBy: CreatedBy) = apply { - apiKey = createdBy.apiKey category = createdBy.category + apiKey = createdBy.apiKey oauthApplication = createdBy.oauthApplication user = createdBy.user additionalProperties = createdBy.additionalProperties.toMutableMap() } + /** The type of object that created this transfer. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** If present, details about the API key that created the transfer. */ fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey)) @@ -2056,18 +2065,6 @@ private constructor( */ fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } - /** The type of object that created this transfer. */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** If present, details about the OAuth Application that created the transfer. */ fun oauthApplication(oauthApplication: OAuthApplication?) = oauthApplication(JsonField.ofNullable(oauthApplication)) @@ -2130,20 +2127,17 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): CreatedBy = CreatedBy( - checkRequired("apiKey", apiKey), checkRequired("category", category), - checkRequired("oauthApplication", oauthApplication), - checkRequired("user", user), + apiKey, + oauthApplication, + user, additionalProperties.toMutableMap(), ) } @@ -2155,8 +2149,8 @@ private constructor( return@apply } - apiKey().ifPresent { it.validate() } category().validate() + apiKey().ifPresent { it.validate() } oauthApplication().ifPresent { it.validate() } user().ifPresent { it.validate() } validated = true @@ -2178,11 +2172,166 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (apiKey.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + (user.asKnown().getOrNull()?.validity() ?: 0) + /** The type of object that created this transfer. */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** If present, details about the API key that created the transfer. */ class ApiKey @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2359,161 +2508,6 @@ private constructor( "ApiKey{description=$description, additionalProperties=$additionalProperties}" } - /** The type of object that created this transfer. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** An API key. Details will be under the `api_key` object. */ - @JvmField val API_KEY = of("api_key") - - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - @JvmField val OAUTH_APPLICATION = of("oauth_application") - - /** A User in the Increase dashboard. Details will be under the `user` object. */ - @JvmField val USER = of("user") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - API_KEY -> Value.API_KEY - OAUTH_APPLICATION -> Value.OAUTH_APPLICATION - USER -> Value.USER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - API_KEY -> Known.API_KEY - OAUTH_APPLICATION -> Known.OAUTH_APPLICATION - USER -> Known.USER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** If present, details about the OAuth Application that created the transfer. */ class OAuthApplication @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2845,21 +2839,21 @@ private constructor( } return other is CreatedBy && - apiKey == other.apiKey && category == other.category && + apiKey == other.apiKey && oauthApplication == other.oauthApplication && user == other.user && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + Objects.hash(category, apiKey, oauthApplication, user, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + "CreatedBy{category=$category, apiKey=$apiKey, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/swifttransfers/SwiftTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/swifttransfers/SwiftTransfer.kt index 2029132e6..eb350706b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/swifttransfers/SwiftTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/swifttransfers/SwiftTransfer.kt @@ -1115,8 +1115,8 @@ private constructor( class CreatedBy @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val apiKey: JsonField, private val category: JsonField, + private val apiKey: JsonField, private val oauthApplication: JsonField, private val user: JsonField, private val additionalProperties: MutableMap, @@ -1124,23 +1124,15 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("oauth_application") @ExcludeMissing oauthApplication: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), - ) : this(apiKey, category, oauthApplication, user, mutableMapOf()) - - /** - * If present, details about the API key that created the transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun apiKey(): Optional = apiKey.getOptional("api_key") + ) : this(category, apiKey, oauthApplication, user, mutableMapOf()) /** * The type of object that created this transfer. @@ -1150,6 +1142,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * If present, details about the API key that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun apiKey(): Optional = apiKey.getOptional("api_key") + /** * If present, details about the OAuth Application that created the transfer. * @@ -1168,18 +1168,18 @@ private constructor( fun user(): Optional = user.getOptional("user") /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [category]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category /** - * Returns the raw JSON value of [category]. + * Returns the raw JSON value of [apiKey]. * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey /** * Returns the raw JSON value of [oauthApplication]. @@ -1217,10 +1217,7 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` */ @JvmStatic fun builder() = Builder() @@ -1229,21 +1226,33 @@ private constructor( /** A builder for [CreatedBy]. */ class Builder internal constructor() { - private var apiKey: JsonField? = null private var category: JsonField? = null - private var oauthApplication: JsonField? = null - private var user: JsonField? = null + private var apiKey: JsonField = JsonMissing.of() + private var oauthApplication: JsonField = JsonMissing.of() + private var user: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(createdBy: CreatedBy) = apply { - apiKey = createdBy.apiKey category = createdBy.category + apiKey = createdBy.apiKey oauthApplication = createdBy.oauthApplication user = createdBy.user additionalProperties = createdBy.additionalProperties.toMutableMap() } + /** The type of object that created this transfer. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** If present, details about the API key that created the transfer. */ fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey)) @@ -1259,18 +1268,6 @@ private constructor( */ fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } - /** The type of object that created this transfer. */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** If present, details about the OAuth Application that created the transfer. */ fun oauthApplication(oauthApplication: OAuthApplication?) = oauthApplication(JsonField.ofNullable(oauthApplication)) @@ -1333,20 +1330,17 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): CreatedBy = CreatedBy( - checkRequired("apiKey", apiKey), checkRequired("category", category), - checkRequired("oauthApplication", oauthApplication), - checkRequired("user", user), + apiKey, + oauthApplication, + user, additionalProperties.toMutableMap(), ) } @@ -1358,8 +1352,8 @@ private constructor( return@apply } - apiKey().ifPresent { it.validate() } category().validate() + apiKey().ifPresent { it.validate() } oauthApplication().ifPresent { it.validate() } user().ifPresent { it.validate() } validated = true @@ -1381,11 +1375,166 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (apiKey.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + (user.asKnown().getOrNull()?.validity() ?: 0) + /** The type of object that created this transfer. */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** If present, details about the API key that created the transfer. */ class ApiKey @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -1562,161 +1711,6 @@ private constructor( "ApiKey{description=$description, additionalProperties=$additionalProperties}" } - /** The type of object that created this transfer. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** An API key. Details will be under the `api_key` object. */ - @JvmField val API_KEY = of("api_key") - - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - @JvmField val OAUTH_APPLICATION = of("oauth_application") - - /** A User in the Increase dashboard. Details will be under the `user` object. */ - @JvmField val USER = of("user") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - API_KEY -> Value.API_KEY - OAUTH_APPLICATION -> Value.OAUTH_APPLICATION - USER -> Value.USER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - API_KEY -> Known.API_KEY - OAUTH_APPLICATION -> Known.OAUTH_APPLICATION - USER -> Known.USER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** If present, details about the OAuth Application that created the transfer. */ class OAuthApplication @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2048,21 +2042,21 @@ private constructor( } return other is CreatedBy && - apiKey == other.apiKey && category == other.category && + apiKey == other.apiKey && oauthApplication == other.oauthApplication && user == other.user && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + Objects.hash(category, apiKey, oauthApplication, user, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + "CreatedBy{category=$category, apiKey=$apiKey, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } /** The creditor's address. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt index 9dc12a011..2c2408bf7 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt @@ -825,6 +825,7 @@ private constructor( class Source @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val category: JsonField, private val accountRevenuePayment: JsonField, private val accountTransferIntention: JsonField, private val achTransferIntention: JsonField, @@ -842,7 +843,6 @@ private constructor( private val cardRevenuePayment: JsonField, private val cardSettlement: JsonField, private val cashbackPayment: JsonField, - private val category: JsonField, private val checkDepositAcceptance: JsonField, private val checkDepositReturn: JsonField, private val checkTransferDeposit: JsonField, @@ -873,6 +873,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), @JsonProperty("account_revenue_payment") @ExcludeMissing accountRevenuePayment: JsonField = JsonMissing.of(), @@ -923,9 +926,6 @@ private constructor( @JsonProperty("cashback_payment") @ExcludeMissing cashbackPayment: JsonField = JsonMissing.of(), - @JsonProperty("category") - @ExcludeMissing - category: JsonField = JsonMissing.of(), @JsonProperty("check_deposit_acceptance") @ExcludeMissing checkDepositAcceptance: JsonField = JsonMissing.of(), @@ -999,6 +999,7 @@ private constructor( @ExcludeMissing wireTransferIntention: JsonField = JsonMissing.of(), ) : this( + category, accountRevenuePayment, accountTransferIntention, achTransferIntention, @@ -1015,7 +1016,6 @@ private constructor( cardRevenuePayment, cardSettlement, cashbackPayment, - category, checkDepositAcceptance, checkDepositReturn, checkTransferDeposit, @@ -1041,6 +1041,15 @@ private constructor( mutableMapOf(), ) + /** + * The type of the resource. We may add additional possible values for this enum over time; + * your application should be able to handle such additions gracefully. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun category(): Category = category.getRequired("category") + /** * An Account Revenue Payment object. This field will be present in the JSON response if and * only if `category` is equal to `account_revenue_payment`. An Account Revenue Payment @@ -1225,15 +1234,6 @@ private constructor( fun cashbackPayment(): Optional = cashbackPayment.getOptional("cashback_payment") - /** - * The type of the resource. We may add additional possible values for this enum over time; - * your application should be able to handle such additions gracefully. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun category(): Category = category.getRequired("category") - /** * A Check Deposit Acceptance object. This field will be present in the JSON response if and * only if `category` is equal to `check_deposit_acceptance`. A Check Deposit Acceptance is @@ -1496,6 +1496,13 @@ private constructor( fun wireTransferIntention(): Optional = wireTransferIntention.getOptional("wire_transfer_intention") + /** + * Returns the raw JSON value of [category]. + * + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + /** * Returns the raw JSON value of [accountRevenuePayment]. * @@ -1659,13 +1666,6 @@ private constructor( @ExcludeMissing fun _cashbackPayment(): JsonField = cashbackPayment - /** - * Returns the raw JSON value of [category]. - * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category - /** * Returns the raw JSON value of [checkDepositAcceptance]. * @@ -1909,45 +1909,7 @@ private constructor( * * The following fields are required: * ```java - * .accountRevenuePayment() - * .accountTransferIntention() - * .achTransferIntention() - * .achTransferRejection() - * .achTransferReturn() - * .blockchainOfframpTransferSettlement() - * .blockchainOnrampTransferIntention() - * .cardDisputeAcceptance() - * .cardDisputeFinancial() - * .cardDisputeLoss() - * .cardFinancial() - * .cardPushTransferAcceptance() - * .cardRefund() - * .cardRevenuePayment() - * .cardSettlement() - * .cashbackPayment() * .category() - * .checkDepositAcceptance() - * .checkDepositReturn() - * .checkTransferDeposit() - * .fednowTransferAcknowledgement() - * .feePayment() - * .inboundAchTransfer() - * .inboundAchTransferReturnIntention() - * .inboundCheckAdjustment() - * .inboundCheckDepositReturnIntention() - * .inboundFednowTransferConfirmation() - * .inboundRealTimePaymentsTransferConfirmation() - * .inboundWireReversal() - * .inboundWireTransfer() - * .inboundWireTransferReversal() - * .interestPayment() - * .internalSource() - * .other() - * .realTimePaymentsTransferAcknowledgement() - * .sampleFunds() - * .swiftTransferIntention() - * .swiftTransferReturn() - * .wireTransferIntention() * ``` */ @JvmStatic fun builder() = Builder() @@ -1956,64 +1918,68 @@ private constructor( /** A builder for [Source]. */ class Builder internal constructor() { - private var accountRevenuePayment: JsonField? = null - private var accountTransferIntention: JsonField? = null - private var achTransferIntention: JsonField? = null - private var achTransferRejection: JsonField? = null - private var achTransferReturn: JsonField? = null + private var category: JsonField? = null + private var accountRevenuePayment: JsonField = JsonMissing.of() + private var accountTransferIntention: JsonField = + JsonMissing.of() + private var achTransferIntention: JsonField = JsonMissing.of() + private var achTransferRejection: JsonField = JsonMissing.of() + private var achTransferReturn: JsonField = JsonMissing.of() private var blockchainOfframpTransferSettlement: - JsonField? = - null + JsonField = + JsonMissing.of() private var blockchainOnrampTransferIntention: - JsonField? = - null - private var cardDisputeAcceptance: JsonField? = null - private var cardDisputeFinancial: JsonField? = null - private var cardDisputeLoss: JsonField? = null - private var cardFinancial: JsonField? = null - private var cardPushTransferAcceptance: JsonField? = null - private var cardRefund: JsonField? = null - private var cardRevenuePayment: JsonField? = null - private var cardSettlement: JsonField? = null - private var cashbackPayment: JsonField? = null - private var category: JsonField? = null - private var checkDepositAcceptance: JsonField? = null - private var checkDepositReturn: JsonField? = null - private var checkTransferDeposit: JsonField? = null - private var fednowTransferAcknowledgement: JsonField? = - null - private var feePayment: JsonField? = null - private var inboundAchTransfer: JsonField? = null + JsonField = + JsonMissing.of() + private var cardDisputeAcceptance: JsonField = JsonMissing.of() + private var cardDisputeFinancial: JsonField = JsonMissing.of() + private var cardDisputeLoss: JsonField = JsonMissing.of() + private var cardFinancial: JsonField = JsonMissing.of() + private var cardPushTransferAcceptance: JsonField = + JsonMissing.of() + private var cardRefund: JsonField = JsonMissing.of() + private var cardRevenuePayment: JsonField = JsonMissing.of() + private var cardSettlement: JsonField = JsonMissing.of() + private var cashbackPayment: JsonField = JsonMissing.of() + private var checkDepositAcceptance: JsonField = JsonMissing.of() + private var checkDepositReturn: JsonField = JsonMissing.of() + private var checkTransferDeposit: JsonField = JsonMissing.of() + private var fednowTransferAcknowledgement: JsonField = + JsonMissing.of() + private var feePayment: JsonField = JsonMissing.of() + private var inboundAchTransfer: JsonField = JsonMissing.of() private var inboundAchTransferReturnIntention: - JsonField? = - null - private var inboundCheckAdjustment: JsonField? = null + JsonField = + JsonMissing.of() + private var inboundCheckAdjustment: JsonField = JsonMissing.of() private var inboundCheckDepositReturnIntention: - JsonField? = - null + JsonField = + JsonMissing.of() private var inboundFednowTransferConfirmation: - JsonField? = - null + JsonField = + JsonMissing.of() private var inboundRealTimePaymentsTransferConfirmation: - JsonField? = - null - private var inboundWireReversal: JsonField? = null - private var inboundWireTransfer: JsonField? = null - private var inboundWireTransferReversal: JsonField? = null - private var interestPayment: JsonField? = null - private var internalSource: JsonField? = null - private var other: JsonField? = null + JsonField = + JsonMissing.of() + private var inboundWireReversal: JsonField = JsonMissing.of() + private var inboundWireTransfer: JsonField = JsonMissing.of() + private var inboundWireTransferReversal: JsonField = + JsonMissing.of() + private var interestPayment: JsonField = JsonMissing.of() + private var internalSource: JsonField = JsonMissing.of() + private var other: JsonField = JsonMissing.of() private var realTimePaymentsTransferAcknowledgement: - JsonField? = - null - private var sampleFunds: JsonField? = null - private var swiftTransferIntention: JsonField? = null - private var swiftTransferReturn: JsonField? = null - private var wireTransferIntention: JsonField? = null + JsonField = + JsonMissing.of() + private var sampleFunds: JsonField = JsonMissing.of() + private var swiftTransferIntention: JsonField = JsonMissing.of() + private var swiftTransferReturn: JsonField = JsonMissing.of() + private var wireTransferIntention: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(source: Source) = apply { + category = source.category accountRevenuePayment = source.accountRevenuePayment accountTransferIntention = source.accountTransferIntention achTransferIntention = source.achTransferIntention @@ -2030,7 +1996,6 @@ private constructor( cardRevenuePayment = source.cardRevenuePayment cardSettlement = source.cardSettlement cashbackPayment = source.cashbackPayment - category = source.category checkDepositAcceptance = source.checkDepositAcceptance checkDepositReturn = source.checkDepositReturn checkTransferDeposit = source.checkTransferDeposit @@ -2058,6 +2023,21 @@ private constructor( additionalProperties = source.additionalProperties.toMutableMap() } + /** + * The type of the resource. We may add additional possible values for this enum over + * time; your application should be able to handle such additions gracefully. + */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** * An Account Revenue Payment object. This field will be present in the JSON response if * and only if `category` is equal to `account_revenue_payment`. An Account Revenue @@ -2487,21 +2467,6 @@ private constructor( this.cashbackPayment = cashbackPayment } - /** - * The type of the resource. We may add additional possible values for this enum over - * time; your application should be able to handle such additions gracefully. - */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** * A Check Deposit Acceptance object. This field will be present in the JSON response if * and only if `category` is equal to `check_deposit_acceptance`. A Check Deposit @@ -3152,111 +3117,52 @@ private constructor( * * The following fields are required: * ```java - * .accountRevenuePayment() - * .accountTransferIntention() - * .achTransferIntention() - * .achTransferRejection() - * .achTransferReturn() - * .blockchainOfframpTransferSettlement() - * .blockchainOnrampTransferIntention() - * .cardDisputeAcceptance() - * .cardDisputeFinancial() - * .cardDisputeLoss() - * .cardFinancial() - * .cardPushTransferAcceptance() - * .cardRefund() - * .cardRevenuePayment() - * .cardSettlement() - * .cashbackPayment() * .category() - * .checkDepositAcceptance() - * .checkDepositReturn() - * .checkTransferDeposit() - * .fednowTransferAcknowledgement() - * .feePayment() - * .inboundAchTransfer() - * .inboundAchTransferReturnIntention() - * .inboundCheckAdjustment() - * .inboundCheckDepositReturnIntention() - * .inboundFednowTransferConfirmation() - * .inboundRealTimePaymentsTransferConfirmation() - * .inboundWireReversal() - * .inboundWireTransfer() - * .inboundWireTransferReversal() - * .interestPayment() - * .internalSource() - * .other() - * .realTimePaymentsTransferAcknowledgement() - * .sampleFunds() - * .swiftTransferIntention() - * .swiftTransferReturn() - * .wireTransferIntention() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): Source = Source( - checkRequired("accountRevenuePayment", accountRevenuePayment), - checkRequired("accountTransferIntention", accountTransferIntention), - checkRequired("achTransferIntention", achTransferIntention), - checkRequired("achTransferRejection", achTransferRejection), - checkRequired("achTransferReturn", achTransferReturn), - checkRequired( - "blockchainOfframpTransferSettlement", - blockchainOfframpTransferSettlement, - ), - checkRequired( - "blockchainOnrampTransferIntention", - blockchainOnrampTransferIntention, - ), - checkRequired("cardDisputeAcceptance", cardDisputeAcceptance), - checkRequired("cardDisputeFinancial", cardDisputeFinancial), - checkRequired("cardDisputeLoss", cardDisputeLoss), - checkRequired("cardFinancial", cardFinancial), - checkRequired("cardPushTransferAcceptance", cardPushTransferAcceptance), - checkRequired("cardRefund", cardRefund), - checkRequired("cardRevenuePayment", cardRevenuePayment), - checkRequired("cardSettlement", cardSettlement), - checkRequired("cashbackPayment", cashbackPayment), checkRequired("category", category), - checkRequired("checkDepositAcceptance", checkDepositAcceptance), - checkRequired("checkDepositReturn", checkDepositReturn), - checkRequired("checkTransferDeposit", checkTransferDeposit), - checkRequired("fednowTransferAcknowledgement", fednowTransferAcknowledgement), - checkRequired("feePayment", feePayment), - checkRequired("inboundAchTransfer", inboundAchTransfer), - checkRequired( - "inboundAchTransferReturnIntention", - inboundAchTransferReturnIntention, - ), - checkRequired("inboundCheckAdjustment", inboundCheckAdjustment), - checkRequired( - "inboundCheckDepositReturnIntention", - inboundCheckDepositReturnIntention, - ), - checkRequired( - "inboundFednowTransferConfirmation", - inboundFednowTransferConfirmation, - ), - checkRequired( - "inboundRealTimePaymentsTransferConfirmation", - inboundRealTimePaymentsTransferConfirmation, - ), - checkRequired("inboundWireReversal", inboundWireReversal), - checkRequired("inboundWireTransfer", inboundWireTransfer), - checkRequired("inboundWireTransferReversal", inboundWireTransferReversal), - checkRequired("interestPayment", interestPayment), - checkRequired("internalSource", internalSource), - checkRequired("other", other), - checkRequired( - "realTimePaymentsTransferAcknowledgement", - realTimePaymentsTransferAcknowledgement, - ), - checkRequired("sampleFunds", sampleFunds), - checkRequired("swiftTransferIntention", swiftTransferIntention), - checkRequired("swiftTransferReturn", swiftTransferReturn), - checkRequired("wireTransferIntention", wireTransferIntention), + accountRevenuePayment, + accountTransferIntention, + achTransferIntention, + achTransferRejection, + achTransferReturn, + blockchainOfframpTransferSettlement, + blockchainOnrampTransferIntention, + cardDisputeAcceptance, + cardDisputeFinancial, + cardDisputeLoss, + cardFinancial, + cardPushTransferAcceptance, + cardRefund, + cardRevenuePayment, + cardSettlement, + cashbackPayment, + checkDepositAcceptance, + checkDepositReturn, + checkTransferDeposit, + fednowTransferAcknowledgement, + feePayment, + inboundAchTransfer, + inboundAchTransferReturnIntention, + inboundCheckAdjustment, + inboundCheckDepositReturnIntention, + inboundFednowTransferConfirmation, + inboundRealTimePaymentsTransferConfirmation, + inboundWireReversal, + inboundWireTransfer, + inboundWireTransferReversal, + interestPayment, + internalSource, + other, + realTimePaymentsTransferAcknowledgement, + sampleFunds, + swiftTransferIntention, + swiftTransferReturn, + wireTransferIntention, additionalProperties.toMutableMap(), ) } @@ -3268,6 +3174,7 @@ private constructor( return@apply } + category().validate() accountRevenuePayment().ifPresent { it.validate() } accountTransferIntention().ifPresent { it.validate() } achTransferIntention().ifPresent { it.validate() } @@ -3284,7 +3191,6 @@ private constructor( cardRevenuePayment().ifPresent { it.validate() } cardSettlement().ifPresent { it.validate() } cashbackPayment().ifPresent { it.validate() } - category().validate() checkDepositAcceptance().ifPresent { it.validate() } checkDepositReturn().ifPresent { it.validate() } checkTransferDeposit().ifPresent { it.validate() } @@ -3326,7 +3232,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (accountRevenuePayment.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (accountRevenuePayment.asKnown().getOrNull()?.validity() ?: 0) + (accountTransferIntention.asKnown().getOrNull()?.validity() ?: 0) + (achTransferIntention.asKnown().getOrNull()?.validity() ?: 0) + (achTransferRejection.asKnown().getOrNull()?.validity() ?: 0) + @@ -3342,7 +3249,6 @@ private constructor( (cardRevenuePayment.asKnown().getOrNull()?.validity() ?: 0) + (cardSettlement.asKnown().getOrNull()?.validity() ?: 0) + (cashbackPayment.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + (checkDepositAcceptance.asKnown().getOrNull()?.validity() ?: 0) + (checkDepositReturn.asKnown().getOrNull()?.validity() ?: 0) + (checkTransferDeposit.asKnown().getOrNull()?.validity() ?: 0) + @@ -3368,971 +3274,820 @@ private constructor( (wireTransferIntention.asKnown().getOrNull()?.validity() ?: 0) /** - * An Account Revenue Payment object. This field will be present in the JSON response if and - * only if `category` is equal to `account_revenue_payment`. An Account Revenue Payment - * represents a payment made to an account from the bank. Account revenue is a type of - * non-interest income. + * The type of the resource. We may add additional possible values for this enum over time; + * your application should be able to handle such additions gracefully. */ - class AccountRevenuePayment - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val accruedOnAccountId: JsonField, - private val periodEnd: JsonField, - private val periodStart: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("accrued_on_account_id") - @ExcludeMissing - accruedOnAccountId: JsonField = JsonMissing.of(), - @JsonProperty("period_end") - @ExcludeMissing - periodEnd: JsonField = JsonMissing.of(), - @JsonProperty("period_start") - @ExcludeMissing - periodStart: JsonField = JsonMissing.of(), - ) : this(accruedOnAccountId, periodEnd, periodStart, mutableMapOf()) - - /** - * The account on which the account revenue was accrued. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun accruedOnAccountId(): String = - accruedOnAccountId.getRequired("accrued_on_account_id") - - /** - * The end of the period for which this transaction paid account revenue. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun periodEnd(): OffsetDateTime = periodEnd.getRequired("period_end") + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { /** - * The start of the period for which this transaction paid account revenue. + * Returns this class instance's raw value. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. */ - fun periodStart(): OffsetDateTime = periodStart.getRequired("period_start") + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - /** - * Returns the raw JSON value of [accruedOnAccountId]. - * - * Unlike [accruedOnAccountId], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("accrued_on_account_id") - @ExcludeMissing - fun _accruedOnAccountId(): JsonField = accruedOnAccountId + companion object { - /** - * Returns the raw JSON value of [periodEnd]. - * - * Unlike [periodEnd], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("period_end") - @ExcludeMissing - fun _periodEnd(): JsonField = periodEnd + /** + * Account Transfer Intention: details will be under the + * `account_transfer_intention` object. + */ + @JvmField val ACCOUNT_TRANSFER_INTENTION = of("account_transfer_intention") - /** - * Returns the raw JSON value of [periodStart]. - * - * Unlike [periodStart], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("period_start") - @ExcludeMissing - fun _periodStart(): JsonField = periodStart + /** + * ACH Transfer Intention: details will be under the `ach_transfer_intention` + * object. + */ + @JvmField val ACH_TRANSFER_INTENTION = of("ach_transfer_intention") - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } + /** + * ACH Transfer Rejection: details will be under the `ach_transfer_rejection` + * object. + */ + @JvmField val ACH_TRANSFER_REJECTION = of("ach_transfer_rejection") - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + /** ACH Transfer Return: details will be under the `ach_transfer_return` object. */ + @JvmField val ACH_TRANSFER_RETURN = of("ach_transfer_return") - fun toBuilder() = Builder().from(this) + /** Cashback Payment: details will be under the `cashback_payment` object. */ + @JvmField val CASHBACK_PAYMENT = of("cashback_payment") - companion object { + /** + * Legacy Card Dispute Acceptance: details will be under the + * `card_dispute_acceptance` object. + */ + @JvmField val CARD_DISPUTE_ACCEPTANCE = of("card_dispute_acceptance") /** - * Returns a mutable builder for constructing an instance of - * [AccountRevenuePayment]. - * - * The following fields are required: - * ```java - * .accruedOnAccountId() - * .periodEnd() - * .periodStart() - * ``` + * Card Dispute Financial: details will be under the `card_dispute_financial` + * object. */ - @JvmStatic fun builder() = Builder() - } + @JvmField val CARD_DISPUTE_FINANCIAL = of("card_dispute_financial") - /** A builder for [AccountRevenuePayment]. */ - class Builder internal constructor() { + /** + * Legacy Card Dispute Loss: details will be under the `card_dispute_loss` object. + */ + @JvmField val CARD_DISPUTE_LOSS = of("card_dispute_loss") - private var accruedOnAccountId: JsonField? = null - private var periodEnd: JsonField? = null - private var periodStart: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + /** Card Refund: details will be under the `card_refund` object. */ + @JvmField val CARD_REFUND = of("card_refund") - @JvmSynthetic - internal fun from(accountRevenuePayment: AccountRevenuePayment) = apply { - accruedOnAccountId = accountRevenuePayment.accruedOnAccountId - periodEnd = accountRevenuePayment.periodEnd - periodStart = accountRevenuePayment.periodStart - additionalProperties = accountRevenuePayment.additionalProperties.toMutableMap() - } + /** Card Settlement: details will be under the `card_settlement` object. */ + @JvmField val CARD_SETTLEMENT = of("card_settlement") - /** The account on which the account revenue was accrued. */ - fun accruedOnAccountId(accruedOnAccountId: String) = - accruedOnAccountId(JsonField.of(accruedOnAccountId)) + /** Card Financial: details will be under the `card_financial` object. */ + @JvmField val CARD_FINANCIAL = of("card_financial") /** - * Sets [Builder.accruedOnAccountId] to an arbitrary JSON value. - * - * You should usually call [Builder.accruedOnAccountId] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. + * Card Revenue Payment: details will be under the `card_revenue_payment` object. */ - fun accruedOnAccountId(accruedOnAccountId: JsonField) = apply { - this.accruedOnAccountId = accruedOnAccountId - } + @JvmField val CARD_REVENUE_PAYMENT = of("card_revenue_payment") - /** The end of the period for which this transaction paid account revenue. */ - fun periodEnd(periodEnd: OffsetDateTime) = periodEnd(JsonField.of(periodEnd)) + /** + * Check Deposit Acceptance: details will be under the `check_deposit_acceptance` + * object. + */ + @JvmField val CHECK_DEPOSIT_ACCEPTANCE = of("check_deposit_acceptance") /** - * Sets [Builder.periodEnd] to an arbitrary JSON value. - * - * You should usually call [Builder.periodEnd] with a well-typed [OffsetDateTime] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. + * Check Deposit Return: details will be under the `check_deposit_return` object. */ - fun periodEnd(periodEnd: JsonField) = apply { - this.periodEnd = periodEnd - } + @JvmField val CHECK_DEPOSIT_RETURN = of("check_deposit_return") - /** The start of the period for which this transaction paid account revenue. */ - fun periodStart(periodStart: OffsetDateTime) = - periodStart(JsonField.of(periodStart)) + /** + * FedNow Transfer Acknowledgement: details will be under the + * `fednow_transfer_acknowledgement` object. + */ + @JvmField + val FEDNOW_TRANSFER_ACKNOWLEDGEMENT = of("fednow_transfer_acknowledgement") /** - * Sets [Builder.periodStart] to an arbitrary JSON value. - * - * You should usually call [Builder.periodStart] with a well-typed [OffsetDateTime] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. + * Check Transfer Deposit: details will be under the `check_transfer_deposit` + * object. */ - fun periodStart(periodStart: JsonField) = apply { - this.periodStart = periodStart - } + @JvmField val CHECK_TRANSFER_DEPOSIT = of("check_transfer_deposit") - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + /** Fee Payment: details will be under the `fee_payment` object. */ + @JvmField val FEE_PAYMENT = of("fee_payment") - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + /** + * Inbound ACH Transfer Intention: details will be under the `inbound_ach_transfer` + * object. + */ + @JvmField val INBOUND_ACH_TRANSFER = of("inbound_ach_transfer") - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } + /** + * Inbound ACH Transfer Return Intention: details will be under the + * `inbound_ach_transfer_return_intention` object. + */ + @JvmField + val INBOUND_ACH_TRANSFER_RETURN_INTENTION = + of("inbound_ach_transfer_return_intention") - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + /** + * Inbound Check Deposit Return Intention: details will be under the + * `inbound_check_deposit_return_intention` object. + */ + @JvmField + val INBOUND_CHECK_DEPOSIT_RETURN_INTENTION = + of("inbound_check_deposit_return_intention") - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + /** + * Inbound Check Adjustment: details will be under the `inbound_check_adjustment` + * object. + */ + @JvmField val INBOUND_CHECK_ADJUSTMENT = of("inbound_check_adjustment") /** - * Returns an immutable instance of [AccountRevenuePayment]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .accruedOnAccountId() - * .periodEnd() - * .periodStart() - * ``` - * - * @throws IllegalStateException if any required field is unset. + * Inbound FedNow Transfer Confirmation: details will be under the + * `inbound_fednow_transfer_confirmation` object. */ - fun build(): AccountRevenuePayment = - AccountRevenuePayment( - checkRequired("accruedOnAccountId", accruedOnAccountId), - checkRequired("periodEnd", periodEnd), - checkRequired("periodStart", periodStart), - additionalProperties.toMutableMap(), - ) - } + @JvmField + val INBOUND_FEDNOW_TRANSFER_CONFIRMATION = + of("inbound_fednow_transfer_confirmation") - private var validated: Boolean = false + /** + * Inbound Real-Time Payments Transfer Confirmation: details will be under the + * `inbound_real_time_payments_transfer_confirmation` object. + */ + @JvmField + val INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION = + of("inbound_real_time_payments_transfer_confirmation") - fun validate(): AccountRevenuePayment = apply { - if (validated) { - return@apply - } + /** + * Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. + */ + @JvmField val INBOUND_WIRE_REVERSAL = of("inbound_wire_reversal") - accruedOnAccountId() - periodEnd() - periodStart() - validated = true - } + /** + * Inbound Wire Transfer Intention: details will be under the + * `inbound_wire_transfer` object. + */ + @JvmField val INBOUND_WIRE_TRANSFER = of("inbound_wire_transfer") - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + /** + * Inbound Wire Transfer Reversal Intention: details will be under the + * `inbound_wire_transfer_reversal` object. + */ + @JvmField val INBOUND_WIRE_TRANSFER_REVERSAL = of("inbound_wire_transfer_reversal") - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (if (accruedOnAccountId.asKnown().isPresent) 1 else 0) + - (if (periodEnd.asKnown().isPresent) 1 else 0) + - (if (periodStart.asKnown().isPresent) 1 else 0) + /** Interest Payment: details will be under the `interest_payment` object. */ + @JvmField val INTEREST_PAYMENT = of("interest_payment") - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + /** Internal Source: details will be under the `internal_source` object. */ + @JvmField val INTERNAL_SOURCE = of("internal_source") - return other is AccountRevenuePayment && - accruedOnAccountId == other.accruedOnAccountId && - periodEnd == other.periodEnd && - periodStart == other.periodStart && - additionalProperties == other.additionalProperties - } + /** + * Real-Time Payments Transfer Acknowledgement: details will be under the + * `real_time_payments_transfer_acknowledgement` object. + */ + @JvmField + val REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT = + of("real_time_payments_transfer_acknowledgement") - private val hashCode: Int by lazy { - Objects.hash(accruedOnAccountId, periodEnd, periodStart, additionalProperties) - } + /** Sample Funds: details will be under the `sample_funds` object. */ + @JvmField val SAMPLE_FUNDS = of("sample_funds") - override fun hashCode(): Int = hashCode + /** + * Wire Transfer Intention: details will be under the `wire_transfer_intention` + * object. + */ + @JvmField val WIRE_TRANSFER_INTENTION = of("wire_transfer_intention") - override fun toString() = - "AccountRevenuePayment{accruedOnAccountId=$accruedOnAccountId, periodEnd=$periodEnd, periodStart=$periodStart, additionalProperties=$additionalProperties}" - } + /** + * Swift Transfer Intention: details will be under the `swift_transfer_intention` + * object. + */ + @JvmField val SWIFT_TRANSFER_INTENTION = of("swift_transfer_intention") - /** - * An Account Transfer Intention object. This field will be present in the JSON response if - * and only if `category` is equal to `account_transfer_intention`. Two Account Transfer - * Intentions are created from each Account Transfer. One decrements the source account, and - * the other increments the destination account. - */ - class AccountTransferIntention - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val amount: JsonField, - private val currency: JsonField, - private val description: JsonField, - private val destinationAccountId: JsonField, - private val sourceAccountId: JsonField, - private val transferId: JsonField, - private val additionalProperties: MutableMap, - ) { + /** + * Swift Transfer Return: details will be under the `swift_transfer_return` object. + */ + @JvmField val SWIFT_TRANSFER_RETURN = of("swift_transfer_return") - @JsonCreator - private constructor( - @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), - @JsonProperty("currency") - @ExcludeMissing - currency: JsonField = JsonMissing.of(), - @JsonProperty("description") - @ExcludeMissing - description: JsonField = JsonMissing.of(), - @JsonProperty("destination_account_id") - @ExcludeMissing - destinationAccountId: JsonField = JsonMissing.of(), - @JsonProperty("source_account_id") - @ExcludeMissing - sourceAccountId: JsonField = JsonMissing.of(), - @JsonProperty("transfer_id") - @ExcludeMissing - transferId: JsonField = JsonMissing.of(), - ) : this( - amount, - currency, - description, - destinationAccountId, - sourceAccountId, - transferId, - mutableMapOf(), - ) + /** + * Card Push Transfer Acceptance: details will be under the + * `card_push_transfer_acceptance` object. + */ + @JvmField val CARD_PUSH_TRANSFER_ACCEPTANCE = of("card_push_transfer_acceptance") - /** - * The pending amount in the minor unit of the transaction's currency. For dollars, for - * example, this is cents. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun amount(): Long = amount.getRequired("amount") + /** + * Account Revenue Payment: details will be under the `account_revenue_payment` + * object. + */ + @JvmField val ACCOUNT_REVENUE_PAYMENT = of("account_revenue_payment") - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun currency(): Currency = currency.getRequired("currency") - - /** - * The description you chose to give the transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun description(): String = description.getRequired("description") - - /** - * The identifier of the Account to where the Account Transfer was sent. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun destinationAccountId(): String = - destinationAccountId.getRequired("destination_account_id") - - /** - * The identifier of the Account from where the Account Transfer was sent. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun sourceAccountId(): String = sourceAccountId.getRequired("source_account_id") - - /** - * The identifier of the Account Transfer that led to this Pending Transaction. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun transferId(): String = transferId.getRequired("transfer_id") - - /** - * Returns the raw JSON value of [amount]. - * - * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount - - /** - * Returns the raw JSON value of [currency]. - * - * Unlike [currency], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("currency") - @ExcludeMissing - fun _currency(): JsonField = currency - - /** - * Returns the raw JSON value of [description]. - * - * Unlike [description], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("description") - @ExcludeMissing - fun _description(): JsonField = description - - /** - * Returns the raw JSON value of [destinationAccountId]. - * - * Unlike [destinationAccountId], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("destination_account_id") - @ExcludeMissing - fun _destinationAccountId(): JsonField = destinationAccountId + /** + * Blockchain On-Ramp Transfer Intention: details will be under the + * `blockchain_onramp_transfer_intention` object. + */ + @JvmField + val BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION = + of("blockchain_onramp_transfer_intention") - /** - * Returns the raw JSON value of [sourceAccountId]. - * - * Unlike [sourceAccountId], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("source_account_id") - @ExcludeMissing - fun _sourceAccountId(): JsonField = sourceAccountId + /** + * Blockchain Off-Ramp Transfer Settlement: details will be under the + * `blockchain_offramp_transfer_settlement` object. + */ + @JvmField + val BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT = + of("blockchain_offramp_transfer_settlement") - /** - * Returns the raw JSON value of [transferId]. - * - * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("transfer_id") - @ExcludeMissing - fun _transferId(): JsonField = transferId + /** The Transaction was made for an undocumented or deprecated reason. */ + @JvmField val OTHER = of("other") - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - + /** An enum containing [Category]'s known values. */ + enum class Known { /** - * Returns a mutable builder for constructing an instance of - * [AccountTransferIntention]. - * - * The following fields are required: - * ```java - * .amount() - * .currency() - * .description() - * .destinationAccountId() - * .sourceAccountId() - * .transferId() - * ``` + * Account Transfer Intention: details will be under the + * `account_transfer_intention` object. */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [AccountTransferIntention]. */ - class Builder internal constructor() { - - private var amount: JsonField? = null - private var currency: JsonField? = null - private var description: JsonField? = null - private var destinationAccountId: JsonField? = null - private var sourceAccountId: JsonField? = null - private var transferId: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(accountTransferIntention: AccountTransferIntention) = apply { - amount = accountTransferIntention.amount - currency = accountTransferIntention.currency - description = accountTransferIntention.description - destinationAccountId = accountTransferIntention.destinationAccountId - sourceAccountId = accountTransferIntention.sourceAccountId - transferId = accountTransferIntention.transferId - additionalProperties = - accountTransferIntention.additionalProperties.toMutableMap() - } - + ACCOUNT_TRANSFER_INTENTION, /** - * The pending amount in the minor unit of the transaction's currency. For dollars, - * for example, this is cents. + * ACH Transfer Intention: details will be under the `ach_transfer_intention` + * object. */ - fun amount(amount: Long) = amount(JsonField.of(amount)) - + ACH_TRANSFER_INTENTION, /** - * Sets [Builder.amount] to an arbitrary JSON value. - * - * You should usually call [Builder.amount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. + * ACH Transfer Rejection: details will be under the `ach_transfer_rejection` + * object. */ - fun amount(amount: JsonField) = apply { this.amount = amount } - + ACH_TRANSFER_REJECTION, + /** ACH Transfer Return: details will be under the `ach_transfer_return` object. */ + ACH_TRANSFER_RETURN, + /** Cashback Payment: details will be under the `cashback_payment` object. */ + CASHBACK_PAYMENT, /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. + * Legacy Card Dispute Acceptance: details will be under the + * `card_dispute_acceptance` object. */ - fun currency(currency: Currency) = currency(JsonField.of(currency)) - + CARD_DISPUTE_ACCEPTANCE, /** - * Sets [Builder.currency] to an arbitrary JSON value. - * - * You should usually call [Builder.currency] with a well-typed [Currency] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * Card Dispute Financial: details will be under the `card_dispute_financial` + * object. */ - fun currency(currency: JsonField) = apply { this.currency = currency } - - /** The description you chose to give the transfer. */ - fun description(description: String) = description(JsonField.of(description)) - + CARD_DISPUTE_FINANCIAL, /** - * Sets [Builder.description] to an arbitrary JSON value. - * - * You should usually call [Builder.description] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * Legacy Card Dispute Loss: details will be under the `card_dispute_loss` object. */ - fun description(description: JsonField) = apply { - this.description = description - } - - /** The identifier of the Account to where the Account Transfer was sent. */ - fun destinationAccountId(destinationAccountId: String) = - destinationAccountId(JsonField.of(destinationAccountId)) - + CARD_DISPUTE_LOSS, + /** Card Refund: details will be under the `card_refund` object. */ + CARD_REFUND, + /** Card Settlement: details will be under the `card_settlement` object. */ + CARD_SETTLEMENT, + /** Card Financial: details will be under the `card_financial` object. */ + CARD_FINANCIAL, /** - * Sets [Builder.destinationAccountId] to an arbitrary JSON value. - * - * You should usually call [Builder.destinationAccountId] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. + * Card Revenue Payment: details will be under the `card_revenue_payment` object. */ - fun destinationAccountId(destinationAccountId: JsonField) = apply { - this.destinationAccountId = destinationAccountId - } - - /** The identifier of the Account from where the Account Transfer was sent. */ - fun sourceAccountId(sourceAccountId: String) = - sourceAccountId(JsonField.of(sourceAccountId)) - + CARD_REVENUE_PAYMENT, /** - * Sets [Builder.sourceAccountId] to an arbitrary JSON value. - * - * You should usually call [Builder.sourceAccountId] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. + * Check Deposit Acceptance: details will be under the `check_deposit_acceptance` + * object. */ - fun sourceAccountId(sourceAccountId: JsonField) = apply { - this.sourceAccountId = sourceAccountId - } - - /** The identifier of the Account Transfer that led to this Pending Transaction. */ - fun transferId(transferId: String) = transferId(JsonField.of(transferId)) - + CHECK_DEPOSIT_ACCEPTANCE, /** - * Sets [Builder.transferId] to an arbitrary JSON value. - * - * You should usually call [Builder.transferId] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * Check Deposit Return: details will be under the `check_deposit_return` object. */ - fun transferId(transferId: JsonField) = apply { - this.transferId = transferId - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - + CHECK_DEPOSIT_RETURN, /** - * Returns an immutable instance of [AccountTransferIntention]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .amount() - * .currency() - * .description() - * .destinationAccountId() - * .sourceAccountId() - * .transferId() - * ``` - * - * @throws IllegalStateException if any required field is unset. + * FedNow Transfer Acknowledgement: details will be under the + * `fednow_transfer_acknowledgement` object. */ - fun build(): AccountTransferIntention = - AccountTransferIntention( - checkRequired("amount", amount), - checkRequired("currency", currency), - checkRequired("description", description), - checkRequired("destinationAccountId", destinationAccountId), - checkRequired("sourceAccountId", sourceAccountId), - checkRequired("transferId", transferId), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): AccountTransferIntention = apply { - if (validated) { - return@apply - } - - amount() - currency().validate() - description() - destinationAccountId() - sourceAccountId() - transferId() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (if (amount.asKnown().isPresent) 1 else 0) + - (currency.asKnown().getOrNull()?.validity() ?: 0) + - (if (description.asKnown().isPresent) 1 else 0) + - (if (destinationAccountId.asKnown().isPresent) 1 else 0) + - (if (sourceAccountId.asKnown().isPresent) 1 else 0) + - (if (transferId.asKnown().isPresent) 1 else 0) - - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. - */ - class Currency @JsonCreator private constructor(private val value: JsonField) : - Enum { - + FEDNOW_TRANSFER_ACKNOWLEDGEMENT, /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that - * doesn't match any known member, and you want to know that value. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. + * Check Transfer Deposit: details will be under the `check_transfer_deposit` + * object. */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** US Dollar (USD) */ - @JvmField val USD = of("USD") - - @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) - } - - /** An enum containing [Currency]'s known values. */ - enum class Known { - /** US Dollar (USD) */ - USD - } - + CHECK_TRANSFER_DEPOSIT, + /** Fee Payment: details will be under the `fee_payment` object. */ + FEE_PAYMENT, /** - * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Currency] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, - * if the SDK is on an older version than the API, then the API may respond with - * new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * Inbound ACH Transfer Intention: details will be under the `inbound_ach_transfer` + * object. */ - enum class Value { - /** US Dollar (USD) */ - USD, - /** - * An enum member indicating that [Currency] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } - + INBOUND_ACH_TRANSFER, /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if - * you want to throw for the unknown case. + * Inbound ACH Transfer Return Intention: details will be under the + * `inbound_ach_transfer_return_intention` object. */ - fun value(): Value = - when (this) { - USD -> Value.USD - else -> Value._UNKNOWN - } - + INBOUND_ACH_TRANSFER_RETURN_INTENTION, /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a - * known member. + * Inbound Check Deposit Return Intention: details will be under the + * `inbound_check_deposit_return_intention` object. */ - fun known(): Known = - when (this) { - USD -> Known.USD - else -> throw IncreaseInvalidDataException("Unknown Currency: $value") - } - + INBOUND_CHECK_DEPOSIT_RETURN_INTENTION, /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have - * the expected primitive type. + * Inbound Check Adjustment: details will be under the `inbound_check_adjustment` + * object. */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Currency = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - + INBOUND_CHECK_ADJUSTMENT, /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. + * Inbound FedNow Transfer Confirmation: details will be under the + * `inbound_fednow_transfer_confirmation` object. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Currency && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AccountTransferIntention && - amount == other.amount && - currency == other.currency && - description == other.description && - destinationAccountId == other.destinationAccountId && - sourceAccountId == other.sourceAccountId && - transferId == other.transferId && - additionalProperties == other.additionalProperties + INBOUND_FEDNOW_TRANSFER_CONFIRMATION, + /** + * Inbound Real-Time Payments Transfer Confirmation: details will be under the + * `inbound_real_time_payments_transfer_confirmation` object. + */ + INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION, + /** + * Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. + */ + INBOUND_WIRE_REVERSAL, + /** + * Inbound Wire Transfer Intention: details will be under the + * `inbound_wire_transfer` object. + */ + INBOUND_WIRE_TRANSFER, + /** + * Inbound Wire Transfer Reversal Intention: details will be under the + * `inbound_wire_transfer_reversal` object. + */ + INBOUND_WIRE_TRANSFER_REVERSAL, + /** Interest Payment: details will be under the `interest_payment` object. */ + INTEREST_PAYMENT, + /** Internal Source: details will be under the `internal_source` object. */ + INTERNAL_SOURCE, + /** + * Real-Time Payments Transfer Acknowledgement: details will be under the + * `real_time_payments_transfer_acknowledgement` object. + */ + REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT, + /** Sample Funds: details will be under the `sample_funds` object. */ + SAMPLE_FUNDS, + /** + * Wire Transfer Intention: details will be under the `wire_transfer_intention` + * object. + */ + WIRE_TRANSFER_INTENTION, + /** + * Swift Transfer Intention: details will be under the `swift_transfer_intention` + * object. + */ + SWIFT_TRANSFER_INTENTION, + /** + * Swift Transfer Return: details will be under the `swift_transfer_return` object. + */ + SWIFT_TRANSFER_RETURN, + /** + * Card Push Transfer Acceptance: details will be under the + * `card_push_transfer_acceptance` object. + */ + CARD_PUSH_TRANSFER_ACCEPTANCE, + /** + * Account Revenue Payment: details will be under the `account_revenue_payment` + * object. + */ + ACCOUNT_REVENUE_PAYMENT, + /** + * Blockchain On-Ramp Transfer Intention: details will be under the + * `blockchain_onramp_transfer_intention` object. + */ + BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION, + /** + * Blockchain Off-Ramp Transfer Settlement: details will be under the + * `blockchain_offramp_transfer_settlement` object. + */ + BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT, + /** The Transaction was made for an undocumented or deprecated reason. */ + OTHER, } - private val hashCode: Int by lazy { - Objects.hash( - amount, - currency, - description, - destinationAccountId, - sourceAccountId, - transferId, - additionalProperties, - ) + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** + * Account Transfer Intention: details will be under the + * `account_transfer_intention` object. + */ + ACCOUNT_TRANSFER_INTENTION, + /** + * ACH Transfer Intention: details will be under the `ach_transfer_intention` + * object. + */ + ACH_TRANSFER_INTENTION, + /** + * ACH Transfer Rejection: details will be under the `ach_transfer_rejection` + * object. + */ + ACH_TRANSFER_REJECTION, + /** ACH Transfer Return: details will be under the `ach_transfer_return` object. */ + ACH_TRANSFER_RETURN, + /** Cashback Payment: details will be under the `cashback_payment` object. */ + CASHBACK_PAYMENT, + /** + * Legacy Card Dispute Acceptance: details will be under the + * `card_dispute_acceptance` object. + */ + CARD_DISPUTE_ACCEPTANCE, + /** + * Card Dispute Financial: details will be under the `card_dispute_financial` + * object. + */ + CARD_DISPUTE_FINANCIAL, + /** + * Legacy Card Dispute Loss: details will be under the `card_dispute_loss` object. + */ + CARD_DISPUTE_LOSS, + /** Card Refund: details will be under the `card_refund` object. */ + CARD_REFUND, + /** Card Settlement: details will be under the `card_settlement` object. */ + CARD_SETTLEMENT, + /** Card Financial: details will be under the `card_financial` object. */ + CARD_FINANCIAL, + /** + * Card Revenue Payment: details will be under the `card_revenue_payment` object. + */ + CARD_REVENUE_PAYMENT, + /** + * Check Deposit Acceptance: details will be under the `check_deposit_acceptance` + * object. + */ + CHECK_DEPOSIT_ACCEPTANCE, + /** + * Check Deposit Return: details will be under the `check_deposit_return` object. + */ + CHECK_DEPOSIT_RETURN, + /** + * FedNow Transfer Acknowledgement: details will be under the + * `fednow_transfer_acknowledgement` object. + */ + FEDNOW_TRANSFER_ACKNOWLEDGEMENT, + /** + * Check Transfer Deposit: details will be under the `check_transfer_deposit` + * object. + */ + CHECK_TRANSFER_DEPOSIT, + /** Fee Payment: details will be under the `fee_payment` object. */ + FEE_PAYMENT, + /** + * Inbound ACH Transfer Intention: details will be under the `inbound_ach_transfer` + * object. + */ + INBOUND_ACH_TRANSFER, + /** + * Inbound ACH Transfer Return Intention: details will be under the + * `inbound_ach_transfer_return_intention` object. + */ + INBOUND_ACH_TRANSFER_RETURN_INTENTION, + /** + * Inbound Check Deposit Return Intention: details will be under the + * `inbound_check_deposit_return_intention` object. + */ + INBOUND_CHECK_DEPOSIT_RETURN_INTENTION, + /** + * Inbound Check Adjustment: details will be under the `inbound_check_adjustment` + * object. + */ + INBOUND_CHECK_ADJUSTMENT, + /** + * Inbound FedNow Transfer Confirmation: details will be under the + * `inbound_fednow_transfer_confirmation` object. + */ + INBOUND_FEDNOW_TRANSFER_CONFIRMATION, + /** + * Inbound Real-Time Payments Transfer Confirmation: details will be under the + * `inbound_real_time_payments_transfer_confirmation` object. + */ + INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION, + /** + * Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. + */ + INBOUND_WIRE_REVERSAL, + /** + * Inbound Wire Transfer Intention: details will be under the + * `inbound_wire_transfer` object. + */ + INBOUND_WIRE_TRANSFER, + /** + * Inbound Wire Transfer Reversal Intention: details will be under the + * `inbound_wire_transfer_reversal` object. + */ + INBOUND_WIRE_TRANSFER_REVERSAL, + /** Interest Payment: details will be under the `interest_payment` object. */ + INTEREST_PAYMENT, + /** Internal Source: details will be under the `internal_source` object. */ + INTERNAL_SOURCE, + /** + * Real-Time Payments Transfer Acknowledgement: details will be under the + * `real_time_payments_transfer_acknowledgement` object. + */ + REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT, + /** Sample Funds: details will be under the `sample_funds` object. */ + SAMPLE_FUNDS, + /** + * Wire Transfer Intention: details will be under the `wire_transfer_intention` + * object. + */ + WIRE_TRANSFER_INTENTION, + /** + * Swift Transfer Intention: details will be under the `swift_transfer_intention` + * object. + */ + SWIFT_TRANSFER_INTENTION, + /** + * Swift Transfer Return: details will be under the `swift_transfer_return` object. + */ + SWIFT_TRANSFER_RETURN, + /** + * Card Push Transfer Acceptance: details will be under the + * `card_push_transfer_acceptance` object. + */ + CARD_PUSH_TRANSFER_ACCEPTANCE, + /** + * Account Revenue Payment: details will be under the `account_revenue_payment` + * object. + */ + ACCOUNT_REVENUE_PAYMENT, + /** + * Blockchain On-Ramp Transfer Intention: details will be under the + * `blockchain_onramp_transfer_intention` object. + */ + BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION, + /** + * Blockchain Off-Ramp Transfer Settlement: details will be under the + * `blockchain_offramp_transfer_settlement` object. + */ + BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT, + /** The Transaction was made for an undocumented or deprecated reason. */ + OTHER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, } - override fun hashCode(): Int = hashCode + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ACCOUNT_TRANSFER_INTENTION -> Value.ACCOUNT_TRANSFER_INTENTION + ACH_TRANSFER_INTENTION -> Value.ACH_TRANSFER_INTENTION + ACH_TRANSFER_REJECTION -> Value.ACH_TRANSFER_REJECTION + ACH_TRANSFER_RETURN -> Value.ACH_TRANSFER_RETURN + CASHBACK_PAYMENT -> Value.CASHBACK_PAYMENT + CARD_DISPUTE_ACCEPTANCE -> Value.CARD_DISPUTE_ACCEPTANCE + CARD_DISPUTE_FINANCIAL -> Value.CARD_DISPUTE_FINANCIAL + CARD_DISPUTE_LOSS -> Value.CARD_DISPUTE_LOSS + CARD_REFUND -> Value.CARD_REFUND + CARD_SETTLEMENT -> Value.CARD_SETTLEMENT + CARD_FINANCIAL -> Value.CARD_FINANCIAL + CARD_REVENUE_PAYMENT -> Value.CARD_REVENUE_PAYMENT + CHECK_DEPOSIT_ACCEPTANCE -> Value.CHECK_DEPOSIT_ACCEPTANCE + CHECK_DEPOSIT_RETURN -> Value.CHECK_DEPOSIT_RETURN + FEDNOW_TRANSFER_ACKNOWLEDGEMENT -> Value.FEDNOW_TRANSFER_ACKNOWLEDGEMENT + CHECK_TRANSFER_DEPOSIT -> Value.CHECK_TRANSFER_DEPOSIT + FEE_PAYMENT -> Value.FEE_PAYMENT + INBOUND_ACH_TRANSFER -> Value.INBOUND_ACH_TRANSFER + INBOUND_ACH_TRANSFER_RETURN_INTENTION -> + Value.INBOUND_ACH_TRANSFER_RETURN_INTENTION + INBOUND_CHECK_DEPOSIT_RETURN_INTENTION -> + Value.INBOUND_CHECK_DEPOSIT_RETURN_INTENTION + INBOUND_CHECK_ADJUSTMENT -> Value.INBOUND_CHECK_ADJUSTMENT + INBOUND_FEDNOW_TRANSFER_CONFIRMATION -> + Value.INBOUND_FEDNOW_TRANSFER_CONFIRMATION + INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION -> + Value.INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION + INBOUND_WIRE_REVERSAL -> Value.INBOUND_WIRE_REVERSAL + INBOUND_WIRE_TRANSFER -> Value.INBOUND_WIRE_TRANSFER + INBOUND_WIRE_TRANSFER_REVERSAL -> Value.INBOUND_WIRE_TRANSFER_REVERSAL + INTEREST_PAYMENT -> Value.INTEREST_PAYMENT + INTERNAL_SOURCE -> Value.INTERNAL_SOURCE + REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT -> + Value.REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT + SAMPLE_FUNDS -> Value.SAMPLE_FUNDS + WIRE_TRANSFER_INTENTION -> Value.WIRE_TRANSFER_INTENTION + SWIFT_TRANSFER_INTENTION -> Value.SWIFT_TRANSFER_INTENTION + SWIFT_TRANSFER_RETURN -> Value.SWIFT_TRANSFER_RETURN + CARD_PUSH_TRANSFER_ACCEPTANCE -> Value.CARD_PUSH_TRANSFER_ACCEPTANCE + ACCOUNT_REVENUE_PAYMENT -> Value.ACCOUNT_REVENUE_PAYMENT + BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION -> + Value.BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION + BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT -> + Value.BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT + OTHER -> Value.OTHER + else -> Value._UNKNOWN + } - override fun toString() = - "AccountTransferIntention{amount=$amount, currency=$currency, description=$description, destinationAccountId=$destinationAccountId, sourceAccountId=$sourceAccountId, transferId=$transferId, additionalProperties=$additionalProperties}" + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ACCOUNT_TRANSFER_INTENTION -> Known.ACCOUNT_TRANSFER_INTENTION + ACH_TRANSFER_INTENTION -> Known.ACH_TRANSFER_INTENTION + ACH_TRANSFER_REJECTION -> Known.ACH_TRANSFER_REJECTION + ACH_TRANSFER_RETURN -> Known.ACH_TRANSFER_RETURN + CASHBACK_PAYMENT -> Known.CASHBACK_PAYMENT + CARD_DISPUTE_ACCEPTANCE -> Known.CARD_DISPUTE_ACCEPTANCE + CARD_DISPUTE_FINANCIAL -> Known.CARD_DISPUTE_FINANCIAL + CARD_DISPUTE_LOSS -> Known.CARD_DISPUTE_LOSS + CARD_REFUND -> Known.CARD_REFUND + CARD_SETTLEMENT -> Known.CARD_SETTLEMENT + CARD_FINANCIAL -> Known.CARD_FINANCIAL + CARD_REVENUE_PAYMENT -> Known.CARD_REVENUE_PAYMENT + CHECK_DEPOSIT_ACCEPTANCE -> Known.CHECK_DEPOSIT_ACCEPTANCE + CHECK_DEPOSIT_RETURN -> Known.CHECK_DEPOSIT_RETURN + FEDNOW_TRANSFER_ACKNOWLEDGEMENT -> Known.FEDNOW_TRANSFER_ACKNOWLEDGEMENT + CHECK_TRANSFER_DEPOSIT -> Known.CHECK_TRANSFER_DEPOSIT + FEE_PAYMENT -> Known.FEE_PAYMENT + INBOUND_ACH_TRANSFER -> Known.INBOUND_ACH_TRANSFER + INBOUND_ACH_TRANSFER_RETURN_INTENTION -> + Known.INBOUND_ACH_TRANSFER_RETURN_INTENTION + INBOUND_CHECK_DEPOSIT_RETURN_INTENTION -> + Known.INBOUND_CHECK_DEPOSIT_RETURN_INTENTION + INBOUND_CHECK_ADJUSTMENT -> Known.INBOUND_CHECK_ADJUSTMENT + INBOUND_FEDNOW_TRANSFER_CONFIRMATION -> + Known.INBOUND_FEDNOW_TRANSFER_CONFIRMATION + INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION -> + Known.INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION + INBOUND_WIRE_REVERSAL -> Known.INBOUND_WIRE_REVERSAL + INBOUND_WIRE_TRANSFER -> Known.INBOUND_WIRE_TRANSFER + INBOUND_WIRE_TRANSFER_REVERSAL -> Known.INBOUND_WIRE_TRANSFER_REVERSAL + INTEREST_PAYMENT -> Known.INTEREST_PAYMENT + INTERNAL_SOURCE -> Known.INTERNAL_SOURCE + REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT -> + Known.REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT + SAMPLE_FUNDS -> Known.SAMPLE_FUNDS + WIRE_TRANSFER_INTENTION -> Known.WIRE_TRANSFER_INTENTION + SWIFT_TRANSFER_INTENTION -> Known.SWIFT_TRANSFER_INTENTION + SWIFT_TRANSFER_RETURN -> Known.SWIFT_TRANSFER_RETURN + CARD_PUSH_TRANSFER_ACCEPTANCE -> Known.CARD_PUSH_TRANSFER_ACCEPTANCE + ACCOUNT_REVENUE_PAYMENT -> Known.ACCOUNT_REVENUE_PAYMENT + BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION -> + Known.BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION + BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT -> + Known.BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT + OTHER -> Known.OTHER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } /** - * An ACH Transfer Intention object. This field will be present in the JSON response if and - * only if `category` is equal to `ach_transfer_intention`. An ACH Transfer Intention is - * created from an ACH Transfer. It reflects the intention to move money into or out of an - * Increase account via the ACH network. + * An Account Revenue Payment object. This field will be present in the JSON response if and + * only if `category` is equal to `account_revenue_payment`. An Account Revenue Payment + * represents a payment made to an account from the bank. Account revenue is a type of + * non-interest income. */ - class AchTransferIntention + class AccountRevenuePayment @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val accountNumber: JsonField, - private val amount: JsonField, - private val routingNumber: JsonField, - private val statementDescriptor: JsonField, - private val transferId: JsonField, + private val accruedOnAccountId: JsonField, + private val periodEnd: JsonField, + private val periodStart: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("account_number") - @ExcludeMissing - accountNumber: JsonField = JsonMissing.of(), - @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), - @JsonProperty("routing_number") + @JsonProperty("accrued_on_account_id") @ExcludeMissing - routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("statement_descriptor") + accruedOnAccountId: JsonField = JsonMissing.of(), + @JsonProperty("period_end") @ExcludeMissing - statementDescriptor: JsonField = JsonMissing.of(), - @JsonProperty("transfer_id") + periodEnd: JsonField = JsonMissing.of(), + @JsonProperty("period_start") @ExcludeMissing - transferId: JsonField = JsonMissing.of(), - ) : this( - accountNumber, - amount, - routingNumber, - statementDescriptor, - transferId, - mutableMapOf(), - ) + periodStart: JsonField = JsonMissing.of(), + ) : this(accruedOnAccountId, periodEnd, periodStart, mutableMapOf()) /** - * The account number for the destination account. + * The account on which the account revenue was accrued. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun accountNumber(): String = accountNumber.getRequired("account_number") + fun accruedOnAccountId(): String = + accruedOnAccountId.getRequired("accrued_on_account_id") /** - * The amount in the minor unit of the transaction's currency. For dollars, for example, - * this is cents. + * The end of the period for which this transaction paid account revenue. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun amount(): Long = amount.getRequired("amount") + fun periodEnd(): OffsetDateTime = periodEnd.getRequired("period_end") /** - * The American Bankers' Association (ABA) Routing Transit Number (RTN) for the - * destination account. + * The start of the period for which this transaction paid account revenue. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun routingNumber(): String = routingNumber.getRequired("routing_number") + fun periodStart(): OffsetDateTime = periodStart.getRequired("period_start") /** - * A description set when the ACH Transfer was created. + * Returns the raw JSON value of [accruedOnAccountId]. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). + * Unlike [accruedOnAccountId], this method doesn't throw if the JSON field has an + * unexpected type. */ - fun statementDescriptor(): String = - statementDescriptor.getRequired("statement_descriptor") + @JsonProperty("accrued_on_account_id") + @ExcludeMissing + fun _accruedOnAccountId(): JsonField = accruedOnAccountId /** - * The identifier of the ACH Transfer that led to this Transaction. + * Returns the raw JSON value of [periodEnd]. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). + * Unlike [periodEnd], this method doesn't throw if the JSON field has an unexpected + * type. */ - fun transferId(): String = transferId.getRequired("transfer_id") + @JsonProperty("period_end") + @ExcludeMissing + fun _periodEnd(): JsonField = periodEnd /** - * Returns the raw JSON value of [accountNumber]. + * Returns the raw JSON value of [periodStart]. * - * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected + * Unlike [periodStart], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("account_number") + @JsonProperty("period_start") @ExcludeMissing - fun _accountNumber(): JsonField = accountNumber - - /** - * Returns the raw JSON value of [amount]. - * - * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount - - /** - * Returns the raw JSON value of [routingNumber]. - * - * Unlike [routingNumber], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("routing_number") - @ExcludeMissing - fun _routingNumber(): JsonField = routingNumber - - /** - * Returns the raw JSON value of [statementDescriptor]. - * - * Unlike [statementDescriptor], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("statement_descriptor") - @ExcludeMissing - fun _statementDescriptor(): JsonField = statementDescriptor - - /** - * Returns the raw JSON value of [transferId]. - * - * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("transfer_id") - @ExcludeMissing - fun _transferId(): JsonField = transferId + fun _periodStart(): JsonField = periodStart @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -4349,115 +4104,77 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [AchTransferIntention]. + * Returns a mutable builder for constructing an instance of + * [AccountRevenuePayment]. * * The following fields are required: * ```java - * .accountNumber() - * .amount() - * .routingNumber() - * .statementDescriptor() - * .transferId() + * .accruedOnAccountId() + * .periodEnd() + * .periodStart() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [AchTransferIntention]. */ + /** A builder for [AccountRevenuePayment]. */ class Builder internal constructor() { - private var accountNumber: JsonField? = null - private var amount: JsonField? = null - private var routingNumber: JsonField? = null - private var statementDescriptor: JsonField? = null - private var transferId: JsonField? = null + private var accruedOnAccountId: JsonField? = null + private var periodEnd: JsonField? = null + private var periodStart: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(achTransferIntention: AchTransferIntention) = apply { - accountNumber = achTransferIntention.accountNumber - amount = achTransferIntention.amount - routingNumber = achTransferIntention.routingNumber - statementDescriptor = achTransferIntention.statementDescriptor - transferId = achTransferIntention.transferId - additionalProperties = achTransferIntention.additionalProperties.toMutableMap() - } - - /** The account number for the destination account. */ - fun accountNumber(accountNumber: String) = - accountNumber(JsonField.of(accountNumber)) - - /** - * Sets [Builder.accountNumber] to an arbitrary JSON value. - * - * You should usually call [Builder.accountNumber] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun accountNumber(accountNumber: JsonField) = apply { - this.accountNumber = accountNumber + internal fun from(accountRevenuePayment: AccountRevenuePayment) = apply { + accruedOnAccountId = accountRevenuePayment.accruedOnAccountId + periodEnd = accountRevenuePayment.periodEnd + periodStart = accountRevenuePayment.periodStart + additionalProperties = accountRevenuePayment.additionalProperties.toMutableMap() } - /** - * The amount in the minor unit of the transaction's currency. For dollars, for - * example, this is cents. - */ - fun amount(amount: Long) = amount(JsonField.of(amount)) - - /** - * Sets [Builder.amount] to an arbitrary JSON value. - * - * You should usually call [Builder.amount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun amount(amount: JsonField) = apply { this.amount = amount } - - /** - * The American Bankers' Association (ABA) Routing Transit Number (RTN) for the - * destination account. - */ - fun routingNumber(routingNumber: String) = - routingNumber(JsonField.of(routingNumber)) + /** The account on which the account revenue was accrued. */ + fun accruedOnAccountId(accruedOnAccountId: String) = + accruedOnAccountId(JsonField.of(accruedOnAccountId)) /** - * Sets [Builder.routingNumber] to an arbitrary JSON value. + * Sets [Builder.accruedOnAccountId] to an arbitrary JSON value. * - * You should usually call [Builder.routingNumber] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * You should usually call [Builder.accruedOnAccountId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. */ - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber + fun accruedOnAccountId(accruedOnAccountId: JsonField) = apply { + this.accruedOnAccountId = accruedOnAccountId } - /** A description set when the ACH Transfer was created. */ - fun statementDescriptor(statementDescriptor: String) = - statementDescriptor(JsonField.of(statementDescriptor)) + /** The end of the period for which this transaction paid account revenue. */ + fun periodEnd(periodEnd: OffsetDateTime) = periodEnd(JsonField.of(periodEnd)) /** - * Sets [Builder.statementDescriptor] to an arbitrary JSON value. + * Sets [Builder.periodEnd] to an arbitrary JSON value. * - * You should usually call [Builder.statementDescriptor] with a well-typed [String] + * You should usually call [Builder.periodEnd] with a well-typed [OffsetDateTime] * value instead. This method is primarily for setting the field to an undocumented * or not yet supported value. */ - fun statementDescriptor(statementDescriptor: JsonField) = apply { - this.statementDescriptor = statementDescriptor + fun periodEnd(periodEnd: JsonField) = apply { + this.periodEnd = periodEnd } - /** The identifier of the ACH Transfer that led to this Transaction. */ - fun transferId(transferId: String) = transferId(JsonField.of(transferId)) + /** The start of the period for which this transaction paid account revenue. */ + fun periodStart(periodStart: OffsetDateTime) = + periodStart(JsonField.of(periodStart)) /** - * Sets [Builder.transferId] to an arbitrary JSON value. + * Sets [Builder.periodStart] to an arbitrary JSON value. * - * You should usually call [Builder.transferId] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * You should usually call [Builder.periodStart] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. */ - fun transferId(transferId: JsonField) = apply { - this.transferId = transferId + fun periodStart(periodStart: JsonField) = apply { + this.periodStart = periodStart } fun additionalProperties(additionalProperties: Map) = apply { @@ -4483,44 +4200,38 @@ private constructor( } /** - * Returns an immutable instance of [AchTransferIntention]. + * Returns an immutable instance of [AccountRevenuePayment]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .accountNumber() - * .amount() - * .routingNumber() - * .statementDescriptor() - * .transferId() + * .accruedOnAccountId() + * .periodEnd() + * .periodStart() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): AchTransferIntention = - AchTransferIntention( - checkRequired("accountNumber", accountNumber), - checkRequired("amount", amount), - checkRequired("routingNumber", routingNumber), - checkRequired("statementDescriptor", statementDescriptor), - checkRequired("transferId", transferId), + fun build(): AccountRevenuePayment = + AccountRevenuePayment( + checkRequired("accruedOnAccountId", accruedOnAccountId), + checkRequired("periodEnd", periodEnd), + checkRequired("periodStart", periodStart), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): AchTransferIntention = apply { + fun validate(): AccountRevenuePayment = apply { if (validated) { return@apply } - accountNumber() - amount() - routingNumber() - statementDescriptor() - transferId() + accruedOnAccountId() + periodEnd() + periodStart() validated = true } @@ -4540,65 +4251,128 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (accountNumber.asKnown().isPresent) 1 else 0) + - (if (amount.asKnown().isPresent) 1 else 0) + - (if (routingNumber.asKnown().isPresent) 1 else 0) + - (if (statementDescriptor.asKnown().isPresent) 1 else 0) + - (if (transferId.asKnown().isPresent) 1 else 0) + (if (accruedOnAccountId.asKnown().isPresent) 1 else 0) + + (if (periodEnd.asKnown().isPresent) 1 else 0) + + (if (periodStart.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is AchTransferIntention && - accountNumber == other.accountNumber && - amount == other.amount && - routingNumber == other.routingNumber && - statementDescriptor == other.statementDescriptor && - transferId == other.transferId && + return other is AccountRevenuePayment && + accruedOnAccountId == other.accruedOnAccountId && + periodEnd == other.periodEnd && + periodStart == other.periodStart && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash( - accountNumber, - amount, - routingNumber, - statementDescriptor, - transferId, - additionalProperties, - ) + Objects.hash(accruedOnAccountId, periodEnd, periodStart, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "AchTransferIntention{accountNumber=$accountNumber, amount=$amount, routingNumber=$routingNumber, statementDescriptor=$statementDescriptor, transferId=$transferId, additionalProperties=$additionalProperties}" + "AccountRevenuePayment{accruedOnAccountId=$accruedOnAccountId, periodEnd=$periodEnd, periodStart=$periodStart, additionalProperties=$additionalProperties}" } /** - * An ACH Transfer Rejection object. This field will be present in the JSON response if and - * only if `category` is equal to `ach_transfer_rejection`. An ACH Transfer Rejection is - * created when an ACH Transfer is rejected by Increase. It offsets the ACH Transfer - * Intention. These rejections are rare. + * An Account Transfer Intention object. This field will be present in the JSON response if + * and only if `category` is equal to `account_transfer_intention`. Two Account Transfer + * Intentions are created from each Account Transfer. One decrements the source account, and + * the other increments the destination account. */ - class AchTransferRejection + class AccountTransferIntention @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val description: JsonField, + private val destinationAccountId: JsonField, + private val sourceAccountId: JsonField, private val transferId: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + @JsonProperty("description") + @ExcludeMissing + description: JsonField = JsonMissing.of(), + @JsonProperty("destination_account_id") + @ExcludeMissing + destinationAccountId: JsonField = JsonMissing.of(), + @JsonProperty("source_account_id") + @ExcludeMissing + sourceAccountId: JsonField = JsonMissing.of(), @JsonProperty("transfer_id") @ExcludeMissing - transferId: JsonField = JsonMissing.of() - ) : this(transferId, mutableMapOf()) + transferId: JsonField = JsonMissing.of(), + ) : this( + amount, + currency, + description, + destinationAccountId, + sourceAccountId, + transferId, + mutableMapOf(), + ) /** - * The identifier of the ACH Transfer that led to this Transaction. + * The pending amount in the minor unit of the transaction's currency. For dollars, for + * example, this is cents. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun currency(): Currency = currency.getRequired("currency") + + /** + * The description you chose to give the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun description(): String = description.getRequired("description") + + /** + * The identifier of the Account to where the Account Transfer was sent. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun destinationAccountId(): String = + destinationAccountId.getRequired("destination_account_id") + + /** + * The identifier of the Account from where the Account Transfer was sent. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun sourceAccountId(): String = sourceAccountId.getRequired("source_account_id") + + /** + * The identifier of the Account Transfer that led to this Pending Transaction. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -4606,6 +4380,53 @@ private constructor( */ fun transferId(): String = transferId.getRequired("transfer_id") + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + /** + * Returns the raw JSON value of [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("description") + @ExcludeMissing + fun _description(): JsonField = description + + /** + * Returns the raw JSON value of [destinationAccountId]. + * + * Unlike [destinationAccountId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("destination_account_id") + @ExcludeMissing + fun _destinationAccountId(): JsonField = destinationAccountId + + /** + * Returns the raw JSON value of [sourceAccountId]. + * + * Unlike [sourceAccountId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("source_account_id") + @ExcludeMissing + fun _sourceAccountId(): JsonField = sourceAccountId + /** * Returns the raw JSON value of [transferId]. * @@ -4631,29 +4452,120 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [AchTransferRejection]. + * Returns a mutable builder for constructing an instance of + * [AccountTransferIntention]. * * The following fields are required: * ```java + * .amount() + * .currency() + * .description() + * .destinationAccountId() + * .sourceAccountId() * .transferId() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [AchTransferRejection]. */ + /** A builder for [AccountTransferIntention]. */ class Builder internal constructor() { + private var amount: JsonField? = null + private var currency: JsonField? = null + private var description: JsonField? = null + private var destinationAccountId: JsonField? = null + private var sourceAccountId: JsonField? = null private var transferId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(achTransferRejection: AchTransferRejection) = apply { - transferId = achTransferRejection.transferId - additionalProperties = achTransferRejection.additionalProperties.toMutableMap() + internal fun from(accountTransferIntention: AccountTransferIntention) = apply { + amount = accountTransferIntention.amount + currency = accountTransferIntention.currency + description = accountTransferIntention.description + destinationAccountId = accountTransferIntention.destinationAccountId + sourceAccountId = accountTransferIntention.sourceAccountId + transferId = accountTransferIntention.transferId + additionalProperties = + accountTransferIntention.additionalProperties.toMutableMap() } - /** The identifier of the ACH Transfer that led to this Transaction. */ + /** + * The pending amount in the minor unit of the transaction's currency. For dollars, + * for example, this is cents. + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + */ + fun currency(currency: Currency) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [Currency] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** The description you chose to give the transfer. */ + fun description(description: String) = description(JsonField.of(description)) + + /** + * Sets [Builder.description] to an arbitrary JSON value. + * + * You should usually call [Builder.description] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun description(description: JsonField) = apply { + this.description = description + } + + /** The identifier of the Account to where the Account Transfer was sent. */ + fun destinationAccountId(destinationAccountId: String) = + destinationAccountId(JsonField.of(destinationAccountId)) + + /** + * Sets [Builder.destinationAccountId] to an arbitrary JSON value. + * + * You should usually call [Builder.destinationAccountId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun destinationAccountId(destinationAccountId: JsonField) = apply { + this.destinationAccountId = destinationAccountId + } + + /** The identifier of the Account from where the Account Transfer was sent. */ + fun sourceAccountId(sourceAccountId: String) = + sourceAccountId(JsonField.of(sourceAccountId)) + + /** + * Sets [Builder.sourceAccountId] to an arbitrary JSON value. + * + * You should usually call [Builder.sourceAccountId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun sourceAccountId(sourceAccountId: JsonField) = apply { + this.sourceAccountId = sourceAccountId + } + + /** The identifier of the Account Transfer that led to this Pending Transaction. */ fun transferId(transferId: String) = transferId(JsonField.of(transferId)) /** @@ -4690,19 +4602,29 @@ private constructor( } /** - * Returns an immutable instance of [AchTransferRejection]. + * Returns an immutable instance of [AccountTransferIntention]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java + * .amount() + * .currency() + * .description() + * .destinationAccountId() + * .sourceAccountId() * .transferId() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): AchTransferRejection = - AchTransferRejection( + fun build(): AccountTransferIntention = + AccountTransferIntention( + checkRequired("amount", amount), + checkRequired("currency", currency), + checkRequired("description", description), + checkRequired("destinationAccountId", destinationAccountId), + checkRequired("sourceAccountId", sourceAccountId), checkRequired("transferId", transferId), additionalProperties.toMutableMap(), ) @@ -4710,11 +4632,16 @@ private constructor( private var validated: Boolean = false - fun validate(): AchTransferRejection = apply { + fun validate(): AccountTransferIntention = apply { if (validated) { return@apply } + amount() + currency().validate() + description() + destinationAccountId() + sourceAccountId() transferId() validated = true } @@ -4734,129 +4661,261 @@ private constructor( * Used for best match union deserialization. */ @JvmSynthetic - internal fun validity(): Int = (if (transferId.asKnown().isPresent) 1 else 0) + internal fun validity(): Int = + (if (amount.asKnown().isPresent) 1 else 0) + + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (if (description.asKnown().isPresent) 1 else 0) + + (if (destinationAccountId.asKnown().isPresent) 1 else 0) + + (if (sourceAccountId.asKnown().isPresent) 1 else 0) + + (if (transferId.asKnown().isPresent) 1 else 0) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + */ + class Currency @JsonCreator private constructor(private val value: JsonField) : + Enum { - return other is AchTransferRejection && - transferId == other.transferId && - additionalProperties == other.additionalProperties - } + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - private val hashCode: Int by lazy { Objects.hash(transferId, additionalProperties) } + companion object { - override fun hashCode(): Int = hashCode + /** US Dollar (USD) */ + @JvmField val USD = of("USD") - override fun toString() = - "AchTransferRejection{transferId=$transferId, additionalProperties=$additionalProperties}" + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** US Dollar (USD) */ + USD + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** US Dollar (USD) */ + USD, + /** + * An enum member indicating that [Currency] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USD -> Value.USD + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Currency = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccountTransferIntention && + amount == other.amount && + currency == other.currency && + description == other.description && + destinationAccountId == other.destinationAccountId && + sourceAccountId == other.sourceAccountId && + transferId == other.transferId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + amount, + currency, + description, + destinationAccountId, + sourceAccountId, + transferId, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AccountTransferIntention{amount=$amount, currency=$currency, description=$description, destinationAccountId=$destinationAccountId, sourceAccountId=$sourceAccountId, transferId=$transferId, additionalProperties=$additionalProperties}" } /** - * An ACH Transfer Return object. This field will be present in the JSON response if and - * only if `category` is equal to `ach_transfer_return`. An ACH Transfer Return is created - * when an ACH Transfer is returned by the receiving bank. It offsets the ACH Transfer - * Intention. ACH Transfer Returns usually occur within the first two business days after - * the transfer is initiated, but can occur much later. + * An ACH Transfer Intention object. This field will be present in the JSON response if and + * only if `category` is equal to `ach_transfer_intention`. An ACH Transfer Intention is + * created from an ACH Transfer. It reflects the intention to move money into or out of an + * Increase account via the ACH network. */ - class AchTransferReturn + class AchTransferIntention @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val createdAt: JsonField, - private val rawReturnReasonCode: JsonField, - private val returnReasonCode: JsonField, - private val traceNumber: JsonField, - private val transactionId: JsonField, + private val accountNumber: JsonField, + private val amount: JsonField, + private val routingNumber: JsonField, + private val statementDescriptor: JsonField, private val transferId: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("created_at") - @ExcludeMissing - createdAt: JsonField = JsonMissing.of(), - @JsonProperty("raw_return_reason_code") - @ExcludeMissing - rawReturnReasonCode: JsonField = JsonMissing.of(), - @JsonProperty("return_reason_code") + @JsonProperty("account_number") @ExcludeMissing - returnReasonCode: JsonField = JsonMissing.of(), - @JsonProperty("trace_number") + accountNumber: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") @ExcludeMissing - traceNumber: JsonField = JsonMissing.of(), - @JsonProperty("transaction_id") + routingNumber: JsonField = JsonMissing.of(), + @JsonProperty("statement_descriptor") @ExcludeMissing - transactionId: JsonField = JsonMissing.of(), + statementDescriptor: JsonField = JsonMissing.of(), @JsonProperty("transfer_id") @ExcludeMissing transferId: JsonField = JsonMissing.of(), ) : this( - createdAt, - rawReturnReasonCode, - returnReasonCode, - traceNumber, - transactionId, + accountNumber, + amount, + routingNumber, + statementDescriptor, transferId, mutableMapOf(), ) /** - * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the - * transfer was created. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - - /** - * The three character ACH return code, in the range R01 to R85. + * The account number for the destination account. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun rawReturnReasonCode(): String = - rawReturnReasonCode.getRequired("raw_return_reason_code") + fun accountNumber(): String = accountNumber.getRequired("account_number") /** - * Why the ACH Transfer was returned. This reason code is sent by the receiving bank - * back to Increase. + * The amount in the minor unit of the transaction's currency. For dollars, for example, + * this is cents. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun returnReasonCode(): ReturnReasonCode = - returnReasonCode.getRequired("return_reason_code") + fun amount(): Long = amount.getRequired("amount") /** - * A 15 digit number that was generated by the bank that initiated the return. The trace - * number of the return is different than that of the original transfer. ACH trace - * numbers are not unique, but along with the amount and date this number can be used to - * identify the ACH return at the bank that initiated it. + * The American Bankers' Association (ABA) Routing Transit Number (RTN) for the + * destination account. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun traceNumber(): String = traceNumber.getRequired("trace_number") + fun routingNumber(): String = routingNumber.getRequired("routing_number") /** - * The identifier of the Transaction associated with this return. + * A description set when the ACH Transfer was created. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun transactionId(): String = transactionId.getRequired("transaction_id") + fun statementDescriptor(): String = + statementDescriptor.getRequired("statement_descriptor") /** - * The identifier of the ACH Transfer associated with this return. + * The identifier of the ACH Transfer that led to this Transaction. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -4865,54 +4924,41 @@ private constructor( fun transferId(): String = transferId.getRequired("transfer_id") /** - * Returns the raw JSON value of [createdAt]. + * Returns the raw JSON value of [accountNumber]. * - * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected + * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("created_at") - @ExcludeMissing - fun _createdAt(): JsonField = createdAt - - /** - * Returns the raw JSON value of [rawReturnReasonCode]. - * - * Unlike [rawReturnReasonCode], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("raw_return_reason_code") + @JsonProperty("account_number") @ExcludeMissing - fun _rawReturnReasonCode(): JsonField = rawReturnReasonCode + fun _accountNumber(): JsonField = accountNumber /** - * Returns the raw JSON value of [returnReasonCode]. + * Returns the raw JSON value of [amount]. * - * Unlike [returnReasonCode], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("return_reason_code") - @ExcludeMissing - fun _returnReasonCode(): JsonField = returnReasonCode + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount /** - * Returns the raw JSON value of [traceNumber]. + * Returns the raw JSON value of [routingNumber]. * - * Unlike [traceNumber], this method doesn't throw if the JSON field has an unexpected + * Unlike [routingNumber], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("trace_number") + @JsonProperty("routing_number") @ExcludeMissing - fun _traceNumber(): JsonField = traceNumber + fun _routingNumber(): JsonField = routingNumber /** - * Returns the raw JSON value of [transactionId]. + * Returns the raw JSON value of [statementDescriptor]. * - * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [statementDescriptor], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JsonProperty("transaction_id") + @JsonProperty("statement_descriptor") @ExcludeMissing - fun _transactionId(): JsonField = transactionId + fun _statementDescriptor(): JsonField = statementDescriptor /** * Returns the raw JSON value of [transferId]. @@ -4939,128 +4985,104 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [AchTransferReturn]. + * Returns a mutable builder for constructing an instance of [AchTransferIntention]. * * The following fields are required: * ```java - * .createdAt() - * .rawReturnReasonCode() - * .returnReasonCode() - * .traceNumber() - * .transactionId() + * .accountNumber() + * .amount() + * .routingNumber() + * .statementDescriptor() * .transferId() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [AchTransferReturn]. */ + /** A builder for [AchTransferIntention]. */ class Builder internal constructor() { - private var createdAt: JsonField? = null - private var rawReturnReasonCode: JsonField? = null - private var returnReasonCode: JsonField? = null - private var traceNumber: JsonField? = null - private var transactionId: JsonField? = null + private var accountNumber: JsonField? = null + private var amount: JsonField? = null + private var routingNumber: JsonField? = null + private var statementDescriptor: JsonField? = null private var transferId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(achTransferReturn: AchTransferReturn) = apply { - createdAt = achTransferReturn.createdAt - rawReturnReasonCode = achTransferReturn.rawReturnReasonCode - returnReasonCode = achTransferReturn.returnReasonCode - traceNumber = achTransferReturn.traceNumber - transactionId = achTransferReturn.transactionId - transferId = achTransferReturn.transferId - additionalProperties = achTransferReturn.additionalProperties.toMutableMap() - } - - /** - * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the - * transfer was created. - */ - fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - - /** - * Sets [Builder.createdAt] to an arbitrary JSON value. - * - * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun createdAt(createdAt: JsonField) = apply { - this.createdAt = createdAt + internal fun from(achTransferIntention: AchTransferIntention) = apply { + accountNumber = achTransferIntention.accountNumber + amount = achTransferIntention.amount + routingNumber = achTransferIntention.routingNumber + statementDescriptor = achTransferIntention.statementDescriptor + transferId = achTransferIntention.transferId + additionalProperties = achTransferIntention.additionalProperties.toMutableMap() } - /** The three character ACH return code, in the range R01 to R85. */ - fun rawReturnReasonCode(rawReturnReasonCode: String) = - rawReturnReasonCode(JsonField.of(rawReturnReasonCode)) + /** The account number for the destination account. */ + fun accountNumber(accountNumber: String) = + accountNumber(JsonField.of(accountNumber)) /** - * Sets [Builder.rawReturnReasonCode] to an arbitrary JSON value. + * Sets [Builder.accountNumber] to an arbitrary JSON value. * - * You should usually call [Builder.rawReturnReasonCode] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. + * You should usually call [Builder.accountNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. */ - fun rawReturnReasonCode(rawReturnReasonCode: JsonField) = apply { - this.rawReturnReasonCode = rawReturnReasonCode + fun accountNumber(accountNumber: JsonField) = apply { + this.accountNumber = accountNumber } /** - * Why the ACH Transfer was returned. This reason code is sent by the receiving bank - * back to Increase. + * The amount in the minor unit of the transaction's currency. For dollars, for + * example, this is cents. */ - fun returnReasonCode(returnReasonCode: ReturnReasonCode) = - returnReasonCode(JsonField.of(returnReasonCode)) + fun amount(amount: Long) = amount(JsonField.of(amount)) /** - * Sets [Builder.returnReasonCode] to an arbitrary JSON value. + * Sets [Builder.amount] to an arbitrary JSON value. * - * You should usually call [Builder.returnReasonCode] with a well-typed - * [ReturnReasonCode] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. + * You should usually call [Builder.amount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun returnReasonCode(returnReasonCode: JsonField) = apply { - this.returnReasonCode = returnReasonCode - } + fun amount(amount: JsonField) = apply { this.amount = amount } /** - * A 15 digit number that was generated by the bank that initiated the return. The - * trace number of the return is different than that of the original transfer. ACH - * trace numbers are not unique, but along with the amount and date this number can - * be used to identify the ACH return at the bank that initiated it. + * The American Bankers' Association (ABA) Routing Transit Number (RTN) for the + * destination account. */ - fun traceNumber(traceNumber: String) = traceNumber(JsonField.of(traceNumber)) + fun routingNumber(routingNumber: String) = + routingNumber(JsonField.of(routingNumber)) /** - * Sets [Builder.traceNumber] to an arbitrary JSON value. + * Sets [Builder.routingNumber] to an arbitrary JSON value. * - * You should usually call [Builder.traceNumber] with a well-typed [String] value + * You should usually call [Builder.routingNumber] with a well-typed [String] value * instead. This method is primarily for setting the field to an undocumented or not * yet supported value. */ - fun traceNumber(traceNumber: JsonField) = apply { - this.traceNumber = traceNumber + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber } - /** The identifier of the Transaction associated with this return. */ - fun transactionId(transactionId: String) = - transactionId(JsonField.of(transactionId)) + /** A description set when the ACH Transfer was created. */ + fun statementDescriptor(statementDescriptor: String) = + statementDescriptor(JsonField.of(statementDescriptor)) /** - * Sets [Builder.transactionId] to an arbitrary JSON value. + * Sets [Builder.statementDescriptor] to an arbitrary JSON value. * - * You should usually call [Builder.transactionId] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * You should usually call [Builder.statementDescriptor] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. */ - fun transactionId(transactionId: JsonField) = apply { - this.transactionId = transactionId + fun statementDescriptor(statementDescriptor: JsonField) = apply { + this.statementDescriptor = statementDescriptor } - /** The identifier of the ACH Transfer associated with this return. */ + /** The identifier of the ACH Transfer that led to this Transaction. */ fun transferId(transferId: String) = transferId(JsonField.of(transferId)) /** @@ -5097,29 +5119,27 @@ private constructor( } /** - * Returns an immutable instance of [AchTransferReturn]. + * Returns an immutable instance of [AchTransferIntention]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .createdAt() - * .rawReturnReasonCode() - * .returnReasonCode() - * .traceNumber() - * .transactionId() + * .accountNumber() + * .amount() + * .routingNumber() + * .statementDescriptor() * .transferId() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): AchTransferReturn = - AchTransferReturn( - checkRequired("createdAt", createdAt), - checkRequired("rawReturnReasonCode", rawReturnReasonCode), - checkRequired("returnReasonCode", returnReasonCode), - checkRequired("traceNumber", traceNumber), - checkRequired("transactionId", transactionId), + fun build(): AchTransferIntention = + AchTransferIntention( + checkRequired("accountNumber", accountNumber), + checkRequired("amount", amount), + checkRequired("routingNumber", routingNumber), + checkRequired("statementDescriptor", statementDescriptor), checkRequired("transferId", transferId), additionalProperties.toMutableMap(), ) @@ -5127,16 +5147,15 @@ private constructor( private var validated: Boolean = false - fun validate(): AchTransferReturn = apply { + fun validate(): AchTransferIntention = apply { if (validated) { return@apply } - createdAt() - rawReturnReasonCode() - returnReasonCode().validate() - traceNumber() - transactionId() + accountNumber() + amount() + routingNumber() + statementDescriptor() transferId() validated = true } @@ -5157,630 +5176,1247 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (createdAt.asKnown().isPresent) 1 else 0) + - (if (rawReturnReasonCode.asKnown().isPresent) 1 else 0) + - (returnReasonCode.asKnown().getOrNull()?.validity() ?: 0) + - (if (traceNumber.asKnown().isPresent) 1 else 0) + - (if (transactionId.asKnown().isPresent) 1 else 0) + + (if (accountNumber.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (routingNumber.asKnown().isPresent) 1 else 0) + + (if (statementDescriptor.asKnown().isPresent) 1 else 0) + (if (transferId.asKnown().isPresent) 1 else 0) - /** - * Why the ACH Transfer was returned. This reason code is sent by the receiving bank - * back to Increase. - */ - class ReturnReasonCode - @JsonCreator - private constructor(private val value: JsonField) : Enum { + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that - * doesn't match any known member, and you want to know that value. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + return other is AchTransferIntention && + accountNumber == other.accountNumber && + amount == other.amount && + routingNumber == other.routingNumber && + statementDescriptor == other.statementDescriptor && + transferId == other.transferId && + additionalProperties == other.additionalProperties + } - companion object { + private val hashCode: Int by lazy { + Objects.hash( + accountNumber, + amount, + routingNumber, + statementDescriptor, + transferId, + additionalProperties, + ) + } - /** - * Code R01. Insufficient funds in the receiving account. Sometimes abbreviated - * to NSF. - */ - @JvmField val INSUFFICIENT_FUND = of("insufficient_fund") + override fun hashCode(): Int = hashCode - /** - * Code R03. The account does not exist or the receiving bank was unable to - * locate it. - */ - @JvmField val NO_ACCOUNT = of("no_account") + override fun toString() = + "AchTransferIntention{accountNumber=$accountNumber, amount=$amount, routingNumber=$routingNumber, statementDescriptor=$statementDescriptor, transferId=$transferId, additionalProperties=$additionalProperties}" + } - /** Code R02. The account is closed at the receiving bank. */ - @JvmField val ACCOUNT_CLOSED = of("account_closed") + /** + * An ACH Transfer Rejection object. This field will be present in the JSON response if and + * only if `category` is equal to `ach_transfer_rejection`. An ACH Transfer Rejection is + * created when an ACH Transfer is rejected by Increase. It offsets the ACH Transfer + * Intention. These rejections are rare. + */ + class AchTransferRejection + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val transferId: JsonField, + private val additionalProperties: MutableMap, + ) { - /** Code R04. The account number is invalid at the receiving bank. */ - @JvmField - val INVALID_ACCOUNT_NUMBER_STRUCTURE = of("invalid_account_number_structure") - - /** - * Code R16. The account at the receiving bank was frozen per the Office of - * Foreign Assets Control. - */ - @JvmField - val ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION = - of("account_frozen_entry_returned_per_ofac_instruction") + @JsonCreator + private constructor( + @JsonProperty("transfer_id") + @ExcludeMissing + transferId: JsonField = JsonMissing.of() + ) : this(transferId, mutableMapOf()) - /** Code R23. The receiving bank account refused a credit transfer. */ - @JvmField - val CREDIT_ENTRY_REFUSED_BY_RECEIVER = of("credit_entry_refused_by_receiver") + /** + * The identifier of the ACH Transfer that led to this Transaction. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun transferId(): String = transferId.getRequired("transfer_id") - /** - * Code R05. The receiving bank rejected because of an incorrect Standard Entry - * Class code. - */ - @JvmField - val UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE = - of("unauthorized_debit_to_consumer_account_using_corporate_sec_code") + /** + * Returns the raw JSON value of [transferId]. + * + * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transfer_id") + @ExcludeMissing + fun _transferId(): JsonField = transferId - /** - * Code R29. The corporate customer at the receiving bank reversed the transfer. - */ - @JvmField - val CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED = - of("corporate_customer_advised_not_authorized") + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** Code R08. The receiving bank stopped payment on this transfer. */ - @JvmField val PAYMENT_STOPPED = of("payment_stopped") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** Code R20. The receiving bank account does not perform transfers. */ - @JvmField val NON_TRANSACTION_ACCOUNT = of("non_transaction_account") + fun toBuilder() = Builder().from(this) - /** - * Code R09. The receiving bank account does not have enough available balance - * for the transfer. - */ - @JvmField val UNCOLLECTED_FUNDS = of("uncollected_funds") + companion object { - /** Code R28. The routing number is incorrect. */ - @JvmField - val ROUTING_NUMBER_CHECK_DIGIT_ERROR = of("routing_number_check_digit_error") + /** + * Returns a mutable builder for constructing an instance of [AchTransferRejection]. + * + * The following fields are required: + * ```java + * .transferId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } - /** Code R10. The customer at the receiving bank reversed the transfer. */ - @JvmField - val CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE = - of("customer_advised_unauthorized_improper_ineligible_or_incomplete") + /** A builder for [AchTransferRejection]. */ + class Builder internal constructor() { - /** Code R19. The amount field is incorrect or too large. */ - @JvmField val AMOUNT_FIELD_ERROR = of("amount_field_error") + private var transferId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() - /** - * Code R07. The customer at the receiving institution informed their bank that - * they have revoked authorization for a previously authorized transfer. - */ - @JvmField - val AUTHORIZATION_REVOKED_BY_CUSTOMER = of("authorization_revoked_by_customer") + @JvmSynthetic + internal fun from(achTransferRejection: AchTransferRejection) = apply { + transferId = achTransferRejection.transferId + additionalProperties = achTransferRejection.additionalProperties.toMutableMap() + } - /** Code R13. The routing number is invalid. */ - @JvmField val INVALID_ACH_ROUTING_NUMBER = of("invalid_ach_routing_number") + /** The identifier of the ACH Transfer that led to this Transaction. */ + fun transferId(transferId: String) = transferId(JsonField.of(transferId)) - /** - * Code R17. The receiving bank is unable to process a field in the transfer. - */ - @JvmField val FILE_RECORD_EDIT_CRITERIA = of("file_record_edit_criteria") + /** + * Sets [Builder.transferId] to an arbitrary JSON value. + * + * You should usually call [Builder.transferId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun transferId(transferId: JsonField) = apply { + this.transferId = transferId + } - /** Code R45. The individual name field was invalid. */ - @JvmField val ENR_INVALID_INDIVIDUAL_NAME = of("enr_invalid_individual_name") + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - /** - * Code R06. The originating financial institution asked for this transfer to be - * returned. The receiving bank is complying with the request. - */ - @JvmField val RETURNED_PER_ODFI_REQUEST = of("returned_per_odfi_request") + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - /** - * Code R34. The receiving bank's regulatory supervisor has limited their - * participation in the ACH network. - */ - @JvmField val LIMITED_PARTICIPATION_DFI = of("limited_participation_dfi") + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - /** Code R85. The outbound international ACH transfer was incorrect. */ - @JvmField - val INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT = - of("incorrectly_coded_outbound_international_payment") + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - /** Code R12. A rare return reason. The account was sold to another bank. */ - @JvmField val ACCOUNT_SOLD_TO_ANOTHER_DFI = of("account_sold_to_another_dfi") + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } - /** Code R25. The addenda record is incorrect or missing. */ - @JvmField val ADDENDA_ERROR = of("addenda_error") + /** + * Returns an immutable instance of [AchTransferRejection]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .transferId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AchTransferRejection = + AchTransferRejection( + checkRequired("transferId", transferId), + additionalProperties.toMutableMap(), + ) + } - /** Code R15. A rare return reason. The account holder is deceased. */ - @JvmField - val BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED = - of("beneficiary_or_account_holder_deceased") + private var validated: Boolean = false - /** - * Code R11. A rare return reason. The customer authorized some payment to the - * sender, but this payment was not in error. - */ - @JvmField - val CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS = - of("customer_advised_not_within_authorization_terms") + fun validate(): AchTransferRejection = apply { + if (validated) { + return@apply + } - /** - * Code R74. A rare return reason. Sent in response to a return that was - * returned with code `field_error`. The latest return should include the - * corrected field(s). - */ - @JvmField val CORRECTED_RETURN = of("corrected_return") + transferId() + validated = true + } - /** - * Code R24. A rare return reason. The receiving bank received an exact - * duplicate entry with the same trace number and amount. - */ - @JvmField val DUPLICATE_ENTRY = of("duplicate_entry") + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - /** - * Code R67. A rare return reason. The return this message refers to was a - * duplicate. - */ - @JvmField val DUPLICATE_RETURN = of("duplicate_return") + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = (if (transferId.asKnown().isPresent) 1 else 0) - /** - * Code R47. A rare return reason. Only used for US Government agency - * non-monetary automatic enrollment messages. - */ - @JvmField val ENR_DUPLICATE_ENROLLMENT = of("enr_duplicate_enrollment") + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - /** - * Code R43. A rare return reason. Only used for US Government agency - * non-monetary automatic enrollment messages. - */ - @JvmField - val ENR_INVALID_DFI_ACCOUNT_NUMBER = of("enr_invalid_dfi_account_number") + return other is AchTransferRejection && + transferId == other.transferId && + additionalProperties == other.additionalProperties + } - /** - * Code R44. A rare return reason. Only used for US Government agency - * non-monetary automatic enrollment messages. - */ - @JvmField - val ENR_INVALID_INDIVIDUAL_ID_NUMBER = of("enr_invalid_individual_id_number") + private val hashCode: Int by lazy { Objects.hash(transferId, additionalProperties) } - /** - * Code R46. A rare return reason. Only used for US Government agency - * non-monetary automatic enrollment messages. - */ - @JvmField - val ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR = - of("enr_invalid_representative_payee_indicator") + override fun hashCode(): Int = hashCode - /** - * Code R41. A rare return reason. Only used for US Government agency - * non-monetary automatic enrollment messages. - */ - @JvmField val ENR_INVALID_TRANSACTION_CODE = of("enr_invalid_transaction_code") + override fun toString() = + "AchTransferRejection{transferId=$transferId, additionalProperties=$additionalProperties}" + } - /** - * Code R40. A rare return reason. Only used for US Government agency - * non-monetary automatic enrollment messages. - */ - @JvmField val ENR_RETURN_OF_ENR_ENTRY = of("enr_return_of_enr_entry") + /** + * An ACH Transfer Return object. This field will be present in the JSON response if and + * only if `category` is equal to `ach_transfer_return`. An ACH Transfer Return is created + * when an ACH Transfer is returned by the receiving bank. It offsets the ACH Transfer + * Intention. ACH Transfer Returns usually occur within the first two business days after + * the transfer is initiated, but can occur much later. + */ + class AchTransferReturn + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val createdAt: JsonField, + private val rawReturnReasonCode: JsonField, + private val returnReasonCode: JsonField, + private val traceNumber: JsonField, + private val transactionId: JsonField, + private val transferId: JsonField, + private val additionalProperties: MutableMap, + ) { - /** - * Code R42. A rare return reason. Only used for US Government agency - * non-monetary automatic enrollment messages. - */ - @JvmField - val ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR = - of("enr_routing_number_check_digit_error") + @JsonCreator + private constructor( + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("raw_return_reason_code") + @ExcludeMissing + rawReturnReasonCode: JsonField = JsonMissing.of(), + @JsonProperty("return_reason_code") + @ExcludeMissing + returnReasonCode: JsonField = JsonMissing.of(), + @JsonProperty("trace_number") + @ExcludeMissing + traceNumber: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + @JsonProperty("transfer_id") + @ExcludeMissing + transferId: JsonField = JsonMissing.of(), + ) : this( + createdAt, + rawReturnReasonCode, + returnReasonCode, + traceNumber, + transactionId, + transferId, + mutableMapOf(), + ) - /** - * Code R84. A rare return reason. The International ACH Transfer cannot be - * processed by the gateway. - */ - @JvmField - val ENTRY_NOT_PROCESSED_BY_GATEWAY = of("entry_not_processed_by_gateway") + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was created. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - /** - * Code R69. A rare return reason. One or more of the fields in the ACH were - * malformed. - */ - @JvmField val FIELD_ERROR = of("field_error") + /** + * The three character ACH return code, in the range R01 to R85. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun rawReturnReasonCode(): String = + rawReturnReasonCode.getRequired("raw_return_reason_code") - /** - * Code R83. A rare return reason. The Foreign receiving bank was unable to - * settle this ACH transfer. - */ - @JvmField - val FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE = - of("foreign_receiving_dfi_unable_to_settle") + /** + * Why the ACH Transfer was returned. This reason code is sent by the receiving bank + * back to Increase. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun returnReasonCode(): ReturnReasonCode = + returnReasonCode.getRequired("return_reason_code") - /** - * Code R80. A rare return reason. The International ACH Transfer is malformed. - */ - @JvmField val IAT_ENTRY_CODING_ERROR = of("iat_entry_coding_error") + /** + * A 15 digit number that was generated by the bank that initiated the return. The trace + * number of the return is different than that of the original transfer. ACH trace + * numbers are not unique, but along with the amount and date this number can be used to + * identify the ACH return at the bank that initiated it. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun traceNumber(): String = traceNumber.getRequired("trace_number") - /** - * Code R18. A rare return reason. The ACH has an improper effective entry date - * field. - */ - @JvmField - val IMPROPER_EFFECTIVE_ENTRY_DATE = of("improper_effective_entry_date") + /** + * The identifier of the Transaction associated with this return. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun transactionId(): String = transactionId.getRequired("transaction_id") - /** - * Code R39. A rare return reason. The source document related to this ACH, - * usually an ACH check conversion, was presented to the bank. - */ - @JvmField - val IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED = - of("improper_source_document_source_document_presented") + /** + * The identifier of the ACH Transfer associated with this return. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun transferId(): String = transferId.getRequired("transfer_id") - /** - * Code R21. A rare return reason. The Company ID field of the ACH was invalid. - */ - @JvmField val INVALID_COMPANY_ID = of("invalid_company_id") + /** + * Returns the raw JSON value of [createdAt]. + * + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("created_at") + @ExcludeMissing + fun _createdAt(): JsonField = createdAt - /** - * Code R82. A rare return reason. The foreign receiving bank identifier for an - * International ACH Transfer was invalid. - */ - @JvmField - val INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION = - of("invalid_foreign_receiving_dfi_identification") + /** + * Returns the raw JSON value of [rawReturnReasonCode]. + * + * Unlike [rawReturnReasonCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("raw_return_reason_code") + @ExcludeMissing + fun _rawReturnReasonCode(): JsonField = rawReturnReasonCode - /** - * Code R22. A rare return reason. The Individual ID number field of the ACH was - * invalid. - */ - @JvmField val INVALID_INDIVIDUAL_ID_NUMBER = of("invalid_individual_id_number") + /** + * Returns the raw JSON value of [returnReasonCode]. + * + * Unlike [returnReasonCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("return_reason_code") + @ExcludeMissing + fun _returnReasonCode(): JsonField = returnReasonCode - /** - * Code R53. A rare return reason. Both the Represented Check ("RCK") entry and - * the original check were presented to the bank. - */ - @JvmField - val ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT = - of("item_and_rck_entry_presented_for_payment") + /** + * Returns the raw JSON value of [traceNumber]. + * + * Unlike [traceNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("trace_number") + @ExcludeMissing + fun _traceNumber(): JsonField = traceNumber - /** - * Code R51. A rare return reason. The Represented Check ("RCK") entry is - * ineligible. - */ - @JvmField - val ITEM_RELATED_TO_RCK_ENTRY_IS_INELIGIBLE = - of("item_related_to_rck_entry_is_ineligible") + /** + * Returns the raw JSON value of [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId - /** Code R26. A rare return reason. The ACH is missing a required field. */ - @JvmField val MANDATORY_FIELD_ERROR = of("mandatory_field_error") + /** + * Returns the raw JSON value of [transferId]. + * + * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transfer_id") + @ExcludeMissing + fun _transferId(): JsonField = transferId - /** - * Code R71. A rare return reason. The receiving bank does not recognize the - * routing number in a dishonored return entry. - */ - @JvmField val MISROUTED_DISHONORED_RETURN = of("misrouted_dishonored_return") + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** - * Code R61. A rare return reason. The receiving bank does not recognize the - * routing number in a return entry. - */ - @JvmField val MISROUTED_RETURN = of("misrouted_return") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** - * Code R76. A rare return reason. Sent in response to a return, the bank does - * not find the errors alleged by the returning bank. - */ - @JvmField val NO_ERRORS_FOUND = of("no_errors_found") + fun toBuilder() = Builder().from(this) - /** - * Code R77. A rare return reason. The receiving bank does not accept the return - * of the erroneous debit. The funds are not available at the receiving bank. - */ - @JvmField - val NON_ACCEPTANCE_OF_R62_DISHONORED_RETURN = - of("non_acceptance_of_r62_dishonored_return") + companion object { - /** - * Code R81. A rare return reason. The receiving bank does not accept - * International ACH Transfers. - */ - @JvmField - val NON_PARTICIPANT_IN_IAT_PROGRAM = of("non_participant_in_iat_program") + /** + * Returns a mutable builder for constructing an instance of [AchTransferReturn]. + * + * The following fields are required: + * ```java + * .createdAt() + * .rawReturnReasonCode() + * .returnReasonCode() + * .traceNumber() + * .transactionId() + * .transferId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } - /** - * Code R31. A rare return reason. A return that has been agreed to be accepted - * by the receiving bank, despite falling outside of the usual return timeframe. - */ - @JvmField val PERMISSIBLE_RETURN_ENTRY = of("permissible_return_entry") + /** A builder for [AchTransferReturn]. */ + class Builder internal constructor() { - /** - * Code R70. A rare return reason. The receiving bank had not approved this - * return. - */ - @JvmField - val PERMISSIBLE_RETURN_ENTRY_NOT_ACCEPTED = - of("permissible_return_entry_not_accepted") + private var createdAt: JsonField? = null + private var rawReturnReasonCode: JsonField? = null + private var returnReasonCode: JsonField? = null + private var traceNumber: JsonField? = null + private var transactionId: JsonField? = null + private var transferId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() - /** - * Code R32. A rare return reason. The receiving bank could not settle this - * transaction. - */ - @JvmField val RDFI_NON_SETTLEMENT = of("rdfi_non_settlement") + @JvmSynthetic + internal fun from(achTransferReturn: AchTransferReturn) = apply { + createdAt = achTransferReturn.createdAt + rawReturnReasonCode = achTransferReturn.rawReturnReasonCode + returnReasonCode = achTransferReturn.returnReasonCode + traceNumber = achTransferReturn.traceNumber + transactionId = achTransferReturn.transactionId + transferId = achTransferReturn.transferId + additionalProperties = achTransferReturn.additionalProperties.toMutableMap() + } - /** - * Code R30. A rare return reason. The receiving bank does not accept Check - * Truncation ACH transfers. - */ - @JvmField - val RDFI_PARTICIPANT_IN_CHECK_TRUNCATION_PROGRAM = - of("rdfi_participant_in_check_truncation_program") + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was created. + */ + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - /** Code R14. A rare return reason. The payee is deceased. */ - @JvmField - val REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY = - of("representative_payee_deceased_or_unable_to_continue_in_that_capacity") + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun createdAt(createdAt: JsonField) = apply { + this.createdAt = createdAt + } - /** - * Code R75. A rare return reason. The originating bank disputes that an earlier - * `duplicate_entry` return was actually a duplicate. - */ - @JvmField val RETURN_NOT_A_DUPLICATE = of("return_not_a_duplicate") + /** The three character ACH return code, in the range R01 to R85. */ + fun rawReturnReasonCode(rawReturnReasonCode: String) = + rawReturnReasonCode(JsonField.of(rawReturnReasonCode)) - /** - * Code R62. A rare return reason. The originating financial institution made a - * mistake and this return corrects it. - */ - @JvmField - val RETURN_OF_ERRONEOUS_OR_REVERSING_DEBIT = - of("return_of_erroneous_or_reversing_debit") + /** + * Sets [Builder.rawReturnReasonCode] to an arbitrary JSON value. + * + * You should usually call [Builder.rawReturnReasonCode] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun rawReturnReasonCode(rawReturnReasonCode: JsonField) = apply { + this.rawReturnReasonCode = rawReturnReasonCode + } - /** Code R36. A rare return reason. Return of a malformed credit entry. */ - @JvmField - val RETURN_OF_IMPROPER_CREDIT_ENTRY = of("return_of_improper_credit_entry") + /** + * Why the ACH Transfer was returned. This reason code is sent by the receiving bank + * back to Increase. + */ + fun returnReasonCode(returnReasonCode: ReturnReasonCode) = + returnReasonCode(JsonField.of(returnReasonCode)) - /** Code R35. A rare return reason. Return of a malformed debit entry. */ - @JvmField - val RETURN_OF_IMPROPER_DEBIT_ENTRY = of("return_of_improper_debit_entry") + /** + * Sets [Builder.returnReasonCode] to an arbitrary JSON value. + * + * You should usually call [Builder.returnReasonCode] with a well-typed + * [ReturnReasonCode] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun returnReasonCode(returnReasonCode: JsonField) = apply { + this.returnReasonCode = returnReasonCode + } - /** - * Code R33. A rare return reason. Return of a Destroyed Check ("XKC") entry. - */ - @JvmField val RETURN_OF_XCK_ENTRY = of("return_of_xck_entry") + /** + * A 15 digit number that was generated by the bank that initiated the return. The + * trace number of the return is different than that of the original transfer. ACH + * trace numbers are not unique, but along with the amount and date this number can + * be used to identify the ACH return at the bank that initiated it. + */ + fun traceNumber(traceNumber: String) = traceNumber(JsonField.of(traceNumber)) - /** - * Code R37. A rare return reason. The source document related to this ACH, - * usually an ACH check conversion, was presented to the bank. - */ - @JvmField - val SOURCE_DOCUMENT_PRESENTED_FOR_PAYMENT = - of("source_document_presented_for_payment") + /** + * Sets [Builder.traceNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.traceNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun traceNumber(traceNumber: JsonField) = apply { + this.traceNumber = traceNumber + } - /** - * Code R50. A rare return reason. State law prevents the bank from accepting - * the Represented Check ("RCK") entry. - */ - @JvmField - val STATE_LAW_AFFECTING_RCK_ACCEPTANCE = - of("state_law_affecting_rck_acceptance") + /** The identifier of the Transaction associated with this return. */ + fun transactionId(transactionId: String) = + transactionId(JsonField.of(transactionId)) - /** - * Code R52. A rare return reason. A stop payment was issued on a Represented - * Check ("RCK") entry. - */ - @JvmField - val STOP_PAYMENT_ON_ITEM_RELATED_TO_RCK_ENTRY = - of("stop_payment_on_item_related_to_rck_entry") + /** + * Sets [Builder.transactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } - /** - * Code R38. A rare return reason. The source attached to the ACH, usually an - * ACH check conversion, includes a stop payment. - */ - @JvmField - val STOP_PAYMENT_ON_SOURCE_DOCUMENT = of("stop_payment_on_source_document") + /** The identifier of the ACH Transfer associated with this return. */ + fun transferId(transferId: String) = transferId(JsonField.of(transferId)) - /** - * Code R73. A rare return reason. The bank receiving an `untimely_return` - * believes it was on time. - */ - @JvmField val TIMELY_ORIGINAL_RETURN = of("timely_original_return") + /** + * Sets [Builder.transferId] to an arbitrary JSON value. + * + * You should usually call [Builder.transferId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun transferId(transferId: JsonField) = apply { + this.transferId = transferId + } - /** - * Code R27. A rare return reason. An ACH return's trace number does not match - * an originated ACH. - */ - @JvmField val TRACE_NUMBER_ERROR = of("trace_number_error") + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - /** Code R72. A rare return reason. The dishonored return was sent too late. */ - @JvmField val UNTIMELY_DISHONORED_RETURN = of("untimely_dishonored_return") + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - /** Code R68. A rare return reason. The return was sent too late. */ - @JvmField val UNTIMELY_RETURN = of("untimely_return") + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - @JvmStatic fun of(value: String) = ReturnReasonCode(JsonField.of(value)) + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - /** An enum containing [ReturnReasonCode]'s known values. */ - enum class Known { + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [AchTransferReturn]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .createdAt() + * .rawReturnReasonCode() + * .returnReasonCode() + * .traceNumber() + * .transactionId() + * .transferId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AchTransferReturn = + AchTransferReturn( + checkRequired("createdAt", createdAt), + checkRequired("rawReturnReasonCode", rawReturnReasonCode), + checkRequired("returnReasonCode", returnReasonCode), + checkRequired("traceNumber", traceNumber), + checkRequired("transactionId", transactionId), + checkRequired("transferId", transferId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): AchTransferReturn = apply { + if (validated) { + return@apply + } + + createdAt() + rawReturnReasonCode() + returnReasonCode().validate() + traceNumber() + transactionId() + transferId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (createdAt.asKnown().isPresent) 1 else 0) + + (if (rawReturnReasonCode.asKnown().isPresent) 1 else 0) + + (returnReasonCode.asKnown().getOrNull()?.validity() ?: 0) + + (if (traceNumber.asKnown().isPresent) 1 else 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + (if (transferId.asKnown().isPresent) 1 else 0) + + /** + * Why the ACH Transfer was returned. This reason code is sent by the receiving bank + * back to Increase. + */ + class ReturnReasonCode + @JsonCreator + private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + /** * Code R01. Insufficient funds in the receiving account. Sometimes abbreviated * to NSF. */ - INSUFFICIENT_FUND, + @JvmField val INSUFFICIENT_FUND = of("insufficient_fund") + /** * Code R03. The account does not exist or the receiving bank was unable to * locate it. */ - NO_ACCOUNT, + @JvmField val NO_ACCOUNT = of("no_account") + /** Code R02. The account is closed at the receiving bank. */ - ACCOUNT_CLOSED, + @JvmField val ACCOUNT_CLOSED = of("account_closed") + /** Code R04. The account number is invalid at the receiving bank. */ - INVALID_ACCOUNT_NUMBER_STRUCTURE, + @JvmField + val INVALID_ACCOUNT_NUMBER_STRUCTURE = of("invalid_account_number_structure") + /** * Code R16. The account at the receiving bank was frozen per the Office of * Foreign Assets Control. */ - ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION, + @JvmField + val ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION = + of("account_frozen_entry_returned_per_ofac_instruction") + /** Code R23. The receiving bank account refused a credit transfer. */ - CREDIT_ENTRY_REFUSED_BY_RECEIVER, + @JvmField + val CREDIT_ENTRY_REFUSED_BY_RECEIVER = of("credit_entry_refused_by_receiver") + /** * Code R05. The receiving bank rejected because of an incorrect Standard Entry * Class code. */ - UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE, + @JvmField + val UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE = + of("unauthorized_debit_to_consumer_account_using_corporate_sec_code") + /** * Code R29. The corporate customer at the receiving bank reversed the transfer. */ - CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED, + @JvmField + val CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED = + of("corporate_customer_advised_not_authorized") + /** Code R08. The receiving bank stopped payment on this transfer. */ - PAYMENT_STOPPED, + @JvmField val PAYMENT_STOPPED = of("payment_stopped") + /** Code R20. The receiving bank account does not perform transfers. */ - NON_TRANSACTION_ACCOUNT, + @JvmField val NON_TRANSACTION_ACCOUNT = of("non_transaction_account") + /** * Code R09. The receiving bank account does not have enough available balance * for the transfer. */ - UNCOLLECTED_FUNDS, + @JvmField val UNCOLLECTED_FUNDS = of("uncollected_funds") + /** Code R28. The routing number is incorrect. */ - ROUTING_NUMBER_CHECK_DIGIT_ERROR, + @JvmField + val ROUTING_NUMBER_CHECK_DIGIT_ERROR = of("routing_number_check_digit_error") + /** Code R10. The customer at the receiving bank reversed the transfer. */ - CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE, + @JvmField + val CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE = + of("customer_advised_unauthorized_improper_ineligible_or_incomplete") + /** Code R19. The amount field is incorrect or too large. */ - AMOUNT_FIELD_ERROR, + @JvmField val AMOUNT_FIELD_ERROR = of("amount_field_error") + /** * Code R07. The customer at the receiving institution informed their bank that * they have revoked authorization for a previously authorized transfer. */ - AUTHORIZATION_REVOKED_BY_CUSTOMER, + @JvmField + val AUTHORIZATION_REVOKED_BY_CUSTOMER = of("authorization_revoked_by_customer") + /** Code R13. The routing number is invalid. */ - INVALID_ACH_ROUTING_NUMBER, + @JvmField val INVALID_ACH_ROUTING_NUMBER = of("invalid_ach_routing_number") + /** * Code R17. The receiving bank is unable to process a field in the transfer. */ - FILE_RECORD_EDIT_CRITERIA, + @JvmField val FILE_RECORD_EDIT_CRITERIA = of("file_record_edit_criteria") + /** Code R45. The individual name field was invalid. */ - ENR_INVALID_INDIVIDUAL_NAME, + @JvmField val ENR_INVALID_INDIVIDUAL_NAME = of("enr_invalid_individual_name") + /** * Code R06. The originating financial institution asked for this transfer to be * returned. The receiving bank is complying with the request. */ - RETURNED_PER_ODFI_REQUEST, + @JvmField val RETURNED_PER_ODFI_REQUEST = of("returned_per_odfi_request") + /** * Code R34. The receiving bank's regulatory supervisor has limited their * participation in the ACH network. */ - LIMITED_PARTICIPATION_DFI, + @JvmField val LIMITED_PARTICIPATION_DFI = of("limited_participation_dfi") + /** Code R85. The outbound international ACH transfer was incorrect. */ - INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT, + @JvmField + val INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT = + of("incorrectly_coded_outbound_international_payment") + /** Code R12. A rare return reason. The account was sold to another bank. */ - ACCOUNT_SOLD_TO_ANOTHER_DFI, + @JvmField val ACCOUNT_SOLD_TO_ANOTHER_DFI = of("account_sold_to_another_dfi") + /** Code R25. The addenda record is incorrect or missing. */ - ADDENDA_ERROR, + @JvmField val ADDENDA_ERROR = of("addenda_error") + /** Code R15. A rare return reason. The account holder is deceased. */ - BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED, + @JvmField + val BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED = + of("beneficiary_or_account_holder_deceased") + /** * Code R11. A rare return reason. The customer authorized some payment to the * sender, but this payment was not in error. */ - CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS, + @JvmField + val CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS = + of("customer_advised_not_within_authorization_terms") + /** * Code R74. A rare return reason. Sent in response to a return that was * returned with code `field_error`. The latest return should include the * corrected field(s). */ - CORRECTED_RETURN, + @JvmField val CORRECTED_RETURN = of("corrected_return") + /** * Code R24. A rare return reason. The receiving bank received an exact * duplicate entry with the same trace number and amount. */ - DUPLICATE_ENTRY, + @JvmField val DUPLICATE_ENTRY = of("duplicate_entry") + /** * Code R67. A rare return reason. The return this message refers to was a * duplicate. */ - DUPLICATE_RETURN, + @JvmField val DUPLICATE_RETURN = of("duplicate_return") + /** * Code R47. A rare return reason. Only used for US Government agency * non-monetary automatic enrollment messages. */ - ENR_DUPLICATE_ENROLLMENT, + @JvmField val ENR_DUPLICATE_ENROLLMENT = of("enr_duplicate_enrollment") + /** * Code R43. A rare return reason. Only used for US Government agency * non-monetary automatic enrollment messages. */ - ENR_INVALID_DFI_ACCOUNT_NUMBER, + @JvmField + val ENR_INVALID_DFI_ACCOUNT_NUMBER = of("enr_invalid_dfi_account_number") + /** * Code R44. A rare return reason. Only used for US Government agency * non-monetary automatic enrollment messages. */ - ENR_INVALID_INDIVIDUAL_ID_NUMBER, + @JvmField + val ENR_INVALID_INDIVIDUAL_ID_NUMBER = of("enr_invalid_individual_id_number") + /** * Code R46. A rare return reason. Only used for US Government agency * non-monetary automatic enrollment messages. */ - ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR, + @JvmField + val ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR = + of("enr_invalid_representative_payee_indicator") + /** * Code R41. A rare return reason. Only used for US Government agency * non-monetary automatic enrollment messages. */ - ENR_INVALID_TRANSACTION_CODE, + @JvmField val ENR_INVALID_TRANSACTION_CODE = of("enr_invalid_transaction_code") + /** * Code R40. A rare return reason. Only used for US Government agency * non-monetary automatic enrollment messages. */ - ENR_RETURN_OF_ENR_ENTRY, + @JvmField val ENR_RETURN_OF_ENR_ENTRY = of("enr_return_of_enr_entry") + /** * Code R42. A rare return reason. Only used for US Government agency * non-monetary automatic enrollment messages. */ - ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR, + @JvmField + val ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR = + of("enr_routing_number_check_digit_error") + /** * Code R84. A rare return reason. The International ACH Transfer cannot be * processed by the gateway. */ - ENTRY_NOT_PROCESSED_BY_GATEWAY, + @JvmField + val ENTRY_NOT_PROCESSED_BY_GATEWAY = of("entry_not_processed_by_gateway") + /** * Code R69. A rare return reason. One or more of the fields in the ACH were * malformed. */ - FIELD_ERROR, + @JvmField val FIELD_ERROR = of("field_error") + /** * Code R83. A rare return reason. The Foreign receiving bank was unable to * settle this ACH transfer. */ - FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE, + @JvmField + val FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE = + of("foreign_receiving_dfi_unable_to_settle") + /** * Code R80. A rare return reason. The International ACH Transfer is malformed. */ - IAT_ENTRY_CODING_ERROR, + @JvmField val IAT_ENTRY_CODING_ERROR = of("iat_entry_coding_error") + /** * Code R18. A rare return reason. The ACH has an improper effective entry date * field. */ - IMPROPER_EFFECTIVE_ENTRY_DATE, + @JvmField + val IMPROPER_EFFECTIVE_ENTRY_DATE = of("improper_effective_entry_date") + /** * Code R39. A rare return reason. The source document related to this ACH, * usually an ACH check conversion, was presented to the bank. */ - IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED, + @JvmField + val IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED = + of("improper_source_document_source_document_presented") + /** * Code R21. A rare return reason. The Company ID field of the ACH was invalid. */ - INVALID_COMPANY_ID, + @JvmField val INVALID_COMPANY_ID = of("invalid_company_id") + /** * Code R82. A rare return reason. The foreign receiving bank identifier for an * International ACH Transfer was invalid. */ - INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION, + @JvmField + val INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION = + of("invalid_foreign_receiving_dfi_identification") + /** * Code R22. A rare return reason. The Individual ID number field of the ACH was * invalid. */ - INVALID_INDIVIDUAL_ID_NUMBER, + @JvmField val INVALID_INDIVIDUAL_ID_NUMBER = of("invalid_individual_id_number") + /** * Code R53. A rare return reason. Both the Represented Check ("RCK") entry and * the original check were presented to the bank. */ - ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT, + @JvmField + val ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT = + of("item_and_rck_entry_presented_for_payment") + + /** + * Code R51. A rare return reason. The Represented Check ("RCK") entry is + * ineligible. + */ + @JvmField + val ITEM_RELATED_TO_RCK_ENTRY_IS_INELIGIBLE = + of("item_related_to_rck_entry_is_ineligible") + + /** Code R26. A rare return reason. The ACH is missing a required field. */ + @JvmField val MANDATORY_FIELD_ERROR = of("mandatory_field_error") + + /** + * Code R71. A rare return reason. The receiving bank does not recognize the + * routing number in a dishonored return entry. + */ + @JvmField val MISROUTED_DISHONORED_RETURN = of("misrouted_dishonored_return") + + /** + * Code R61. A rare return reason. The receiving bank does not recognize the + * routing number in a return entry. + */ + @JvmField val MISROUTED_RETURN = of("misrouted_return") + + /** + * Code R76. A rare return reason. Sent in response to a return, the bank does + * not find the errors alleged by the returning bank. + */ + @JvmField val NO_ERRORS_FOUND = of("no_errors_found") + + /** + * Code R77. A rare return reason. The receiving bank does not accept the return + * of the erroneous debit. The funds are not available at the receiving bank. + */ + @JvmField + val NON_ACCEPTANCE_OF_R62_DISHONORED_RETURN = + of("non_acceptance_of_r62_dishonored_return") + + /** + * Code R81. A rare return reason. The receiving bank does not accept + * International ACH Transfers. + */ + @JvmField + val NON_PARTICIPANT_IN_IAT_PROGRAM = of("non_participant_in_iat_program") + + /** + * Code R31. A rare return reason. A return that has been agreed to be accepted + * by the receiving bank, despite falling outside of the usual return timeframe. + */ + @JvmField val PERMISSIBLE_RETURN_ENTRY = of("permissible_return_entry") + + /** + * Code R70. A rare return reason. The receiving bank had not approved this + * return. + */ + @JvmField + val PERMISSIBLE_RETURN_ENTRY_NOT_ACCEPTED = + of("permissible_return_entry_not_accepted") + + /** + * Code R32. A rare return reason. The receiving bank could not settle this + * transaction. + */ + @JvmField val RDFI_NON_SETTLEMENT = of("rdfi_non_settlement") + + /** + * Code R30. A rare return reason. The receiving bank does not accept Check + * Truncation ACH transfers. + */ + @JvmField + val RDFI_PARTICIPANT_IN_CHECK_TRUNCATION_PROGRAM = + of("rdfi_participant_in_check_truncation_program") + + /** Code R14. A rare return reason. The payee is deceased. */ + @JvmField + val REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY = + of("representative_payee_deceased_or_unable_to_continue_in_that_capacity") + + /** + * Code R75. A rare return reason. The originating bank disputes that an earlier + * `duplicate_entry` return was actually a duplicate. + */ + @JvmField val RETURN_NOT_A_DUPLICATE = of("return_not_a_duplicate") + + /** + * Code R62. A rare return reason. The originating financial institution made a + * mistake and this return corrects it. + */ + @JvmField + val RETURN_OF_ERRONEOUS_OR_REVERSING_DEBIT = + of("return_of_erroneous_or_reversing_debit") + + /** Code R36. A rare return reason. Return of a malformed credit entry. */ + @JvmField + val RETURN_OF_IMPROPER_CREDIT_ENTRY = of("return_of_improper_credit_entry") + + /** Code R35. A rare return reason. Return of a malformed debit entry. */ + @JvmField + val RETURN_OF_IMPROPER_DEBIT_ENTRY = of("return_of_improper_debit_entry") + + /** + * Code R33. A rare return reason. Return of a Destroyed Check ("XKC") entry. + */ + @JvmField val RETURN_OF_XCK_ENTRY = of("return_of_xck_entry") + + /** + * Code R37. A rare return reason. The source document related to this ACH, + * usually an ACH check conversion, was presented to the bank. + */ + @JvmField + val SOURCE_DOCUMENT_PRESENTED_FOR_PAYMENT = + of("source_document_presented_for_payment") + + /** + * Code R50. A rare return reason. State law prevents the bank from accepting + * the Represented Check ("RCK") entry. + */ + @JvmField + val STATE_LAW_AFFECTING_RCK_ACCEPTANCE = + of("state_law_affecting_rck_acceptance") + + /** + * Code R52. A rare return reason. A stop payment was issued on a Represented + * Check ("RCK") entry. + */ + @JvmField + val STOP_PAYMENT_ON_ITEM_RELATED_TO_RCK_ENTRY = + of("stop_payment_on_item_related_to_rck_entry") + + /** + * Code R38. A rare return reason. The source attached to the ACH, usually an + * ACH check conversion, includes a stop payment. + */ + @JvmField + val STOP_PAYMENT_ON_SOURCE_DOCUMENT = of("stop_payment_on_source_document") + + /** + * Code R73. A rare return reason. The bank receiving an `untimely_return` + * believes it was on time. + */ + @JvmField val TIMELY_ORIGINAL_RETURN = of("timely_original_return") + + /** + * Code R27. A rare return reason. An ACH return's trace number does not match + * an originated ACH. + */ + @JvmField val TRACE_NUMBER_ERROR = of("trace_number_error") + + /** Code R72. A rare return reason. The dishonored return was sent too late. */ + @JvmField val UNTIMELY_DISHONORED_RETURN = of("untimely_dishonored_return") + + /** Code R68. A rare return reason. The return was sent too late. */ + @JvmField val UNTIMELY_RETURN = of("untimely_return") + + @JvmStatic fun of(value: String) = ReturnReasonCode(JsonField.of(value)) + } + + /** An enum containing [ReturnReasonCode]'s known values. */ + enum class Known { + /** + * Code R01. Insufficient funds in the receiving account. Sometimes abbreviated + * to NSF. + */ + INSUFFICIENT_FUND, + /** + * Code R03. The account does not exist or the receiving bank was unable to + * locate it. + */ + NO_ACCOUNT, + /** Code R02. The account is closed at the receiving bank. */ + ACCOUNT_CLOSED, + /** Code R04. The account number is invalid at the receiving bank. */ + INVALID_ACCOUNT_NUMBER_STRUCTURE, + /** + * Code R16. The account at the receiving bank was frozen per the Office of + * Foreign Assets Control. + */ + ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION, + /** Code R23. The receiving bank account refused a credit transfer. */ + CREDIT_ENTRY_REFUSED_BY_RECEIVER, + /** + * Code R05. The receiving bank rejected because of an incorrect Standard Entry + * Class code. + */ + UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE, + /** + * Code R29. The corporate customer at the receiving bank reversed the transfer. + */ + CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED, + /** Code R08. The receiving bank stopped payment on this transfer. */ + PAYMENT_STOPPED, + /** Code R20. The receiving bank account does not perform transfers. */ + NON_TRANSACTION_ACCOUNT, + /** + * Code R09. The receiving bank account does not have enough available balance + * for the transfer. + */ + UNCOLLECTED_FUNDS, + /** Code R28. The routing number is incorrect. */ + ROUTING_NUMBER_CHECK_DIGIT_ERROR, + /** Code R10. The customer at the receiving bank reversed the transfer. */ + CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE, + /** Code R19. The amount field is incorrect or too large. */ + AMOUNT_FIELD_ERROR, + /** + * Code R07. The customer at the receiving institution informed their bank that + * they have revoked authorization for a previously authorized transfer. + */ + AUTHORIZATION_REVOKED_BY_CUSTOMER, + /** Code R13. The routing number is invalid. */ + INVALID_ACH_ROUTING_NUMBER, + /** + * Code R17. The receiving bank is unable to process a field in the transfer. + */ + FILE_RECORD_EDIT_CRITERIA, + /** Code R45. The individual name field was invalid. */ + ENR_INVALID_INDIVIDUAL_NAME, + /** + * Code R06. The originating financial institution asked for this transfer to be + * returned. The receiving bank is complying with the request. + */ + RETURNED_PER_ODFI_REQUEST, + /** + * Code R34. The receiving bank's regulatory supervisor has limited their + * participation in the ACH network. + */ + LIMITED_PARTICIPATION_DFI, + /** Code R85. The outbound international ACH transfer was incorrect. */ + INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT, + /** Code R12. A rare return reason. The account was sold to another bank. */ + ACCOUNT_SOLD_TO_ANOTHER_DFI, + /** Code R25. The addenda record is incorrect or missing. */ + ADDENDA_ERROR, + /** Code R15. A rare return reason. The account holder is deceased. */ + BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED, + /** + * Code R11. A rare return reason. The customer authorized some payment to the + * sender, but this payment was not in error. + */ + CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS, + /** + * Code R74. A rare return reason. Sent in response to a return that was + * returned with code `field_error`. The latest return should include the + * corrected field(s). + */ + CORRECTED_RETURN, + /** + * Code R24. A rare return reason. The receiving bank received an exact + * duplicate entry with the same trace number and amount. + */ + DUPLICATE_ENTRY, + /** + * Code R67. A rare return reason. The return this message refers to was a + * duplicate. + */ + DUPLICATE_RETURN, + /** + * Code R47. A rare return reason. Only used for US Government agency + * non-monetary automatic enrollment messages. + */ + ENR_DUPLICATE_ENROLLMENT, + /** + * Code R43. A rare return reason. Only used for US Government agency + * non-monetary automatic enrollment messages. + */ + ENR_INVALID_DFI_ACCOUNT_NUMBER, + /** + * Code R44. A rare return reason. Only used for US Government agency + * non-monetary automatic enrollment messages. + */ + ENR_INVALID_INDIVIDUAL_ID_NUMBER, + /** + * Code R46. A rare return reason. Only used for US Government agency + * non-monetary automatic enrollment messages. + */ + ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR, + /** + * Code R41. A rare return reason. Only used for US Government agency + * non-monetary automatic enrollment messages. + */ + ENR_INVALID_TRANSACTION_CODE, + /** + * Code R40. A rare return reason. Only used for US Government agency + * non-monetary automatic enrollment messages. + */ + ENR_RETURN_OF_ENR_ENTRY, + /** + * Code R42. A rare return reason. Only used for US Government agency + * non-monetary automatic enrollment messages. + */ + ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR, + /** + * Code R84. A rare return reason. The International ACH Transfer cannot be + * processed by the gateway. + */ + ENTRY_NOT_PROCESSED_BY_GATEWAY, + /** + * Code R69. A rare return reason. One or more of the fields in the ACH were + * malformed. + */ + FIELD_ERROR, + /** + * Code R83. A rare return reason. The Foreign receiving bank was unable to + * settle this ACH transfer. + */ + FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE, + /** + * Code R80. A rare return reason. The International ACH Transfer is malformed. + */ + IAT_ENTRY_CODING_ERROR, + /** + * Code R18. A rare return reason. The ACH has an improper effective entry date + * field. + */ + IMPROPER_EFFECTIVE_ENTRY_DATE, + /** + * Code R39. A rare return reason. The source document related to this ACH, + * usually an ACH check conversion, was presented to the bank. + */ + IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED, + /** + * Code R21. A rare return reason. The Company ID field of the ACH was invalid. + */ + INVALID_COMPANY_ID, + /** + * Code R82. A rare return reason. The foreign receiving bank identifier for an + * International ACH Transfer was invalid. + */ + INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION, + /** + * Code R22. A rare return reason. The Individual ID number field of the ACH was + * invalid. + */ + INVALID_INDIVIDUAL_ID_NUMBER, + /** + * Code R53. A rare return reason. Both the Represented Check ("RCK") entry and + * the original check were presented to the bank. + */ + ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT, /** * Code R51. A rare return reason. The Represented Check ("RCK") entry is * ineligible. @@ -37528,1111 +38164,225 @@ private constructor( @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount /** - * Returns the raw JSON value of [currency]. - * - * Unlike [currency], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("currency") - @ExcludeMissing - fun _currency(): JsonField = currency - - /** - * Returns the raw JSON value of [periodEnd]. - * - * Unlike [periodEnd], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("period_end") - @ExcludeMissing - fun _periodEnd(): JsonField = periodEnd - - /** - * Returns the raw JSON value of [periodStart]. - * - * Unlike [periodStart], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("period_start") - @ExcludeMissing - fun _periodStart(): JsonField = periodStart - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of [CashbackPayment]. - * - * The following fields are required: - * ```java - * .accruedOnCardId() - * .amount() - * .currency() - * .periodEnd() - * .periodStart() - * ``` - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [CashbackPayment]. */ - class Builder internal constructor() { - - private var accruedOnCardId: JsonField? = null - private var amount: JsonField? = null - private var currency: JsonField? = null - private var periodEnd: JsonField? = null - private var periodStart: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(cashbackPayment: CashbackPayment) = apply { - accruedOnCardId = cashbackPayment.accruedOnCardId - amount = cashbackPayment.amount - currency = cashbackPayment.currency - periodEnd = cashbackPayment.periodEnd - periodStart = cashbackPayment.periodStart - additionalProperties = cashbackPayment.additionalProperties.toMutableMap() - } - - /** The card on which the cashback was accrued. */ - fun accruedOnCardId(accruedOnCardId: String?) = - accruedOnCardId(JsonField.ofNullable(accruedOnCardId)) - - /** - * Alias for calling [Builder.accruedOnCardId] with `accruedOnCardId.orElse(null)`. - */ - fun accruedOnCardId(accruedOnCardId: Optional) = - accruedOnCardId(accruedOnCardId.getOrNull()) - - /** - * Sets [Builder.accruedOnCardId] to an arbitrary JSON value. - * - * You should usually call [Builder.accruedOnCardId] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun accruedOnCardId(accruedOnCardId: JsonField) = apply { - this.accruedOnCardId = accruedOnCardId - } - - /** - * The amount in the minor unit of the transaction's currency. For dollars, for - * example, this is cents. - */ - fun amount(amount: Long) = amount(JsonField.of(amount)) - - /** - * Sets [Builder.amount] to an arbitrary JSON value. - * - * You should usually call [Builder.amount] with a well-typed [Long] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun amount(amount: JsonField) = apply { this.amount = amount } - - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction - * currency. - */ - fun currency(currency: Currency) = currency(JsonField.of(currency)) - - /** - * Sets [Builder.currency] to an arbitrary JSON value. - * - * You should usually call [Builder.currency] with a well-typed [Currency] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun currency(currency: JsonField) = apply { this.currency = currency } - - /** The end of the period for which this transaction paid cashback. */ - fun periodEnd(periodEnd: OffsetDateTime) = periodEnd(JsonField.of(periodEnd)) - - /** - * Sets [Builder.periodEnd] to an arbitrary JSON value. - * - * You should usually call [Builder.periodEnd] with a well-typed [OffsetDateTime] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun periodEnd(periodEnd: JsonField) = apply { - this.periodEnd = periodEnd - } - - /** The start of the period for which this transaction paid cashback. */ - fun periodStart(periodStart: OffsetDateTime) = - periodStart(JsonField.of(periodStart)) - - /** - * Sets [Builder.periodStart] to an arbitrary JSON value. - * - * You should usually call [Builder.periodStart] with a well-typed [OffsetDateTime] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun periodStart(periodStart: JsonField) = apply { - this.periodStart = periodStart - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } - - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) - } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } - - /** - * Returns an immutable instance of [CashbackPayment]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .accruedOnCardId() - * .amount() - * .currency() - * .periodEnd() - * .periodStart() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): CashbackPayment = - CashbackPayment( - checkRequired("accruedOnCardId", accruedOnCardId), - checkRequired("amount", amount), - checkRequired("currency", currency), - checkRequired("periodEnd", periodEnd), - checkRequired("periodStart", periodStart), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): CashbackPayment = apply { - if (validated) { - return@apply - } - - accruedOnCardId() - amount() - currency().validate() - periodEnd() - periodStart() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic - internal fun validity(): Int = - (if (accruedOnCardId.asKnown().isPresent) 1 else 0) + - (if (amount.asKnown().isPresent) 1 else 0) + - (currency.asKnown().getOrNull()?.validity() ?: 0) + - (if (periodEnd.asKnown().isPresent) 1 else 0) + - (if (periodStart.asKnown().isPresent) 1 else 0) - - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction - * currency. - */ - class Currency @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that - * doesn't match any known member, and you want to know that value. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** US Dollar (USD) */ - @JvmField val USD = of("USD") - - @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) - } - - /** An enum containing [Currency]'s known values. */ - enum class Known { - /** US Dollar (USD) */ - USD - } - - /** - * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Currency] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, - * if the SDK is on an older version than the API, then the API may respond with - * new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** US Dollar (USD) */ - USD, - /** - * An enum member indicating that [Currency] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if - * you want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - USD -> Value.USD - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a - * known member. - */ - fun known(): Known = - when (this) { - USD -> Known.USD - else -> throw IncreaseInvalidDataException("Unknown Currency: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have - * the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Currency = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Currency && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is CashbackPayment && - accruedOnCardId == other.accruedOnCardId && - amount == other.amount && - currency == other.currency && - periodEnd == other.periodEnd && - periodStart == other.periodStart && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - accruedOnCardId, - amount, - currency, - periodEnd, - periodStart, - additionalProperties, - ) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "CashbackPayment{accruedOnCardId=$accruedOnCardId, amount=$amount, currency=$currency, periodEnd=$periodEnd, periodStart=$periodStart, additionalProperties=$additionalProperties}" - } - - /** - * The type of the resource. We may add additional possible values for this enum over time; - * your application should be able to handle such additions gracefully. - */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** - * Account Transfer Intention: details will be under the - * `account_transfer_intention` object. - */ - @JvmField val ACCOUNT_TRANSFER_INTENTION = of("account_transfer_intention") - - /** - * ACH Transfer Intention: details will be under the `ach_transfer_intention` - * object. - */ - @JvmField val ACH_TRANSFER_INTENTION = of("ach_transfer_intention") - - /** - * ACH Transfer Rejection: details will be under the `ach_transfer_rejection` - * object. - */ - @JvmField val ACH_TRANSFER_REJECTION = of("ach_transfer_rejection") - - /** ACH Transfer Return: details will be under the `ach_transfer_return` object. */ - @JvmField val ACH_TRANSFER_RETURN = of("ach_transfer_return") - - /** Cashback Payment: details will be under the `cashback_payment` object. */ - @JvmField val CASHBACK_PAYMENT = of("cashback_payment") - - /** - * Legacy Card Dispute Acceptance: details will be under the - * `card_dispute_acceptance` object. - */ - @JvmField val CARD_DISPUTE_ACCEPTANCE = of("card_dispute_acceptance") - - /** - * Card Dispute Financial: details will be under the `card_dispute_financial` - * object. - */ - @JvmField val CARD_DISPUTE_FINANCIAL = of("card_dispute_financial") - - /** - * Legacy Card Dispute Loss: details will be under the `card_dispute_loss` object. - */ - @JvmField val CARD_DISPUTE_LOSS = of("card_dispute_loss") - - /** Card Refund: details will be under the `card_refund` object. */ - @JvmField val CARD_REFUND = of("card_refund") - - /** Card Settlement: details will be under the `card_settlement` object. */ - @JvmField val CARD_SETTLEMENT = of("card_settlement") - - /** Card Financial: details will be under the `card_financial` object. */ - @JvmField val CARD_FINANCIAL = of("card_financial") - - /** - * Card Revenue Payment: details will be under the `card_revenue_payment` object. - */ - @JvmField val CARD_REVENUE_PAYMENT = of("card_revenue_payment") - - /** - * Check Deposit Acceptance: details will be under the `check_deposit_acceptance` - * object. - */ - @JvmField val CHECK_DEPOSIT_ACCEPTANCE = of("check_deposit_acceptance") - - /** - * Check Deposit Return: details will be under the `check_deposit_return` object. - */ - @JvmField val CHECK_DEPOSIT_RETURN = of("check_deposit_return") - - /** - * FedNow Transfer Acknowledgement: details will be under the - * `fednow_transfer_acknowledgement` object. - */ - @JvmField - val FEDNOW_TRANSFER_ACKNOWLEDGEMENT = of("fednow_transfer_acknowledgement") - - /** - * Check Transfer Deposit: details will be under the `check_transfer_deposit` - * object. - */ - @JvmField val CHECK_TRANSFER_DEPOSIT = of("check_transfer_deposit") - - /** Fee Payment: details will be under the `fee_payment` object. */ - @JvmField val FEE_PAYMENT = of("fee_payment") - - /** - * Inbound ACH Transfer Intention: details will be under the `inbound_ach_transfer` - * object. - */ - @JvmField val INBOUND_ACH_TRANSFER = of("inbound_ach_transfer") - - /** - * Inbound ACH Transfer Return Intention: details will be under the - * `inbound_ach_transfer_return_intention` object. - */ - @JvmField - val INBOUND_ACH_TRANSFER_RETURN_INTENTION = - of("inbound_ach_transfer_return_intention") - - /** - * Inbound Check Deposit Return Intention: details will be under the - * `inbound_check_deposit_return_intention` object. - */ - @JvmField - val INBOUND_CHECK_DEPOSIT_RETURN_INTENTION = - of("inbound_check_deposit_return_intention") - - /** - * Inbound Check Adjustment: details will be under the `inbound_check_adjustment` - * object. - */ - @JvmField val INBOUND_CHECK_ADJUSTMENT = of("inbound_check_adjustment") - - /** - * Inbound FedNow Transfer Confirmation: details will be under the - * `inbound_fednow_transfer_confirmation` object. - */ - @JvmField - val INBOUND_FEDNOW_TRANSFER_CONFIRMATION = - of("inbound_fednow_transfer_confirmation") - - /** - * Inbound Real-Time Payments Transfer Confirmation: details will be under the - * `inbound_real_time_payments_transfer_confirmation` object. - */ - @JvmField - val INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION = - of("inbound_real_time_payments_transfer_confirmation") - - /** - * Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. - */ - @JvmField val INBOUND_WIRE_REVERSAL = of("inbound_wire_reversal") - - /** - * Inbound Wire Transfer Intention: details will be under the - * `inbound_wire_transfer` object. - */ - @JvmField val INBOUND_WIRE_TRANSFER = of("inbound_wire_transfer") - - /** - * Inbound Wire Transfer Reversal Intention: details will be under the - * `inbound_wire_transfer_reversal` object. - */ - @JvmField val INBOUND_WIRE_TRANSFER_REVERSAL = of("inbound_wire_transfer_reversal") - - /** Interest Payment: details will be under the `interest_payment` object. */ - @JvmField val INTEREST_PAYMENT = of("interest_payment") - - /** Internal Source: details will be under the `internal_source` object. */ - @JvmField val INTERNAL_SOURCE = of("internal_source") - - /** - * Real-Time Payments Transfer Acknowledgement: details will be under the - * `real_time_payments_transfer_acknowledgement` object. - */ - @JvmField - val REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT = - of("real_time_payments_transfer_acknowledgement") - - /** Sample Funds: details will be under the `sample_funds` object. */ - @JvmField val SAMPLE_FUNDS = of("sample_funds") - - /** - * Wire Transfer Intention: details will be under the `wire_transfer_intention` - * object. - */ - @JvmField val WIRE_TRANSFER_INTENTION = of("wire_transfer_intention") - - /** - * Swift Transfer Intention: details will be under the `swift_transfer_intention` - * object. - */ - @JvmField val SWIFT_TRANSFER_INTENTION = of("swift_transfer_intention") - - /** - * Swift Transfer Return: details will be under the `swift_transfer_return` object. - */ - @JvmField val SWIFT_TRANSFER_RETURN = of("swift_transfer_return") - - /** - * Card Push Transfer Acceptance: details will be under the - * `card_push_transfer_acceptance` object. - */ - @JvmField val CARD_PUSH_TRANSFER_ACCEPTANCE = of("card_push_transfer_acceptance") - - /** - * Account Revenue Payment: details will be under the `account_revenue_payment` - * object. - */ - @JvmField val ACCOUNT_REVENUE_PAYMENT = of("account_revenue_payment") - - /** - * Blockchain On-Ramp Transfer Intention: details will be under the - * `blockchain_onramp_transfer_intention` object. - */ - @JvmField - val BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION = - of("blockchain_onramp_transfer_intention") - - /** - * Blockchain Off-Ramp Transfer Settlement: details will be under the - * `blockchain_offramp_transfer_settlement` object. - */ - @JvmField - val BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT = - of("blockchain_offramp_transfer_settlement") - - /** The Transaction was made for an undocumented or deprecated reason. */ - @JvmField val OTHER = of("other") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** - * Account Transfer Intention: details will be under the - * `account_transfer_intention` object. - */ - ACCOUNT_TRANSFER_INTENTION, - /** - * ACH Transfer Intention: details will be under the `ach_transfer_intention` - * object. - */ - ACH_TRANSFER_INTENTION, - /** - * ACH Transfer Rejection: details will be under the `ach_transfer_rejection` - * object. - */ - ACH_TRANSFER_REJECTION, - /** ACH Transfer Return: details will be under the `ach_transfer_return` object. */ - ACH_TRANSFER_RETURN, - /** Cashback Payment: details will be under the `cashback_payment` object. */ - CASHBACK_PAYMENT, - /** - * Legacy Card Dispute Acceptance: details will be under the - * `card_dispute_acceptance` object. - */ - CARD_DISPUTE_ACCEPTANCE, - /** - * Card Dispute Financial: details will be under the `card_dispute_financial` - * object. - */ - CARD_DISPUTE_FINANCIAL, - /** - * Legacy Card Dispute Loss: details will be under the `card_dispute_loss` object. - */ - CARD_DISPUTE_LOSS, - /** Card Refund: details will be under the `card_refund` object. */ - CARD_REFUND, - /** Card Settlement: details will be under the `card_settlement` object. */ - CARD_SETTLEMENT, - /** Card Financial: details will be under the `card_financial` object. */ - CARD_FINANCIAL, - /** - * Card Revenue Payment: details will be under the `card_revenue_payment` object. - */ - CARD_REVENUE_PAYMENT, - /** - * Check Deposit Acceptance: details will be under the `check_deposit_acceptance` - * object. - */ - CHECK_DEPOSIT_ACCEPTANCE, - /** - * Check Deposit Return: details will be under the `check_deposit_return` object. - */ - CHECK_DEPOSIT_RETURN, - /** - * FedNow Transfer Acknowledgement: details will be under the - * `fednow_transfer_acknowledgement` object. - */ - FEDNOW_TRANSFER_ACKNOWLEDGEMENT, - /** - * Check Transfer Deposit: details will be under the `check_transfer_deposit` - * object. - */ - CHECK_TRANSFER_DEPOSIT, - /** Fee Payment: details will be under the `fee_payment` object. */ - FEE_PAYMENT, - /** - * Inbound ACH Transfer Intention: details will be under the `inbound_ach_transfer` - * object. - */ - INBOUND_ACH_TRANSFER, - /** - * Inbound ACH Transfer Return Intention: details will be under the - * `inbound_ach_transfer_return_intention` object. - */ - INBOUND_ACH_TRANSFER_RETURN_INTENTION, - /** - * Inbound Check Deposit Return Intention: details will be under the - * `inbound_check_deposit_return_intention` object. - */ - INBOUND_CHECK_DEPOSIT_RETURN_INTENTION, - /** - * Inbound Check Adjustment: details will be under the `inbound_check_adjustment` - * object. - */ - INBOUND_CHECK_ADJUSTMENT, - /** - * Inbound FedNow Transfer Confirmation: details will be under the - * `inbound_fednow_transfer_confirmation` object. - */ - INBOUND_FEDNOW_TRANSFER_CONFIRMATION, - /** - * Inbound Real-Time Payments Transfer Confirmation: details will be under the - * `inbound_real_time_payments_transfer_confirmation` object. - */ - INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION, - /** - * Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. - */ - INBOUND_WIRE_REVERSAL, - /** - * Inbound Wire Transfer Intention: details will be under the - * `inbound_wire_transfer` object. - */ - INBOUND_WIRE_TRANSFER, - /** - * Inbound Wire Transfer Reversal Intention: details will be under the - * `inbound_wire_transfer_reversal` object. - */ - INBOUND_WIRE_TRANSFER_REVERSAL, - /** Interest Payment: details will be under the `interest_payment` object. */ - INTEREST_PAYMENT, - /** Internal Source: details will be under the `internal_source` object. */ - INTERNAL_SOURCE, - /** - * Real-Time Payments Transfer Acknowledgement: details will be under the - * `real_time_payments_transfer_acknowledgement` object. - */ - REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT, - /** Sample Funds: details will be under the `sample_funds` object. */ - SAMPLE_FUNDS, - /** - * Wire Transfer Intention: details will be under the `wire_transfer_intention` - * object. - */ - WIRE_TRANSFER_INTENTION, - /** - * Swift Transfer Intention: details will be under the `swift_transfer_intention` - * object. - */ - SWIFT_TRANSFER_INTENTION, - /** - * Swift Transfer Return: details will be under the `swift_transfer_return` object. - */ - SWIFT_TRANSFER_RETURN, - /** - * Card Push Transfer Acceptance: details will be under the - * `card_push_transfer_acceptance` object. - */ - CARD_PUSH_TRANSFER_ACCEPTANCE, - /** - * Account Revenue Payment: details will be under the `account_revenue_payment` - * object. - */ - ACCOUNT_REVENUE_PAYMENT, - /** - * Blockchain On-Ramp Transfer Intention: details will be under the - * `blockchain_onramp_transfer_intention` object. - */ - BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION, - /** - * Blockchain Off-Ramp Transfer Settlement: details will be under the - * `blockchain_offramp_transfer_settlement` object. - */ - BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT, - /** The Transaction was made for an undocumented or deprecated reason. */ - OTHER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** - * Account Transfer Intention: details will be under the - * `account_transfer_intention` object. - */ - ACCOUNT_TRANSFER_INTENTION, - /** - * ACH Transfer Intention: details will be under the `ach_transfer_intention` - * object. - */ - ACH_TRANSFER_INTENTION, - /** - * ACH Transfer Rejection: details will be under the `ach_transfer_rejection` - * object. - */ - ACH_TRANSFER_REJECTION, - /** ACH Transfer Return: details will be under the `ach_transfer_return` object. */ - ACH_TRANSFER_RETURN, - /** Cashback Payment: details will be under the `cashback_payment` object. */ - CASHBACK_PAYMENT, - /** - * Legacy Card Dispute Acceptance: details will be under the - * `card_dispute_acceptance` object. - */ - CARD_DISPUTE_ACCEPTANCE, - /** - * Card Dispute Financial: details will be under the `card_dispute_financial` - * object. - */ - CARD_DISPUTE_FINANCIAL, - /** - * Legacy Card Dispute Loss: details will be under the `card_dispute_loss` object. - */ - CARD_DISPUTE_LOSS, - /** Card Refund: details will be under the `card_refund` object. */ - CARD_REFUND, - /** Card Settlement: details will be under the `card_settlement` object. */ - CARD_SETTLEMENT, - /** Card Financial: details will be under the `card_financial` object. */ - CARD_FINANCIAL, - /** - * Card Revenue Payment: details will be under the `card_revenue_payment` object. - */ - CARD_REVENUE_PAYMENT, - /** - * Check Deposit Acceptance: details will be under the `check_deposit_acceptance` - * object. - */ - CHECK_DEPOSIT_ACCEPTANCE, - /** - * Check Deposit Return: details will be under the `check_deposit_return` object. - */ - CHECK_DEPOSIT_RETURN, - /** - * FedNow Transfer Acknowledgement: details will be under the - * `fednow_transfer_acknowledgement` object. - */ - FEDNOW_TRANSFER_ACKNOWLEDGEMENT, - /** - * Check Transfer Deposit: details will be under the `check_transfer_deposit` - * object. - */ - CHECK_TRANSFER_DEPOSIT, - /** Fee Payment: details will be under the `fee_payment` object. */ - FEE_PAYMENT, - /** - * Inbound ACH Transfer Intention: details will be under the `inbound_ach_transfer` - * object. - */ - INBOUND_ACH_TRANSFER, - /** - * Inbound ACH Transfer Return Intention: details will be under the - * `inbound_ach_transfer_return_intention` object. - */ - INBOUND_ACH_TRANSFER_RETURN_INTENTION, - /** - * Inbound Check Deposit Return Intention: details will be under the - * `inbound_check_deposit_return_intention` object. - */ - INBOUND_CHECK_DEPOSIT_RETURN_INTENTION, - /** - * Inbound Check Adjustment: details will be under the `inbound_check_adjustment` - * object. - */ - INBOUND_CHECK_ADJUSTMENT, - /** - * Inbound FedNow Transfer Confirmation: details will be under the - * `inbound_fednow_transfer_confirmation` object. - */ - INBOUND_FEDNOW_TRANSFER_CONFIRMATION, - /** - * Inbound Real-Time Payments Transfer Confirmation: details will be under the - * `inbound_real_time_payments_transfer_confirmation` object. - */ - INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION, - /** - * Inbound Wire Reversal: details will be under the `inbound_wire_reversal` object. - */ - INBOUND_WIRE_REVERSAL, - /** - * Inbound Wire Transfer Intention: details will be under the - * `inbound_wire_transfer` object. - */ - INBOUND_WIRE_TRANSFER, - /** - * Inbound Wire Transfer Reversal Intention: details will be under the - * `inbound_wire_transfer_reversal` object. - */ - INBOUND_WIRE_TRANSFER_REVERSAL, - /** Interest Payment: details will be under the `interest_payment` object. */ - INTEREST_PAYMENT, - /** Internal Source: details will be under the `internal_source` object. */ - INTERNAL_SOURCE, + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + /** + * Returns the raw JSON value of [periodEnd]. + * + * Unlike [periodEnd], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("period_end") + @ExcludeMissing + fun _periodEnd(): JsonField = periodEnd + + /** + * Returns the raw JSON value of [periodStart]. + * + * Unlike [periodStart], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("period_start") + @ExcludeMissing + fun _periodStart(): JsonField = periodStart + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + /** - * Real-Time Payments Transfer Acknowledgement: details will be under the - * `real_time_payments_transfer_acknowledgement` object. + * Returns a mutable builder for constructing an instance of [CashbackPayment]. + * + * The following fields are required: + * ```java + * .accruedOnCardId() + * .amount() + * .currency() + * .periodEnd() + * .periodStart() + * ``` */ - REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT, - /** Sample Funds: details will be under the `sample_funds` object. */ - SAMPLE_FUNDS, + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CashbackPayment]. */ + class Builder internal constructor() { + + private var accruedOnCardId: JsonField? = null + private var amount: JsonField? = null + private var currency: JsonField? = null + private var periodEnd: JsonField? = null + private var periodStart: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(cashbackPayment: CashbackPayment) = apply { + accruedOnCardId = cashbackPayment.accruedOnCardId + amount = cashbackPayment.amount + currency = cashbackPayment.currency + periodEnd = cashbackPayment.periodEnd + periodStart = cashbackPayment.periodStart + additionalProperties = cashbackPayment.additionalProperties.toMutableMap() + } + + /** The card on which the cashback was accrued. */ + fun accruedOnCardId(accruedOnCardId: String?) = + accruedOnCardId(JsonField.ofNullable(accruedOnCardId)) + /** - * Wire Transfer Intention: details will be under the `wire_transfer_intention` - * object. + * Alias for calling [Builder.accruedOnCardId] with `accruedOnCardId.orElse(null)`. */ - WIRE_TRANSFER_INTENTION, + fun accruedOnCardId(accruedOnCardId: Optional) = + accruedOnCardId(accruedOnCardId.getOrNull()) + /** - * Swift Transfer Intention: details will be under the `swift_transfer_intention` - * object. + * Sets [Builder.accruedOnCardId] to an arbitrary JSON value. + * + * You should usually call [Builder.accruedOnCardId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. */ - SWIFT_TRANSFER_INTENTION, + fun accruedOnCardId(accruedOnCardId: JsonField) = apply { + this.accruedOnCardId = accruedOnCardId + } + /** - * Swift Transfer Return: details will be under the `swift_transfer_return` object. + * The amount in the minor unit of the transaction's currency. For dollars, for + * example, this is cents. */ - SWIFT_TRANSFER_RETURN, + fun amount(amount: Long) = amount(JsonField.of(amount)) + /** - * Card Push Transfer Acceptance: details will be under the - * `card_push_transfer_acceptance` object. + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - CARD_PUSH_TRANSFER_ACCEPTANCE, + fun amount(amount: JsonField) = apply { this.amount = amount } + /** - * Account Revenue Payment: details will be under the `account_revenue_payment` - * object. + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction + * currency. */ - ACCOUNT_REVENUE_PAYMENT, + fun currency(currency: Currency) = currency(JsonField.of(currency)) + /** - * Blockchain On-Ramp Transfer Intention: details will be under the - * `blockchain_onramp_transfer_intention` object. + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [Currency] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. */ - BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION, + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** The end of the period for which this transaction paid cashback. */ + fun periodEnd(periodEnd: OffsetDateTime) = periodEnd(JsonField.of(periodEnd)) + /** - * Blockchain Off-Ramp Transfer Settlement: details will be under the - * `blockchain_offramp_transfer_settlement` object. + * Sets [Builder.periodEnd] to an arbitrary JSON value. + * + * You should usually call [Builder.periodEnd] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. */ - BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT, - /** The Transaction was made for an undocumented or deprecated reason. */ - OTHER, + fun periodEnd(periodEnd: JsonField) = apply { + this.periodEnd = periodEnd + } + + /** The start of the period for which this transaction paid cashback. */ + fun periodStart(periodStart: OffsetDateTime) = + periodStart(JsonField.of(periodStart)) + /** - * An enum member indicating that [Category] was instantiated with an unknown value. + * Sets [Builder.periodStart] to an arbitrary JSON value. + * + * You should usually call [Builder.periodStart] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. */ - _UNKNOWN, - } + fun periodStart(periodStart: JsonField) = apply { + this.periodStart = periodStart + } - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - ACCOUNT_TRANSFER_INTENTION -> Value.ACCOUNT_TRANSFER_INTENTION - ACH_TRANSFER_INTENTION -> Value.ACH_TRANSFER_INTENTION - ACH_TRANSFER_REJECTION -> Value.ACH_TRANSFER_REJECTION - ACH_TRANSFER_RETURN -> Value.ACH_TRANSFER_RETURN - CASHBACK_PAYMENT -> Value.CASHBACK_PAYMENT - CARD_DISPUTE_ACCEPTANCE -> Value.CARD_DISPUTE_ACCEPTANCE - CARD_DISPUTE_FINANCIAL -> Value.CARD_DISPUTE_FINANCIAL - CARD_DISPUTE_LOSS -> Value.CARD_DISPUTE_LOSS - CARD_REFUND -> Value.CARD_REFUND - CARD_SETTLEMENT -> Value.CARD_SETTLEMENT - CARD_FINANCIAL -> Value.CARD_FINANCIAL - CARD_REVENUE_PAYMENT -> Value.CARD_REVENUE_PAYMENT - CHECK_DEPOSIT_ACCEPTANCE -> Value.CHECK_DEPOSIT_ACCEPTANCE - CHECK_DEPOSIT_RETURN -> Value.CHECK_DEPOSIT_RETURN - FEDNOW_TRANSFER_ACKNOWLEDGEMENT -> Value.FEDNOW_TRANSFER_ACKNOWLEDGEMENT - CHECK_TRANSFER_DEPOSIT -> Value.CHECK_TRANSFER_DEPOSIT - FEE_PAYMENT -> Value.FEE_PAYMENT - INBOUND_ACH_TRANSFER -> Value.INBOUND_ACH_TRANSFER - INBOUND_ACH_TRANSFER_RETURN_INTENTION -> - Value.INBOUND_ACH_TRANSFER_RETURN_INTENTION - INBOUND_CHECK_DEPOSIT_RETURN_INTENTION -> - Value.INBOUND_CHECK_DEPOSIT_RETURN_INTENTION - INBOUND_CHECK_ADJUSTMENT -> Value.INBOUND_CHECK_ADJUSTMENT - INBOUND_FEDNOW_TRANSFER_CONFIRMATION -> - Value.INBOUND_FEDNOW_TRANSFER_CONFIRMATION - INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION -> - Value.INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION - INBOUND_WIRE_REVERSAL -> Value.INBOUND_WIRE_REVERSAL - INBOUND_WIRE_TRANSFER -> Value.INBOUND_WIRE_TRANSFER - INBOUND_WIRE_TRANSFER_REVERSAL -> Value.INBOUND_WIRE_TRANSFER_REVERSAL - INTEREST_PAYMENT -> Value.INTEREST_PAYMENT - INTERNAL_SOURCE -> Value.INTERNAL_SOURCE - REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT -> - Value.REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT - SAMPLE_FUNDS -> Value.SAMPLE_FUNDS - WIRE_TRANSFER_INTENTION -> Value.WIRE_TRANSFER_INTENTION - SWIFT_TRANSFER_INTENTION -> Value.SWIFT_TRANSFER_INTENTION - SWIFT_TRANSFER_RETURN -> Value.SWIFT_TRANSFER_RETURN - CARD_PUSH_TRANSFER_ACCEPTANCE -> Value.CARD_PUSH_TRANSFER_ACCEPTANCE - ACCOUNT_REVENUE_PAYMENT -> Value.ACCOUNT_REVENUE_PAYMENT - BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION -> - Value.BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION - BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT -> - Value.BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT - OTHER -> Value.OTHER - else -> Value._UNKNOWN + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - ACCOUNT_TRANSFER_INTENTION -> Known.ACCOUNT_TRANSFER_INTENTION - ACH_TRANSFER_INTENTION -> Known.ACH_TRANSFER_INTENTION - ACH_TRANSFER_REJECTION -> Known.ACH_TRANSFER_REJECTION - ACH_TRANSFER_RETURN -> Known.ACH_TRANSFER_RETURN - CASHBACK_PAYMENT -> Known.CASHBACK_PAYMENT - CARD_DISPUTE_ACCEPTANCE -> Known.CARD_DISPUTE_ACCEPTANCE - CARD_DISPUTE_FINANCIAL -> Known.CARD_DISPUTE_FINANCIAL - CARD_DISPUTE_LOSS -> Known.CARD_DISPUTE_LOSS - CARD_REFUND -> Known.CARD_REFUND - CARD_SETTLEMENT -> Known.CARD_SETTLEMENT - CARD_FINANCIAL -> Known.CARD_FINANCIAL - CARD_REVENUE_PAYMENT -> Known.CARD_REVENUE_PAYMENT - CHECK_DEPOSIT_ACCEPTANCE -> Known.CHECK_DEPOSIT_ACCEPTANCE - CHECK_DEPOSIT_RETURN -> Known.CHECK_DEPOSIT_RETURN - FEDNOW_TRANSFER_ACKNOWLEDGEMENT -> Known.FEDNOW_TRANSFER_ACKNOWLEDGEMENT - CHECK_TRANSFER_DEPOSIT -> Known.CHECK_TRANSFER_DEPOSIT - FEE_PAYMENT -> Known.FEE_PAYMENT - INBOUND_ACH_TRANSFER -> Known.INBOUND_ACH_TRANSFER - INBOUND_ACH_TRANSFER_RETURN_INTENTION -> - Known.INBOUND_ACH_TRANSFER_RETURN_INTENTION - INBOUND_CHECK_DEPOSIT_RETURN_INTENTION -> - Known.INBOUND_CHECK_DEPOSIT_RETURN_INTENTION - INBOUND_CHECK_ADJUSTMENT -> Known.INBOUND_CHECK_ADJUSTMENT - INBOUND_FEDNOW_TRANSFER_CONFIRMATION -> - Known.INBOUND_FEDNOW_TRANSFER_CONFIRMATION - INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION -> - Known.INBOUND_REAL_TIME_PAYMENTS_TRANSFER_CONFIRMATION - INBOUND_WIRE_REVERSAL -> Known.INBOUND_WIRE_REVERSAL - INBOUND_WIRE_TRANSFER -> Known.INBOUND_WIRE_TRANSFER - INBOUND_WIRE_TRANSFER_REVERSAL -> Known.INBOUND_WIRE_TRANSFER_REVERSAL - INTEREST_PAYMENT -> Known.INTEREST_PAYMENT - INTERNAL_SOURCE -> Known.INTERNAL_SOURCE - REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT -> - Known.REAL_TIME_PAYMENTS_TRANSFER_ACKNOWLEDGEMENT - SAMPLE_FUNDS -> Known.SAMPLE_FUNDS - WIRE_TRANSFER_INTENTION -> Known.WIRE_TRANSFER_INTENTION - SWIFT_TRANSFER_INTENTION -> Known.SWIFT_TRANSFER_INTENTION - SWIFT_TRANSFER_RETURN -> Known.SWIFT_TRANSFER_RETURN - CARD_PUSH_TRANSFER_ACCEPTANCE -> Known.CARD_PUSH_TRANSFER_ACCEPTANCE - ACCOUNT_REVENUE_PAYMENT -> Known.ACCOUNT_REVENUE_PAYMENT - BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION -> - Known.BLOCKCHAIN_ONRAMP_TRANSFER_INTENTION - BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT -> - Known.BLOCKCHAIN_OFFRAMP_TRANSFER_SETTLEMENT - OTHER -> Known.OTHER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) } - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) } + /** + * Returns an immutable instance of [CashbackPayment]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accruedOnCardId() + * .amount() + * .currency() + * .periodEnd() + * .periodStart() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CashbackPayment = + CashbackPayment( + checkRequired("accruedOnCardId", accruedOnCardId), + checkRequired("amount", amount), + checkRequired("currency", currency), + checkRequired("periodEnd", periodEnd), + checkRequired("periodStart", periodStart), + additionalProperties.toMutableMap(), + ) + } + private var validated: Boolean = false - fun validate(): Category = apply { + fun validate(): CashbackPayment = apply { if (validated) { return@apply } - known() + accruedOnCardId() + amount() + currency().validate() + periodEnd() + periodStart() validated = true } @@ -38650,19 +38400,175 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic + internal fun validity(): Int = + (if (accruedOnCardId.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (if (periodEnd.asKnown().isPresent) 1 else 0) + + (if (periodStart.asKnown().isPresent) 1 else 0) + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction + * currency. + */ + class Currency @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** US Dollar (USD) */ + USD + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** US Dollar (USD) */ + USD, + /** + * An enum member indicating that [Currency] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + USD -> Value.USD + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Currency = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Category && value == other.value + return other is CashbackPayment && + accruedOnCardId == other.accruedOnCardId && + amount == other.amount && + currency == other.currency && + periodEnd == other.periodEnd && + periodStart == other.periodStart && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { + Objects.hash( + accruedOnCardId, + amount, + currency, + periodEnd, + periodStart, + additionalProperties, + ) + } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "CashbackPayment{accruedOnCardId=$accruedOnCardId, amount=$amount, currency=$currency, periodEnd=$periodEnd, periodStart=$periodStart, additionalProperties=$additionalProperties}" } /** @@ -49578,6 +49484,7 @@ private constructor( } return other is Source && + category == other.category && accountRevenuePayment == other.accountRevenuePayment && accountTransferIntention == other.accountTransferIntention && achTransferIntention == other.achTransferIntention && @@ -49594,7 +49501,6 @@ private constructor( cardRevenuePayment == other.cardRevenuePayment && cardSettlement == other.cardSettlement && cashbackPayment == other.cashbackPayment && - category == other.category && checkDepositAcceptance == other.checkDepositAcceptance && checkDepositReturn == other.checkDepositReturn && checkTransferDeposit == other.checkTransferDeposit && @@ -49624,6 +49530,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + category, accountRevenuePayment, accountTransferIntention, achTransferIntention, @@ -49640,7 +49547,6 @@ private constructor( cardRevenuePayment, cardSettlement, cashbackPayment, - category, checkDepositAcceptance, checkDepositReturn, checkTransferDeposit, @@ -49670,7 +49576,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Source{accountRevenuePayment=$accountRevenuePayment, accountTransferIntention=$accountTransferIntention, achTransferIntention=$achTransferIntention, achTransferRejection=$achTransferRejection, achTransferReturn=$achTransferReturn, blockchainOfframpTransferSettlement=$blockchainOfframpTransferSettlement, blockchainOnrampTransferIntention=$blockchainOnrampTransferIntention, cardDisputeAcceptance=$cardDisputeAcceptance, cardDisputeFinancial=$cardDisputeFinancial, cardDisputeLoss=$cardDisputeLoss, cardFinancial=$cardFinancial, cardPushTransferAcceptance=$cardPushTransferAcceptance, cardRefund=$cardRefund, cardRevenuePayment=$cardRevenuePayment, cardSettlement=$cardSettlement, cashbackPayment=$cashbackPayment, category=$category, checkDepositAcceptance=$checkDepositAcceptance, checkDepositReturn=$checkDepositReturn, checkTransferDeposit=$checkTransferDeposit, fednowTransferAcknowledgement=$fednowTransferAcknowledgement, feePayment=$feePayment, inboundAchTransfer=$inboundAchTransfer, inboundAchTransferReturnIntention=$inboundAchTransferReturnIntention, inboundCheckAdjustment=$inboundCheckAdjustment, inboundCheckDepositReturnIntention=$inboundCheckDepositReturnIntention, inboundFednowTransferConfirmation=$inboundFednowTransferConfirmation, inboundRealTimePaymentsTransferConfirmation=$inboundRealTimePaymentsTransferConfirmation, inboundWireReversal=$inboundWireReversal, inboundWireTransfer=$inboundWireTransfer, inboundWireTransferReversal=$inboundWireTransferReversal, interestPayment=$interestPayment, internalSource=$internalSource, other=$other, realTimePaymentsTransferAcknowledgement=$realTimePaymentsTransferAcknowledgement, sampleFunds=$sampleFunds, swiftTransferIntention=$swiftTransferIntention, swiftTransferReturn=$swiftTransferReturn, wireTransferIntention=$wireTransferIntention, additionalProperties=$additionalProperties}" + "Source{category=$category, accountRevenuePayment=$accountRevenuePayment, accountTransferIntention=$accountTransferIntention, achTransferIntention=$achTransferIntention, achTransferRejection=$achTransferRejection, achTransferReturn=$achTransferReturn, blockchainOfframpTransferSettlement=$blockchainOfframpTransferSettlement, blockchainOnrampTransferIntention=$blockchainOnrampTransferIntention, cardDisputeAcceptance=$cardDisputeAcceptance, cardDisputeFinancial=$cardDisputeFinancial, cardDisputeLoss=$cardDisputeLoss, cardFinancial=$cardFinancial, cardPushTransferAcceptance=$cardPushTransferAcceptance, cardRefund=$cardRefund, cardRevenuePayment=$cardRevenuePayment, cardSettlement=$cardSettlement, cashbackPayment=$cashbackPayment, checkDepositAcceptance=$checkDepositAcceptance, checkDepositReturn=$checkDepositReturn, checkTransferDeposit=$checkTransferDeposit, fednowTransferAcknowledgement=$fednowTransferAcknowledgement, feePayment=$feePayment, inboundAchTransfer=$inboundAchTransfer, inboundAchTransferReturnIntention=$inboundAchTransferReturnIntention, inboundCheckAdjustment=$inboundCheckAdjustment, inboundCheckDepositReturnIntention=$inboundCheckDepositReturnIntention, inboundFednowTransferConfirmation=$inboundFednowTransferConfirmation, inboundRealTimePaymentsTransferConfirmation=$inboundRealTimePaymentsTransferConfirmation, inboundWireReversal=$inboundWireReversal, inboundWireTransfer=$inboundWireTransfer, inboundWireTransferReversal=$inboundWireTransferReversal, interestPayment=$interestPayment, internalSource=$internalSource, other=$other, realTimePaymentsTransferAcknowledgement=$realTimePaymentsTransferAcknowledgement, sampleFunds=$sampleFunds, swiftTransferIntention=$swiftTransferIntention, swiftTransferReturn=$swiftTransferReturn, wireTransferIntention=$wireTransferIntention, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt index 0bbf33214..cb68787a5 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt @@ -1642,8 +1642,8 @@ private constructor( class CreatedBy @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val apiKey: JsonField, private val category: JsonField, + private val apiKey: JsonField, private val oauthApplication: JsonField, private val user: JsonField, private val additionalProperties: MutableMap, @@ -1651,23 +1651,15 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), @JsonProperty("oauth_application") @ExcludeMissing oauthApplication: JsonField = JsonMissing.of(), @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), - ) : this(apiKey, category, oauthApplication, user, mutableMapOf()) - - /** - * If present, details about the API key that created the transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun apiKey(): Optional = apiKey.getOptional("api_key") + ) : this(category, apiKey, oauthApplication, user, mutableMapOf()) /** * The type of object that created this transfer. @@ -1677,6 +1669,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * If present, details about the API key that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun apiKey(): Optional = apiKey.getOptional("api_key") + /** * If present, details about the OAuth Application that created the transfer. * @@ -1695,18 +1695,18 @@ private constructor( fun user(): Optional = user.getOptional("user") /** - * Returns the raw JSON value of [apiKey]. + * Returns the raw JSON value of [category]. * - * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category /** - * Returns the raw JSON value of [category]. + * Returns the raw JSON value of [apiKey]. * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey /** * Returns the raw JSON value of [oauthApplication]. @@ -1744,10 +1744,7 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` */ @JvmStatic fun builder() = Builder() @@ -1756,21 +1753,33 @@ private constructor( /** A builder for [CreatedBy]. */ class Builder internal constructor() { - private var apiKey: JsonField? = null private var category: JsonField? = null - private var oauthApplication: JsonField? = null - private var user: JsonField? = null + private var apiKey: JsonField = JsonMissing.of() + private var oauthApplication: JsonField = JsonMissing.of() + private var user: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(createdBy: CreatedBy) = apply { - apiKey = createdBy.apiKey category = createdBy.category + apiKey = createdBy.apiKey oauthApplication = createdBy.oauthApplication user = createdBy.user additionalProperties = createdBy.additionalProperties.toMutableMap() } + /** The type of object that created this transfer. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + /** If present, details about the API key that created the transfer. */ fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey)) @@ -1786,18 +1795,6 @@ private constructor( */ fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } - /** The type of object that created this transfer. */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** If present, details about the OAuth Application that created the transfer. */ fun oauthApplication(oauthApplication: OAuthApplication?) = oauthApplication(JsonField.ofNullable(oauthApplication)) @@ -1860,20 +1857,17 @@ private constructor( * * The following fields are required: * ```java - * .apiKey() * .category() - * .oauthApplication() - * .user() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): CreatedBy = CreatedBy( - checkRequired("apiKey", apiKey), checkRequired("category", category), - checkRequired("oauthApplication", oauthApplication), - checkRequired("user", user), + apiKey, + oauthApplication, + user, additionalProperties.toMutableMap(), ) } @@ -1885,8 +1879,8 @@ private constructor( return@apply } - apiKey().ifPresent { it.validate() } category().validate() + apiKey().ifPresent { it.validate() } oauthApplication().ifPresent { it.validate() } user().ifPresent { it.validate() } validated = true @@ -1908,11 +1902,166 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (apiKey.asKnown().getOrNull()?.validity() ?: 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + (user.asKnown().getOrNull()?.validity() ?: 0) + /** The type of object that created this transfer. */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** If present, details about the API key that created the transfer. */ class ApiKey @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2089,161 +2238,6 @@ private constructor( "ApiKey{description=$description, additionalProperties=$additionalProperties}" } - /** The type of object that created this transfer. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** An API key. Details will be under the `api_key` object. */ - @JvmField val API_KEY = of("api_key") - - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - @JvmField val OAUTH_APPLICATION = of("oauth_application") - - /** A User in the Increase dashboard. Details will be under the `user` object. */ - @JvmField val USER = of("user") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - } - - /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** An API key. Details will be under the `api_key` object. */ - API_KEY, - /** - * An OAuth application you connected to Increase. Details will be under the - * `oauth_application` object. - */ - OAUTH_APPLICATION, - /** A User in the Increase dashboard. Details will be under the `user` object. */ - USER, - /** - * An enum member indicating that [Category] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - API_KEY -> Value.API_KEY - OAUTH_APPLICATION -> Value.OAUTH_APPLICATION - USER -> Value.USER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - API_KEY -> Known.API_KEY - OAUTH_APPLICATION -> Known.OAUTH_APPLICATION - USER -> Known.USER - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** If present, details about the OAuth Application that created the transfer. */ class OAuthApplication @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -2575,21 +2569,21 @@ private constructor( } return other is CreatedBy && - apiKey == other.apiKey && category == other.category && + apiKey == other.apiKey && oauthApplication == other.oauthApplication && user == other.user && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + Objects.hash(category, apiKey, oauthApplication, user, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + "CreatedBy{category=$category, apiKey=$apiKey, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } /** The person or business that is receiving the funds from the transfer. */ @@ -4212,8 +4206,6 @@ private constructor( * The following fields are required: * ```java * .category() - * .tax() - * .unstructured() * ``` */ @JvmStatic fun builder() = Builder() @@ -4223,8 +4215,8 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null - private var tax: JsonField? = null - private var unstructured: JsonField? = null + private var tax: JsonField = JsonMissing.of() + private var unstructured: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -4314,8 +4306,6 @@ private constructor( * The following fields are required: * ```java * .category() - * .tax() - * .unstructured() * ``` * * @throws IllegalStateException if any required field is unset. @@ -4323,8 +4313,8 @@ private constructor( fun build(): Remittance = Remittance( checkRequired("category", category), - checkRequired("tax", tax), - checkRequired("unstructured", unstructured), + tax, + unstructured, additionalProperties.toMutableMap(), ) } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageResponseTest.kt index 31b8858cf..919f70658 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageResponseTest.kt @@ -34,12 +34,12 @@ internal class AccountTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( AccountTransfer.CreatedBy.builder() + .category(AccountTransfer.CreatedBy.Category.USER) .apiKey( AccountTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AccountTransfer.CreatedBy.Category.USER) .oauthApplication( AccountTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -87,12 +87,12 @@ internal class AccountTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( AccountTransfer.CreatedBy.builder() + .category(AccountTransfer.CreatedBy.Category.USER) .apiKey( AccountTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AccountTransfer.CreatedBy.Category.USER) .oauthApplication( AccountTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -144,12 +144,12 @@ internal class AccountTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( AccountTransfer.CreatedBy.builder() + .category(AccountTransfer.CreatedBy.Category.USER) .apiKey( AccountTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AccountTransfer.CreatedBy.Category.USER) .oauthApplication( AccountTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferTest.kt index 2d838855b..c9e375f7a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferTest.kt @@ -32,12 +32,12 @@ internal class AccountTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( AccountTransfer.CreatedBy.builder() + .category(AccountTransfer.CreatedBy.Category.USER) .apiKey( AccountTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AccountTransfer.CreatedBy.Category.USER) .oauthApplication( AccountTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -83,12 +83,12 @@ internal class AccountTransferTest { assertThat(accountTransfer.createdBy()) .contains( AccountTransfer.CreatedBy.builder() + .category(AccountTransfer.CreatedBy.Category.USER) .apiKey( AccountTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AccountTransfer.CreatedBy.Category.USER) .oauthApplication( AccountTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -132,12 +132,12 @@ internal class AccountTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( AccountTransfer.CreatedBy.builder() + .category(AccountTransfer.CreatedBy.Category.USER) .apiKey( AccountTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AccountTransfer.CreatedBy.Category.USER) .oauthApplication( AccountTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt index e755df7b5..6dff39ee7 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt @@ -71,12 +71,12 @@ internal class AchTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( AchTransfer.CreatedBy.builder() + .category(AchTransfer.CreatedBy.Category.USER) .apiKey( AchTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AchTransfer.CreatedBy.Category.USER) .oauthApplication( AchTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -234,12 +234,12 @@ internal class AchTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( AchTransfer.CreatedBy.builder() + .category(AchTransfer.CreatedBy.Category.USER) .apiKey( AchTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AchTransfer.CreatedBy.Category.USER) .oauthApplication( AchTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -395,12 +395,12 @@ internal class AchTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( AchTransfer.CreatedBy.builder() + .category(AchTransfer.CreatedBy.Category.USER) .apiKey( AchTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AchTransfer.CreatedBy.Category.USER) .oauthApplication( AchTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt index ab1d04600..1c4d52ad7 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt @@ -69,12 +69,12 @@ internal class AchTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( AchTransfer.CreatedBy.builder() + .category(AchTransfer.CreatedBy.Category.USER) .apiKey( AchTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AchTransfer.CreatedBy.Category.USER) .oauthApplication( AchTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -217,10 +217,10 @@ internal class AchTransferTest { assertThat(achTransfer.createdBy()) .contains( AchTransfer.CreatedBy.builder() + .category(AchTransfer.CreatedBy.Category.USER) .apiKey( AchTransfer.CreatedBy.ApiKey.builder().description("description").build() ) - .category(AchTransfer.CreatedBy.Category.USER) .oauthApplication( AchTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -369,12 +369,12 @@ internal class AchTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( AchTransfer.CreatedBy.builder() + .category(AchTransfer.CreatedBy.Category.USER) .apiKey( AchTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(AchTransfer.CreatedBy.Category.USER) .oauthApplication( AchTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt index 72d6d8377..9d9a6b5d9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt @@ -46,6 +46,10 @@ internal class CardDisputeListPageResponseTest { CardDispute.Visa.NetworkEvent.Category .CHARGEBACK_ACCEPTED ) + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .disputeFinancialTransactionId( + "dispute_financial_transaction_id" + ) .chargebackAccepted( CardDispute.Visa.NetworkEvent.ChargebackAccepted .builder() @@ -61,10 +65,6 @@ internal class CardDisputeListPageResponseTest { .builder() .build() ) - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .disputeFinancialTransactionId( - "dispute_financial_transaction_id" - ) .merchantPrearbitrationDeclineSubmitted( CardDispute.Visa.NetworkEvent .MerchantPrearbitrationDeclineSubmitted @@ -312,6 +312,14 @@ internal class CardDisputeListPageResponseTest { .category( CardDispute.Visa.UserSubmission.Category.CHARGEBACK ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .explanation(null) + .furtherInformationRequestedAt(null) + .furtherInformationRequestedReason(null) + .status( + CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING + ) + .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .chargeback( CardDispute.Visa.UserSubmission.Chargeback.builder() .authorization( @@ -1343,10 +1351,6 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .explanation(null) - .furtherInformationRequestedAt(null) - .furtherInformationRequestedReason(null) .merchantPrearbitrationDecline( CardDispute.Visa.UserSubmission .MerchantPrearbitrationDecline @@ -1356,10 +1360,6 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .status( - CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING - ) - .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .userPrearbitration( CardDispute.Visa.UserSubmission.UserPrearbitration .builder() @@ -1437,6 +1437,10 @@ internal class CardDisputeListPageResponseTest { .category( CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED ) + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .disputeFinancialTransactionId( + "dispute_financial_transaction_id" + ) .chargebackAccepted( CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder() .build() @@ -1449,10 +1453,6 @@ internal class CardDisputeListPageResponseTest { CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder() .build() ) - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .disputeFinancialTransactionId( - "dispute_financial_transaction_id" - ) .merchantPrearbitrationDeclineSubmitted( CardDispute.Visa.NetworkEvent .MerchantPrearbitrationDeclineSubmitted @@ -1694,6 +1694,14 @@ internal class CardDisputeListPageResponseTest { .build() ) .category(CardDispute.Visa.UserSubmission.Category.CHARGEBACK) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .explanation(null) + .furtherInformationRequestedAt(null) + .furtherInformationRequestedReason(null) + .status( + CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING + ) + .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .chargeback( CardDispute.Visa.UserSubmission.Chargeback.builder() .authorization( @@ -2644,10 +2652,6 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .explanation(null) - .furtherInformationRequestedAt(null) - .furtherInformationRequestedReason(null) .merchantPrearbitrationDecline( CardDispute.Visa.UserSubmission .MerchantPrearbitrationDecline @@ -2657,10 +2661,6 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .status( - CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING - ) - .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .userPrearbitration( CardDispute.Visa.UserSubmission.UserPrearbitration.builder() .categoryChange( @@ -2739,6 +2739,10 @@ internal class CardDisputeListPageResponseTest { CardDispute.Visa.NetworkEvent.Category .CHARGEBACK_ACCEPTED ) + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .disputeFinancialTransactionId( + "dispute_financial_transaction_id" + ) .chargebackAccepted( CardDispute.Visa.NetworkEvent.ChargebackAccepted .builder() @@ -2754,10 +2758,6 @@ internal class CardDisputeListPageResponseTest { .builder() .build() ) - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .disputeFinancialTransactionId( - "dispute_financial_transaction_id" - ) .merchantPrearbitrationDeclineSubmitted( CardDispute.Visa.NetworkEvent .MerchantPrearbitrationDeclineSubmitted @@ -3005,6 +3005,14 @@ internal class CardDisputeListPageResponseTest { .category( CardDispute.Visa.UserSubmission.Category.CHARGEBACK ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .explanation(null) + .furtherInformationRequestedAt(null) + .furtherInformationRequestedReason(null) + .status( + CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING + ) + .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .chargeback( CardDispute.Visa.UserSubmission.Chargeback.builder() .authorization( @@ -4036,10 +4044,6 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .explanation(null) - .furtherInformationRequestedAt(null) - .furtherInformationRequestedReason(null) .merchantPrearbitrationDecline( CardDispute.Visa.UserSubmission .MerchantPrearbitrationDecline @@ -4049,10 +4053,6 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .status( - CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING - ) - .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .userPrearbitration( CardDispute.Visa.UserSubmission.UserPrearbitration .builder() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt index b00714438..9fa0bef3e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt @@ -43,6 +43,8 @@ internal class CardDisputeTest { .category( CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED ) + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .disputeFinancialTransactionId("dispute_financial_transaction_id") .chargebackAccepted( CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder() .build() @@ -55,8 +57,6 @@ internal class CardDisputeTest { CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder() .build() ) - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .disputeFinancialTransactionId("dispute_financial_transaction_id") .merchantPrearbitrationDeclineSubmitted( CardDispute.Visa.NetworkEvent .MerchantPrearbitrationDeclineSubmitted @@ -294,6 +294,12 @@ internal class CardDisputeTest { .build() ) .category(CardDispute.Visa.UserSubmission.Category.CHARGEBACK) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .explanation(null) + .furtherInformationRequestedAt(null) + .furtherInformationRequestedReason(null) + .status(CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING) + .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .chargeback( CardDispute.Visa.UserSubmission.Chargeback.builder() .authorization( @@ -1170,10 +1176,6 @@ internal class CardDisputeTest { ) .build() ) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .explanation(null) - .furtherInformationRequestedAt(null) - .furtherInformationRequestedReason(null) .merchantPrearbitrationDecline( CardDispute.Visa.UserSubmission.MerchantPrearbitrationDecline .builder() @@ -1182,8 +1184,6 @@ internal class CardDisputeTest { ) .build() ) - .status(CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING) - .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .userPrearbitration( CardDispute.Visa.UserSubmission.UserPrearbitration.builder() .categoryChange( @@ -1249,6 +1249,8 @@ internal class CardDisputeTest { .build() ) .category(CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED) + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .disputeFinancialTransactionId("dispute_financial_transaction_id") .chargebackAccepted( CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder().build() ) @@ -1258,8 +1260,6 @@ internal class CardDisputeTest { .chargebackTimedOut( CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder().build() ) - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .disputeFinancialTransactionId("dispute_financial_transaction_id") .merchantPrearbitrationDeclineSubmitted( CardDispute.Visa.NetworkEvent.MerchantPrearbitrationDeclineSubmitted .builder() @@ -1483,6 +1483,12 @@ internal class CardDisputeTest { .build() ) .category(CardDispute.Visa.UserSubmission.Category.CHARGEBACK) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .explanation(null) + .furtherInformationRequestedAt(null) + .furtherInformationRequestedReason(null) + .status(CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING) + .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .chargeback( CardDispute.Visa.UserSubmission.Chargeback.builder() .authorization( @@ -2328,10 +2334,6 @@ internal class CardDisputeTest { ) .build() ) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .explanation(null) - .furtherInformationRequestedAt(null) - .furtherInformationRequestedReason(null) .merchantPrearbitrationDecline( CardDispute.Visa.UserSubmission.MerchantPrearbitrationDecline .builder() @@ -2340,8 +2342,6 @@ internal class CardDisputeTest { ) .build() ) - .status(CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING) - .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .userPrearbitration( CardDispute.Visa.UserSubmission.UserPrearbitration.builder() .categoryChange( @@ -2413,6 +2413,8 @@ internal class CardDisputeTest { .category( CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED ) + .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .disputeFinancialTransactionId("dispute_financial_transaction_id") .chargebackAccepted( CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder() .build() @@ -2425,8 +2427,6 @@ internal class CardDisputeTest { CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder() .build() ) - .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .disputeFinancialTransactionId("dispute_financial_transaction_id") .merchantPrearbitrationDeclineSubmitted( CardDispute.Visa.NetworkEvent .MerchantPrearbitrationDeclineSubmitted @@ -2664,6 +2664,12 @@ internal class CardDisputeTest { .build() ) .category(CardDispute.Visa.UserSubmission.Category.CHARGEBACK) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .explanation(null) + .furtherInformationRequestedAt(null) + .furtherInformationRequestedReason(null) + .status(CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING) + .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .chargeback( CardDispute.Visa.UserSubmission.Chargeback.builder() .authorization( @@ -3540,10 +3546,6 @@ internal class CardDisputeTest { ) .build() ) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .explanation(null) - .furtherInformationRequestedAt(null) - .furtherInformationRequestedReason(null) .merchantPrearbitrationDecline( CardDispute.Visa.UserSubmission.MerchantPrearbitrationDecline .builder() @@ -3552,8 +3554,6 @@ internal class CardDisputeTest { ) .build() ) - .status(CardDispute.Visa.UserSubmission.Status.PENDING_REVIEWING) - .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .userPrearbitration( CardDispute.Visa.UserSubmission.UserPrearbitration.builder() .categoryChange( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt index c88fcfca4..f21fb177f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt @@ -25,6 +25,8 @@ internal class CardPaymentListPageResponseTest { .elements( listOf( CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_AUTHORIZATION) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -2047,11 +2049,11 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_AUTHORIZATION) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_REVERSAL) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -4074,11 +4076,11 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_REVERSAL) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_INCREMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -6101,11 +6103,11 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_INCREMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_SETTLEMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -8128,8 +8130,6 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_SETTLEMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), ) @@ -8163,6 +8163,8 @@ internal class CardPaymentListPageResponseTest { .elements( listOf( CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_AUTHORIZATION) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -10070,11 +10072,11 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_AUTHORIZATION) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_REVERSAL) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -11982,11 +11984,11 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_REVERSAL) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_INCREMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -13894,11 +13896,11 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_INCREMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_SETTLEMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -15806,8 +15808,6 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_SETTLEMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), ) @@ -15845,6 +15845,8 @@ internal class CardPaymentListPageResponseTest { .elements( listOf( CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_AUTHORIZATION) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -17867,11 +17869,11 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_AUTHORIZATION) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_REVERSAL) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -19894,11 +19896,11 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_REVERSAL) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_INCREMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -21921,11 +21923,11 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_INCREMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_SETTLEMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -23948,8 +23950,6 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_SETTLEMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt index b20d1f771..abd0995d1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt @@ -23,6 +23,8 @@ internal class CardPaymentTest { .elements( listOf( CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_AUTHORIZATION) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -1809,11 +1811,11 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_AUTHORIZATION) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_REVERSAL) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -3600,11 +3602,11 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_REVERSAL) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_INCREMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -5391,11 +5393,11 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_INCREMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_SETTLEMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -7182,8 +7184,6 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_SETTLEMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), ) @@ -7211,6 +7211,8 @@ internal class CardPaymentTest { assertThat(cardPayment.elements()) .containsExactly( CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_AUTHORIZATION) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -8815,11 +8817,11 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_AUTHORIZATION) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_REVERSAL) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -10424,11 +10426,11 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_REVERSAL) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_INCREMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -12033,11 +12035,11 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_INCREMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_SETTLEMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -13642,8 +13644,6 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_SETTLEMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), ) @@ -13676,6 +13676,8 @@ internal class CardPaymentTest { .elements( listOf( CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_AUTHORIZATION) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -15462,11 +15464,11 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_AUTHORIZATION) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_REVERSAL) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -17253,11 +17255,11 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_REVERSAL) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_INCREMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -19044,11 +19046,11 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_INCREMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() + .category(CardPayment.Element.Category.CARD_SETTLEMENT) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .cardAuthentication( CardPayment.Element.CardAuthentication.builder() .id("card_authentication_xft30xjdubptlgrxboch") @@ -20835,8 +20837,6 @@ internal class CardPaymentTest { ) .build() ) - .category(CardPayment.Element.Category.CARD_SETTLEMENT) - .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .other(CardPayment.Element.Other.builder().build()) .build(), ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageResponseTest.kt index 2c9928d63..aefad2b85 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageResponseTest.kt @@ -45,12 +45,12 @@ internal class CardPushTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CardPushTransfer.CreatedBy.builder() + .category(CardPushTransfer.CreatedBy.Category.USER) .apiKey( CardPushTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardPushTransfer.CreatedBy.Category.USER) .oauthApplication( CardPushTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -140,12 +140,12 @@ internal class CardPushTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CardPushTransfer.CreatedBy.builder() + .category(CardPushTransfer.CreatedBy.Category.USER) .apiKey( CardPushTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardPushTransfer.CreatedBy.Category.USER) .oauthApplication( CardPushTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -239,12 +239,12 @@ internal class CardPushTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CardPushTransfer.CreatedBy.builder() + .category(CardPushTransfer.CreatedBy.Category.USER) .apiKey( CardPushTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardPushTransfer.CreatedBy.Category.USER) .oauthApplication( CardPushTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferTest.kt index 73d8cfb81..a84e0bc4c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferTest.kt @@ -43,12 +43,12 @@ internal class CardPushTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CardPushTransfer.CreatedBy.builder() + .category(CardPushTransfer.CreatedBy.Category.USER) .apiKey( CardPushTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardPushTransfer.CreatedBy.Category.USER) .oauthApplication( CardPushTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -136,12 +136,12 @@ internal class CardPushTransferTest { assertThat(cardPushTransfer.createdBy()) .contains( CardPushTransfer.CreatedBy.builder() + .category(CardPushTransfer.CreatedBy.Category.USER) .apiKey( CardPushTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardPushTransfer.CreatedBy.Category.USER) .oauthApplication( CardPushTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -227,12 +227,12 @@ internal class CardPushTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CardPushTransfer.CreatedBy.builder() + .category(CardPushTransfer.CreatedBy.Category.USER) .apiKey( CardPushTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardPushTransfer.CreatedBy.Category.USER) .oauthApplication( CardPushTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageResponseTest.kt index 7c2f9b5e9..ce725745a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageResponseTest.kt @@ -41,12 +41,12 @@ internal class CardValidationListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CardValidation.CreatedBy.builder() + .category(CardValidation.CreatedBy.Category.USER) .apiKey( CardValidation.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardValidation.CreatedBy.Category.USER) .oauthApplication( CardValidation.CreatedBy.OAuthApplication.builder() .name("name") @@ -117,12 +117,12 @@ internal class CardValidationListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CardValidation.CreatedBy.builder() + .category(CardValidation.CreatedBy.Category.USER) .apiKey( CardValidation.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardValidation.CreatedBy.Category.USER) .oauthApplication( CardValidation.CreatedBy.OAuthApplication.builder() .name("name") @@ -197,12 +197,12 @@ internal class CardValidationListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CardValidation.CreatedBy.builder() + .category(CardValidation.CreatedBy.Category.USER) .apiKey( CardValidation.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardValidation.CreatedBy.Category.USER) .oauthApplication( CardValidation.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationTest.kt index ea4e92986..e7f6ca293 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationTest.kt @@ -39,12 +39,12 @@ internal class CardValidationTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CardValidation.CreatedBy.builder() + .category(CardValidation.CreatedBy.Category.USER) .apiKey( CardValidation.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardValidation.CreatedBy.Category.USER) .oauthApplication( CardValidation.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -110,10 +110,10 @@ internal class CardValidationTest { assertThat(cardValidation.createdBy()) .contains( CardValidation.CreatedBy.builder() + .category(CardValidation.CreatedBy.Category.USER) .apiKey( CardValidation.CreatedBy.ApiKey.builder().description("description").build() ) - .category(CardValidation.CreatedBy.Category.USER) .oauthApplication( CardValidation.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -176,12 +176,12 @@ internal class CardValidationTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CardValidation.CreatedBy.builder() + .category(CardValidation.CreatedBy.Category.USER) .apiKey( CardValidation.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CardValidation.CreatedBy.Category.USER) .oauthApplication( CardValidation.CreatedBy.OAuthApplication.builder().name("name").build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageResponseTest.kt index 6da499af4..18d73cda8 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageResponseTest.kt @@ -38,12 +38,12 @@ internal class CheckTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CheckTransfer.CreatedBy.builder() + .category(CheckTransfer.CreatedBy.Category.USER) .apiKey( CheckTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CheckTransfer.CreatedBy.Category.USER) .oauthApplication( CheckTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -191,12 +191,12 @@ internal class CheckTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CheckTransfer.CreatedBy.builder() + .category(CheckTransfer.CreatedBy.Category.USER) .apiKey( CheckTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CheckTransfer.CreatedBy.Category.USER) .oauthApplication( CheckTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -344,12 +344,12 @@ internal class CheckTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CheckTransfer.CreatedBy.builder() + .category(CheckTransfer.CreatedBy.Category.USER) .apiKey( CheckTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CheckTransfer.CreatedBy.Category.USER) .oauthApplication( CheckTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferTest.kt index 7f075f6e8..9a7c259f1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferTest.kt @@ -36,12 +36,12 @@ internal class CheckTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CheckTransfer.CreatedBy.builder() + .category(CheckTransfer.CreatedBy.Category.USER) .apiKey( CheckTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CheckTransfer.CreatedBy.Category.USER) .oauthApplication( CheckTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -179,10 +179,10 @@ internal class CheckTransferTest { assertThat(checkTransfer.createdBy()) .contains( CheckTransfer.CreatedBy.builder() + .category(CheckTransfer.CreatedBy.Category.USER) .apiKey( CheckTransfer.CreatedBy.ApiKey.builder().description("description").build() ) - .category(CheckTransfer.CreatedBy.Category.USER) .oauthApplication( CheckTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -321,12 +321,12 @@ internal class CheckTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( CheckTransfer.CreatedBy.builder() + .category(CheckTransfer.CreatedBy.Category.USER) .apiKey( CheckTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(CheckTransfer.CreatedBy.Category.USER) .oauthApplication( CheckTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt index c084b666b..719e6e9bc 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt @@ -26,6 +26,7 @@ internal class DeclinedTransactionListPageResponseTest { .routeType(DeclinedTransaction.RouteType.ACCOUNT_NUMBER) .source( DeclinedTransaction.Source.builder() + .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .achDecline( DeclinedTransaction.Source.AchDecline.builder() .id("ach_decline_72v1mcwxudctq56efipa") @@ -286,7 +287,6 @@ internal class DeclinedTransactionListPageResponseTest { ) .build() ) - .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .checkDecline( DeclinedTransaction.Source.CheckDecline.builder() .amount(-1000L) @@ -396,6 +396,7 @@ internal class DeclinedTransactionListPageResponseTest { .routeType(DeclinedTransaction.RouteType.ACCOUNT_NUMBER) .source( DeclinedTransaction.Source.builder() + .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .achDecline( DeclinedTransaction.Source.AchDecline.builder() .id("ach_decline_72v1mcwxudctq56efipa") @@ -646,7 +647,6 @@ internal class DeclinedTransactionListPageResponseTest { ) .build() ) - .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .checkDecline( DeclinedTransaction.Source.CheckDecline.builder() .amount(-1000L) @@ -757,6 +757,7 @@ internal class DeclinedTransactionListPageResponseTest { .routeType(DeclinedTransaction.RouteType.ACCOUNT_NUMBER) .source( DeclinedTransaction.Source.builder() + .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .achDecline( DeclinedTransaction.Source.AchDecline.builder() .id("ach_decline_72v1mcwxudctq56efipa") @@ -1017,7 +1018,6 @@ internal class DeclinedTransactionListPageResponseTest { ) .build() ) - .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .checkDecline( DeclinedTransaction.Source.CheckDecline.builder() .amount(-1000L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt index 289b7fe96..ecb995760 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt @@ -24,6 +24,7 @@ internal class DeclinedTransactionTest { .routeType(DeclinedTransaction.RouteType.ACCOUNT_NUMBER) .source( DeclinedTransaction.Source.builder() + .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .achDecline( DeclinedTransaction.Source.AchDecline.builder() .id("ach_decline_72v1mcwxudctq56efipa") @@ -251,7 +252,6 @@ internal class DeclinedTransactionTest { ) .build() ) - .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .checkDecline( DeclinedTransaction.Source.CheckDecline.builder() .amount(-1000L) @@ -345,6 +345,7 @@ internal class DeclinedTransactionTest { assertThat(declinedTransaction.source()) .isEqualTo( DeclinedTransaction.Source.builder() + .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .achDecline( DeclinedTransaction.Source.AchDecline.builder() .id("ach_decline_72v1mcwxudctq56efipa") @@ -561,7 +562,6 @@ internal class DeclinedTransactionTest { ) .build() ) - .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .checkDecline( DeclinedTransaction.Source.CheckDecline.builder() .amount(-1000L) @@ -650,6 +650,7 @@ internal class DeclinedTransactionTest { .routeType(DeclinedTransaction.RouteType.ACCOUNT_NUMBER) .source( DeclinedTransaction.Source.builder() + .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .achDecline( DeclinedTransaction.Source.AchDecline.builder() .id("ach_decline_72v1mcwxudctq56efipa") @@ -877,7 +878,6 @@ internal class DeclinedTransactionTest { ) .build() ) - .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .checkDecline( DeclinedTransaction.Source.CheckDecline.builder() .amount(-1000L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt index 555be5ebb..c9f9fd040 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt @@ -28,12 +28,12 @@ internal class FednowTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( FednowTransfer.CreatedBy.builder() + .category(FednowTransfer.CreatedBy.Category.USER) .apiKey( FednowTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(FednowTransfer.CreatedBy.Category.USER) .oauthApplication( FednowTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -92,12 +92,12 @@ internal class FednowTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( FednowTransfer.CreatedBy.builder() + .category(FednowTransfer.CreatedBy.Category.USER) .apiKey( FednowTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(FednowTransfer.CreatedBy.Category.USER) .oauthApplication( FednowTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -160,12 +160,12 @@ internal class FednowTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( FednowTransfer.CreatedBy.builder() + .category(FednowTransfer.CreatedBy.Category.USER) .apiKey( FednowTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(FednowTransfer.CreatedBy.Category.USER) .oauthApplication( FednowTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt index 25cb67962..4b6c02394 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt @@ -26,12 +26,12 @@ internal class FednowTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( FednowTransfer.CreatedBy.builder() + .category(FednowTransfer.CreatedBy.Category.USER) .apiKey( FednowTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(FednowTransfer.CreatedBy.Category.USER) .oauthApplication( FednowTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -85,10 +85,10 @@ internal class FednowTransferTest { assertThat(fednowTransfer.createdBy()) .contains( FednowTransfer.CreatedBy.builder() + .category(FednowTransfer.CreatedBy.Category.USER) .apiKey( FednowTransfer.CreatedBy.ApiKey.builder().description("description").build() ) - .category(FednowTransfer.CreatedBy.Category.USER) .oauthApplication( FednowTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -145,12 +145,12 @@ internal class FednowTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( FednowTransfer.CreatedBy.builder() + .category(FednowTransfer.CreatedBy.Category.USER) .apiKey( FednowTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(FednowTransfer.CreatedBy.Category.USER) .oauthApplication( FednowTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt index aabadb139..5f6cb9cd4 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt @@ -29,6 +29,9 @@ internal class PendingTransactionListPageResponseTest { .routeType(PendingTransaction.RouteType.CARD) .source( PendingTransaction.Source.builder() + .category( + PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION + ) .accountTransferInstruction( PendingTransaction.Source.AccountTransferInstruction.builder() .amount(100L) @@ -318,9 +321,6 @@ internal class PendingTransactionListPageResponseTest { ) .build() ) - .category( - PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION - ) .checkDepositInstruction( PendingTransaction.Source.CheckDepositInstruction.builder() .amount(100L) @@ -434,6 +434,7 @@ internal class PendingTransactionListPageResponseTest { .routeType(PendingTransaction.RouteType.CARD) .source( PendingTransaction.Source.builder() + .category(PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION) .accountTransferInstruction( PendingTransaction.Source.AccountTransferInstruction.builder() .amount(100L) @@ -712,7 +713,6 @@ internal class PendingTransactionListPageResponseTest { .transferId("outbound_card_push_transfer_e0z9rdpamraczh4tvwye") .build() ) - .category(PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION) .checkDepositInstruction( PendingTransaction.Source.CheckDepositInstruction.builder() .amount(100L) @@ -824,6 +824,9 @@ internal class PendingTransactionListPageResponseTest { .routeType(PendingTransaction.RouteType.CARD) .source( PendingTransaction.Source.builder() + .category( + PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION + ) .accountTransferInstruction( PendingTransaction.Source.AccountTransferInstruction.builder() .amount(100L) @@ -1113,9 +1116,6 @@ internal class PendingTransactionListPageResponseTest { ) .build() ) - .category( - PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION - ) .checkDepositInstruction( PendingTransaction.Source.CheckDepositInstruction.builder() .amount(100L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt index 97d18b050..d01c8fcd3 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt @@ -27,6 +27,7 @@ internal class PendingTransactionTest { .routeType(PendingTransaction.RouteType.CARD) .source( PendingTransaction.Source.builder() + .category(PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION) .accountTransferInstruction( PendingTransaction.Source.AccountTransferInstruction.builder() .amount(100L) @@ -292,7 +293,6 @@ internal class PendingTransactionTest { .transferId("outbound_card_push_transfer_e0z9rdpamraczh4tvwye") .build() ) - .category(PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION) .checkDepositInstruction( PendingTransaction.Source.CheckDepositInstruction.builder() .amount(100L) @@ -387,6 +387,7 @@ internal class PendingTransactionTest { assertThat(pendingTransaction.source()) .isEqualTo( PendingTransaction.Source.builder() + .category(PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION) .accountTransferInstruction( PendingTransaction.Source.AccountTransferInstruction.builder() .amount(100L) @@ -641,7 +642,6 @@ internal class PendingTransactionTest { .transferId("outbound_card_push_transfer_e0z9rdpamraczh4tvwye") .build() ) - .category(PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION) .checkDepositInstruction( PendingTransaction.Source.CheckDepositInstruction.builder() .amount(100L) @@ -736,6 +736,7 @@ internal class PendingTransactionTest { .routeType(PendingTransaction.RouteType.CARD) .source( PendingTransaction.Source.builder() + .category(PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION) .accountTransferInstruction( PendingTransaction.Source.AccountTransferInstruction.builder() .amount(100L) @@ -1001,7 +1002,6 @@ internal class PendingTransactionTest { .transferId("outbound_card_push_transfer_e0z9rdpamraczh4tvwye") .build() ) - .category(PendingTransaction.Source.Category.ACH_TRANSFER_INSTRUCTION) .checkDepositInstruction( PendingTransaction.Source.CheckDepositInstruction.builder() .amount(100L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageResponseTest.kt index ceea65faf..188d74a9e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageResponseTest.kt @@ -39,12 +39,12 @@ internal class RealTimePaymentsTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( RealTimePaymentsTransfer.CreatedBy.builder() + .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .apiKey( RealTimePaymentsTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .oauthApplication( RealTimePaymentsTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -119,12 +119,12 @@ internal class RealTimePaymentsTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( RealTimePaymentsTransfer.CreatedBy.builder() + .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .apiKey( RealTimePaymentsTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .oauthApplication( RealTimePaymentsTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -202,12 +202,12 @@ internal class RealTimePaymentsTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( RealTimePaymentsTransfer.CreatedBy.builder() + .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .apiKey( RealTimePaymentsTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .oauthApplication( RealTimePaymentsTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferTest.kt index 93596c505..1c5e9eda0 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferTest.kt @@ -37,12 +37,12 @@ internal class RealTimePaymentsTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( RealTimePaymentsTransfer.CreatedBy.builder() + .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .apiKey( RealTimePaymentsTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .oauthApplication( RealTimePaymentsTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -116,12 +116,12 @@ internal class RealTimePaymentsTransferTest { assertThat(realTimePaymentsTransfer.createdBy()) .contains( RealTimePaymentsTransfer.CreatedBy.builder() + .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .apiKey( RealTimePaymentsTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .oauthApplication( RealTimePaymentsTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -201,12 +201,12 @@ internal class RealTimePaymentsTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( RealTimePaymentsTransfer.CreatedBy.builder() + .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .apiKey( RealTimePaymentsTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(RealTimePaymentsTransfer.CreatedBy.Category.USER) .oauthApplication( RealTimePaymentsTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt index ef9b3ec3d..bae7ef01d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt @@ -29,6 +29,7 @@ internal class CardAuthorizationCreateResponseTest { .routeType(DeclinedTransaction.RouteType.ACCOUNT_NUMBER) .source( DeclinedTransaction.Source.builder() + .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .achDecline( DeclinedTransaction.Source.AchDecline.builder() .id("ach_decline_72v1mcwxudctq56efipa") @@ -289,7 +290,6 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .checkDecline( DeclinedTransaction.Source.CheckDecline.builder() .amount(-1000L) @@ -397,6 +397,7 @@ internal class CardAuthorizationCreateResponseTest { .routeType(PendingTransaction.RouteType.CARD) .source( PendingTransaction.Source.builder() + .category(PendingTransaction.Source.Category.CARD_AUTHORIZATION) .accountTransferInstruction( PendingTransaction.Source.AccountTransferInstruction.builder() .amount(100L) @@ -686,7 +687,6 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .category(PendingTransaction.Source.Category.CARD_AUTHORIZATION) .checkDepositInstruction( PendingTransaction.Source.CheckDepositInstruction.builder() .amount(100L) @@ -801,6 +801,7 @@ internal class CardAuthorizationCreateResponseTest { .routeType(DeclinedTransaction.RouteType.ACCOUNT_NUMBER) .source( DeclinedTransaction.Source.builder() + .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .achDecline( DeclinedTransaction.Source.AchDecline.builder() .id("ach_decline_72v1mcwxudctq56efipa") @@ -1051,7 +1052,6 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .checkDecline( DeclinedTransaction.Source.CheckDecline.builder() .amount(-1000L) @@ -1157,6 +1157,7 @@ internal class CardAuthorizationCreateResponseTest { .routeType(PendingTransaction.RouteType.CARD) .source( PendingTransaction.Source.builder() + .category(PendingTransaction.Source.Category.CARD_AUTHORIZATION) .accountTransferInstruction( PendingTransaction.Source.AccountTransferInstruction.builder() .amount(100L) @@ -1435,7 +1436,6 @@ internal class CardAuthorizationCreateResponseTest { .transferId("outbound_card_push_transfer_e0z9rdpamraczh4tvwye") .build() ) - .category(PendingTransaction.Source.Category.CARD_AUTHORIZATION) .checkDepositInstruction( PendingTransaction.Source.CheckDepositInstruction.builder() .amount(100L) @@ -1548,6 +1548,7 @@ internal class CardAuthorizationCreateResponseTest { .routeType(DeclinedTransaction.RouteType.ACCOUNT_NUMBER) .source( DeclinedTransaction.Source.builder() + .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .achDecline( DeclinedTransaction.Source.AchDecline.builder() .id("ach_decline_72v1mcwxudctq56efipa") @@ -1808,7 +1809,6 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .category(DeclinedTransaction.Source.Category.ACH_DECLINE) .checkDecline( DeclinedTransaction.Source.CheckDecline.builder() .amount(-1000L) @@ -1916,6 +1916,7 @@ internal class CardAuthorizationCreateResponseTest { .routeType(PendingTransaction.RouteType.CARD) .source( PendingTransaction.Source.builder() + .category(PendingTransaction.Source.Category.CARD_AUTHORIZATION) .accountTransferInstruction( PendingTransaction.Source.AccountTransferInstruction.builder() .amount(100L) @@ -2205,7 +2206,6 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .category(PendingTransaction.Source.Category.CARD_AUTHORIZATION) .checkDepositInstruction( PendingTransaction.Source.CheckDepositInstruction.builder() .amount(100L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/swifttransfers/SwiftTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/swifttransfers/SwiftTransferListPageResponseTest.kt index 2bd20834f..b598271f0 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/swifttransfers/SwiftTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/swifttransfers/SwiftTransferListPageResponseTest.kt @@ -24,12 +24,12 @@ internal class SwiftTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( SwiftTransfer.CreatedBy.builder() + .category(SwiftTransfer.CreatedBy.Category.USER) .apiKey( SwiftTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(SwiftTransfer.CreatedBy.Category.USER) .oauthApplication( SwiftTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -91,12 +91,12 @@ internal class SwiftTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( SwiftTransfer.CreatedBy.builder() + .category(SwiftTransfer.CreatedBy.Category.USER) .apiKey( SwiftTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(SwiftTransfer.CreatedBy.Category.USER) .oauthApplication( SwiftTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -162,12 +162,12 @@ internal class SwiftTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( SwiftTransfer.CreatedBy.builder() + .category(SwiftTransfer.CreatedBy.Category.USER) .apiKey( SwiftTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(SwiftTransfer.CreatedBy.Category.USER) .oauthApplication( SwiftTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/swifttransfers/SwiftTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/swifttransfers/SwiftTransferTest.kt index 64ca22ad1..20bd4a647 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/swifttransfers/SwiftTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/swifttransfers/SwiftTransferTest.kt @@ -22,12 +22,12 @@ internal class SwiftTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( SwiftTransfer.CreatedBy.builder() + .category(SwiftTransfer.CreatedBy.Category.USER) .apiKey( SwiftTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(SwiftTransfer.CreatedBy.Category.USER) .oauthApplication( SwiftTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -81,10 +81,10 @@ internal class SwiftTransferTest { assertThat(swiftTransfer.createdBy()) .isEqualTo( SwiftTransfer.CreatedBy.builder() + .category(SwiftTransfer.CreatedBy.Category.USER) .apiKey( SwiftTransfer.CreatedBy.ApiKey.builder().description("description").build() ) - .category(SwiftTransfer.CreatedBy.Category.USER) .oauthApplication( SwiftTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -146,12 +146,12 @@ internal class SwiftTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( SwiftTransfer.CreatedBy.builder() + .category(SwiftTransfer.CreatedBy.Category.USER) .apiKey( SwiftTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(SwiftTransfer.CreatedBy.Category.USER) .oauthApplication( SwiftTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt index bb6f7a2d1..cb9ef0548 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt @@ -27,6 +27,7 @@ internal class TransactionListPageResponseTest { .routeType(Transaction.RouteType.ACCOUNT_NUMBER) .source( Transaction.Source.builder() + .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .accountRevenuePayment( Transaction.Source.AccountRevenuePayment.builder() .accruedOnAccountId("account_in71c4amph0vgo2qllky") @@ -898,7 +899,6 @@ internal class TransactionListPageResponseTest { ) .build() ) - .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .checkDepositAcceptance( Transaction.Source.CheckDepositAcceptance.builder() .accountNumber("987654321") @@ -1176,6 +1176,7 @@ internal class TransactionListPageResponseTest { .routeType(Transaction.RouteType.ACCOUNT_NUMBER) .source( Transaction.Source.builder() + .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .accountRevenuePayment( Transaction.Source.AccountRevenuePayment.builder() .accruedOnAccountId("account_in71c4amph0vgo2qllky") @@ -1986,7 +1987,6 @@ internal class TransactionListPageResponseTest { .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00")) .build() ) - .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .checkDepositAcceptance( Transaction.Source.CheckDepositAcceptance.builder() .accountNumber("987654321") @@ -2256,6 +2256,7 @@ internal class TransactionListPageResponseTest { .routeType(Transaction.RouteType.ACCOUNT_NUMBER) .source( Transaction.Source.builder() + .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .accountRevenuePayment( Transaction.Source.AccountRevenuePayment.builder() .accruedOnAccountId("account_in71c4amph0vgo2qllky") @@ -3127,7 +3128,6 @@ internal class TransactionListPageResponseTest { ) .build() ) - .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .checkDepositAcceptance( Transaction.Source.CheckDepositAcceptance.builder() .accountNumber("987654321") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt index 518e025be..17ec15086 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt @@ -25,6 +25,7 @@ internal class TransactionTest { .routeType(Transaction.RouteType.ACCOUNT_NUMBER) .source( Transaction.Source.builder() + .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .accountRevenuePayment( Transaction.Source.AccountRevenuePayment.builder() .accruedOnAccountId("account_in71c4amph0vgo2qllky") @@ -806,7 +807,6 @@ internal class TransactionTest { .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00")) .build() ) - .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .checkDepositAcceptance( Transaction.Source.CheckDepositAcceptance.builder() .accountNumber("987654321") @@ -1048,6 +1048,7 @@ internal class TransactionTest { assertThat(transaction.source()) .isEqualTo( Transaction.Source.builder() + .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .accountRevenuePayment( Transaction.Source.AccountRevenuePayment.builder() .accruedOnAccountId("account_in71c4amph0vgo2qllky") @@ -1781,7 +1782,6 @@ internal class TransactionTest { .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00")) .build() ) - .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .checkDepositAcceptance( Transaction.Source.CheckDepositAcceptance.builder() .accountNumber("987654321") @@ -2022,6 +2022,7 @@ internal class TransactionTest { .routeType(Transaction.RouteType.ACCOUNT_NUMBER) .source( Transaction.Source.builder() + .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .accountRevenuePayment( Transaction.Source.AccountRevenuePayment.builder() .accruedOnAccountId("account_in71c4amph0vgo2qllky") @@ -2803,7 +2804,6 @@ internal class TransactionTest { .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00")) .build() ) - .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER) .checkDepositAcceptance( Transaction.Source.CheckDepositAcceptance.builder() .accountNumber("987654321") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt index 25e92a0da..6d43db788 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt @@ -36,12 +36,12 @@ internal class WireTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( WireTransfer.CreatedBy.builder() + .category(WireTransfer.CreatedBy.Category.USER) .apiKey( WireTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(WireTransfer.CreatedBy.Category.USER) .oauthApplication( WireTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -165,12 +165,12 @@ internal class WireTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( WireTransfer.CreatedBy.builder() + .category(WireTransfer.CreatedBy.Category.USER) .apiKey( WireTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(WireTransfer.CreatedBy.Category.USER) .oauthApplication( WireTransfer.CreatedBy.OAuthApplication.builder() .name("name") @@ -298,12 +298,12 @@ internal class WireTransferListPageResponseTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( WireTransfer.CreatedBy.builder() + .category(WireTransfer.CreatedBy.Category.USER) .apiKey( WireTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(WireTransfer.CreatedBy.Category.USER) .oauthApplication( WireTransfer.CreatedBy.OAuthApplication.builder() .name("name") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt index 50f0f31bb..ddba59fac 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt @@ -34,12 +34,12 @@ internal class WireTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( WireTransfer.CreatedBy.builder() + .category(WireTransfer.CreatedBy.Category.USER) .apiKey( WireTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(WireTransfer.CreatedBy.Category.USER) .oauthApplication( WireTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -156,10 +156,10 @@ internal class WireTransferTest { assertThat(wireTransfer.createdBy()) .contains( WireTransfer.CreatedBy.builder() + .category(WireTransfer.CreatedBy.Category.USER) .apiKey( WireTransfer.CreatedBy.ApiKey.builder().description("description").build() ) - .category(WireTransfer.CreatedBy.Category.USER) .oauthApplication( WireTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) @@ -282,12 +282,12 @@ internal class WireTransferTest { .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .createdBy( WireTransfer.CreatedBy.builder() + .category(WireTransfer.CreatedBy.Category.USER) .apiKey( WireTransfer.CreatedBy.ApiKey.builder() .description("description") .build() ) - .category(WireTransfer.CreatedBy.Category.USER) .oauthApplication( WireTransfer.CreatedBy.OAuthApplication.builder().name("name").build() ) From 8868e03352842ffbd3293422bfb111fe01d462b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Feb 2026 01:32:52 +0000 Subject: [PATCH 3/3] release: 0.426.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 92be4f76e..304196ece 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.425.0" + ".": "0.426.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index fbcb1d502..7ccb66b30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.426.0 (2026-02-07) + +Full Changelog: [v0.425.0...v0.426.0](https://github.com/Increase/increase-java/compare/v0.425.0...v0.426.0) + +### Features + +* **api:** api update ([8cce3f5](https://github.com/Increase/increase-java/commit/8cce3f5b9b8b10010953b2b6e2d9017fae724a8e)) + + +### Chores + +* **internal:** upgrade AssertJ ([bfba6a5](https://github.com/Increase/increase-java/commit/bfba6a58b6f3ab2dafdf1f42e09b98ddff81fa28)) + ## 0.425.0 (2026-02-06) Full Changelog: [v0.424.0...v0.425.0](https://github.com/Increase/increase-java/compare/v0.424.0...v0.425.0) diff --git a/README.md b/README.md index 9c832c37c..d94c257f9 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.425.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.425.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.425.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.426.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.426.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.426.0) @@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe -The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.425.0). +The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.426.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d ### Gradle ```kotlin -implementation("com.increase.api:increase-java:0.425.0") +implementation("com.increase.api:increase-java:0.426.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.425.0") com.increase.api increase-java - 0.425.0 + 0.426.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 1ccde6b35..86880cf04 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.425.0" // x-release-please-version + version = "0.426.0" // x-release-please-version } subprojects {