diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml
index 51bee24d..518dad07 100644
--- a/.github/workflows/publish-sonatype.yml
+++ b/.github/workflows/publish-sonatype.yml
@@ -29,11 +29,13 @@ jobs:
uses: gradle/gradle-build-action@v2
- name: Publish to Sonatype
- run: |
- ./gradlew --parallel --no-daemon publish
+ run: |-
+ export -- GPG_SIGNING_KEY_ID
+ printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
+ GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
+ ./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD"
env:
SONATYPE_USERNAME: ${{ secrets.FINCH_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.FINCH_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
- GPG_SIGNING_KEY_ID: ${{ secrets.FINCH_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }}
GPG_SIGNING_KEY: ${{ secrets.FINCH_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.FINCH_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
\ No newline at end of file
diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml
index 8cf3f601..d4b7eca7 100644
--- a/.github/workflows/release-doctor.yml
+++ b/.github/workflows/release-doctor.yml
@@ -20,6 +20,5 @@ jobs:
env:
SONATYPE_USERNAME: ${{ secrets.FINCH_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.FINCH_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
- GPG_SIGNING_KEY_ID: ${{ secrets.FINCH_SONATYPE_GPG_SIGNING_KEY_ID || secrets.GPG_SIGNING_KEY_ID }}
GPG_SIGNING_KEY: ${{ secrets.FINCH_SONATYPE_GPG_SIGNING_KEY || secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_PASSWORD: ${{ secrets.FINCH_SONATYPE_GPG_SIGNING_PASSWORD || secrets.GPG_SIGNING_PASSWORD }}
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 271a68cf..de0960ab 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "1.11.1"
+ ".": "1.12.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 6db8f59f..eacfbb3f 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,2 +1,2 @@
configured_endpoints: 38
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-c7c3b67aee7f77702be22b17af22bdf799b8c95be8028f20ac406af8b5ec0439.yml
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-2526a31a361274411e6cfc64858b1b084a22ffb491a9490374b717534827b3e1.yml
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ee682aa8..37cc93e3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,30 @@
# Changelog
+## 1.12.0 (2024-11-27)
+
+Full Changelog: [v1.11.1...v1.12.0](https://github.com/Finch-API/finch-api-java/compare/v1.11.1...v1.12.0)
+
+### Features
+
+* **api:** api update ([#344](https://github.com/Finch-API/finch-api-java/issues/344)) ([995447b](https://github.com/Finch-API/finch-api-java/commit/995447bc6ce0c99dd0fef03af69574ad028fb2cc))
+* derive gpg release key's id via gpg itself ([#341](https://github.com/Finch-API/finch-api-java/issues/341)) ([5d9b02d](https://github.com/Finch-API/finch-api-java/commit/5d9b02de8fa17a49a1d05e71aea488007d6db1a4))
+
+
+### Bug Fixes
+
+* remove reference to removed deps 'guava' ([ab6b83c](https://github.com/Finch-API/finch-api-java/commit/ab6b83ceff97195bced4391a82dc4fafe086ad3e))
+
+
+### Chores
+
+* fix formatting ([a8911c2](https://github.com/Finch-API/finch-api-java/commit/a8911c2030d43fa0de1e13428378a099366a22b4))
+* **internal:** codegen changes ([#340](https://github.com/Finch-API/finch-api-java/issues/340)) ([3c5d768](https://github.com/Finch-API/finch-api-java/commit/3c5d768f7a1511c6625b6008f3140c5a7ad1e3cd))
+* **internal:** codegen changes ([#342](https://github.com/Finch-API/finch-api-java/issues/342)) ([3876694](https://github.com/Finch-API/finch-api-java/commit/3876694b22866aeed1e47ab17264f253001d9290))
+* **internal:** codegen related update ([#335](https://github.com/Finch-API/finch-api-java/issues/335)) ([4c594c8](https://github.com/Finch-API/finch-api-java/commit/4c594c8869c07387731fdde4519575bb93f865e5))
+* **internal:** codegen related update ([#337](https://github.com/Finch-API/finch-api-java/issues/337)) ([586ee38](https://github.com/Finch-API/finch-api-java/commit/586ee38c5744b36d44dd42756cc74bf1d542ca56))
+* **internal:** codegen related update ([#343](https://github.com/Finch-API/finch-api-java/issues/343)) ([2827201](https://github.com/Finch-API/finch-api-java/commit/28272014e7a7c5439b369c92d336c9247f226368))
+* **internal:** update example values ([#339](https://github.com/Finch-API/finch-api-java/issues/339)) ([de78eab](https://github.com/Finch-API/finch-api-java/commit/de78eab92fb90d7d324d99f93f6dbb4d0e7e3cd0))
+
## 1.11.1 (2024-11-20)
Full Changelog: [v1.11.0...v1.11.1](https://github.com/Finch-API/finch-api-java/compare/v1.11.0...v1.11.1)
diff --git a/README.md b/README.md
index 615d6bf4..fb49b052 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/1.11.1)
+[](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/1.12.0)
@@ -27,7 +27,7 @@ The REST API documentation can be found [in the Finch Documentation Center](htt
```kotlin
-implementation("com.tryfinch.api:finch-java:1.11.1")
+implementation("com.tryfinch.api:finch-java:1.12.0")
```
#### Maven
@@ -36,7 +36,7 @@ implementation("com.tryfinch.api:finch-java:1.11.1")
com.tryfinch.api
finch-java
- 1.11.1
+ 1.12.0
```
@@ -294,6 +294,22 @@ FinchClient client = FinchOkHttpClient.builder()
.build();
```
+## Logging
+
+We use the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).
+
+You can enable logging by setting the environment variable `FINCH_LOG` to `info`.
+
+```sh
+$ export FINCH_LOG=info
+```
+
+Or to `debug` for more verbose logging.
+
+```sh
+$ export FINCH_LOG=debug
+```
+
## Semantic versioning
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
diff --git a/build.gradle.kts b/build.gradle.kts
index c9a7ed3b..1c0d6a5c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -1,20 +1,10 @@
plugins {
- id("io.github.gradle-nexus.publish-plugin") version "1.1.0"
+
}
allprojects {
group = "com.tryfinch.api"
- version = "1.11.1" // x-release-please-version
+ version = "1.12.0" // x-release-please-version
}
-nexusPublishing {
- repositories {
- sonatype {
- nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
- snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
- username.set(System.getenv("SONATYPE_USERNAME"))
- password.set(System.getenv("SONATYPE_PASSWORD"))
- }
- }
-}
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index b88cd06f..493cb327 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -1,12 +1,16 @@
plugins {
`kotlin-dsl`
+ kotlin("jvm") version "1.9.22"
+ id("com.vanniktech.maven.publish") version "0.28.0"
}
repositories {
gradlePluginPortal()
+ mavenCentral()
}
dependencies {
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23")
+ implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0")
}
diff --git a/buildSrc/src/main/kotlin/finch.java.gradle.kts b/buildSrc/src/main/kotlin/finch.java.gradle.kts
index 1de5b8a8..32a150ed 100644
--- a/buildSrc/src/main/kotlin/finch.java.gradle.kts
+++ b/buildSrc/src/main/kotlin/finch.java.gradle.kts
@@ -1,6 +1,9 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
-import java.util.Locale
+import com.vanniktech.maven.publish.JavaLibrary
+import com.vanniktech.maven.publish.JavadocJar
+import com.vanniktech.maven.publish.MavenPublishBaseExtension
+import com.vanniktech.maven.publish.SonatypeHost
plugins {
`java-library`
@@ -11,11 +14,6 @@ repositories {
mavenCentral()
}
-configure {
- withJavadocJar()
- withSourcesJar()
-}
-
configure {
java {
importOrder()
@@ -36,10 +34,6 @@ tasks.withType().configureEach {
options.release.set(8)
}
-tasks.named("javadocJar") {
- setZip64(true)
-}
-
tasks.named("jar") {
manifest {
attributes(mapOf(
diff --git a/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts b/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts
index bad07eed..02304634 100644
--- a/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts
+++ b/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts
@@ -1,5 +1,6 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+import com.vanniktech.maven.publish.*
plugins {
id("finch.java")
diff --git a/buildSrc/src/main/kotlin/finch.publish.gradle.kts b/buildSrc/src/main/kotlin/finch.publish.gradle.kts
index 86ee4657..dd28e5e0 100644
--- a/buildSrc/src/main/kotlin/finch.publish.gradle.kts
+++ b/buildSrc/src/main/kotlin/finch.publish.gradle.kts
@@ -3,65 +3,52 @@ import org.gradle.api.publish.maven.MavenPublication
import org.gradle.kotlin.dsl.configure
import org.gradle.kotlin.dsl.register
import org.gradle.kotlin.dsl.get
+import com.vanniktech.maven.publish.JavaLibrary
+import com.vanniktech.maven.publish.JavadocJar
+import com.vanniktech.maven.publish.MavenPublishBaseExtension
+import com.vanniktech.maven.publish.SonatypeHost
plugins {
- `maven-publish`
- `signing`
+ id("com.vanniktech.maven.publish")
}
-configure {
- publications {
- register("maven") {
- from(components["java"])
+repositories {
+ gradlePluginPortal()
+ mavenCentral()
+}
- pom {
- name.set("API Reference")
- description.set("The Finch HRIS API provides a unified way to connect to a multitide of HRIS\nsystems. The API requires an access token issued by Finch.\n\nBy default, Organization and Payroll requests use Finch's\n[Data Syncs](/developer-resources/Data-Syncs). If a request is made before the\ninitial sync has completed, Finch will request data live from the provider. The\nlatency on live requests may range from seconds to minutes depending on the\nprovider and batch size. For automated integrations, Deductions requests (both\nread and write) are always made live to the provider. Latencies may range from\nseconds to minutes depending on the provider and batch size.\n\nEmployer products are specified by the product parameter, a space-separated list\nof products that your application requests from an employer authenticating\nthrough Finch Connect. Valid product names are—\n\n- `company`: Read basic company data\n\n- `directory`: Read company directory and organization structure\n\n- `individual`: Read individual data, excluding income and employment data\n\n- `employment`: Read individual employment and income data\n\n- `payment`: Read payroll and contractor related payments by the company\n\n- `pay_statement`: Read detailed pay statements for each individual\n\n- `benefits`: Create and manage deductions and contributions and enrollment for\n an employer\n\n[](https://god.gw.postman.com/run-collection/21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4?action=collection%2Ffork&collection-url=entityId%3D21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4%26entityType%3Dcollection%26workspaceId%3D1edf19bc-e0a8-41e9-ac55-481a4b50790b)")
- url.set("https://developer.tryfinch.com/")
+extra["signingInMemoryKey"] = System.getenv("GPG_SIGNING_KEY")
+extra["signingInMemoryKeyId"] = System.getenv("GPG_SIGNING_KEY_ID")
+extra["signingInMemoryKeyPassword"] = System.getenv("GPG_SIGNING_PASSWORD")
- licenses {
- license {
- name.set("Apache-2.0")
- }
- }
+configure {
+ signAllPublications()
+ publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
- developers {
- developer {
- name.set("Finch")
- email.set("founders@tryfinch.com")
- }
- }
+ this.coordinates(project.group.toString(), project.name, project.version.toString())
- scm {
- connection.set("scm:git:git://github.com/Finch-API/finch-api-java.git")
- developerConnection.set("scm:git:git://github.com/Finch-API/finch-api-java.git")
- url.set("https://github.com/Finch-API/finch-api-java")
- }
+ pom {
+ name.set("API Reference")
+ description.set("The Finch HRIS API provides a unified way to connect to a multitide of HRIS\nsystems. The API requires an access token issued by Finch.\n\nBy default, Organization and Payroll requests use Finch's\n[Data Syncs](/developer-resources/Data-Syncs). If a request is made before the\ninitial sync has completed, Finch will request data live from the provider. The\nlatency on live requests may range from seconds to minutes depending on the\nprovider and batch size. For automated integrations, Deductions requests (both\nread and write) are always made live to the provider. Latencies may range from\nseconds to minutes depending on the provider and batch size.\n\nEmployer products are specified by the product parameter, a space-separated list\nof products that your application requests from an employer authenticating\nthrough Finch Connect. Valid product names are—\n\n- `company`: Read basic company data\n\n- `directory`: Read company directory and organization structure\n\n- `individual`: Read individual data, excluding income and employment data\n\n- `employment`: Read individual employment and income data\n\n- `payment`: Read payroll and contractor related payments by the company\n\n- `pay_statement`: Read detailed pay statements for each individual\n\n- `benefits`: Create and manage deductions and contributions and enrollment for\n an employer\n\n[](https://god.gw.postman.com/run-collection/21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4?action=collection%2Ffork&collection-url=entityId%3D21027137-08db0929-883d-4094-a9ce-dbf5a9bee4a4%26entityType%3Dcollection%26workspaceId%3D1edf19bc-e0a8-41e9-ac55-481a4b50790b)")
+ url.set("https://developer.tryfinch.com/")
- versionMapping {
- allVariants {
- fromResolutionResult()
- }
- }
+ licenses {
+ license {
+ name.set("Apache-2.0")
}
}
- }
-}
-signing {
- val signingKeyId = System.getenv("GPG_SIGNING_KEY_ID")?.ifBlank { null }
- val signingKey = System.getenv("GPG_SIGNING_KEY")?.ifBlank { null }
- val signingPassword = System.getenv("GPG_SIGNING_PASSWORD")?.ifBlank { null }
- if (signingKey != null && signingPassword != null) {
- useInMemoryPgpKeys(
- signingKeyId,
- signingKey,
- signingPassword,
- )
- sign(publishing.publications["maven"])
- }
-}
+ developers {
+ developer {
+ name.set("Finch")
+ email.set("founders@tryfinch.com")
+ }
+ }
-tasks.named("publish") {
- dependsOn(":closeAndReleaseSonatypeStagingRepository")
+ scm {
+ connection.set("scm:git:git://github.com/Finch-API/finch-api-java.git")
+ developerConnection.set("scm:git:git://github.com/Finch-API/finch-api-java.git")
+ url.set("https://github.com/Finch-API/finch-api-java")
+ }
+ }
}
diff --git a/finch-java-client-okhttp/build.gradle.kts b/finch-java-client-okhttp/build.gradle.kts
index dd0be767..77047196 100644
--- a/finch-java-client-okhttp/build.gradle.kts
+++ b/finch-java-client-okhttp/build.gradle.kts
@@ -7,6 +7,7 @@ dependencies {
api(project(":finch-java-core"))
implementation("com.squareup.okhttp3:okhttp:4.12.0")
+ implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.25.3")
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 af6c2aa4..c34c5d11 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
@@ -23,6 +23,7 @@ import okhttp3.Request
import okhttp3.RequestBody
import okhttp3.RequestBody.Companion.toRequestBody
import okhttp3.Response
+import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink
class OkHttpClient
@@ -30,14 +31,30 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val
HttpClient {
private fun getClient(requestOptions: RequestOptions): okhttp3.OkHttpClient {
- val timeout = requestOptions.timeout ?: return okHttpClient
- return okHttpClient
- .newBuilder()
- .connectTimeout(timeout)
- .readTimeout(timeout)
- .writeTimeout(timeout)
- .callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30))
- .build()
+ val clientBuilder = okHttpClient.newBuilder()
+
+ val logLevel =
+ when (System.getenv("FINCH_LOG")?.lowercase()) {
+ "info" -> HttpLoggingInterceptor.Level.BASIC
+ "debug" -> HttpLoggingInterceptor.Level.BODY
+ else -> null
+ }
+ if (logLevel != null) {
+ clientBuilder.addNetworkInterceptor(
+ HttpLoggingInterceptor().setLevel(logLevel).apply { redactHeader("Authorization") }
+ )
+ }
+
+ val timeout = requestOptions.timeout
+ if (timeout != null) {
+ clientBuilder
+ .connectTimeout(timeout)
+ .readTimeout(timeout)
+ .writeTimeout(timeout)
+ .callTimeout(if (timeout.seconds == 0L) timeout else timeout.plusSeconds(30))
+ }
+
+ return clientBuilder.build()
}
override fun execute(
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt
index 05943d88..14aabb06 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchError.kt
@@ -19,20 +19,6 @@ private constructor(
val additionalProperties: Map,
) {
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is FinchError && this.additionalProperties == other.additionalProperties /* spotless:on */
- }
-
- override fun hashCode(): Int {
- return /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
- }
-
- override fun toString() = "FinchError{additionalProperties=$additionalProperties}"
-
fun toBuilder() = Builder().from(this)
companion object {
@@ -71,4 +57,16 @@ private constructor(
fun build(): FinchError = FinchError(additionalProperties.toImmutable())
}
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is FinchError && additionalProperties == other.additionalProperties /* spotless:on */
+ }
+
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */
+
+ override fun toString() = "FinchError{additionalProperties=$additionalProperties}"
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt
index af057356..5ee50b30 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccessTokenCreateParams.kt
@@ -35,6 +35,12 @@ constructor(
fun redirectUri(): Optional = Optional.ofNullable(redirectUri)
+ fun _additionalHeaders(): Headers = additionalHeaders
+
+ fun _additionalQueryParams(): QueryParams = additionalQueryParams
+
+ fun _additionalBodyProperties(): Map = additionalBodyProperties
+
@JvmSynthetic
internal fun getBody(): AccessTokenCreateBody {
return AccessTokenCreateBody(
@@ -137,43 +143,19 @@ constructor(
return true
}
- return /* spotless:off */ other is AccessTokenCreateBody && this.code == other.code && this.clientId == other.clientId && this.clientSecret == other.clientSecret && this.redirectUri == other.redirectUri && this.additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is AccessTokenCreateBody && code == other.code && clientId == other.clientId && clientSecret == other.clientSecret && redirectUri == other.redirectUri && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(code, clientId, clientSecret, redirectUri, additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(code, clientId, clientSecret, redirectUri, additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() =
"AccessTokenCreateBody{code=$code, clientId=$clientId, clientSecret=$clientSecret, redirectUri=$redirectUri, additionalProperties=$additionalProperties}"
}
- fun _additionalHeaders(): Headers = additionalHeaders
-
- fun _additionalQueryParams(): QueryParams = additionalQueryParams
-
- fun _additionalBodyProperties(): Map = additionalBodyProperties
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is AccessTokenCreateParams && this.code == other.code && this.clientId == other.clientId && this.clientSecret == other.clientSecret && this.redirectUri == other.redirectUri && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
- }
-
- override fun hashCode(): Int {
- return /* spotless:off */ Objects.hash(code, clientId, clientSecret, redirectUri, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
- }
-
- override fun toString() =
- "AccessTokenCreateParams{code=$code, clientId=$clientId, clientSecret=$clientSecret, redirectUri=$redirectUri, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
-
fun toBuilder() = Builder().from(this)
companion object {
@@ -194,13 +176,14 @@ constructor(
@JvmSynthetic
internal fun from(accessTokenCreateParams: AccessTokenCreateParams) = apply {
- this.code = accessTokenCreateParams.code
- this.clientId = accessTokenCreateParams.clientId
- this.clientSecret = accessTokenCreateParams.clientSecret
- this.redirectUri = accessTokenCreateParams.redirectUri
- additionalHeaders(accessTokenCreateParams.additionalHeaders)
- additionalQueryParams(accessTokenCreateParams.additionalQueryParams)
- additionalBodyProperties(accessTokenCreateParams.additionalBodyProperties)
+ code = accessTokenCreateParams.code
+ clientId = accessTokenCreateParams.clientId
+ clientSecret = accessTokenCreateParams.clientSecret
+ redirectUri = accessTokenCreateParams.redirectUri
+ additionalHeaders = accessTokenCreateParams.additionalHeaders.toBuilder()
+ additionalQueryParams = accessTokenCreateParams.additionalQueryParams.toBuilder()
+ additionalBodyProperties =
+ accessTokenCreateParams.additionalBodyProperties.toMutableMap()
}
fun code(code: String) = apply { this.code = code }
@@ -342,4 +325,17 @@ constructor(
additionalBodyProperties.toImmutable(),
)
}
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return /* spotless:off */ other is AccessTokenCreateParams && code == other.code && clientId == other.clientId && clientSecret == other.clientSecret && redirectUri == other.redirectUri && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
+ }
+
+ override fun hashCode(): Int = /* spotless:off */ Objects.hash(code, clientId, clientSecret, redirectUri, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
+
+ override fun toString() =
+ "AccessTokenCreateParams{code=$code, clientId=$clientId, clientSecret=$clientSecret, redirectUri=$redirectUri, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
}
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt
index 7a5abab7..533e3693 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt
@@ -214,7 +214,7 @@ private constructor(
return true
}
- return /* spotless:off */ other is AuthenticationType && this.value == other.value /* spotless:on */
+ return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
@@ -275,17 +275,14 @@ private constructor(
return true
}
- return /* spotless:off */ other is AccountCreateResponse && this.connectionId == other.connectionId && 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 /* spotless:on */
+ return /* spotless:off */ other is AccountCreateResponse && connectionId == other.connectionId && companyId == other.companyId && providerId == other.providerId && accountId == other.accountId && authenticationType == other.authenticationType && products == other.products && accessToken == other.accessToken && additionalProperties == other.additionalProperties /* spotless:on */
}
- private var hashCode: Int = 0
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, providerId, accountId, authenticationType, products, accessToken, additionalProperties) }
+ /* spotless:on */
- override fun hashCode(): Int {
- if (hashCode == 0) {
- hashCode = /* spotless:off */ Objects.hash(connectionId, companyId, providerId, accountId, authenticationType, products, accessToken, additionalProperties) /* spotless:on */
- }
- return hashCode
- }
+ override fun hashCode(): Int = hashCode
override fun toString() =
"AccountCreateResponse{connectionId=$connectionId, companyId=$companyId, providerId=$providerId, accountId=$accountId, authenticationType=$authenticationType, products=$products, accessToken=$accessToken, additionalProperties=$additionalProperties}"
diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt
index b61aa426..fc26161d 100644
--- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt
+++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt
@@ -18,35 +18,20 @@ constructor(
private val additionalBodyProperties: Map,
) {
- @JvmSynthetic
- internal fun getBody(): Optional