diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index f80776a4..a26ebfc1 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.13.2"
+ ".": "0.14.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 67256046..f6819ec3 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1 +1 @@
-configured_endpoints: 22
+configured_endpoints: 33
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1a52fba7..34255faf 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,20 @@
# Changelog
+## 0.14.0 (2024-01-09)
+
+Full Changelog: [v0.13.2...v0.14.0](https://github.com/Finch-API/finch-api-java/compare/v0.13.2...v0.14.0)
+
+### Features
+
+* **api:** add method to create access token ([#125](https://github.com/Finch-API/finch-api-java/issues/125)) ([b456bde](https://github.com/Finch-API/finch-api-java/commit/b456bdee9ae7effecb7a1c4c1a7faacd6b26c335))
+* **api:** add sandbox APIs ([#127](https://github.com/Finch-API/finch-api-java/issues/127)) ([44671e6](https://github.com/Finch-API/finch-api-java/commit/44671e666b645dac5d43e499d29531f0b88dc34a))
+
+
+### Chores
+
+* add .keep files for examples and custom code directories ([#126](https://github.com/Finch-API/finch-api-java/issues/126)) ([98b8b4a](https://github.com/Finch-API/finch-api-java/commit/98b8b4a234444abe4dd136931524ee22df2aa2d1))
+* **internal:** bump license ([#123](https://github.com/Finch-API/finch-api-java/issues/123)) ([121f7f9](https://github.com/Finch-API/finch-api-java/commit/121f7f9ffe98731113aecda46effa52976c2ee62))
+
## 0.13.2 (2023-12-19)
Full Changelog: [v0.13.1...v0.13.2](https://github.com/Finch-API/finch-api-java/compare/v0.13.1...v0.13.2)
diff --git a/LICENSE b/LICENSE
index 6e22ceda..1dac0f68 100644
--- a/LICENSE
+++ b/LICENSE
@@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
- Copyright 2023 Finch
+ Copyright 2024 Finch
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/README.md b/README.md
index 00d9c0dc..4d5f7d19 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/0.13.2)
+[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/0.14.0)
@@ -25,7 +25,7 @@ The API documentation can be foundĀ [in the Finch Documentation Center](https://
```kotlin
-implementation("com.tryfinch.api:finch-java:0.13.2")
+implementation("com.tryfinch.api:finch-java:0.14.0")
```
#### Maven
@@ -34,7 +34,7 @@ implementation("com.tryfinch.api:finch-java:0.13.2")
com.tryfinch.api
finch-java
- 0.13.2
+ 0.14.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 65ef5515..9dda05aa 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -4,7 +4,7 @@ plugins {
allprojects {
group = "com.tryfinch.api"
- version = "0.13.2" // x-release-please-version
+ version = "0.14.0" // x-release-please-version
}
nexusPublishing {
diff --git a/examples/.keep b/examples/.keep
new file mode 100644
index 00000000..d8c73e93
--- /dev/null
+++ b/examples/.keep
@@ -0,0 +1,4 @@
+File generated from our OpenAPI spec by Stainless.
+
+This directory can be used to store example files demonstrating usage of this SDK.
+It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.
\ No newline at end of file
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 f8459c0c..2e07bb4d 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
@@ -12,6 +12,8 @@ interface FinchClient {
fun async(): FinchClientAsync
+ fun accessTokens(): AccessTokenService
+
fun hris(): HrisService
fun providers(): ProviderService
@@ -24,6 +26,10 @@ interface FinchClient {
fun jobs(): JobService
+ fun auth(): AuthService
+
+ fun sandbox(): SandboxService
+
fun getAccessToken(
clientId: String,
clientSecret: String,
@@ -33,6 +39,8 @@ interface FinchClient {
fun getAuthUrl(products: String, redirectUri: String, sandbox: Boolean): String
+ fun withAccessToken(accessToken: String): FinchClient
+
private data class GetAccessTokenParams(
@JsonProperty("client_id") val clientId: String,
@JsonProperty("client_secret") val clientSecret: String,
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 6eb28260..7cf05106 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
@@ -13,6 +13,8 @@ interface FinchClientAsync {
fun sync(): FinchClient
+ fun accessTokens(): AccessTokenServiceAsync
+
fun hris(): HrisServiceAsync
fun providers(): ProviderServiceAsync
@@ -25,6 +27,10 @@ interface FinchClientAsync {
fun jobs(): JobServiceAsync
+ fun auth(): AuthServiceAsync
+
+ fun sandbox(): SandboxServiceAsync
+
fun getAccessToken(
clientId: String,
clientSecret: String,
@@ -34,6 +40,8 @@ interface FinchClientAsync {
fun getAuthUrl(products: String, redirectUri: String, sandbox: Boolean): String
+ fun withAccessToken(accessToken: String): FinchClientAsync
+
private data class GetAccessTokenParams(
@JsonProperty("client_id") val clientId: String,
@JsonProperty("client_secret") val clientSecret: String,
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 3a12f906..c2b3033d 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
@@ -27,6 +27,10 @@ constructor(
private val sync: FinchClient by lazy { FinchClientImpl(clientOptions) }
+ private val accessTokens: AccessTokenServiceAsync by lazy {
+ AccessTokenServiceAsyncImpl(clientOptions)
+ }
+
private val hris: HrisServiceAsync by lazy { HrisServiceAsyncImpl(clientOptions) }
private val providers: ProviderServiceAsync by lazy { ProviderServiceAsyncImpl(clientOptions) }
@@ -41,11 +45,17 @@ constructor(
private val jobs: JobServiceAsync by lazy { JobServiceAsyncImpl(clientOptions) }
+ private val auth: AuthServiceAsync by lazy { AuthServiceAsyncImpl(clientOptions) }
+
+ private val sandbox: SandboxServiceAsync by lazy { SandboxServiceAsyncImpl(clientOptions) }
+
private val getAccessTokenHandler: Handler =
jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler)
override fun sync(): FinchClient = sync
+ override fun accessTokens(): AccessTokenServiceAsync = accessTokens
+
override fun hris(): HrisServiceAsync = hris
override fun providers(): ProviderServiceAsync = providers
@@ -58,6 +68,10 @@ constructor(
override fun jobs(): JobServiceAsync = jobs
+ override fun auth(): AuthServiceAsync = auth
+
+ override fun sandbox(): SandboxServiceAsync = sandbox
+
override fun getAccessToken(
clientId: String,
clientSecret: String,
@@ -102,6 +116,23 @@ constructor(
"&sandbox=${if (sandbox) "true" else "false"}"
}
+ override fun withAccessToken(accessToken: String): FinchClientAsync {
+ return FinchClientAsyncImpl(
+ ClientOptions.builder()
+ .httpClient(clientOptions.httpClient)
+ .jsonMapper(clientOptions.jsonMapper)
+ .clock(clientOptions.clock)
+ .baseUrl(clientOptions.baseUrl)
+ .accessToken(accessToken)
+ .clientId(clientOptions.clientId)
+ .clientSecret(clientOptions.clientSecret)
+ .webhookSecret(clientOptions.webhookSecret)
+ .headers(clientOptions.headers.asMap())
+ .responseValidation(clientOptions.responseValidation)
+ .build()
+ )
+ }
+
private data class GetAccessTokenParams(
@JsonProperty("client_id") val clientId: String,
@JsonProperty("client_secret") val clientSecret: String,
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 4954ad33..09430114 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
@@ -26,6 +26,8 @@ constructor(
private val async: FinchClientAsync by lazy { FinchClientAsyncImpl(clientOptions) }
+ private val accessTokens: AccessTokenService by lazy { AccessTokenServiceImpl(clientOptions) }
+
private val hris: HrisService by lazy { HrisServiceImpl(clientOptions) }
private val providers: ProviderService by lazy { ProviderServiceImpl(clientOptions) }
@@ -40,11 +42,17 @@ constructor(
private val jobs: JobService by lazy { JobServiceImpl(clientOptions) }
+ private val auth: AuthService by lazy { AuthServiceImpl(clientOptions) }
+
+ private val sandbox: SandboxService by lazy { SandboxServiceImpl(clientOptions) }
+
private val getAccessTokenHandler: Handler =
jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler)
override fun async(): FinchClientAsync = async
+ override fun accessTokens(): AccessTokenService = accessTokens
+
override fun hris(): HrisService = hris
override fun providers(): ProviderService = providers
@@ -57,6 +65,10 @@ constructor(
override fun jobs(): JobService = jobs
+ override fun auth(): AuthService = auth
+
+ override fun sandbox(): SandboxService = sandbox
+
override fun getAccessToken(
clientId: String,
clientSecret: String,
@@ -101,6 +113,23 @@ constructor(
"&sandbox=${if (sandbox) "true" else "false"}"
}
+ override fun withAccessToken(accessToken: String): FinchClient {
+ return FinchClientImpl(
+ ClientOptions.builder()
+ .httpClient(clientOptions.httpClient)
+ .jsonMapper(clientOptions.jsonMapper)
+ .clock(clientOptions.clock)
+ .baseUrl(clientOptions.baseUrl)
+ .accessToken(accessToken)
+ .clientId(clientOptions.clientId)
+ .clientSecret(clientOptions.clientSecret)
+ .webhookSecret(clientOptions.webhookSecret)
+ .headers(clientOptions.headers.asMap())
+ .responseValidation(clientOptions.responseValidation)
+ .build()
+ )
+ }
+
private data class GetAccessTokenParams(
@JsonProperty("client_id") val clientId: String,
@JsonProperty("client_secret") val clientSecret: String,
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt
new file mode 100644
index 00000000..16a17c91
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt
@@ -0,0 +1,303 @@
+// 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.JsonProperty
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize
+import com.tryfinch.api.core.ExcludeMissing
+import com.tryfinch.api.core.JsonValue
+import com.tryfinch.api.core.NoAutoDetect
+import com.tryfinch.api.core.toUnmodifiable
+import com.tryfinch.api.models.*
+import java.util.Objects
+
+class AccessTokenCreateParams
+constructor(
+ private val clientId: String,
+ private val clientSecret: String,
+ private val code: String,
+ private val redirectUri: String,
+ private val additionalQueryParams: Map>,
+ private val additionalHeaders: Map>,
+ private val additionalBodyProperties: Map,
+) {
+
+ fun clientId(): String = clientId
+
+ fun clientSecret(): String = clientSecret
+
+ fun code(): String = code
+
+ fun redirectUri(): String = redirectUri
+
+ @JvmSynthetic
+ internal fun getBody(): AccessTokenCreateBody {
+ return AccessTokenCreateBody(
+ clientId,
+ clientSecret,
+ code,
+ redirectUri,
+ additionalBodyProperties,
+ )
+ }
+
+ @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams
+
+ @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders
+
+ @JsonDeserialize(builder = AccessTokenCreateBody.Builder::class)
+ @NoAutoDetect
+ class AccessTokenCreateBody
+ internal constructor(
+ private val clientId: String?,
+ private val clientSecret: String?,
+ private val code: String?,
+ private val redirectUri: String?,
+ private val additionalProperties: Map,
+ ) {
+
+ private var hashCode: Int = 0
+
+ @JsonProperty("client_id") fun clientId(): String? = clientId
+
+ @JsonProperty("client_secret") fun clientSecret(): String? = clientSecret
+
+ @JsonProperty("code") fun code(): String? = code
+
+ @JsonProperty("redirect_uri") fun redirectUri(): String? = redirectUri
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AccessTokenCreateBody &&
+ this.clientId == other.clientId &&
+ this.clientSecret == other.clientSecret &&
+ this.code == other.code &&
+ this.redirectUri == other.redirectUri &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode =
+ Objects.hash(
+ clientId,
+ clientSecret,
+ code,
+ redirectUri,
+ additionalProperties,
+ )
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "AccessTokenCreateBody{clientId=$clientId, clientSecret=$clientSecret, code=$code, redirectUri=$redirectUri, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var clientId: String? = null
+ private var clientSecret: String? = null
+ private var code: String? = null
+ private var redirectUri: String? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(accessTokenCreateBody: AccessTokenCreateBody) = apply {
+ this.clientId = accessTokenCreateBody.clientId
+ this.clientSecret = accessTokenCreateBody.clientSecret
+ this.code = accessTokenCreateBody.code
+ this.redirectUri = accessTokenCreateBody.redirectUri
+ additionalProperties(accessTokenCreateBody.additionalProperties)
+ }
+
+ @JsonProperty("client_id")
+ fun clientId(clientId: String) = apply { this.clientId = clientId }
+
+ @JsonProperty("client_secret")
+ fun clientSecret(clientSecret: String) = apply { this.clientSecret = clientSecret }
+
+ @JsonProperty("code") fun code(code: String) = apply { this.code = code }
+
+ @JsonProperty("redirect_uri")
+ fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): AccessTokenCreateBody =
+ AccessTokenCreateBody(
+ checkNotNull(clientId) { "`clientId` is required but was not set" },
+ checkNotNull(clientSecret) { "`clientSecret` is required but was not set" },
+ checkNotNull(code) { "`code` is required but was not set" },
+ checkNotNull(redirectUri) { "`redirectUri` is required but was not set" },
+ additionalProperties.toUnmodifiable(),
+ )
+ }
+ }
+
+ fun _additionalQueryParams(): Map> = additionalQueryParams
+
+ fun _additionalHeaders(): Map> = additionalHeaders
+
+ fun _additionalBodyProperties(): Map = additionalBodyProperties
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AccessTokenCreateParams &&
+ this.clientId == other.clientId &&
+ this.clientSecret == other.clientSecret &&
+ this.code == other.code &&
+ this.redirectUri == other.redirectUri &&
+ this.additionalQueryParams == other.additionalQueryParams &&
+ this.additionalHeaders == other.additionalHeaders &&
+ this.additionalBodyProperties == other.additionalBodyProperties
+ }
+
+ override fun hashCode(): Int {
+ return Objects.hash(
+ clientId,
+ clientSecret,
+ code,
+ redirectUri,
+ additionalQueryParams,
+ additionalHeaders,
+ additionalBodyProperties,
+ )
+ }
+
+ override fun toString() =
+ "AccessTokenCreateParams{clientId=$clientId, clientSecret=$clientSecret, code=$code, redirectUri=$redirectUri, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ @NoAutoDetect
+ class Builder {
+
+ private var clientId: String? = null
+ private var clientSecret: String? = null
+ private var code: String? = null
+ private var redirectUri: String? = null
+ private var additionalQueryParams: MutableMap> = mutableMapOf()
+ private var additionalHeaders: MutableMap> = mutableMapOf()
+ private var additionalBodyProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(accessTokenCreateParams: AccessTokenCreateParams) = apply {
+ this.clientId = accessTokenCreateParams.clientId
+ this.clientSecret = accessTokenCreateParams.clientSecret
+ this.code = accessTokenCreateParams.code
+ this.redirectUri = accessTokenCreateParams.redirectUri
+ additionalQueryParams(accessTokenCreateParams.additionalQueryParams)
+ additionalHeaders(accessTokenCreateParams.additionalHeaders)
+ additionalBodyProperties(accessTokenCreateParams.additionalBodyProperties)
+ }
+
+ fun clientId(clientId: String) = apply { this.clientId = clientId }
+
+ fun clientSecret(clientSecret: String) = apply { this.clientSecret = clientSecret }
+
+ fun code(code: String) = apply { this.code = code }
+
+ fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllQueryParams(additionalQueryParams)
+ }
+
+ fun putQueryParam(name: String, value: String) = apply {
+ this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value)
+ }
+
+ fun putQueryParams(name: String, values: Iterable) = apply {
+ this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values)
+ }
+
+ fun putAllQueryParams(additionalQueryParams: Map>) = apply {
+ additionalQueryParams.forEach(this::putQueryParams)
+ }
+
+ fun removeQueryParam(name: String) = apply {
+ this.additionalQueryParams.put(name, mutableListOf())
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllHeaders(additionalHeaders)
+ }
+
+ fun putHeader(name: String, value: String) = apply {
+ this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value)
+ }
+
+ fun putHeaders(name: String, values: Iterable) = apply {
+ this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values)
+ }
+
+ fun putAllHeaders(additionalHeaders: Map>) = apply {
+ additionalHeaders.forEach(this::putHeaders)
+ }
+
+ fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) }
+
+ fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
+ this.additionalBodyProperties.clear()
+ this.additionalBodyProperties.putAll(additionalBodyProperties)
+ }
+
+ fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
+ this.additionalBodyProperties.put(key, value)
+ }
+
+ fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
+ apply {
+ this.additionalBodyProperties.putAll(additionalBodyProperties)
+ }
+
+ fun build(): AccessTokenCreateParams =
+ AccessTokenCreateParams(
+ checkNotNull(clientId) { "`clientId` is required but was not set" },
+ checkNotNull(clientSecret) { "`clientSecret` is required but was not set" },
+ checkNotNull(code) { "`code` is required but was not set" },
+ checkNotNull(redirectUri) { "`redirectUri` is required but was not set" },
+ additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
+ additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
+ additionalBodyProperties.toUnmodifiable(),
+ )
+ }
+}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt
new file mode 100644
index 00000000..b3f52134
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt
@@ -0,0 +1,274 @@
+// 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.fasterxml.jackson.databind.annotation.JsonDeserialize
+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.NoAutoDetect
+import com.tryfinch.api.core.toUnmodifiable
+import com.tryfinch.api.errors.FinchInvalidDataException
+import java.util.Objects
+
+@JsonDeserialize(builder = AccountCreateResponse.Builder::class)
+@NoAutoDetect
+class AccountCreateResponse
+private constructor(
+ private val companyId: JsonField,
+ private val providerId: JsonField,
+ private val accountId: JsonField,
+ private val authenticationType: JsonField,
+ private val products: JsonField>,
+ private val accessToken: JsonField,
+ private val additionalProperties: Map,
+) {
+
+ private var validated: Boolean = false
+
+ private var hashCode: Int = 0
+
+ fun companyId(): String = companyId.getRequired("company_id")
+
+ fun providerId(): String = providerId.getRequired("provider_id")
+
+ fun accountId(): String = accountId.getRequired("account_id")
+
+ fun authenticationType(): AuthenticationType =
+ authenticationType.getRequired("authentication_type")
+
+ fun products(): List = products.getRequired("products")
+
+ fun accessToken(): String = accessToken.getRequired("access_token")
+
+ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId
+
+ @JsonProperty("provider_id") @ExcludeMissing fun _providerId() = providerId
+
+ @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId
+
+ @JsonProperty("authentication_type")
+ @ExcludeMissing
+ fun _authenticationType() = authenticationType
+
+ @JsonProperty("products") @ExcludeMissing fun _products() = products
+
+ @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun validate(): AccountCreateResponse = apply {
+ if (!validated) {
+ companyId()
+ providerId()
+ accountId()
+ authenticationType()
+ products()
+ accessToken()
+ validated = true
+ }
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AccountCreateResponse &&
+ this.companyId == other.companyId &&
+ this.providerId == other.providerId &&
+ this.accountId == other.accountId &&
+ this.authenticationType == other.authenticationType &&
+ this.products == other.products &&
+ this.accessToken == other.accessToken &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode =
+ Objects.hash(
+ companyId,
+ providerId,
+ accountId,
+ authenticationType,
+ products,
+ accessToken,
+ additionalProperties,
+ )
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "AccountCreateResponse{companyId=$companyId, providerId=$providerId, accountId=$accountId, authenticationType=$authenticationType, products=$products, accessToken=$accessToken, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var companyId: JsonField = JsonMissing.of()
+ private var providerId: JsonField = JsonMissing.of()
+ private var accountId: JsonField = JsonMissing.of()
+ private var authenticationType: JsonField = JsonMissing.of()
+ private var products: JsonField> = JsonMissing.of()
+ private var accessToken: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(accountCreateResponse: AccountCreateResponse) = apply {
+ this.companyId = accountCreateResponse.companyId
+ this.providerId = accountCreateResponse.providerId
+ this.accountId = accountCreateResponse.accountId
+ this.authenticationType = accountCreateResponse.authenticationType
+ this.products = accountCreateResponse.products
+ this.accessToken = accountCreateResponse.accessToken
+ additionalProperties(accountCreateResponse.additionalProperties)
+ }
+
+ fun companyId(companyId: String) = companyId(JsonField.of(companyId))
+
+ @JsonProperty("company_id")
+ @ExcludeMissing
+ fun companyId(companyId: JsonField) = apply { this.companyId = companyId }
+
+ fun providerId(providerId: String) = providerId(JsonField.of(providerId))
+
+ @JsonProperty("provider_id")
+ @ExcludeMissing
+ fun providerId(providerId: JsonField) = apply { this.providerId = providerId }
+
+ fun accountId(accountId: String) = accountId(JsonField.of(accountId))
+
+ @JsonProperty("account_id")
+ @ExcludeMissing
+ fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
+
+ fun authenticationType(authenticationType: AuthenticationType) =
+ authenticationType(JsonField.of(authenticationType))
+
+ @JsonProperty("authentication_type")
+ @ExcludeMissing
+ fun authenticationType(authenticationType: JsonField) = apply {
+ this.authenticationType = authenticationType
+ }
+
+ fun products(products: List) = products(JsonField.of(products))
+
+ @JsonProperty("products")
+ @ExcludeMissing
+ fun products(products: JsonField>) = apply { this.products = products }
+
+ fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken))
+
+ @JsonProperty("access_token")
+ @ExcludeMissing
+ fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): AccountCreateResponse =
+ AccountCreateResponse(
+ companyId,
+ providerId,
+ accountId,
+ authenticationType,
+ products.map { it.toUnmodifiable() },
+ accessToken,
+ additionalProperties.toUnmodifiable(),
+ )
+ }
+
+ class AuthenticationType
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) {
+
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthenticationType && this.value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+
+ companion object {
+
+ @JvmField val CREDENTIALS = AuthenticationType(JsonField.of("credentials"))
+
+ @JvmField val API_TOKEN = AuthenticationType(JsonField.of("api_token"))
+
+ @JvmField val OAUTH = AuthenticationType(JsonField.of("oauth"))
+
+ @JvmField val ASSISTED = AuthenticationType(JsonField.of("assisted"))
+
+ @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value))
+ }
+
+ enum class Known {
+ CREDENTIALS,
+ API_TOKEN,
+ OAUTH,
+ ASSISTED,
+ }
+
+ enum class Value {
+ CREDENTIALS,
+ API_TOKEN,
+ OAUTH,
+ ASSISTED,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ CREDENTIALS -> Value.CREDENTIALS
+ API_TOKEN -> Value.API_TOKEN
+ OAUTH -> Value.OAUTH
+ ASSISTED -> Value.ASSISTED
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ CREDENTIALS -> Known.CREDENTIALS
+ API_TOKEN -> Known.API_TOKEN
+ OAUTH -> Known.OAUTH
+ ASSISTED -> Known.ASSISTED
+ else -> throw FinchInvalidDataException("Unknown AuthenticationType: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+ }
+}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt
new file mode 100644
index 00000000..eb273f6c
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateResponse.kt
@@ -0,0 +1,257 @@
+// 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.fasterxml.jackson.databind.annotation.JsonDeserialize
+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.NoAutoDetect
+import com.tryfinch.api.core.toUnmodifiable
+import com.tryfinch.api.errors.FinchInvalidDataException
+import java.util.Objects
+
+@JsonDeserialize(builder = AccountUpdateResponse.Builder::class)
+@NoAutoDetect
+class AccountUpdateResponse
+private constructor(
+ private val accountId: JsonField,
+ private val authenticationType: JsonField,
+ private val companyId: JsonField,
+ private val providerId: JsonField,
+ private val products: JsonField>,
+ private val additionalProperties: Map,
+) {
+
+ private var validated: Boolean = false
+
+ private var hashCode: Int = 0
+
+ fun accountId(): String = accountId.getRequired("account_id")
+
+ fun authenticationType(): AuthenticationType =
+ authenticationType.getRequired("authentication_type")
+
+ fun companyId(): String = companyId.getRequired("company_id")
+
+ fun providerId(): String = providerId.getRequired("provider_id")
+
+ fun products(): List = products.getRequired("products")
+
+ @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId
+
+ @JsonProperty("authentication_type")
+ @ExcludeMissing
+ fun _authenticationType() = authenticationType
+
+ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId
+
+ @JsonProperty("provider_id") @ExcludeMissing fun _providerId() = providerId
+
+ @JsonProperty("products") @ExcludeMissing fun _products() = products
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun validate(): AccountUpdateResponse = apply {
+ if (!validated) {
+ accountId()
+ authenticationType()
+ companyId()
+ providerId()
+ products()
+ validated = true
+ }
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AccountUpdateResponse &&
+ this.accountId == other.accountId &&
+ this.authenticationType == other.authenticationType &&
+ this.companyId == other.companyId &&
+ this.providerId == other.providerId &&
+ this.products == other.products &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode =
+ Objects.hash(
+ accountId,
+ authenticationType,
+ companyId,
+ providerId,
+ products,
+ additionalProperties,
+ )
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "AccountUpdateResponse{accountId=$accountId, authenticationType=$authenticationType, companyId=$companyId, providerId=$providerId, products=$products, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var accountId: JsonField = JsonMissing.of()
+ private var authenticationType: JsonField = JsonMissing.of()
+ private var companyId: JsonField = JsonMissing.of()
+ private var providerId: JsonField = JsonMissing.of()
+ private var products: JsonField> = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(accountUpdateResponse: AccountUpdateResponse) = apply {
+ this.accountId = accountUpdateResponse.accountId
+ this.authenticationType = accountUpdateResponse.authenticationType
+ this.companyId = accountUpdateResponse.companyId
+ this.providerId = accountUpdateResponse.providerId
+ this.products = accountUpdateResponse.products
+ additionalProperties(accountUpdateResponse.additionalProperties)
+ }
+
+ fun accountId(accountId: String) = accountId(JsonField.of(accountId))
+
+ @JsonProperty("account_id")
+ @ExcludeMissing
+ fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
+
+ fun authenticationType(authenticationType: AuthenticationType) =
+ authenticationType(JsonField.of(authenticationType))
+
+ @JsonProperty("authentication_type")
+ @ExcludeMissing
+ fun authenticationType(authenticationType: JsonField) = apply {
+ this.authenticationType = authenticationType
+ }
+
+ fun companyId(companyId: String) = companyId(JsonField.of(companyId))
+
+ @JsonProperty("company_id")
+ @ExcludeMissing
+ fun companyId(companyId: JsonField) = apply { this.companyId = companyId }
+
+ fun providerId(providerId: String) = providerId(JsonField.of(providerId))
+
+ @JsonProperty("provider_id")
+ @ExcludeMissing
+ fun providerId(providerId: JsonField) = apply { this.providerId = providerId }
+
+ fun products(products: List) = products(JsonField.of(products))
+
+ @JsonProperty("products")
+ @ExcludeMissing
+ fun products(products: JsonField>) = apply { this.products = products }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): AccountUpdateResponse =
+ AccountUpdateResponse(
+ accountId,
+ authenticationType,
+ companyId,
+ providerId,
+ products.map { it.toUnmodifiable() },
+ additionalProperties.toUnmodifiable(),
+ )
+ }
+
+ class AuthenticationType
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) {
+
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthenticationType && this.value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+
+ companion object {
+
+ @JvmField val CREDENTIALS = AuthenticationType(JsonField.of("credentials"))
+
+ @JvmField val API_TOKEN = AuthenticationType(JsonField.of("api_token"))
+
+ @JvmField val OAUTH = AuthenticationType(JsonField.of("oauth"))
+
+ @JvmField val ASSISTED = AuthenticationType(JsonField.of("assisted"))
+
+ @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value))
+ }
+
+ enum class Known {
+ CREDENTIALS,
+ API_TOKEN,
+ OAUTH,
+ ASSISTED,
+ }
+
+ enum class Value {
+ CREDENTIALS,
+ API_TOKEN,
+ OAUTH,
+ ASSISTED,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ CREDENTIALS -> Value.CREDENTIALS
+ API_TOKEN -> Value.API_TOKEN
+ OAUTH -> Value.OAUTH
+ ASSISTED -> Value.ASSISTED
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ CREDENTIALS -> Known.CREDENTIALS
+ API_TOKEN -> Known.API_TOKEN
+ OAUTH -> Known.OAUTH
+ ASSISTED -> Known.ASSISTED
+ else -> throw FinchInvalidDataException("Unknown AuthenticationType: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+ }
+}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AuthCreateTokenParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AuthCreateTokenParams.kt
new file mode 100644
index 00000000..056d206c
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AuthCreateTokenParams.kt
@@ -0,0 +1,303 @@
+// 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.JsonProperty
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize
+import com.tryfinch.api.core.ExcludeMissing
+import com.tryfinch.api.core.JsonValue
+import com.tryfinch.api.core.NoAutoDetect
+import com.tryfinch.api.core.toUnmodifiable
+import com.tryfinch.api.models.*
+import java.util.Objects
+
+class AuthCreateTokenParams
+constructor(
+ private val clientId: String,
+ private val clientSecret: String,
+ private val code: String,
+ private val redirectUri: String,
+ private val additionalQueryParams: Map>,
+ private val additionalHeaders: Map>,
+ private val additionalBodyProperties: Map,
+) {
+
+ fun clientId(): String = clientId
+
+ fun clientSecret(): String = clientSecret
+
+ fun code(): String = code
+
+ fun redirectUri(): String = redirectUri
+
+ @JvmSynthetic
+ internal fun getBody(): AuthCreateTokenBody {
+ return AuthCreateTokenBody(
+ clientId,
+ clientSecret,
+ code,
+ redirectUri,
+ additionalBodyProperties,
+ )
+ }
+
+ @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams
+
+ @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders
+
+ @JsonDeserialize(builder = AuthCreateTokenBody.Builder::class)
+ @NoAutoDetect
+ class AuthCreateTokenBody
+ internal constructor(
+ private val clientId: String?,
+ private val clientSecret: String?,
+ private val code: String?,
+ private val redirectUri: String?,
+ private val additionalProperties: Map,
+ ) {
+
+ private var hashCode: Int = 0
+
+ @JsonProperty("client_id") fun clientId(): String? = clientId
+
+ @JsonProperty("client_secret") fun clientSecret(): String? = clientSecret
+
+ @JsonProperty("code") fun code(): String? = code
+
+ @JsonProperty("redirect_uri") fun redirectUri(): String? = redirectUri
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthCreateTokenBody &&
+ this.clientId == other.clientId &&
+ this.clientSecret == other.clientSecret &&
+ this.code == other.code &&
+ this.redirectUri == other.redirectUri &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode =
+ Objects.hash(
+ clientId,
+ clientSecret,
+ code,
+ redirectUri,
+ additionalProperties,
+ )
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "AuthCreateTokenBody{clientId=$clientId, clientSecret=$clientSecret, code=$code, redirectUri=$redirectUri, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var clientId: String? = null
+ private var clientSecret: String? = null
+ private var code: String? = null
+ private var redirectUri: String? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(authCreateTokenBody: AuthCreateTokenBody) = apply {
+ this.clientId = authCreateTokenBody.clientId
+ this.clientSecret = authCreateTokenBody.clientSecret
+ this.code = authCreateTokenBody.code
+ this.redirectUri = authCreateTokenBody.redirectUri
+ additionalProperties(authCreateTokenBody.additionalProperties)
+ }
+
+ @JsonProperty("client_id")
+ fun clientId(clientId: String) = apply { this.clientId = clientId }
+
+ @JsonProperty("client_secret")
+ fun clientSecret(clientSecret: String) = apply { this.clientSecret = clientSecret }
+
+ @JsonProperty("code") fun code(code: String) = apply { this.code = code }
+
+ @JsonProperty("redirect_uri")
+ fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): AuthCreateTokenBody =
+ AuthCreateTokenBody(
+ checkNotNull(clientId) { "`clientId` is required but was not set" },
+ checkNotNull(clientSecret) { "`clientSecret` is required but was not set" },
+ checkNotNull(code) { "`code` is required but was not set" },
+ checkNotNull(redirectUri) { "`redirectUri` is required but was not set" },
+ additionalProperties.toUnmodifiable(),
+ )
+ }
+ }
+
+ fun _additionalQueryParams(): Map> = additionalQueryParams
+
+ fun _additionalHeaders(): Map> = additionalHeaders
+
+ fun _additionalBodyProperties(): Map = additionalBodyProperties
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthCreateTokenParams &&
+ this.clientId == other.clientId &&
+ this.clientSecret == other.clientSecret &&
+ this.code == other.code &&
+ this.redirectUri == other.redirectUri &&
+ this.additionalQueryParams == other.additionalQueryParams &&
+ this.additionalHeaders == other.additionalHeaders &&
+ this.additionalBodyProperties == other.additionalBodyProperties
+ }
+
+ override fun hashCode(): Int {
+ return Objects.hash(
+ clientId,
+ clientSecret,
+ code,
+ redirectUri,
+ additionalQueryParams,
+ additionalHeaders,
+ additionalBodyProperties,
+ )
+ }
+
+ override fun toString() =
+ "AuthCreateTokenParams{clientId=$clientId, clientSecret=$clientSecret, code=$code, redirectUri=$redirectUri, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ @NoAutoDetect
+ class Builder {
+
+ private var clientId: String? = null
+ private var clientSecret: String? = null
+ private var code: String? = null
+ private var redirectUri: String? = null
+ private var additionalQueryParams: MutableMap> = mutableMapOf()
+ private var additionalHeaders: MutableMap> = mutableMapOf()
+ private var additionalBodyProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(authCreateTokenParams: AuthCreateTokenParams) = apply {
+ this.clientId = authCreateTokenParams.clientId
+ this.clientSecret = authCreateTokenParams.clientSecret
+ this.code = authCreateTokenParams.code
+ this.redirectUri = authCreateTokenParams.redirectUri
+ additionalQueryParams(authCreateTokenParams.additionalQueryParams)
+ additionalHeaders(authCreateTokenParams.additionalHeaders)
+ additionalBodyProperties(authCreateTokenParams.additionalBodyProperties)
+ }
+
+ fun clientId(clientId: String) = apply { this.clientId = clientId }
+
+ fun clientSecret(clientSecret: String) = apply { this.clientSecret = clientSecret }
+
+ fun code(code: String) = apply { this.code = code }
+
+ fun redirectUri(redirectUri: String) = apply { this.redirectUri = redirectUri }
+
+ fun additionalQueryParams(additionalQueryParams: Map>) = apply {
+ this.additionalQueryParams.clear()
+ putAllQueryParams(additionalQueryParams)
+ }
+
+ fun putQueryParam(name: String, value: String) = apply {
+ this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value)
+ }
+
+ fun putQueryParams(name: String, values: Iterable) = apply {
+ this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values)
+ }
+
+ fun putAllQueryParams(additionalQueryParams: Map>) = apply {
+ additionalQueryParams.forEach(this::putQueryParams)
+ }
+
+ fun removeQueryParam(name: String) = apply {
+ this.additionalQueryParams.put(name, mutableListOf())
+ }
+
+ fun additionalHeaders(additionalHeaders: Map>) = apply {
+ this.additionalHeaders.clear()
+ putAllHeaders(additionalHeaders)
+ }
+
+ fun putHeader(name: String, value: String) = apply {
+ this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value)
+ }
+
+ fun putHeaders(name: String, values: Iterable) = apply {
+ this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values)
+ }
+
+ fun putAllHeaders(additionalHeaders: Map>) = apply {
+ additionalHeaders.forEach(this::putHeaders)
+ }
+
+ fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) }
+
+ fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
+ this.additionalBodyProperties.clear()
+ this.additionalBodyProperties.putAll(additionalBodyProperties)
+ }
+
+ fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
+ this.additionalBodyProperties.put(key, value)
+ }
+
+ fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
+ apply {
+ this.additionalBodyProperties.putAll(additionalBodyProperties)
+ }
+
+ fun build(): AuthCreateTokenParams =
+ AuthCreateTokenParams(
+ checkNotNull(clientId) { "`clientId` is required but was not set" },
+ checkNotNull(clientSecret) { "`clientSecret` is required but was not set" },
+ checkNotNull(code) { "`code` is required but was not set" },
+ checkNotNull(redirectUri) { "`redirectUri` is required but was not set" },
+ additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
+ additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
+ additionalBodyProperties.toUnmodifiable(),
+ )
+ }
+}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt
new file mode 100644
index 00000000..004172ae
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyUpdateResponse.kt
@@ -0,0 +1,1033 @@
+// 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.fasterxml.jackson.databind.annotation.JsonDeserialize
+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.NoAutoDetect
+import com.tryfinch.api.core.toUnmodifiable
+import com.tryfinch.api.errors.FinchInvalidDataException
+import java.util.Objects
+import java.util.Optional
+
+@JsonDeserialize(builder = CompanyUpdateResponse.Builder::class)
+@NoAutoDetect
+class CompanyUpdateResponse
+private constructor(
+ private val legalName: JsonField,
+ private val entity: JsonField,
+ private val primaryEmail: JsonField,
+ private val primaryPhoneNumber: JsonField,
+ private val departments: JsonField>,
+ private val ein: JsonField,
+ private val locations: JsonField>,
+ private val accounts: JsonField>,
+ private val additionalProperties: Map,
+) {
+
+ private var validated: Boolean = false
+
+ private var hashCode: Int = 0
+
+ /** The legal name of the company. */
+ fun legalName(): Optional = Optional.ofNullable(legalName.getNullable("legal_name"))
+
+ /** The entity type object. */
+ fun entity(): Optional = Optional.ofNullable(entity.getNullable("entity"))
+
+ /** The email of the main administrator on the account. */
+ fun primaryEmail(): Optional =
+ Optional.ofNullable(primaryEmail.getNullable("primary_email"))
+
+ /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */
+ fun primaryPhoneNumber(): Optional =
+ Optional.ofNullable(primaryPhoneNumber.getNullable("primary_phone_number"))
+
+ /** The array of company departments. */
+ fun departments(): Optional> =
+ Optional.ofNullable(departments.getNullable("departments"))
+
+ /** The employer identification number. */
+ fun ein(): Optional = Optional.ofNullable(ein.getNullable("ein"))
+
+ fun locations(): Optional> =
+ Optional.ofNullable(locations.getNullable("locations"))
+
+ /** An array of bank account objects associated with the payroll/HRIS system. */
+ fun accounts(): Optional> = Optional.ofNullable(accounts.getNullable("accounts"))
+
+ /** The legal name of the company. */
+ @JsonProperty("legal_name") @ExcludeMissing fun _legalName() = legalName
+
+ /** The entity type object. */
+ @JsonProperty("entity") @ExcludeMissing fun _entity() = entity
+
+ /** The email of the main administrator on the account. */
+ @JsonProperty("primary_email") @ExcludeMissing fun _primaryEmail() = primaryEmail
+
+ /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */
+ @JsonProperty("primary_phone_number")
+ @ExcludeMissing
+ fun _primaryPhoneNumber() = primaryPhoneNumber
+
+ /** The array of company departments. */
+ @JsonProperty("departments") @ExcludeMissing fun _departments() = departments
+
+ /** The employer identification number. */
+ @JsonProperty("ein") @ExcludeMissing fun _ein() = ein
+
+ @JsonProperty("locations") @ExcludeMissing fun _locations() = locations
+
+ /** An array of bank account objects associated with the payroll/HRIS system. */
+ @JsonProperty("accounts") @ExcludeMissing fun _accounts() = accounts
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun validate(): CompanyUpdateResponse = apply {
+ if (!validated) {
+ legalName()
+ entity().map { it.validate() }
+ primaryEmail()
+ primaryPhoneNumber()
+ departments().map { it.forEach { it.validate() } }
+ ein()
+ locations().map { it.forEach { it.validate() } }
+ accounts().map { it.forEach { it.validate() } }
+ validated = true
+ }
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is CompanyUpdateResponse &&
+ this.legalName == other.legalName &&
+ this.entity == other.entity &&
+ this.primaryEmail == other.primaryEmail &&
+ this.primaryPhoneNumber == other.primaryPhoneNumber &&
+ this.departments == other.departments &&
+ this.ein == other.ein &&
+ this.locations == other.locations &&
+ this.accounts == other.accounts &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode =
+ Objects.hash(
+ legalName,
+ entity,
+ primaryEmail,
+ primaryPhoneNumber,
+ departments,
+ ein,
+ locations,
+ accounts,
+ additionalProperties,
+ )
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "CompanyUpdateResponse{legalName=$legalName, entity=$entity, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, departments=$departments, ein=$ein, locations=$locations, accounts=$accounts, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var legalName: JsonField = JsonMissing.of()
+ private var entity: JsonField = JsonMissing.of()
+ private var primaryEmail: JsonField = JsonMissing.of()
+ private var primaryPhoneNumber: JsonField = JsonMissing.of()
+ private var departments: JsonField> = JsonMissing.of()
+ private var ein: JsonField = JsonMissing.of()
+ private var locations: JsonField> = JsonMissing.of()
+ private var accounts: JsonField> = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(companyUpdateResponse: CompanyUpdateResponse) = apply {
+ this.legalName = companyUpdateResponse.legalName
+ this.entity = companyUpdateResponse.entity
+ this.primaryEmail = companyUpdateResponse.primaryEmail
+ this.primaryPhoneNumber = companyUpdateResponse.primaryPhoneNumber
+ this.departments = companyUpdateResponse.departments
+ this.ein = companyUpdateResponse.ein
+ this.locations = companyUpdateResponse.locations
+ this.accounts = companyUpdateResponse.accounts
+ additionalProperties(companyUpdateResponse.additionalProperties)
+ }
+
+ /** The legal name of the company. */
+ fun legalName(legalName: String) = legalName(JsonField.of(legalName))
+
+ /** The legal name of the company. */
+ @JsonProperty("legal_name")
+ @ExcludeMissing
+ fun legalName(legalName: JsonField) = apply { this.legalName = legalName }
+
+ /** The entity type object. */
+ fun entity(entity: Entity) = entity(JsonField.of(entity))
+
+ /** The entity type object. */
+ @JsonProperty("entity")
+ @ExcludeMissing
+ fun entity(entity: JsonField) = apply { this.entity = entity }
+
+ /** The email of the main administrator on the account. */
+ fun primaryEmail(primaryEmail: String) = primaryEmail(JsonField.of(primaryEmail))
+
+ /** The email of the main administrator on the account. */
+ @JsonProperty("primary_email")
+ @ExcludeMissing
+ fun primaryEmail(primaryEmail: JsonField) = apply {
+ this.primaryEmail = primaryEmail
+ }
+
+ /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */
+ fun primaryPhoneNumber(primaryPhoneNumber: String) =
+ primaryPhoneNumber(JsonField.of(primaryPhoneNumber))
+
+ /** The phone number of the main administrator on the account. Format: `XXXXXXXXXX` */
+ @JsonProperty("primary_phone_number")
+ @ExcludeMissing
+ fun primaryPhoneNumber(primaryPhoneNumber: JsonField) = apply {
+ this.primaryPhoneNumber = primaryPhoneNumber
+ }
+
+ /** The array of company departments. */
+ fun departments(departments: List) = departments(JsonField.of(departments))
+
+ /** The array of company departments. */
+ @JsonProperty("departments")
+ @ExcludeMissing
+ fun departments(departments: JsonField>) = apply {
+ this.departments = departments
+ }
+
+ /** The employer identification number. */
+ fun ein(ein: String) = ein(JsonField.of(ein))
+
+ /** The employer identification number. */
+ @JsonProperty("ein")
+ @ExcludeMissing
+ fun ein(ein: JsonField) = apply { this.ein = ein }
+
+ fun locations(locations: List) = locations(JsonField.of(locations))
+
+ @JsonProperty("locations")
+ @ExcludeMissing
+ fun locations(locations: JsonField>) = apply { this.locations = locations }
+
+ /** An array of bank account objects associated with the payroll/HRIS system. */
+ fun accounts(accounts: List) = accounts(JsonField.of(accounts))
+
+ /** An array of bank account objects associated with the payroll/HRIS system. */
+ @JsonProperty("accounts")
+ @ExcludeMissing
+ fun accounts(accounts: JsonField>) = apply { this.accounts = accounts }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): CompanyUpdateResponse =
+ CompanyUpdateResponse(
+ legalName,
+ entity,
+ primaryEmail,
+ primaryPhoneNumber,
+ departments.map { it.toUnmodifiable() },
+ ein,
+ locations.map { it.toUnmodifiable() },
+ accounts.map { it.toUnmodifiable() },
+ additionalProperties.toUnmodifiable(),
+ )
+ }
+
+ @JsonDeserialize(builder = Account.Builder::class)
+ @NoAutoDetect
+ class Account
+ private constructor(
+ private val routingNumber: JsonField,
+ private val accountName: JsonField,
+ private val institutionName: JsonField,
+ private val accountType: JsonField,
+ private val accountNumber: JsonField,
+ private val additionalProperties: Map,
+ ) {
+
+ private var validated: Boolean = false
+
+ private var hashCode: Int = 0
+
+ /**
+ * A nine-digit code that's based on the U.S. Bank location where your account was opened.
+ */
+ fun routingNumber(): Optional =
+ Optional.ofNullable(routingNumber.getNullable("routing_number"))
+
+ /** The name of the bank associated in the payroll/HRIS system. */
+ fun accountName(): Optional =
+ Optional.ofNullable(accountName.getNullable("account_name"))
+
+ /** Name of the banking institution. */
+ fun institutionName(): Optional =
+ Optional.ofNullable(institutionName.getNullable("institution_name"))
+
+ /** The type of bank account. */
+ fun accountType(): Optional =
+ Optional.ofNullable(accountType.getNullable("account_type"))
+
+ /** 10-12 digit number to specify the bank account */
+ fun accountNumber(): Optional =
+ Optional.ofNullable(accountNumber.getNullable("account_number"))
+
+ /**
+ * A nine-digit code that's based on the U.S. Bank location where your account was opened.
+ */
+ @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber
+
+ /** The name of the bank associated in the payroll/HRIS system. */
+ @JsonProperty("account_name") @ExcludeMissing fun _accountName() = accountName
+
+ /** Name of the banking institution. */
+ @JsonProperty("institution_name") @ExcludeMissing fun _institutionName() = institutionName
+
+ /** The type of bank account. */
+ @JsonProperty("account_type") @ExcludeMissing fun _accountType() = accountType
+
+ /** 10-12 digit number to specify the bank account */
+ @JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun validate(): Account = apply {
+ if (!validated) {
+ routingNumber()
+ accountName()
+ institutionName()
+ accountType()
+ accountNumber()
+ validated = true
+ }
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Account &&
+ this.routingNumber == other.routingNumber &&
+ this.accountName == other.accountName &&
+ this.institutionName == other.institutionName &&
+ this.accountType == other.accountType &&
+ this.accountNumber == other.accountNumber &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode =
+ Objects.hash(
+ routingNumber,
+ accountName,
+ institutionName,
+ accountType,
+ accountNumber,
+ additionalProperties,
+ )
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "Account{routingNumber=$routingNumber, accountName=$accountName, institutionName=$institutionName, accountType=$accountType, accountNumber=$accountNumber, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var routingNumber: JsonField = JsonMissing.of()
+ private var accountName: JsonField = JsonMissing.of()
+ private var institutionName: JsonField = JsonMissing.of()
+ private var accountType: JsonField = JsonMissing.of()
+ private var accountNumber: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(account: Account) = apply {
+ this.routingNumber = account.routingNumber
+ this.accountName = account.accountName
+ this.institutionName = account.institutionName
+ this.accountType = account.accountType
+ this.accountNumber = account.accountNumber
+ additionalProperties(account.additionalProperties)
+ }
+
+ /**
+ * A nine-digit code that's based on the U.S. Bank location where your account was
+ * opened.
+ */
+ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber))
+
+ /**
+ * A nine-digit code that's based on the U.S. Bank location where your account was
+ * opened.
+ */
+ @JsonProperty("routing_number")
+ @ExcludeMissing
+ fun routingNumber(routingNumber: JsonField) = apply {
+ this.routingNumber = routingNumber
+ }
+
+ /** The name of the bank associated in the payroll/HRIS system. */
+ fun accountName(accountName: String) = accountName(JsonField.of(accountName))
+
+ /** The name of the bank associated in the payroll/HRIS system. */
+ @JsonProperty("account_name")
+ @ExcludeMissing
+ fun accountName(accountName: JsonField) = apply {
+ this.accountName = accountName
+ }
+
+ /** Name of the banking institution. */
+ fun institutionName(institutionName: String) =
+ institutionName(JsonField.of(institutionName))
+
+ /** Name of the banking institution. */
+ @JsonProperty("institution_name")
+ @ExcludeMissing
+ fun institutionName(institutionName: JsonField) = apply {
+ this.institutionName = institutionName
+ }
+
+ /** The type of bank account. */
+ fun accountType(accountType: AccountType) = accountType(JsonField.of(accountType))
+
+ /** The type of bank account. */
+ @JsonProperty("account_type")
+ @ExcludeMissing
+ fun accountType(accountType: JsonField) = apply {
+ this.accountType = accountType
+ }
+
+ /** 10-12 digit number to specify the bank account */
+ fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber))
+
+ /** 10-12 digit number to specify the bank account */
+ @JsonProperty("account_number")
+ @ExcludeMissing
+ fun accountNumber(accountNumber: JsonField) = apply {
+ this.accountNumber = accountNumber
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): Account =
+ Account(
+ routingNumber,
+ accountName,
+ institutionName,
+ accountType,
+ accountNumber,
+ additionalProperties.toUnmodifiable(),
+ )
+ }
+
+ class AccountType
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) {
+
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AccountType && this.value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+
+ companion object {
+
+ @JvmField val CHECKING = AccountType(JsonField.of("checking"))
+
+ @JvmField val SAVINGS = AccountType(JsonField.of("savings"))
+
+ @JvmStatic fun of(value: String) = AccountType(JsonField.of(value))
+ }
+
+ enum class Known {
+ CHECKING,
+ SAVINGS,
+ }
+
+ enum class Value {
+ CHECKING,
+ SAVINGS,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ CHECKING -> Value.CHECKING
+ SAVINGS -> Value.SAVINGS
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ CHECKING -> Known.CHECKING
+ SAVINGS -> Known.SAVINGS
+ else -> throw FinchInvalidDataException("Unknown AccountType: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+ }
+ }
+
+ @JsonDeserialize(builder = Department.Builder::class)
+ @NoAutoDetect
+ class Department
+ private constructor(
+ private val name: JsonField,
+ private val parent: JsonField,
+ private val additionalProperties: Map,
+ ) {
+
+ private var validated: Boolean = false
+
+ private var hashCode: Int = 0
+
+ /** The department name. */
+ fun name(): Optional = Optional.ofNullable(name.getNullable("name"))
+
+ /** The parent department, if present. */
+ fun parent(): Optional = Optional.ofNullable(parent.getNullable("parent"))
+
+ /** The department name. */
+ @JsonProperty("name") @ExcludeMissing fun _name() = name
+
+ /** The parent department, if present. */
+ @JsonProperty("parent") @ExcludeMissing fun _parent() = parent
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun validate(): Department = apply {
+ if (!validated) {
+ name()
+ parent().map { it.validate() }
+ validated = true
+ }
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Department &&
+ this.name == other.name &&
+ this.parent == other.parent &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode =
+ Objects.hash(
+ name,
+ parent,
+ additionalProperties,
+ )
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "Department{name=$name, parent=$parent, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var name: JsonField = JsonMissing.of()
+ private var parent: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(department: Department) = apply {
+ this.name = department.name
+ this.parent = department.parent
+ additionalProperties(department.additionalProperties)
+ }
+
+ /** The department name. */
+ fun name(name: String) = name(JsonField.of(name))
+
+ /** The department name. */
+ @JsonProperty("name")
+ @ExcludeMissing
+ fun name(name: JsonField) = apply { this.name = name }
+
+ /** The parent department, if present. */
+ fun parent(parent: Parent) = parent(JsonField.of(parent))
+
+ /** The parent department, if present. */
+ @JsonProperty("parent")
+ @ExcludeMissing
+ fun parent(parent: JsonField) = apply { this.parent = parent }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): Department =
+ Department(
+ name,
+ parent,
+ additionalProperties.toUnmodifiable(),
+ )
+ }
+
+ /** The parent department, if present. */
+ @JsonDeserialize(builder = Parent.Builder::class)
+ @NoAutoDetect
+ class Parent
+ private constructor(
+ private val name: JsonField,
+ private val additionalProperties: Map,
+ ) {
+
+ private var validated: Boolean = false
+
+ private var hashCode: Int = 0
+
+ /** The parent department's name. */
+ fun name(): Optional = Optional.ofNullable(name.getNullable("name"))
+
+ /** The parent department's name. */
+ @JsonProperty("name") @ExcludeMissing fun _name() = name
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun validate(): Parent = apply {
+ if (!validated) {
+ name()
+ validated = true
+ }
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Parent &&
+ this.name == other.name &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode = Objects.hash(name, additionalProperties)
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "Parent{name=$name, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var name: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(parent: Parent) = apply {
+ this.name = parent.name
+ additionalProperties(parent.additionalProperties)
+ }
+
+ /** The parent department's name. */
+ fun name(name: String) = name(JsonField.of(name))
+
+ /** The parent department's name. */
+ @JsonProperty("name")
+ @ExcludeMissing
+ fun name(name: JsonField) = apply { this.name = name }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): Parent = Parent(name, additionalProperties.toUnmodifiable())
+ }
+ }
+ }
+
+ /** The entity type object. */
+ @JsonDeserialize(builder = Entity.Builder::class)
+ @NoAutoDetect
+ class Entity
+ private constructor(
+ private val type: JsonField,
+ private val subtype: JsonField,
+ private val additionalProperties: Map,
+ ) {
+
+ private var validated: Boolean = false
+
+ private var hashCode: Int = 0
+
+ /** The tax payer type of the company. */
+ fun type(): Optional = Optional.ofNullable(type.getNullable("type"))
+
+ /** The tax payer subtype of the company. */
+ fun subtype(): Optional = Optional.ofNullable(subtype.getNullable("subtype"))
+
+ /** The tax payer type of the company. */
+ @JsonProperty("type") @ExcludeMissing fun _type() = type
+
+ /** The tax payer subtype of the company. */
+ @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun validate(): Entity = apply {
+ if (!validated) {
+ type()
+ subtype()
+ validated = true
+ }
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Entity &&
+ this.type == other.type &&
+ this.subtype == other.subtype &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode =
+ Objects.hash(
+ type,
+ subtype,
+ additionalProperties,
+ )
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "Entity{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var type: JsonField = JsonMissing.of()
+ private var subtype: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(entity: Entity) = apply {
+ this.type = entity.type
+ this.subtype = entity.subtype
+ additionalProperties(entity.additionalProperties)
+ }
+
+ /** The tax payer type of the company. */
+ fun type(type: Type) = type(JsonField.of(type))
+
+ /** The tax payer type of the company. */
+ @JsonProperty("type")
+ @ExcludeMissing
+ fun type(type: JsonField) = apply { this.type = type }
+
+ /** The tax payer subtype of the company. */
+ fun subtype(subtype: Subtype) = subtype(JsonField.of(subtype))
+
+ /** The tax payer subtype of the company. */
+ @JsonProperty("subtype")
+ @ExcludeMissing
+ fun subtype(subtype: JsonField) = apply { this.subtype = subtype }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): Entity =
+ Entity(
+ type,
+ subtype,
+ additionalProperties.toUnmodifiable(),
+ )
+ }
+
+ class Subtype
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) {
+
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Subtype && this.value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+
+ companion object {
+
+ @JvmField val S_CORPORATION = Subtype(JsonField.of("s_corporation"))
+
+ @JvmField val C_CORPORATION = Subtype(JsonField.of("c_corporation"))
+
+ @JvmField val B_CORPORATION = Subtype(JsonField.of("b_corporation"))
+
+ @JvmStatic fun of(value: String) = Subtype(JsonField.of(value))
+ }
+
+ enum class Known {
+ S_CORPORATION,
+ C_CORPORATION,
+ B_CORPORATION,
+ }
+
+ enum class Value {
+ S_CORPORATION,
+ C_CORPORATION,
+ B_CORPORATION,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ S_CORPORATION -> Value.S_CORPORATION
+ C_CORPORATION -> Value.C_CORPORATION
+ B_CORPORATION -> Value.B_CORPORATION
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ S_CORPORATION -> Known.S_CORPORATION
+ C_CORPORATION -> Known.C_CORPORATION
+ B_CORPORATION -> Known.B_CORPORATION
+ else -> throw FinchInvalidDataException("Unknown Subtype: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+ }
+
+ class Type
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) {
+
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Type && this.value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+
+ companion object {
+
+ @JvmField val LLC = Type(JsonField.of("llc"))
+
+ @JvmField val LP = Type(JsonField.of("lp"))
+
+ @JvmField val CORPORATION = Type(JsonField.of("corporation"))
+
+ @JvmField val SOLE_PROPRIETOR = Type(JsonField.of("sole_proprietor"))
+
+ @JvmField val NON_PROFIT = Type(JsonField.of("non_profit"))
+
+ @JvmField val PARTNERSHIP = Type(JsonField.of("partnership"))
+
+ @JvmField val COOPERATIVE = Type(JsonField.of("cooperative"))
+
+ @JvmStatic fun of(value: String) = Type(JsonField.of(value))
+ }
+
+ enum class Known {
+ LLC,
+ LP,
+ CORPORATION,
+ SOLE_PROPRIETOR,
+ NON_PROFIT,
+ PARTNERSHIP,
+ COOPERATIVE,
+ }
+
+ enum class Value {
+ LLC,
+ LP,
+ CORPORATION,
+ SOLE_PROPRIETOR,
+ NON_PROFIT,
+ PARTNERSHIP,
+ COOPERATIVE,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ LLC -> Value.LLC
+ LP -> Value.LP
+ CORPORATION -> Value.CORPORATION
+ SOLE_PROPRIETOR -> Value.SOLE_PROPRIETOR
+ NON_PROFIT -> Value.NON_PROFIT
+ PARTNERSHIP -> Value.PARTNERSHIP
+ COOPERATIVE -> Value.COOPERATIVE
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ LLC -> Known.LLC
+ LP -> Known.LP
+ CORPORATION -> Known.CORPORATION
+ SOLE_PROPRIETOR -> Known.SOLE_PROPRIETOR
+ NON_PROFIT -> Known.NON_PROFIT
+ PARTNERSHIP -> Known.PARTNERSHIP
+ COOPERATIVE -> Known.COOPERATIVE
+ else -> throw FinchInvalidDataException("Unknown Type: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+ }
+ }
+}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt
new file mode 100644
index 00000000..307ad373
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt
@@ -0,0 +1,274 @@
+// 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.fasterxml.jackson.databind.annotation.JsonDeserialize
+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.NoAutoDetect
+import com.tryfinch.api.core.toUnmodifiable
+import com.tryfinch.api.errors.FinchInvalidDataException
+import java.util.Objects
+
+@JsonDeserialize(builder = ConnectionCreateResponse.Builder::class)
+@NoAutoDetect
+class ConnectionCreateResponse
+private constructor(
+ private val companyId: JsonField,
+ private val providerId: JsonField,
+ private val accountId: JsonField,
+ private val authenticationType: JsonField,
+ private val products: JsonField>,
+ private val accessToken: JsonField,
+ private val additionalProperties: Map,
+) {
+
+ private var validated: Boolean = false
+
+ private var hashCode: Int = 0
+
+ fun companyId(): String = companyId.getRequired("company_id")
+
+ fun providerId(): String = providerId.getRequired("provider_id")
+
+ fun accountId(): String = accountId.getRequired("account_id")
+
+ fun authenticationType(): AuthenticationType =
+ authenticationType.getRequired("authentication_type")
+
+ fun products(): List = products.getRequired("products")
+
+ fun accessToken(): String = accessToken.getRequired("access_token")
+
+ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId
+
+ @JsonProperty("provider_id") @ExcludeMissing fun _providerId() = providerId
+
+ @JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId
+
+ @JsonProperty("authentication_type")
+ @ExcludeMissing
+ fun _authenticationType() = authenticationType
+
+ @JsonProperty("products") @ExcludeMissing fun _products() = products
+
+ @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun validate(): ConnectionCreateResponse = apply {
+ if (!validated) {
+ companyId()
+ providerId()
+ accountId()
+ authenticationType()
+ products()
+ accessToken()
+ validated = true
+ }
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is ConnectionCreateResponse &&
+ this.companyId == other.companyId &&
+ this.providerId == other.providerId &&
+ this.accountId == other.accountId &&
+ this.authenticationType == other.authenticationType &&
+ this.products == other.products &&
+ this.accessToken == other.accessToken &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode =
+ Objects.hash(
+ companyId,
+ providerId,
+ accountId,
+ authenticationType,
+ products,
+ accessToken,
+ additionalProperties,
+ )
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "ConnectionCreateResponse{companyId=$companyId, providerId=$providerId, accountId=$accountId, authenticationType=$authenticationType, products=$products, accessToken=$accessToken, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var companyId: JsonField = JsonMissing.of()
+ private var providerId: JsonField = JsonMissing.of()
+ private var accountId: JsonField = JsonMissing.of()
+ private var authenticationType: JsonField = JsonMissing.of()
+ private var products: JsonField> = JsonMissing.of()
+ private var accessToken: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(connectionCreateResponse: ConnectionCreateResponse) = apply {
+ this.companyId = connectionCreateResponse.companyId
+ this.providerId = connectionCreateResponse.providerId
+ this.accountId = connectionCreateResponse.accountId
+ this.authenticationType = connectionCreateResponse.authenticationType
+ this.products = connectionCreateResponse.products
+ this.accessToken = connectionCreateResponse.accessToken
+ additionalProperties(connectionCreateResponse.additionalProperties)
+ }
+
+ fun companyId(companyId: String) = companyId(JsonField.of(companyId))
+
+ @JsonProperty("company_id")
+ @ExcludeMissing
+ fun companyId(companyId: JsonField) = apply { this.companyId = companyId }
+
+ fun providerId(providerId: String) = providerId(JsonField.of(providerId))
+
+ @JsonProperty("provider_id")
+ @ExcludeMissing
+ fun providerId(providerId: JsonField) = apply { this.providerId = providerId }
+
+ fun accountId(accountId: String) = accountId(JsonField.of(accountId))
+
+ @JsonProperty("account_id")
+ @ExcludeMissing
+ fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
+
+ fun authenticationType(authenticationType: AuthenticationType) =
+ authenticationType(JsonField.of(authenticationType))
+
+ @JsonProperty("authentication_type")
+ @ExcludeMissing
+ fun authenticationType(authenticationType: JsonField) = apply {
+ this.authenticationType = authenticationType
+ }
+
+ fun products(products: List) = products(JsonField.of(products))
+
+ @JsonProperty("products")
+ @ExcludeMissing
+ fun products(products: JsonField>) = apply { this.products = products }
+
+ fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken))
+
+ @JsonProperty("access_token")
+ @ExcludeMissing
+ fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): ConnectionCreateResponse =
+ ConnectionCreateResponse(
+ companyId,
+ providerId,
+ accountId,
+ authenticationType,
+ products.map { it.toUnmodifiable() },
+ accessToken,
+ additionalProperties.toUnmodifiable(),
+ )
+ }
+
+ class AuthenticationType
+ @JsonCreator
+ private constructor(
+ private val value: JsonField,
+ ) {
+
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is AuthenticationType && this.value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+
+ companion object {
+
+ @JvmField val CREDENTIALS = AuthenticationType(JsonField.of("credentials"))
+
+ @JvmField val API_TOKEN = AuthenticationType(JsonField.of("api_token"))
+
+ @JvmField val OAUTH = AuthenticationType(JsonField.of("oauth"))
+
+ @JvmField val ASSISTED = AuthenticationType(JsonField.of("assisted"))
+
+ @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value))
+ }
+
+ enum class Known {
+ CREDENTIALS,
+ API_TOKEN,
+ OAUTH,
+ ASSISTED,
+ }
+
+ enum class Value {
+ CREDENTIALS,
+ API_TOKEN,
+ OAUTH,
+ ASSISTED,
+ _UNKNOWN,
+ }
+
+ fun value(): Value =
+ when (this) {
+ CREDENTIALS -> Value.CREDENTIALS
+ API_TOKEN -> Value.API_TOKEN
+ OAUTH -> Value.OAUTH
+ ASSISTED -> Value.ASSISTED
+ else -> Value._UNKNOWN
+ }
+
+ fun known(): Known =
+ when (this) {
+ CREDENTIALS -> Known.CREDENTIALS
+ API_TOKEN -> Known.API_TOKEN
+ OAUTH -> Known.OAUTH
+ ASSISTED -> Known.ASSISTED
+ else -> throw FinchInvalidDataException("Unknown AuthenticationType: $value")
+ }
+
+ fun asString(): String = _value().asStringOrThrow()
+ }
+}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt
new file mode 100644
index 00000000..fa4c81ab
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt
@@ -0,0 +1,105 @@
+// 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.JsonProperty
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize
+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.NoAutoDetect
+import com.tryfinch.api.core.toUnmodifiable
+import java.util.Objects
+
+@JsonDeserialize(builder = CreateAccessTokenResponse.Builder::class)
+@NoAutoDetect
+class CreateAccessTokenResponse
+private constructor(
+ private val accessToken: JsonField,
+ private val additionalProperties: Map,
+) {
+
+ private var validated: Boolean = false
+
+ private var hashCode: Int = 0
+
+ fun accessToken(): String = accessToken.getRequired("access_token")
+
+ @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map = additionalProperties
+
+ fun validate(): CreateAccessTokenResponse = apply {
+ if (!validated) {
+ accessToken()
+ validated = true
+ }
+ }
+
+ fun toBuilder() = Builder().from(this)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is CreateAccessTokenResponse &&
+ this.accessToken == other.accessToken &&
+ this.additionalProperties == other.additionalProperties
+ }
+
+ override fun hashCode(): Int {
+ if (hashCode == 0) {
+ hashCode = Objects.hash(accessToken, additionalProperties)
+ }
+ return hashCode
+ }
+
+ override fun toString() =
+ "CreateAccessTokenResponse{accessToken=$accessToken, additionalProperties=$additionalProperties}"
+
+ companion object {
+
+ @JvmStatic fun builder() = Builder()
+ }
+
+ class Builder {
+
+ private var accessToken: JsonField = JsonMissing.of()
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(createAccessTokenResponse: CreateAccessTokenResponse) = apply {
+ this.accessToken = createAccessTokenResponse.accessToken
+ additionalProperties(createAccessTokenResponse.additionalProperties)
+ }
+
+ fun accessToken(accessToken: String) = accessToken(JsonField.of(accessToken))
+
+ @JsonProperty("access_token")
+ @ExcludeMissing
+ fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ @JsonAnySetter
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ this.additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun build(): CreateAccessTokenResponse =
+ CreateAccessTokenResponse(accessToken, additionalProperties.toUnmodifiable())
+ }
+}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt
new file mode 100644
index 00000000..b30f7604
--- /dev/null
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt
@@ -0,0 +1,1046 @@
+// 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.fasterxml.jackson.databind.annotation.JsonDeserialize
+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.NoAutoDetect
+import com.tryfinch.api.core.toUnmodifiable
+import com.tryfinch.api.errors.FinchInvalidDataException
+import java.util.Objects
+import java.util.Optional
+
+@JsonDeserialize(builder = EmploymentUpdateResponse.Builder::class)
+@NoAutoDetect
+class EmploymentUpdateResponse
+private constructor(
+ private val firstName: JsonField,
+ private val middleName: JsonField,
+ private val lastName: JsonField,
+ private val title: JsonField,
+ private val manager: JsonField,
+ private val department: JsonField,
+ private val employment: JsonField,
+ private val startDate: JsonField,
+ private val endDate: JsonField,
+ private val isActive: JsonField,
+ private val classCode: JsonField