Skip to content

Commit abdc5a2

Browse files
release: 0.45.0 (#262)
* chore(internal): remove unused test file (#261) * feat(client): improve binary return values (#263) * chore(ci): run tests in CI (#264) * release: 0.45.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 927c193 commit abdc5a2

11 files changed

Lines changed: 43 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ jobs:
3535
- name: Run lints
3636
run: ./scripts/lint
3737

38+

.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.44.0"
2+
".": "0.45.0"
33
}

CHANGELOG.md

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

3+
## 0.45.0 (2024-07-30)
4+
5+
Full Changelog: [v0.44.0...v0.45.0](https://github.com/lithic-com/lithic-java/compare/v0.44.0...v0.45.0)
6+
7+
### Features
8+
9+
* **client:** improve binary return values ([#263](https://github.com/lithic-com/lithic-java/issues/263)) ([c74f890](https://github.com/lithic-com/lithic-java/commit/c74f890a757517bd76a7927bf5153b77e14db149))
10+
11+
12+
### Chores
13+
14+
* **ci:** run tests in CI ([#264](https://github.com/lithic-com/lithic-java/issues/264)) ([b9ed756](https://github.com/lithic-com/lithic-java/commit/b9ed756d87b057964754a50f1dd72fc01aef4b89))
15+
* **internal:** remove unused test file ([#261](https://github.com/lithic-com/lithic-java/issues/261)) ([d580e71](https://github.com/lithic-com/lithic-java/commit/d580e71186717291dbaa72df2de6926816dd8fe1))
16+
317
## 0.44.0 (2024-07-26)
418

519
Full Changelog: [v0.43.0...v0.44.0](https://github.com/lithic-com/lithic-java/compare/v0.43.0...v0.44.0)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
[![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.44.0)
5+
[![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.45.0)
66

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

@@ -25,7 +25,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithi
2525
<!-- x-release-please-start-version -->
2626

2727
```kotlin
28-
implementation("com.lithic.api:lithic-java:0.44.0")
28+
implementation("com.lithic.api:lithic-java:0.45.0")
2929
```
3030

3131
#### Maven
@@ -34,7 +34,7 @@ implementation("com.lithic.api:lithic-java:0.44.0")
3434
<dependency>
3535
<groupId>com.lithic.api</groupId>
3636
<artifactId>lithic-java</artifactId>
37-
<version>0.44.0</version>
37+
<version>0.45.0</version>
3838
</dependency>
3939
```
4040

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44

55
allprojects {
66
group = "com.lithic.api"
7-
version = "0.44.0" // x-release-please-version
7+
version = "0.45.0" // x-release-please-version
88
}
99

1010
nexusPublishing {

lithic-java-core/src/main/kotlin/com/lithic/api/core/http/BinaryResponseContent.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package com.lithic.api.core.http
22

3-
import java.io.Closeable
43
import java.io.IOException
54
import java.io.InputStream
65
import java.io.OutputStream
6+
import java.lang.AutoCloseable
7+
import java.util.Optional
78

8-
interface BinaryResponseContent : Closeable {
9+
interface BinaryResponseContent : AutoCloseable {
910

10-
fun contentType(): String?
11+
fun contentType(): Optional<String>
1112

1213
fun body(): InputStream
1314

lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpClient.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.lithic.api.core.http
22

33
import com.lithic.api.core.RequestOptions
4-
import java.io.Closeable
4+
import java.lang.AutoCloseable
55
import java.util.concurrent.CompletableFuture
66

7-
interface HttpClient : Closeable {
7+
interface HttpClient : AutoCloseable {
88

99
fun execute(
1010
request: HttpRequest,

lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpRequestBody.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.lithic.api.core.http
22

3-
import java.io.Closeable
43
import java.io.IOException
54
import java.io.OutputStream
5+
import java.lang.AutoCloseable
66

7-
interface HttpRequestBody : Closeable {
7+
interface HttpRequestBody : AutoCloseable {
88

99
@Throws(IOException::class) fun writeTo(outputStream: OutputStream)
1010

lithic-java-core/src/main/kotlin/com/lithic/api/core/http/HttpResponse.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.lithic.api.core.http
22

33
import com.google.common.collect.ListMultimap
4-
import java.io.Closeable
54
import java.io.InputStream
5+
import java.lang.AutoCloseable
66

7-
interface HttpResponse : Closeable {
7+
interface HttpResponse : AutoCloseable {
88

99
fun statusCode(): Int
1010

lithic-java-core/src/main/kotlin/com/lithic/api/services/Handlers.kt

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import com.lithic.api.errors.UnexpectedStatusCodeException
1919
import com.lithic.api.errors.UnprocessableEntityException
2020
import java.io.InputStream
2121
import java.io.OutputStream
22+
import java.util.Optional
2223

2324
@JvmSynthetic internal fun emptyHandler(): Handler<Void?> = EmptyHandler
2425

@@ -38,7 +39,18 @@ private object StringHandler : Handler<String> {
3839

3940
private object BinaryHandler : Handler<BinaryResponseContent> {
4041
override fun handle(response: HttpResponse): BinaryResponseContent {
41-
return BinaryResponseContentImpl(response)
42+
return object : BinaryResponseContent {
43+
override fun contentType(): Optional<String> =
44+
Optional.ofNullable(response.headers().get("Content-Type").firstOrNull())
45+
46+
override fun body(): InputStream = response.body()
47+
48+
override fun close() = response.close()
49+
50+
override fun writeTo(outputStream: OutputStream) {
51+
response.body().copyTo(outputStream)
52+
}
53+
}
4254
}
4355
}
4456

@@ -107,24 +119,3 @@ internal fun <T> Handler<T>.withErrorHandler(errorHandler: Handler<LithicError>)
107119
}
108120
}
109121
}
110-
111-
class BinaryResponseContentImpl
112-
constructor(
113-
private val response: HttpResponse,
114-
) : BinaryResponseContent {
115-
override fun contentType(): String? {
116-
return response.headers().get("Content-Type").firstOrNull()
117-
}
118-
119-
override fun body(): InputStream {
120-
return response.body()
121-
}
122-
123-
override fun writeTo(outputStream: OutputStream) {
124-
response.body().copyTo(outputStream)
125-
}
126-
127-
override fun close() {
128-
response.body().close()
129-
}
130-
}

0 commit comments

Comments
 (0)