Skip to content

Commit fc781b5

Browse files
Merge pull request #8 from CASParser/release-please--branches--main--changes--next
release: 0.4.0
2 parents 97b20b6 + 0f834e7 commit fc781b5

File tree

84 files changed

+7082
-469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+7082
-469
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.3.0"
2+
".": "0.4.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 17
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-56b0f699c5437d9e5326626d35dfc972c17d01f12cb416c7f4854c8ea6d0e95e.yml
3-
openapi_spec_hash: 158f405c1880706266d83e6ff16b9d2f
4-
config_hash: ab495a165f0919b37cbf9efbd0f0e6ef
1+
configured_endpoints: 21
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cas-parser%2Fcas-parser-d9763d006969b49a1473851069fdfa429eb13133b64103a62963bb70ddb22305.yml
3+
openapi_spec_hash: 6aee689b7a759b12c85c088c15e29bc0
4+
config_hash: 4ab3e1ee76a463e0ed214541260ee12e

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## 0.4.0 (2026-02-23)
4+
5+
Full Changelog: [v0.3.0...v0.4.0](https://github.com/CASParser/cas-parser-java/compare/v0.3.0...v0.4.0)
6+
7+
### Features
8+
9+
* **api:** api update ([b23e224](https://github.com/CASParser/cas-parser-java/commit/b23e22466dac01c31d286182542dc8146d5fac7d))
10+
* **api:** api update ([cfdb276](https://github.com/CASParser/cas-parser-java/commit/cfdb276b8126bf167b489ded6fc13d84ad876dad))
11+
* **api:** api update ([8d2cb43](https://github.com/CASParser/cas-parser-java/commit/8d2cb43b11b1923624fdc32f7433115f5b20cf37))
12+
* **api:** manual updates ([2bb349e](https://github.com/CASParser/cas-parser-java/commit/2bb349ef8822aeda2d8d47d5f0c27994f9624446))
13+
* **client:** add connection pooling option ([3ad0fbc](https://github.com/CASParser/cas-parser-java/commit/3ad0fbcafa782f6f7dfcead9d4c4646aedd4e681))
14+
15+
16+
### Chores
17+
18+
* **internal:** make `OkHttp` constructor internal ([1939ec1](https://github.com/CASParser/cas-parser-java/commit/1939ec1346feeb7a1ea45db385d6f8b7f8daacf6))
19+
* **internal:** remove mock server code ([0bdc28f](https://github.com/CASParser/cas-parser-java/commit/0bdc28fc1a9ae2e735d2c40d9cf86c1dc00461ae))
20+
* **internal:** update `TestServerExtension` comment ([ff77ead](https://github.com/CASParser/cas-parser-java/commit/ff77ead512a0b13377c61c0e92cc478586e7a67e))
21+
* update mock server docs ([e7286da](https://github.com/CASParser/cas-parser-java/commit/e7286da78e71c2750514686fb39e2b1a0b5140af))
22+
323
## 0.3.0 (2026-02-14)
424

525
Full Changelog: [v0.2.1...v0.3.0](https://github.com/CASParser/cas-parser-java/compare/v0.2.1...v0.3.0)

README.md

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

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

5-
[![Maven Central](https://img.shields.io/maven-central/v/com.cas_parser.api/cas-parser-java)](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.3.0)
6-
[![javadoc](https://javadoc.io/badge2/com.cas_parser.api/cas-parser-java/0.3.0/javadoc.svg)](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.3.0)
5+
[![Maven Central](https://img.shields.io/maven-central/v/com.cas_parser.api/cas-parser-java)](https://central.sonatype.com/artifact/com.cas_parser.api/cas-parser-java/0.4.0)
6+
[![javadoc](https://javadoc.io/badge2/com.cas_parser.api/cas-parser-java/0.4.0/javadoc.svg)](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.4.0)
77

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

@@ -22,7 +22,7 @@ Use the Cas Parser MCP Server to enable AI assistants to interact with this API,
2222
2323
<!-- x-release-please-start-version -->
2424

25-
The REST API documentation can be found on [docs.casparser.in](https://docs.casparser.in). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.3.0).
25+
The REST API documentation can be found on [docs.casparser.in](https://docs.casparser.in). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.cas_parser.api/cas-parser-java/0.4.0).
2626

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

@@ -33,7 +33,7 @@ The REST API documentation can be found on [docs.casparser.in](https://docs.casp
3333
### Gradle
3434

3535
```kotlin
36-
implementation("com.cas_parser.api:cas-parser-java:0.3.0")
36+
implementation("com.cas_parser.api:cas-parser-java:0.4.0")
3737
```
3838

3939
### Maven
@@ -42,7 +42,7 @@ implementation("com.cas_parser.api:cas-parser-java:0.3.0")
4242
<dependency>
4343
<groupId>com.cas_parser.api</groupId>
4444
<artifactId>cas-parser-java</artifactId>
45-
<version>0.3.0</version>
45+
<version>0.4.0</version>
4646
</dependency>
4747
```
4848

@@ -342,6 +342,25 @@ CasParserClient client = CasParserOkHttpClient.builder()
342342
.build();
343343
```
344344

345+
### Connection pooling
346+
347+
To customize the underlying OkHttp connection pool, configure the client using the `maxIdleConnections` and `keepAliveDuration` methods:
348+
349+
```java
350+
import com.cas_parser.api.client.CasParserClient;
351+
import com.cas_parser.api.client.okhttp.CasParserOkHttpClient;
352+
import java.time.Duration;
353+
354+
CasParserClient client = CasParserOkHttpClient.builder()
355+
.fromEnv()
356+
// If `maxIdleConnections` is set, then `keepAliveDuration` must be set, and vice versa.
357+
.maxIdleConnections(10)
358+
.keepAliveDuration(Duration.ofMinutes(2))
359+
.build();
360+
```
361+
362+
If both options are unset, OkHttp's default connection pool settings are used.
363+
345364
### HTTPS
346365

347366
> [!NOTE]

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repositories {
99

1010
allprojects {
1111
group = "com.cas_parser.api"
12-
version = "0.3.0" // x-release-please-version
12+
version = "0.4.0" // x-release-please-version
1313
}
1414

1515
subprojects {

cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClient.kt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class CasParserOkHttpClient private constructor() {
4747
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
4848
private var dispatcherExecutorService: ExecutorService? = null
4949
private var proxy: Proxy? = null
50+
private var maxIdleConnections: Int? = null
51+
private var keepAliveDuration: Duration? = null
5052
private var sslSocketFactory: SSLSocketFactory? = null
5153
private var trustManager: X509TrustManager? = null
5254
private var hostnameVerifier: HostnameVerifier? = null
@@ -75,6 +77,46 @@ class CasParserOkHttpClient private constructor() {
7577
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
7678
fun proxy(proxy: Optional<Proxy>) = proxy(proxy.getOrNull())
7779

80+
/**
81+
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
82+
*
83+
* If this is set, then [keepAliveDuration] must also be set.
84+
*
85+
* If unset, then OkHttp's default is used.
86+
*/
87+
fun maxIdleConnections(maxIdleConnections: Int?) = apply {
88+
this.maxIdleConnections = maxIdleConnections
89+
}
90+
91+
/**
92+
* Alias for [Builder.maxIdleConnections].
93+
*
94+
* This unboxed primitive overload exists for backwards compatibility.
95+
*/
96+
fun maxIdleConnections(maxIdleConnections: Int) =
97+
maxIdleConnections(maxIdleConnections as Int?)
98+
99+
/**
100+
* Alias for calling [Builder.maxIdleConnections] with `maxIdleConnections.orElse(null)`.
101+
*/
102+
fun maxIdleConnections(maxIdleConnections: Optional<Int>) =
103+
maxIdleConnections(maxIdleConnections.getOrNull())
104+
105+
/**
106+
* The keep-alive duration for idle connections in the underlying OkHttp connection pool.
107+
*
108+
* If this is set, then [maxIdleConnections] must also be set.
109+
*
110+
* If unset, then OkHttp's default is used.
111+
*/
112+
fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
113+
this.keepAliveDuration = keepAliveDuration
114+
}
115+
116+
/** Alias for calling [Builder.keepAliveDuration] with `keepAliveDuration.orElse(null)`. */
117+
fun keepAliveDuration(keepAliveDuration: Optional<Duration>) =
118+
keepAliveDuration(keepAliveDuration.getOrNull())
119+
78120
/**
79121
* The socket factory used to secure HTTPS connections.
80122
*
@@ -328,6 +370,8 @@ class CasParserOkHttpClient private constructor() {
328370
OkHttpClient.builder()
329371
.timeout(clientOptions.timeout())
330372
.proxy(proxy)
373+
.maxIdleConnections(maxIdleConnections)
374+
.keepAliveDuration(keepAliveDuration)
331375
.dispatcherExecutorService(dispatcherExecutorService)
332376
.sslSocketFactory(sslSocketFactory)
333377
.trustManager(trustManager)

cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/CasParserOkHttpClientAsync.kt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ class CasParserOkHttpClientAsync private constructor() {
4747
private var clientOptions: ClientOptions.Builder = ClientOptions.builder()
4848
private var dispatcherExecutorService: ExecutorService? = null
4949
private var proxy: Proxy? = null
50+
private var maxIdleConnections: Int? = null
51+
private var keepAliveDuration: Duration? = null
5052
private var sslSocketFactory: SSLSocketFactory? = null
5153
private var trustManager: X509TrustManager? = null
5254
private var hostnameVerifier: HostnameVerifier? = null
@@ -75,6 +77,46 @@ class CasParserOkHttpClientAsync private constructor() {
7577
/** Alias for calling [Builder.proxy] with `proxy.orElse(null)`. */
7678
fun proxy(proxy: Optional<Proxy>) = proxy(proxy.getOrNull())
7779

80+
/**
81+
* The maximum number of idle connections kept by the underlying OkHttp connection pool.
82+
*
83+
* If this is set, then [keepAliveDuration] must also be set.
84+
*
85+
* If unset, then OkHttp's default is used.
86+
*/
87+
fun maxIdleConnections(maxIdleConnections: Int?) = apply {
88+
this.maxIdleConnections = maxIdleConnections
89+
}
90+
91+
/**
92+
* Alias for [Builder.maxIdleConnections].
93+
*
94+
* This unboxed primitive overload exists for backwards compatibility.
95+
*/
96+
fun maxIdleConnections(maxIdleConnections: Int) =
97+
maxIdleConnections(maxIdleConnections as Int?)
98+
99+
/**
100+
* Alias for calling [Builder.maxIdleConnections] with `maxIdleConnections.orElse(null)`.
101+
*/
102+
fun maxIdleConnections(maxIdleConnections: Optional<Int>) =
103+
maxIdleConnections(maxIdleConnections.getOrNull())
104+
105+
/**
106+
* The keep-alive duration for idle connections in the underlying OkHttp connection pool.
107+
*
108+
* If this is set, then [maxIdleConnections] must also be set.
109+
*
110+
* If unset, then OkHttp's default is used.
111+
*/
112+
fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
113+
this.keepAliveDuration = keepAliveDuration
114+
}
115+
116+
/** Alias for calling [Builder.keepAliveDuration] with `keepAliveDuration.orElse(null)`. */
117+
fun keepAliveDuration(keepAliveDuration: Optional<Duration>) =
118+
keepAliveDuration(keepAliveDuration.getOrNull())
119+
78120
/**
79121
* The socket factory used to secure HTTPS connections.
80122
*
@@ -328,6 +370,8 @@ class CasParserOkHttpClientAsync private constructor() {
328370
OkHttpClient.builder()
329371
.timeout(clientOptions.timeout())
330372
.proxy(proxy)
373+
.maxIdleConnections(maxIdleConnections)
374+
.keepAliveDuration(keepAliveDuration)
331375
.dispatcherExecutorService(dispatcherExecutorService)
332376
.sslSocketFactory(sslSocketFactory)
333377
.trustManager(trustManager)

cas-parser-java-client-okhttp/src/main/kotlin/com/cas_parser/api/client/okhttp/OkHttpClient.kt

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,13 @@ import java.time.Duration
1616
import java.util.concurrent.CancellationException
1717
import java.util.concurrent.CompletableFuture
1818
import java.util.concurrent.ExecutorService
19+
import java.util.concurrent.TimeUnit
1920
import javax.net.ssl.HostnameVerifier
2021
import javax.net.ssl.SSLSocketFactory
2122
import javax.net.ssl.X509TrustManager
2223
import okhttp3.Call
2324
import okhttp3.Callback
25+
import okhttp3.ConnectionPool
2426
import okhttp3.Dispatcher
2527
import okhttp3.HttpUrl.Companion.toHttpUrl
2628
import okhttp3.MediaType
@@ -33,7 +35,7 @@ import okhttp3.logging.HttpLoggingInterceptor
3335
import okio.BufferedSink
3436

3537
class OkHttpClient
36-
private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient {
38+
internal constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClient) : HttpClient {
3739

3840
override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse {
3941
val call = newCall(request, requestOptions)
@@ -200,6 +202,8 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
200202

201203
private var timeout: Timeout = Timeout.default()
202204
private var proxy: Proxy? = null
205+
private var maxIdleConnections: Int? = null
206+
private var keepAliveDuration: Duration? = null
203207
private var dispatcherExecutorService: ExecutorService? = null
204208
private var sslSocketFactory: SSLSocketFactory? = null
205209
private var trustManager: X509TrustManager? = null
@@ -211,6 +215,28 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
211215

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

218+
/**
219+
* Sets the maximum number of idle connections kept by the underlying [ConnectionPool].
220+
*
221+
* If this is set, then [keepAliveDuration] must also be set.
222+
*
223+
* If unset, then OkHttp's default is used.
224+
*/
225+
fun maxIdleConnections(maxIdleConnections: Int?) = apply {
226+
this.maxIdleConnections = maxIdleConnections
227+
}
228+
229+
/**
230+
* Sets the keep-alive duration for idle connections in the underlying [ConnectionPool].
231+
*
232+
* If this is set, then [maxIdleConnections] must also be set.
233+
*
234+
* If unset, then OkHttp's default is used.
235+
*/
236+
fun keepAliveDuration(keepAliveDuration: Duration?) = apply {
237+
this.keepAliveDuration = keepAliveDuration
238+
}
239+
214240
fun dispatcherExecutorService(dispatcherExecutorService: ExecutorService?) = apply {
215241
this.dispatcherExecutorService = dispatcherExecutorService
216242
}
@@ -240,6 +266,22 @@ private constructor(@JvmSynthetic internal val okHttpClient: okhttp3.OkHttpClien
240266
.apply {
241267
dispatcherExecutorService?.let { dispatcher(Dispatcher(it)) }
242268

269+
val maxIdleConnections = maxIdleConnections
270+
val keepAliveDuration = keepAliveDuration
271+
if (maxIdleConnections != null && keepAliveDuration != null) {
272+
connectionPool(
273+
ConnectionPool(
274+
maxIdleConnections,
275+
keepAliveDuration.toNanos(),
276+
TimeUnit.NANOSECONDS,
277+
)
278+
)
279+
} else {
280+
check((maxIdleConnections != null) == (keepAliveDuration != null)) {
281+
"Both or none of `maxIdleConnections` and `keepAliveDuration` must be set, but only one was set"
282+
}
283+
}
284+
243285
val sslSocketFactory = sslSocketFactory
244286
val trustManager = trustManager
245287
if (sslSocketFactory != null && trustManager != null) {

cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClient.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.cas_parser.api.services.blocking.CamsKfintechService
88
import com.cas_parser.api.services.blocking.CdslService
99
import com.cas_parser.api.services.blocking.ContractNoteService
1010
import com.cas_parser.api.services.blocking.CreditService
11+
import com.cas_parser.api.services.blocking.InboundEmailService
1112
import com.cas_parser.api.services.blocking.InboxService
1213
import com.cas_parser.api.services.blocking.KfintechService
1314
import com.cas_parser.api.services.blocking.LogService
@@ -74,6 +75,8 @@ interface CasParserClient {
7475

7576
fun smart(): SmartService
7677

78+
fun inboundEmail(): InboundEmailService
79+
7780
/**
7881
* Closes this client, relinquishing any underlying resources.
7982
*
@@ -118,5 +121,7 @@ interface CasParserClient {
118121
fun nsdl(): NsdlService.WithRawResponse
119122

120123
fun smart(): SmartService.WithRawResponse
124+
125+
fun inboundEmail(): InboundEmailService.WithRawResponse
121126
}
122127
}

cas-parser-java-core/src/main/kotlin/com/cas_parser/api/client/CasParserClientAsync.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import com.cas_parser.api.services.async.CamsKfintechServiceAsync
88
import com.cas_parser.api.services.async.CdslServiceAsync
99
import com.cas_parser.api.services.async.ContractNoteServiceAsync
1010
import com.cas_parser.api.services.async.CreditServiceAsync
11+
import com.cas_parser.api.services.async.InboundEmailServiceAsync
1112
import com.cas_parser.api.services.async.InboxServiceAsync
1213
import com.cas_parser.api.services.async.KfintechServiceAsync
1314
import com.cas_parser.api.services.async.LogServiceAsync
@@ -74,6 +75,8 @@ interface CasParserClientAsync {
7475

7576
fun smart(): SmartServiceAsync
7677

78+
fun inboundEmail(): InboundEmailServiceAsync
79+
7780
/**
7881
* Closes this client, relinquishing any underlying resources.
7982
*
@@ -122,5 +125,7 @@ interface CasParserClientAsync {
122125
fun nsdl(): NsdlServiceAsync.WithRawResponse
123126

124127
fun smart(): SmartServiceAsync.WithRawResponse
128+
129+
fun inboundEmail(): InboundEmailServiceAsync.WithRawResponse
125130
}
126131
}

0 commit comments

Comments
 (0)