diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d260e00dd..878ea368c 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.435.0" + ".": "0.436.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index b138946e6..c4189e824 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 232 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-5a71b48efd87b38f1e7fd01e83a58b902b2c262b2606c4bf8e1ad0d7f562772e.yml -openapi_spec_hash: a159f26827b08d4900b7b354854535c7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-27bb508e6a503f797a19506901c8f0116f970947741708bcebd38a1399ef7f23.yml +openapi_spec_hash: c92a7ed16b42e192b8201ce5ffe73dc1 config_hash: b881baa4e0bc537d0caf02152712bd28 diff --git a/CHANGELOG.md b/CHANGELOG.md index 738f0b61d..55b330aae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.436.0 (2026-03-02) + +Full Changelog: [v0.435.0...v0.436.0](https://github.com/Increase/increase-java/compare/v0.435.0...v0.436.0) + +### Features + +* **api:** api update ([2688518](https://github.com/Increase/increase-java/commit/2688518152fa6f14ca5f3149ce8e189207e0912c)) + ## 0.435.0 (2026-02-25) Full Changelog: [v0.434.0...v0.435.0](https://github.com/Increase/increase-java/compare/v0.434.0...v0.435.0) diff --git a/README.md b/README.md index 638071c00..befd40e82 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.435.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.435.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.435.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.436.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.436.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.436.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.435.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.436.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.435.0") +implementation("com.increase.api:increase-java:0.436.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.435.0") com.increase.api increase-java - 0.435.0 + 0.436.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index f59e31b38..63fd9775b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.435.0" // x-release-please-version + version = "0.436.0" // x-release-please-version } subprojects { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt index 31f19507e..7c19f7b1c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt @@ -33,6 +33,7 @@ private constructor( private val amount: JsonField, private val createdAt: JsonField, private val createdBy: JsonField, + private val creditorAddress: JsonField, private val creditorName: JsonField, private val currency: JsonField, private val debtorName: JsonField, @@ -68,6 +69,9 @@ private constructor( @JsonProperty("created_by") @ExcludeMissing createdBy: JsonField = JsonMissing.of(), + @JsonProperty("creditor_address") + @ExcludeMissing + creditorAddress: JsonField = JsonMissing.of(), @JsonProperty("creditor_name") @ExcludeMissing creditorName: JsonField = JsonMissing.of(), @@ -115,6 +119,7 @@ private constructor( amount, createdAt, createdBy, + creditorAddress, creditorName, currency, debtorName, @@ -192,6 +197,15 @@ private constructor( */ fun createdBy(): Optional = createdBy.getOptional("created_by") + /** + * The creditor's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun creditorAddress(): Optional = + creditorAddress.getOptional("creditor_address") + /** * The name of the transfer's recipient. This is set by the sender when creating the transfer. * @@ -379,6 +393,15 @@ private constructor( */ @JsonProperty("created_by") @ExcludeMissing fun _createdBy(): JsonField = createdBy + /** + * Returns the raw JSON value of [creditorAddress]. + * + * Unlike [creditorAddress], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("creditor_address") + @ExcludeMissing + fun _creditorAddress(): JsonField = creditorAddress + /** * Returns the raw JSON value of [creditorName]. * @@ -536,6 +559,7 @@ private constructor( * .amount() * .createdAt() * .createdBy() + * .creditorAddress() * .creditorName() * .currency() * .debtorName() @@ -566,6 +590,7 @@ private constructor( private var amount: JsonField? = null private var createdAt: JsonField? = null private var createdBy: JsonField? = null + private var creditorAddress: JsonField? = null private var creditorName: JsonField? = null private var currency: JsonField? = null private var debtorName: JsonField? = null @@ -592,6 +617,7 @@ private constructor( amount = fednowTransfer.amount createdAt = fednowTransfer.createdAt createdBy = fednowTransfer.createdBy + creditorAddress = fednowTransfer.creditorAddress creditorName = fednowTransfer.creditorName currency = fednowTransfer.currency debtorName = fednowTransfer.debtorName @@ -710,6 +736,25 @@ private constructor( */ fun createdBy(createdBy: JsonField) = apply { this.createdBy = createdBy } + /** The creditor's address. */ + fun creditorAddress(creditorAddress: CreditorAddress?) = + creditorAddress(JsonField.ofNullable(creditorAddress)) + + /** Alias for calling [Builder.creditorAddress] with `creditorAddress.orElse(null)`. */ + fun creditorAddress(creditorAddress: Optional) = + creditorAddress(creditorAddress.getOrNull()) + + /** + * Sets [Builder.creditorAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorAddress] with a well-typed [CreditorAddress] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun creditorAddress(creditorAddress: JsonField) = apply { + this.creditorAddress = creditorAddress + } + /** * The name of the transfer's recipient. This is set by the sender when creating the * transfer. @@ -994,6 +1039,7 @@ private constructor( * .amount() * .createdAt() * .createdBy() + * .creditorAddress() * .creditorName() * .currency() * .debtorName() @@ -1022,6 +1068,7 @@ private constructor( checkRequired("amount", amount), checkRequired("createdAt", createdAt), checkRequired("createdBy", createdBy), + checkRequired("creditorAddress", creditorAddress), checkRequired("creditorName", creditorName), checkRequired("currency", currency), checkRequired("debtorName", debtorName), @@ -1061,6 +1108,7 @@ private constructor( amount() createdAt() createdBy().ifPresent { it.validate() } + creditorAddress().ifPresent { it.validate() } creditorName() currency().validate() debtorName() @@ -1101,6 +1149,7 @@ private constructor( (if (amount.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (createdBy.asKnown().getOrNull()?.validity() ?: 0) + + (creditorAddress.asKnown().getOrNull()?.validity() ?: 0) + (if (creditorName.asKnown().isPresent) 1 else 0) + (currency.asKnown().getOrNull()?.validity() ?: 0) + (if (debtorName.asKnown().isPresent) 1 else 0) + @@ -2237,6 +2286,297 @@ private constructor( "CreatedBy{category=$category, apiKey=$apiKey, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } + /** The creditor's address. */ + class CreditorAddress + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val city: JsonField, + private val line1: JsonField, + private val postalCode: JsonField, + private val state: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("city") @ExcludeMissing city: JsonField = JsonMissing.of(), + @JsonProperty("line1") @ExcludeMissing line1: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + postalCode: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(), + ) : this(city, line1, postalCode, state, mutableMapOf()) + + /** + * The city, district, town, or village of the address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun city(): Optional = city.getOptional("city") + + /** + * The first line of the address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun line1(): Optional = line1.getOptional("line1") + + /** + * The ZIP code of the address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun postalCode(): Optional = postalCode.getOptional("postal_code") + + /** + * The address state. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun state(): Optional = state.getOptional("state") + + /** + * Returns the raw JSON value of [city]. + * + * Unlike [city], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("city") @ExcludeMissing fun _city(): JsonField = city + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + /** + * Returns the raw JSON value of [postalCode]. + * + * Unlike [postalCode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("postal_code") + @ExcludeMissing + fun _postalCode(): JsonField = postalCode + + /** + * Returns the raw JSON value of [state]. + * + * Unlike [state], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CreditorAddress]. + * + * The following fields are required: + * ```java + * .city() + * .line1() + * .postalCode() + * .state() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreditorAddress]. */ + class Builder internal constructor() { + + private var city: JsonField? = null + private var line1: JsonField? = null + private var postalCode: JsonField? = null + private var state: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(creditorAddress: CreditorAddress) = apply { + city = creditorAddress.city + line1 = creditorAddress.line1 + postalCode = creditorAddress.postalCode + state = creditorAddress.state + additionalProperties = creditorAddress.additionalProperties.toMutableMap() + } + + /** The city, district, town, or village of the address. */ + fun city(city: String?) = city(JsonField.ofNullable(city)) + + /** Alias for calling [Builder.city] with `city.orElse(null)`. */ + fun city(city: Optional) = city(city.getOrNull()) + + /** + * Sets [Builder.city] to an arbitrary JSON value. + * + * You should usually call [Builder.city] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun city(city: JsonField) = apply { this.city = city } + + /** The first line of the address. */ + fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) + + /** Alias for calling [Builder.line1] with `line1.orElse(null)`. */ + fun line1(line1: Optional) = line1(line1.getOrNull()) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** The ZIP code of the address. */ + fun postalCode(postalCode: String?) = postalCode(JsonField.ofNullable(postalCode)) + + /** Alias for calling [Builder.postalCode] with `postalCode.orElse(null)`. */ + fun postalCode(postalCode: Optional) = postalCode(postalCode.getOrNull()) + + /** + * Sets [Builder.postalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.postalCode] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } + + /** The address state. */ + fun state(state: String?) = state(JsonField.ofNullable(state)) + + /** Alias for calling [Builder.state] with `state.orElse(null)`. */ + fun state(state: Optional) = state(state.getOrNull()) + + /** + * Sets [Builder.state] to an arbitrary JSON value. + * + * You should usually call [Builder.state] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun state(state: JsonField) = apply { this.state = state } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [CreditorAddress]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .city() + * .line1() + * .postalCode() + * .state() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CreditorAddress = + CreditorAddress( + checkRequired("city", city), + checkRequired("line1", line1), + checkRequired("postalCode", postalCode), + checkRequired("state", state), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CreditorAddress = apply { + if (validated) { + return@apply + } + + city() + line1() + postalCode() + state() + 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 (city.asKnown().isPresent) 1 else 0) + + (if (line1.asKnown().isPresent) 1 else 0) + + (if (postalCode.asKnown().isPresent) 1 else 0) + + (if (state.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreditorAddress && + city == other.city && + line1 == other.line1 && + postalCode == other.postalCode && + state == other.state && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(city, line1, postalCode, state, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreditorAddress{city=$city, line1=$line1, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" + } + /** * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For * FedNow transfers this is always equal to `USD`. @@ -3610,6 +3950,7 @@ private constructor( amount == other.amount && createdAt == other.createdAt && createdBy == other.createdBy && + creditorAddress == other.creditorAddress && creditorName == other.creditorName && currency == other.currency && debtorName == other.debtorName && @@ -3637,6 +3978,7 @@ private constructor( amount, createdAt, createdBy, + creditorAddress, creditorName, currency, debtorName, @@ -3659,5 +4001,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "FednowTransfer{id=$id, accountId=$accountId, accountNumber=$accountNumber, acknowledgement=$acknowledgement, amount=$amount, createdAt=$createdAt, createdBy=$createdBy, creditorName=$creditorName, currency=$currency, debtorName=$debtorName, externalAccountId=$externalAccountId, idempotencyKey=$idempotencyKey, pendingTransactionId=$pendingTransactionId, rejection=$rejection, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, status=$status, submission=$submission, transactionId=$transactionId, type=$type, uniqueEndToEndTransactionReference=$uniqueEndToEndTransactionReference, unstructuredRemittanceInformation=$unstructuredRemittanceInformation, additionalProperties=$additionalProperties}" + "FednowTransfer{id=$id, accountId=$accountId, accountNumber=$accountNumber, acknowledgement=$acknowledgement, amount=$amount, createdAt=$createdAt, createdBy=$createdBy, creditorAddress=$creditorAddress, creditorName=$creditorName, currency=$currency, debtorName=$debtorName, externalAccountId=$externalAccountId, idempotencyKey=$idempotencyKey, pendingTransactionId=$pendingTransactionId, rejection=$rejection, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, status=$status, submission=$submission, transactionId=$transactionId, type=$type, uniqueEndToEndTransactionReference=$uniqueEndToEndTransactionReference, unstructuredRemittanceInformation=$unstructuredRemittanceInformation, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt index c9f9fd040..365bbde56 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt @@ -46,6 +46,14 @@ internal class FednowTransferListPageResponseTest { ) .build() ) + .creditorAddress( + FednowTransfer.CreditorAddress.builder() + .city("New York") + .line1("33 Liberty Street") + .postalCode("10045") + .state("NY") + .build() + ) .creditorName("Ian Crease") .currency(FednowTransfer.Currency.USD) .debtorName("National Phonograph Company") @@ -110,6 +118,14 @@ internal class FednowTransferListPageResponseTest { ) .build() ) + .creditorAddress( + FednowTransfer.CreditorAddress.builder() + .city("New York") + .line1("33 Liberty Street") + .postalCode("10045") + .state("NY") + .build() + ) .creditorName("Ian Crease") .currency(FednowTransfer.Currency.USD) .debtorName("National Phonograph Company") @@ -178,6 +194,14 @@ internal class FednowTransferListPageResponseTest { ) .build() ) + .creditorAddress( + FednowTransfer.CreditorAddress.builder() + .city("New York") + .line1("33 Liberty Street") + .postalCode("10045") + .state("NY") + .build() + ) .creditorName("Ian Crease") .currency(FednowTransfer.Currency.USD) .debtorName("National Phonograph Company") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt index 4b6c02394..700e9807d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt @@ -42,6 +42,14 @@ internal class FednowTransferTest { ) .build() ) + .creditorAddress( + FednowTransfer.CreditorAddress.builder() + .city("New York") + .line1("33 Liberty Street") + .postalCode("10045") + .state("NY") + .build() + ) .creditorName("Ian Crease") .currency(FednowTransfer.Currency.USD) .debtorName("National Phonograph Company") @@ -95,6 +103,15 @@ internal class FednowTransferTest { .user(FednowTransfer.CreatedBy.User.builder().email("user@example.com").build()) .build() ) + assertThat(fednowTransfer.creditorAddress()) + .contains( + FednowTransfer.CreditorAddress.builder() + .city("New York") + .line1("33 Liberty Street") + .postalCode("10045") + .state("NY") + .build() + ) assertThat(fednowTransfer.creditorName()).isEqualTo("Ian Crease") assertThat(fednowTransfer.currency()).isEqualTo(FednowTransfer.Currency.USD) assertThat(fednowTransfer.debtorName()).isEqualTo("National Phonograph Company") @@ -161,6 +178,14 @@ internal class FednowTransferTest { ) .build() ) + .creditorAddress( + FednowTransfer.CreditorAddress.builder() + .city("New York") + .line1("33 Liberty Street") + .postalCode("10045") + .state("NY") + .build() + ) .creditorName("Ian Crease") .currency(FednowTransfer.Currency.USD) .debtorName("National Phonograph Company")