Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.97.1"
".": "0.98.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 167
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-54e6f7955e86265bc870eaae7f4a9cd716292457a83e032567f22bbb9ce6ad0d.yml
openapi_spec_hash: 6adbff5e5aeda88504047fc2c87e3fa0
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-aa089e65735b8884f8cb391b39b9a0b295819e438bf976c98cc6150628ca5488.yml
openapi_spec_hash: 719876533d1496e9192c7a734a78c736
config_hash: e9a46eb8acb9dc2c236f3e1958a1c4dd
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.98.0 (2025-07-28)

Full Changelog: [v0.97.1...v0.98.0](https://github.com/lithic-com/lithic-java/compare/v0.97.1...v0.98.0)

### Features

* **api:** updates Transaction retrieve response to match API ([88464d7](https://github.com/lithic-com/lithic-java/commit/88464d78e371337db7a1c4530866a9d18ba893d4))


### Documentation

* more code comments ([ceb45ee](https://github.com/lithic-com/lithic-java/commit/ceb45ee1e189449f1097d181d86238b1f535805d))

## 0.97.1 (2025-07-24)

Full Changelog: [v0.97.0...v0.97.1](https://github.com/lithic-com/lithic-java/compare/v0.97.0...v0.97.1)
Expand Down
14 changes: 7 additions & 7 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.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.97.1)
[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.97.1/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.97.1)
[![Maven Central](https://img.shields.io/maven-central/v/com.lithic.api/lithic-java)](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.98.0)
[![javadoc](https://javadoc.io/badge2/com.lithic.api/lithic-java/0.98.0/javadoc.svg)](https://javadoc.io/doc/com.lithic.api/lithic-java/0.98.0)

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

Expand All @@ -13,7 +13,7 @@ The Lithic Java SDK is similar to the Lithic Kotlin SDK but with minor differenc

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

The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.97.1).
The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.98.0).

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

Expand All @@ -24,7 +24,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic
### Gradle

```kotlin
implementation("com.lithic.api:lithic-java:0.97.1")
implementation("com.lithic.api:lithic-java:0.98.0")
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation("com.lithic.api:lithic-java:0.97.1")
<dependency>
<groupId>com.lithic.api</groupId>
<artifactId>lithic-java</artifactId>
<version>0.97.1</version>
<version>0.98.0</version>
</dependency>
```

Expand Down Expand Up @@ -377,7 +377,7 @@ If the SDK threw an exception, but you're _certain_ the version is compatible, t

### Retries

The SDK automatically retries 2 times by default, with a short exponential backoff.
The SDK automatically retries 2 times by default, with a short exponential backoff between requests.

Only the following error types are retried:

Expand All @@ -387,7 +387,7 @@ Only the following error types are retried:
- 429 Rate Limit
- 5xx Internal

The API may also explicitly instruct the SDK to retry or not retry a response.
The API may also explicitly instruct the SDK to retry or not retry a request.

To set a custom number of retries, configure the client using the `maxRetries` method:

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.lithic.api"
version = "0.97.1" // x-release-please-version
version = "0.98.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import com.lithic.api.client.LithicClient
import com.lithic.api.client.LithicClientImpl
import com.lithic.api.core.ClientOptions
import com.lithic.api.core.Timeout
import com.lithic.api.core.http.AsyncStreamResponse
import com.lithic.api.core.http.Headers
import com.lithic.api.core.http.HttpClient
import com.lithic.api.core.http.QueryParams
import com.lithic.api.core.jsonMapper
import java.net.Proxy
Expand All @@ -20,13 +22,22 @@ import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
import kotlin.jvm.optionals.getOrNull

/**
* A class that allows building an instance of [LithicClient] with [OkHttpClient] as the underlying
* [HttpClient].
*/
class LithicOkHttpClient private constructor() {

companion object {

/** Returns a mutable builder for constructing an instance of [LithicOkHttpClient]. */
/** Returns a mutable builder for constructing an instance of [LithicClient]. */
@JvmStatic fun builder() = Builder()

/**
* Returns a client configured using system properties and environment variables.
*
* @see ClientOptions.Builder.fromEnv
*/
@JvmStatic fun fromEnv(): LithicClient = builder().fromEnv().build()
}

Expand Down Expand Up @@ -103,25 +114,64 @@ class LithicOkHttpClient private constructor() {
clientOptions.checkJacksonVersionCompatibility(checkJacksonVersionCompatibility)
}

/**
* The Jackson JSON mapper to use for serializing and deserializing JSON.
*
* Defaults to [com.lithic.api.core.jsonMapper]. The default is usually sufficient and
* rarely needs to be overridden.
*/
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }

/**
* The executor to use for running [AsyncStreamResponse.Handler] callbacks.
*
* Defaults to a dedicated cached thread pool.
*/
fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
clientOptions.streamHandlerExecutor(streamHandlerExecutor)
}

/**
* The clock to use for operations that require timing, like retries.
*
* This is primarily useful for using a fake clock in tests.
*
* Defaults to [Clock.systemUTC].
*/
fun clock(clock: Clock) = apply { clientOptions.clock(clock) }

/**
* The base URL to use for every request.
*
* Defaults to the production environment: `https://api.lithic.com`.
*
* The following other environments, with dedicated builder methods, are available:
* - sandbox: `https://sandbox.lithic.com`
*/
fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) }

/** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */
fun baseUrl(baseUrl: Optional<String>) = baseUrl(baseUrl.getOrNull())

/** Sets [baseUrl] to `https://sandbox.lithic.com`. */
fun sandbox() = apply { clientOptions.sandbox() }

/**
* Whether to call `validate` on every response before returning it.
*
* Defaults to false, which means the shape of the response will not be validated upfront.
* Instead, validation will only occur for the parts of the response that are accessed.
*/
fun responseValidation(responseValidation: Boolean) = apply {
clientOptions.responseValidation(responseValidation)
}

/**
* Sets the maximum time allowed for various parts of an HTTP call's lifecycle, excluding
* retries.
*
* Defaults to [Timeout.default].
*/
fun timeout(timeout: Timeout) = apply { clientOptions.timeout(timeout) }

/**
Expand All @@ -133,6 +183,21 @@ class LithicOkHttpClient private constructor() {
*/
fun timeout(timeout: Duration) = apply { clientOptions.timeout(timeout) }

/**
* The maximum number of times to retry failed requests, with a short exponential backoff
* between requests.
*
* Only the following error types are retried:
* - Connection errors (for example, due to a network connectivity problem)
* - 408 Request Timeout
* - 409 Conflict
* - 429 Rate Limit
* - 5xx Internal
*
* The API may also explicitly instruct the SDK to retry or not retry a request.
*
* Defaults to 2.
*/
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }

fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }
Expand Down Expand Up @@ -225,6 +290,11 @@ class LithicOkHttpClient private constructor() {
clientOptions.removeAllQueryParams(keys)
}

/**
* Updates configuration using system properties and environment variables.
*
* @see ClientOptions.Builder.fromEnv
*/
fun fromEnv() = apply { clientOptions.fromEnv() }

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import com.lithic.api.client.LithicClientAsync
import com.lithic.api.client.LithicClientAsyncImpl
import com.lithic.api.core.ClientOptions
import com.lithic.api.core.Timeout
import com.lithic.api.core.http.AsyncStreamResponse
import com.lithic.api.core.http.Headers
import com.lithic.api.core.http.HttpClient
import com.lithic.api.core.http.QueryParams
import com.lithic.api.core.jsonMapper
import java.net.Proxy
Expand All @@ -20,13 +22,22 @@ import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
import kotlin.jvm.optionals.getOrNull

/**
* A class that allows building an instance of [LithicClientAsync] with [OkHttpClient] as the
* underlying [HttpClient].
*/
class LithicOkHttpClientAsync private constructor() {

companion object {

/** Returns a mutable builder for constructing an instance of [LithicOkHttpClientAsync]. */
/** Returns a mutable builder for constructing an instance of [LithicClientAsync]. */
@JvmStatic fun builder() = Builder()

/**
* Returns a client configured using system properties and environment variables.
*
* @see ClientOptions.Builder.fromEnv
*/
@JvmStatic fun fromEnv(): LithicClientAsync = builder().fromEnv().build()
}

Expand Down Expand Up @@ -103,25 +114,64 @@ class LithicOkHttpClientAsync private constructor() {
clientOptions.checkJacksonVersionCompatibility(checkJacksonVersionCompatibility)
}

/**
* The Jackson JSON mapper to use for serializing and deserializing JSON.
*
* Defaults to [com.lithic.api.core.jsonMapper]. The default is usually sufficient and
* rarely needs to be overridden.
*/
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }

/**
* The executor to use for running [AsyncStreamResponse.Handler] callbacks.
*
* Defaults to a dedicated cached thread pool.
*/
fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
clientOptions.streamHandlerExecutor(streamHandlerExecutor)
}

/**
* The clock to use for operations that require timing, like retries.
*
* This is primarily useful for using a fake clock in tests.
*
* Defaults to [Clock.systemUTC].
*/
fun clock(clock: Clock) = apply { clientOptions.clock(clock) }

/**
* The base URL to use for every request.
*
* Defaults to the production environment: `https://api.lithic.com`.
*
* The following other environments, with dedicated builder methods, are available:
* - sandbox: `https://sandbox.lithic.com`
*/
fun baseUrl(baseUrl: String?) = apply { clientOptions.baseUrl(baseUrl) }

/** Alias for calling [Builder.baseUrl] with `baseUrl.orElse(null)`. */
fun baseUrl(baseUrl: Optional<String>) = baseUrl(baseUrl.getOrNull())

/** Sets [baseUrl] to `https://sandbox.lithic.com`. */
fun sandbox() = apply { clientOptions.sandbox() }

/**
* Whether to call `validate` on every response before returning it.
*
* Defaults to false, which means the shape of the response will not be validated upfront.
* Instead, validation will only occur for the parts of the response that are accessed.
*/
fun responseValidation(responseValidation: Boolean) = apply {
clientOptions.responseValidation(responseValidation)
}

/**
* Sets the maximum time allowed for various parts of an HTTP call's lifecycle, excluding
* retries.
*
* Defaults to [Timeout.default].
*/
fun timeout(timeout: Timeout) = apply { clientOptions.timeout(timeout) }

/**
Expand All @@ -133,6 +183,21 @@ class LithicOkHttpClientAsync private constructor() {
*/
fun timeout(timeout: Duration) = apply { clientOptions.timeout(timeout) }

/**
* The maximum number of times to retry failed requests, with a short exponential backoff
* between requests.
*
* Only the following error types are retried:
* - Connection errors (for example, due to a network connectivity problem)
* - 408 Request Timeout
* - 409 Conflict
* - 429 Rate Limit
* - 5xx Internal
*
* The API may also explicitly instruct the SDK to retry or not retry a request.
*
* Defaults to 2.
*/
fun maxRetries(maxRetries: Int) = apply { clientOptions.maxRetries(maxRetries) }

fun apiKey(apiKey: String) = apply { clientOptions.apiKey(apiKey) }
Expand Down Expand Up @@ -225,6 +290,11 @@ class LithicOkHttpClientAsync private constructor() {
clientOptions.removeAllQueryParams(keys)
}

/**
* Updates configuration using system properties and environment variables.
*
* @see ClientOptions.Builder.fromEnv
*/
fun fromEnv() = apply { clientOptions.fromEnv() }

/**
Expand Down
Loading
Loading