diff --git a/.release-please-manifest.json b/.release-please-manifest.json index a70550d8d..d5ac71f16 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.552.0" + ".": "0.553.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index ef6aec49e..1ed19e257 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 238 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase/increase-162a3fd8f0b295740db83e8821202090132f546d9b0d07c344c3c39fe9f69fdc.yml -openapi_spec_hash: b0ecd390f57fb61621ae4006faa9b56b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase/increase-5b9e67ce2917b971d667c6b9caaf33f9fede2e8911fd9f51f59069bce04f8b08.yml +openapi_spec_hash: 274f5826d639548c822084630d696a3a config_hash: ac050010e5453883d5e5fa603554a2e0 diff --git a/CHANGELOG.md b/CHANGELOG.md index f846ad964..eb14a7b02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.553.0 (2026-05-16) + +Full Changelog: [v0.552.0...v0.553.0](https://github.com/Increase/increase-java/compare/v0.552.0...v0.553.0) + +### Features + +* **api:** api update ([b35cd8f](https://github.com/Increase/increase-java/commit/b35cd8fc609b61d83bce6eb13d73e73fdd8d6747)) + ## 0.552.0 (2026-05-15) Full Changelog: [v0.551.0...v0.552.0](https://github.com/Increase/increase-java/compare/v0.551.0...v0.552.0) diff --git a/README.md b/README.md index 96e61e683..37b629c8b 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.552.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.552.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.552.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.553.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.553.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.553.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.552.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.553.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.552.0") +implementation("com.increase.api:increase-java:0.553.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.552.0") com.increase.api increase-java - 0.552.0 + 0.553.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 640ca3c86..c361acf42 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.552.0" // x-release-please-version + version = "0.553.0" // x-release-please-version } subprojects { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotification.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotification.kt index 8531b057f..b87551824 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotification.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotification.kt @@ -1249,7 +1249,10 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val changeCode: JsonField, - private val correctedData: JsonField, + private val correctedAccountFunding: JsonField, + private val correctedAccountNumber: JsonField, + private val correctedIndividualId: JsonField, + private val correctedRoutingNumber: JsonField, private val createdAt: JsonField, private val additionalProperties: MutableMap, ) { @@ -1259,13 +1262,30 @@ private constructor( @JsonProperty("change_code") @ExcludeMissing changeCode: JsonField = JsonMissing.of(), - @JsonProperty("corrected_data") + @JsonProperty("corrected_account_funding") @ExcludeMissing - correctedData: JsonField = JsonMissing.of(), + correctedAccountFunding: JsonField = JsonMissing.of(), + @JsonProperty("corrected_account_number") + @ExcludeMissing + correctedAccountNumber: JsonField = JsonMissing.of(), + @JsonProperty("corrected_individual_id") + @ExcludeMissing + correctedIndividualId: JsonField = JsonMissing.of(), + @JsonProperty("corrected_routing_number") + @ExcludeMissing + correctedRoutingNumber: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), - ) : this(changeCode, correctedData, createdAt, mutableMapOf()) + ) : this( + changeCode, + correctedAccountFunding, + correctedAccountNumber, + correctedIndividualId, + correctedRoutingNumber, + createdAt, + mutableMapOf(), + ) /** * The required type of change that is being signaled by the receiving financial @@ -1277,16 +1297,41 @@ private constructor( fun changeCode(): ChangeCode = changeCode.getRequired("change_code") /** - * The corrected data that should be used in future ACHs to this account. This may contain - * the suggested new account number or routing number. When the `change_code` is - * `incorrect_transaction_code`, this field contains an integer. Numbers starting with a 2 - * encourage changing the `funding` parameter to checking; numbers starting with a 3 - * encourage changing to savings. + * The corrected account funding type that should be used in future ACHs to this account. + * This is derived from the corrected transaction code. * - * @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 correctedData(): String = correctedData.getRequired("corrected_data") + fun correctedAccountFunding(): Optional = + correctedAccountFunding.getOptional("corrected_account_funding") + + /** + * The corrected account number that should be used in future ACHs to this account. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun correctedAccountNumber(): Optional = + correctedAccountNumber.getOptional("corrected_account_number") + + /** + * The corrected individual identifier that should be used in future ACHs. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun correctedIndividualId(): Optional = + correctedIndividualId.getOptional("corrected_individual_id") + + /** + * The corrected routing number that should be used in future ACHs to this account. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun correctedRoutingNumber(): Optional = + correctedRoutingNumber.getOptional("corrected_routing_number") /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the @@ -1307,14 +1352,44 @@ private constructor( fun _changeCode(): JsonField = changeCode /** - * Returns the raw JSON value of [correctedData]. + * Returns the raw JSON value of [correctedAccountFunding]. * - * Unlike [correctedData], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [correctedAccountFunding], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("corrected_account_funding") + @ExcludeMissing + fun _correctedAccountFunding(): JsonField = correctedAccountFunding + + /** + * Returns the raw JSON value of [correctedAccountNumber]. + * + * Unlike [correctedAccountNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JsonProperty("corrected_data") + @JsonProperty("corrected_account_number") @ExcludeMissing - fun _correctedData(): JsonField = correctedData + fun _correctedAccountNumber(): JsonField = correctedAccountNumber + + /** + * Returns the raw JSON value of [correctedIndividualId]. + * + * Unlike [correctedIndividualId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("corrected_individual_id") + @ExcludeMissing + fun _correctedIndividualId(): JsonField = correctedIndividualId + + /** + * Returns the raw JSON value of [correctedRoutingNumber]. + * + * Unlike [correctedRoutingNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("corrected_routing_number") + @ExcludeMissing + fun _correctedRoutingNumber(): JsonField = correctedRoutingNumber /** * Returns the raw JSON value of [createdAt]. @@ -1345,7 +1420,10 @@ private constructor( * The following fields are required: * ```java * .changeCode() - * .correctedData() + * .correctedAccountFunding() + * .correctedAccountNumber() + * .correctedIndividualId() + * .correctedRoutingNumber() * .createdAt() * ``` */ @@ -1356,14 +1434,20 @@ private constructor( class Builder internal constructor() { private var changeCode: JsonField? = null - private var correctedData: JsonField? = null + private var correctedAccountFunding: JsonField? = null + private var correctedAccountNumber: JsonField? = null + private var correctedIndividualId: JsonField? = null + private var correctedRoutingNumber: JsonField? = null private var createdAt: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(notificationsOfChange: NotificationsOfChange) = apply { changeCode = notificationsOfChange.changeCode - correctedData = notificationsOfChange.correctedData + correctedAccountFunding = notificationsOfChange.correctedAccountFunding + correctedAccountNumber = notificationsOfChange.correctedAccountNumber + correctedIndividualId = notificationsOfChange.correctedIndividualId + correctedRoutingNumber = notificationsOfChange.correctedRoutingNumber createdAt = notificationsOfChange.createdAt additionalProperties = notificationsOfChange.additionalProperties.toMutableMap() } @@ -1386,23 +1470,95 @@ private constructor( } /** - * The corrected data that should be used in future ACHs to this account. This may - * contain the suggested new account number or routing number. When the `change_code` is - * `incorrect_transaction_code`, this field contains an integer. Numbers starting with a - * 2 encourage changing the `funding` parameter to checking; numbers starting with a 3 - * encourage changing to savings. + * The corrected account funding type that should be used in future ACHs to this + * account. This is derived from the corrected transaction code. + */ + fun correctedAccountFunding(correctedAccountFunding: CorrectedAccountFunding?) = + correctedAccountFunding(JsonField.ofNullable(correctedAccountFunding)) + + /** + * Alias for calling [Builder.correctedAccountFunding] with + * `correctedAccountFunding.orElse(null)`. */ - fun correctedData(correctedData: String) = correctedData(JsonField.of(correctedData)) + fun correctedAccountFunding( + correctedAccountFunding: Optional + ) = correctedAccountFunding(correctedAccountFunding.getOrNull()) /** - * Sets [Builder.correctedData] to an arbitrary JSON value. + * Sets [Builder.correctedAccountFunding] to an arbitrary JSON value. * - * You should usually call [Builder.correctedData] 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.correctedAccountFunding] with a well-typed + * [CorrectedAccountFunding] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun correctedAccountFunding( + correctedAccountFunding: JsonField + ) = apply { this.correctedAccountFunding = correctedAccountFunding } + + /** The corrected account number that should be used in future ACHs to this account. */ + fun correctedAccountNumber(correctedAccountNumber: String?) = + correctedAccountNumber(JsonField.ofNullable(correctedAccountNumber)) + + /** + * Alias for calling [Builder.correctedAccountNumber] with + * `correctedAccountNumber.orElse(null)`. + */ + fun correctedAccountNumber(correctedAccountNumber: Optional) = + correctedAccountNumber(correctedAccountNumber.getOrNull()) + + /** + * Sets [Builder.correctedAccountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.correctedAccountNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. */ - fun correctedData(correctedData: JsonField) = apply { - this.correctedData = correctedData + fun correctedAccountNumber(correctedAccountNumber: JsonField) = apply { + this.correctedAccountNumber = correctedAccountNumber + } + + /** The corrected individual identifier that should be used in future ACHs. */ + fun correctedIndividualId(correctedIndividualId: String?) = + correctedIndividualId(JsonField.ofNullable(correctedIndividualId)) + + /** + * Alias for calling [Builder.correctedIndividualId] with + * `correctedIndividualId.orElse(null)`. + */ + fun correctedIndividualId(correctedIndividualId: Optional) = + correctedIndividualId(correctedIndividualId.getOrNull()) + + /** + * Sets [Builder.correctedIndividualId] to an arbitrary JSON value. + * + * You should usually call [Builder.correctedIndividualId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun correctedIndividualId(correctedIndividualId: JsonField) = apply { + this.correctedIndividualId = correctedIndividualId + } + + /** The corrected routing number that should be used in future ACHs to this account. */ + fun correctedRoutingNumber(correctedRoutingNumber: String?) = + correctedRoutingNumber(JsonField.ofNullable(correctedRoutingNumber)) + + /** + * Alias for calling [Builder.correctedRoutingNumber] with + * `correctedRoutingNumber.orElse(null)`. + */ + fun correctedRoutingNumber(correctedRoutingNumber: Optional) = + correctedRoutingNumber(correctedRoutingNumber.getOrNull()) + + /** + * Sets [Builder.correctedRoutingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.correctedRoutingNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun correctedRoutingNumber(correctedRoutingNumber: JsonField) = apply { + this.correctedRoutingNumber = correctedRoutingNumber } /** @@ -1449,7 +1605,10 @@ private constructor( * The following fields are required: * ```java * .changeCode() - * .correctedData() + * .correctedAccountFunding() + * .correctedAccountNumber() + * .correctedIndividualId() + * .correctedRoutingNumber() * .createdAt() * ``` * @@ -1458,7 +1617,10 @@ private constructor( fun build(): NotificationsOfChange = NotificationsOfChange( checkRequired("changeCode", changeCode), - checkRequired("correctedData", correctedData), + checkRequired("correctedAccountFunding", correctedAccountFunding), + checkRequired("correctedAccountNumber", correctedAccountNumber), + checkRequired("correctedIndividualId", correctedIndividualId), + checkRequired("correctedRoutingNumber", correctedRoutingNumber), checkRequired("createdAt", createdAt), additionalProperties.toMutableMap(), ) @@ -1481,7 +1643,10 @@ private constructor( } changeCode().validate() - correctedData() + correctedAccountFunding().ifPresent { it.validate() } + correctedAccountNumber() + correctedIndividualId() + correctedRoutingNumber() createdAt() validated = true } @@ -1503,7 +1668,10 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (changeCode.asKnown().getOrNull()?.validity() ?: 0) + - (if (correctedData.asKnown().isPresent) 1 else 0) + + (correctedAccountFunding.asKnown().getOrNull()?.validity() ?: 0) + + (if (correctedAccountNumber.asKnown().isPresent) 1 else 0) + + (if (correctedIndividualId.asKnown().isPresent) 1 else 0) + + (if (correctedRoutingNumber.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) /** @@ -1898,6 +2066,172 @@ private constructor( override fun toString() = value.toString() } + /** + * The corrected account funding type that should be used in future ACHs to this account. + * This is derived from the corrected transaction code. + */ + class CorrectedAccountFunding + @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 { + + /** A checking account. */ + @JvmField val CHECKING = of("checking") + + /** A savings account. */ + @JvmField val SAVINGS = of("savings") + + /** A bank's general ledger. Uncommon. */ + @JvmField val GENERAL_LEDGER = of("general_ledger") + + @JvmStatic fun of(value: String) = CorrectedAccountFunding(JsonField.of(value)) + } + + /** An enum containing [CorrectedAccountFunding]'s known values. */ + enum class Known { + /** A checking account. */ + CHECKING, + /** A savings account. */ + SAVINGS, + /** A bank's general ledger. Uncommon. */ + GENERAL_LEDGER, + } + + /** + * An enum containing [CorrectedAccountFunding]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [CorrectedAccountFunding] 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 { + /** A checking account. */ + CHECKING, + /** A savings account. */ + SAVINGS, + /** A bank's general ledger. Uncommon. */ + GENERAL_LEDGER, + /** + * An enum member indicating that [CorrectedAccountFunding] 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) { + CHECKING -> Value.CHECKING + SAVINGS -> Value.SAVINGS + GENERAL_LEDGER -> Value.GENERAL_LEDGER + 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) { + CHECKING -> Known.CHECKING + SAVINGS -> Known.SAVINGS + GENERAL_LEDGER -> Known.GENERAL_LEDGER + else -> + throw IncreaseInvalidDataException( + "Unknown CorrectedAccountFunding: $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 + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws IncreaseInvalidDataException if any value type in this object doesn't match + * its expected type. + */ + fun validate(): CorrectedAccountFunding = 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 CorrectedAccountFunding && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -1905,19 +2239,30 @@ private constructor( return other is NotificationsOfChange && changeCode == other.changeCode && - correctedData == other.correctedData && + correctedAccountFunding == other.correctedAccountFunding && + correctedAccountNumber == other.correctedAccountNumber && + correctedIndividualId == other.correctedIndividualId && + correctedRoutingNumber == other.correctedRoutingNumber && createdAt == other.createdAt && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(changeCode, correctedData, createdAt, additionalProperties) + Objects.hash( + changeCode, + correctedAccountFunding, + correctedAccountNumber, + correctedIndividualId, + correctedRoutingNumber, + createdAt, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "NotificationsOfChange{changeCode=$changeCode, correctedData=$correctedData, createdAt=$createdAt, additionalProperties=$additionalProperties}" + "NotificationsOfChange{changeCode=$changeCode, correctedAccountFunding=$correctedAccountFunding, correctedAccountNumber=$correctedAccountNumber, correctedIndividualId=$correctedIndividualId, correctedRoutingNumber=$correctedRoutingNumber, createdAt=$createdAt, additionalProperties=$additionalProperties}" } /** If your prenotification is returned, this will contain details of the return. */ 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 23dcf4412..44e7e3134 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 @@ -6298,7 +6298,10 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val changeCode: JsonField, - private val correctedData: JsonField, + private val correctedAccountFunding: JsonField, + private val correctedAccountNumber: JsonField, + private val correctedIndividualId: JsonField, + private val correctedRoutingNumber: JsonField, private val createdAt: JsonField, private val additionalProperties: MutableMap, ) { @@ -6308,13 +6311,30 @@ private constructor( @JsonProperty("change_code") @ExcludeMissing changeCode: JsonField = JsonMissing.of(), - @JsonProperty("corrected_data") + @JsonProperty("corrected_account_funding") @ExcludeMissing - correctedData: JsonField = JsonMissing.of(), + correctedAccountFunding: JsonField = JsonMissing.of(), + @JsonProperty("corrected_account_number") + @ExcludeMissing + correctedAccountNumber: JsonField = JsonMissing.of(), + @JsonProperty("corrected_individual_id") + @ExcludeMissing + correctedIndividualId: JsonField = JsonMissing.of(), + @JsonProperty("corrected_routing_number") + @ExcludeMissing + correctedRoutingNumber: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), - ) : this(changeCode, correctedData, createdAt, mutableMapOf()) + ) : this( + changeCode, + correctedAccountFunding, + correctedAccountNumber, + correctedIndividualId, + correctedRoutingNumber, + createdAt, + mutableMapOf(), + ) /** * The required type of change that is being signaled by the receiving financial @@ -6326,16 +6346,41 @@ private constructor( fun changeCode(): ChangeCode = changeCode.getRequired("change_code") /** - * The corrected data that should be used in future ACHs to this account. This may contain - * the suggested new account number or routing number. When the `change_code` is - * `incorrect_transaction_code`, this field contains an integer. Numbers starting with a 2 - * encourage changing the `funding` parameter to checking; numbers starting with a 3 - * encourage changing to savings. + * The corrected account funding type that should be used in future ACHs to this account. + * This is derived from the corrected transaction code. * - * @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 correctedAccountFunding(): Optional = + correctedAccountFunding.getOptional("corrected_account_funding") + + /** + * The corrected account number that should be used in future ACHs to this account. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun correctedAccountNumber(): Optional = + correctedAccountNumber.getOptional("corrected_account_number") + + /** + * The corrected individual identifier that should be used in future ACHs. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun correctedIndividualId(): Optional = + correctedIndividualId.getOptional("corrected_individual_id") + + /** + * The corrected routing number that should be used in future ACHs to this account. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - fun correctedData(): String = correctedData.getRequired("corrected_data") + fun correctedRoutingNumber(): Optional = + correctedRoutingNumber.getOptional("corrected_routing_number") /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the @@ -6356,14 +6401,44 @@ private constructor( fun _changeCode(): JsonField = changeCode /** - * Returns the raw JSON value of [correctedData]. + * Returns the raw JSON value of [correctedAccountFunding]. * - * Unlike [correctedData], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [correctedAccountFunding], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("corrected_account_funding") + @ExcludeMissing + fun _correctedAccountFunding(): JsonField = correctedAccountFunding + + /** + * Returns the raw JSON value of [correctedAccountNumber]. + * + * Unlike [correctedAccountNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("corrected_account_number") + @ExcludeMissing + fun _correctedAccountNumber(): JsonField = correctedAccountNumber + + /** + * Returns the raw JSON value of [correctedIndividualId]. + * + * Unlike [correctedIndividualId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("corrected_individual_id") + @ExcludeMissing + fun _correctedIndividualId(): JsonField = correctedIndividualId + + /** + * Returns the raw JSON value of [correctedRoutingNumber]. + * + * Unlike [correctedRoutingNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JsonProperty("corrected_data") + @JsonProperty("corrected_routing_number") @ExcludeMissing - fun _correctedData(): JsonField = correctedData + fun _correctedRoutingNumber(): JsonField = correctedRoutingNumber /** * Returns the raw JSON value of [createdAt]. @@ -6394,7 +6469,10 @@ private constructor( * The following fields are required: * ```java * .changeCode() - * .correctedData() + * .correctedAccountFunding() + * .correctedAccountNumber() + * .correctedIndividualId() + * .correctedRoutingNumber() * .createdAt() * ``` */ @@ -6405,14 +6483,20 @@ private constructor( class Builder internal constructor() { private var changeCode: JsonField? = null - private var correctedData: JsonField? = null + private var correctedAccountFunding: JsonField? = null + private var correctedAccountNumber: JsonField? = null + private var correctedIndividualId: JsonField? = null + private var correctedRoutingNumber: JsonField? = null private var createdAt: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(notificationsOfChange: NotificationsOfChange) = apply { changeCode = notificationsOfChange.changeCode - correctedData = notificationsOfChange.correctedData + correctedAccountFunding = notificationsOfChange.correctedAccountFunding + correctedAccountNumber = notificationsOfChange.correctedAccountNumber + correctedIndividualId = notificationsOfChange.correctedIndividualId + correctedRoutingNumber = notificationsOfChange.correctedRoutingNumber createdAt = notificationsOfChange.createdAt additionalProperties = notificationsOfChange.additionalProperties.toMutableMap() } @@ -6435,23 +6519,95 @@ private constructor( } /** - * The corrected data that should be used in future ACHs to this account. This may - * contain the suggested new account number or routing number. When the `change_code` is - * `incorrect_transaction_code`, this field contains an integer. Numbers starting with a - * 2 encourage changing the `funding` parameter to checking; numbers starting with a 3 - * encourage changing to savings. + * The corrected account funding type that should be used in future ACHs to this + * account. This is derived from the corrected transaction code. */ - fun correctedData(correctedData: String) = correctedData(JsonField.of(correctedData)) + fun correctedAccountFunding(correctedAccountFunding: CorrectedAccountFunding?) = + correctedAccountFunding(JsonField.ofNullable(correctedAccountFunding)) /** - * Sets [Builder.correctedData] to an arbitrary JSON value. + * Alias for calling [Builder.correctedAccountFunding] with + * `correctedAccountFunding.orElse(null)`. + */ + fun correctedAccountFunding( + correctedAccountFunding: Optional + ) = correctedAccountFunding(correctedAccountFunding.getOrNull()) + + /** + * Sets [Builder.correctedAccountFunding] to an arbitrary JSON value. * - * You should usually call [Builder.correctedData] 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.correctedAccountFunding] with a well-typed + * [CorrectedAccountFunding] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. */ - fun correctedData(correctedData: JsonField) = apply { - this.correctedData = correctedData + fun correctedAccountFunding( + correctedAccountFunding: JsonField + ) = apply { this.correctedAccountFunding = correctedAccountFunding } + + /** The corrected account number that should be used in future ACHs to this account. */ + fun correctedAccountNumber(correctedAccountNumber: String?) = + correctedAccountNumber(JsonField.ofNullable(correctedAccountNumber)) + + /** + * Alias for calling [Builder.correctedAccountNumber] with + * `correctedAccountNumber.orElse(null)`. + */ + fun correctedAccountNumber(correctedAccountNumber: Optional) = + correctedAccountNumber(correctedAccountNumber.getOrNull()) + + /** + * Sets [Builder.correctedAccountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.correctedAccountNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun correctedAccountNumber(correctedAccountNumber: JsonField) = apply { + this.correctedAccountNumber = correctedAccountNumber + } + + /** The corrected individual identifier that should be used in future ACHs. */ + fun correctedIndividualId(correctedIndividualId: String?) = + correctedIndividualId(JsonField.ofNullable(correctedIndividualId)) + + /** + * Alias for calling [Builder.correctedIndividualId] with + * `correctedIndividualId.orElse(null)`. + */ + fun correctedIndividualId(correctedIndividualId: Optional) = + correctedIndividualId(correctedIndividualId.getOrNull()) + + /** + * Sets [Builder.correctedIndividualId] to an arbitrary JSON value. + * + * You should usually call [Builder.correctedIndividualId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun correctedIndividualId(correctedIndividualId: JsonField) = apply { + this.correctedIndividualId = correctedIndividualId + } + + /** The corrected routing number that should be used in future ACHs to this account. */ + fun correctedRoutingNumber(correctedRoutingNumber: String?) = + correctedRoutingNumber(JsonField.ofNullable(correctedRoutingNumber)) + + /** + * Alias for calling [Builder.correctedRoutingNumber] with + * `correctedRoutingNumber.orElse(null)`. + */ + fun correctedRoutingNumber(correctedRoutingNumber: Optional) = + correctedRoutingNumber(correctedRoutingNumber.getOrNull()) + + /** + * Sets [Builder.correctedRoutingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.correctedRoutingNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun correctedRoutingNumber(correctedRoutingNumber: JsonField) = apply { + this.correctedRoutingNumber = correctedRoutingNumber } /** @@ -6498,7 +6654,10 @@ private constructor( * The following fields are required: * ```java * .changeCode() - * .correctedData() + * .correctedAccountFunding() + * .correctedAccountNumber() + * .correctedIndividualId() + * .correctedRoutingNumber() * .createdAt() * ``` * @@ -6507,7 +6666,10 @@ private constructor( fun build(): NotificationsOfChange = NotificationsOfChange( checkRequired("changeCode", changeCode), - checkRequired("correctedData", correctedData), + checkRequired("correctedAccountFunding", correctedAccountFunding), + checkRequired("correctedAccountNumber", correctedAccountNumber), + checkRequired("correctedIndividualId", correctedIndividualId), + checkRequired("correctedRoutingNumber", correctedRoutingNumber), checkRequired("createdAt", createdAt), additionalProperties.toMutableMap(), ) @@ -6530,7 +6692,10 @@ private constructor( } changeCode().validate() - correctedData() + correctedAccountFunding().ifPresent { it.validate() } + correctedAccountNumber() + correctedIndividualId() + correctedRoutingNumber() createdAt() validated = true } @@ -6552,7 +6717,10 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (changeCode.asKnown().getOrNull()?.validity() ?: 0) + - (if (correctedData.asKnown().isPresent) 1 else 0) + + (correctedAccountFunding.asKnown().getOrNull()?.validity() ?: 0) + + (if (correctedAccountNumber.asKnown().isPresent) 1 else 0) + + (if (correctedIndividualId.asKnown().isPresent) 1 else 0) + + (if (correctedRoutingNumber.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) /** @@ -6947,6 +7115,172 @@ private constructor( override fun toString() = value.toString() } + /** + * The corrected account funding type that should be used in future ACHs to this account. + * This is derived from the corrected transaction code. + */ + class CorrectedAccountFunding + @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 { + + /** A checking account. */ + @JvmField val CHECKING = of("checking") + + /** A savings account. */ + @JvmField val SAVINGS = of("savings") + + /** A bank's general ledger. Uncommon. */ + @JvmField val GENERAL_LEDGER = of("general_ledger") + + @JvmStatic fun of(value: String) = CorrectedAccountFunding(JsonField.of(value)) + } + + /** An enum containing [CorrectedAccountFunding]'s known values. */ + enum class Known { + /** A checking account. */ + CHECKING, + /** A savings account. */ + SAVINGS, + /** A bank's general ledger. Uncommon. */ + GENERAL_LEDGER, + } + + /** + * An enum containing [CorrectedAccountFunding]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [CorrectedAccountFunding] 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 { + /** A checking account. */ + CHECKING, + /** A savings account. */ + SAVINGS, + /** A bank's general ledger. Uncommon. */ + GENERAL_LEDGER, + /** + * An enum member indicating that [CorrectedAccountFunding] 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) { + CHECKING -> Value.CHECKING + SAVINGS -> Value.SAVINGS + GENERAL_LEDGER -> Value.GENERAL_LEDGER + 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) { + CHECKING -> Known.CHECKING + SAVINGS -> Known.SAVINGS + GENERAL_LEDGER -> Known.GENERAL_LEDGER + else -> + throw IncreaseInvalidDataException( + "Unknown CorrectedAccountFunding: $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 + + /** + * Validates that the types of all values in this object match their expected types + * recursively. + * + * This method is _not_ forwards compatible with new types from the API for existing + * fields. + * + * @throws IncreaseInvalidDataException if any value type in this object doesn't match + * its expected type. + */ + fun validate(): CorrectedAccountFunding = 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 CorrectedAccountFunding && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -6954,19 +7288,30 @@ private constructor( return other is NotificationsOfChange && changeCode == other.changeCode && - correctedData == other.correctedData && + correctedAccountFunding == other.correctedAccountFunding && + correctedAccountNumber == other.correctedAccountNumber && + correctedIndividualId == other.correctedIndividualId && + correctedRoutingNumber == other.correctedRoutingNumber && createdAt == other.createdAt && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(changeCode, correctedData, createdAt, additionalProperties) + Objects.hash( + changeCode, + correctedAccountFunding, + correctedAccountNumber, + correctedIndividualId, + correctedRoutingNumber, + createdAt, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "NotificationsOfChange{changeCode=$changeCode, correctedData=$correctedData, createdAt=$createdAt, additionalProperties=$additionalProperties}" + "NotificationsOfChange{changeCode=$changeCode, correctedAccountFunding=$correctedAccountFunding, correctedAccountNumber=$correctedAccountNumber, correctedIndividualId=$correctedIndividualId, correctedRoutingNumber=$correctedRoutingNumber, createdAt=$createdAt, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/achtransfers/AchTransferCreateNotificationOfChangeParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/achtransfers/AchTransferCreateNotificationOfChangeParams.kt index 0f160c944..b68c57330 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/achtransfers/AchTransferCreateNotificationOfChangeParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/achtransfers/AchTransferCreateNotificationOfChangeParams.kt @@ -12,7 +12,6 @@ import com.increase.api.core.JsonField import com.increase.api.core.JsonMissing import com.increase.api.core.JsonValue import com.increase.api.core.Params -import com.increase.api.core.checkRequired import com.increase.api.core.http.Headers import com.increase.api.core.http.QueryParams import com.increase.api.errors.IncreaseInvalidDataException @@ -34,34 +33,70 @@ private constructor( fun achTransferId(): Optional = Optional.ofNullable(achTransferId) /** - * The reason for the notification of change. + * The corrected account funding type. * - * @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 changeCode(): ChangeCode = body.changeCode() + fun correctedAccountFunding(): Optional = + body.correctedAccountFunding() /** - * The corrected data for the notification of change (e.g., a new routing number). + * The corrected account number. * - * @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 correctedData(): String = body.correctedData() + fun correctedAccountNumber(): Optional = body.correctedAccountNumber() /** - * Returns the raw JSON value of [changeCode]. + * The corrected individual identifier. * - * Unlike [changeCode], this method doesn't throw if the JSON field has an unexpected type. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun _changeCode(): JsonField = body._changeCode() + fun correctedIndividualId(): Optional = body.correctedIndividualId() /** - * Returns the raw JSON value of [correctedData]. + * The corrected routing number. * - * Unlike [correctedData], this method doesn't throw if the JSON field has an unexpected type. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). */ - fun _correctedData(): JsonField = body._correctedData() + fun correctedRoutingNumber(): Optional = body.correctedRoutingNumber() + + /** + * Returns the raw JSON value of [correctedAccountFunding]. + * + * Unlike [correctedAccountFunding], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _correctedAccountFunding(): JsonField = + body._correctedAccountFunding() + + /** + * Returns the raw JSON value of [correctedAccountNumber]. + * + * Unlike [correctedAccountNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _correctedAccountNumber(): JsonField = body._correctedAccountNumber() + + /** + * Returns the raw JSON value of [correctedIndividualId]. + * + * Unlike [correctedIndividualId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _correctedIndividualId(): JsonField = body._correctedIndividualId() + + /** + * Returns the raw JSON value of [correctedRoutingNumber]. + * + * Unlike [correctedRoutingNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + fun _correctedRoutingNumber(): JsonField = body._correctedRoutingNumber() fun _additionalBodyProperties(): Map = body._additionalProperties() @@ -75,15 +110,11 @@ private constructor( companion object { + @JvmStatic fun none(): AchTransferCreateNotificationOfChangeParams = builder().build() + /** * Returns a mutable builder for constructing an instance of * [AchTransferCreateNotificationOfChangeParams]. - * - * The following fields are required: - * ```java - * .changeCode() - * .correctedData() - * ``` */ @JvmStatic fun builder() = Builder() } @@ -120,35 +151,76 @@ private constructor( * * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: - * - [changeCode] - * - [correctedData] + * - [correctedAccountFunding] + * - [correctedAccountNumber] + * - [correctedIndividualId] + * - [correctedRoutingNumber] */ fun body(body: Body) = apply { this.body = body.toBuilder() } - /** The reason for the notification of change. */ - fun changeCode(changeCode: ChangeCode) = apply { body.changeCode(changeCode) } + /** The corrected account funding type. */ + fun correctedAccountFunding(correctedAccountFunding: CorrectedAccountFunding) = apply { + body.correctedAccountFunding(correctedAccountFunding) + } + + /** + * Sets [Builder.correctedAccountFunding] to an arbitrary JSON value. + * + * You should usually call [Builder.correctedAccountFunding] with a well-typed + * [CorrectedAccountFunding] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun correctedAccountFunding(correctedAccountFunding: JsonField) = + apply { + body.correctedAccountFunding(correctedAccountFunding) + } + + /** The corrected account number. */ + fun correctedAccountNumber(correctedAccountNumber: String) = apply { + body.correctedAccountNumber(correctedAccountNumber) + } + + /** + * Sets [Builder.correctedAccountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.correctedAccountNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun correctedAccountNumber(correctedAccountNumber: JsonField) = apply { + body.correctedAccountNumber(correctedAccountNumber) + } + + /** The corrected individual identifier. */ + fun correctedIndividualId(correctedIndividualId: String) = apply { + body.correctedIndividualId(correctedIndividualId) + } /** - * Sets [Builder.changeCode] to an arbitrary JSON value. + * Sets [Builder.correctedIndividualId] to an arbitrary JSON value. * - * You should usually call [Builder.changeCode] with a well-typed [ChangeCode] value + * You should usually call [Builder.correctedIndividualId] with a well-typed [String] value * instead. This method is primarily for setting the field to an undocumented or not yet * supported value. */ - fun changeCode(changeCode: JsonField) = apply { body.changeCode(changeCode) } + fun correctedIndividualId(correctedIndividualId: JsonField) = apply { + body.correctedIndividualId(correctedIndividualId) + } - /** The corrected data for the notification of change (e.g., a new routing number). */ - fun correctedData(correctedData: String) = apply { body.correctedData(correctedData) } + /** The corrected routing number. */ + fun correctedRoutingNumber(correctedRoutingNumber: String) = apply { + body.correctedRoutingNumber(correctedRoutingNumber) + } /** - * Sets [Builder.correctedData] to an arbitrary JSON value. + * Sets [Builder.correctedRoutingNumber] to an arbitrary JSON value. * - * You should usually call [Builder.correctedData] 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.correctedRoutingNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun correctedData(correctedData: JsonField) = apply { - body.correctedData(correctedData) + fun correctedRoutingNumber(correctedRoutingNumber: JsonField) = apply { + body.correctedRoutingNumber(correctedRoutingNumber) } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { @@ -272,14 +344,6 @@ private constructor( * Returns an immutable instance of [AchTransferCreateNotificationOfChangeParams]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .changeCode() - * .correctedData() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ fun build(): AchTransferCreateNotificationOfChangeParams = AchTransferCreateNotificationOfChangeParams( @@ -305,55 +369,110 @@ private constructor( class Body @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val changeCode: JsonField, - private val correctedData: JsonField, + private val correctedAccountFunding: JsonField, + private val correctedAccountNumber: JsonField, + private val correctedIndividualId: JsonField, + private val correctedRoutingNumber: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("change_code") + @JsonProperty("corrected_account_funding") @ExcludeMissing - changeCode: JsonField = JsonMissing.of(), - @JsonProperty("corrected_data") + correctedAccountFunding: JsonField = JsonMissing.of(), + @JsonProperty("corrected_account_number") @ExcludeMissing - correctedData: JsonField = JsonMissing.of(), - ) : this(changeCode, correctedData, mutableMapOf()) + correctedAccountNumber: JsonField = JsonMissing.of(), + @JsonProperty("corrected_individual_id") + @ExcludeMissing + correctedIndividualId: JsonField = JsonMissing.of(), + @JsonProperty("corrected_routing_number") + @ExcludeMissing + correctedRoutingNumber: JsonField = JsonMissing.of(), + ) : this( + correctedAccountFunding, + correctedAccountNumber, + correctedIndividualId, + correctedRoutingNumber, + mutableMapOf(), + ) + + /** + * The corrected account funding type. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun correctedAccountFunding(): Optional = + correctedAccountFunding.getOptional("corrected_account_funding") + + /** + * The corrected account number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun correctedAccountNumber(): Optional = + correctedAccountNumber.getOptional("corrected_account_number") + + /** + * The corrected individual identifier. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun correctedIndividualId(): Optional = + correctedIndividualId.getOptional("corrected_individual_id") + + /** + * The corrected routing number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun correctedRoutingNumber(): Optional = + correctedRoutingNumber.getOptional("corrected_routing_number") /** - * The reason for the notification of change. + * Returns the raw JSON value of [correctedAccountFunding]. * - * @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 [correctedAccountFunding], this method doesn't throw if the JSON field has an + * unexpected type. */ - fun changeCode(): ChangeCode = changeCode.getRequired("change_code") + @JsonProperty("corrected_account_funding") + @ExcludeMissing + fun _correctedAccountFunding(): JsonField = correctedAccountFunding /** - * The corrected data for the notification of change (e.g., a new routing number). + * Returns the raw JSON value of [correctedAccountNumber]. * - * @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 [correctedAccountNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - fun correctedData(): String = correctedData.getRequired("corrected_data") + @JsonProperty("corrected_account_number") + @ExcludeMissing + fun _correctedAccountNumber(): JsonField = correctedAccountNumber /** - * Returns the raw JSON value of [changeCode]. + * Returns the raw JSON value of [correctedIndividualId]. * - * Unlike [changeCode], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [correctedIndividualId], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JsonProperty("change_code") + @JsonProperty("corrected_individual_id") @ExcludeMissing - fun _changeCode(): JsonField = changeCode + fun _correctedIndividualId(): JsonField = correctedIndividualId /** - * Returns the raw JSON value of [correctedData]. + * Returns the raw JSON value of [correctedRoutingNumber]. * - * Unlike [correctedData], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [correctedRoutingNumber], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JsonProperty("corrected_data") + @JsonProperty("corrected_routing_number") @ExcludeMissing - fun _correctedData(): JsonField = correctedData + fun _correctedRoutingNumber(): JsonField = correctedRoutingNumber @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -369,58 +488,87 @@ private constructor( companion object { - /** - * Returns a mutable builder for constructing an instance of [Body]. - * - * The following fields are required: - * ```java - * .changeCode() - * .correctedData() - * ``` - */ + /** Returns a mutable builder for constructing an instance of [Body]. */ @JvmStatic fun builder() = Builder() } /** A builder for [Body]. */ class Builder internal constructor() { - private var changeCode: JsonField? = null - private var correctedData: JsonField? = null + private var correctedAccountFunding: JsonField = + JsonMissing.of() + private var correctedAccountNumber: JsonField = JsonMissing.of() + private var correctedIndividualId: JsonField = JsonMissing.of() + private var correctedRoutingNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { - changeCode = body.changeCode - correctedData = body.correctedData + correctedAccountFunding = body.correctedAccountFunding + correctedAccountNumber = body.correctedAccountNumber + correctedIndividualId = body.correctedIndividualId + correctedRoutingNumber = body.correctedRoutingNumber additionalProperties = body.additionalProperties.toMutableMap() } - /** The reason for the notification of change. */ - fun changeCode(changeCode: ChangeCode) = changeCode(JsonField.of(changeCode)) + /** The corrected account funding type. */ + fun correctedAccountFunding(correctedAccountFunding: CorrectedAccountFunding) = + correctedAccountFunding(JsonField.of(correctedAccountFunding)) + + /** + * Sets [Builder.correctedAccountFunding] to an arbitrary JSON value. + * + * You should usually call [Builder.correctedAccountFunding] with a well-typed + * [CorrectedAccountFunding] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun correctedAccountFunding( + correctedAccountFunding: JsonField + ) = apply { this.correctedAccountFunding = correctedAccountFunding } + + /** The corrected account number. */ + fun correctedAccountNumber(correctedAccountNumber: String) = + correctedAccountNumber(JsonField.of(correctedAccountNumber)) + + /** + * Sets [Builder.correctedAccountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.correctedAccountNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun correctedAccountNumber(correctedAccountNumber: JsonField) = apply { + this.correctedAccountNumber = correctedAccountNumber + } + + /** The corrected individual identifier. */ + fun correctedIndividualId(correctedIndividualId: String) = + correctedIndividualId(JsonField.of(correctedIndividualId)) /** - * Sets [Builder.changeCode] to an arbitrary JSON value. + * Sets [Builder.correctedIndividualId] to an arbitrary JSON value. * - * You should usually call [Builder.changeCode] with a well-typed [ChangeCode] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. + * You should usually call [Builder.correctedIndividualId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. */ - fun changeCode(changeCode: JsonField) = apply { - this.changeCode = changeCode + fun correctedIndividualId(correctedIndividualId: JsonField) = apply { + this.correctedIndividualId = correctedIndividualId } - /** The corrected data for the notification of change (e.g., a new routing number). */ - fun correctedData(correctedData: String) = correctedData(JsonField.of(correctedData)) + /** The corrected routing number. */ + fun correctedRoutingNumber(correctedRoutingNumber: String) = + correctedRoutingNumber(JsonField.of(correctedRoutingNumber)) /** - * Sets [Builder.correctedData] to an arbitrary JSON value. + * Sets [Builder.correctedRoutingNumber] to an arbitrary JSON value. * - * You should usually call [Builder.correctedData] 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.correctedRoutingNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. */ - fun correctedData(correctedData: JsonField) = apply { - this.correctedData = correctedData + fun correctedRoutingNumber(correctedRoutingNumber: JsonField) = apply { + this.correctedRoutingNumber = correctedRoutingNumber } fun additionalProperties(additionalProperties: Map) = apply { @@ -446,19 +594,13 @@ private constructor( * Returns an immutable instance of [Body]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .changeCode() - * .correctedData() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ fun build(): Body = Body( - checkRequired("changeCode", changeCode), - checkRequired("correctedData", correctedData), + correctedAccountFunding, + correctedAccountNumber, + correctedIndividualId, + correctedRoutingNumber, additionalProperties.toMutableMap(), ) } @@ -479,8 +621,10 @@ private constructor( return@apply } - changeCode().validate() - correctedData() + correctedAccountFunding().ifPresent { it.validate() } + correctedAccountNumber() + correctedIndividualId() + correctedRoutingNumber() validated = true } @@ -500,8 +644,10 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (changeCode.asKnown().getOrNull()?.validity() ?: 0) + - (if (correctedData.asKnown().isPresent) 1 else 0) + (correctedAccountFunding.asKnown().getOrNull()?.validity() ?: 0) + + (if (correctedAccountNumber.asKnown().isPresent) 1 else 0) + + (if (correctedIndividualId.asKnown().isPresent) 1 else 0) + + (if (correctedRoutingNumber.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -509,23 +655,33 @@ private constructor( } return other is Body && - changeCode == other.changeCode && - correctedData == other.correctedData && + correctedAccountFunding == other.correctedAccountFunding && + correctedAccountNumber == other.correctedAccountNumber && + correctedIndividualId == other.correctedIndividualId && + correctedRoutingNumber == other.correctedRoutingNumber && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(changeCode, correctedData, additionalProperties) + Objects.hash( + correctedAccountFunding, + correctedAccountNumber, + correctedIndividualId, + correctedRoutingNumber, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{changeCode=$changeCode, correctedData=$correctedData, additionalProperties=$additionalProperties}" + "Body{correctedAccountFunding=$correctedAccountFunding, correctedAccountNumber=$correctedAccountNumber, correctedIndividualId=$correctedIndividualId, correctedRoutingNumber=$correctedRoutingNumber, additionalProperties=$additionalProperties}" } - /** The reason for the notification of change. */ - class ChangeCode @JsonCreator private constructor(private val value: JsonField) : Enum { + /** The corrected account funding type. */ + class CorrectedAccountFunding + @JsonCreator + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -539,214 +695,49 @@ private constructor( companion object { - /** The account number was incorrect. */ - @JvmField val INCORRECT_ACCOUNT_NUMBER = of("incorrect_account_number") - - /** The routing number was incorrect. */ - @JvmField val INCORRECT_ROUTING_NUMBER = of("incorrect_routing_number") - - /** Both the routing number and the account number were incorrect. */ - @JvmField - val INCORRECT_ROUTING_NUMBER_AND_ACCOUNT_NUMBER = - of("incorrect_routing_number_and_account_number") - - /** - * The transaction code was incorrect. Try changing the `funding` parameter from - * checking to savings or vice-versa. - */ - @JvmField val INCORRECT_TRANSACTION_CODE = of("incorrect_transaction_code") - - /** The account number and the transaction code were incorrect. */ - @JvmField - val INCORRECT_ACCOUNT_NUMBER_AND_TRANSACTION_CODE = - of("incorrect_account_number_and_transaction_code") - - /** The routing number, account number, and transaction code were incorrect. */ - @JvmField - val INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE = - of("incorrect_routing_number_account_number_and_transaction_code") - - /** The receiving depository financial institution identification was incorrect. */ - @JvmField - val INCORRECT_RECEIVING_DEPOSITORY_FINANCIAL_INSTITUTION_IDENTIFICATION = - of("incorrect_receiving_depository_financial_institution_identification") - - /** The individual identification number was incorrect. */ - @JvmField - val INCORRECT_INDIVIDUAL_IDENTIFICATION_NUMBER = - of("incorrect_individual_identification_number") - - /** The addenda had an incorrect format. */ - @JvmField val ADDENDA_FORMAT_ERROR = of("addenda_format_error") - - /** - * The standard entry class code was incorrect for an outbound international payment. - */ - @JvmField - val INCORRECT_STANDARD_ENTRY_CLASS_CODE_FOR_OUTBOUND_INTERNATIONAL_PAYMENT = - of("incorrect_standard_entry_class_code_for_outbound_international_payment") - - /** The notification of change was misrouted. */ - @JvmField val MISROUTED_NOTIFICATION_OF_CHANGE = of("misrouted_notification_of_change") - - /** The trace number was incorrect. */ - @JvmField val INCORRECT_TRACE_NUMBER = of("incorrect_trace_number") + /** A checking account. */ + @JvmField val CHECKING = of("checking") - /** The company identification number was incorrect. */ - @JvmField - val INCORRECT_COMPANY_IDENTIFICATION_NUMBER = - of("incorrect_company_identification_number") + /** A savings account. */ + @JvmField val SAVINGS = of("savings") - /** The individual identification number or identification number was incorrect. */ - @JvmField val INCORRECT_IDENTIFICATION_NUMBER = of("incorrect_identification_number") + /** A bank's general ledger. Uncommon. */ + @JvmField val GENERAL_LEDGER = of("general_ledger") - /** The corrected data was incorrectly formatted. */ - @JvmField - val INCORRECTLY_FORMATTED_CORRECTED_DATA = of("incorrectly_formatted_corrected_data") - - /** The discretionary data was incorrect. */ - @JvmField val INCORRECT_DISCRETIONARY_DATA = of("incorrect_discretionary_data") - - /** The routing number was not from the original entry detail record. */ - @JvmField - val ROUTING_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD = - of("routing_number_not_from_original_entry_detail_record") - - /** - * The depository financial institution account number was not from the original entry - * detail record. - */ - @JvmField - val DEPOSITORY_FINANCIAL_INSTITUTION_ACCOUNT_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD = - of( - "depository_financial_institution_account_number_not_from_original_entry_detail_record" - ) - - /** - * The transaction code was incorrect, initiated by the originating depository financial - * institution. - */ - @JvmField - val INCORRECT_TRANSACTION_CODE_BY_ORIGINATING_DEPOSITORY_FINANCIAL_INSTITUTION = - of("incorrect_transaction_code_by_originating_depository_financial_institution") - - @JvmStatic fun of(value: String) = ChangeCode(JsonField.of(value)) + @JvmStatic fun of(value: String) = CorrectedAccountFunding(JsonField.of(value)) } - /** An enum containing [ChangeCode]'s known values. */ + /** An enum containing [CorrectedAccountFunding]'s known values. */ enum class Known { - /** The account number was incorrect. */ - INCORRECT_ACCOUNT_NUMBER, - /** The routing number was incorrect. */ - INCORRECT_ROUTING_NUMBER, - /** Both the routing number and the account number were incorrect. */ - INCORRECT_ROUTING_NUMBER_AND_ACCOUNT_NUMBER, - /** - * The transaction code was incorrect. Try changing the `funding` parameter from - * checking to savings or vice-versa. - */ - INCORRECT_TRANSACTION_CODE, - /** The account number and the transaction code were incorrect. */ - INCORRECT_ACCOUNT_NUMBER_AND_TRANSACTION_CODE, - /** The routing number, account number, and transaction code were incorrect. */ - INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE, - /** The receiving depository financial institution identification was incorrect. */ - INCORRECT_RECEIVING_DEPOSITORY_FINANCIAL_INSTITUTION_IDENTIFICATION, - /** The individual identification number was incorrect. */ - INCORRECT_INDIVIDUAL_IDENTIFICATION_NUMBER, - /** The addenda had an incorrect format. */ - ADDENDA_FORMAT_ERROR, - /** - * The standard entry class code was incorrect for an outbound international payment. - */ - INCORRECT_STANDARD_ENTRY_CLASS_CODE_FOR_OUTBOUND_INTERNATIONAL_PAYMENT, - /** The notification of change was misrouted. */ - MISROUTED_NOTIFICATION_OF_CHANGE, - /** The trace number was incorrect. */ - INCORRECT_TRACE_NUMBER, - /** The company identification number was incorrect. */ - INCORRECT_COMPANY_IDENTIFICATION_NUMBER, - /** The individual identification number or identification number was incorrect. */ - INCORRECT_IDENTIFICATION_NUMBER, - /** The corrected data was incorrectly formatted. */ - INCORRECTLY_FORMATTED_CORRECTED_DATA, - /** The discretionary data was incorrect. */ - INCORRECT_DISCRETIONARY_DATA, - /** The routing number was not from the original entry detail record. */ - ROUTING_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD, - /** - * The depository financial institution account number was not from the original entry - * detail record. - */ - DEPOSITORY_FINANCIAL_INSTITUTION_ACCOUNT_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD, - /** - * The transaction code was incorrect, initiated by the originating depository financial - * institution. - */ - INCORRECT_TRANSACTION_CODE_BY_ORIGINATING_DEPOSITORY_FINANCIAL_INSTITUTION, + /** A checking account. */ + CHECKING, + /** A savings account. */ + SAVINGS, + /** A bank's general ledger. Uncommon. */ + GENERAL_LEDGER, } /** - * An enum containing [ChangeCode]'s known values, as well as an [_UNKNOWN] member. + * An enum containing [CorrectedAccountFunding]'s known values, as well as an [_UNKNOWN] + * member. * - * An instance of [ChangeCode] can contain an unknown value in a couple of cases: + * An instance of [CorrectedAccountFunding] 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 account number was incorrect. */ - INCORRECT_ACCOUNT_NUMBER, - /** The routing number was incorrect. */ - INCORRECT_ROUTING_NUMBER, - /** Both the routing number and the account number were incorrect. */ - INCORRECT_ROUTING_NUMBER_AND_ACCOUNT_NUMBER, - /** - * The transaction code was incorrect. Try changing the `funding` parameter from - * checking to savings or vice-versa. - */ - INCORRECT_TRANSACTION_CODE, - /** The account number and the transaction code were incorrect. */ - INCORRECT_ACCOUNT_NUMBER_AND_TRANSACTION_CODE, - /** The routing number, account number, and transaction code were incorrect. */ - INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE, - /** The receiving depository financial institution identification was incorrect. */ - INCORRECT_RECEIVING_DEPOSITORY_FINANCIAL_INSTITUTION_IDENTIFICATION, - /** The individual identification number was incorrect. */ - INCORRECT_INDIVIDUAL_IDENTIFICATION_NUMBER, - /** The addenda had an incorrect format. */ - ADDENDA_FORMAT_ERROR, - /** - * The standard entry class code was incorrect for an outbound international payment. - */ - INCORRECT_STANDARD_ENTRY_CLASS_CODE_FOR_OUTBOUND_INTERNATIONAL_PAYMENT, - /** The notification of change was misrouted. */ - MISROUTED_NOTIFICATION_OF_CHANGE, - /** The trace number was incorrect. */ - INCORRECT_TRACE_NUMBER, - /** The company identification number was incorrect. */ - INCORRECT_COMPANY_IDENTIFICATION_NUMBER, - /** The individual identification number or identification number was incorrect. */ - INCORRECT_IDENTIFICATION_NUMBER, - /** The corrected data was incorrectly formatted. */ - INCORRECTLY_FORMATTED_CORRECTED_DATA, - /** The discretionary data was incorrect. */ - INCORRECT_DISCRETIONARY_DATA, - /** The routing number was not from the original entry detail record. */ - ROUTING_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD, - /** - * The depository financial institution account number was not from the original entry - * detail record. - */ - DEPOSITORY_FINANCIAL_INSTITUTION_ACCOUNT_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD, - /** - * The transaction code was incorrect, initiated by the originating depository financial - * institution. - */ - INCORRECT_TRANSACTION_CODE_BY_ORIGINATING_DEPOSITORY_FINANCIAL_INSTITUTION, + /** A checking account. */ + CHECKING, + /** A savings account. */ + SAVINGS, + /** A bank's general ledger. Uncommon. */ + GENERAL_LEDGER, /** - * An enum member indicating that [ChangeCode] was instantiated with an unknown value. + * An enum member indicating that [CorrectedAccountFunding] was instantiated with an + * unknown value. */ _UNKNOWN, } @@ -760,36 +751,9 @@ private constructor( */ fun value(): Value = when (this) { - INCORRECT_ACCOUNT_NUMBER -> Value.INCORRECT_ACCOUNT_NUMBER - INCORRECT_ROUTING_NUMBER -> Value.INCORRECT_ROUTING_NUMBER - INCORRECT_ROUTING_NUMBER_AND_ACCOUNT_NUMBER -> - Value.INCORRECT_ROUTING_NUMBER_AND_ACCOUNT_NUMBER - INCORRECT_TRANSACTION_CODE -> Value.INCORRECT_TRANSACTION_CODE - INCORRECT_ACCOUNT_NUMBER_AND_TRANSACTION_CODE -> - Value.INCORRECT_ACCOUNT_NUMBER_AND_TRANSACTION_CODE - INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE -> - Value.INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE - INCORRECT_RECEIVING_DEPOSITORY_FINANCIAL_INSTITUTION_IDENTIFICATION -> - Value.INCORRECT_RECEIVING_DEPOSITORY_FINANCIAL_INSTITUTION_IDENTIFICATION - INCORRECT_INDIVIDUAL_IDENTIFICATION_NUMBER -> - Value.INCORRECT_INDIVIDUAL_IDENTIFICATION_NUMBER - ADDENDA_FORMAT_ERROR -> Value.ADDENDA_FORMAT_ERROR - INCORRECT_STANDARD_ENTRY_CLASS_CODE_FOR_OUTBOUND_INTERNATIONAL_PAYMENT -> - Value.INCORRECT_STANDARD_ENTRY_CLASS_CODE_FOR_OUTBOUND_INTERNATIONAL_PAYMENT - MISROUTED_NOTIFICATION_OF_CHANGE -> Value.MISROUTED_NOTIFICATION_OF_CHANGE - INCORRECT_TRACE_NUMBER -> Value.INCORRECT_TRACE_NUMBER - INCORRECT_COMPANY_IDENTIFICATION_NUMBER -> - Value.INCORRECT_COMPANY_IDENTIFICATION_NUMBER - INCORRECT_IDENTIFICATION_NUMBER -> Value.INCORRECT_IDENTIFICATION_NUMBER - INCORRECTLY_FORMATTED_CORRECTED_DATA -> Value.INCORRECTLY_FORMATTED_CORRECTED_DATA - INCORRECT_DISCRETIONARY_DATA -> Value.INCORRECT_DISCRETIONARY_DATA - ROUTING_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD -> - Value.ROUTING_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD - DEPOSITORY_FINANCIAL_INSTITUTION_ACCOUNT_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD -> - Value - .DEPOSITORY_FINANCIAL_INSTITUTION_ACCOUNT_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD - INCORRECT_TRANSACTION_CODE_BY_ORIGINATING_DEPOSITORY_FINANCIAL_INSTITUTION -> - Value.INCORRECT_TRANSACTION_CODE_BY_ORIGINATING_DEPOSITORY_FINANCIAL_INSTITUTION + CHECKING -> Value.CHECKING + SAVINGS -> Value.SAVINGS + GENERAL_LEDGER -> Value.GENERAL_LEDGER else -> Value._UNKNOWN } @@ -804,37 +768,11 @@ private constructor( */ fun known(): Known = when (this) { - INCORRECT_ACCOUNT_NUMBER -> Known.INCORRECT_ACCOUNT_NUMBER - INCORRECT_ROUTING_NUMBER -> Known.INCORRECT_ROUTING_NUMBER - INCORRECT_ROUTING_NUMBER_AND_ACCOUNT_NUMBER -> - Known.INCORRECT_ROUTING_NUMBER_AND_ACCOUNT_NUMBER - INCORRECT_TRANSACTION_CODE -> Known.INCORRECT_TRANSACTION_CODE - INCORRECT_ACCOUNT_NUMBER_AND_TRANSACTION_CODE -> - Known.INCORRECT_ACCOUNT_NUMBER_AND_TRANSACTION_CODE - INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE -> - Known.INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE - INCORRECT_RECEIVING_DEPOSITORY_FINANCIAL_INSTITUTION_IDENTIFICATION -> - Known.INCORRECT_RECEIVING_DEPOSITORY_FINANCIAL_INSTITUTION_IDENTIFICATION - INCORRECT_INDIVIDUAL_IDENTIFICATION_NUMBER -> - Known.INCORRECT_INDIVIDUAL_IDENTIFICATION_NUMBER - ADDENDA_FORMAT_ERROR -> Known.ADDENDA_FORMAT_ERROR - INCORRECT_STANDARD_ENTRY_CLASS_CODE_FOR_OUTBOUND_INTERNATIONAL_PAYMENT -> - Known.INCORRECT_STANDARD_ENTRY_CLASS_CODE_FOR_OUTBOUND_INTERNATIONAL_PAYMENT - MISROUTED_NOTIFICATION_OF_CHANGE -> Known.MISROUTED_NOTIFICATION_OF_CHANGE - INCORRECT_TRACE_NUMBER -> Known.INCORRECT_TRACE_NUMBER - INCORRECT_COMPANY_IDENTIFICATION_NUMBER -> - Known.INCORRECT_COMPANY_IDENTIFICATION_NUMBER - INCORRECT_IDENTIFICATION_NUMBER -> Known.INCORRECT_IDENTIFICATION_NUMBER - INCORRECTLY_FORMATTED_CORRECTED_DATA -> Known.INCORRECTLY_FORMATTED_CORRECTED_DATA - INCORRECT_DISCRETIONARY_DATA -> Known.INCORRECT_DISCRETIONARY_DATA - ROUTING_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD -> - Known.ROUTING_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD - DEPOSITORY_FINANCIAL_INSTITUTION_ACCOUNT_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD -> - Known - .DEPOSITORY_FINANCIAL_INSTITUTION_ACCOUNT_NUMBER_NOT_FROM_ORIGINAL_ENTRY_DETAIL_RECORD - INCORRECT_TRANSACTION_CODE_BY_ORIGINATING_DEPOSITORY_FINANCIAL_INSTITUTION -> - Known.INCORRECT_TRANSACTION_CODE_BY_ORIGINATING_DEPOSITORY_FINANCIAL_INSTITUTION - else -> throw IncreaseInvalidDataException("Unknown ChangeCode: $value") + CHECKING -> Known.CHECKING + SAVINGS -> Known.SAVINGS + GENERAL_LEDGER -> Known.GENERAL_LEDGER + else -> + throw IncreaseInvalidDataException("Unknown CorrectedAccountFunding: $value") } /** @@ -862,7 +800,7 @@ private constructor( * @throws IncreaseInvalidDataException if any value type in this object doesn't match its * expected type. */ - fun validate(): ChangeCode = apply { + fun validate(): CorrectedAccountFunding = apply { if (validated) { return@apply } @@ -892,7 +830,7 @@ private constructor( return true } - return other is ChangeCode && value == other.value + return other is CorrectedAccountFunding && value == other.value } override fun hashCode() = value.hashCode() diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/AchTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/AchTransferServiceAsync.kt index cc39f6076..9935141f2 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/AchTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/AchTransferServiceAsync.kt @@ -70,16 +70,17 @@ interface AchTransferServiceAsync { acknowledge(achTransferId, AchTransferAcknowledgeParams.none(), requestOptions) /** Simulates receiving a Notification of Change for an [ACH Transfer](#ach-transfers). */ - fun createNotificationOfChange( - achTransferId: String, - params: AchTransferCreateNotificationOfChangeParams, - ): CompletableFuture = - createNotificationOfChange(achTransferId, params, RequestOptions.none()) + fun createNotificationOfChange(achTransferId: String): CompletableFuture = + createNotificationOfChange( + achTransferId, + AchTransferCreateNotificationOfChangeParams.none(), + ) /** @see createNotificationOfChange */ fun createNotificationOfChange( achTransferId: String, - params: AchTransferCreateNotificationOfChangeParams, + params: AchTransferCreateNotificationOfChangeParams = + AchTransferCreateNotificationOfChangeParams.none(), requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture = createNotificationOfChange( @@ -89,8 +90,11 @@ interface AchTransferServiceAsync { /** @see createNotificationOfChange */ fun createNotificationOfChange( - params: AchTransferCreateNotificationOfChangeParams - ): CompletableFuture = createNotificationOfChange(params, RequestOptions.none()) + achTransferId: String, + params: AchTransferCreateNotificationOfChangeParams = + AchTransferCreateNotificationOfChangeParams.none(), + ): CompletableFuture = + createNotificationOfChange(achTransferId, params, RequestOptions.none()) /** @see createNotificationOfChange */ fun createNotificationOfChange( @@ -98,6 +102,22 @@ interface AchTransferServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + /** @see createNotificationOfChange */ + fun createNotificationOfChange( + params: AchTransferCreateNotificationOfChangeParams + ): CompletableFuture = createNotificationOfChange(params, RequestOptions.none()) + + /** @see createNotificationOfChange */ + fun createNotificationOfChange( + achTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + createNotificationOfChange( + achTransferId, + AchTransferCreateNotificationOfChangeParams.none(), + requestOptions, + ) + /** * Simulates the return of an [ACH Transfer](#ach-transfers) by the Federal Reserve due to an * error condition. This will also create a Transaction to account for the returned funds. This @@ -285,15 +305,18 @@ interface AchTransferServiceAsync { * otherwise the same as [AchTransferServiceAsync.createNotificationOfChange]. */ fun createNotificationOfChange( - achTransferId: String, - params: AchTransferCreateNotificationOfChangeParams, + achTransferId: String ): CompletableFuture> = - createNotificationOfChange(achTransferId, params, RequestOptions.none()) + createNotificationOfChange( + achTransferId, + AchTransferCreateNotificationOfChangeParams.none(), + ) /** @see createNotificationOfChange */ fun createNotificationOfChange( achTransferId: String, - params: AchTransferCreateNotificationOfChangeParams, + params: AchTransferCreateNotificationOfChangeParams = + AchTransferCreateNotificationOfChangeParams.none(), requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> = createNotificationOfChange( @@ -303,9 +326,11 @@ interface AchTransferServiceAsync { /** @see createNotificationOfChange */ fun createNotificationOfChange( - params: AchTransferCreateNotificationOfChangeParams + achTransferId: String, + params: AchTransferCreateNotificationOfChangeParams = + AchTransferCreateNotificationOfChangeParams.none(), ): CompletableFuture> = - createNotificationOfChange(params, RequestOptions.none()) + createNotificationOfChange(achTransferId, params, RequestOptions.none()) /** @see createNotificationOfChange */ fun createNotificationOfChange( @@ -313,6 +338,23 @@ interface AchTransferServiceAsync { requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> + /** @see createNotificationOfChange */ + fun createNotificationOfChange( + params: AchTransferCreateNotificationOfChangeParams + ): CompletableFuture> = + createNotificationOfChange(params, RequestOptions.none()) + + /** @see createNotificationOfChange */ + fun createNotificationOfChange( + achTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + createNotificationOfChange( + achTransferId, + AchTransferCreateNotificationOfChangeParams.none(), + requestOptions, + ) + /** * Returns a raw HTTP response for `post * /simulations/ach_transfers/{ach_transfer_id}/return`, but is otherwise the same as diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/AchTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/AchTransferService.kt index 6c13f8897..d366a8a0c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/AchTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/AchTransferService.kt @@ -67,15 +67,17 @@ interface AchTransferService { acknowledge(achTransferId, AchTransferAcknowledgeParams.none(), requestOptions) /** Simulates receiving a Notification of Change for an [ACH Transfer](#ach-transfers). */ - fun createNotificationOfChange( - achTransferId: String, - params: AchTransferCreateNotificationOfChangeParams, - ): AchTransfer = createNotificationOfChange(achTransferId, params, RequestOptions.none()) + fun createNotificationOfChange(achTransferId: String): AchTransfer = + createNotificationOfChange( + achTransferId, + AchTransferCreateNotificationOfChangeParams.none(), + ) /** @see createNotificationOfChange */ fun createNotificationOfChange( achTransferId: String, - params: AchTransferCreateNotificationOfChangeParams, + params: AchTransferCreateNotificationOfChangeParams = + AchTransferCreateNotificationOfChangeParams.none(), requestOptions: RequestOptions = RequestOptions.none(), ): AchTransfer = createNotificationOfChange( @@ -85,8 +87,10 @@ interface AchTransferService { /** @see createNotificationOfChange */ fun createNotificationOfChange( - params: AchTransferCreateNotificationOfChangeParams - ): AchTransfer = createNotificationOfChange(params, RequestOptions.none()) + achTransferId: String, + params: AchTransferCreateNotificationOfChangeParams = + AchTransferCreateNotificationOfChangeParams.none(), + ): AchTransfer = createNotificationOfChange(achTransferId, params, RequestOptions.none()) /** @see createNotificationOfChange */ fun createNotificationOfChange( @@ -94,6 +98,22 @@ interface AchTransferService { requestOptions: RequestOptions = RequestOptions.none(), ): AchTransfer + /** @see createNotificationOfChange */ + fun createNotificationOfChange( + params: AchTransferCreateNotificationOfChangeParams + ): AchTransfer = createNotificationOfChange(params, RequestOptions.none()) + + /** @see createNotificationOfChange */ + fun createNotificationOfChange( + achTransferId: String, + requestOptions: RequestOptions, + ): AchTransfer = + createNotificationOfChange( + achTransferId, + AchTransferCreateNotificationOfChangeParams.none(), + requestOptions, + ) + /** * Simulates the return of an [ACH Transfer](#ach-transfers) by the Federal Reserve due to an * error condition. This will also create a Transaction to account for the returned funds. This @@ -270,17 +290,18 @@ interface AchTransferService { * otherwise the same as [AchTransferService.createNotificationOfChange]. */ @MustBeClosed - fun createNotificationOfChange( - achTransferId: String, - params: AchTransferCreateNotificationOfChangeParams, - ): HttpResponseFor = - createNotificationOfChange(achTransferId, params, RequestOptions.none()) + fun createNotificationOfChange(achTransferId: String): HttpResponseFor = + createNotificationOfChange( + achTransferId, + AchTransferCreateNotificationOfChangeParams.none(), + ) /** @see createNotificationOfChange */ @MustBeClosed fun createNotificationOfChange( achTransferId: String, - params: AchTransferCreateNotificationOfChangeParams, + params: AchTransferCreateNotificationOfChangeParams = + AchTransferCreateNotificationOfChangeParams.none(), requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor = createNotificationOfChange( @@ -291,8 +312,11 @@ interface AchTransferService { /** @see createNotificationOfChange */ @MustBeClosed fun createNotificationOfChange( - params: AchTransferCreateNotificationOfChangeParams - ): HttpResponseFor = createNotificationOfChange(params, RequestOptions.none()) + achTransferId: String, + params: AchTransferCreateNotificationOfChangeParams = + AchTransferCreateNotificationOfChangeParams.none(), + ): HttpResponseFor = + createNotificationOfChange(achTransferId, params, RequestOptions.none()) /** @see createNotificationOfChange */ @MustBeClosed @@ -301,6 +325,24 @@ interface AchTransferService { requestOptions: RequestOptions = RequestOptions.none(), ): HttpResponseFor + /** @see createNotificationOfChange */ + @MustBeClosed + fun createNotificationOfChange( + params: AchTransferCreateNotificationOfChangeParams + ): HttpResponseFor = createNotificationOfChange(params, RequestOptions.none()) + + /** @see createNotificationOfChange */ + @MustBeClosed + fun createNotificationOfChange( + achTransferId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + createNotificationOfChange( + achTransferId, + AchTransferCreateNotificationOfChangeParams.none(), + requestOptions, + ) + /** * Returns a raw HTTP response for `post * /simulations/ach_transfers/{ach_transfer_id}/return`, but is otherwise the same as diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageResponseTest.kt index c1aa8ba67..765fd55e3 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageResponseTest.kt @@ -34,9 +34,15 @@ internal class AchPrenotificationListPageResponseTest { AchPrenotification.NotificationsOfChange.builder() .changeCode( AchPrenotification.NotificationsOfChange.ChangeCode - .INCORRECT_TRANSACTION_CODE + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE ) - .correctedData("32") + .correctedAccountFunding( + AchPrenotification.NotificationsOfChange.CorrectedAccountFunding + .CHECKING + ) + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) @@ -81,9 +87,15 @@ internal class AchPrenotificationListPageResponseTest { AchPrenotification.NotificationsOfChange.builder() .changeCode( AchPrenotification.NotificationsOfChange.ChangeCode - .INCORRECT_TRANSACTION_CODE + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE + ) + .correctedAccountFunding( + AchPrenotification.NotificationsOfChange.CorrectedAccountFunding + .CHECKING ) - .correctedData("32") + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) @@ -132,9 +144,15 @@ internal class AchPrenotificationListPageResponseTest { AchPrenotification.NotificationsOfChange.builder() .changeCode( AchPrenotification.NotificationsOfChange.ChangeCode - .INCORRECT_TRANSACTION_CODE + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE + ) + .correctedAccountFunding( + AchPrenotification.NotificationsOfChange.CorrectedAccountFunding + .CHECKING ) - .correctedData("32") + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationTest.kt index 33893262a..c2d691a85 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationTest.kt @@ -32,9 +32,15 @@ internal class AchPrenotificationTest { AchPrenotification.NotificationsOfChange.builder() .changeCode( AchPrenotification.NotificationsOfChange.ChangeCode - .INCORRECT_TRANSACTION_CODE + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE ) - .correctedData("32") + .correctedAccountFunding( + AchPrenotification.NotificationsOfChange.CorrectedAccountFunding + .CHECKING + ) + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) @@ -77,9 +83,14 @@ internal class AchPrenotificationTest { AchPrenotification.NotificationsOfChange.builder() .changeCode( AchPrenotification.NotificationsOfChange.ChangeCode - .INCORRECT_TRANSACTION_CODE + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE + ) + .correctedAccountFunding( + AchPrenotification.NotificationsOfChange.CorrectedAccountFunding.CHECKING ) - .correctedData("32") + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) @@ -123,9 +134,15 @@ internal class AchPrenotificationTest { AchPrenotification.NotificationsOfChange.builder() .changeCode( AchPrenotification.NotificationsOfChange.ChangeCode - .INCORRECT_TRANSACTION_CODE + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE + ) + .correctedAccountFunding( + AchPrenotification.NotificationsOfChange.CorrectedAccountFunding + .CHECKING ) - .correctedData("32") + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) 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 6dff39ee7..2b3660f37 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 @@ -116,9 +116,15 @@ internal class AchTransferListPageResponseTest { AchTransfer.NotificationsOfChange.builder() .changeCode( AchTransfer.NotificationsOfChange.ChangeCode - .INCORRECT_TRANSACTION_CODE + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE ) - .correctedData("32") + .correctedAccountFunding( + AchTransfer.NotificationsOfChange.CorrectedAccountFunding + .CHECKING + ) + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) @@ -277,9 +283,14 @@ internal class AchTransferListPageResponseTest { AchTransfer.NotificationsOfChange.builder() .changeCode( AchTransfer.NotificationsOfChange.ChangeCode - .INCORRECT_TRANSACTION_CODE + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE + ) + .correctedAccountFunding( + AchTransfer.NotificationsOfChange.CorrectedAccountFunding.CHECKING ) - .correctedData("32") + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) @@ -440,9 +451,15 @@ internal class AchTransferListPageResponseTest { AchTransfer.NotificationsOfChange.builder() .changeCode( AchTransfer.NotificationsOfChange.ChangeCode - .INCORRECT_TRANSACTION_CODE + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE + ) + .correctedAccountFunding( + AchTransfer.NotificationsOfChange.CorrectedAccountFunding + .CHECKING ) - .correctedData("32") + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) 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 1c4d52ad7..ba775b116 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 @@ -107,9 +107,15 @@ internal class AchTransferTest { .addNotificationsOfChange( AchTransfer.NotificationsOfChange.builder() .changeCode( - AchTransfer.NotificationsOfChange.ChangeCode.INCORRECT_TRANSACTION_CODE + AchTransfer.NotificationsOfChange.ChangeCode + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE ) - .correctedData("32") + .correctedAccountFunding( + AchTransfer.NotificationsOfChange.CorrectedAccountFunding.CHECKING + ) + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) @@ -255,9 +261,15 @@ internal class AchTransferTest { .containsExactly( AchTransfer.NotificationsOfChange.builder() .changeCode( - AchTransfer.NotificationsOfChange.ChangeCode.INCORRECT_TRANSACTION_CODE + AchTransfer.NotificationsOfChange.ChangeCode + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE + ) + .correctedAccountFunding( + AchTransfer.NotificationsOfChange.CorrectedAccountFunding.CHECKING ) - .correctedData("32") + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) @@ -407,9 +419,15 @@ internal class AchTransferTest { .addNotificationsOfChange( AchTransfer.NotificationsOfChange.builder() .changeCode( - AchTransfer.NotificationsOfChange.ChangeCode.INCORRECT_TRANSACTION_CODE + AchTransfer.NotificationsOfChange.ChangeCode + .INCORRECT_ROUTING_NUMBER_ACCOUNT_NUMBER_AND_TRANSACTION_CODE + ) + .correctedAccountFunding( + AchTransfer.NotificationsOfChange.CorrectedAccountFunding.CHECKING ) - .correctedData("32") + .correctedAccountNumber("987654321") + .correctedIndividualId(null) + .correctedRoutingNumber("123456789") .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/achtransfers/AchTransferCreateNotificationOfChangeParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/achtransfers/AchTransferCreateNotificationOfChangeParamsTest.kt index 89471939e..96ce4932f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/achtransfers/AchTransferCreateNotificationOfChangeParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/achtransfers/AchTransferCreateNotificationOfChangeParamsTest.kt @@ -11,10 +11,12 @@ internal class AchTransferCreateNotificationOfChangeParamsTest { fun create() { AchTransferCreateNotificationOfChangeParams.builder() .achTransferId("ach_transfer_uoxatyh3lt5evrsdvo7q") - .changeCode( - AchTransferCreateNotificationOfChangeParams.ChangeCode.INCORRECT_ROUTING_NUMBER + .correctedAccountFunding( + AchTransferCreateNotificationOfChangeParams.CorrectedAccountFunding.CHECKING ) - .correctedData("123456789") + .correctedAccountNumber("x") + .correctedIndividualId("x") + .correctedRoutingNumber("123456789") .build() } @@ -23,10 +25,6 @@ internal class AchTransferCreateNotificationOfChangeParamsTest { val params = AchTransferCreateNotificationOfChangeParams.builder() .achTransferId("ach_transfer_uoxatyh3lt5evrsdvo7q") - .changeCode( - AchTransferCreateNotificationOfChangeParams.ChangeCode.INCORRECT_ROUTING_NUMBER - ) - .correctedData("123456789") .build() assertThat(params._pathParam(0)).isEqualTo("ach_transfer_uoxatyh3lt5evrsdvo7q") @@ -39,18 +37,30 @@ internal class AchTransferCreateNotificationOfChangeParamsTest { val params = AchTransferCreateNotificationOfChangeParams.builder() .achTransferId("ach_transfer_uoxatyh3lt5evrsdvo7q") - .changeCode( - AchTransferCreateNotificationOfChangeParams.ChangeCode.INCORRECT_ROUTING_NUMBER + .correctedAccountFunding( + AchTransferCreateNotificationOfChangeParams.CorrectedAccountFunding.CHECKING ) - .correctedData("123456789") + .correctedAccountNumber("x") + .correctedIndividualId("x") + .correctedRoutingNumber("123456789") .build() val body = params._body() - assertThat(body.changeCode()) - .isEqualTo( - AchTransferCreateNotificationOfChangeParams.ChangeCode.INCORRECT_ROUTING_NUMBER - ) - assertThat(body.correctedData()).isEqualTo("123456789") + assertThat(body.correctedAccountFunding()) + .contains(AchTransferCreateNotificationOfChangeParams.CorrectedAccountFunding.CHECKING) + assertThat(body.correctedAccountNumber()).contains("x") + assertThat(body.correctedIndividualId()).contains("x") + assertThat(body.correctedRoutingNumber()).contains("123456789") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + AchTransferCreateNotificationOfChangeParams.builder() + .achTransferId("ach_transfer_uoxatyh3lt5evrsdvo7q") + .build() + + val body = params._body() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/AchTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/AchTransferServiceAsyncTest.kt index 01ede4cce..1b3dd7052 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/AchTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/AchTransferServiceAsyncTest.kt @@ -42,11 +42,12 @@ internal class AchTransferServiceAsyncTest { achTransferServiceAsync.createNotificationOfChange( AchTransferCreateNotificationOfChangeParams.builder() .achTransferId("ach_transfer_uoxatyh3lt5evrsdvo7q") - .changeCode( - AchTransferCreateNotificationOfChangeParams.ChangeCode - .INCORRECT_ROUTING_NUMBER + .correctedAccountFunding( + AchTransferCreateNotificationOfChangeParams.CorrectedAccountFunding.CHECKING ) - .correctedData("123456789") + .correctedAccountNumber("x") + .correctedIndividualId("x") + .correctedRoutingNumber("123456789") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/AchTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/AchTransferServiceTest.kt index bffba47d1..92645d310 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/AchTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/AchTransferServiceTest.kt @@ -40,11 +40,12 @@ internal class AchTransferServiceTest { achTransferService.createNotificationOfChange( AchTransferCreateNotificationOfChangeParams.builder() .achTransferId("ach_transfer_uoxatyh3lt5evrsdvo7q") - .changeCode( - AchTransferCreateNotificationOfChangeParams.ChangeCode - .INCORRECT_ROUTING_NUMBER + .correctedAccountFunding( + AchTransferCreateNotificationOfChangeParams.CorrectedAccountFunding.CHECKING ) - .correctedData("123456789") + .correctedAccountNumber("x") + .correctedIndividualId("x") + .correctedRoutingNumber("123456789") .build() )