From ede9159b3ee898ef71ec407192cdfa9ade3339bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 15:57:20 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +- .../inboundmailitems/InboundMailItem.kt | 200 +++++++++++++++++- .../InboundMailItemListPageResponseTest.kt | 6 + .../inboundmailitems/InboundMailItemTest.kt | 6 + 4 files changed, 210 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index f961ed3c7..4b31e9820 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-029ea9e6c4067d483991aa9c3f62773ffaf56ac0b765749983afc182074e834d.yml -openapi_spec_hash: 4b3f58b1324441e24b4c2b4dfa391d74 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-0cbadaf8bea9237be21194a1039047af135bbcec657db6fc9d6b6697a17c2e37.yml +openapi_spec_hash: dbffc2b4874015f957526d1086861435 config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItem.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItem.kt index 774cda56d..426a2c8ff 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItem.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItem.kt @@ -523,6 +523,7 @@ private constructor( private val backFileId: JsonField, private val checkDepositId: JsonField, private val frontFileId: JsonField, + private val status: JsonField, private val additionalProperties: MutableMap, ) { @@ -538,7 +539,8 @@ private constructor( @JsonProperty("front_file_id") @ExcludeMissing frontFileId: JsonField = JsonMissing.of(), - ) : this(amount, backFileId, checkDepositId, frontFileId, mutableMapOf()) + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + ) : this(amount, backFileId, checkDepositId, frontFileId, status, mutableMapOf()) /** * The amount of the check. @@ -572,6 +574,14 @@ private constructor( */ fun frontFileId(): Optional = frontFileId.getOptional("front_file_id") + /** + * The status of the Inbound Mail Item Check. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun status(): Optional = status.getOptional("status") + /** * Returns the raw JSON value of [amount]. * @@ -607,6 +617,13 @@ private constructor( @ExcludeMissing fun _frontFileId(): JsonField = frontFileId + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -630,6 +647,7 @@ private constructor( * .backFileId() * .checkDepositId() * .frontFileId() + * .status() * ``` */ @JvmStatic fun builder() = Builder() @@ -642,6 +660,7 @@ private constructor( private var backFileId: JsonField? = null private var checkDepositId: JsonField? = null private var frontFileId: JsonField? = null + private var status: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -650,6 +669,7 @@ private constructor( backFileId = check.backFileId checkDepositId = check.checkDepositId frontFileId = check.frontFileId + status = check.status additionalProperties = check.additionalProperties.toMutableMap() } @@ -716,6 +736,21 @@ private constructor( this.frontFileId = frontFileId } + /** The status of the Inbound Mail Item Check. */ + fun status(status: Status?) = status(JsonField.ofNullable(status)) + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -746,6 +781,7 @@ private constructor( * .backFileId() * .checkDepositId() * .frontFileId() + * .status() * ``` * * @throws IllegalStateException if any required field is unset. @@ -756,6 +792,7 @@ private constructor( checkRequired("backFileId", backFileId), checkRequired("checkDepositId", checkDepositId), checkRequired("frontFileId", frontFileId), + checkRequired("status", status), additionalProperties.toMutableMap(), ) } @@ -771,6 +808,7 @@ private constructor( backFileId() checkDepositId() frontFileId() + status().ifPresent { it.validate() } validated = true } @@ -793,7 +831,153 @@ private constructor( (if (amount.asKnown().isPresent) 1 else 0) + (if (backFileId.asKnown().isPresent) 1 else 0) + (if (checkDepositId.asKnown().isPresent) 1 else 0) + - (if (frontFileId.asKnown().isPresent) 1 else 0) + (if (frontFileId.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + /** The status of the Inbound Mail Item Check. */ + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** The check is pending processing. */ + @JvmField val PENDING = of("pending") + + /** The check has been deposited. */ + @JvmField val DEPOSITED = of("deposited") + + /** The check has been ignored. */ + @JvmField val IGNORED = of("ignored") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + /** The check is pending processing. */ + PENDING, + /** The check has been deposited. */ + DEPOSITED, + /** The check has been ignored. */ + IGNORED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** The check is pending processing. */ + PENDING, + /** The check has been deposited. */ + DEPOSITED, + /** The check has been ignored. */ + IGNORED, + /** + * An enum member indicating that [Status] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PENDING -> Value.PENDING + DEPOSITED -> Value.DEPOSITED + IGNORED -> Value.IGNORED + 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) { + PENDING -> Known.PENDING + DEPOSITED -> Known.DEPOSITED + IGNORED -> Known.IGNORED + else -> throw IncreaseInvalidDataException("Unknown Status: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -805,17 +989,25 @@ private constructor( backFileId == other.backFileId && checkDepositId == other.checkDepositId && frontFileId == other.frontFileId && + status == other.status && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(amount, backFileId, checkDepositId, frontFileId, additionalProperties) + Objects.hash( + amount, + backFileId, + checkDepositId, + frontFileId, + status, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "Check{amount=$amount, backFileId=$backFileId, checkDepositId=$checkDepositId, frontFileId=$frontFileId, additionalProperties=$additionalProperties}" + "Check{amount=$amount, backFileId=$backFileId, checkDepositId=$checkDepositId, frontFileId=$frontFileId, status=$status, additionalProperties=$additionalProperties}" } /** If the mail item has been rejected, why it was rejected. */ diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt index 34bf62465..768d45eb6 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt @@ -23,6 +23,7 @@ internal class InboundMailItemListPageResponseTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build() ) .addCheck( @@ -31,6 +32,7 @@ internal class InboundMailItemListPageResponseTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build() ) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -55,6 +57,7 @@ internal class InboundMailItemListPageResponseTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build() ) .addCheck( @@ -63,6 +66,7 @@ internal class InboundMailItemListPageResponseTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build() ) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -91,6 +95,7 @@ internal class InboundMailItemListPageResponseTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build() ) .addCheck( @@ -99,6 +104,7 @@ internal class InboundMailItemListPageResponseTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build() ) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemTest.kt index be3d0bd6f..e5d1e5996 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemTest.kt @@ -21,6 +21,7 @@ internal class InboundMailItemTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build() ) .addCheck( @@ -29,6 +30,7 @@ internal class InboundMailItemTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build() ) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -48,12 +50,14 @@ internal class InboundMailItemTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build(), InboundMailItem.Check.builder() .amount(1750L) .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build(), ) assertThat(inboundMailItem.createdAt()) @@ -78,6 +82,7 @@ internal class InboundMailItemTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build() ) .addCheck( @@ -86,6 +91,7 @@ internal class InboundMailItemTest { .backFileId("file_makxrc67oh9l6sg7w9yc") .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1") .frontFileId("file_makxrc67oh9l6sg7w9yc") + .status(InboundMailItem.Check.Status.DEPOSITED) .build() ) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) From b474ef73ae0304a962b9da8499ee7888dd161430 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 15:57:47 +0000 Subject: [PATCH 2/2] release: 0.356.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 8eb45f64c..d4af9aa61 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.355.0" + ".": "0.356.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a1730d96..2395847be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.356.0 (2025-11-07) + +Full Changelog: [v0.355.0...v0.356.0](https://github.com/Increase/increase-java/compare/v0.355.0...v0.356.0) + +### Features + +* **api:** api update ([ede9159](https://github.com/Increase/increase-java/commit/ede9159b3ee898ef71ec407192cdfa9ade3339bb)) + ## 0.355.0 (2025-11-07) Full Changelog: [v0.354.0...v0.355.0](https://github.com/Increase/increase-java/compare/v0.354.0...v0.355.0) diff --git a/README.md b/README.md index 10eaea161..5184e2324 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.355.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.355.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.355.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.356.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.356.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.356.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.355.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.356.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.355.0") +implementation("com.increase.api:increase-java:0.356.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.355.0") com.increase.api increase-java - 0.355.0 + 0.356.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 56df3bf58..8d0c1406a 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.355.0" // x-release-please-version + version = "0.356.0" // x-release-please-version } subprojects {