Skip to content

Commit

Permalink
release: 0.47.0 (#255)
Browse files Browse the repository at this point in the history
* chore(internal): remove unused test file (#254)

* feat(client): improve binary return values (#256)

* chore(ci): run tests in CI (#257)

* release: 0.47.0

---------

Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
  • Loading branch information
stainless-app[bot] authored Aug 1, 2024
1 parent 59e0349 commit 4fedaf5
Show file tree
Hide file tree
Showing 11 changed files with 39 additions and 39 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ jobs:
- name: Run lints
run: ./scripts/lint


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.46.0"
".": "0.47.0"
}
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.47.0 (2024-07-30)

Full Changelog: [v0.46.0...v0.47.0](https://github.com/lithic-com/lithic-kotlin/compare/v0.46.0...v0.47.0)

### Features

* **client:** improve binary return values ([#256](https://github.com/lithic-com/lithic-kotlin/issues/256)) ([c25532d](https://github.com/lithic-com/lithic-kotlin/commit/c25532da4398d7afe616ca1e220b8cde1a47902c))


### Chores

* **ci:** run tests in CI ([#257](https://github.com/lithic-com/lithic-kotlin/issues/257)) ([c7ab14b](https://github.com/lithic-com/lithic-kotlin/commit/c7ab14b8c124b57cedefbb9be2da739e654471e9))
* **internal:** remove unused test file ([#254](https://github.com/lithic-com/lithic-kotlin/issues/254)) ([a5ec664](https://github.com/lithic-com/lithic-kotlin/commit/a5ec6647ef2044b1dfad4ae825382fea6289b956))

## 0.46.0 (2024-07-26)

Full Changelog: [v0.45.0...v0.46.0](https://github.com/lithic-com/lithic-kotlin/compare/v0.45.0...v0.46.0)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithi
<!-- x-release-please-start-version -->

```kotlin
implementation("com.lithic.api:lithic-kotlin:0.46.0")
implementation("com.lithic.api:lithic-kotlin:0.47.0")
```

#### Maven
Expand All @@ -28,7 +28,7 @@ implementation("com.lithic.api:lithic-kotlin:0.46.0")
<dependency>
<groupId>com.lithic.api</groupId>
<artifactId>lithic-kotlin</artifactId>
<version>0.46.0</version>
<version>0.47.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 @@ -4,7 +4,7 @@ plugins {

allprojects {
group = "com.lithic.api"
version = "0.46.0" // x-release-please-version
version = "0.47.0" // x-release-please-version
}

nexusPublishing {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package com.lithic.api.core.http

import java.io.Closeable
import java.io.IOException
import java.io.InputStream
import java.io.OutputStream
import java.lang.AutoCloseable

interface BinaryResponseContent : Closeable {
interface BinaryResponseContent : AutoCloseable {

fun contentType(): String?

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.lithic.api.core.http

import com.lithic.api.core.RequestOptions
import java.io.Closeable
import java.lang.AutoCloseable

interface HttpClient : Closeable {
interface HttpClient : AutoCloseable {

fun execute(
request: HttpRequest,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.lithic.api.core.http

import java.io.Closeable
import java.io.IOException
import java.io.OutputStream
import java.lang.AutoCloseable

interface HttpRequestBody : Closeable {
interface HttpRequestBody : AutoCloseable {

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.lithic.api.core.http

import com.google.common.collect.ListMultimap
import java.io.Closeable
import java.io.InputStream
import java.lang.AutoCloseable

interface HttpResponse : Closeable {
interface HttpResponse : AutoCloseable {

fun statusCode(): Int

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,18 @@ private object StringHandler : Handler<String> {

private object BinaryHandler : Handler<BinaryResponseContent> {
override fun handle(response: HttpResponse): BinaryResponseContent {
return BinaryResponseContentImpl(response)
return object : BinaryResponseContent {
override fun contentType(): String? =
response.headers().get("Content-Type").firstOrNull()

override fun body(): InputStream = response.body()

override fun close() = response.close()

override fun writeTo(outputStream: OutputStream) {
response.body().copyTo(outputStream)
}
}
}
}

Expand Down Expand Up @@ -104,24 +115,3 @@ internal fun <T> Handler<T>.withErrorHandler(errorHandler: Handler<LithicError>)
}
}
}

class BinaryResponseContentImpl
constructor(
private val response: HttpResponse,
) : BinaryResponseContent {
override fun contentType(): String? {
return response.headers().get("Content-Type").firstOrNull()
}

override fun body(): InputStream {
return response.body()
}

override fun writeTo(outputStream: OutputStream) {
response.body().copyTo(outputStream)
}

override fun close() {
response.body().close()
}
}

This file was deleted.

0 comments on commit 4fedaf5

Please sign in to comment.