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
The table of contents is too big for display.
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.368.0"
".": "0.369.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 229
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-bd464d151612058d8029150b376949b22d5515af23621465c0ce1c1069b91644.yml
openapi_spec_hash: e60e1548c523a0ee7c9daa1bd988cbc5
config_hash: ca1425272e17fa23d4466d33492334fa
config_hash: eecc5886c26d07c167f37f30ae505a2c
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.369.0 (2025-11-26)

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

### Features

* **api:** api update ([49f8354](https://github.com/Increase/increase-java/commit/49f8354e6d4f314efbe012732e12254ae18a3127))

## 0.368.0 (2025-11-24)

Full Changelog: [v0.367.0...v0.368.0](https://github.com/Increase/increase-java/compare/v0.367.0...v0.368.0)
Expand Down
120 changes: 5 additions & 115 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.368.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.368.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.368.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.369.0)
[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.369.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.369.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.368.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.369.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.368.0")
implementation("com.increase.api:increase-java:0.369.0")
```

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

Expand All @@ -57,8 +57,6 @@ IncreaseClient client = IncreaseOkHttpClient.fromEnv();

AccountCreateParams params = AccountCreateParams.builder()
.name("New Account!")
.entityId("entity_n8y8tnk2p9339ti393yi")
.programId("program_i2v2os4mwza1oetokh9i")
.build();
Account account = client.accounts().create(params);
```
Expand Down Expand Up @@ -161,8 +159,6 @@ IncreaseClient client = IncreaseOkHttpClient.fromEnv();

AccountCreateParams params = AccountCreateParams.builder()
.name("New Account!")
.entityId("entity_n8y8tnk2p9339ti393yi")
.programId("program_i2v2os4mwza1oetokh9i")
.build();
CompletableFuture<Account> account = client.async().accounts().create(params);
```
Expand All @@ -182,8 +178,6 @@ IncreaseClientAsync client = IncreaseOkHttpClientAsync.fromEnv();

AccountCreateParams params = AccountCreateParams.builder()
.name("New Account!")
.entityId("entity_n8y8tnk2p9339ti393yi")
.programId("program_i2v2os4mwza1oetokh9i")
.build();
CompletableFuture<Account> account = client.accounts().create(params);
```
Expand Down Expand Up @@ -268,8 +262,6 @@ import com.increase.api.models.accounts.AccountCreateParams;

AccountCreateParams params = AccountCreateParams.builder()
.name("New Account!")
.entityId("entity_n8y8tnk2p9339ti393yi")
.programId("program_i2v2os4mwza1oetokh9i")
.build();
HttpResponseFor<Account> account = client.accounts().withRawResponse().create(params);

Expand Down Expand Up @@ -310,106 +302,6 @@ The SDK throws custom unchecked exception types:

- [`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.

## Pagination

The SDK defines methods that return a paginated lists of results. It provides convenient ways to access the results either one page at a time or item-by-item across all pages.

### Auto-pagination

To iterate through all results across all pages, use the `autoPager()` method, which automatically fetches more pages as needed.

When using the synchronous client, the method returns an [`Iterable`](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html)

```java
import com.increase.api.models.accounts.Account;
import com.increase.api.models.accounts.AccountListPage;

AccountListPage page = client.accounts().list();

// Process as an Iterable
for (Account account : page.autoPager()) {
System.out.println(account);
}

// Process as a Stream
page.autoPager()
.stream()
.limit(50)
.forEach(account -> System.out.println(account));
```

When using the asynchronous client, the method returns an [`AsyncStreamResponse`](increase-java-core/src/main/kotlin/com/increase/api/core/http/AsyncStreamResponse.kt):

```java
import com.increase.api.core.http.AsyncStreamResponse;
import com.increase.api.models.accounts.Account;
import com.increase.api.models.accounts.AccountListPageAsync;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;

CompletableFuture<AccountListPageAsync> pageFuture = client.async().accounts().list();

pageFuture.thenRun(page -> page.autoPager().subscribe(account -> {
System.out.println(account);
}));

// If you need to handle errors or completion of the stream
pageFuture.thenRun(page -> page.autoPager().subscribe(new AsyncStreamResponse.Handler<>() {
@Override
public void onNext(Account account) {
System.out.println(account);
}

@Override
public void onComplete(Optional<Throwable> error) {
if (error.isPresent()) {
System.out.println("Something went wrong!");
throw new RuntimeException(error.get());
} else {
System.out.println("No more!");
}
}
}));

// Or use futures
pageFuture.thenRun(page -> page.autoPager()
.subscribe(account -> {
System.out.println(account);
})
.onCompleteFuture()
.whenComplete((unused, error) -> {
if (error != null) {
System.out.println("Something went wrong!");
throw new RuntimeException(error);
} else {
System.out.println("No more!");
}
}));
```

### Manual pagination

To access individual page items and manually request the next page, use the `items()`,
`hasNextPage()`, and `nextPage()` methods:

```java
import com.increase.api.models.accounts.Account;
import com.increase.api.models.accounts.AccountListPage;

AccountListPage page = client.accounts().list();
while (true) {
for (Account account : page.items()) {
System.out.println(account);
}

if (!page.hasNextPage()) {
break;
}

page = page.nextPage();
}
```

## Logging

The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor).
Expand Down Expand Up @@ -628,8 +520,6 @@ import com.increase.api.models.accounts.AccountCreateParams;

AccountCreateParams params = AccountCreateParams.builder()
.name(JsonValue.from(42))
.entityId("entity_n8y8tnk2p9339ti393yi")
.programId("program_i2v2os4mwza1oetokh9i")
.build();
```

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.368.0" // x-release-please-version
version = "0.369.0" // x-release-please-version
}

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.increase.api.client.IncreaseClientImpl
import com.increase.api.core.ClientOptions
import com.increase.api.core.Sleeper
import com.increase.api.core.Timeout
import com.increase.api.core.http.AsyncStreamResponse
import com.increase.api.core.http.Headers
import com.increase.api.core.http.HttpClient
import com.increase.api.core.http.QueryParams
Expand All @@ -17,7 +16,6 @@ import java.net.Proxy
import java.time.Clock
import java.time.Duration
import java.util.Optional
import java.util.concurrent.Executor
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
Expand Down Expand Up @@ -123,17 +121,6 @@ class IncreaseOkHttpClient private constructor() {
*/
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }

/**
* The executor to use for running [AsyncStreamResponse.Handler] callbacks.
*
* Defaults to a dedicated cached thread pool.
*
* This class takes ownership of the executor and shuts it down, if possible, when closed.
*/
fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
clientOptions.streamHandlerExecutor(streamHandlerExecutor)
}

/**
* The interface to use for delaying execution, like during retries.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import com.increase.api.client.IncreaseClientAsyncImpl
import com.increase.api.core.ClientOptions
import com.increase.api.core.Sleeper
import com.increase.api.core.Timeout
import com.increase.api.core.http.AsyncStreamResponse
import com.increase.api.core.http.Headers
import com.increase.api.core.http.HttpClient
import com.increase.api.core.http.QueryParams
Expand All @@ -17,7 +16,6 @@ import java.net.Proxy
import java.time.Clock
import java.time.Duration
import java.util.Optional
import java.util.concurrent.Executor
import javax.net.ssl.HostnameVerifier
import javax.net.ssl.SSLSocketFactory
import javax.net.ssl.X509TrustManager
Expand Down Expand Up @@ -123,17 +121,6 @@ class IncreaseOkHttpClientAsync private constructor() {
*/
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }

/**
* The executor to use for running [AsyncStreamResponse.Handler] callbacks.
*
* Defaults to a dedicated cached thread pool.
*
* This class takes ownership of the executor and shuts it down, if possible, when closed.
*/
fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply {
clientOptions.streamHandlerExecutor(streamHandlerExecutor)
}

/**
* The interface to use for delaying execution, like during retries.
*
Expand Down

This file was deleted.

Loading
Loading