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.266.1"
".": "0.267.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-c88cd4c32889125cd4b50b7d6c53436b4bf61f3f1fa4acbb7494e778aa891f40.yml
openapi_spec_hash: d381528847ebbd39bbf825f9fe678925
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-976ae14d2349a3599f9bd33dba52b3c12c265493a8af9e581c71b2e819b8de04.yml
openapi_spec_hash: d8a9fef4dfe082acdf834ac0339e800c
config_hash: a185e9a72778cc4658ea73fb3a7f1354
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.267.0 (2025-07-29)

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

### Features

* add retryable exception ([3beee7e](https://github.com/Increase/increase-java/commit/3beee7ef2b430fa43401ca77cd488246b66d86a0))
* **api:** api update ([2fb6b19](https://github.com/Increase/increase-java/commit/2fb6b195347be42452c7a477f8f1568b6ff3d239))
* **client:** ensure compat with proguard ([2a0df21](https://github.com/Increase/increase-java/commit/2a0df215d33f5f1dc05482171f2ed77a507f4f8c))

## 0.266.1 (2025-07-28)

Full Changelog: [v0.266.0...v0.266.1](https://github.com/Increase/increase-java/compare/v0.266.0...v0.266.1)
Expand Down
18 changes: 13 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.266.1)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.266.1/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.266.1)
[![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.267.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.267.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.267.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.266.1).
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.267.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.266.1")
implementation("com.increase.api:increase-java:0.267.0")
```

### Maven
Expand All @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.266.1")
<dependency>
<groupId>com.increase.api</groupId>
<artifactId>increase-java</artifactId>
<version>0.266.1</version>
<version>0.267.0</version>
</dependency>
```

Expand Down Expand Up @@ -304,6 +304,8 @@ The SDK throws custom unchecked exception types:

- [`IncreaseIoException`](increase-java-core/src/main/kotlin/com/increase/api/errors/IncreaseIoException.kt): I/O networking errors.

- [`IncreaseRetryableException`](increase-java-core/src/main/kotlin/com/increase/api/errors/IncreaseRetryableException.kt): Generic error indicating a failure that could be retried by the client.

- [`IncreaseInvalidDataException`](increase-java-core/src/main/kotlin/com/increase/api/errors/IncreaseInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response.

- [`IncreaseException`](increase-java-core/src/main/kotlin/com/increase/api/errors/IncreaseException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class.
Expand Down Expand Up @@ -434,6 +436,12 @@ both of which will raise an error if the signature is invalid. If secret is omit
Note that the "body" parameter must be the raw JSON string sent from the server (do not parse it first).
The `.unwrap()` method can parse this JSON for you.

## ProGuard and R8

Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `increase-java-core` is published with a [configuration file](increase-java-core/src/main/resources/META-INF/proguard/increase-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage).

ProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary.

## Jackson

The SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default.
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.266.1" // x-release-please-version
version = "0.267.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.increase.api.core.http
import com.increase.api.core.RequestOptions
import com.increase.api.core.checkRequired
import com.increase.api.errors.IncreaseIoException
import com.increase.api.errors.IncreaseRetryableException
import java.io.IOException
import java.time.Clock
import java.time.Duration
Expand Down Expand Up @@ -176,9 +177,10 @@ private constructor(
}

private fun shouldRetry(throwable: Throwable): Boolean =
// Only retry IOException and IncreaseIoException, other exceptions are not intended to be
// retried.
throwable is IOException || throwable is IncreaseIoException
// Only retry known retryable exceptions, other exceptions are not intended to be retried.
throwable is IOException ||
throwable is IncreaseIoException ||
throwable is IncreaseRetryableException

private fun getRetryBackoffDuration(retries: Int, response: HttpResponse?): Duration {
// About the Retry-After header:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.increase.api.errors

/**
* Exception that indicates a transient error that can be retried.
*
* When this exception is thrown during an HTTP request, the SDK will automatically retry the
* request up to the maximum number of retries.
*
* @param message A descriptive error message
* @param cause The underlying cause of this exception, if any
*/
class IncreaseRetryableException
@JvmOverloads
constructor(message: String? = null, cause: Throwable? = null) : IncreaseException(message, cause)
Loading
Loading