diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml
index 2499cfae..042993b7 100644
--- a/.github/workflows/publish-sonatype.yml
+++ b/.github/workflows/publish-sonatype.yml
@@ -22,7 +22,7 @@ jobs:
distribution: temurin
java-version: |
8
- 17
+ 21
cache: gradle
- name: Set up Gradle
@@ -33,7 +33,7 @@ jobs:
export -- GPG_SIGNING_KEY_ID
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
- ./gradlew publishAndReleaseToMavenCentral -Dorg.gradle.jvmargs="-Xmx8g" --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
+ ./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
env:
SONATYPE_USERNAME: ${{ secrets.FINCH_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.FINCH_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index e49be765..8e11baae 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "7.5.2"
+ ".": "7.6.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 019c8e66..ba35cc4a 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 45
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-e8b684dbd61d1724b5e516a573a952bb6906d63840e27ebda7731a2f71061aff.yml
-openapi_spec_hash: 8baff9577d4e721d0494ff315da267ca
-config_hash: 5146b12344dae76238940989dac1e8a0
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-199a2fd8b7387b0648e88b5942a8248895373a561aff663389982073e55c8eb5.yml
+openapi_spec_hash: 7415c1faca5f2e873824893b140650f1
+config_hash: 6d3585c0032e08d723d077d660fc8448
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c5503aa0..1f9e083b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,43 @@
# Changelog
+## 7.6.0 (2025-10-09)
+
+Full Changelog: [v7.5.2...v7.6.0](https://github.com/Finch-API/finch-api-java/compare/v7.5.2...v7.6.0)
+
+### Features
+
+* **api:** api update ([ad4e392](https://github.com/Finch-API/finch-api-java/commit/ad4e39250d4c3c675e7eec402176c12c6146bf8c))
+* **api:** api update ([44864b7](https://github.com/Finch-API/finch-api-java/commit/44864b7f26c318600f0e7544109430a8c5112a1d))
+* **api:** api update ([71bc2ee](https://github.com/Finch-API/finch-api-java/commit/71bc2eea611486a4f156f76f8a6a4f68483bb078))
+* **api:** api update ([5751ee1](https://github.com/Finch-API/finch-api-java/commit/5751ee17299c6a67354b6f7e16baed691a62e560))
+* **api:** api update ([11e8385](https://github.com/Finch-API/finch-api-java/commit/11e83851d62b489718c81440b16734def25c07bf))
+* **api:** api update ([ff49b09](https://github.com/Finch-API/finch-api-java/commit/ff49b09be8b1d99fd939600a128c733a45586417))
+* **api:** api update ([0f28b13](https://github.com/Finch-API/finch-api-java/commit/0f28b13c3cbb994557ed019c2020939a7e0476e1))
+* **api:** make client id, client secret optional again ([6119020](https://github.com/Finch-API/finch-api-java/commit/61190204ca49d06cfd445baa0792b29d2a41d738))
+* **client:** add convenience overloads for some methods ([ac75f13](https://github.com/Finch-API/finch-api-java/commit/ac75f134bce62861ce3d2c9d9a8dc91bc16e8b83))
+* **client:** expose sleeper option ([6eb8e0f](https://github.com/Finch-API/finch-api-java/commit/6eb8e0f744b399b8a056c481b5d35850eaca0ced))
+
+
+### Bug Fixes
+
+* **ci:** use java-version 21 for publish step ([7d2e9d7](https://github.com/Finch-API/finch-api-java/commit/7d2e9d77738fef412fc7606230877cdb3befca7f))
+* **client:** deserialization of empty objects ([bb6d18b](https://github.com/Finch-API/finch-api-java/commit/bb6d18b4c4c47e1efea7aa7ab716f2414afb4870))
+* **client:** ensure single timer is created per client ([6eb8e0f](https://github.com/Finch-API/finch-api-java/commit/6eb8e0f744b399b8a056c481b5d35850eaca0ced))
+* **client:** incorrect `getPackageVersion` impl ([a7638ae](https://github.com/Finch-API/finch-api-java/commit/a7638ae702e08f124b717a78ed90a6b7347ee92c))
+* fix casing issue ([a493f5f](https://github.com/Finch-API/finch-api-java/commit/a493f5f1779c5af85ea3122a3bcba407eb0b1099))
+* update singularization rules ([270e376](https://github.com/Finch-API/finch-api-java/commit/270e37692dcb7314ec7ff88debd588642615533d))
+
+
+### Chores
+
+* **ci:** reduce log noise ([b7eee64](https://github.com/Finch-API/finch-api-java/commit/b7eee641c7c531117813d3400955373a1268e495))
+* improve formatter performance ([ebb6206](https://github.com/Finch-API/finch-api-java/commit/ebb6206eaecf268ccd3a251dc5a4159333bbe6af))
+* **internal:** change some comment formatting ([235dfbc](https://github.com/Finch-API/finch-api-java/commit/235dfbc5ffb151fde9d608b7fb3db4f1d25bf0ef))
+* **internal:** codegen related update ([5623e2d](https://github.com/Finch-API/finch-api-java/commit/5623e2d992fe5352d55f6ddec923e2b0239fef30))
+* **internal:** codegen related update ([e87c1f4](https://github.com/Finch-API/finch-api-java/commit/e87c1f421dd2e0f4805187b928a2ae54b963535b))
+* **internal:** codegen related update ([4f33876](https://github.com/Finch-API/finch-api-java/commit/4f3387637ddad2287835d764441a75e1a42ac216))
+* remove memory upper bound from publishing step ([c1d1685](https://github.com/Finch-API/finch-api-java/commit/c1d16852bef0a7a7177e3619cce87d754f391edc))
+
## 7.5.2 (2025-08-20)
Full Changelog: [v7.5.1...v7.5.2](https://github.com/Finch-API/finch-api-java/compare/v7.5.1...v7.5.2)
diff --git a/README.md b/README.md
index 99f7362a..ee25f2f8 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/7.5.2)
-[](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.5.2)
+[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/7.6.0)
+[](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.6.0)
@@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).
-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/7.5.2).
+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/7.6.0).
@@ -26,7 +26,7 @@ The REST API documentation can be found on [developer.tryfinch.com](https://deve
### Gradle
```kotlin
-implementation("com.tryfinch.api:finch-java:7.5.2")
+implementation("com.tryfinch.api:finch-java:7.6.0")
```
### Maven
@@ -35,7 +35,7 @@ implementation("com.tryfinch.api:finch-java:7.5.2")
com.tryfinch.api
finch-java
- 7.5.2
+ 7.6.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 7c4ec2b8..f21b0c40 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.tryfinch.api"
- version = "7.5.2" // x-release-please-version
+ version = "7.6.0" // x-release-please-version
}
subprojects {
diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt
index 68859894..81d8813e 100644
--- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt
+++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClient.kt
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.FinchClientImpl
import com.tryfinch.api.core.ClientOptions
+import com.tryfinch.api.core.Sleeper
import com.tryfinch.api.core.Timeout
import com.tryfinch.api.core.http.AsyncStreamResponse
import com.tryfinch.api.core.http.Headers
@@ -133,6 +134,17 @@ class FinchOkHttpClient private constructor() {
clientOptions.streamHandlerExecutor(streamHandlerExecutor)
}
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ fun sleeper(sleeper: Sleeper) = apply { clientOptions.sleeper(sleeper) }
+
/**
* The clock to use for operations that require timing, like retries.
*
diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt
index 668500aa..1987a24d 100644
--- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt
+++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/FinchOkHttpClientAsync.kt
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.tryfinch.api.client.FinchClientAsync
import com.tryfinch.api.client.FinchClientAsyncImpl
import com.tryfinch.api.core.ClientOptions
+import com.tryfinch.api.core.Sleeper
import com.tryfinch.api.core.Timeout
import com.tryfinch.api.core.http.AsyncStreamResponse
import com.tryfinch.api.core.http.Headers
@@ -133,6 +134,17 @@ class FinchOkHttpClientAsync private constructor() {
clientOptions.streamHandlerExecutor(streamHandlerExecutor)
}
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ fun sleeper(sleeper: Sleeper) = apply { clientOptions.sleeper(sleeper) }
+
/**
* The clock to use for operations that require timing, like retries.
*
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt
index 42a6c1e2..8d6c2ad0 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt
@@ -55,6 +55,16 @@ private constructor(
* This class takes ownership of the executor and shuts it down, if possible, when closed.
*/
@get:JvmName("streamHandlerExecutor") val streamHandlerExecutor: Executor,
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ @get:JvmName("sleeper") val sleeper: Sleeper,
/**
* The clock to use for operations that require timing, like retries.
*
@@ -156,6 +166,7 @@ private constructor(
private var checkJacksonVersionCompatibility: Boolean = true
private var jsonMapper: JsonMapper = jsonMapper()
private var streamHandlerExecutor: Executor? = null
+ private var sleeper: Sleeper? = null
private var clock: Clock = Clock.systemUTC()
private var baseUrl: String? = null
private var headers: Headers.Builder = Headers.builder()
@@ -174,6 +185,7 @@ private constructor(
checkJacksonVersionCompatibility = clientOptions.checkJacksonVersionCompatibility
jsonMapper = clientOptions.jsonMapper
streamHandlerExecutor = clientOptions.streamHandlerExecutor
+ sleeper = clientOptions.sleeper
clock = clientOptions.clock
baseUrl = clientOptions.baseUrl
headers = clientOptions.headers.toBuilder()
@@ -231,6 +243,17 @@ private constructor(
else streamHandlerExecutor
}
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ fun sleeper(sleeper: Sleeper) = apply { this.sleeper = PhantomReachableSleeper(sleeper) }
+
/**
* The clock to use for operations that require timing, like retries.
*
@@ -438,6 +461,25 @@ private constructor(
*/
fun build(): ClientOptions {
val httpClient = checkRequired("httpClient", httpClient)
+ val streamHandlerExecutor =
+ streamHandlerExecutor
+ ?: PhantomReachableExecutorService(
+ Executors.newCachedThreadPool(
+ object : ThreadFactory {
+
+ private val threadFactory: ThreadFactory =
+ Executors.defaultThreadFactory()
+ private val count = AtomicLong(0)
+
+ override fun newThread(runnable: Runnable): Thread =
+ threadFactory.newThread(runnable).also {
+ it.name =
+ "finch-stream-handler-thread-${count.getAndIncrement()}"
+ }
+ }
+ )
+ )
+ val sleeper = sleeper ?: PhantomReachableSleeper(DefaultSleeper())
val headers = Headers.builder()
val queryParams = QueryParams.builder()
@@ -471,26 +513,14 @@ private constructor(
httpClient,
RetryingHttpClient.builder()
.httpClient(httpClient)
+ .sleeper(sleeper)
.clock(clock)
.maxRetries(maxRetries)
.build(),
checkJacksonVersionCompatibility,
jsonMapper,
- streamHandlerExecutor
- ?: Executors.newCachedThreadPool(
- object : ThreadFactory {
-
- private val threadFactory: ThreadFactory =
- Executors.defaultThreadFactory()
- private val count = AtomicLong(0)
-
- override fun newThread(runnable: Runnable): Thread =
- threadFactory.newThread(runnable).also {
- it.name =
- "finch-stream-handler-thread-${count.getAndIncrement()}"
- }
- }
- ),
+ streamHandlerExecutor,
+ sleeper,
clock,
baseUrl,
headers.build(),
@@ -519,5 +549,6 @@ private constructor(
fun close() {
httpClient.close()
(streamHandlerExecutor as? ExecutorService)?.shutdown()
+ sleeper.close()
}
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/DefaultSleeper.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/DefaultSleeper.kt
new file mode 100644
index 00000000..005c6f8c
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/DefaultSleeper.kt
@@ -0,0 +1,28 @@
+package com.tryfinch.api.core
+
+import java.time.Duration
+import java.util.Timer
+import java.util.TimerTask
+import java.util.concurrent.CompletableFuture
+
+class DefaultSleeper : Sleeper {
+
+ private val timer = Timer("DefaultSleeper", true)
+
+ override fun sleep(duration: Duration) = Thread.sleep(duration.toMillis())
+
+ override fun sleepAsync(duration: Duration): CompletableFuture {
+ val future = CompletableFuture()
+ timer.schedule(
+ object : TimerTask() {
+ override fun run() {
+ future.complete(null)
+ }
+ },
+ duration.toMillis(),
+ )
+ return future
+ }
+
+ override fun close() = timer.cancel()
+}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/PhantomReachableSleeper.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/PhantomReachableSleeper.kt
new file mode 100644
index 00000000..0b0e21bb
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/PhantomReachableSleeper.kt
@@ -0,0 +1,23 @@
+package com.tryfinch.api.core
+
+import java.time.Duration
+import java.util.concurrent.CompletableFuture
+
+/**
+ * A delegating wrapper around a [Sleeper] that closes it once it's only phantom reachable.
+ *
+ * This class ensures the [Sleeper] is closed even if the user forgets to do it.
+ */
+internal class PhantomReachableSleeper(private val sleeper: Sleeper) : Sleeper {
+
+ init {
+ closeWhenPhantomReachable(this, sleeper)
+ }
+
+ override fun sleep(duration: Duration) = sleeper.sleep(duration)
+
+ override fun sleepAsync(duration: Duration): CompletableFuture =
+ sleeper.sleepAsync(duration)
+
+ override fun close() = sleeper.close()
+}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Properties.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Properties.kt
index cc7e7158..29bb4994 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Properties.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Properties.kt
@@ -2,7 +2,7 @@
package com.tryfinch.api.core
-import java.util.Properties
+import com.tryfinch.api.client.FinchClient
fun getOsArch(): String {
val osArch = System.getProperty("os.arch")
@@ -16,7 +16,7 @@ fun getOsArch(): String {
"x86_64" -> "x64"
"arm" -> "arm"
"aarch64" -> "arm64"
- else -> "other:${osArch}"
+ else -> "other:$osArch"
}
}
@@ -30,13 +30,13 @@ fun getOsName(): String {
osName.startsWith("Linux") -> "Linux"
osName.startsWith("Mac OS") -> "MacOS"
osName.startsWith("Windows") -> "Windows"
- else -> "Other:${osName}"
+ else -> "Other:$osName"
}
}
fun getOsVersion(): String = System.getProperty("os.version", "unknown")
fun getPackageVersion(): String =
- Properties::class.java.`package`.implementationVersion ?: "unknown"
+ FinchClient::class.java.`package`.implementationVersion ?: "unknown"
fun getJavaVersion(): String = System.getProperty("java.version", "unknown")
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Sleeper.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Sleeper.kt
new file mode 100644
index 00000000..b027f47d
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Sleeper.kt
@@ -0,0 +1,21 @@
+package com.tryfinch.api.core
+
+import java.time.Duration
+import java.util.concurrent.CompletableFuture
+
+/**
+ * An interface for delaying execution for a specified amount of time.
+ *
+ * Useful for testing and cleaning up resources.
+ */
+interface Sleeper : AutoCloseable {
+
+ /** Synchronously pauses execution for the given [duration]. */
+ fun sleep(duration: Duration)
+
+ /** Asynchronously pauses execution for the given [duration]. */
+ fun sleepAsync(duration: Duration): CompletableFuture
+
+ /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */
+ override fun close()
+}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt
index d4cb1e78..b1d9b083 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt
@@ -1,6 +1,8 @@
package com.tryfinch.api.core.http
+import com.tryfinch.api.core.DefaultSleeper
import com.tryfinch.api.core.RequestOptions
+import com.tryfinch.api.core.Sleeper
import com.tryfinch.api.core.checkRequired
import com.tryfinch.api.errors.FinchIoException
import com.tryfinch.api.errors.FinchRetryableException
@@ -11,8 +13,6 @@ import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeParseException
import java.time.temporal.ChronoUnit
-import java.util.Timer
-import java.util.TimerTask
import java.util.UUID
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ThreadLocalRandom
@@ -130,7 +130,10 @@ private constructor(
return executeWithRetries(modifiedRequest, requestOptions)
}
- override fun close() = httpClient.close()
+ override fun close() {
+ httpClient.close()
+ sleeper.close()
+ }
private fun isRetryable(request: HttpRequest): Boolean =
// Some requests, such as when a request body is being streamed, cannot be retried because
@@ -235,33 +238,14 @@ private constructor(
class Builder internal constructor() {
private var httpClient: HttpClient? = null
- private var sleeper: Sleeper =
- object : Sleeper {
-
- private val timer = Timer("RetryingHttpClient", true)
-
- override fun sleep(duration: Duration) = Thread.sleep(duration.toMillis())
-
- override fun sleepAsync(duration: Duration): CompletableFuture {
- val future = CompletableFuture()
- timer.schedule(
- object : TimerTask() {
- override fun run() {
- future.complete(null)
- }
- },
- duration.toMillis(),
- )
- return future
- }
- }
+ private var sleeper: Sleeper? = null
private var clock: Clock = Clock.systemUTC()
private var maxRetries: Int = 2
private var idempotencyHeader: String? = null
fun httpClient(httpClient: HttpClient) = apply { this.httpClient = httpClient }
- @JvmSynthetic internal fun sleeper(sleeper: Sleeper) = apply { this.sleeper = sleeper }
+ fun sleeper(sleeper: Sleeper) = apply { this.sleeper = sleeper }
fun clock(clock: Clock) = apply { this.clock = clock }
@@ -272,17 +256,10 @@ private constructor(
fun build(): HttpClient =
RetryingHttpClient(
checkRequired("httpClient", httpClient),
- sleeper,
+ sleeper ?: DefaultSleeper(),
clock,
maxRetries,
idempotencyHeader,
)
}
-
- internal interface Sleeper {
-
- fun sleep(duration: Duration)
-
- fun sleepAsync(duration: Duration): CompletableFuture
- }
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt
index 2d1e6f32..75ba86fd 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt
@@ -22,30 +22,38 @@ import java.util.Optional
/** Exchange the authorization code for an access token */
class AccessTokenCreateParams
private constructor(
- private val body: Body,
+ private val body: CreateAccessTokenRequest,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
) : Params {
/**
+ * The authorization code received from the authorization server
+ *
* @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 code(): String = body.code()
/**
+ * The client ID for your application
+ *
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun clientId(): Optional = body.clientId()
/**
+ * The client secret for your application
+ *
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun clientSecret(): Optional = body.clientSecret()
/**
+ * The redirect URI used in the authorization request (optional)
+ *
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
@@ -105,7 +113,7 @@ private constructor(
/** A builder for [AccessTokenCreateParams]. */
class Builder internal constructor() {
- private var body: Body.Builder = Body.builder()
+ private var body: CreateAccessTokenRequest.Builder = CreateAccessTokenRequest.builder()
private var additionalHeaders: Headers.Builder = Headers.builder()
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
@@ -126,8 +134,9 @@ private constructor(
* - [clientSecret]
* - [redirectUri]
*/
- fun body(body: Body) = apply { this.body = body.toBuilder() }
+ fun body(body: CreateAccessTokenRequest) = apply { this.body = body.toBuilder() }
+ /** The authorization code received from the authorization server */
fun code(code: String) = apply { body.code(code) }
/**
@@ -138,6 +147,7 @@ private constructor(
*/
fun code(code: JsonField) = apply { body.code(code) }
+ /** The client ID for your application */
fun clientId(clientId: String) = apply { body.clientId(clientId) }
/**
@@ -148,6 +158,7 @@ private constructor(
*/
fun clientId(clientId: JsonField) = apply { body.clientId(clientId) }
+ /** The client secret for your application */
fun clientSecret(clientSecret: String) = apply { body.clientSecret(clientSecret) }
/**
@@ -161,6 +172,7 @@ private constructor(
body.clientSecret(clientSecret)
}
+ /** The redirect URI used in the authorization request (optional) */
fun redirectUri(redirectUri: String) = apply { body.redirectUri(redirectUri) }
/**
@@ -309,13 +321,14 @@ private constructor(
)
}
- fun _body(): Body = body
+ fun _body(): CreateAccessTokenRequest = body
override fun _headers(): Headers = additionalHeaders
override fun _queryParams(): QueryParams = additionalQueryParams
- class Body
+ class CreateAccessTokenRequest
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val code: JsonField,
private val clientId: JsonField,
@@ -339,24 +352,32 @@ private constructor(
) : this(code, clientId, clientSecret, redirectUri, mutableMapOf())
/**
+ * The authorization code received from the authorization server
+ *
* @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 code(): String = code.getRequired("code")
/**
+ * The client ID for your application
+ *
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun clientId(): Optional = clientId.getOptional("client_id")
/**
+ * The client secret for your application
+ *
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
fun clientSecret(): Optional = clientSecret.getOptional("client_secret")
/**
+ * The redirect URI used in the authorization request (optional)
+ *
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
@@ -410,7 +431,7 @@ private constructor(
companion object {
/**
- * Returns a mutable builder for constructing an instance of [Body].
+ * Returns a mutable builder for constructing an instance of [CreateAccessTokenRequest].
*
* The following fields are required:
* ```java
@@ -420,7 +441,7 @@ private constructor(
@JvmStatic fun builder() = Builder()
}
- /** A builder for [Body]. */
+ /** A builder for [CreateAccessTokenRequest]. */
class Builder internal constructor() {
private var code: JsonField? = null
@@ -430,14 +451,15 @@ private constructor(
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(body: Body) = apply {
- code = body.code
- clientId = body.clientId
- clientSecret = body.clientSecret
- redirectUri = body.redirectUri
- additionalProperties = body.additionalProperties.toMutableMap()
+ internal fun from(createAccessTokenRequest: CreateAccessTokenRequest) = apply {
+ code = createAccessTokenRequest.code
+ clientId = createAccessTokenRequest.clientId
+ clientSecret = createAccessTokenRequest.clientSecret
+ redirectUri = createAccessTokenRequest.redirectUri
+ additionalProperties = createAccessTokenRequest.additionalProperties.toMutableMap()
}
+ /** The authorization code received from the authorization server */
fun code(code: String) = code(JsonField.of(code))
/**
@@ -449,6 +471,7 @@ private constructor(
*/
fun code(code: JsonField) = apply { this.code = code }
+ /** The client ID for your application */
fun clientId(clientId: String) = clientId(JsonField.of(clientId))
/**
@@ -460,6 +483,7 @@ private constructor(
*/
fun clientId(clientId: JsonField) = apply { this.clientId = clientId }
+ /** The client secret for your application */
fun clientSecret(clientSecret: String) = clientSecret(JsonField.of(clientSecret))
/**
@@ -473,6 +497,7 @@ private constructor(
this.clientSecret = clientSecret
}
+ /** The redirect URI used in the authorization request (optional) */
fun redirectUri(redirectUri: String) = redirectUri(JsonField.of(redirectUri))
/**
@@ -506,7 +531,7 @@ private constructor(
}
/**
- * Returns an immutable instance of [Body].
+ * Returns an immutable instance of [CreateAccessTokenRequest].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
@@ -517,8 +542,8 @@ private constructor(
*
* @throws IllegalStateException if any required field is unset.
*/
- fun build(): Body =
- Body(
+ fun build(): CreateAccessTokenRequest =
+ CreateAccessTokenRequest(
checkRequired("code", code),
clientId,
clientSecret,
@@ -529,7 +554,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): Body = apply {
+ fun validate(): CreateAccessTokenRequest = apply {
if (validated) {
return@apply
}
@@ -567,7 +592,7 @@ private constructor(
return true
}
- return other is Body &&
+ return other is CreateAccessTokenRequest &&
code == other.code &&
clientId == other.clientId &&
clientSecret == other.clientSecret &&
@@ -582,7 +607,7 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "Body{code=$code, clientId=$clientId, clientSecret=$clientSecret, redirectUri=$redirectUri, additionalProperties=$additionalProperties}"
+ "CreateAccessTokenRequest{code=$code, clientId=$clientId, clientSecret=$clientSecret, redirectUri=$redirectUri, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt
index 053aae24..f74f28af 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt
@@ -20,6 +20,7 @@ import java.util.Objects
import kotlin.jvm.optionals.getOrNull
class AccountCreateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accessToken: JsonField,
private val accountId: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt
index cb5a9c86..1faf0298 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt
@@ -19,6 +19,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AccountUpdateEvent
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accountId: JsonField,
private val companyId: JsonField,
@@ -324,6 +325,7 @@ private constructor(
(eventType.asKnown().getOrNull()?.validity() ?: 0)
class Data
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val authenticationMethod: JsonField,
private val status: JsonField,
@@ -510,6 +512,7 @@ private constructor(
(status.asKnown().getOrNull()?.validity() ?: 0)
class AuthenticationMethod
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val benefitsSupport: JsonField,
private val supportedFields: JsonField,
@@ -746,6 +749,7 @@ private constructor(
/** The supported data fields returned by our HR and payroll endpoints */
class SupportedFields
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val company: JsonField,
private val directory: JsonField,
@@ -1131,6 +1135,7 @@ private constructor(
(payment.asKnown().getOrNull()?.validity() ?: 0)
class SupportedCompanyFields
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val accounts: JsonField,
@@ -1582,6 +1587,7 @@ private constructor(
(if (primaryPhoneNumber.asKnown().isPresent) 1 else 0)
class Accounts
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accountName: JsonField,
private val accountNumber: JsonField,
@@ -1921,6 +1927,7 @@ private constructor(
}
class Departments
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val name: JsonField,
private val parent: JsonField,
@@ -2090,6 +2097,7 @@ private constructor(
(parent.asKnown().getOrNull()?.validity() ?: 0)
class Parent
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val name: JsonField,
private val additionalProperties: MutableMap,
@@ -2267,6 +2275,7 @@ private constructor(
}
class Entity
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val subtype: JsonField,
private val type: JsonField,
@@ -2457,6 +2466,7 @@ private constructor(
}
class Locations
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val city: JsonField,
private val country: JsonField,
@@ -2850,6 +2860,7 @@ private constructor(
}
class SupportedDirectoryFields
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val individuals: JsonField,
private val paging: JsonField,
@@ -3029,6 +3040,7 @@ private constructor(
(paging.asKnown().getOrNull()?.validity() ?: 0)
class Individuals
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val department: JsonField,
@@ -3405,6 +3417,7 @@ private constructor(
(if (middleName.asKnown().isPresent) 1 else 0)
class Manager
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val additionalProperties: MutableMap,
@@ -3594,6 +3607,7 @@ private constructor(
}
class Paging
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val count: JsonField,
private val offset: JsonField,
@@ -3805,6 +3819,7 @@ private constructor(
}
class SupportedEmploymentFields
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val classCode: JsonField,
@@ -4567,6 +4582,7 @@ private constructor(
(if (title.asKnown().isPresent) 1 else 0)
class Department
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val name: JsonField,
private val additionalProperties: MutableMap,
@@ -4720,6 +4736,7 @@ private constructor(
}
class Employment
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val subtype: JsonField,
private val type: JsonField,
@@ -4912,6 +4929,7 @@ private constructor(
}
class Income
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val amount: JsonField,
private val currency: JsonField,
@@ -5138,6 +5156,7 @@ private constructor(
}
class Location
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val city: JsonField,
private val country: JsonField,
@@ -5491,6 +5510,7 @@ private constructor(
}
class Manager
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val additionalProperties: MutableMap,
@@ -5694,6 +5714,7 @@ private constructor(
}
class SupportedIndividualFields
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val dob: JsonField,
@@ -6296,6 +6317,7 @@ private constructor(
(if (ssn.asKnown().isPresent) 1 else 0)
class Emails
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val data: JsonField,
private val type: JsonField,
@@ -6482,6 +6504,7 @@ private constructor(
}
class PhoneNumbers
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val data: JsonField,
private val type: JsonField,
@@ -6670,6 +6693,7 @@ private constructor(
}
class Residence
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val city: JsonField,
private val country: JsonField,
@@ -7071,6 +7095,7 @@ private constructor(
}
class SupportedPayGroupFields
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val individualIds: JsonField,
@@ -7345,6 +7370,7 @@ private constructor(
}
class SupportedPayStatementFields
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val paging: JsonField,
private val payStatements: JsonField,
@@ -7525,6 +7551,7 @@ private constructor(
(payStatements.asKnown().getOrNull()?.validity() ?: 0)
class Paging
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val count: JsonField,
private val offset: JsonField,
@@ -7735,6 +7762,7 @@ private constructor(
}
class PayStatements
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val earnings: JsonField,
private val employeeDeductions: JsonField,
@@ -8239,6 +8267,7 @@ private constructor(
(if (type.asKnown().isPresent) 1 else 0)
class Earnings
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val amount: JsonField,
private val currency: JsonField,
@@ -8514,6 +8543,7 @@ private constructor(
}
class EmployeeDeductions
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val amount: JsonField,
private val currency: JsonField,
@@ -8835,6 +8865,7 @@ private constructor(
}
class EmployerContributions
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val amount: JsonField,
private val currency: JsonField,
@@ -9075,6 +9106,7 @@ private constructor(
}
class Taxes
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val amount: JsonField,
private val currency: JsonField,
@@ -9457,6 +9489,7 @@ private constructor(
}
class SupportedPaymentFields
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val companyDebit: JsonField,
@@ -10032,6 +10065,7 @@ private constructor(
(payPeriod.asKnown().getOrNull()?.validity() ?: 0)
class PayPeriod
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val endDate: JsonField,
private val startDate: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt
index 1a6dadca..d76a464b 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt
@@ -21,6 +21,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AccountUpdateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accountId: JsonField,
private val authenticationType: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt
index 00b3d3a8..cdcb6c77 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt
@@ -20,6 +20,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AutomatedAsyncJob
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val completedAt: JsonField,
private val createdAt: JsonField,
@@ -499,6 +500,7 @@ private constructor(
/** The input parameters for the job. */
class Params
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val individualId: JsonField,
private val additionalProperties: MutableMap,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt
index 4d246ec3..a01a4d5c 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt
@@ -17,6 +17,7 @@ import java.util.Objects
import java.util.Optional
class AutomatedCreateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val allowedRefreshes: JsonField,
private val remainingRefreshes: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedListResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedListResponse.kt
index 512ce448..b9a02fdc 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedListResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedListResponse.kt
@@ -20,6 +20,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class AutomatedListResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val data: JsonField>,
private val meta: JsonField,
@@ -206,6 +207,7 @@ private constructor(
(meta.asKnown().getOrNull()?.validity() ?: 0)
class Meta
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val quotas: JsonField,
private val additionalProperties: MutableMap,
@@ -339,6 +341,7 @@ private constructor(
* contact a Finch representative for more details.
*/
class Quotas
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val dataSyncAll: JsonField,
private val additionalProperties: MutableMap,
@@ -469,6 +472,7 @@ private constructor(
internal fun validity(): Int = (dataSyncAll.asKnown().getOrNull()?.validity() ?: 0)
class DataSyncAll
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val allowedRefreshes: JsonField,
private val remainingRefreshes: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt
index 5b8d2c6d..a3c5d0cd 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt
@@ -17,6 +17,7 @@ import java.util.Objects
import java.util.Optional
class BaseWebhookEvent
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accountId: JsonField,
private val companyId: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt
index 17245a56..ad2b5911 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt
@@ -19,6 +19,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class BenefitContribution
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val amount: JsonField,
private val type: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt
index 8eca9722..665a11a5 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt
@@ -17,6 +17,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class BenefitFeaturesAndOperations
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val supportedFeatures: JsonField,
private val supportedOperations: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt
index bd48977c..afd9845f 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt
@@ -21,6 +21,7 @@ import kotlin.jvm.optionals.getOrNull
* property will be null
*/
class BenefitsSupport
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val commuter: JsonField,
private val customPostTax: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt
index e045475f..96420583 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt
@@ -21,6 +21,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class Company
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val accounts: JsonField>,
@@ -555,6 +556,7 @@ private constructor(
(if (primaryPhoneNumber.asKnown().isPresent) 1 else 0)
class Account
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accountName: JsonField,
private val accountNumber: JsonField,
@@ -1070,6 +1072,7 @@ private constructor(
}
class Department
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val name: JsonField,
private val parent: JsonField,
@@ -1255,6 +1258,7 @@ private constructor(
/** The parent department, if present. */
class Parent
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val name: JsonField,
private val additionalProperties: MutableMap,
@@ -1436,6 +1440,7 @@ private constructor(
/** The entity type object. */
class Entity
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val subtype: JsonField,
private val type: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt
index 34a008e9..911be02d 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt
@@ -21,6 +21,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class CompanyBenefit
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val benefitId: JsonField,
private val description: JsonField,
@@ -334,6 +335,7 @@ private constructor(
/** The company match for this benefit. */
class BenefitCompanyMatchContribution
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val tiers: JsonField>,
private val type: JsonField,
@@ -523,6 +525,7 @@ private constructor(
(type.asKnown().getOrNull()?.validity() ?: 0)
class Tier
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val match: JsonField,
private val threshold: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt
index f5ac8559..e7b74a60 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt
@@ -20,6 +20,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class CompanyEvent
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accountId: JsonField,
private val companyId: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt
index e2e427f3..96ed910c 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt
@@ -21,6 +21,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class CompanyUpdateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accounts: JsonField>,
private val departments: JsonField>,
@@ -519,6 +520,7 @@ private constructor(
(if (primaryPhoneNumber.asKnown().isPresent) 1 else 0)
class Account
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accountName: JsonField,
private val accountNumber: JsonField,
@@ -1012,6 +1014,7 @@ private constructor(
}
class Department
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val name: JsonField,
private val parent: JsonField,
@@ -1176,6 +1179,7 @@ private constructor(
/** The parent department, if present. */
class Parent
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val name: JsonField,
private val additionalProperties: MutableMap,
@@ -1342,6 +1346,7 @@ private constructor(
/** The entity type object. */
class Entity
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val subtype: JsonField,
private val type: JsonField,
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 7c557b64..70b0dc76 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
@@ -500,6 +500,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val customerId: JsonField,
private val customerName: JsonField,
@@ -1218,6 +1219,7 @@ private constructor(
}
class Integration
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val authMethod: JsonField,
private val provider: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt
index 8d695b3c..a13a3bdb 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt
@@ -367,6 +367,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val connectionId: JsonField,
private val minutesToExpire: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt
index 0049ee7b..b18e334d 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt
@@ -21,6 +21,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class ConnectionCreateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accessToken: JsonField,
private val accountId: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt
index 1815b149..33c41add 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt
@@ -21,17 +21,18 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class CreateAccessTokenResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accessToken: JsonField,
- private val accountId: JsonField,
private val clientType: JsonField,
- private val companyId: JsonField,
private val connectionId: JsonField,
private val connectionType: JsonField,
private val products: JsonField>,
private val providerId: JsonField,
- private val customerId: JsonField,
private val tokenType: JsonField,
+ private val accountId: JsonField,
+ private val companyId: JsonField,
+ private val customerId: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -40,11 +41,9 @@ private constructor(
@JsonProperty("access_token")
@ExcludeMissing
accessToken: JsonField = JsonMissing.of(),
- @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(),
@JsonProperty("client_type")
@ExcludeMissing
clientType: JsonField = JsonMissing.of(),
- @JsonProperty("company_id") @ExcludeMissing companyId: JsonField = JsonMissing.of(),
@JsonProperty("connection_id")
@ExcludeMissing
connectionId: JsonField = JsonMissing.of(),
@@ -57,26 +56,28 @@ private constructor(
@JsonProperty("provider_id")
@ExcludeMissing
providerId: JsonField = JsonMissing.of(),
+ @JsonProperty("token_type") @ExcludeMissing tokenType: JsonField = JsonMissing.of(),
+ @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(),
+ @JsonProperty("company_id") @ExcludeMissing companyId: JsonField = JsonMissing.of(),
@JsonProperty("customer_id")
@ExcludeMissing
customerId: JsonField = JsonMissing.of(),
- @JsonProperty("token_type") @ExcludeMissing tokenType: JsonField = JsonMissing.of(),
) : this(
accessToken,
- accountId,
clientType,
- companyId,
connectionId,
connectionType,
products,
providerId,
- customerId,
tokenType,
+ accountId,
+ companyId,
+ customerId,
mutableMapOf(),
)
/**
- * The access token for the connection.
+ * The access token for the 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).
@@ -84,79 +85,81 @@ private constructor(
fun accessToken(): String = accessToken.getRequired("access_token")
/**
- * [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID.
+ * The type of application associated with a token.
*
* @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).
*/
- @Deprecated("deprecated") fun accountId(): String = accountId.getRequired("account_id")
+ fun clientType(): ClientType = clientType.getRequired("client_type")
/**
- * The type of application associated with a token.
+ * The Finch UUID of the connection associated with the `access_token`
*
* @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 clientType(): ClientType = clientType.getRequired("client_type")
+ fun connectionId(): String = connectionId.getRequired("connection_id")
/**
- * [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID.
+ * The type of the connection associated with the token.
+ * - `provider` - connection to an external provider
+ * - `finch` - finch-generated data.
*
* @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).
*/
- @Deprecated("deprecated") fun companyId(): String = companyId.getRequired("company_id")
+ fun connectionType(): ConnectionType = connectionType.getRequired("connection_type")
/**
- * The Finch UUID of the connection associated with the `access_token`.
+ * An array of the authorized products associated with the `access_token`
*
* @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 connectionId(): String = connectionId.getRequired("connection_id")
+ fun products(): List = products.getRequired("products")
/**
- * The type of the connection associated with the token.
- * - `provider` - connection to an external provider
- * - `finch` - finch-generated data.
+ * The ID of the provider associated with the `access_token`
*
* @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 connectionType(): ConnectionType = connectionType.getRequired("connection_type")
+ fun providerId(): String = providerId.getRequired("provider_id")
/**
- * An array of the authorized products associated with the `access_token`.
+ * The RFC 8693 token type (Finch uses `bearer` tokens)
*
* @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 products(): List = products.getRequired("products")
+ fun tokenType(): String = tokenType.getRequired("token_type")
/**
- * The ID of the provider associated with the `access_token`.
+ * [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID
*
- * @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).
+ * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
*/
- fun providerId(): String = providerId.getRequired("provider_id")
+ @Deprecated("deprecated")
+ fun accountId(): Optional = accountId.getOptional("account_id")
/**
- * The ID of your customer you provided to Finch when a connect session was created for this
- * connection.
+ * [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID
*
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun customerId(): Optional = customerId.getOptional("customer_id")
+ @Deprecated("deprecated")
+ fun companyId(): Optional = companyId.getOptional("company_id")
/**
- * The RFC 8693 token type (Finch uses `bearer` tokens)
+ * The ID of your customer you provided to Finch when a connect session was created for this
+ * connection
*
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun tokenType(): Optional = tokenType.getOptional("token_type")
+ fun customerId(): Optional = customerId.getOptional("customer_id")
/**
* Returns the raw JSON value of [accessToken].
@@ -167,16 +170,6 @@ private constructor(
@ExcludeMissing
fun _accessToken(): JsonField = accessToken
- /**
- * Returns the raw JSON value of [accountId].
- *
- * Unlike [accountId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @Deprecated("deprecated")
- @JsonProperty("account_id")
- @ExcludeMissing
- fun _accountId(): JsonField = accountId
-
/**
* Returns the raw JSON value of [clientType].
*
@@ -186,16 +179,6 @@ private constructor(
@ExcludeMissing
fun _clientType(): JsonField = clientType
- /**
- * Returns the raw JSON value of [companyId].
- *
- * Unlike [companyId], this method doesn't throw if the JSON field has an unexpected type.
- */
- @Deprecated("deprecated")
- @JsonProperty("company_id")
- @ExcludeMissing
- fun _companyId(): JsonField = companyId
-
/**
* Returns the raw JSON value of [connectionId].
*
@@ -229,18 +212,38 @@ private constructor(
@JsonProperty("provider_id") @ExcludeMissing fun _providerId(): JsonField = providerId
/**
- * Returns the raw JSON value of [customerId].
+ * Returns the raw JSON value of [tokenType].
*
- * Unlike [customerId], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [tokenType], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("customer_id") @ExcludeMissing fun _customerId(): JsonField = customerId
+ @JsonProperty("token_type") @ExcludeMissing fun _tokenType(): JsonField = tokenType
/**
- * Returns the raw JSON value of [tokenType].
+ * Returns the raw JSON value of [accountId].
*
- * Unlike [tokenType], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [accountId], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("token_type") @ExcludeMissing fun _tokenType(): JsonField = tokenType
+ @Deprecated("deprecated")
+ @JsonProperty("account_id")
+ @ExcludeMissing
+ fun _accountId(): JsonField = accountId
+
+ /**
+ * Returns the raw JSON value of [companyId].
+ *
+ * Unlike [companyId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @Deprecated("deprecated")
+ @JsonProperty("company_id")
+ @ExcludeMissing
+ fun _companyId(): JsonField = companyId
+
+ /**
+ * Returns the raw JSON value of [customerId].
+ *
+ * Unlike [customerId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("customer_id") @ExcludeMissing fun _customerId(): JsonField = customerId
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -262,13 +265,12 @@ private constructor(
* The following fields are required:
* ```java
* .accessToken()
- * .accountId()
* .clientType()
- * .companyId()
* .connectionId()
* .connectionType()
* .products()
* .providerId()
+ * .tokenType()
* ```
*/
@JvmStatic fun builder() = Builder()
@@ -278,33 +280,33 @@ private constructor(
class Builder internal constructor() {
private var accessToken: JsonField? = null
- private var accountId: JsonField? = null
private var clientType: JsonField? = null
- private var companyId: JsonField? = null
private var connectionId: JsonField? = null
private var connectionType: JsonField? = null
private var products: JsonField>? = null
private var providerId: JsonField? = null
+ private var tokenType: JsonField? = null
+ private var accountId: JsonField = JsonMissing.of()
+ private var companyId: JsonField = JsonMissing.of()
private var customerId: JsonField = JsonMissing.of()
- private var tokenType: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(createAccessTokenResponse: CreateAccessTokenResponse) = apply {
accessToken = createAccessTokenResponse.accessToken
- accountId = createAccessTokenResponse.accountId
clientType = createAccessTokenResponse.clientType
- companyId = createAccessTokenResponse.companyId
connectionId = createAccessTokenResponse.connectionId
connectionType = createAccessTokenResponse.connectionType
products = createAccessTokenResponse.products.map { it.toMutableList() }
providerId = createAccessTokenResponse.providerId
- customerId = createAccessTokenResponse.customerId
tokenType = createAccessTokenResponse.tokenType
+ accountId = createAccessTokenResponse.accountId
+ companyId = createAccessTokenResponse.companyId
+ customerId = createAccessTokenResponse.customerId
additionalProperties = createAccessTokenResponse.additionalProperties.toMutableMap()
}
- /** The access token for the connection. */
+ /** The access token for the connection */
fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken))
/**
@@ -316,22 +318,6 @@ private constructor(
*/
fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken }
- /**
- * [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID.
- */
- @Deprecated("deprecated")
- fun accountId(accountId: String) = accountId(JsonField.of(accountId))
-
- /**
- * Sets [Builder.accountId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.accountId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- @Deprecated("deprecated")
- fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
-
/** The type of application associated with a token. */
fun clientType(clientType: ClientType) = clientType(JsonField.of(clientType))
@@ -344,23 +330,7 @@ private constructor(
*/
fun clientType(clientType: JsonField) = apply { this.clientType = clientType }
- /**
- * [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID.
- */
- @Deprecated("deprecated")
- fun companyId(companyId: String) = companyId(JsonField.of(companyId))
-
- /**
- * Sets [Builder.companyId] to an arbitrary JSON value.
- *
- * You should usually call [Builder.companyId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- @Deprecated("deprecated")
- fun companyId(companyId: JsonField) = apply { this.companyId = companyId }
-
- /** The Finch UUID of the connection associated with the `access_token`. */
+ /** The Finch UUID of the connection associated with the `access_token` */
fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId))
/**
@@ -393,7 +363,7 @@ private constructor(
this.connectionType = connectionType
}
- /** An array of the authorized products associated with the `access_token`. */
+ /** An array of the authorized products associated with the `access_token` */
fun products(products: List) = products(JsonField.of(products))
/**
@@ -419,7 +389,7 @@ private constructor(
}
}
- /** The ID of the provider associated with the `access_token`. */
+ /** The ID of the provider associated with the `access_token` */
fun providerId(providerId: String) = providerId(JsonField.of(providerId))
/**
@@ -431,35 +401,67 @@ private constructor(
*/
fun providerId(providerId: JsonField) = apply { this.providerId = providerId }
+ /** The RFC 8693 token type (Finch uses `bearer` tokens) */
+ fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType))
+
/**
- * The ID of your customer you provided to Finch when a connect session was created for this
- * connection.
+ * Sets [Builder.tokenType] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.tokenType] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
*/
- fun customerId(customerId: String?) = customerId(JsonField.ofNullable(customerId))
+ fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType }
- /** Alias for calling [Builder.customerId] with `customerId.orElse(null)`. */
- fun customerId(customerId: Optional) = customerId(customerId.getOrNull())
+ /**
+ * [DEPRECATED] Use `connection_id` to identify the connection instead of this account ID
+ */
+ @Deprecated("deprecated")
+ fun accountId(accountId: String) = accountId(JsonField.of(accountId))
/**
- * Sets [Builder.customerId] to an arbitrary JSON value.
+ * Sets [Builder.accountId] to an arbitrary JSON value.
*
- * You should usually call [Builder.customerId] with a well-typed [String] value instead.
+ * You should usually call [Builder.accountId] with a well-typed [String] value instead.
* This method is primarily for setting the field to an undocumented or not yet supported
* value.
*/
- fun customerId(customerId: JsonField) = apply { this.customerId = customerId }
+ @Deprecated("deprecated")
+ fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
- /** The RFC 8693 token type (Finch uses `bearer` tokens) */
- fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType))
+ /**
+ * [DEPRECATED] Use `connection_id` to identify the connection instead of this company ID
+ */
+ @Deprecated("deprecated")
+ fun companyId(companyId: String) = companyId(JsonField.of(companyId))
/**
- * Sets [Builder.tokenType] to an arbitrary JSON value.
+ * Sets [Builder.companyId] to an arbitrary JSON value.
*
- * You should usually call [Builder.tokenType] with a well-typed [String] value instead.
+ * You should usually call [Builder.companyId] with a well-typed [String] value instead.
* This method is primarily for setting the field to an undocumented or not yet supported
* value.
*/
- fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType }
+ @Deprecated("deprecated")
+ fun companyId(companyId: JsonField) = apply { this.companyId = companyId }
+
+ /**
+ * The ID of your customer you provided to Finch when a connect session was created for this
+ * connection
+ */
+ fun customerId(customerId: String?) = customerId(JsonField.ofNullable(customerId))
+
+ /** Alias for calling [Builder.customerId] with `customerId.orElse(null)`. */
+ fun customerId(customerId: Optional) = customerId(customerId.getOrNull())
+
+ /**
+ * Sets [Builder.customerId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.customerId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet supported
+ * value.
+ */
+ fun customerId(customerId: JsonField) = apply { this.customerId = customerId }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
@@ -488,13 +490,12 @@ private constructor(
* The following fields are required:
* ```java
* .accessToken()
- * .accountId()
* .clientType()
- * .companyId()
* .connectionId()
* .connectionType()
* .products()
* .providerId()
+ * .tokenType()
* ```
*
* @throws IllegalStateException if any required field is unset.
@@ -502,15 +503,15 @@ private constructor(
fun build(): CreateAccessTokenResponse =
CreateAccessTokenResponse(
checkRequired("accessToken", accessToken),
- checkRequired("accountId", accountId),
checkRequired("clientType", clientType),
- checkRequired("companyId", companyId),
checkRequired("connectionId", connectionId),
checkRequired("connectionType", connectionType),
checkRequired("products", products).map { it.toImmutable() },
checkRequired("providerId", providerId),
+ checkRequired("tokenType", tokenType),
+ accountId,
+ companyId,
customerId,
- tokenType,
additionalProperties.toMutableMap(),
)
}
@@ -523,15 +524,15 @@ private constructor(
}
accessToken()
- accountId()
clientType().validate()
- companyId()
connectionId()
connectionType().validate()
products()
providerId()
- customerId()
tokenType()
+ accountId()
+ companyId()
+ customerId()
validated = true
}
@@ -551,15 +552,15 @@ private constructor(
@JvmSynthetic
internal fun validity(): Int =
(if (accessToken.asKnown().isPresent) 1 else 0) +
- (if (accountId.asKnown().isPresent) 1 else 0) +
(clientType.asKnown().getOrNull()?.validity() ?: 0) +
- (if (companyId.asKnown().isPresent) 1 else 0) +
(if (connectionId.asKnown().isPresent) 1 else 0) +
(connectionType.asKnown().getOrNull()?.validity() ?: 0) +
(products.asKnown().getOrNull()?.size ?: 0) +
(if (providerId.asKnown().isPresent) 1 else 0) +
- (if (customerId.asKnown().isPresent) 1 else 0) +
- (if (tokenType.asKnown().isPresent) 1 else 0)
+ (if (tokenType.asKnown().isPresent) 1 else 0) +
+ (if (accountId.asKnown().isPresent) 1 else 0) +
+ (if (companyId.asKnown().isPresent) 1 else 0) +
+ (if (customerId.asKnown().isPresent) 1 else 0)
/** The type of application associated with a token. */
class ClientType @JsonCreator private constructor(private val value: JsonField) : Enum {
@@ -576,10 +577,10 @@ private constructor(
companion object {
- @JvmField val PRODUCTION = of("production")
-
@JvmField val DEVELOPMENT = of("development")
+ @JvmField val PRODUCTION = of("production")
+
@JvmField val SANDBOX = of("sandbox")
@JvmStatic fun of(value: String) = ClientType(JsonField.of(value))
@@ -587,8 +588,8 @@ private constructor(
/** An enum containing [ClientType]'s known values. */
enum class Known {
- PRODUCTION,
DEVELOPMENT,
+ PRODUCTION,
SANDBOX,
}
@@ -602,8 +603,8 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- PRODUCTION,
DEVELOPMENT,
+ PRODUCTION,
SANDBOX,
/**
* An enum member indicating that [ClientType] was instantiated with an unknown value.
@@ -620,8 +621,8 @@ private constructor(
*/
fun value(): Value =
when (this) {
- PRODUCTION -> Value.PRODUCTION
DEVELOPMENT -> Value.DEVELOPMENT
+ PRODUCTION -> Value.PRODUCTION
SANDBOX -> Value.SANDBOX
else -> Value._UNKNOWN
}
@@ -636,8 +637,8 @@ private constructor(
*/
fun known(): Known =
when (this) {
- PRODUCTION -> Known.PRODUCTION
DEVELOPMENT -> Known.DEVELOPMENT
+ PRODUCTION -> Known.PRODUCTION
SANDBOX -> Known.SANDBOX
else -> throw FinchInvalidDataException("Unknown ClientType: $value")
}
@@ -714,17 +715,17 @@ private constructor(
companion object {
- @JvmField val PROVIDER = of("provider")
-
@JvmField val FINCH = of("finch")
+ @JvmField val PROVIDER = of("provider")
+
@JvmStatic fun of(value: String) = ConnectionType(JsonField.of(value))
}
/** An enum containing [ConnectionType]'s known values. */
enum class Known {
- PROVIDER,
FINCH,
+ PROVIDER,
}
/**
@@ -737,8 +738,8 @@ private constructor(
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- PROVIDER,
FINCH,
+ PROVIDER,
/**
* An enum member indicating that [ConnectionType] was instantiated with an unknown
* value.
@@ -755,8 +756,8 @@ private constructor(
*/
fun value(): Value =
when (this) {
- PROVIDER -> Value.PROVIDER
FINCH -> Value.FINCH
+ PROVIDER -> Value.PROVIDER
else -> Value._UNKNOWN
}
@@ -770,8 +771,8 @@ private constructor(
*/
fun known(): Known =
when (this) {
- PROVIDER -> Known.PROVIDER
FINCH -> Known.FINCH
+ PROVIDER -> Known.PROVIDER
else -> throw FinchInvalidDataException("Unknown ConnectionType: $value")
}
@@ -834,30 +835,30 @@ private constructor(
return other is CreateAccessTokenResponse &&
accessToken == other.accessToken &&
- accountId == other.accountId &&
clientType == other.clientType &&
- companyId == other.companyId &&
connectionId == other.connectionId &&
connectionType == other.connectionType &&
products == other.products &&
providerId == other.providerId &&
- customerId == other.customerId &&
tokenType == other.tokenType &&
+ accountId == other.accountId &&
+ companyId == other.companyId &&
+ customerId == other.customerId &&
additionalProperties == other.additionalProperties
}
private val hashCode: Int by lazy {
Objects.hash(
accessToken,
- accountId,
clientType,
- companyId,
connectionId,
connectionType,
products,
providerId,
- customerId,
tokenType,
+ accountId,
+ companyId,
+ customerId,
additionalProperties,
)
}
@@ -865,5 +866,5 @@ private constructor(
override fun hashCode(): Int = hashCode
override fun toString() =
- "CreateAccessTokenResponse{accessToken=$accessToken, accountId=$accountId, clientType=$clientType, companyId=$companyId, connectionId=$connectionId, connectionType=$connectionType, products=$products, providerId=$providerId, customerId=$customerId, tokenType=$tokenType, additionalProperties=$additionalProperties}"
+ "CreateAccessTokenResponse{accessToken=$accessToken, clientType=$clientType, connectionId=$connectionId, connectionType=$connectionType, products=$products, providerId=$providerId, tokenType=$tokenType, accountId=$accountId, companyId=$companyId, customerId=$customerId, additionalProperties=$additionalProperties}"
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt
index 7a86b89a..5e4f0d48 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt
@@ -16,6 +16,7 @@ import java.util.Collections
import java.util.Objects
class CreateCompanyBenefitsResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val benefitId: JsonField,
private val jobId: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryCreateResponse.kt
index 0a8f737b..f5c0cf3c 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryCreateResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryCreateResponse.kt
@@ -12,6 +12,7 @@ import java.util.Collections
import java.util.Objects
class DirectoryCreateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(private val additionalProperties: MutableMap) {
@JsonCreator private constructor() : this(mutableMapOf())
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt
index 352176bc..66fa1cc2 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt
@@ -19,6 +19,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class DirectoryEvent
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val accountId: JsonField,
private val companyId: JsonField,
@@ -324,6 +325,7 @@ private constructor(
(eventType.asKnown().getOrNull()?.validity() ?: 0)
class Data
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val individualId: JsonField,
private val additionalProperties: MutableMap,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt
index 4f5ae616..4115c896 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt
@@ -16,6 +16,7 @@ import java.util.Collections
import java.util.Objects
class DisconnectResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val status: JsonField,
private val additionalProperties: MutableMap,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt
index 2fbb4668..a4d67b18 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentListResponse.kt
@@ -19,6 +19,7 @@ import java.util.Objects
import kotlin.jvm.optionals.getOrNull
class DocumentListResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val documents: JsonField>,
private val paging: JsonField,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt
index cb4e0b34..7e702560 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DocumentResponse.kt
@@ -11,6 +11,7 @@ import com.tryfinch.api.core.ExcludeMissing
import com.tryfinch.api.core.JsonField
import com.tryfinch.api.core.JsonMissing
import com.tryfinch.api.core.JsonValue
+import com.tryfinch.api.core.checkRequired
import com.tryfinch.api.errors.FinchInvalidDataException
import java.util.Collections
import java.util.Objects
@@ -18,6 +19,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class DocumentResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val individualId: JsonField,
@@ -41,10 +43,10 @@ private constructor(
/**
* A stable Finch id for the document.
*
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
+ * @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 id(): Optional = id.getOptional("id")
+ fun id(): String = id.getRequired("id")
/**
* The ID of the individual associated with the document. This will be null for employer-level
@@ -58,27 +60,27 @@ private constructor(
/**
* The type of document.
*
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
+ * @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 type(): Optional = type.getOptional("type")
+ fun type(): Type = type.getRequired("type")
/**
* A URL to access the document. Format:
* `https://api.tryfinch.com/employer/documents/:document_id`.
*
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
+ * @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 url(): Optional = url.getOptional("url")
+ fun url(): String = url.getRequired("url")
/**
* The year the document applies to, if available.
*
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
+ * @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 year(): Optional = year.getOptional("year")
+ fun year(): Double = year.getRequired("year")
/**
* Returns the raw JSON value of [id].
@@ -131,18 +133,29 @@ private constructor(
companion object {
- /** Returns a mutable builder for constructing an instance of [DocumentResponse]. */
+ /**
+ * Returns a mutable builder for constructing an instance of [DocumentResponse].
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * .individualId()
+ * .type()
+ * .url()
+ * .year()
+ * ```
+ */
@JvmStatic fun builder() = Builder()
}
/** A builder for [DocumentResponse]. */
class Builder internal constructor() {
- private var id: JsonField = JsonMissing.of()
- private var individualId: JsonField = JsonMissing.of()
- private var type: JsonField = JsonMissing.of()
- private var url: JsonField = JsonMissing.of()
- private var year: JsonField = JsonMissing.of()
+ private var id: JsonField? = null
+ private var individualId: JsonField? = null
+ private var type: JsonField? = null
+ private var url: JsonField? = null
+ private var year: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
@@ -212,17 +225,7 @@ private constructor(
fun url(url: JsonField) = apply { this.url = url }
/** The year the document applies to, if available. */
- fun year(year: Double?) = year(JsonField.ofNullable(year))
-
- /**
- * Alias for [Builder.year].
- *
- * This unboxed primitive overload exists for backwards compatibility.
- */
- fun year(year: Double) = year(year as Double?)
-
- /** Alias for calling [Builder.year] with `year.orElse(null)`. */
- fun year(year: Optional) = year(year.getOrNull())
+ fun year(year: Double) = year(JsonField.of(year))
/**
* Sets [Builder.year] to an arbitrary JSON value.
@@ -255,9 +258,27 @@ private constructor(
* Returns an immutable instance of [DocumentResponse].
*
* Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .id()
+ * .individualId()
+ * .type()
+ * .url()
+ * .year()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
fun build(): DocumentResponse =
- DocumentResponse(id, individualId, type, url, year, additionalProperties.toMutableMap())
+ DocumentResponse(
+ checkRequired("id", id),
+ checkRequired("individualId", individualId),
+ checkRequired("type", type),
+ checkRequired("url", url),
+ checkRequired("year", year),
+ additionalProperties.toMutableMap(),
+ )
}
private var validated: Boolean = false
@@ -269,7 +290,7 @@ private constructor(
id()
individualId()
- type().ifPresent { it.validate() }
+ type().validate()
url()
year()
validated = true
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt
index de4b32f7..f8365f31 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt
@@ -206,6 +206,7 @@ private constructor(
}
class UnionMember0
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val id: JsonField,
private val classCode: JsonField,
@@ -1214,6 +1215,7 @@ private constructor(
/** The department object. */
class Department
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val name: JsonField,
private val additionalProperties: MutableMap