diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 479431d9..e2d3d7d8 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "8.7.0"
+ ".": "8.8.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 6539dd75..14602907 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 48
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch/finch-9a6d840deb9e30caf68354e884cb2c72ff6ca21cfbefb5ed0ca6187932c9cd62.yml
-openapi_spec_hash: ce61ace110680a502bdccf396b2a4d88
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch/finch-d7a5aa80f0d4940c2d9994e1a72d27e0a22ac2431e4dab6354ca628457c7c790.yml
+openapi_spec_hash: ec74d859d1bfd431ea7210f800e02c8d
config_hash: 9ae56f40cec7304896138bfad5caf748
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e04a1cd1..91fcc5db 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,25 @@
# Changelog
+## 8.8.0 (2026-08-17)
+
+Full Changelog: [v8.7.0...v8.8.0](https://github.com/Finch-API/finch-api-java/compare/v8.7.0...v8.8.0)
+
+### Features
+
+* **api:** api update ([03555eb](https://github.com/Finch-API/finch-api-java/commit/03555eb939004a5a749f83e9afe344141002a9f1))
+* **api:** api update ([0694e6c](https://github.com/Finch-API/finch-api-java/commit/0694e6cf508c0f30cde9cabff88b0951f0e6ab0f))
+* **api:** api update ([54deda5](https://github.com/Finch-API/finch-api-java/commit/54deda5ca30f036c9eea43f1db0fea1c213571ff))
+
+
+### Bug Fixes
+
+* **docs:** link the javadoc badge so the version stays current after release ([e47ad45](https://github.com/Finch-API/finch-api-java/commit/e47ad45e7c5aa16e5f628daa3df2f541507c812b))
+
+
+### Chores
+
+* **internal:** codegen related update ([7b1f70e](https://github.com/Finch-API/finch-api-java/commit/7b1f70e596215b9242d0a3b2191bd345eaba9e57))
+
## 8.7.0 (2026-08-07)
Full Changelog: [v8.6.0...v8.7.0](https://github.com/Finch-API/finch-api-java/compare/v8.6.0...v8.7.0)
diff --git a/README.md b/README.md
index 0be7fbb9..3c6d87f6 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/8.7.0)
-[](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.7.0)
+[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/8.8.0)
+[](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.8.0)
@@ -24,7 +24,7 @@ Use the Finch MCP Server to enable AI assistants to interact with this API, allo
-The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.7.0).
+The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/8.8.0).
@@ -35,7 +35,7 @@ The REST API documentation can be found on [developer.tryfinch.com](https://deve
### Gradle
```kotlin
-implementation("com.tryfinch.api:finch-java:8.7.0")
+implementation("com.tryfinch.api:finch-java:8.8.0")
```
### Maven
@@ -44,7 +44,7 @@ implementation("com.tryfinch.api:finch-java:8.7.0")
com.tryfinch.api
finch-java
- 8.7.0
+ 8.8.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 7e818b34..5e0518d0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.tryfinch.api"
- version = "8.7.0" // x-release-please-version
+ version = "8.8.0" // x-release-please-version
}
subprojects {
diff --git a/finch-java-core/build.gradle.kts b/finch-java-core/build.gradle.kts
index d5dc8c35..c5cb7a08 100644
--- a/finch-java-core/build.gradle.kts
+++ b/finch-java-core/build.gradle.kts
@@ -38,4 +38,5 @@ dependencies {
testImplementation("org.mockito:mockito-core:5.14.2")
testImplementation("org.mockito:mockito-junit-jupiter:5.14.2")
testImplementation("org.mockito.kotlin:mockito-kotlin:4.1.0")
+ testImplementation("org.slf4j:slf4j-nop:1.7.36")
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt
index 44aa93b9..68c485f4 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt
@@ -89,6 +89,16 @@ private constructor(
*/
fun minutesToExpire(): Optional = body.minutesToExpire()
+ /**
+ * Optional recordkeeping configuration. Can only be provided when the `recordkeeping` product
+ * is requested. Currently supports `recordkeeper` set to `voya`, `empower`, `fidelity`, or
+ * `transamerica`.
+ *
+ * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun recordkeeping(): Optional = body.recordkeeping()
+
/**
* The URI to redirect to after the Connect flow is completed
*
@@ -154,6 +164,13 @@ private constructor(
*/
fun _minutesToExpire(): JsonField = body._minutesToExpire()
+ /**
+ * Returns the raw JSON value of [recordkeeping].
+ *
+ * Unlike [recordkeeping], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ fun _recordkeeping(): JsonField = body._recordkeeping()
+
/**
* Returns the raw JSON value of [redirectUri].
*
@@ -356,6 +373,30 @@ private constructor(
body.minutesToExpire(minutesToExpire)
}
+ /**
+ * Optional recordkeeping configuration. Can only be provided when the `recordkeeping`
+ * product is requested. Currently supports `recordkeeper` set to `voya`, `empower`,
+ * `fidelity`, or `transamerica`.
+ */
+ fun recordkeeping(recordkeeping: Recordkeeping?) = apply {
+ body.recordkeeping(recordkeeping)
+ }
+
+ /** Alias for calling [Builder.recordkeeping] with `recordkeeping.orElse(null)`. */
+ fun recordkeeping(recordkeeping: Optional) =
+ recordkeeping(recordkeeping.getOrNull())
+
+ /**
+ * Sets [Builder.recordkeeping] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.recordkeeping] with a well-typed [Recordkeeping] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun recordkeeping(recordkeeping: JsonField) = apply {
+ body.recordkeeping(recordkeeping)
+ }
+
/** The URI to redirect to after the Connect flow is completed */
fun redirectUri(redirectUri: String?) = apply { body.redirectUri(redirectUri) }
@@ -540,6 +581,7 @@ private constructor(
private val integration: JsonField,
private val manual: JsonField,
private val minutesToExpire: JsonField,
+ private val recordkeeping: JsonField,
private val redirectUri: JsonField,
private val sandbox: JsonField,
private val additionalProperties: MutableMap,
@@ -566,6 +608,9 @@ private constructor(
@JsonProperty("minutes_to_expire")
@ExcludeMissing
minutesToExpire: JsonField = JsonMissing.of(),
+ @JsonProperty("recordkeeping")
+ @ExcludeMissing
+ recordkeeping: JsonField = JsonMissing.of(),
@JsonProperty("redirect_uri")
@ExcludeMissing
redirectUri: JsonField = JsonMissing.of(),
@@ -578,6 +623,7 @@ private constructor(
integration,
manual,
minutesToExpire,
+ recordkeeping,
redirectUri,
sandbox,
mutableMapOf(),
@@ -641,6 +687,16 @@ private constructor(
*/
fun minutesToExpire(): Optional = minutesToExpire.getOptional("minutes_to_expire")
+ /**
+ * Optional recordkeeping configuration. Can only be provided when the `recordkeeping`
+ * product is requested. Currently supports `recordkeeper` set to `voya`, `empower`,
+ * `fidelity`, or `transamerica`.
+ *
+ * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun recordkeeping(): Optional = recordkeeping.getOptional("recordkeeping")
+
/**
* The URI to redirect to after the Connect flow is completed
*
@@ -721,6 +777,16 @@ private constructor(
@ExcludeMissing
fun _minutesToExpire(): JsonField = minutesToExpire
+ /**
+ * Returns the raw JSON value of [recordkeeping].
+ *
+ * Unlike [recordkeeping], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("recordkeeping")
+ @ExcludeMissing
+ fun _recordkeeping(): JsonField = recordkeeping
+
/**
* Returns the raw JSON value of [redirectUri].
*
@@ -775,6 +841,7 @@ private constructor(
private var integration: JsonField = JsonMissing.of()
private var manual: JsonField = JsonMissing.of()
private var minutesToExpire: JsonField = JsonMissing.of()
+ private var recordkeeping: JsonField = JsonMissing.of()
private var redirectUri: JsonField = JsonMissing.of()
private var sandbox: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@@ -788,6 +855,7 @@ private constructor(
integration = createConnectSessionRequest.integration
manual = createConnectSessionRequest.manual
minutesToExpire = createConnectSessionRequest.minutesToExpire
+ recordkeeping = createConnectSessionRequest.recordkeeping
redirectUri = createConnectSessionRequest.redirectUri
sandbox = createConnectSessionRequest.sandbox
additionalProperties =
@@ -940,6 +1008,29 @@ private constructor(
this.minutesToExpire = minutesToExpire
}
+ /**
+ * Optional recordkeeping configuration. Can only be provided when the `recordkeeping`
+ * product is requested. Currently supports `recordkeeper` set to `voya`, `empower`,
+ * `fidelity`, or `transamerica`.
+ */
+ fun recordkeeping(recordkeeping: Recordkeeping?) =
+ recordkeeping(JsonField.ofNullable(recordkeeping))
+
+ /** Alias for calling [Builder.recordkeeping] with `recordkeeping.orElse(null)`. */
+ fun recordkeeping(recordkeeping: Optional) =
+ recordkeeping(recordkeeping.getOrNull())
+
+ /**
+ * Sets [Builder.recordkeeping] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.recordkeeping] with a well-typed [Recordkeeping]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun recordkeeping(recordkeeping: JsonField) = apply {
+ this.recordkeeping = recordkeeping
+ }
+
/** The URI to redirect to after the Connect flow is completed */
fun redirectUri(redirectUri: String?) = redirectUri(JsonField.ofNullable(redirectUri))
@@ -1014,6 +1105,7 @@ private constructor(
integration,
manual,
minutesToExpire,
+ recordkeeping,
redirectUri,
sandbox,
additionalProperties.toMutableMap(),
@@ -1043,6 +1135,7 @@ private constructor(
integration().ifPresent { it.validate() }
manual()
minutesToExpire()
+ recordkeeping().ifPresent { it.validate() }
redirectUri()
sandbox().ifPresent { it.validate() }
validated = true
@@ -1071,6 +1164,7 @@ private constructor(
(integration.asKnown().getOrNull()?.validity() ?: 0) +
(if (manual.asKnown().isPresent) 1 else 0) +
(if (minutesToExpire.asKnown().isPresent) 1 else 0) +
+ (recordkeeping.asKnown().getOrNull()?.validity() ?: 0) +
(if (redirectUri.asKnown().isPresent) 1 else 0) +
(sandbox.asKnown().getOrNull()?.validity() ?: 0)
@@ -1087,6 +1181,7 @@ private constructor(
integration == other.integration &&
manual == other.manual &&
minutesToExpire == other.minutesToExpire &&
+ recordkeeping == other.recordkeeping &&
redirectUri == other.redirectUri &&
sandbox == other.sandbox &&
additionalProperties == other.additionalProperties
@@ -1101,6 +1196,7 @@ private constructor(
integration,
manual,
minutesToExpire,
+ recordkeeping,
redirectUri,
sandbox,
additionalProperties,
@@ -1110,7 +1206,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "CreateConnectSessionRequest{customerId=$customerId, customerName=$customerName, products=$products, customerEmail=$customerEmail, integration=$integration, manual=$manual, minutesToExpire=$minutesToExpire, redirectUri=$redirectUri, sandbox=$sandbox, additionalProperties=$additionalProperties}"
+ "CreateConnectSessionRequest{customerId=$customerId, customerName=$customerName, products=$products, customerEmail=$customerEmail, integration=$integration, manual=$manual, minutesToExpire=$minutesToExpire, recordkeeping=$recordkeeping, redirectUri=$redirectUri, sandbox=$sandbox, additionalProperties=$additionalProperties}"
}
class ConnectProducts @JsonCreator private constructor(private val value: JsonField) :
@@ -1695,6 +1791,382 @@ private constructor(
"Integration{provider=$provider, authMethod=$authMethod, additionalProperties=$additionalProperties}"
}
+ /**
+ * Optional recordkeeping configuration. Can only be provided when the `recordkeeping` product
+ * is requested. Currently supports `recordkeeper` set to `voya`, `empower`, `fidelity`, or
+ * `transamerica`.
+ */
+ class Recordkeeping
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val recordkeeper: JsonField,
+ private val planId: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("recordkeeper")
+ @ExcludeMissing
+ recordkeeper: JsonField = JsonMissing.of(),
+ @JsonProperty("plan_id") @ExcludeMissing planId: JsonField = JsonMissing.of(),
+ ) : this(recordkeeper, planId, mutableMapOf())
+
+ /**
+ * The recordkeeper to configure for this connection
+ *
+ * @throws FinchInvalidDataException 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 recordkeeper(): Recordkeeper = recordkeeper.getRequired("recordkeeper")
+
+ /**
+ * The plan identifier used by the recordkeeper
+ *
+ * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun planId(): Optional = planId.getOptional("plan_id")
+
+ /**
+ * Returns the raw JSON value of [recordkeeper].
+ *
+ * Unlike [recordkeeper], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("recordkeeper")
+ @ExcludeMissing
+ fun _recordkeeper(): JsonField = recordkeeper
+
+ /**
+ * Returns the raw JSON value of [planId].
+ *
+ * Unlike [planId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("plan_id") @ExcludeMissing fun _planId(): JsonField = planId
+
+ @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 [Recordkeeping].
+ *
+ * The following fields are required:
+ * ```java
+ * .recordkeeper()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Recordkeeping]. */
+ class Builder internal constructor() {
+
+ private var recordkeeper: JsonField? = null
+ private var planId: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(recordkeeping: Recordkeeping) = apply {
+ recordkeeper = recordkeeping.recordkeeper
+ planId = recordkeeping.planId
+ additionalProperties = recordkeeping.additionalProperties.toMutableMap()
+ }
+
+ /** The recordkeeper to configure for this connection */
+ fun recordkeeper(recordkeeper: Recordkeeper) = recordkeeper(JsonField.of(recordkeeper))
+
+ /**
+ * Sets [Builder.recordkeeper] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.recordkeeper] with a well-typed [Recordkeeper] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun recordkeeper(recordkeeper: JsonField) = apply {
+ this.recordkeeper = recordkeeper
+ }
+
+ /** The plan identifier used by the recordkeeper */
+ fun planId(planId: String?) = planId(JsonField.ofNullable(planId))
+
+ /** Alias for calling [Builder.planId] with `planId.orElse(null)`. */
+ fun planId(planId: Optional) = planId(planId.getOrNull())
+
+ /**
+ * Sets [Builder.planId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.planId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun planId(planId: JsonField) = apply { this.planId = planId }
+
+ 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 [Recordkeeping].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .recordkeeper()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Recordkeeping =
+ Recordkeeping(
+ checkRequired("recordkeeper", recordkeeper),
+ planId,
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ 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 FinchInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): Recordkeeping = apply {
+ if (validated) {
+ return@apply
+ }
+
+ recordkeeper().validate()
+ planId()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: FinchInvalidDataException) {
+ 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 =
+ (recordkeeper.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (planId.asKnown().isPresent) 1 else 0)
+
+ /** The recordkeeper to configure for this connection */
+ class Recordkeeper @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 {
+
+ @JvmField val VOYA = of("voya")
+
+ @JvmField val EMPOWER = of("empower")
+
+ @JvmField val FIDELITY = of("fidelity")
+
+ @JvmField val TRANSAMERICA = of("transamerica")
+
+ @JvmStatic fun of(value: String) = Recordkeeper(JsonField.of(value))
+ }
+
+ /** An enum containing [Recordkeeper]'s known values. */
+ enum class Known {
+ VOYA,
+ EMPOWER,
+ FIDELITY,
+ TRANSAMERICA,
+ }
+
+ /**
+ * An enum containing [Recordkeeper]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Recordkeeper] 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 {
+ VOYA,
+ EMPOWER,
+ FIDELITY,
+ TRANSAMERICA,
+ /**
+ * An enum member indicating that [Recordkeeper] 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) {
+ VOYA -> Value.VOYA
+ EMPOWER -> Value.EMPOWER
+ FIDELITY -> Value.FIDELITY
+ TRANSAMERICA -> Value.TRANSAMERICA
+ 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 FinchInvalidDataException if this class instance's value is a not a known
+ * member.
+ */
+ fun known(): Known =
+ when (this) {
+ VOYA -> Known.VOYA
+ EMPOWER -> Known.EMPOWER
+ FIDELITY -> Known.FIDELITY
+ TRANSAMERICA -> Known.TRANSAMERICA
+ else -> throw FinchInvalidDataException("Unknown Recordkeeper: $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 FinchInvalidDataException if this class instance's value does not have the
+ * expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ FinchInvalidDataException("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 FinchInvalidDataException if any value type in this object doesn't match its
+ * expected type.
+ */
+ fun validate(): Recordkeeper = apply {
+ if (validated) {
+ return@apply
+ }
+
+ known()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: FinchInvalidDataException) {
+ 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 Recordkeeper && 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 Recordkeeping &&
+ recordkeeper == other.recordkeeper &&
+ planId == other.planId &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(recordkeeper, planId, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Recordkeeping{recordkeeper=$recordkeeper, planId=$planId, additionalProperties=$additionalProperties}"
+ }
+
/** Sandbox mode for testing */
class Sandbox @JsonCreator private constructor(private val value: JsonField) : Enum {
diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionNewParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionNewParamsTest.kt
index 3695428c..374a3365 100644
--- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionNewParamsTest.kt
+++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionNewParamsTest.kt
@@ -22,6 +22,12 @@ internal class ConnectSessionNewParamsTest {
)
.manual(true)
.minutesToExpire(1.0)
+ .recordkeeping(
+ ConnectSessionNewParams.Recordkeeping.builder()
+ .recordkeeper(ConnectSessionNewParams.Recordkeeping.Recordkeeper.VOYA)
+ .planId("x")
+ .build()
+ )
.redirectUri("redirect_uri")
.sandbox(ConnectSessionNewParams.Sandbox.FINCH)
.build()
@@ -43,6 +49,12 @@ internal class ConnectSessionNewParamsTest {
)
.manual(true)
.minutesToExpire(1.0)
+ .recordkeeping(
+ ConnectSessionNewParams.Recordkeeping.builder()
+ .recordkeeper(ConnectSessionNewParams.Recordkeeping.Recordkeeper.VOYA)
+ .planId("x")
+ .build()
+ )
.redirectUri("redirect_uri")
.sandbox(ConnectSessionNewParams.Sandbox.FINCH)
.build()
@@ -63,6 +75,13 @@ internal class ConnectSessionNewParamsTest {
)
assertThat(body.manual()).contains(true)
assertThat(body.minutesToExpire()).contains(1.0)
+ assertThat(body.recordkeeping())
+ .contains(
+ ConnectSessionNewParams.Recordkeeping.builder()
+ .recordkeeper(ConnectSessionNewParams.Recordkeeping.Recordkeeper.VOYA)
+ .planId("x")
+ .build()
+ )
assertThat(body.redirectUri()).contains("redirect_uri")
assertThat(body.sandbox()).contains(ConnectSessionNewParams.Sandbox.FINCH)
}
diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncTest.kt
index 2cdfd01a..c337de71 100644
--- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncTest.kt
+++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsyncTest.kt
@@ -38,6 +38,12 @@ internal class SessionServiceAsyncTest {
)
.manual(true)
.minutesToExpire(1.0)
+ .recordkeeping(
+ ConnectSessionNewParams.Recordkeeping.builder()
+ .recordkeeper(ConnectSessionNewParams.Recordkeeping.Recordkeeper.VOYA)
+ .planId("x")
+ .build()
+ )
.redirectUri("redirect_uri")
.sandbox(ConnectSessionNewParams.Sandbox.FINCH)
.build()
diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt
index 29733809..4102d958 100644
--- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt
+++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt
@@ -38,6 +38,12 @@ internal class SessionServiceTest {
)
.manual(true)
.minutesToExpire(1.0)
+ .recordkeeping(
+ ConnectSessionNewParams.Recordkeeping.builder()
+ .recordkeeper(ConnectSessionNewParams.Recordkeeping.Recordkeeper.VOYA)
+ .planId("x")
+ .build()
+ )
.redirectUri("redirect_uri")
.sandbox(ConnectSessionNewParams.Sandbox.FINCH)
.build()