Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8b61c22
chore(internal): allow passing args to `./scripts/test`
stainless-app[bot] Jan 30, 2026
7df6475
feat(api): api update
stainless-app[bot] Feb 3, 2026
8ea3731
chore(internal): upgrade AssertJ
stainless-app[bot] Feb 6, 2026
a4e55fc
feat(api): api update
stainless-app[bot] Feb 10, 2026
2769639
codegen metadata
stainless-app[bot] Feb 11, 2026
4e9e830
chore(internal): codegen related update
stainless-app[bot] Feb 11, 2026
808e072
feat(api): api update
stainless-app[bot] Feb 12, 2026
d93464c
feat(api): manual updates
stainless-app[bot] Feb 12, 2026
9c54a99
feat(api): api update
stainless-app[bot] Feb 16, 2026
7eb1e48
chore(internal): update `TestServerExtension` comment
stainless-app[bot] Feb 17, 2026
6de031f
feat(api): api update
stainless-app[bot] Feb 18, 2026
2435e96
chore(internal): make `OkHttp` constructor internal
stainless-app[bot] Feb 18, 2026
c449333
feat(client): add more convenience service method overloads
stainless-app[bot] Feb 18, 2026
ce4d8a2
feat(client): add connection pooling option
stainless-app[bot] Feb 18, 2026
63f49a7
feat(api): api update
stainless-app[bot] Feb 19, 2026
a018be0
feat(api): api update
stainless-app[bot] Feb 21, 2026
7104ce5
chore: make `Properties` more resilient to `null`
stainless-app[bot] Feb 23, 2026
2fb8c9e
chore: drop apache dependency
stainless-app[bot] Feb 23, 2026
4e1cecf
chore(internal): expand imports
stainless-app[bot] Feb 24, 2026
c57175f
chore(docs): add missing descriptions
stainless-app[bot] Feb 27, 2026
fe15a1e
feat(api): api update
stainless-app[bot] Feb 27, 2026
723f156
feat(api): api update
stainless-app[bot] Mar 4, 2026
860ce4a
fix: fix request delays for retrying to be more respectful of high re…
stainless-app[bot] Mar 5, 2026
8195969
chore(internal): bump palantir-java-format
stainless-app[bot] Mar 5, 2026
e2497db
chore(test): do not count install time for mock server timeout
stainless-app[bot] Mar 5, 2026
e397453
feat(api): api update
stainless-app[bot] Mar 5, 2026
0e05662
feat(api): api update
stainless-app[bot] Mar 7, 2026
3c13033
fix(client): incorrect `Retry-After` parsing
stainless-app[bot] Mar 10, 2026
7091a72
feat(api): api update
stainless-app[bot] Mar 13, 2026
67887bf
chore(tests): update mock server to steady
stainless-app[bot] Mar 13, 2026
5fceea6
chore(internal): tweak CI branches
stainless-app[bot] Mar 16, 2026
b77931f
chore(internal): update retry delay tests
stainless-app[bot] Mar 17, 2026
562fcc3
fix(client): allow updating header/query affecting fields in `toBuild…
stainless-app[bot] Mar 17, 2026
86ce6f3
feat(api): api update
stainless-app[bot] Mar 19, 2026
24a716a
chore(internal): bump ktfmt
stainless-app[bot] Mar 19, 2026
849d3de
chore(tests): bump steady to v0.19.4
stainless-app[bot] Mar 20, 2026
a10b512
chore(tests): bump steady to v0.19.5
stainless-app[bot] Mar 20, 2026
fa67c12
chore(internal): update gitignore
stainless-app[bot] Mar 23, 2026
db03fe4
chore(tests): bump steady to v0.19.6
stainless-app[bot] Mar 23, 2026
847e839
chore(ci): skip lint on metadata-only changes
stainless-app[bot] Mar 24, 2026
7f90cdf
chore(tests): bump steady to v0.19.7
stainless-app[bot] Mar 24, 2026
a0f53b0
feat(api): api update
stainless-app[bot] Mar 24, 2026
19c71b8
codegen metadata
stainless-app[bot] Mar 25, 2026
f8ee810
chore(internal): update multipart form array serialization
stainless-app[bot] Mar 26, 2026
60af3d0
chore(tests): bump steady to v0.20.1
stainless-app[bot] Mar 31, 2026
e14d736
codegen metadata
stainless-app[bot] Mar 31, 2026
196c645
chore(tests): bump steady to v0.20.2
stainless-app[bot] Mar 31, 2026
2f25f86
feat(api): api update
stainless-app[bot] Apr 3, 2026
f1ab4b8
docs: improve examples
stainless-app[bot] Apr 10, 2026
ffa5b92
feat(api): api update
stainless-app[bot] Apr 11, 2026
f108cca
feat(api): api update
stainless-app[bot] Apr 13, 2026
bf92205
release: 1.13.0
stainless-app[bot] Apr 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
18 changes: 10 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
Expand All @@ -17,7 +19,7 @@ jobs:
timeout-minutes: 15
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/orb-kotlin' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')

steps:
- uses: actions/checkout@v6
Expand All @@ -41,7 +43,7 @@ jobs:
timeout-minutes: 15
name: build
runs-on: ${{ github.repository == 'stainless-sdks/orb-kotlin' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')

steps:
- uses: actions/checkout@v6
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.prism.log
.stdy.log
.gradle
.idea
.kotlin
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 @@
{
".": "1.12.0"
".": "1.13.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 126
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-9f1a41612765cb08d100b2c9e85080e93306e8d0942d535f16052c3eb18d9b8b.yml
openapi_spec_hash: 6dd28f36adc7e7d6a9245585eaf9b9c1
config_hash: bcf82bddb691f6be773ac6cae8c03b9a
configured_endpoints: 139
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/orb%2Forb-91a51960dab258d5435cc2a7f47760fd81e4b711b891a1fde3d98757e85e8add.yml
openapi_spec_hash: 192e4e94264db429260169f0b2e731ce
config_hash: c01c1191b1cd696c7ca855ff6d28a8df
67 changes: 67 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,72 @@
# Changelog

## 1.13.0 (2026-04-13)

Full Changelog: [v1.12.0...v1.13.0](https://github.com/orbcorp/orb-kotlin/compare/v1.12.0...v1.13.0)

### Features

* **api:** api update ([f108cca](https://github.com/orbcorp/orb-kotlin/commit/f108cca9594df29f98fee72963ce55534cee1b50))
* **api:** api update ([ffa5b92](https://github.com/orbcorp/orb-kotlin/commit/ffa5b92f2d89afa95c12a8d4fd6c608c983b3eac))
* **api:** api update ([2f25f86](https://github.com/orbcorp/orb-kotlin/commit/2f25f860175c24c187e7f8ffd2d283f0017b8722))
* **api:** api update ([a0f53b0](https://github.com/orbcorp/orb-kotlin/commit/a0f53b00b27077118e8da9afc249843109aad174))
* **api:** api update ([86ce6f3](https://github.com/orbcorp/orb-kotlin/commit/86ce6f3f76500235d4ebba8c96e2a4c84d4343db))
* **api:** api update ([7091a72](https://github.com/orbcorp/orb-kotlin/commit/7091a7208d02be59e8e72fcec879ca805cf00813))
* **api:** api update ([0e05662](https://github.com/orbcorp/orb-kotlin/commit/0e05662b947ceb6d28995075cc59fad024d6161f))
* **api:** api update ([e397453](https://github.com/orbcorp/orb-kotlin/commit/e3974536b461231fef00e23c9e02fe6b274b6bd1))
* **api:** api update ([723f156](https://github.com/orbcorp/orb-kotlin/commit/723f156299560f9a997cdb75603fc96dcbbe6906))
* **api:** api update ([fe15a1e](https://github.com/orbcorp/orb-kotlin/commit/fe15a1ef1f9ecba723e359bcba1f36a629d3d960))
* **api:** api update ([a018be0](https://github.com/orbcorp/orb-kotlin/commit/a018be0afe3879a198d667714f0de75f2c5cdbf9))
* **api:** api update ([63f49a7](https://github.com/orbcorp/orb-kotlin/commit/63f49a7d9be8e33bbdc0489310fe5ef7f5f1df44))
* **api:** api update ([6de031f](https://github.com/orbcorp/orb-kotlin/commit/6de031f604efd812fc895269568e4debf2b36566))
* **api:** api update ([9c54a99](https://github.com/orbcorp/orb-kotlin/commit/9c54a99fc2abd5d78d679967ddf8c48c960eeb03))
* **api:** api update ([808e072](https://github.com/orbcorp/orb-kotlin/commit/808e0728d3848bdcbd4e3ace9e4cf7e3e7fe9852))
* **api:** api update ([a4e55fc](https://github.com/orbcorp/orb-kotlin/commit/a4e55fcd736a0e61da05512f1015c542b77b2e01))
* **api:** api update ([7df6475](https://github.com/orbcorp/orb-kotlin/commit/7df6475b8742a8d3755c77f2168bfafdc0bf660a))
* **api:** manual updates ([d93464c](https://github.com/orbcorp/orb-kotlin/commit/d93464c286e31f707862d8a961c5f454351022e5))
* **client:** add connection pooling option ([ce4d8a2](https://github.com/orbcorp/orb-kotlin/commit/ce4d8a2e387790b9a1faf40b8f04374a74c9110e))
* **client:** add more convenience service method overloads ([c449333](https://github.com/orbcorp/orb-kotlin/commit/c449333d09d0b112178f42325b09fd7ff48811df))


### Bug Fixes

* **client:** allow updating header/query affecting fields in `toBuilder()` ([562fcc3](https://github.com/orbcorp/orb-kotlin/commit/562fcc3e28663dc802d801a6c359cbc5c04c681a))
* **client:** incorrect `Retry-After` parsing ([3c13033](https://github.com/orbcorp/orb-kotlin/commit/3c13033d0e362da84b28e1b5e26ba32d69188bac))
* fix request delays for retrying to be more respectful of high requested delays ([860ce4a](https://github.com/orbcorp/orb-kotlin/commit/860ce4a58b2d43cad76f218d23db8baccab57534))


### Chores

* **ci:** skip lint on metadata-only changes ([847e839](https://github.com/orbcorp/orb-kotlin/commit/847e8399ce5cd8c10fcf1abeeaba3184a0695b9f))
* **docs:** add missing descriptions ([c57175f](https://github.com/orbcorp/orb-kotlin/commit/c57175fc1dc641c6d28ad1dc72cec513bc5982c2))
* drop apache dependency ([2fb8c9e](https://github.com/orbcorp/orb-kotlin/commit/2fb8c9eb2ca0dbbf34cf0ec88e2053dae3af1df6))
* **internal:** allow passing args to `./scripts/test` ([8b61c22](https://github.com/orbcorp/orb-kotlin/commit/8b61c22ee33f728ae31d37c535280c2ca0c6a364))
* **internal:** bump ktfmt ([24a716a](https://github.com/orbcorp/orb-kotlin/commit/24a716abbe941baed09fedde8e5ef860e65e01ba))
* **internal:** bump palantir-java-format ([8195969](https://github.com/orbcorp/orb-kotlin/commit/8195969d6833b6dbf576fe9a74e511ce8d1b4a00))
* **internal:** codegen related update ([4e9e830](https://github.com/orbcorp/orb-kotlin/commit/4e9e830d982ed89d6e3f3a08e8dd952dedf44676))
* **internal:** expand imports ([4e1cecf](https://github.com/orbcorp/orb-kotlin/commit/4e1cecf9966e60a856333a3fd94f08ffb5abe1d2))
* **internal:** make `OkHttp` constructor internal ([2435e96](https://github.com/orbcorp/orb-kotlin/commit/2435e963adf84c275057b6a2e9ede78989e59cd0))
* **internal:** tweak CI branches ([5fceea6](https://github.com/orbcorp/orb-kotlin/commit/5fceea66f7cc3148c01a0a33c81000cf1fbfd1a1))
* **internal:** update `TestServerExtension` comment ([7eb1e48](https://github.com/orbcorp/orb-kotlin/commit/7eb1e48401da793d82b5b8465fef638088411e55))
* **internal:** update gitignore ([fa67c12](https://github.com/orbcorp/orb-kotlin/commit/fa67c1226f96926bce3720704e5fff5a29871679))
* **internal:** update multipart form array serialization ([f8ee810](https://github.com/orbcorp/orb-kotlin/commit/f8ee81005fb308a952e6fd946680c8e7d3f04190))
* **internal:** update retry delay tests ([b77931f](https://github.com/orbcorp/orb-kotlin/commit/b77931f2d6025e820c84c9a01626321c73a65240))
* **internal:** upgrade AssertJ ([8ea3731](https://github.com/orbcorp/orb-kotlin/commit/8ea373173f2b39a788ecd61aa1f4e83b9a27b8e4))
* make `Properties` more resilient to `null` ([7104ce5](https://github.com/orbcorp/orb-kotlin/commit/7104ce5655136a86694abe6438bb8d7df7093ff9))
* **test:** do not count install time for mock server timeout ([e2497db](https://github.com/orbcorp/orb-kotlin/commit/e2497db0a8bb5068d55a5ed257ebbad1e766bf2c))
* **tests:** bump steady to v0.19.4 ([849d3de](https://github.com/orbcorp/orb-kotlin/commit/849d3de8b4ea87f9d0468a7375f0fdcb643e5cbc))
* **tests:** bump steady to v0.19.5 ([a10b512](https://github.com/orbcorp/orb-kotlin/commit/a10b51221a51c8316be0ea100d22aa621e1672ad))
* **tests:** bump steady to v0.19.6 ([db03fe4](https://github.com/orbcorp/orb-kotlin/commit/db03fe4c53ad646d5de1f7bd7a58bb1d9554c768))
* **tests:** bump steady to v0.19.7 ([7f90cdf](https://github.com/orbcorp/orb-kotlin/commit/7f90cdf8a4b13e32a35eb69e48643dc3bbf7388e))
* **tests:** bump steady to v0.20.1 ([60af3d0](https://github.com/orbcorp/orb-kotlin/commit/60af3d0eafd87bccc861e9c586f384869042f50d))
* **tests:** bump steady to v0.20.2 ([196c645](https://github.com/orbcorp/orb-kotlin/commit/196c645c4bf289fb6ecfa7165e8b417679c52f0e))
* **tests:** update mock server to steady ([67887bf](https://github.com/orbcorp/orb-kotlin/commit/67887bfd41f3744589a59299b8b4b69c136dfc1e))


### Documentation

* improve examples ([f1ab4b8](https://github.com/orbcorp/orb-kotlin/commit/f1ab4b89f00819f7dc49af9c2163d5372a416327))

## 1.12.0 (2026-01-28)

Full Changelog: [v1.11.0...v1.12.0](https://github.com/orbcorp/orb-kotlin/compare/v1.11.0...v1.12.0)
Expand Down
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-kotlin)](https://central.sonatype.com/artifact/com.withorb.api/orb-kotlin/1.12.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.withorb.api/orb-kotlin)](https://central.sonatype.com/artifact/com.withorb.api/orb-kotlin/1.13.0)

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

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

```kotlin
implementation("com.withorb.api:orb-kotlin:1.12.0")
implementation("com.withorb.api:orb-kotlin:1.13.0")
```

### Maven
Expand All @@ -28,7 +28,7 @@ implementation("com.withorb.api:orb-kotlin:1.12.0")
<dependency>
<groupId>com.withorb.api</groupId>
<artifactId>orb-kotlin</artifactId>
<version>1.12.0</version>
<version>1.13.0</version>
</dependency>
```

Expand Down Expand Up @@ -408,6 +408,25 @@ val client: OrbClient = OrbOkHttpClient.builder()
.build()
```

### Connection pooling

To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:

```kotlin
import com.withorb.api.client.OrbClient
import com.withorb.api.client.okhttp.OrbOkHttpClient
import java.time.Duration

val client: OrbClient = OrbOkHttpClient.builder()
.fromEnv()
// If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.
.maxIdleConnections(10)
.keepAliveDuration(Duration.ofMinutes(2))
.build()
```

If both options are unset, OkHttp's default connection pool settings are used.

### HTTPS

> [!NOTE]
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
allprojects {
group = "com.withorb.api"
version = "1.12.0" // x-release-please-version
version = "1.13.0" // x-release-please-version
}

subprojects {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/orb.java.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ tasks.withType<Test>().configureEach {

val palantir by configurations.creating
dependencies {
palantir("com.palantir.javaformat:palantir-java-format:2.73.0")
palantir("com.palantir.javaformat:palantir-java-format:2.89.0")
}

fun registerPalantir(
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/orb.kotlin.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ tasks.withType<Test>().configureEach {

val ktfmt by configurations.creating
dependencies {
ktfmt("com.facebook:ktfmt:0.56")
ktfmt("com.facebook:ktfmt:0.61")
}

fun registerKtfmt(
Expand Down
2 changes: 1 addition & 1 deletion orb-kotlin-client-okhttp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.0")

testImplementation(kotlin("test"))
testImplementation("org.assertj:assertj-core:3.25.3")
testImplementation("org.assertj:assertj-core:3.27.7")
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import java.io.InputStream
import java.net.Proxy
import java.time.Duration
import java.util.concurrent.ExecutorService
import java.util.concurrent.TimeUnit
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
import kotlinx.coroutines.suspendCancellableCoroutine
import okhttp3.Call
import okhttp3.Callback
import okhttp3.ConnectionPool
import okhttp3.Dispatcher
import okhttp3.HttpUrl.Companion.toHttpUrl
import okhttp3.MediaType
Expand All @@ -31,7 +33,7 @@ import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor
import okio.BufferedSink

class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpClient) :
class OkHttpClient internal constructor(private val okHttpClient: okhttp3.OkHttpClient) :
HttpClient {

override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
Expand Down Expand Up @@ -202,6 +204,8 @@ class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpC

private var timeout: Timeout = Timeout.default()
private var proxy: Proxy? = null
private var maxIdleConnections: Int? = null
private var keepAliveDuration: Duration? = null
private var dispatcherExecutorService: ExecutorService? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
Expand All @@ -213,6 +217,28 @@ class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpC

fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }

/**
* Sets the maximum number of idle connections kept by the underlying [ConnectionPool].
*
* If this is set, then [keepAliveDuration] must also be set.
*
* If unset, then OkHttp's default is used.
*/
fun maxIdleConnections(maxIdleConnections: Int?) = apply {
this.maxIdleConnections = maxIdleConnections
}

/**
* Sets the keep-alive duration for idle connections in the underlying [ConnectionPool].
*
* If this is set, then [maxIdleConnections] must also be set.
*
* If unset, then OkHttp's default is used.
*/
fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
this.keepAliveDuration = keepAliveDuration
}

fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
this.dispatcherExecutorService = dispatcherExecutorService
}
Expand Down Expand Up @@ -242,6 +268,22 @@ class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpC
.apply {
dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) }

val maxIdleConnections = maxIdleConnections
val keepAliveDuration = keepAliveDuration
if (maxIdleConnections != null && keepAliveDuration != null) {
connectionPool(
ConnectionPool(
maxIdleConnections,
keepAliveDuration.toNanos(),
TimeUnit.NANOSECONDS,
)
)
} else {
check((maxIdleConnections != null) == (keepAliveDuration != null)) {
"Both or none of `maxIdleConnections` and `keepAliveDuration` must be set, but only one was set"
}
}

val sslSocketFactory = sslSocketFactory
val trustManager = trustManager
if (sslSocketFactory != null && trustManager != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class OrbOkHttpClient private constructor() {
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
private var dispatcherExecutorService: ExecutorService? = null
private var proxy: Proxy? = null
private var maxIdleConnections: Int? = null
private var keepAliveDuration: Duration? = null
private var sslSocketFactory: SSLSocketFactory? = null
private var trustManager: X509TrustManager? = null
private var hostnameVerifier: HostnameVerifier? = null
Expand All @@ -63,6 +65,36 @@ class OrbOkHttpClient private constructor() {

fun proxy(proxy: Proxy?) = apply { this.proxy = proxy }

/**
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
*
* If this is set, then [keepAliveDuration] must also be set.
*
* If unset, then OkHttp's default is used.
*/
fun maxIdleConnections(maxIdleConnections: Int?) = apply {
this.maxIdleConnections = maxIdleConnections
}

/**
* Alias for [Builder.maxIdleConnections].
*
* This unboxed primitive overload exists for backwards compatibility.
*/
fun maxIdleConnections(maxIdleConnections: Int) =
maxIdleConnections(maxIdleConnections as Int?)

/**
* The keep-alive duration for idle connections in the underlying OkHttp connection pool.
*
* If this is set, then [maxIdleConnections] must also be set.
*
* If unset, then OkHttp's default is used.
*/
fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
this.keepAliveDuration = keepAliveDuration
}

/**
* The socket factory used to secure HTTPS connections.
*
Expand Down Expand Up @@ -294,6 +326,8 @@ class OrbOkHttpClient private constructor() {
OkHttpClient.builder()
.timeout(clientOptions.timeout())
.proxy(proxy)
.maxIdleConnections(maxIdleConnections)
.keepAliveDuration(keepAliveDuration)
.dispatcherExecutorService(dispatcherExecutorService)
.sslSocketFactory(sslSocketFactory)
.trustManager(trustManager)
Expand Down
Loading
Loading