Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0f28b13
feat(api): api update
stainless-app[bot] Aug 25, 2025
c1d1685
chore: remove memory upper bound from publishing step
stainless-app[bot] Aug 21, 2025
ff49b09
feat(api): api update
stainless-app[bot] Aug 21, 2025
b7eee64
chore(ci): reduce log noise
stainless-app[bot] Aug 22, 2025
270e376
fix: update singularization rules
stainless-app[bot] Aug 22, 2025
a493f5f
fix: fix casing issue
stainless-app[bot] Aug 23, 2025
7d2e9d7
fix(ci): use java-version 21 for publish step
stainless-app[bot] Sep 3, 2025
11e8385
feat(api): api update
stainless-app[bot] Sep 8, 2025
6119020
feat(api): make client id, client secret optional again
stainless-app[bot] Sep 8, 2025
ebb6206
chore: improve formatter performance
stainless-app[bot] Sep 11, 2025
4f33876
chore(internal): codegen related update
stainless-app[bot] Sep 12, 2025
e87c1f4
chore(internal): codegen related update
stainless-app[bot] Sep 12, 2025
a7638ae
fix(client): incorrect `getPackageVersion` impl
stainless-app[bot] Sep 15, 2025
ac75f13
feat(client): add convenience overloads for some methods
stainless-app[bot] Sep 18, 2025
6eb8e0f
feat(client): expose sleeper option
stainless-app[bot] Sep 19, 2025
5623e2d
chore(internal): codegen related update
stainless-app[bot] Sep 19, 2025
40267fd
codegen metadata
stainless-app[bot] Sep 23, 2025
235dfbc
chore(internal): change some comment formatting
stainless-app[bot] Sep 23, 2025
bb6d18b
fix(client): deserialization of empty objects
stainless-app[bot] Sep 25, 2025
bc3e2b5
codegen metadata
stainless-app[bot] Sep 26, 2025
5751ee1
feat(api): api update
stainless-app[bot] Sep 26, 2025
1cd481b
codegen metadata
stainless-app[bot] Sep 30, 2025
71bc2ee
feat(api): api update
stainless-app[bot] Oct 7, 2025
44864b7
feat(api): api update
stainless-app[bot] Oct 7, 2025
1682cab
codegen metadata
stainless-app[bot] Oct 9, 2025
ad4e392
feat(api): api update
stainless-app[bot] Oct 9, 2025
ca783d0
release: 7.6.0
stainless-app[bot] Oct 9, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/publish-sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
distribution: temurin
java-version: |
8
17
21
cache: gradle

- name: Set up Gradle
Expand All @@ -33,7 +33,7 @@ jobs:
export -- GPG_SIGNING_KEY_ID
printenv -- GPG_SIGNING_KEY | gpg --batch --passphrase-fd 3 --import 3<<< "$GPG_SIGNING_PASSWORD"
GPG_SIGNING_KEY_ID="$(gpg --with-colons --list-keys | awk -F : -- '/^pub:/ { getline; print "0x" substr($10, length($10) - 7) }')"
./gradlew publishAndReleaseToMavenCentral -Dorg.gradle.jvmargs="-Xmx8g" --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
./gradlew publishAndReleaseToMavenCentral --stacktrace -PmavenCentralUsername="$SONATYPE_USERNAME" -PmavenCentralPassword="$SONATYPE_PASSWORD" --no-configuration-cache
env:
SONATYPE_USERNAME: ${{ secrets.FINCH_SONATYPE_USERNAME || secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.FINCH_SONATYPE_PASSWORD || secrets.SONATYPE_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "7.5.2"
".": "7.6.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 45
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-e8b684dbd61d1724b5e516a573a952bb6906d63840e27ebda7731a2f71061aff.yml
openapi_spec_hash: 8baff9577d4e721d0494ff315da267ca
config_hash: 5146b12344dae76238940989dac1e8a0
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-199a2fd8b7387b0648e88b5942a8248895373a561aff663389982073e55c8eb5.yml
openapi_spec_hash: 7415c1faca5f2e873824893b140650f1
config_hash: 6d3585c0032e08d723d077d660fc8448
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# Changelog

## 7.6.0 (2025-10-09)

Full Changelog: [v7.5.2...v7.6.0](https://github.com/Finch-API/finch-api-java/compare/v7.5.2...v7.6.0)

### Features

* **api:** api update ([ad4e392](https://github.com/Finch-API/finch-api-java/commit/ad4e39250d4c3c675e7eec402176c12c6146bf8c))
* **api:** api update ([44864b7](https://github.com/Finch-API/finch-api-java/commit/44864b7f26c318600f0e7544109430a8c5112a1d))
* **api:** api update ([71bc2ee](https://github.com/Finch-API/finch-api-java/commit/71bc2eea611486a4f156f76f8a6a4f68483bb078))
* **api:** api update ([5751ee1](https://github.com/Finch-API/finch-api-java/commit/5751ee17299c6a67354b6f7e16baed691a62e560))
* **api:** api update ([11e8385](https://github.com/Finch-API/finch-api-java/commit/11e83851d62b489718c81440b16734def25c07bf))
* **api:** api update ([ff49b09](https://github.com/Finch-API/finch-api-java/commit/ff49b09be8b1d99fd939600a128c733a45586417))
* **api:** api update ([0f28b13](https://github.com/Finch-API/finch-api-java/commit/0f28b13c3cbb994557ed019c2020939a7e0476e1))
* **api:** make client id, client secret optional again ([6119020](https://github.com/Finch-API/finch-api-java/commit/61190204ca49d06cfd445baa0792b29d2a41d738))
* **client:** add convenience overloads for some methods ([ac75f13](https://github.com/Finch-API/finch-api-java/commit/ac75f134bce62861ce3d2c9d9a8dc91bc16e8b83))
* **client:** expose sleeper option ([6eb8e0f](https://github.com/Finch-API/finch-api-java/commit/6eb8e0f744b399b8a056c481b5d35850eaca0ced))


### Bug Fixes

* **ci:** use java-version 21 for publish step ([7d2e9d7](https://github.com/Finch-API/finch-api-java/commit/7d2e9d77738fef412fc7606230877cdb3befca7f))
* **client:** deserialization of empty objects ([bb6d18b](https://github.com/Finch-API/finch-api-java/commit/bb6d18b4c4c47e1efea7aa7ab716f2414afb4870))
* **client:** ensure single timer is created per client ([6eb8e0f](https://github.com/Finch-API/finch-api-java/commit/6eb8e0f744b399b8a056c481b5d35850eaca0ced))
* **client:** incorrect `getPackageVersion` impl ([a7638ae](https://github.com/Finch-API/finch-api-java/commit/a7638ae702e08f124b717a78ed90a6b7347ee92c))
* fix casing issue ([a493f5f](https://github.com/Finch-API/finch-api-java/commit/a493f5f1779c5af85ea3122a3bcba407eb0b1099))
* update singularization rules ([270e376](https://github.com/Finch-API/finch-api-java/commit/270e37692dcb7314ec7ff88debd588642615533d))


### Chores

* **ci:** reduce log noise ([b7eee64](https://github.com/Finch-API/finch-api-java/commit/b7eee641c7c531117813d3400955373a1268e495))
* improve formatter performance ([ebb6206](https://github.com/Finch-API/finch-api-java/commit/ebb6206eaecf268ccd3a251dc5a4159333bbe6af))
* **internal:** change some comment formatting ([235dfbc](https://github.com/Finch-API/finch-api-java/commit/235dfbc5ffb151fde9d608b7fb3db4f1d25bf0ef))
* **internal:** codegen related update ([5623e2d](https://github.com/Finch-API/finch-api-java/commit/5623e2d992fe5352d55f6ddec923e2b0239fef30))
* **internal:** codegen related update ([e87c1f4](https://github.com/Finch-API/finch-api-java/commit/e87c1f421dd2e0f4805187b928a2ae54b963535b))
* **internal:** codegen related update ([4f33876](https://github.com/Finch-API/finch-api-java/commit/4f3387637ddad2287835d764441a75e1a42ac216))
* remove memory upper bound from publishing step ([c1d1685](https://github.com/Finch-API/finch-api-java/commit/c1d16852bef0a7a7177e3619cce87d754f391edc))

## 7.5.2 (2025-08-20)

Full Changelog: [v7.5.1...v7.5.2](https://github.com/Finch-API/finch-api-java/compare/v7.5.1...v7.5.2)
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<!-- x-release-please-start-version -->

[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/7.5.2)
[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-java/7.5.2/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.5.2)
[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/7.6.0)
[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-java/7.6.0/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.6.0)

<!-- x-release-please-end -->

Expand All @@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/).

<!-- x-release-please-start-version -->

The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.5.2).
The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.6.0).

<!-- x-release-please-end -->

Expand All @@ -26,7 +26,7 @@ The REST API documentation can be found on [developer.tryfinch.com](https://deve
### Gradle

```kotlin
implementation("com.tryfinch.api:finch-java:7.5.2")
implementation("com.tryfinch.api:finch-java:7.6.0")
```

### Maven
Expand All @@ -35,7 +35,7 @@ implementation("com.tryfinch.api:finch-java:7.5.2")
<dependency>
<groupId>com.tryfinch.api</groupId>
<artifactId>finch-java</artifactId>
<version>7.5.2</version>
<version>7.6.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.tryfinch.api"
version = "7.5.2" // x-release-please-version
version = "7.6.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.tryfinch.api.client.FinchClient
import com.tryfinch.api.client.FinchClientImpl
import com.tryfinch.api.core.ClientOptions
import com.tryfinch.api.core.Sleeper
import com.tryfinch.api.core.Timeout
import com.tryfinch.api.core.http.AsyncStreamResponse
import com.tryfinch.api.core.http.Headers
Expand Down Expand Up @@ -133,6 +134,17 @@ class FinchOkHttpClient private constructor() {
clientOptions.streamHandlerExecutor(streamHandlerExecutor)
}

/**
* The interface to use for delaying execution, like during retries.
*
* This is primarily useful for using fake delays in tests.
*
* Defaults to real execution delays.
*
* This class takes ownership of the sleeper and closes it when closed.
*/
fun sleeper(sleeper: Sleeper) = apply { clientOptions.sleeper(sleeper) }

/**
* The clock to use for operations that require timing, like retries.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.tryfinch.api.client.FinchClientAsync
import com.tryfinch.api.client.FinchClientAsyncImpl
import com.tryfinch.api.core.ClientOptions
import com.tryfinch.api.core.Sleeper
import com.tryfinch.api.core.Timeout
import com.tryfinch.api.core.http.AsyncStreamResponse
import com.tryfinch.api.core.http.Headers
Expand Down Expand Up @@ -133,6 +134,17 @@ class FinchOkHttpClientAsync private constructor() {
clientOptions.streamHandlerExecutor(streamHandlerExecutor)
}

/**
* The interface to use for delaying execution, like during retries.
*
* This is primarily useful for using fake delays in tests.
*
* Defaults to real execution delays.
*
* This class takes ownership of the sleeper and closes it when closed.
*/
fun sleeper(sleeper: Sleeper) = apply { clientOptions.sleeper(sleeper) }

/**
* The clock to use for operations that require timing, like retries.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ private constructor(
* This class takes ownership of the executor and shuts it down, if possible, when closed.
*/
@get:JvmName("streamHandlerExecutor") val streamHandlerExecutor: Executor,
/**
* The interface to use for delaying execution, like during retries.
*
* This is primarily useful for using fake delays in tests.
*
* Defaults to real execution delays.
*
* This class takes ownership of the sleeper and closes it when closed.
*/
@get:JvmName("sleeper") val sleeper: Sleeper,
/**
* The clock to use for operations that require timing, like retries.
*
Expand Down Expand Up @@ -156,6 +166,7 @@ private constructor(
private var checkJacksonVersionCompatibility: Boolean = true
private var jsonMapper: JsonMapper = jsonMapper()
private var streamHandlerExecutor: Executor? = null
private var sleeper: Sleeper? = null
private var clock: Clock = Clock.systemUTC()
private var baseUrl: String? = null
private var headers: Headers.Builder = Headers.builder()
Expand All @@ -174,6 +185,7 @@ private constructor(
checkJacksonVersionCompatibility = clientOptions.checkJacksonVersionCompatibility
jsonMapper = clientOptions.jsonMapper
streamHandlerExecutor = clientOptions.streamHandlerExecutor
sleeper = clientOptions.sleeper
clock = clientOptions.clock
baseUrl = clientOptions.baseUrl
headers = clientOptions.headers.toBuilder()
Expand Down Expand Up @@ -231,6 +243,17 @@ private constructor(
else streamHandlerExecutor
}

/**
* The interface to use for delaying execution, like during retries.
*
* This is primarily useful for using fake delays in tests.
*
* Defaults to real execution delays.
*
* This class takes ownership of the sleeper and closes it when closed.
*/
fun sleeper(sleeper: Sleeper) = apply { this.sleeper = PhantomReachableSleeper(sleeper) }

/**
* The clock to use for operations that require timing, like retries.
*
Expand Down Expand Up @@ -438,6 +461,25 @@ private constructor(
*/
fun build(): ClientOptions {
val httpClient = checkRequired("httpClient", httpClient)
val streamHandlerExecutor =
streamHandlerExecutor
?: PhantomReachableExecutorService(
Executors.newCachedThreadPool(
object : ThreadFactory {

private val threadFactory: ThreadFactory =
Executors.defaultThreadFactory()
private val count = AtomicLong(0)

override fun newThread(runnable: Runnable): Thread =
threadFactory.newThread(runnable).also {
it.name =
"finch-stream-handler-thread-${count.getAndIncrement()}"
}
}
)
)
val sleeper = sleeper ?: PhantomReachableSleeper(DefaultSleeper())

val headers = Headers.builder()
val queryParams = QueryParams.builder()
Expand Down Expand Up @@ -471,26 +513,14 @@ private constructor(
httpClient,
RetryingHttpClient.builder()
.httpClient(httpClient)
.sleeper(sleeper)
.clock(clock)
.maxRetries(maxRetries)
.build(),
checkJacksonVersionCompatibility,
jsonMapper,
streamHandlerExecutor
?: Executors.newCachedThreadPool(
object : ThreadFactory {

private val threadFactory: ThreadFactory =
Executors.defaultThreadFactory()
private val count = AtomicLong(0)

override fun newThread(runnable: Runnable): Thread =
threadFactory.newThread(runnable).also {
it.name =
"finch-stream-handler-thread-${count.getAndIncrement()}"
}
}
),
streamHandlerExecutor,
sleeper,
clock,
baseUrl,
headers.build(),
Expand Down Expand Up @@ -519,5 +549,6 @@ private constructor(
fun close() {
httpClient.close()
(streamHandlerExecutor as? ExecutorService)?.shutdown()
sleeper.close()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.tryfinch.api.core

import java.time.Duration
import java.util.Timer
import java.util.TimerTask
import java.util.concurrent.CompletableFuture

class DefaultSleeper : Sleeper {

private val timer = Timer("DefaultSleeper", true)

override fun sleep(duration: Duration) = Thread.sleep(duration.toMillis())

override fun sleepAsync(duration: Duration): CompletableFuture<Void> {
val future = CompletableFuture<Void>()
timer.schedule(
object : TimerTask() {
override fun run() {
future.complete(null)
}
},
duration.toMillis(),
)
return future
}

override fun close() = timer.cancel()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.tryfinch.api.core

import java.time.Duration
import java.util.concurrent.CompletableFuture

/**
* A delegating wrapper around a [Sleeper] that closes it once it's only phantom reachable.
*
* This class ensures the [Sleeper] is closed even if the user forgets to do it.
*/
internal class PhantomReachableSleeper(private val sleeper: Sleeper) : Sleeper {

init {
closeWhenPhantomReachable(this, sleeper)
}

override fun sleep(duration: Duration) = sleeper.sleep(duration)

override fun sleepAsync(duration: Duration): CompletableFuture<Void> =
sleeper.sleepAsync(duration)

override fun close() = sleeper.close()
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package com.tryfinch.api.core

import java.util.Properties
import com.tryfinch.api.client.FinchClient

fun getOsArch(): String {
val osArch = System.getProperty("os.arch")
Expand All @@ -16,7 +16,7 @@ fun getOsArch(): String {
"x86_64" -> "x64"
"arm" -> "arm"
"aarch64" -> "arm64"
else -> "other:${osArch}"
else -> "other:$osArch"
}
}

Expand All @@ -30,13 +30,13 @@ fun getOsName(): String {
osName.startsWith("Linux") -> "Linux"
osName.startsWith("Mac OS") -> "MacOS"
osName.startsWith("Windows") -> "Windows"
else -> "Other:${osName}"
else -> "Other:$osName"
}
}

fun getOsVersion(): String = System.getProperty("os.version", "unknown")

fun getPackageVersion(): String =
Properties::class.java.`package`.implementationVersion ?: "unknown"
FinchClient::class.java.`package`.implementationVersion ?: "unknown"

fun getJavaVersion(): String = System.getProperty("java.version", "unknown")
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.tryfinch.api.core

import java.time.Duration
import java.util.concurrent.CompletableFuture

/**
* An interface for delaying execution for a specified amount of time.
*
* Useful for testing and cleaning up resources.
*/
interface Sleeper : AutoCloseable {

/** Synchronously pauses execution for the given [duration]. */
fun sleep(duration: Duration)

/** Asynchronously pauses execution for the given [duration]. */
fun sleepAsync(duration: Duration): CompletableFuture<Void>

/** Overridden from [AutoCloseable] to not have a checked exception in its signature. */
override fun close()
}
Loading
Loading