diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 480eb784..2914c6d4 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -7,12 +7,17 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
+ pull_request:
+ branches-ignore:
+ - 'stl-preview-head/**'
+ - 'stl-preview-base/**'
jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/finch-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
@@ -35,6 +40,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/finch-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index ad42ef71..6bec2480 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "7.2.0"
+ ".": "7.3.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 2493b56b..1889fe28 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-944a0f9d35f3b8ec2ba62fa12e551cf89f0b845f8ed1e3c7f67a9fb80b32d96f.yml
-openapi_spec_hash: 37c849e7b5dd941c011385b49467e077
-config_hash: 53778a0b839c4f6ad34fbba051f5e8a6
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-f7e741bc6e0175fd96a9db5348092b90a77b0985154c0814bb681ad5dccdf19a.yml
+openapi_spec_hash: b348a9ef407a8e91dd770fcb219d4ac5
+config_hash: 5146b12344dae76238940989dac1e8a0
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bc506e14..5a1dac19 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,44 @@
# Changelog
+## 7.3.0 (2025-07-02)
+
+Full Changelog: [v7.2.0...v7.3.0](https://github.com/Finch-API/finch-api-java/compare/v7.2.0...v7.3.0)
+
+### Features
+
+* **api:** api update ([ba2711a](https://github.com/Finch-API/finch-api-java/commit/ba2711a7466433c91cafd023ab09a29dda400322))
+* **api:** api update ([85f964f](https://github.com/Finch-API/finch-api-java/commit/85f964f88bf80872817b2eff4e8a1017a9fabb4e))
+* **api:** api update ([d06d641](https://github.com/Finch-API/finch-api-java/commit/d06d641383d5b756ed558ce9dc23382995855b97))
+* **api:** api update ([ad3d78f](https://github.com/Finch-API/finch-api-java/commit/ad3d78f6515a72e9bc485e5eb9a5dfd98e8cd3d9))
+* **client:** add a `withOptions` method ([a6d2027](https://github.com/Finch-API/finch-api-java/commit/a6d2027c37a9dcf2582041bfa003b3d52a2699f4))
+* **client:** implement per-endpoint base URL support ([9b313e8](https://github.com/Finch-API/finch-api-java/commit/9b313e857a753068e492ffc9fd8a2a9022664ac9))
+
+
+### Bug Fixes
+
+* **ci:** release-doctor — report correct token name ([9ec953f](https://github.com/Finch-API/finch-api-java/commit/9ec953ffd3bc6c481f8b426db00fdee0364f737f))
+* **client:** `hasNextPage` impl for some classes ([1d74258](https://github.com/Finch-API/finch-api-java/commit/1d74258cd7af29bab12fa98e22201fdd736ff70e))
+* **client:** bump max requests per host to max requests (5 -> 64) ([c2130c2](https://github.com/Finch-API/finch-api-java/commit/c2130c25fe4053c6d85800dbf4e00935b85ff293))
+* **client:** don't close client on `withOptions` usage when original is gc'd ([f16754f](https://github.com/Finch-API/finch-api-java/commit/f16754fba73202a310517fafa12da662f70030e2))
+* **client:** fix PayStatementResponse body ([6e3128c](https://github.com/Finch-API/finch-api-java/commit/6e3128c15c5554728a0a1ab30f52458031d52f6c))
+* **client:** remove `@MustBeClosed` for future returning methods ([17cef16](https://github.com/Finch-API/finch-api-java/commit/17cef164e3b1da2ee49ed2c8e134bc3b2ff22e18))
+* **client:** update pagination ([d6b79ed](https://github.com/Finch-API/finch-api-java/commit/d6b79edb8319349a9b1141eb686f1e72b45929aa))
+* missing baseUrl call ([2040de9](https://github.com/Finch-API/finch-api-java/commit/2040de9e68d7b36faf74855e99b3e6d2d960cf7b))
+
+
+### Chores
+
+* **ci:** enable for pull requests ([d88d4b3](https://github.com/Finch-API/finch-api-java/commit/d88d4b39718a89f914aa89ad944d67eabb833f7a))
+* **ci:** only run for pushes and fork pull requests ([65d0eb9](https://github.com/Finch-API/finch-api-java/commit/65d0eb99b3b44fca36f3b1598911b242f1405ef0))
+* **docs:** grammar improvements ([ec2fe8b](https://github.com/Finch-API/finch-api-java/commit/ec2fe8b45c5898aee580617acbce9364802647be))
+* **internal:** codegen related update ([ec234c1](https://github.com/Finch-API/finch-api-java/commit/ec234c1c781c1453c7cea59e897420e0b820a15b))
+* **tests:** skip endpoints with basic auth ([6c2f07f](https://github.com/Finch-API/finch-api-java/commit/6c2f07f7ce293abdf78dd6584111eb1fcb6b7b52))
+
+
+### Refactors
+
+* **internal:** minor `ClientOptionsTest` change ([459de5c](https://github.com/Finch-API/finch-api-java/commit/459de5c5529c89b73febf0d0b30c12d46d314460))
+
## 7.2.0 (2025-05-16)
Full Changelog: [v7.1.0...v7.2.0](https://github.com/Finch-API/finch-api-java/compare/v7.1.0...v7.2.0)
diff --git a/README.md b/README.md
index bdb48061..54f2db3a 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/7.2.0)
-[](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.2.0)
+[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/7.3.0)
+[](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.3.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.2.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/7.3.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.2.0")
+implementation("com.tryfinch.api:finch-java:7.3.0")
```
### Maven
@@ -35,7 +35,7 @@ implementation("com.tryfinch.api:finch-java:7.2.0")
com.tryfinch.api
finch-java
- 7.2.0
+ 7.3.0
```
@@ -114,6 +114,21 @@ See this table for the available options:
> Don't create more than one client in the same application. Each client has a connection pool and
> thread pools, which are more efficient to share between requests.
+### Modifying configuration
+
+To temporarily use a modified client configuration, while reusing the same connection and thread pools, call `withOptions()` on any client or service:
+
+```java
+import com.tryfinch.api.client.FinchClient;
+
+FinchClient clientWithOptions = client.withOptions(optionsBuilder -> {
+ optionsBuilder.baseUrl("https://example.com");
+ optionsBuilder.maxRetries(42);
+});
+```
+
+The `withOptions()` method does not affect the original client or service.
+
## Requests and responses
To send a request to the Finch API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class.
diff --git a/SECURITY.md b/SECURITY.md
index b6499508..1e432e1e 100644
--- a/SECURITY.md
+++ b/SECURITY.md
@@ -16,11 +16,11 @@ before making any information public.
## Reporting Non-SDK Related Security Issues
If you encounter security issues that are not directly related to SDKs but pertain to the services
-or products provided by Finch please follow the respective company's security reporting guidelines.
+or products provided by Finch, please follow the respective company's security reporting guidelines.
### Finch Terms and Policies
-Please contact founders@tryfinch.com for any questions or concerns regarding security of our services.
+Please contact founders@tryfinch.com for any questions or concerns regarding the security of our services.
---
diff --git a/bin/check-release-environment b/bin/check-release-environment
index 5e7c517a..3a6a7b4a 100644
--- a/bin/check-release-environment
+++ b/bin/check-release-environment
@@ -3,19 +3,19 @@
errors=()
if [ -z "${SONATYPE_USERNAME}" ]; then
- errors+=("The FINCH_SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets")
+ errors+=("The SONATYPE_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi
if [ -z "${SONATYPE_PASSWORD}" ]; then
- errors+=("The FINCH_SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
+ errors+=("The SONATYPE_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi
if [ -z "${GPG_SIGNING_KEY}" ]; then
- errors+=("The FINCH_SONATYPE_GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets")
+ errors+=("The GPG_SIGNING_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi
if [ -z "${GPG_SIGNING_PASSWORD}" ]; then
- errors+=("The FINCH_SONATYPE_GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
+ errors+=("The GPG_SIGNING_PASSWORD secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi
lenErrors=${#errors[@]}
diff --git a/build.gradle.kts b/build.gradle.kts
index 003509c6..8faba707 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.tryfinch.api"
- version = "7.2.0" // x-release-please-version
+ version = "7.3.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 21e1d896..ea6fc295 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
@@ -189,13 +189,7 @@ class FinchOkHttpClient private constructor() {
fun build(): FinchClient =
FinchClientImpl(
clientOptions
- .httpClient(
- OkHttpClient.builder()
- .baseUrl(clientOptions.baseUrl())
- .timeout(timeout)
- .proxy(proxy)
- .build()
- )
+ .httpClient(OkHttpClient.builder().timeout(timeout).proxy(proxy).build())
.build()
)
}
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 ecfb663d..158818cc 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
@@ -189,13 +189,7 @@ class FinchOkHttpClientAsync private constructor() {
fun build(): FinchClientAsync =
FinchClientAsyncImpl(
clientOptions
- .httpClient(
- OkHttpClient.builder()
- .baseUrl(clientOptions.baseUrl())
- .timeout(timeout)
- .proxy(proxy)
- .build()
- )
+ .httpClient(OkHttpClient.builder().timeout(timeout).proxy(proxy).build())
.build()
)
}
diff --git a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt
index be523572..9d66fadb 100644
--- a/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt
+++ b/finch-java-client-okhttp/src/main/kotlin/com/tryfinch/api/client/okhttp/OkHttpClient.kt
@@ -2,7 +2,6 @@ package com.tryfinch.api.client.okhttp
import com.tryfinch.api.core.RequestOptions
import com.tryfinch.api.core.Timeout
-import com.tryfinch.api.core.checkRequired
import com.tryfinch.api.core.http.Headers
import com.tryfinch.api.core.http.HttpClient
import com.tryfinch.api.core.http.HttpMethod
@@ -17,7 +16,6 @@ import java.time.Duration
import java.util.concurrent.CompletableFuture
import okhttp3.Call
import okhttp3.Callback
-import okhttp3.HttpUrl
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.MediaType
import okhttp3.MediaType.Companion.toMediaType
@@ -28,8 +26,7 @@ import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink
-class OkHttpClient
-private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) :
+class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpClient) :
HttpClient {
override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
@@ -140,11 +137,7 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
}
private fun HttpRequest.toUrl(): String {
- url?.let {
- return it
- }
-
- val builder = baseUrl.newBuilder()
+ val builder = baseUrl.toHttpUrl().newBuilder()
pathSegments.forEach(builder::addPathSegment)
queryParams.keys().forEach { key ->
queryParams.values(key).forEach { builder.addQueryParameter(key, it) }
@@ -194,12 +187,9 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
class Builder internal constructor() {
- private var baseUrl: HttpUrl? = null
private var timeout: Timeout = Timeout.default()
private var proxy: Proxy? = null
- fun baseUrl(baseUrl: String) = apply { this.baseUrl = baseUrl.toHttpUrl() }
-
fun timeout(timeout: Timeout) = apply { this.timeout = timeout }
fun timeout(timeout: Duration) = timeout(Timeout.builder().request(timeout).build())
@@ -214,8 +204,12 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
.writeTimeout(timeout.write())
.callTimeout(timeout.request())
.proxy(proxy)
- .build(),
- checkRequired("baseUrl", baseUrl),
+ .build()
+ .apply {
+ // We usually make all our requests to the same host so it makes sense to
+ // raise the per-host limit to the overall limit.
+ dispatcher.maxRequestsPerHost = dispatcher.maxRequests
+ }
)
}
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt
index 4d6662df..b1026a74 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClient.kt
@@ -3,6 +3,7 @@
package com.tryfinch.api.client
import com.fasterxml.jackson.annotation.JsonProperty
+import com.tryfinch.api.core.ClientOptions
import com.tryfinch.api.services.blocking.AccessTokenService
import com.tryfinch.api.services.blocking.AccountService
import com.tryfinch.api.services.blocking.ConnectService
@@ -13,6 +14,7 @@ import com.tryfinch.api.services.blocking.ProviderService
import com.tryfinch.api.services.blocking.RequestForwardingService
import com.tryfinch.api.services.blocking.SandboxService
import com.tryfinch.api.services.blocking.WebhookService
+import java.util.function.Consumer
/**
* A client for interacting with the Finch REST API synchronously. You can also switch to
@@ -43,6 +45,13 @@ interface FinchClient {
*/
fun withRawResponse(): WithRawResponse
+ /**
+ * Returns a view of this service with the given option modifications applied.
+ *
+ * The original service is not modified.
+ */
+ fun withOptions(modifier: Consumer): FinchClient
+
fun accessTokens(): AccessTokenService
fun hris(): HrisService
@@ -109,6 +118,13 @@ interface FinchClient {
/** A view of [FinchClient] that provides access to raw HTTP responses for each method. */
interface WithRawResponse {
+ /**
+ * Returns a view of this service with the given option modifications applied.
+ *
+ * The original service is not modified.
+ */
+ fun withOptions(modifier: Consumer): FinchClient.WithRawResponse
+
fun accessTokens(): AccessTokenService.WithRawResponse
fun hris(): HrisService.WithRawResponse
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt
index d829a593..df116b22 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsync.kt
@@ -3,6 +3,7 @@
package com.tryfinch.api.client
import com.fasterxml.jackson.annotation.JsonProperty
+import com.tryfinch.api.core.ClientOptions
import com.tryfinch.api.services.async.AccessTokenServiceAsync
import com.tryfinch.api.services.async.AccountServiceAsync
import com.tryfinch.api.services.async.ConnectServiceAsync
@@ -14,6 +15,7 @@ import com.tryfinch.api.services.async.RequestForwardingServiceAsync
import com.tryfinch.api.services.async.SandboxServiceAsync
import com.tryfinch.api.services.async.WebhookServiceAsync
import java.util.concurrent.CompletableFuture
+import java.util.function.Consumer
/**
* A client for interacting with the Finch REST API asynchronously. You can also switch to
@@ -44,6 +46,13 @@ interface FinchClientAsync {
*/
fun withRawResponse(): WithRawResponse
+ /**
+ * Returns a view of this service with the given option modifications applied.
+ *
+ * The original service is not modified.
+ */
+ fun withOptions(modifier: Consumer): FinchClientAsync
+
fun accessTokens(): AccessTokenServiceAsync
fun hris(): HrisServiceAsync
@@ -110,6 +119,13 @@ interface FinchClientAsync {
/** A view of [FinchClientAsync] that provides access to raw HTTP responses for each method. */
interface WithRawResponse {
+ /**
+ * Returns a view of this service with the given option modifications applied.
+ *
+ * The original service is not modified.
+ */
+ fun withOptions(modifier: Consumer): FinchClientAsync.WithRawResponse
+
fun accessTokens(): AccessTokenServiceAsync.WithRawResponse
fun hris(): HrisServiceAsync.WithRawResponse
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt
index 23a0f4e0..5f8e59fb 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientAsyncImpl.kt
@@ -37,6 +37,7 @@ import com.tryfinch.api.services.async.WebhookServiceAsync
import com.tryfinch.api.services.async.WebhookServiceAsyncImpl
import java.net.URLEncoder
import java.util.concurrent.CompletableFuture
+import java.util.function.Consumer
class FinchClientAsyncImpl(private val clientOptions: ClientOptions) : FinchClientAsync {
@@ -99,6 +100,9 @@ class FinchClientAsyncImpl(private val clientOptions: ClientOptions) : FinchClie
override fun withRawResponse(): FinchClientAsync.WithRawResponse = withRawResponse
+ override fun withOptions(modifier: Consumer): FinchClientAsync =
+ FinchClientAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build())
+
override fun accessTokens(): AccessTokenServiceAsync = accessTokens
override fun hris(): HrisServiceAsync = hris
@@ -136,6 +140,7 @@ class FinchClientAsyncImpl(private val clientOptions: ClientOptions) : FinchClie
val request =
HttpRequest.builder()
.method(HttpMethod.POST)
+ .baseUrl(clientOptions.baseUrl())
.addPathSegments("auth", "token")
.body(
json(
@@ -166,7 +171,7 @@ class FinchClientAsyncImpl(private val clientOptions: ClientOptions) : FinchClie
.httpClient(clientOptions.httpClient)
.jsonMapper(clientOptions.jsonMapper)
.clock(clientOptions.clock)
- .baseUrl(clientOptions.baseUrl)
+ .baseUrl(clientOptions.baseUrl())
.accessToken(accessToken)
.clientId(clientOptions.clientId())
.clientSecret(clientOptions.clientSecret())
@@ -235,6 +240,13 @@ class FinchClientAsyncImpl(private val clientOptions: ClientOptions) : FinchClie
ConnectServiceAsyncImpl.WithRawResponseImpl(clientOptions)
}
+ override fun withOptions(
+ modifier: Consumer
+ ): FinchClientAsync.WithRawResponse =
+ FinchClientAsyncImpl.WithRawResponseImpl(
+ clientOptions.toBuilder().apply(modifier::accept).build()
+ )
+
override fun accessTokens(): AccessTokenServiceAsync.WithRawResponse = accessTokens
override fun hris(): HrisServiceAsync.WithRawResponse = hris
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt
index 766d1631..efa56805 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt
@@ -36,6 +36,7 @@ import com.tryfinch.api.services.blocking.SandboxServiceImpl
import com.tryfinch.api.services.blocking.WebhookService
import com.tryfinch.api.services.blocking.WebhookServiceImpl
import java.net.URLEncoder
+import java.util.function.Consumer
class FinchClientImpl(private val clientOptions: ClientOptions) : FinchClient {
@@ -88,6 +89,9 @@ class FinchClientImpl(private val clientOptions: ClientOptions) : FinchClient {
override fun withRawResponse(): FinchClient.WithRawResponse = withRawResponse
+ override fun withOptions(modifier: Consumer): FinchClient =
+ FinchClientImpl(clientOptions.toBuilder().apply(modifier::accept).build())
+
override fun accessTokens(): AccessTokenService = accessTokens
override fun hris(): HrisService = hris
@@ -125,6 +129,7 @@ class FinchClientImpl(private val clientOptions: ClientOptions) : FinchClient {
val request =
HttpRequest.builder()
.method(HttpMethod.POST)
+ .baseUrl(clientOptions.baseUrl())
.addPathSegments("auth", "token")
.body(
json(
@@ -155,7 +160,7 @@ class FinchClientImpl(private val clientOptions: ClientOptions) : FinchClient {
.httpClient(clientOptions.httpClient)
.jsonMapper(clientOptions.jsonMapper)
.clock(clientOptions.clock)
- .baseUrl(clientOptions.baseUrl)
+ .baseUrl(clientOptions.baseUrl())
.accessToken(accessToken)
.clientId(clientOptions.clientId())
.clientSecret(clientOptions.clientSecret())
@@ -224,6 +229,13 @@ class FinchClientImpl(private val clientOptions: ClientOptions) : FinchClient {
ConnectServiceImpl.WithRawResponseImpl(clientOptions)
}
+ override fun withOptions(
+ modifier: Consumer
+ ): FinchClient.WithRawResponse =
+ FinchClientImpl.WithRawResponseImpl(
+ clientOptions.toBuilder().apply(modifier::accept).build()
+ )
+
override fun accessTokens(): AccessTokenService.WithRawResponse = accessTokens
override fun hris(): HrisService.WithRawResponse = hris
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 cfdb5e56..e63f1d29 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
@@ -25,7 +25,7 @@ private constructor(
@get:JvmName("jsonMapper") val jsonMapper: JsonMapper,
@get:JvmName("streamHandlerExecutor") val streamHandlerExecutor: Executor,
@get:JvmName("clock") val clock: Clock,
- @get:JvmName("baseUrl") val baseUrl: String,
+ private val baseUrl: String?,
@get:JvmName("headers") val headers: Headers,
@get:JvmName("queryParams") val queryParams: QueryParams,
@get:JvmName("responseValidation") val responseValidation: Boolean,
@@ -43,6 +43,8 @@ private constructor(
}
}
+ fun baseUrl(): String = baseUrl ?: PRODUCTION_URL
+
fun accessToken(): Optional = Optional.ofNullable(accessToken)
fun clientId(): Optional = Optional.ofNullable(clientId)
@@ -78,7 +80,7 @@ private constructor(
private var jsonMapper: JsonMapper = jsonMapper()
private var streamHandlerExecutor: Executor? = null
private var clock: Clock = Clock.systemUTC()
- private var baseUrl: String = PRODUCTION_URL
+ private var baseUrl: String? = null
private var headers: Headers.Builder = Headers.builder()
private var queryParams: QueryParams.Builder = QueryParams.builder()
private var responseValidation: Boolean = false
@@ -108,7 +110,9 @@ private constructor(
webhookSecret = clientOptions.webhookSecret
}
- fun httpClient(httpClient: HttpClient) = apply { this.httpClient = httpClient }
+ fun httpClient(httpClient: HttpClient) = apply {
+ this.httpClient = PhantomReachableClosingHttpClient(httpClient)
+ }
fun checkJacksonVersionCompatibility(checkJacksonVersionCompatibility: Boolean) = apply {
this.checkJacksonVersionCompatibility = checkJacksonVersionCompatibility
@@ -122,7 +126,10 @@ private constructor(
fun clock(clock: Clock) = apply { this.clock = clock }
- fun baseUrl(baseUrl: String) = apply { this.baseUrl = baseUrl }
+ fun baseUrl(baseUrl: String?) = apply { this.baseUrl = baseUrl }
+
+ /** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */
+ fun baseUrl(baseUrl: Optional) = baseUrl(baseUrl.getOrNull())
fun responseValidation(responseValidation: Boolean) = apply {
this.responseValidation = responseValidation
@@ -233,8 +240,6 @@ private constructor(
fun removeAllQueryParams(keys: Set) = apply { queryParams.removeAll(keys) }
- fun baseUrl(): String = baseUrl
-
fun fromEnv() = apply {
System.getenv("FINCH_BASE_URL")?.let { baseUrl(it) }
System.getenv("FINCH_CLIENT_ID")?.let { clientId(it) }
@@ -287,13 +292,11 @@ private constructor(
return ClientOptions(
httpClient,
- PhantomReachableClosingHttpClient(
- RetryingHttpClient.builder()
- .httpClient(httpClient)
- .clock(clock)
- .maxRetries(maxRetries)
- .build()
- ),
+ RetryingHttpClient.builder()
+ .httpClient(httpClient)
+ .clock(clock)
+ .maxRetries(maxRetries)
+ .build(),
checkJacksonVersionCompatibility,
jsonMapper,
streamHandlerExecutor
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt
index c75e9fb9..ab9b11c1 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequest.kt
@@ -6,7 +6,7 @@ import com.tryfinch.api.core.toImmutable
class HttpRequest
private constructor(
@get:JvmName("method") val method: HttpMethod,
- @get:JvmName("url") val url: String?,
+ @get:JvmName("baseUrl") val baseUrl: String,
@get:JvmName("pathSegments") val pathSegments: List,
@get:JvmName("headers") val headers: Headers,
@get:JvmName("queryParams") val queryParams: QueryParams,
@@ -16,7 +16,7 @@ private constructor(
fun toBuilder(): Builder = Builder().from(this)
override fun toString(): String =
- "HttpRequest{method=$method, url=$url, pathSegments=$pathSegments, headers=$headers, queryParams=$queryParams, body=$body}"
+ "HttpRequest{method=$method, baseUrl=$baseUrl, pathSegments=$pathSegments, headers=$headers, queryParams=$queryParams, body=$body}"
companion object {
@JvmStatic fun builder() = Builder()
@@ -25,7 +25,7 @@ private constructor(
class Builder internal constructor() {
private var method: HttpMethod? = null
- private var url: String? = null
+ private var baseUrl: String? = null
private var pathSegments: MutableList = mutableListOf()
private var headers: Headers.Builder = Headers.builder()
private var queryParams: QueryParams.Builder = QueryParams.builder()
@@ -34,7 +34,7 @@ private constructor(
@JvmSynthetic
internal fun from(request: HttpRequest) = apply {
method = request.method
- url = request.url
+ baseUrl = request.baseUrl
pathSegments = request.pathSegments.toMutableList()
headers = request.headers.toBuilder()
queryParams = request.queryParams.toBuilder()
@@ -43,7 +43,7 @@ private constructor(
fun method(method: HttpMethod) = apply { this.method = method }
- fun url(url: String) = apply { this.url = url }
+ fun baseUrl(baseUrl: String) = apply { this.baseUrl = baseUrl }
fun addPathSegment(pathSegment: String) = apply { pathSegments.add(pathSegment) }
@@ -136,7 +136,7 @@ private constructor(
fun build(): HttpRequest =
HttpRequest(
checkRequired("method", method),
- url,
+ checkRequired("baseUrl", baseUrl),
pathSegments.toImmutable(),
headers.build(),
queryParams.build(),
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 2d9f9c47..b7429b6f 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
@@ -6,13 +6,10 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty
-import com.tryfinch.api.core.Enum
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.checkKnown
-import com.tryfinch.api.core.toImmutable
import com.tryfinch.api.errors.FinchInvalidDataException
import java.util.Collections
import java.util.Objects
@@ -21,7 +18,7 @@ import kotlin.jvm.optionals.getOrNull
class BenefitFeaturesAndOperations
private constructor(
- private val supportedFeatures: JsonField,
+ private val supportedFeatures: JsonField,
private val supportedOperations: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -30,7 +27,7 @@ private constructor(
private constructor(
@JsonProperty("supported_features")
@ExcludeMissing
- supportedFeatures: JsonField = JsonMissing.of(),
+ supportedFeatures: JsonField = JsonMissing.of(),
@JsonProperty("supported_operations")
@ExcludeMissing
supportedOperations: JsonField = JsonMissing.of(),
@@ -40,7 +37,7 @@ private constructor(
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun supportedFeatures(): Optional =
+ fun supportedFeatures(): Optional =
supportedFeatures.getOptional("supported_features")
/**
@@ -58,7 +55,7 @@ private constructor(
*/
@JsonProperty("supported_features")
@ExcludeMissing
- fun _supportedFeatures(): JsonField = supportedFeatures
+ fun _supportedFeatures(): JsonField = supportedFeatures
/**
* Returns the raw JSON value of [supportedOperations].
@@ -93,7 +90,7 @@ private constructor(
/** A builder for [BenefitFeaturesAndOperations]. */
class Builder internal constructor() {
- private var supportedFeatures: JsonField = JsonMissing.of()
+ private var supportedFeatures: JsonField = JsonMissing.of()
private var supportedOperations: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@@ -104,17 +101,17 @@ private constructor(
additionalProperties = benefitFeaturesAndOperations.additionalProperties.toMutableMap()
}
- fun supportedFeatures(supportedFeatures: BenefitFeature) =
+ fun supportedFeatures(supportedFeatures: SupportedBenefit) =
supportedFeatures(JsonField.of(supportedFeatures))
/**
* Sets [Builder.supportedFeatures] to an arbitrary JSON value.
*
- * You should usually call [Builder.supportedFeatures] with a well-typed [BenefitFeature]
+ * You should usually call [Builder.supportedFeatures] with a well-typed [SupportedBenefit]
* value instead. This method is primarily for setting the field to an undocumented or not
* yet supported value.
*/
- fun supportedFeatures(supportedFeatures: JsonField) = apply {
+ fun supportedFeatures(supportedFeatures: JsonField) = apply {
this.supportedFeatures = supportedFeatures
}
@@ -194,923 +191,6 @@ private constructor(
(supportedFeatures.asKnown().getOrNull()?.validity() ?: 0) +
(supportedOperations.asKnown().getOrNull()?.validity() ?: 0)
- class BenefitFeature
- private constructor(
- private val annualMaximum: JsonField,
- private val catchUp: JsonField,
- private val companyContribution: JsonField>,
- private val description: JsonField,
- private val employeeDeduction: JsonField>,
- private val frequencies: JsonField>,
- private val hsaContributionLimit: JsonField>,
- private val additionalProperties: MutableMap,
- ) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("annual_maximum")
- @ExcludeMissing
- annualMaximum: JsonField = JsonMissing.of(),
- @JsonProperty("catch_up")
- @ExcludeMissing
- catchUp: JsonField = JsonMissing.of(),
- @JsonProperty("company_contribution")
- @ExcludeMissing
- companyContribution: JsonField> = JsonMissing.of(),
- @JsonProperty("description")
- @ExcludeMissing
- description: JsonField = JsonMissing.of(),
- @JsonProperty("employee_deduction")
- @ExcludeMissing
- employeeDeduction: JsonField> = JsonMissing.of(),
- @JsonProperty("frequencies")
- @ExcludeMissing
- frequencies: JsonField> = JsonMissing.of(),
- @JsonProperty("hsa_contribution_limit")
- @ExcludeMissing
- hsaContributionLimit: JsonField> = JsonMissing.of(),
- ) : this(
- annualMaximum,
- catchUp,
- companyContribution,
- description,
- employeeDeduction,
- frequencies,
- hsaContributionLimit,
- mutableMapOf(),
- )
-
- /**
- * Whether the provider supports an annual maximum for this benefit.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun annualMaximum(): Optional = annualMaximum.getOptional("annual_maximum")
-
- /**
- * Whether the provider supports catch up for this benefit. This field will only be true for
- * retirement benefits.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun catchUp(): Optional = catchUp.getOptional("catch_up")
-
- /**
- * Supported contribution types. An empty array indicates contributions are not supported.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun companyContribution(): Optional> =
- companyContribution.getOptional("company_contribution")
-
- /**
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun description(): Optional = description.getOptional("description")
-
- /**
- * Supported deduction types. An empty array indicates deductions are not supported.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun employeeDeduction(): Optional> =
- employeeDeduction.getOptional("employee_deduction")
-
- /**
- * The list of frequencies supported by the provider for this benefit
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun frequencies(): Optional> =
- frequencies.getOptional("frequencies")
-
- /**
- * Whether the provider supports HSA contribution limits. Empty if this feature is not
- * supported for the benefit. This array only has values for HSA benefits.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun hsaContributionLimit(): Optional> =
- hsaContributionLimit.getOptional("hsa_contribution_limit")
-
- /**
- * Returns the raw JSON value of [annualMaximum].
- *
- * Unlike [annualMaximum], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("annual_maximum")
- @ExcludeMissing
- fun _annualMaximum(): JsonField = annualMaximum
-
- /**
- * Returns the raw JSON value of [catchUp].
- *
- * Unlike [catchUp], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("catch_up") @ExcludeMissing fun _catchUp(): JsonField = catchUp
-
- /**
- * Returns the raw JSON value of [companyContribution].
- *
- * Unlike [companyContribution], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("company_contribution")
- @ExcludeMissing
- fun _companyContribution(): JsonField> = companyContribution
-
- /**
- * Returns the raw JSON value of [description].
- *
- * Unlike [description], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("description")
- @ExcludeMissing
- fun _description(): JsonField = description
-
- /**
- * Returns the raw JSON value of [employeeDeduction].
- *
- * Unlike [employeeDeduction], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("employee_deduction")
- @ExcludeMissing
- fun _employeeDeduction(): JsonField> = employeeDeduction
-
- /**
- * Returns the raw JSON value of [frequencies].
- *
- * Unlike [frequencies], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("frequencies")
- @ExcludeMissing
- fun _frequencies(): JsonField> = frequencies
-
- /**
- * Returns the raw JSON value of [hsaContributionLimit].
- *
- * Unlike [hsaContributionLimit], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("hsa_contribution_limit")
- @ExcludeMissing
- fun _hsaContributionLimit(): JsonField> = hsaContributionLimit
-
- @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 [BenefitFeature]. */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BenefitFeature]. */
- class Builder internal constructor() {
-
- private var annualMaximum: JsonField = JsonMissing.of()
- private var catchUp: JsonField = JsonMissing.of()
- private var companyContribution: JsonField>? = null
- private var description: JsonField = JsonMissing.of()
- private var employeeDeduction: JsonField>? = null
- private var frequencies: JsonField>? = null
- private var hsaContributionLimit: JsonField>? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(benefitFeature: BenefitFeature) = apply {
- annualMaximum = benefitFeature.annualMaximum
- catchUp = benefitFeature.catchUp
- companyContribution = benefitFeature.companyContribution.map { it.toMutableList() }
- description = benefitFeature.description
- employeeDeduction = benefitFeature.employeeDeduction.map { it.toMutableList() }
- frequencies = benefitFeature.frequencies.map { it.toMutableList() }
- hsaContributionLimit =
- benefitFeature.hsaContributionLimit.map { it.toMutableList() }
- additionalProperties = benefitFeature.additionalProperties.toMutableMap()
- }
-
- /** Whether the provider supports an annual maximum for this benefit. */
- fun annualMaximum(annualMaximum: Boolean?) =
- annualMaximum(JsonField.ofNullable(annualMaximum))
-
- /**
- * Alias for [Builder.annualMaximum].
- *
- * This unboxed primitive overload exists for backwards compatibility.
- */
- fun annualMaximum(annualMaximum: Boolean) = annualMaximum(annualMaximum as Boolean?)
-
- /** Alias for calling [Builder.annualMaximum] with `annualMaximum.orElse(null)`. */
- fun annualMaximum(annualMaximum: Optional) =
- annualMaximum(annualMaximum.getOrNull())
-
- /**
- * Sets [Builder.annualMaximum] to an arbitrary JSON value.
- *
- * You should usually call [Builder.annualMaximum] with a well-typed [Boolean] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun annualMaximum(annualMaximum: JsonField) = apply {
- this.annualMaximum = annualMaximum
- }
-
- /**
- * Whether the provider supports catch up for this benefit. This field will only be true
- * for retirement benefits.
- */
- fun catchUp(catchUp: Boolean?) = catchUp(JsonField.ofNullable(catchUp))
-
- /**
- * Alias for [Builder.catchUp].
- *
- * This unboxed primitive overload exists for backwards compatibility.
- */
- fun catchUp(catchUp: Boolean) = catchUp(catchUp as Boolean?)
-
- /** Alias for calling [Builder.catchUp] with `catchUp.orElse(null)`. */
- fun catchUp(catchUp: Optional) = catchUp(catchUp.getOrNull())
-
- /**
- * Sets [Builder.catchUp] to an arbitrary JSON value.
- *
- * You should usually call [Builder.catchUp] with a well-typed [Boolean] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun catchUp(catchUp: JsonField) = apply { this.catchUp = catchUp }
-
- /**
- * Supported contribution types. An empty array indicates contributions are not
- * supported.
- */
- fun companyContribution(companyContribution: List?) =
- companyContribution(JsonField.ofNullable(companyContribution))
-
- /**
- * Alias for calling [Builder.companyContribution] with
- * `companyContribution.orElse(null)`.
- */
- fun companyContribution(companyContribution: Optional>) =
- companyContribution(companyContribution.getOrNull())
-
- /**
- * Sets [Builder.companyContribution] to an arbitrary JSON value.
- *
- * You should usually call [Builder.companyContribution] with a well-typed
- * `List` value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun companyContribution(companyContribution: JsonField>) =
- apply {
- this.companyContribution = companyContribution.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [CompanyContribution] to [Builder.companyContribution].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addCompanyContribution(companyContribution: CompanyContribution) = apply {
- this.companyContribution =
- (this.companyContribution ?: JsonField.of(mutableListOf())).also {
- checkKnown("companyContribution", it).add(companyContribution)
- }
- }
-
- fun description(description: String?) = description(JsonField.ofNullable(description))
-
- /** Alias for calling [Builder.description] with `description.orElse(null)`. */
- fun description(description: Optional) = description(description.getOrNull())
-
- /**
- * Sets [Builder.description] to an arbitrary JSON value.
- *
- * You should usually call [Builder.description] with a well-typed [String] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun description(description: JsonField) = apply {
- this.description = description
- }
-
- /** Supported deduction types. An empty array indicates deductions are not supported. */
- fun employeeDeduction(employeeDeduction: List?) =
- employeeDeduction(JsonField.ofNullable(employeeDeduction))
-
- /**
- * Alias for calling [Builder.employeeDeduction] with `employeeDeduction.orElse(null)`.
- */
- fun employeeDeduction(employeeDeduction: Optional>) =
- employeeDeduction(employeeDeduction.getOrNull())
-
- /**
- * Sets [Builder.employeeDeduction] to an arbitrary JSON value.
- *
- * You should usually call [Builder.employeeDeduction] with a well-typed
- * `List` value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun employeeDeduction(employeeDeduction: JsonField>) = apply {
- this.employeeDeduction = employeeDeduction.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [EmployeeDeduction] to [Builder.employeeDeduction].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addEmployeeDeduction(employeeDeduction: EmployeeDeduction) = apply {
- this.employeeDeduction =
- (this.employeeDeduction ?: JsonField.of(mutableListOf())).also {
- checkKnown("employeeDeduction", it).add(employeeDeduction)
- }
- }
-
- /** The list of frequencies supported by the provider for this benefit */
- fun frequencies(frequencies: List) =
- frequencies(JsonField.of(frequencies))
-
- /**
- * Sets [Builder.frequencies] to an arbitrary JSON value.
- *
- * You should usually call [Builder.frequencies] with a well-typed
- * `List` value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun frequencies(frequencies: JsonField>) = apply {
- this.frequencies = frequencies.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [BenefitFrequency] to [frequencies].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addFrequency(frequency: BenefitFrequency) = apply {
- frequencies =
- (frequencies ?: JsonField.of(mutableListOf())).also {
- checkKnown("frequencies", it).add(frequency)
- }
- }
-
- /**
- * Whether the provider supports HSA contribution limits. Empty if this feature is not
- * supported for the benefit. This array only has values for HSA benefits.
- */
- fun hsaContributionLimit(hsaContributionLimit: List?) =
- hsaContributionLimit(JsonField.ofNullable(hsaContributionLimit))
-
- /**
- * Alias for calling [Builder.hsaContributionLimit] with
- * `hsaContributionLimit.orElse(null)`.
- */
- fun hsaContributionLimit(hsaContributionLimit: Optional>) =
- hsaContributionLimit(hsaContributionLimit.getOrNull())
-
- /**
- * Sets [Builder.hsaContributionLimit] to an arbitrary JSON value.
- *
- * You should usually call [Builder.hsaContributionLimit] with a well-typed
- * `List` value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun hsaContributionLimit(hsaContributionLimit: JsonField>) =
- apply {
- this.hsaContributionLimit = hsaContributionLimit.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [HsaContributionLimit] to [Builder.hsaContributionLimit].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addHsaContributionLimit(hsaContributionLimit: HsaContributionLimit) = apply {
- this.hsaContributionLimit =
- (this.hsaContributionLimit ?: JsonField.of(mutableListOf())).also {
- checkKnown("hsaContributionLimit", it).add(hsaContributionLimit)
- }
- }
-
- 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 [BenefitFeature].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): BenefitFeature =
- BenefitFeature(
- annualMaximum,
- catchUp,
- (companyContribution ?: JsonMissing.of()).map { it.toImmutable() },
- description,
- (employeeDeduction ?: JsonMissing.of()).map { it.toImmutable() },
- (frequencies ?: JsonMissing.of()).map { it.toImmutable() },
- (hsaContributionLimit ?: JsonMissing.of()).map { it.toImmutable() },
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): BenefitFeature = apply {
- if (validated) {
- return@apply
- }
-
- annualMaximum()
- catchUp()
- companyContribution().ifPresent { it.forEach { it?.validate() } }
- description()
- employeeDeduction().ifPresent { it.forEach { it?.validate() } }
- frequencies().ifPresent { it.forEach { it?.validate() } }
- hsaContributionLimit().ifPresent { it.forEach { it?.validate() } }
- 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 (annualMaximum.asKnown().isPresent) 1 else 0) +
- (if (catchUp.asKnown().isPresent) 1 else 0) +
- (companyContribution.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() }
- ?: 0) +
- (if (description.asKnown().isPresent) 1 else 0) +
- (employeeDeduction.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() }
- ?: 0) +
- (frequencies.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) +
- (hsaContributionLimit.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() }
- ?: 0)
-
- class CompanyContribution
- @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 FIXED = of("fixed")
-
- @JvmField val PERCENT = of("percent")
-
- @JvmStatic fun of(value: String) = CompanyContribution(JsonField.of(value))
- }
-
- /** An enum containing [CompanyContribution]'s known values. */
- enum class Known {
- FIXED,
- PERCENT,
- }
-
- /**
- * An enum containing [CompanyContribution]'s known values, as well as an [_UNKNOWN]
- * member.
- *
- * An instance of [CompanyContribution] 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 {
- FIXED,
- PERCENT,
- /**
- * An enum member indicating that [CompanyContribution] 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) {
- FIXED -> Value.FIXED
- PERCENT -> Value.PERCENT
- 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) {
- FIXED -> Known.FIXED
- PERCENT -> Known.PERCENT
- else -> throw FinchInvalidDataException("Unknown CompanyContribution: $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
-
- fun validate(): CompanyContribution = 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 /* spotless:off */ other is CompanyContribution && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- class EmployeeDeduction
- @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 FIXED = of("fixed")
-
- @JvmField val PERCENT = of("percent")
-
- @JvmStatic fun of(value: String) = EmployeeDeduction(JsonField.of(value))
- }
-
- /** An enum containing [EmployeeDeduction]'s known values. */
- enum class Known {
- FIXED,
- PERCENT,
- }
-
- /**
- * An enum containing [EmployeeDeduction]'s known values, as well as an [_UNKNOWN]
- * member.
- *
- * An instance of [EmployeeDeduction] 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 {
- FIXED,
- PERCENT,
- /**
- * An enum member indicating that [EmployeeDeduction] 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) {
- FIXED -> Value.FIXED
- PERCENT -> Value.PERCENT
- 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) {
- FIXED -> Known.FIXED
- PERCENT -> Known.PERCENT
- else -> throw FinchInvalidDataException("Unknown EmployeeDeduction: $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
-
- fun validate(): EmployeeDeduction = 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 /* spotless:off */ other is EmployeeDeduction && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- class HsaContributionLimit
- @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 INDIVIDUAL = of("individual")
-
- @JvmField val FAMILY = of("family")
-
- @JvmStatic fun of(value: String) = HsaContributionLimit(JsonField.of(value))
- }
-
- /** An enum containing [HsaContributionLimit]'s known values. */
- enum class Known {
- INDIVIDUAL,
- FAMILY,
- }
-
- /**
- * An enum containing [HsaContributionLimit]'s known values, as well as an [_UNKNOWN]
- * member.
- *
- * An instance of [HsaContributionLimit] 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 {
- INDIVIDUAL,
- FAMILY,
- /**
- * An enum member indicating that [HsaContributionLimit] 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) {
- INDIVIDUAL -> Value.INDIVIDUAL
- FAMILY -> Value.FAMILY
- 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) {
- INDIVIDUAL -> Known.INDIVIDUAL
- FAMILY -> Known.FAMILY
- else -> throw FinchInvalidDataException("Unknown HsaContributionLimit: $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
-
- fun validate(): HsaContributionLimit = 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 /* spotless:off */ other is HsaContributionLimit && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is BenefitFeature && annualMaximum == other.annualMaximum && catchUp == other.catchUp && companyContribution == other.companyContribution && description == other.description && employeeDeduction == other.employeeDeduction && frequencies == other.frequencies && hsaContributionLimit == other.hsaContributionLimit && additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(annualMaximum, catchUp, companyContribution, description, employeeDeduction, frequencies, hsaContributionLimit, additionalProperties) }
- /* spotless:on */
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BenefitFeature{annualMaximum=$annualMaximum, catchUp=$catchUp, companyContribution=$companyContribution, description=$description, employeeDeduction=$employeeDeduction, frequencies=$frequencies, hsaContributionLimit=$hsaContributionLimit, additionalProperties=$additionalProperties}"
- }
-
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitListSupportedBenefitsResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitListSupportedBenefitsResponse.kt
deleted file mode 100644
index be8e05eb..00000000
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitListSupportedBenefitsResponse.kt
+++ /dev/null
@@ -1,918 +0,0 @@
-// File generated from our OpenAPI spec by Stainless.
-
-package com.tryfinch.api.models
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter
-import com.fasterxml.jackson.annotation.JsonAnySetter
-import com.fasterxml.jackson.annotation.JsonCreator
-import com.fasterxml.jackson.annotation.JsonProperty
-import com.tryfinch.api.core.Enum
-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.checkKnown
-import com.tryfinch.api.core.toImmutable
-import com.tryfinch.api.errors.FinchInvalidDataException
-import java.util.Collections
-import java.util.Objects
-import java.util.Optional
-import kotlin.jvm.optionals.getOrNull
-
-class BenefitListSupportedBenefitsResponse
-private constructor(
- private val annualMaximum: JsonField,
- private val catchUp: JsonField,
- private val companyContribution: JsonField>,
- private val description: JsonField,
- private val employeeDeduction: JsonField>,
- private val frequencies: JsonField>,
- private val hsaContributionLimit: JsonField>,
- private val additionalProperties: MutableMap,
-) {
-
- @JsonCreator
- private constructor(
- @JsonProperty("annual_maximum")
- @ExcludeMissing
- annualMaximum: JsonField = JsonMissing.of(),
- @JsonProperty("catch_up") @ExcludeMissing catchUp: JsonField = JsonMissing.of(),
- @JsonProperty("company_contribution")
- @ExcludeMissing
- companyContribution: JsonField> = JsonMissing.of(),
- @JsonProperty("description")
- @ExcludeMissing
- description: JsonField = JsonMissing.of(),
- @JsonProperty("employee_deduction")
- @ExcludeMissing
- employeeDeduction: JsonField> = JsonMissing.of(),
- @JsonProperty("frequencies")
- @ExcludeMissing
- frequencies: JsonField> = JsonMissing.of(),
- @JsonProperty("hsa_contribution_limit")
- @ExcludeMissing
- hsaContributionLimit: JsonField> = JsonMissing.of(),
- ) : this(
- annualMaximum,
- catchUp,
- companyContribution,
- description,
- employeeDeduction,
- frequencies,
- hsaContributionLimit,
- mutableMapOf(),
- )
-
- /**
- * Whether the provider supports an annual maximum for this benefit.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun annualMaximum(): Optional = annualMaximum.getOptional("annual_maximum")
-
- /**
- * Whether the provider supports catch up for this benefit. This field will only be true for
- * retirement benefits.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun catchUp(): Optional = catchUp.getOptional("catch_up")
-
- /**
- * Supported contribution types. An empty array indicates contributions are not supported.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun companyContribution(): Optional> =
- companyContribution.getOptional("company_contribution")
-
- /**
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun description(): Optional = description.getOptional("description")
-
- /**
- * Supported deduction types. An empty array indicates deductions are not supported.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun employeeDeduction(): Optional> =
- employeeDeduction.getOptional("employee_deduction")
-
- /**
- * The list of frequencies supported by the provider for this benefit
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun frequencies(): Optional> = frequencies.getOptional("frequencies")
-
- /**
- * Whether the provider supports HSA contribution limits. Empty if this feature is not supported
- * for the benefit. This array only has values for HSA benefits.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun hsaContributionLimit(): Optional> =
- hsaContributionLimit.getOptional("hsa_contribution_limit")
-
- /**
- * Returns the raw JSON value of [annualMaximum].
- *
- * Unlike [annualMaximum], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("annual_maximum")
- @ExcludeMissing
- fun _annualMaximum(): JsonField = annualMaximum
-
- /**
- * Returns the raw JSON value of [catchUp].
- *
- * Unlike [catchUp], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("catch_up") @ExcludeMissing fun _catchUp(): JsonField = catchUp
-
- /**
- * Returns the raw JSON value of [companyContribution].
- *
- * Unlike [companyContribution], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("company_contribution")
- @ExcludeMissing
- fun _companyContribution(): JsonField> = companyContribution
-
- /**
- * Returns the raw JSON value of [description].
- *
- * Unlike [description], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("description") @ExcludeMissing fun _description(): JsonField = description
-
- /**
- * Returns the raw JSON value of [employeeDeduction].
- *
- * Unlike [employeeDeduction], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("employee_deduction")
- @ExcludeMissing
- fun _employeeDeduction(): JsonField> = employeeDeduction
-
- /**
- * Returns the raw JSON value of [frequencies].
- *
- * Unlike [frequencies], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("frequencies")
- @ExcludeMissing
- fun _frequencies(): JsonField> = frequencies
-
- /**
- * Returns the raw JSON value of [hsaContributionLimit].
- *
- * Unlike [hsaContributionLimit], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("hsa_contribution_limit")
- @ExcludeMissing
- fun _hsaContributionLimit(): JsonField> = hsaContributionLimit
-
- @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
- * [BenefitListSupportedBenefitsResponse].
- */
- @JvmStatic fun builder() = Builder()
- }
-
- /** A builder for [BenefitListSupportedBenefitsResponse]. */
- class Builder internal constructor() {
-
- private var annualMaximum: JsonField = JsonMissing.of()
- private var catchUp: JsonField = JsonMissing.of()
- private var companyContribution: JsonField>? = null
- private var description: JsonField = JsonMissing.of()
- private var employeeDeduction: JsonField>? = null
- private var frequencies: JsonField>? = null
- private var hsaContributionLimit: JsonField>? = null
- private var additionalProperties: MutableMap = mutableMapOf()
-
- @JvmSynthetic
- internal fun from(
- benefitListSupportedBenefitsResponse: BenefitListSupportedBenefitsResponse
- ) = apply {
- annualMaximum = benefitListSupportedBenefitsResponse.annualMaximum
- catchUp = benefitListSupportedBenefitsResponse.catchUp
- companyContribution =
- benefitListSupportedBenefitsResponse.companyContribution.map { it.toMutableList() }
- description = benefitListSupportedBenefitsResponse.description
- employeeDeduction =
- benefitListSupportedBenefitsResponse.employeeDeduction.map { it.toMutableList() }
- frequencies =
- benefitListSupportedBenefitsResponse.frequencies.map { it.toMutableList() }
- hsaContributionLimit =
- benefitListSupportedBenefitsResponse.hsaContributionLimit.map { it.toMutableList() }
- additionalProperties =
- benefitListSupportedBenefitsResponse.additionalProperties.toMutableMap()
- }
-
- /** Whether the provider supports an annual maximum for this benefit. */
- fun annualMaximum(annualMaximum: Boolean?) =
- annualMaximum(JsonField.ofNullable(annualMaximum))
-
- /**
- * Alias for [Builder.annualMaximum].
- *
- * This unboxed primitive overload exists for backwards compatibility.
- */
- fun annualMaximum(annualMaximum: Boolean) = annualMaximum(annualMaximum as Boolean?)
-
- /** Alias for calling [Builder.annualMaximum] with `annualMaximum.orElse(null)`. */
- fun annualMaximum(annualMaximum: Optional) =
- annualMaximum(annualMaximum.getOrNull())
-
- /**
- * Sets [Builder.annualMaximum] to an arbitrary JSON value.
- *
- * You should usually call [Builder.annualMaximum] with a well-typed [Boolean] value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun annualMaximum(annualMaximum: JsonField) = apply {
- this.annualMaximum = annualMaximum
- }
-
- /**
- * Whether the provider supports catch up for this benefit. This field will only be true for
- * retirement benefits.
- */
- fun catchUp(catchUp: Boolean?) = catchUp(JsonField.ofNullable(catchUp))
-
- /**
- * Alias for [Builder.catchUp].
- *
- * This unboxed primitive overload exists for backwards compatibility.
- */
- fun catchUp(catchUp: Boolean) = catchUp(catchUp as Boolean?)
-
- /** Alias for calling [Builder.catchUp] with `catchUp.orElse(null)`. */
- fun catchUp(catchUp: Optional) = catchUp(catchUp.getOrNull())
-
- /**
- * Sets [Builder.catchUp] to an arbitrary JSON value.
- *
- * You should usually call [Builder.catchUp] with a well-typed [Boolean] value instead. This
- * method is primarily for setting the field to an undocumented or not yet supported value.
- */
- fun catchUp(catchUp: JsonField) = apply { this.catchUp = catchUp }
-
- /**
- * Supported contribution types. An empty array indicates contributions are not supported.
- */
- fun companyContribution(companyContribution: List?) =
- companyContribution(JsonField.ofNullable(companyContribution))
-
- /**
- * Alias for calling [Builder.companyContribution] with `companyContribution.orElse(null)`.
- */
- fun companyContribution(companyContribution: Optional>) =
- companyContribution(companyContribution.getOrNull())
-
- /**
- * Sets [Builder.companyContribution] to an arbitrary JSON value.
- *
- * You should usually call [Builder.companyContribution] with a well-typed
- * `List` value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun companyContribution(companyContribution: JsonField>) =
- apply {
- this.companyContribution = companyContribution.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [CompanyContribution] to [Builder.companyContribution].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addCompanyContribution(companyContribution: CompanyContribution) = apply {
- this.companyContribution =
- (this.companyContribution ?: JsonField.of(mutableListOf())).also {
- checkKnown("companyContribution", it).add(companyContribution)
- }
- }
-
- fun description(description: String?) = description(JsonField.ofNullable(description))
-
- /** Alias for calling [Builder.description] with `description.orElse(null)`. */
- fun description(description: Optional) = description(description.getOrNull())
-
- /**
- * Sets [Builder.description] to an arbitrary JSON value.
- *
- * You should usually call [Builder.description] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun description(description: JsonField) = apply { this.description = description }
-
- /** Supported deduction types. An empty array indicates deductions are not supported. */
- fun employeeDeduction(employeeDeduction: List?) =
- employeeDeduction(JsonField.ofNullable(employeeDeduction))
-
- /** Alias for calling [Builder.employeeDeduction] with `employeeDeduction.orElse(null)`. */
- fun employeeDeduction(employeeDeduction: Optional>) =
- employeeDeduction(employeeDeduction.getOrNull())
-
- /**
- * Sets [Builder.employeeDeduction] to an arbitrary JSON value.
- *
- * You should usually call [Builder.employeeDeduction] with a well-typed
- * `List` value instead. This method is primarily for setting the field
- * to an undocumented or not yet supported value.
- */
- fun employeeDeduction(employeeDeduction: JsonField>) = apply {
- this.employeeDeduction = employeeDeduction.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [EmployeeDeduction] to [Builder.employeeDeduction].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addEmployeeDeduction(employeeDeduction: EmployeeDeduction) = apply {
- this.employeeDeduction =
- (this.employeeDeduction ?: JsonField.of(mutableListOf())).also {
- checkKnown("employeeDeduction", it).add(employeeDeduction)
- }
- }
-
- /** The list of frequencies supported by the provider for this benefit */
- fun frequencies(frequencies: List) =
- frequencies(JsonField.of(frequencies))
-
- /**
- * Sets [Builder.frequencies] to an arbitrary JSON value.
- *
- * You should usually call [Builder.frequencies] with a well-typed `List`
- * value instead. This method is primarily for setting the field to an undocumented or not
- * yet supported value.
- */
- fun frequencies(frequencies: JsonField>) = apply {
- this.frequencies = frequencies.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [BenefitFrequency] to [frequencies].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addFrequency(frequency: BenefitFrequency) = apply {
- frequencies =
- (frequencies ?: JsonField.of(mutableListOf())).also {
- checkKnown("frequencies", it).add(frequency)
- }
- }
-
- /**
- * Whether the provider supports HSA contribution limits. Empty if this feature is not
- * supported for the benefit. This array only has values for HSA benefits.
- */
- fun hsaContributionLimit(hsaContributionLimit: List?) =
- hsaContributionLimit(JsonField.ofNullable(hsaContributionLimit))
-
- /**
- * Alias for calling [Builder.hsaContributionLimit] with
- * `hsaContributionLimit.orElse(null)`.
- */
- fun hsaContributionLimit(hsaContributionLimit: Optional>) =
- hsaContributionLimit(hsaContributionLimit.getOrNull())
-
- /**
- * Sets [Builder.hsaContributionLimit] to an arbitrary JSON value.
- *
- * You should usually call [Builder.hsaContributionLimit] with a well-typed
- * `List` value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
- */
- fun hsaContributionLimit(hsaContributionLimit: JsonField>) =
- apply {
- this.hsaContributionLimit = hsaContributionLimit.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [HsaContributionLimit] to [Builder.hsaContributionLimit].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addHsaContributionLimit(hsaContributionLimit: HsaContributionLimit) = apply {
- this.hsaContributionLimit =
- (this.hsaContributionLimit ?: JsonField.of(mutableListOf())).also {
- checkKnown("hsaContributionLimit", it).add(hsaContributionLimit)
- }
- }
-
- 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 [BenefitListSupportedBenefitsResponse].
- *
- * Further updates to this [Builder] will not mutate the returned instance.
- */
- fun build(): BenefitListSupportedBenefitsResponse =
- BenefitListSupportedBenefitsResponse(
- annualMaximum,
- catchUp,
- (companyContribution ?: JsonMissing.of()).map { it.toImmutable() },
- description,
- (employeeDeduction ?: JsonMissing.of()).map { it.toImmutable() },
- (frequencies ?: JsonMissing.of()).map { it.toImmutable() },
- (hsaContributionLimit ?: JsonMissing.of()).map { it.toImmutable() },
- additionalProperties.toMutableMap(),
- )
- }
-
- private var validated: Boolean = false
-
- fun validate(): BenefitListSupportedBenefitsResponse = apply {
- if (validated) {
- return@apply
- }
-
- annualMaximum()
- catchUp()
- companyContribution().ifPresent { it.forEach { it?.validate() } }
- description()
- employeeDeduction().ifPresent { it.forEach { it?.validate() } }
- frequencies().ifPresent { it.forEach { it?.validate() } }
- hsaContributionLimit().ifPresent { it.forEach { it?.validate() } }
- 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 (annualMaximum.asKnown().isPresent) 1 else 0) +
- (if (catchUp.asKnown().isPresent) 1 else 0) +
- (companyContribution.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() }
- ?: 0) +
- (if (description.asKnown().isPresent) 1 else 0) +
- (employeeDeduction.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() }
- ?: 0) +
- (frequencies.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() } ?: 0) +
- (hsaContributionLimit.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() }
- ?: 0)
-
- class CompanyContribution
- @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 FIXED = of("fixed")
-
- @JvmField val PERCENT = of("percent")
-
- @JvmStatic fun of(value: String) = CompanyContribution(JsonField.of(value))
- }
-
- /** An enum containing [CompanyContribution]'s known values. */
- enum class Known {
- FIXED,
- PERCENT,
- }
-
- /**
- * An enum containing [CompanyContribution]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [CompanyContribution] 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 {
- FIXED,
- PERCENT,
- /**
- * An enum member indicating that [CompanyContribution] 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) {
- FIXED -> Value.FIXED
- PERCENT -> Value.PERCENT
- 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) {
- FIXED -> Known.FIXED
- PERCENT -> Known.PERCENT
- else -> throw FinchInvalidDataException("Unknown CompanyContribution: $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
-
- fun validate(): CompanyContribution = 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 /* spotless:off */ other is CompanyContribution && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- class EmployeeDeduction @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 FIXED = of("fixed")
-
- @JvmField val PERCENT = of("percent")
-
- @JvmStatic fun of(value: String) = EmployeeDeduction(JsonField.of(value))
- }
-
- /** An enum containing [EmployeeDeduction]'s known values. */
- enum class Known {
- FIXED,
- PERCENT,
- }
-
- /**
- * An enum containing [EmployeeDeduction]'s known values, as well as an [_UNKNOWN] member.
- *
- * An instance of [EmployeeDeduction] 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 {
- FIXED,
- PERCENT,
- /**
- * An enum member indicating that [EmployeeDeduction] 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) {
- FIXED -> Value.FIXED
- PERCENT -> Value.PERCENT
- 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) {
- FIXED -> Known.FIXED
- PERCENT -> Known.PERCENT
- else -> throw FinchInvalidDataException("Unknown EmployeeDeduction: $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
-
- fun validate(): EmployeeDeduction = 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 /* spotless:off */ other is EmployeeDeduction && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- class HsaContributionLimit
- @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 INDIVIDUAL = of("individual")
-
- @JvmField val FAMILY = of("family")
-
- @JvmStatic fun of(value: String) = HsaContributionLimit(JsonField.of(value))
- }
-
- /** An enum containing [HsaContributionLimit]'s known values. */
- enum class Known {
- INDIVIDUAL,
- FAMILY,
- }
-
- /**
- * An enum containing [HsaContributionLimit]'s known values, as well as an [_UNKNOWN]
- * member.
- *
- * An instance of [HsaContributionLimit] 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 {
- INDIVIDUAL,
- FAMILY,
- /**
- * An enum member indicating that [HsaContributionLimit] 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) {
- INDIVIDUAL -> Value.INDIVIDUAL
- FAMILY -> Value.FAMILY
- 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) {
- INDIVIDUAL -> Known.INDIVIDUAL
- FAMILY -> Known.FAMILY
- else -> throw FinchInvalidDataException("Unknown HsaContributionLimit: $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
-
- fun validate(): HsaContributionLimit = 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 /* spotless:off */ other is HsaContributionLimit && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is BenefitListSupportedBenefitsResponse && annualMaximum == other.annualMaximum && catchUp == other.catchUp && companyContribution == other.companyContribution && description == other.description && employeeDeduction == other.employeeDeduction && frequencies == other.frequencies && hsaContributionLimit == other.hsaContributionLimit && additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(annualMaximum, catchUp, companyContribution, description, employeeDeduction, frequencies, hsaContributionLimit, additionalProperties) }
- /* spotless:on */
-
- override fun hashCode(): Int = hashCode
-
- override fun toString() =
- "BenefitListSupportedBenefitsResponse{annualMaximum=$annualMaximum, catchUp=$catchUp, companyContribution=$companyContribution, description=$description, employeeDeduction=$employeeDeduction, frequencies=$frequencies, hsaContributionLimit=$hsaContributionLimit, additionalProperties=$additionalProperties}"
-}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt
index 27b2ed15..b8526345 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitType.kt
@@ -21,6 +21,8 @@ class BenefitType @JsonCreator private constructor(private val value: JsonField<
companion object {
+ @JvmField val _457 = of("457")
+
@JvmField val _401K = of("401k")
@JvmField val _401K_ROTH = of("401k_roth")
@@ -31,58 +33,56 @@ class BenefitType @JsonCreator private constructor(private val value: JsonField<
@JvmField val _403B_ROTH = of("403b_roth")
- @JvmField val _457 = of("457")
-
@JvmField val _457_ROTH = of("457_roth")
- @JvmField val S125_MEDICAL = of("s125_medical")
-
- @JvmField val S125_DENTAL = of("s125_dental")
+ @JvmField val COMMUTER = of("commuter")
- @JvmField val S125_VISION = of("s125_vision")
+ @JvmField val CUSTOM_POST_TAX = of("custom_post_tax")
- @JvmField val HSA_PRE = of("hsa_pre")
+ @JvmField val CUSTOM_PRE_TAX = of("custom_pre_tax")
- @JvmField val HSA_POST = of("hsa_post")
+ @JvmField val FSA_DEPENDENT_CARE = of("fsa_dependent_care")
@JvmField val FSA_MEDICAL = of("fsa_medical")
- @JvmField val FSA_DEPENDENT_CARE = of("fsa_dependent_care")
+ @JvmField val HSA_POST = of("hsa_post")
- @JvmField val SIMPLE_IRA = of("simple_ira")
+ @JvmField val HSA_PRE = of("hsa_pre")
- @JvmField val SIMPLE = of("simple")
+ @JvmField val S125_DENTAL = of("s125_dental")
- @JvmField val COMMUTER = of("commuter")
+ @JvmField val S125_MEDICAL = of("s125_medical")
- @JvmField val CUSTOM_POST_TAX = of("custom_post_tax")
+ @JvmField val S125_VISION = of("s125_vision")
- @JvmField val CUSTOM_PRE_TAX = of("custom_pre_tax")
+ @JvmField val SIMPLE = of("simple")
+
+ @JvmField val SIMPLE_IRA = of("simple_ira")
@JvmStatic fun of(value: String) = BenefitType(JsonField.of(value))
}
/** An enum containing [BenefitType]'s known values. */
enum class Known {
+ _457,
_401K,
_401K_ROTH,
_401K_LOAN,
_403B,
_403B_ROTH,
- _457,
_457_ROTH,
- S125_MEDICAL,
- S125_DENTAL,
- S125_VISION,
- HSA_PRE,
- HSA_POST,
- FSA_MEDICAL,
- FSA_DEPENDENT_CARE,
- SIMPLE_IRA,
- SIMPLE,
COMMUTER,
CUSTOM_POST_TAX,
CUSTOM_PRE_TAX,
+ FSA_DEPENDENT_CARE,
+ FSA_MEDICAL,
+ HSA_POST,
+ HSA_PRE,
+ S125_DENTAL,
+ S125_MEDICAL,
+ S125_VISION,
+ SIMPLE,
+ SIMPLE_IRA,
}
/**
@@ -95,25 +95,25 @@ class BenefitType @JsonCreator private constructor(private val value: JsonField<
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
+ _457,
_401K,
_401K_ROTH,
_401K_LOAN,
_403B,
_403B_ROTH,
- _457,
_457_ROTH,
- S125_MEDICAL,
- S125_DENTAL,
- S125_VISION,
- HSA_PRE,
- HSA_POST,
- FSA_MEDICAL,
- FSA_DEPENDENT_CARE,
- SIMPLE_IRA,
- SIMPLE,
COMMUTER,
CUSTOM_POST_TAX,
CUSTOM_PRE_TAX,
+ FSA_DEPENDENT_CARE,
+ FSA_MEDICAL,
+ HSA_POST,
+ HSA_PRE,
+ S125_DENTAL,
+ S125_MEDICAL,
+ S125_VISION,
+ SIMPLE,
+ SIMPLE_IRA,
/** An enum member indicating that [BenefitType] was instantiated with an unknown value. */
_UNKNOWN,
}
@@ -127,25 +127,25 @@ class BenefitType @JsonCreator private constructor(private val value: JsonField<
*/
fun value(): Value =
when (this) {
+ _457 -> Value._457
_401K -> Value._401K
_401K_ROTH -> Value._401K_ROTH
_401K_LOAN -> Value._401K_LOAN
_403B -> Value._403B
_403B_ROTH -> Value._403B_ROTH
- _457 -> Value._457
_457_ROTH -> Value._457_ROTH
- S125_MEDICAL -> Value.S125_MEDICAL
- S125_DENTAL -> Value.S125_DENTAL
- S125_VISION -> Value.S125_VISION
- HSA_PRE -> Value.HSA_PRE
- HSA_POST -> Value.HSA_POST
- FSA_MEDICAL -> Value.FSA_MEDICAL
- FSA_DEPENDENT_CARE -> Value.FSA_DEPENDENT_CARE
- SIMPLE_IRA -> Value.SIMPLE_IRA
- SIMPLE -> Value.SIMPLE
COMMUTER -> Value.COMMUTER
CUSTOM_POST_TAX -> Value.CUSTOM_POST_TAX
CUSTOM_PRE_TAX -> Value.CUSTOM_PRE_TAX
+ FSA_DEPENDENT_CARE -> Value.FSA_DEPENDENT_CARE
+ FSA_MEDICAL -> Value.FSA_MEDICAL
+ HSA_POST -> Value.HSA_POST
+ HSA_PRE -> Value.HSA_PRE
+ S125_DENTAL -> Value.S125_DENTAL
+ S125_MEDICAL -> Value.S125_MEDICAL
+ S125_VISION -> Value.S125_VISION
+ SIMPLE -> Value.SIMPLE
+ SIMPLE_IRA -> Value.SIMPLE_IRA
else -> Value._UNKNOWN
}
@@ -159,25 +159,25 @@ class BenefitType @JsonCreator private constructor(private val value: JsonField<
*/
fun known(): Known =
when (this) {
+ _457 -> Known._457
_401K -> Known._401K
_401K_ROTH -> Known._401K_ROTH
_401K_LOAN -> Known._401K_LOAN
_403B -> Known._403B
_403B_ROTH -> Known._403B_ROTH
- _457 -> Known._457
_457_ROTH -> Known._457_ROTH
- S125_MEDICAL -> Known.S125_MEDICAL
- S125_DENTAL -> Known.S125_DENTAL
- S125_VISION -> Known.S125_VISION
- HSA_PRE -> Known.HSA_PRE
- HSA_POST -> Known.HSA_POST
- FSA_MEDICAL -> Known.FSA_MEDICAL
- FSA_DEPENDENT_CARE -> Known.FSA_DEPENDENT_CARE
- SIMPLE_IRA -> Known.SIMPLE_IRA
- SIMPLE -> Known.SIMPLE
COMMUTER -> Known.COMMUTER
CUSTOM_POST_TAX -> Known.CUSTOM_POST_TAX
CUSTOM_PRE_TAX -> Known.CUSTOM_PRE_TAX
+ FSA_DEPENDENT_CARE -> Known.FSA_DEPENDENT_CARE
+ FSA_MEDICAL -> Known.FSA_MEDICAL
+ HSA_POST -> Known.HSA_POST
+ HSA_PRE -> Known.HSA_PRE
+ S125_DENTAL -> Known.S125_DENTAL
+ S125_MEDICAL -> Known.S125_MEDICAL
+ S125_VISION -> Known.S125_VISION
+ SIMPLE -> Known.SIMPLE
+ SIMPLE_IRA -> Known.SIMPLE_IRA
else -> throw FinchInvalidDataException("Unknown BenefitType: $value")
}
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 7e1b5ca6..a2c22053 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
@@ -68,7 +68,7 @@ private constructor(
fun manual(): Optional = body.manual()
/**
- * The number of minutes until the session expires (defaults to 43,200, which is 30 days)
+ * The number of minutes until the session expires (defaults to 129,600, which is 90 days)
*
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -297,7 +297,7 @@ private constructor(
fun manual(manual: JsonField) = apply { body.manual(manual) }
/**
- * The number of minutes until the session expires (defaults to 43,200, which is 30 days)
+ * The number of minutes until the session expires (defaults to 129,600, which is 90 days)
*/
fun minutesToExpire(minutesToExpire: Double?) = apply {
body.minutesToExpire(minutesToExpire)
@@ -586,7 +586,7 @@ private constructor(
fun manual(): Optional = manual.getOptional("manual")
/**
- * The number of minutes until the session expires (defaults to 43,200, which is 30 days)
+ * The number of minutes until the session expires (defaults to 129,600, which is 90 days)
*
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
@@ -847,7 +847,7 @@ private constructor(
fun manual(manual: JsonField) = apply { this.manual = manual }
/**
- * The number of minutes until the session expires (defaults to 43,200, which is 30
+ * The number of minutes until the session expires (defaults to 129,600, which is 90
* days)
*/
fun minutesToExpire(minutesToExpire: Double?) =
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 bd97abad..e95ca383 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
@@ -207,7 +207,6 @@ private constructor(
private constructor(
private val id: JsonField,
private val classCode: JsonField,
- private val customFields: JsonField>,
private val department: JsonField,
private val employment: JsonField,
private val employmentStatus: JsonField,
@@ -221,10 +220,11 @@ private constructor(
private val middleName: JsonField,
private val startDate: JsonField,
private val title: JsonField,
- private val workId: JsonField,
+ private val customFields: JsonField>,
private val income: JsonField,
private val incomeHistory: JsonField>,
private val sourceId: JsonField,
+ private val workId: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -234,9 +234,6 @@ private constructor(
@JsonProperty("class_code")
@ExcludeMissing
classCode: JsonField = JsonMissing.of(),
- @JsonProperty("custom_fields")
- @ExcludeMissing
- customFields: JsonField> = JsonMissing.of(),
@JsonProperty("department")
@ExcludeMissing
department: JsonField = JsonMissing.of(),
@@ -270,7 +267,9 @@ private constructor(
@ExcludeMissing
startDate: JsonField = JsonMissing.of(),
@JsonProperty("title") @ExcludeMissing title: JsonField = JsonMissing.of(),
- @JsonProperty("work_id") @ExcludeMissing workId: JsonField = JsonMissing.of(),
+ @JsonProperty("custom_fields")
+ @ExcludeMissing
+ customFields: JsonField> = JsonMissing.of(),
@JsonProperty("income") @ExcludeMissing income: JsonField = JsonMissing.of(),
@JsonProperty("income_history")
@ExcludeMissing
@@ -278,10 +277,10 @@ private constructor(
@JsonProperty("source_id")
@ExcludeMissing
sourceId: JsonField = JsonMissing.of(),
+ @JsonProperty("work_id") @ExcludeMissing workId: JsonField = JsonMissing.of(),
) : this(
id,
classCode,
- customFields,
department,
employment,
employmentStatus,
@@ -295,10 +294,11 @@ private constructor(
middleName,
startDate,
title,
- workId,
+ customFields,
income,
incomeHistory,
sourceId,
+ workId,
mutableMapOf(),
)
@@ -318,15 +318,6 @@ private constructor(
*/
fun classCode(): Optional = classCode.getOptional("class_code")
- /**
- * Custom fields for the individual. These are fields which are defined by the employer in
- * the system. Custom fields are not currently supported for assisted connections.
- *
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
- * server responded with an unexpected value).
- */
- fun customFields(): Optional> = customFields.getOptional("custom_fields")
-
/**
* The department object.
*
@@ -427,12 +418,13 @@ private constructor(
fun title(): Optional = title.getOptional("title")
/**
- * This field is deprecated in favour of `source_id`
+ * Custom fields for the individual. These are fields which are defined by the employer in
+ * the system. Custom fields are not currently supported for assisted connections.
*
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- @Deprecated("deprecated") fun workId(): Optional = workId.getOptional("work_id")
+ fun customFields(): Optional> = customFields.getOptional("custom_fields")
/**
* The employee's income as reported by the provider. This may not always be annualized
@@ -460,6 +452,14 @@ private constructor(
*/
fun sourceId(): Optional = sourceId.getOptional("source_id")
+ /**
+ * This field is deprecated in favour of `source_id`
+ *
+ * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ @Deprecated("deprecated") fun workId(): Optional = workId.getOptional("work_id")
+
/**
* Returns the raw JSON value of [id].
*
@@ -474,16 +474,6 @@ private constructor(
*/
@JsonProperty("class_code") @ExcludeMissing fun _classCode(): JsonField = classCode
- /**
- * Returns the raw JSON value of [customFields].
- *
- * Unlike [customFields], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("custom_fields")
- @ExcludeMissing
- fun _customFields(): JsonField> = customFields
-
/**
* Returns the raw JSON value of [department].
*
@@ -588,14 +578,14 @@ private constructor(
@JsonProperty("title") @ExcludeMissing fun _title(): JsonField = title
/**
- * Returns the raw JSON value of [workId].
+ * Returns the raw JSON value of [customFields].
*
- * Unlike [workId], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [customFields], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- @Deprecated("deprecated")
- @JsonProperty("work_id")
+ @JsonProperty("custom_fields")
@ExcludeMissing
- fun _workId(): JsonField = workId
+ fun _customFields(): JsonField> = customFields
/**
* Returns the raw JSON value of [income].
@@ -621,6 +611,16 @@ private constructor(
*/
@JsonProperty("source_id") @ExcludeMissing fun _sourceId(): JsonField = sourceId
+ /**
+ * Returns the raw JSON value of [workId].
+ *
+ * Unlike [workId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @Deprecated("deprecated")
+ @JsonProperty("work_id")
+ @ExcludeMissing
+ fun _workId(): JsonField = workId
+
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -642,7 +642,6 @@ private constructor(
* ```java
* .id()
* .classCode()
- * .customFields()
* .department()
* .employment()
* .employmentStatus()
@@ -656,7 +655,6 @@ private constructor(
* .middleName()
* .startDate()
* .title()
- * .workId()
* ```
*/
@JvmStatic fun builder() = Builder()
@@ -667,7 +665,6 @@ private constructor(
private var id: JsonField? = null
private var classCode: JsonField? = null
- private var customFields: JsonField>? = null
private var department: JsonField? = null
private var employment: JsonField? = null
private var employmentStatus: JsonField? = null
@@ -681,17 +678,17 @@ private constructor(
private var middleName: JsonField? = null
private var startDate: JsonField? = null
private var title: JsonField? = null
- private var workId: JsonField? = null
+ private var customFields: JsonField>? = null
private var income: JsonField = JsonMissing.of()
private var incomeHistory: JsonField>? = null
private var sourceId: JsonField = JsonMissing.of()
+ private var workId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(unionMember0: UnionMember0) = apply {
id = unionMember0.id
classCode = unionMember0.classCode
- customFields = unionMember0.customFields.map { it.toMutableList() }
department = unionMember0.department
employment = unionMember0.employment
employmentStatus = unionMember0.employmentStatus
@@ -705,10 +702,11 @@ private constructor(
middleName = unionMember0.middleName
startDate = unionMember0.startDate
title = unionMember0.title
- workId = unionMember0.workId
+ customFields = unionMember0.customFields.map { it.toMutableList() }
income = unionMember0.income
incomeHistory = unionMember0.incomeHistory.map { it.toMutableList() }
sourceId = unionMember0.sourceId
+ workId = unionMember0.workId
additionalProperties = unionMember0.additionalProperties.toMutableMap()
}
@@ -739,40 +737,6 @@ private constructor(
*/
fun classCode(classCode: JsonField) = apply { this.classCode = classCode }
- /**
- * Custom fields for the individual. These are fields which are defined by the employer
- * in the system. Custom fields are not currently supported for assisted connections.
- */
- fun customFields(customFields: List?) =
- customFields(JsonField.ofNullable(customFields))
-
- /** Alias for calling [Builder.customFields] with `customFields.orElse(null)`. */
- fun customFields(customFields: Optional>) =
- customFields(customFields.getOrNull())
-
- /**
- * Sets [Builder.customFields] to an arbitrary JSON value.
- *
- * You should usually call [Builder.customFields] with a well-typed `List`
- * value instead. This method is primarily for setting the field to an undocumented or
- * not yet supported value.
- */
- fun customFields(customFields: JsonField>) = apply {
- this.customFields = customFields.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [CustomField] to [customFields].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addCustomField(customField: CustomField) = apply {
- customFields =
- (customFields ?: JsonField.of(mutableListOf())).also {
- checkKnown("customFields", it).add(customField)
- }
- }
-
/** The department object. */
fun department(department: Department?) = department(JsonField.ofNullable(department))
@@ -990,23 +954,39 @@ private constructor(
*/
fun title(title: JsonField) = apply { this.title = title }
- /** This field is deprecated in favour of `source_id` */
- @Deprecated("deprecated")
- fun workId(workId: String?) = workId(JsonField.ofNullable(workId))
+ /**
+ * Custom fields for the individual. These are fields which are defined by the employer
+ * in the system. Custom fields are not currently supported for assisted connections.
+ */
+ fun customFields(customFields: List?) =
+ customFields(JsonField.ofNullable(customFields))
- /** Alias for calling [Builder.workId] with `workId.orElse(null)`. */
- @Deprecated("deprecated")
- fun workId(workId: Optional) = workId(workId.getOrNull())
+ /** Alias for calling [Builder.customFields] with `customFields.orElse(null)`. */
+ fun customFields(customFields: Optional>) =
+ customFields(customFields.getOrNull())
/**
- * Sets [Builder.workId] to an arbitrary JSON value.
+ * Sets [Builder.customFields] to an arbitrary JSON value.
*
- * You should usually call [Builder.workId] with a well-typed [String] value instead.
- * This method is primarily for setting the field to an undocumented or not yet
- * supported value.
+ * You should usually call [Builder.customFields] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
*/
- @Deprecated("deprecated")
- fun workId(workId: JsonField) = apply { this.workId = workId }
+ fun customFields(customFields: JsonField>) = apply {
+ this.customFields = customFields.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [CustomField] to [customFields].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addCustomField(customField: CustomField) = apply {
+ customFields =
+ (customFields ?: JsonField.of(mutableListOf())).also {
+ checkKnown("customFields", it).add(customField)
+ }
+ }
/**
* The employee's income as reported by the provider. This may not always be annualized
@@ -1073,6 +1053,24 @@ private constructor(
*/
fun sourceId(sourceId: JsonField) = apply { this.sourceId = sourceId }
+ /** This field is deprecated in favour of `source_id` */
+ @Deprecated("deprecated")
+ fun workId(workId: String?) = workId(JsonField.ofNullable(workId))
+
+ /** Alias for calling [Builder.workId] with `workId.orElse(null)`. */
+ @Deprecated("deprecated")
+ fun workId(workId: Optional) = workId(workId.getOrNull())
+
+ /**
+ * Sets [Builder.workId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.workId] 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 workId(workId: JsonField) = apply { this.workId = workId }
+
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
putAllAdditionalProperties(additionalProperties)
@@ -1101,7 +1099,6 @@ private constructor(
* ```java
* .id()
* .classCode()
- * .customFields()
* .department()
* .employment()
* .employmentStatus()
@@ -1115,7 +1112,6 @@ private constructor(
* .middleName()
* .startDate()
* .title()
- * .workId()
* ```
*
* @throws IllegalStateException if any required field is unset.
@@ -1124,7 +1120,6 @@ private constructor(
UnionMember0(
checkRequired("id", id),
checkRequired("classCode", classCode),
- checkRequired("customFields", customFields).map { it.toImmutable() },
checkRequired("department", department),
checkRequired("employment", employment),
checkRequired("employmentStatus", employmentStatus),
@@ -1138,10 +1133,11 @@ private constructor(
checkRequired("middleName", middleName),
checkRequired("startDate", startDate),
checkRequired("title", title),
- checkRequired("workId", workId),
+ (customFields ?: JsonMissing.of()).map { it.toImmutable() },
income,
(incomeHistory ?: JsonMissing.of()).map { it.toImmutable() },
sourceId,
+ workId,
additionalProperties.toMutableMap(),
)
}
@@ -1155,7 +1151,6 @@ private constructor(
id()
classCode()
- customFields().ifPresent { it.forEach { it.validate() } }
department().ifPresent { it.validate() }
employment().ifPresent { it.validate() }
employmentStatus().ifPresent { it.validate() }
@@ -1169,10 +1164,11 @@ private constructor(
middleName()
startDate()
title()
- workId()
+ customFields().ifPresent { it.forEach { it.validate() } }
income().ifPresent { it.validate() }
incomeHistory().ifPresent { it.forEach { it?.validate() } }
sourceId()
+ workId()
validated = true
}
@@ -1194,7 +1190,6 @@ private constructor(
internal fun validity(): Int =
(if (id.asKnown().isPresent) 1 else 0) +
(if (classCode.asKnown().isPresent) 1 else 0) +
- (customFields.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(department.asKnown().getOrNull()?.validity() ?: 0) +
(employment.asKnown().getOrNull()?.validity() ?: 0) +
(employmentStatus.asKnown().getOrNull()?.validity() ?: 0) +
@@ -1208,37 +1203,33 @@ private constructor(
(if (middleName.asKnown().isPresent) 1 else 0) +
(if (startDate.asKnown().isPresent) 1 else 0) +
(if (title.asKnown().isPresent) 1 else 0) +
- (if (workId.asKnown().isPresent) 1 else 0) +
+ (customFields.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(income.asKnown().getOrNull()?.validity() ?: 0) +
(incomeHistory.asKnown().getOrNull()?.sumOf { (it?.validity() ?: 0).toInt() }
?: 0) +
- (if (sourceId.asKnown().isPresent) 1 else 0)
+ (if (sourceId.asKnown().isPresent) 1 else 0) +
+ (if (workId.asKnown().isPresent) 1 else 0)
- class CustomField
+ /** The department object. */
+ class Department
private constructor(
private val name: JsonField,
- private val value: JsonField,
private val additionalProperties: MutableMap,
) {
@JsonCreator
private constructor(
- @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(),
- @JsonProperty("value") @ExcludeMissing value: JsonField = JsonMissing.of(),
- ) : this(name, value, mutableMapOf())
+ @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of()
+ ) : this(name, mutableMapOf())
/**
+ * The name of the department associated with the individual.
+ *
* @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if
* the server responded with an unexpected value).
*/
fun name(): Optional = name.getOptional("name")
- /**
- * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if
- * the server responded with an unexpected value).
- */
- fun value(): Optional = value.getOptional("value")
-
/**
* Returns the raw JSON value of [name].
*
@@ -1246,13 +1237,6 @@ private constructor(
*/
@JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name
- /**
- * Returns the raw JSON value of [value].
- *
- * Unlike [value], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("value") @ExcludeMissing fun _value(): JsonField = value
-
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
additionalProperties.put(key, value)
@@ -1267,24 +1251,30 @@ private constructor(
companion object {
- /** Returns a mutable builder for constructing an instance of [CustomField]. */
+ /**
+ * Returns a mutable builder for constructing an instance of [Department].
+ *
+ * The following fields are required:
+ * ```java
+ * .name()
+ * ```
+ */
@JvmStatic fun builder() = Builder()
}
- /** A builder for [CustomField]. */
+ /** A builder for [Department]. */
class Builder internal constructor() {
- private var name: JsonField = JsonMissing.of()
- private var value: JsonField