diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 62c73da10..b1b5a42f0 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.360.0"
+ ".": "0.361.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index e94fde2d8..2cc58976a 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-b6b193549e9c795e807b299e7161628dc1e504d43d6be27113b1f3a1e491914f.yml
-openapi_spec_hash: 9d0ff6cc1ec60a6772598cff20f8db1d
-config_hash: eb2035151c7b49c2f12caf55469b8f9a
+configured_endpoints: 229
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-a0eb4b9ef698e80be2fc9e995d6096b96de35e4985c8586e0773fa55a6b50943.yml
+openapi_spec_hash: a36c0bee01bf3af40ebcd7075308f170
+config_hash: ca1425272e17fa23d4466d33492334fa
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c3fff9572..8f53a451c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.361.0 (2025-11-12)
+
+Full Changelog: [v0.360.0...v0.361.0](https://github.com/Increase/increase-java/compare/v0.360.0...v0.361.0)
+
+### Features
+
+* **api:** api update ([806bd6f](https://github.com/Increase/increase-java/commit/806bd6f3052a3ee354cb9cad48e388594b2bd4d0))
+
## 0.360.0 (2025-11-10)
Full Changelog: [v0.359.0...v0.360.0](https://github.com/Increase/increase-java/compare/v0.359.0...v0.360.0)
diff --git a/README.md b/README.md
index a6ec68295..bfe30e4a3 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.360.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.360.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.361.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.361.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.360.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.361.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.360.0")
+implementation("com.increase.api:increase-java:0.361.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.360.0")
com.increase.api
increase-java
- 0.360.0
+ 0.361.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 63b46d487..20f17a4bf 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.360.0" // x-release-please-version
+ version = "0.361.0" // x-release-please-version
}
subprojects {
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemActionParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemActionParams.kt
new file mode 100644
index 000000000..b9cfa8883
--- /dev/null
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemActionParams.kt
@@ -0,0 +1,804 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.increase.api.models.inboundmailitems
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter
+import com.fasterxml.jackson.annotation.JsonAnySetter
+import com.fasterxml.jackson.annotation.JsonCreator
+import com.fasterxml.jackson.annotation.JsonProperty
+import com.increase.api.core.Enum
+import com.increase.api.core.ExcludeMissing
+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.checkKnown
+import com.increase.api.core.checkRequired
+import com.increase.api.core.http.Headers
+import com.increase.api.core.http.QueryParams
+import com.increase.api.core.toImmutable
+import com.increase.api.errors.IncreaseInvalidDataException
+import java.util.Collections
+import java.util.Objects
+import java.util.Optional
+import kotlin.jvm.optionals.getOrNull
+
+/** Action a Inbound Mail Item */
+class InboundMailItemActionParams
+private constructor(
+ private val inboundMailItemId: String?,
+ private val body: Body,
+ private val additionalHeaders: Headers,
+ private val additionalQueryParams: QueryParams,
+) : Params {
+
+ /** The identifier of the Inbound Mail Item to action. */
+ fun inboundMailItemId(): Optional = Optional.ofNullable(inboundMailItemId)
+
+ /**
+ * The actions to perform on the Inbound Mail Item.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun checks(): List = body.checks()
+
+ /**
+ * Returns the raw JSON value of [checks].
+ *
+ * Unlike [checks], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _checks(): JsonField> = body._checks()
+
+ fun _additionalBodyProperties(): Map = body._additionalProperties()
+
+ /** Additional headers to send with the request. */
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ /** Additional query param to send with the request. */
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [InboundMailItemActionParams].
+ *
+ * The following fields are required:
+ * ```java
+ * .checks()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [InboundMailItemActionParams]. */
+ class Builder internal constructor() {
+
+ private var inboundMailItemId: String? = null
+ private var body: Body.Builder = Body.builder()
+ private var additionalHeaders: Headers.Builder = Headers.builder()
+ private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
+
+ @JvmSynthetic
+ internal fun from(inboundMailItemActionParams: InboundMailItemActionParams) = apply {
+ inboundMailItemId = inboundMailItemActionParams.inboundMailItemId
+ body = inboundMailItemActionParams.body.toBuilder()
+ additionalHeaders = inboundMailItemActionParams.additionalHeaders.toBuilder()
+ additionalQueryParams = inboundMailItemActionParams.additionalQueryParams.toBuilder()
+ }
+
+ /** The identifier of the Inbound Mail Item to action. */
+ fun inboundMailItemId(inboundMailItemId: String?) = apply {
+ this.inboundMailItemId = inboundMailItemId
+ }
+
+ /** Alias for calling [Builder.inboundMailItemId] with `inboundMailItemId.orElse(null)`. */
+ fun inboundMailItemId(inboundMailItemId: Optional) =
+ inboundMailItemId(inboundMailItemId.getOrNull())
+
+ /**
+ * Sets the entire request body.
+ *
+ * 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:
+ * - [checks]
+ */
+ fun body(body: Body) = apply { this.body = body.toBuilder() }
+
+ /** The actions to perform on the Inbound Mail Item. */
+ fun checks(checks: List) = apply { body.checks(checks) }
+
+ /**
+ * Sets [Builder.checks] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.checks] with a well-typed `List` value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun checks(checks: JsonField>) = apply { body.checks(checks) }
+
+ /**
+ * Adds a single [Check] to [checks].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addCheck(check: Check) = apply { body.addCheck(check) }
+
+ fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
+ body.additionalProperties(additionalBodyProperties)
+ }
+
+ fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
+ body.putAdditionalProperty(key, value)
+ }
+
+ fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
+ apply {
+ body.putAllAdditionalProperties(additionalBodyProperties)
+ }
+
+ fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) }
+
+ fun removeAllAdditionalBodyProperties(keys: Set) = apply {
+ body.removeAllAdditionalProperties(keys)
+ }
+
+ fun additionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllAdditionalHeaders(additionalHeaders)
+ }
+
+ fun putAdditionalHeader(name: String, value: String) = apply {
+ additionalHeaders.put(name, value)
+ }
+
+ fun putAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.put(name, values)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.putAll(additionalHeaders)
+ }
+
+ fun replaceAdditionalHeaders(name: String, value: String) = apply {
+ additionalHeaders.replace(name, value)
+ }
+
+ fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
+ additionalHeaders.replace(name, values)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.replaceAll(additionalHeaders)
+ }
+
+ fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
+
+ fun removeAllAdditionalHeaders(names: Set) = apply {
+ additionalHeaders.removeAll(names)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllAdditionalQueryParams(additionalQueryParams)
+ }
+
+ fun putAdditionalQueryParam(key: String, value: String) = apply {
+ additionalQueryParams.put(key, value)
+ }
+
+ fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.put(key, values)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.putAll(additionalQueryParams)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, value: String) = apply {
+ additionalQueryParams.replace(key, value)
+ }
+
+ fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
+ additionalQueryParams.replace(key, values)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
+ apply {
+ this.additionalQueryParams.replaceAll(additionalQueryParams)
+ }
+
+ fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
+
+ fun removeAllAdditionalQueryParams(keys: Set) = apply {
+ additionalQueryParams.removeAll(keys)
+ }
+
+ /**
+ * Returns an immutable instance of [InboundMailItemActionParams].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .checks()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): InboundMailItemActionParams =
+ InboundMailItemActionParams(
+ inboundMailItemId,
+ body.build(),
+ additionalHeaders.build(),
+ additionalQueryParams.build(),
+ )
+ }
+
+ fun _body(): Body = body
+
+ fun _pathParam(index: Int): String =
+ when (index) {
+ 0 -> inboundMailItemId ?: ""
+ else -> ""
+ }
+
+ override fun _headers(): Headers = additionalHeaders
+
+ override fun _queryParams(): QueryParams = additionalQueryParams
+
+ class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val checks: JsonField>,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("checks")
+ @ExcludeMissing
+ checks: JsonField> = JsonMissing.of()
+ ) : this(checks, mutableMapOf())
+
+ /**
+ * The actions to perform on the Inbound Mail Item.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun checks(): List = checks.getRequired("checks")
+
+ /**
+ * Returns the raw JSON value of [checks].
+ *
+ * Unlike [checks], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("checks") @ExcludeMissing fun _checks(): JsonField> = checks
+
+ @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 [Body].
+ *
+ * The following fields are required:
+ * ```java
+ * .checks()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Body]. */
+ class Builder internal constructor() {
+
+ private var checks: JsonField>? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(body: Body) = apply {
+ checks = body.checks.map { it.toMutableList() }
+ additionalProperties = body.additionalProperties.toMutableMap()
+ }
+
+ /** The actions to perform on the Inbound Mail Item. */
+ fun checks(checks: List) = checks(JsonField.of(checks))
+
+ /**
+ * Sets [Builder.checks] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.checks] with a well-typed `List` value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun checks(checks: JsonField>) = apply {
+ this.checks = checks.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [Check] to [checks].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addCheck(check: Check) = apply {
+ checks =
+ (checks ?: JsonField.of(mutableListOf())).also {
+ checkKnown("checks", it).add(check)
+ }
+ }
+
+ 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 [Body].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .checks()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Body =
+ Body(
+ checkRequired("checks", checks).map { it.toImmutable() },
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Body = apply {
+ if (validated) {
+ return@apply
+ }
+
+ checks().forEach { it.validate() }
+ 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 =
+ (checks.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Body &&
+ checks == other.checks &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(checks, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() = "Body{checks=$checks, additionalProperties=$additionalProperties}"
+ }
+
+ class Check
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val action: JsonField,
+ private val account: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("action") @ExcludeMissing action: JsonField = JsonMissing.of(),
+ @JsonProperty("account") @ExcludeMissing account: JsonField = JsonMissing.of(),
+ ) : this(action, account, mutableMapOf())
+
+ /**
+ * The action to perform on the Inbound Mail Item.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun action(): Action = action.getRequired("action")
+
+ /**
+ * The identifier of the Account to deposit the check into. If not provided, the check will
+ * be deposited into the Account associated with the Lockbox.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun account(): Optional = account.getOptional("account")
+
+ /**
+ * Returns the raw JSON value of [action].
+ *
+ * Unlike [action], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("action") @ExcludeMissing fun _action(): JsonField = action
+
+ /**
+ * Returns the raw JSON value of [account].
+ *
+ * Unlike [account], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("account") @ExcludeMissing fun _account(): JsonField = account
+
+ @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 [Check].
+ *
+ * The following fields are required:
+ * ```java
+ * .action()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Check]. */
+ class Builder internal constructor() {
+
+ private var action: JsonField? = null
+ private var account: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(check: Check) = apply {
+ action = check.action
+ account = check.account
+ additionalProperties = check.additionalProperties.toMutableMap()
+ }
+
+ /** The action to perform on the Inbound Mail Item. */
+ fun action(action: Action) = action(JsonField.of(action))
+
+ /**
+ * Sets [Builder.action] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.action] with a well-typed [Action] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun action(action: JsonField) = apply { this.action = action }
+
+ /**
+ * The identifier of the Account to deposit the check into. If not provided, the check
+ * will be deposited into the Account associated with the Lockbox.
+ */
+ fun account(account: String) = account(JsonField.of(account))
+
+ /**
+ * Sets [Builder.account] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.account] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun account(account: JsonField) = apply { this.account = account }
+
+ 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 [Check].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .action()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Check =
+ Check(checkRequired("action", action), account, additionalProperties.toMutableMap())
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Check = apply {
+ if (validated) {
+ return@apply
+ }
+
+ action().validate()
+ account()
+ 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 =
+ (action.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (account.asKnown().isPresent) 1 else 0)
+
+ /** The action to perform on the Inbound Mail Item. */
+ class Action @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 will be deposited. */
+ @JvmField val DEPOSIT = of("deposit")
+
+ /** The check will be ignored. */
+ @JvmField val IGNORE = of("ignore")
+
+ @JvmStatic fun of(value: String) = Action(JsonField.of(value))
+ }
+
+ /** An enum containing [Action]'s known values. */
+ enum class Known {
+ /** The check will be deposited. */
+ DEPOSIT,
+ /** The check will be ignored. */
+ IGNORE,
+ }
+
+ /**
+ * An enum containing [Action]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Action] 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 will be deposited. */
+ DEPOSIT,
+ /** The check will be ignored. */
+ IGNORE,
+ /**
+ * An enum member indicating that [Action] 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) {
+ DEPOSIT -> Value.DEPOSIT
+ IGNORE -> Value.IGNORE
+ 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) {
+ DEPOSIT -> Known.DEPOSIT
+ IGNORE -> Known.IGNORE
+ else -> throw IncreaseInvalidDataException("Unknown Action: $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(): Action = 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 Action && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Check &&
+ action == other.action &&
+ account == other.account &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy { Objects.hash(action, account, additionalProperties) }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Check{action=$action, account=$account, additionalProperties=$additionalProperties}"
+ }
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is InboundMailItemActionParams &&
+ inboundMailItemId == other.inboundMailItemId &&
+ body == other.body &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
+ }
+
+ override fun hashCode(): Int =
+ Objects.hash(inboundMailItemId, body, additionalHeaders, additionalQueryParams)
+
+ override fun toString() =
+ "InboundMailItemActionParams{inboundMailItemId=$inboundMailItemId, body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
+}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/Lockbox.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/Lockbox.kt
index b2a7d061a..68184474c 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/Lockbox.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/Lockbox.kt
@@ -903,6 +903,9 @@ private constructor(
/** Checks mailed to this Lockbox will not be deposited. */
@JvmField val DISABLED = of("disabled")
+ /** Checks mailed to this Lockbox will be pending until actioned. */
+ @JvmField val PEND_FOR_PROCESSING = of("pend_for_processing")
+
@JvmStatic fun of(value: String) = CheckDepositBehavior(JsonField.of(value))
}
@@ -912,6 +915,8 @@ private constructor(
ENABLED,
/** Checks mailed to this Lockbox will not be deposited. */
DISABLED,
+ /** Checks mailed to this Lockbox will be pending until actioned. */
+ PEND_FOR_PROCESSING,
}
/**
@@ -929,6 +934,8 @@ private constructor(
ENABLED,
/** Checks mailed to this Lockbox will not be deposited. */
DISABLED,
+ /** Checks mailed to this Lockbox will be pending until actioned. */
+ PEND_FOR_PROCESSING,
/**
* An enum member indicating that [CheckDepositBehavior] was instantiated with an
* unknown value.
@@ -947,6 +954,7 @@ private constructor(
when (this) {
ENABLED -> Value.ENABLED
DISABLED -> Value.DISABLED
+ PEND_FOR_PROCESSING -> Value.PEND_FOR_PROCESSING
else -> Value._UNKNOWN
}
@@ -963,6 +971,7 @@ private constructor(
when (this) {
ENABLED -> Known.ENABLED
DISABLED -> Known.DISABLED
+ PEND_FOR_PROCESSING -> Known.PEND_FOR_PROCESSING
else -> throw IncreaseInvalidDataException("Unknown CheckDepositBehavior: $value")
}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParams.kt
index 9d4ab6b89..2d0f44494 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParams.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxUpdateParams.kt
@@ -579,6 +579,9 @@ private constructor(
/** Checks mailed to this Lockbox will not be deposited. */
@JvmField val DISABLED = of("disabled")
+ /** Checks mailed to this Lockbox will be pending until actioned. */
+ @JvmField val PEND_FOR_PROCESSING = of("pend_for_processing")
+
@JvmStatic fun of(value: String) = CheckDepositBehavior(JsonField.of(value))
}
@@ -588,6 +591,8 @@ private constructor(
ENABLED,
/** Checks mailed to this Lockbox will not be deposited. */
DISABLED,
+ /** Checks mailed to this Lockbox will be pending until actioned. */
+ PEND_FOR_PROCESSING,
}
/**
@@ -605,6 +610,8 @@ private constructor(
ENABLED,
/** Checks mailed to this Lockbox will not be deposited. */
DISABLED,
+ /** Checks mailed to this Lockbox will be pending until actioned. */
+ PEND_FOR_PROCESSING,
/**
* An enum member indicating that [CheckDepositBehavior] was instantiated with an
* unknown value.
@@ -623,6 +630,7 @@ private constructor(
when (this) {
ENABLED -> Value.ENABLED
DISABLED -> Value.DISABLED
+ PEND_FOR_PROCESSING -> Value.PEND_FOR_PROCESSING
else -> Value._UNKNOWN
}
@@ -639,6 +647,7 @@ private constructor(
when (this) {
ENABLED -> Known.ENABLED
DISABLED -> Known.DISABLED
+ PEND_FOR_PROCESSING -> Known.PEND_FOR_PROCESSING
else -> throw IncreaseInvalidDataException("Unknown CheckDepositBehavior: $value")
}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsync.kt
index 2a5dfdeec..77f3f8ba8 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsync.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsync.kt
@@ -6,6 +6,7 @@ import com.increase.api.core.ClientOptions
import com.increase.api.core.RequestOptions
import com.increase.api.core.http.HttpResponseFor
import com.increase.api.models.inboundmailitems.InboundMailItem
+import com.increase.api.models.inboundmailitems.InboundMailItemActionParams
import com.increase.api.models.inboundmailitems.InboundMailItemListPageAsync
import com.increase.api.models.inboundmailitems.InboundMailItemListParams
import com.increase.api.models.inboundmailitems.InboundMailItemRetrieveParams
@@ -81,6 +82,30 @@ interface InboundMailItemServiceAsync {
fun list(requestOptions: RequestOptions): CompletableFuture =
list(InboundMailItemListParams.none(), requestOptions)
+ /** Action a Inbound Mail Item */
+ fun action(
+ inboundMailItemId: String,
+ params: InboundMailItemActionParams,
+ ): CompletableFuture = action(inboundMailItemId, params, RequestOptions.none())
+
+ /** @see action */
+ fun action(
+ inboundMailItemId: String,
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): CompletableFuture =
+ action(params.toBuilder().inboundMailItemId(inboundMailItemId).build(), requestOptions)
+
+ /** @see action */
+ fun action(params: InboundMailItemActionParams): CompletableFuture =
+ action(params, RequestOptions.none())
+
+ /** @see action */
+ fun action(
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): CompletableFuture
+
/**
* A view of [InboundMailItemServiceAsync] that provides access to raw HTTP responses for each
* method.
@@ -166,5 +191,35 @@ interface InboundMailItemServiceAsync {
requestOptions: RequestOptions
): CompletableFuture> =
list(InboundMailItemListParams.none(), requestOptions)
+
+ /**
+ * Returns a raw HTTP response for `post /inbound_mail_items/{inbound_mail_item_id}/action`,
+ * but is otherwise the same as [InboundMailItemServiceAsync.action].
+ */
+ fun action(
+ inboundMailItemId: String,
+ params: InboundMailItemActionParams,
+ ): CompletableFuture> =
+ action(inboundMailItemId, params, RequestOptions.none())
+
+ /** @see action */
+ fun action(
+ inboundMailItemId: String,
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): CompletableFuture> =
+ action(params.toBuilder().inboundMailItemId(inboundMailItemId).build(), requestOptions)
+
+ /** @see action */
+ fun action(
+ params: InboundMailItemActionParams
+ ): CompletableFuture> =
+ action(params, RequestOptions.none())
+
+ /** @see action */
+ fun action(
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): CompletableFuture>
}
}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncImpl.kt
index 834cbd515..fe75afcc4 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncImpl.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncImpl.kt
@@ -13,9 +13,11 @@ import com.increase.api.core.http.HttpRequest
import com.increase.api.core.http.HttpResponse
import com.increase.api.core.http.HttpResponse.Handler
import com.increase.api.core.http.HttpResponseFor
+import com.increase.api.core.http.json
import com.increase.api.core.http.parseable
import com.increase.api.core.prepareAsync
import com.increase.api.models.inboundmailitems.InboundMailItem
+import com.increase.api.models.inboundmailitems.InboundMailItemActionParams
import com.increase.api.models.inboundmailitems.InboundMailItemListPageAsync
import com.increase.api.models.inboundmailitems.InboundMailItemListPageResponse
import com.increase.api.models.inboundmailitems.InboundMailItemListParams
@@ -52,6 +54,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundMailItem
// get /inbound_mail_items
withRawResponse().list(params, requestOptions).thenApply { it.parse() }
+ override fun action(
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions,
+ ): CompletableFuture =
+ // post /inbound_mail_items/{inbound_mail_item_id}/action
+ withRawResponse().action(params, requestOptions).thenApply { it.parse() }
+
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
InboundMailItemServiceAsync.WithRawResponse {
@@ -135,5 +144,39 @@ internal constructor(private val clientOptions: ClientOptions) : InboundMailItem
}
}
}
+
+ private val actionHandler: Handler =
+ jsonHandler(clientOptions.jsonMapper)
+
+ override fun action(
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions,
+ ): CompletableFuture> {
+ // We check here instead of in the params builder because this can be specified
+ // positionally or in the params class.
+ checkRequired("inboundMailItemId", params.inboundMailItemId().getOrNull())
+ val request =
+ HttpRequest.builder()
+ .method(HttpMethod.POST)
+ .baseUrl(clientOptions.baseUrl())
+ .addPathSegments("inbound_mail_items", params._pathParam(0), "action")
+ .body(json(clientOptions.jsonMapper, params._body()))
+ .build()
+ .prepareAsync(clientOptions, params)
+ val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
+ return request
+ .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) }
+ .thenApply { response ->
+ errorHandler.handle(response).parseable {
+ response
+ .use { actionHandler.handle(it) }
+ .also {
+ if (requestOptions.responseValidation!!) {
+ it.validate()
+ }
+ }
+ }
+ }
+ }
}
}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemService.kt
index 8b406cb32..82e377d95 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemService.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemService.kt
@@ -7,6 +7,7 @@ import com.increase.api.core.ClientOptions
import com.increase.api.core.RequestOptions
import com.increase.api.core.http.HttpResponseFor
import com.increase.api.models.inboundmailitems.InboundMailItem
+import com.increase.api.models.inboundmailitems.InboundMailItemActionParams
import com.increase.api.models.inboundmailitems.InboundMailItemListPage
import com.increase.api.models.inboundmailitems.InboundMailItemListParams
import com.increase.api.models.inboundmailitems.InboundMailItemRetrieveParams
@@ -76,6 +77,28 @@ interface InboundMailItemService {
fun list(requestOptions: RequestOptions): InboundMailItemListPage =
list(InboundMailItemListParams.none(), requestOptions)
+ /** Action a Inbound Mail Item */
+ fun action(inboundMailItemId: String, params: InboundMailItemActionParams): InboundMailItem =
+ action(inboundMailItemId, params, RequestOptions.none())
+
+ /** @see action */
+ fun action(
+ inboundMailItemId: String,
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): InboundMailItem =
+ action(params.toBuilder().inboundMailItemId(inboundMailItemId).build(), requestOptions)
+
+ /** @see action */
+ fun action(params: InboundMailItemActionParams): InboundMailItem =
+ action(params, RequestOptions.none())
+
+ /** @see action */
+ fun action(
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): InboundMailItem
+
/**
* A view of [InboundMailItemService] that provides access to raw HTTP responses for each
* method.
@@ -164,5 +187,37 @@ interface InboundMailItemService {
@MustBeClosed
fun list(requestOptions: RequestOptions): HttpResponseFor =
list(InboundMailItemListParams.none(), requestOptions)
+
+ /**
+ * Returns a raw HTTP response for `post /inbound_mail_items/{inbound_mail_item_id}/action`,
+ * but is otherwise the same as [InboundMailItemService.action].
+ */
+ @MustBeClosed
+ fun action(
+ inboundMailItemId: String,
+ params: InboundMailItemActionParams,
+ ): HttpResponseFor =
+ action(inboundMailItemId, params, RequestOptions.none())
+
+ /** @see action */
+ @MustBeClosed
+ fun action(
+ inboundMailItemId: String,
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): HttpResponseFor =
+ action(params.toBuilder().inboundMailItemId(inboundMailItemId).build(), requestOptions)
+
+ /** @see action */
+ @MustBeClosed
+ fun action(params: InboundMailItemActionParams): HttpResponseFor =
+ action(params, RequestOptions.none())
+
+ /** @see action */
+ @MustBeClosed
+ fun action(
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions = RequestOptions.none(),
+ ): HttpResponseFor
}
}
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemServiceImpl.kt
index ad4a06935..31805785e 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemServiceImpl.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemServiceImpl.kt
@@ -13,9 +13,11 @@ import com.increase.api.core.http.HttpRequest
import com.increase.api.core.http.HttpResponse
import com.increase.api.core.http.HttpResponse.Handler
import com.increase.api.core.http.HttpResponseFor
+import com.increase.api.core.http.json
import com.increase.api.core.http.parseable
import com.increase.api.core.prepare
import com.increase.api.models.inboundmailitems.InboundMailItem
+import com.increase.api.models.inboundmailitems.InboundMailItemActionParams
import com.increase.api.models.inboundmailitems.InboundMailItemListPage
import com.increase.api.models.inboundmailitems.InboundMailItemListPageResponse
import com.increase.api.models.inboundmailitems.InboundMailItemListParams
@@ -49,6 +51,13 @@ class InboundMailItemServiceImpl internal constructor(private val clientOptions:
// get /inbound_mail_items
withRawResponse().list(params, requestOptions).parse()
+ override fun action(
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions,
+ ): InboundMailItem =
+ // post /inbound_mail_items/{inbound_mail_item_id}/action
+ withRawResponse().action(params, requestOptions).parse()
+
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
InboundMailItemService.WithRawResponse {
@@ -125,5 +134,36 @@ class InboundMailItemServiceImpl internal constructor(private val clientOptions:
}
}
}
+
+ private val actionHandler: Handler =
+ jsonHandler(clientOptions.jsonMapper)
+
+ override fun action(
+ params: InboundMailItemActionParams,
+ requestOptions: RequestOptions,
+ ): HttpResponseFor {
+ // We check here instead of in the params builder because this can be specified
+ // positionally or in the params class.
+ checkRequired("inboundMailItemId", params.inboundMailItemId().getOrNull())
+ val request =
+ HttpRequest.builder()
+ .method(HttpMethod.POST)
+ .baseUrl(clientOptions.baseUrl())
+ .addPathSegments("inbound_mail_items", params._pathParam(0), "action")
+ .body(json(clientOptions.jsonMapper, params._body()))
+ .build()
+ .prepare(clientOptions, params)
+ val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions))
+ val response = clientOptions.httpClient.execute(request, requestOptions)
+ return errorHandler.handle(response).parseable {
+ response
+ .use { actionHandler.handle(it) }
+ .also {
+ if (requestOptions.responseValidation!!) {
+ it.validate()
+ }
+ }
+ }
+ }
}
}
diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemActionParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemActionParamsTest.kt
new file mode 100644
index 000000000..ebe304049
--- /dev/null
+++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemActionParamsTest.kt
@@ -0,0 +1,114 @@
+// File generated from our OpenAPI spec by Stainless.
+
+package com.increase.api.models.inboundmailitems
+
+import org.assertj.core.api.Assertions.assertThat
+import org.junit.jupiter.api.Test
+
+internal class InboundMailItemActionParamsTest {
+
+ @Test
+ fun create() {
+ InboundMailItemActionParams.builder()
+ .inboundMailItemId("inbound_mail_item_q6rrg7mmqpplx80zceev")
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.DEPOSIT)
+ .account("account_in71c4amph0vgo2qllky")
+ .build()
+ )
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.IGNORE)
+ .account("account")
+ .build()
+ )
+ .build()
+ }
+
+ @Test
+ fun pathParams() {
+ val params =
+ InboundMailItemActionParams.builder()
+ .inboundMailItemId("inbound_mail_item_q6rrg7mmqpplx80zceev")
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.DEPOSIT)
+ .build()
+ )
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.IGNORE)
+ .build()
+ )
+ .build()
+
+ assertThat(params._pathParam(0)).isEqualTo("inbound_mail_item_q6rrg7mmqpplx80zceev")
+ // out-of-bound path param
+ assertThat(params._pathParam(1)).isEqualTo("")
+ }
+
+ @Test
+ fun body() {
+ val params =
+ InboundMailItemActionParams.builder()
+ .inboundMailItemId("inbound_mail_item_q6rrg7mmqpplx80zceev")
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.DEPOSIT)
+ .account("account_in71c4amph0vgo2qllky")
+ .build()
+ )
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.IGNORE)
+ .account("account")
+ .build()
+ )
+ .build()
+
+ val body = params._body()
+
+ assertThat(body.checks())
+ .containsExactly(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.DEPOSIT)
+ .account("account_in71c4amph0vgo2qllky")
+ .build(),
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.IGNORE)
+ .account("account")
+ .build(),
+ )
+ }
+
+ @Test
+ fun bodyWithoutOptionalFields() {
+ val params =
+ InboundMailItemActionParams.builder()
+ .inboundMailItemId("inbound_mail_item_q6rrg7mmqpplx80zceev")
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.DEPOSIT)
+ .build()
+ )
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.IGNORE)
+ .build()
+ )
+ .build()
+
+ val body = params._body()
+
+ assertThat(body.checks())
+ .containsExactly(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.DEPOSIT)
+ .build(),
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.IGNORE)
+ .build(),
+ )
+ }
+}
diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncTest.kt
index f82d0ae7e..908d760e7 100644
--- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncTest.kt
+++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncTest.kt
@@ -4,6 +4,7 @@ package com.increase.api.services.async
import com.increase.api.TestServerExtension
import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync
+import com.increase.api.models.inboundmailitems.InboundMailItemActionParams
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
@@ -40,4 +41,36 @@ internal class InboundMailItemServiceAsyncTest {
val page = pageFuture.get()
page.response().validate()
}
+
+ @Test
+ fun action() {
+ val client =
+ IncreaseOkHttpClientAsync.builder()
+ .baseUrl(TestServerExtension.BASE_URL)
+ .apiKey("My API Key")
+ .build()
+ val inboundMailItemServiceAsync = client.inboundMailItems()
+
+ val inboundMailItemFuture =
+ inboundMailItemServiceAsync.action(
+ InboundMailItemActionParams.builder()
+ .inboundMailItemId("inbound_mail_item_q6rrg7mmqpplx80zceev")
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.DEPOSIT)
+ .account("account_in71c4amph0vgo2qllky")
+ .build()
+ )
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.IGNORE)
+ .account("account")
+ .build()
+ )
+ .build()
+ )
+
+ val inboundMailItem = inboundMailItemFuture.get()
+ inboundMailItem.validate()
+ }
}
diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundMailItemServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundMailItemServiceTest.kt
index eda00aab8..df84998b1 100644
--- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundMailItemServiceTest.kt
+++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundMailItemServiceTest.kt
@@ -4,6 +4,7 @@ package com.increase.api.services.blocking
import com.increase.api.TestServerExtension
import com.increase.api.client.okhttp.IncreaseOkHttpClient
+import com.increase.api.models.inboundmailitems.InboundMailItemActionParams
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.ExtendWith
@@ -38,4 +39,35 @@ internal class InboundMailItemServiceTest {
page.response().validate()
}
+
+ @Test
+ fun action() {
+ val client =
+ IncreaseOkHttpClient.builder()
+ .baseUrl(TestServerExtension.BASE_URL)
+ .apiKey("My API Key")
+ .build()
+ val inboundMailItemService = client.inboundMailItems()
+
+ val inboundMailItem =
+ inboundMailItemService.action(
+ InboundMailItemActionParams.builder()
+ .inboundMailItemId("inbound_mail_item_q6rrg7mmqpplx80zceev")
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.DEPOSIT)
+ .account("account_in71c4amph0vgo2qllky")
+ .build()
+ )
+ .addCheck(
+ InboundMailItemActionParams.Check.builder()
+ .action(InboundMailItemActionParams.Check.Action.IGNORE)
+ .account("account")
+ .build()
+ )
+ .build()
+ )
+
+ inboundMailItem.validate()
+ }
}