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.272.0"
".": "0.273.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: 202
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-aceb2cce1f9a46b1059a04de979b4c40210190639a4c264944b4402042168804.yml
openapi_spec_hash: 5b4ea7615676e742cea44d107b8038ca
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-147712ba3a72b1dea9a966f9b0ebc99ccebe38e1789426115f3b4c8977ed03c8.yml
openapi_spec_hash: 6c6fc01c8ea4f34b3c2553928945c100
config_hash: a185e9a72778cc4658ea73fb3a7f1354
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.273.0 (2025-08-06)

Full Changelog: [v0.272.0...v0.273.0](https://github.com/Increase/increase-java/compare/v0.272.0...v0.273.0)

### Features

* **api:** api update ([eb1b597](https://github.com/Increase/increase-java/commit/eb1b597349163ef5372f2a28a54607e3239e7953))


### Chores

* **example:** fix run example comment ([fee56bf](https://github.com/Increase/increase-java/commit/fee56bf02015b7e8ac6c8a1ad789138fc1897123))
* **internal:** add async lock helper ([207a33b](https://github.com/Increase/increase-java/commit/207a33b115a9dce3b3132b9b1bc91b799462d2e6))

## 0.272.0 (2025-08-04)

Full Changelog: [v0.271.0...v0.272.0](https://github.com/Increase/increase-java/compare/v0.271.0...v0.272.0)
Expand Down
10 changes: 5 additions & 5 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.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.272.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.272.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.272.0)
[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.273.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.273.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.273.0)

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

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

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

The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.272.0).
The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.273.0).

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

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

```kotlin
implementation("com.increase.api:increase-java:0.272.0")
implementation("com.increase.api:increase-java:0.273.0")
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.272.0")
<dependency>
<groupId>com.increase.api</groupId>
<artifactId>increase-java</artifactId>
<version>0.272.0</version>
<version>0.273.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 @@ -8,7 +8,7 @@ repositories {

allprojects {
group = "com.increase.api"
version = "0.272.0" // x-release-please-version
version = "0.273.0" // x-release-please-version
}

subprojects {
Expand Down
23 changes: 23 additions & 0 deletions increase-java-core/src/main/kotlin/com/increase/api/core/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import com.increase.api.core.http.Headers
import com.increase.api.errors.IncreaseInvalidDataException
import java.util.Collections
import java.util.SortedMap
import java.util.concurrent.CompletableFuture
import java.util.concurrent.locks.Lock

@JvmSynthetic
internal fun <T : Any> T?.getOrThrow(name: String): T =
Expand Down Expand Up @@ -95,3 +97,24 @@ internal fun Headers.getRequiredHeader(name: String): String =
values(name).firstOrNull() ?: throw IncreaseInvalidDataException("Could not find $name header")

internal interface Enum

/**
* Executes the given [action] while holding the lock, returning a [CompletableFuture] with the
* result.
*
* @param action The asynchronous action to execute while holding the lock
* @return A [CompletableFuture] that completes with the result of the action
*/
@JvmSynthetic
internal fun <T> Lock.withLockAsync(action: () -> CompletableFuture<T>): CompletableFuture<T> {
lock()
val future =
try {
action()
} catch (e: Throwable) {
unlock()
throw e
}
future.whenComplete { _, _ -> unlock() }
return future
}
Loading
Loading