diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ec847edc6..16b219fd3 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.369.0" + ".": "0.370.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index fa77aa9b3..b52e8c7d7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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: eecc5886c26d07c167f37f30ae505a2c +config_hash: ca1425272e17fa23d4466d33492334fa diff --git a/CHANGELOG.md b/CHANGELOG.md index f876af3aa..fb5a34338 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.370.0 (2025-11-26) + +Full Changelog: [v0.369.0...v0.370.0](https://github.com/Increase/increase-java/compare/v0.369.0...v0.370.0) + +### Features + +* **api:** api update ([3816f9a](https://github.com/Increase/increase-java/commit/3816f9a2dde3a34697bb0b289b5dd543152aadb3)) + ## 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) diff --git a/README.md b/README.md index bbb7a419c..932bcb81d 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![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) +[![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.370.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.370.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.370.0) @@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe -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). +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.370.0). @@ -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.369.0") +implementation("com.increase.api:increase-java:0.370.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.369.0") com.increase.api increase-java - 0.369.0 + 0.370.0 ``` @@ -57,6 +57,8 @@ IncreaseClient client = IncreaseOkHttpClient.fromEnv(); AccountCreateParams params = AccountCreateParams.builder() .name("New Account!") + .entityId("entity_n8y8tnk2p9339ti393yi") + .programId("program_i2v2os4mwza1oetokh9i") .build(); Account account = client.accounts().create(params); ``` @@ -159,6 +161,8 @@ IncreaseClient client = IncreaseOkHttpClient.fromEnv(); AccountCreateParams params = AccountCreateParams.builder() .name("New Account!") + .entityId("entity_n8y8tnk2p9339ti393yi") + .programId("program_i2v2os4mwza1oetokh9i") .build(); CompletableFuture account = client.async().accounts().create(params); ``` @@ -178,6 +182,8 @@ IncreaseClientAsync client = IncreaseOkHttpClientAsync.fromEnv(); AccountCreateParams params = AccountCreateParams.builder() .name("New Account!") + .entityId("entity_n8y8tnk2p9339ti393yi") + .programId("program_i2v2os4mwza1oetokh9i") .build(); CompletableFuture account = client.accounts().create(params); ``` @@ -262,6 +268,8 @@ import com.increase.api.models.accounts.AccountCreateParams; AccountCreateParams params = AccountCreateParams.builder() .name("New Account!") + .entityId("entity_n8y8tnk2p9339ti393yi") + .programId("program_i2v2os4mwza1oetokh9i") .build(); HttpResponseFor account = client.accounts().withRawResponse().create(params); @@ -302,6 +310,106 @@ 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 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 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). @@ -520,6 +628,8 @@ import com.increase.api.models.accounts.AccountCreateParams; AccountCreateParams params = AccountCreateParams.builder() .name(JsonValue.from(42)) + .entityId("entity_n8y8tnk2p9339ti393yi") + .programId("program_i2v2os4mwza1oetokh9i") .build(); ``` diff --git a/build.gradle.kts b/build.gradle.kts index db1776f38..811961cea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.369.0" // x-release-please-version + version = "0.370.0" // x-release-please-version } subprojects { diff --git a/increase-java-client-okhttp/src/main/kotlin/com/increase/api/client/okhttp/IncreaseOkHttpClient.kt b/increase-java-client-okhttp/src/main/kotlin/com/increase/api/client/okhttp/IncreaseOkHttpClient.kt index 4f68fa3bd..8d8f55ae4 100644 --- a/increase-java-client-okhttp/src/main/kotlin/com/increase/api/client/okhttp/IncreaseOkHttpClient.kt +++ b/increase-java-client-okhttp/src/main/kotlin/com/increase/api/client/okhttp/IncreaseOkHttpClient.kt @@ -8,6 +8,7 @@ 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 @@ -16,6 +17,7 @@ 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 @@ -121,6 +123,17 @@ 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. * diff --git a/increase-java-client-okhttp/src/main/kotlin/com/increase/api/client/okhttp/IncreaseOkHttpClientAsync.kt b/increase-java-client-okhttp/src/main/kotlin/com/increase/api/client/okhttp/IncreaseOkHttpClientAsync.kt index 963317a79..d80607c7e 100644 --- a/increase-java-client-okhttp/src/main/kotlin/com/increase/api/client/okhttp/IncreaseOkHttpClientAsync.kt +++ b/increase-java-client-okhttp/src/main/kotlin/com/increase/api/client/okhttp/IncreaseOkHttpClientAsync.kt @@ -8,6 +8,7 @@ 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 @@ -16,6 +17,7 @@ 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 @@ -121,6 +123,17 @@ 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. * diff --git a/increase-java-core/src/main/kotlin/com/increase/api/core/AutoPager.kt b/increase-java-core/src/main/kotlin/com/increase/api/core/AutoPager.kt new file mode 100644 index 000000000..fc383e837 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/core/AutoPager.kt @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.core + +import java.util.stream.Stream +import java.util.stream.StreamSupport + +class AutoPager private constructor(private val firstPage: Page) : Iterable { + + companion object { + + fun from(firstPage: Page): AutoPager = AutoPager(firstPage) + } + + override fun iterator(): Iterator = + generateSequence(firstPage) { if (it.hasNextPage()) it.nextPage() else null } + .flatMap { it.items() } + .iterator() + + fun stream(): Stream = StreamSupport.stream(spliterator(), false) +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/core/AutoPagerAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/core/AutoPagerAsync.kt new file mode 100644 index 000000000..15b811a06 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/core/AutoPagerAsync.kt @@ -0,0 +1,88 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.core + +import com.increase.api.core.http.AsyncStreamResponse +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.CompletionException +import java.util.concurrent.Executor +import java.util.concurrent.atomic.AtomicReference + +class AutoPagerAsync +private constructor(private val firstPage: PageAsync, private val defaultExecutor: Executor) : + AsyncStreamResponse { + + companion object { + + fun from(firstPage: PageAsync, defaultExecutor: Executor): AutoPagerAsync = + AutoPagerAsync(firstPage, defaultExecutor) + } + + private val onCompleteFuture = CompletableFuture() + private val state = AtomicReference(State.NEW) + + override fun subscribe(handler: AsyncStreamResponse.Handler): AsyncStreamResponse = + subscribe(handler, defaultExecutor) + + override fun subscribe( + handler: AsyncStreamResponse.Handler, + executor: Executor, + ): AsyncStreamResponse = apply { + // TODO(JDK): Use `compareAndExchange` once targeting JDK 9. + check(state.compareAndSet(State.NEW, State.SUBSCRIBED)) { + if (state.get() == State.SUBSCRIBED) "Cannot subscribe more than once" + else "Cannot subscribe after the response is closed" + } + + fun PageAsync.handle(): CompletableFuture { + if (state.get() == State.CLOSED) { + return CompletableFuture.completedFuture(null) + } + + items().forEach { handler.onNext(it) } + return if (hasNextPage()) nextPage().thenCompose { it.handle() } + else CompletableFuture.completedFuture(null) + } + + executor.execute { + firstPage.handle().whenComplete { _, error -> + val actualError = + if (error is CompletionException && error.cause != null) error.cause else error + try { + handler.onComplete(Optional.ofNullable(actualError)) + } finally { + try { + if (actualError == null) { + onCompleteFuture.complete(null) + } else { + onCompleteFuture.completeExceptionally(actualError) + } + } finally { + close() + } + } + } + } + } + + override fun onCompleteFuture(): CompletableFuture = onCompleteFuture + + override fun close() { + val previousState = state.getAndSet(State.CLOSED) + if (previousState == State.CLOSED) { + return + } + + // When the stream is closed, we should always consider it closed. If it closed due + // to an error, then we will have already completed the future earlier, and this + // will be a no-op. + onCompleteFuture.complete(null) + } +} + +private enum class State { + NEW, + SUBSCRIBED, + CLOSED, +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/core/ClientOptions.kt b/increase-java-core/src/main/kotlin/com/increase/api/core/ClientOptions.kt index 29167b2c3..0dff03ae7 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/core/ClientOptions.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/core/ClientOptions.kt @@ -3,6 +3,7 @@ package com.increase.api.core import com.fasterxml.jackson.databind.json.JsonMapper +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.PhantomReachableClosingHttpClient @@ -11,6 +12,11 @@ import com.increase.api.core.http.RetryingHttpClient import java.time.Clock import java.time.Duration import java.util.Optional +import java.util.concurrent.Executor +import java.util.concurrent.ExecutorService +import java.util.concurrent.Executors +import java.util.concurrent.ThreadFactory +import java.util.concurrent.atomic.AtomicLong import kotlin.jvm.optionals.getOrNull /** A class representing the SDK client configuration. */ @@ -40,6 +46,14 @@ private constructor( * needs to be overridden. */ @get:JvmName("jsonMapper") val 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. + */ + @get:JvmName("streamHandlerExecutor") val streamHandlerExecutor: Executor, /** * The interface to use for delaying execution, like during retries. * @@ -148,6 +162,7 @@ private constructor( private var httpClient: HttpClient? = null private var checkJacksonVersionCompatibility: Boolean = true private var jsonMapper: JsonMapper = jsonMapper() + private var streamHandlerExecutor: Executor? = null private var sleeper: Sleeper? = null private var clock: Clock = Clock.systemUTC() private var baseUrl: String? = null @@ -164,6 +179,7 @@ private constructor( httpClient = clientOptions.originalHttpClient checkJacksonVersionCompatibility = clientOptions.checkJacksonVersionCompatibility jsonMapper = clientOptions.jsonMapper + streamHandlerExecutor = clientOptions.streamHandlerExecutor sleeper = clientOptions.sleeper clock = clientOptions.clock baseUrl = clientOptions.baseUrl @@ -206,6 +222,20 @@ private constructor( */ fun jsonMapper(jsonMapper: JsonMapper) = apply { this.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 { + this.streamHandlerExecutor = + if (streamHandlerExecutor is ExecutorService) + PhantomReachableExecutorService(streamHandlerExecutor) + else streamHandlerExecutor + } + /** * The interface to use for delaying execution, like during retries. * @@ -416,6 +446,24 @@ private constructor( */ fun build(): ClientOptions { val httpClient = checkRequired("httpClient", httpClient) + val streamHandlerExecutor = + streamHandlerExecutor + ?: PhantomReachableExecutorService( + Executors.newCachedThreadPool( + object : ThreadFactory { + + private val threadFactory: ThreadFactory = + Executors.defaultThreadFactory() + private val count = AtomicLong(0) + + override fun newThread(runnable: Runnable): Thread = + threadFactory.newThread(runnable).also { + it.name = + "increase-stream-handler-thread-${count.getAndIncrement()}" + } + } + ) + ) val sleeper = sleeper ?: PhantomReachableSleeper(DefaultSleeper()) val apiKey = checkRequired("apiKey", apiKey) @@ -447,6 +495,7 @@ private constructor( .build(), checkJacksonVersionCompatibility, jsonMapper, + streamHandlerExecutor, sleeper, clock, baseUrl, @@ -473,6 +522,7 @@ private constructor( */ fun close() { httpClient.close() + (streamHandlerExecutor as? ExecutorService)?.shutdown() sleeper.close() } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/core/Page.kt b/increase-java-core/src/main/kotlin/com/increase/api/core/Page.kt new file mode 100644 index 000000000..6a28f88ef --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/core/Page.kt @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.core + +/** + * An interface representing a single page, with items of type [T], from a paginated endpoint + * response. + * + * Implementations of this interface are expected to request additional pages synchronously. For + * asynchronous pagination, see the [PageAsync] interface. + */ +interface Page { + + /** + * Returns whether there's another page after this one. + * + * The method generally doesn't make requests so the result depends entirely on the data in this + * page. If a significant amount of time has passed between requesting this page and calling + * this method, then the result could be stale. + */ + fun hasNextPage(): Boolean + + /** + * Returns the page after this one by making another request. + * + * @throws IllegalStateException if it's impossible to get the next page. This exception is + * avoidable by calling [hasNextPage] first. + */ + fun nextPage(): Page + + /** Returns the items in this page. */ + fun items(): List +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/core/PageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/core/PageAsync.kt new file mode 100644 index 000000000..8d5da0c9e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/core/PageAsync.kt @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.core + +import java.util.concurrent.CompletableFuture + +/** + * An interface representing a single page, with items of type [T], from a paginated endpoint + * response. + * + * Implementations of this interface are expected to request additional pages asynchronously. For + * synchronous pagination, see the [Page] interface. + */ +interface PageAsync { + + /** + * Returns whether there's another page after this one. + * + * The method generally doesn't make requests so the result depends entirely on the data in this + * page. If a significant amount of time has passed between requesting this page and calling + * this method, then the result could be stale. + */ + fun hasNextPage(): Boolean + + /** + * Returns the page after this one by making another request. + * + * @throws IllegalStateException if it's impossible to get the next page. This exception is + * avoidable by calling [hasNextPage] first. + */ + fun nextPage(): CompletableFuture> + + /** Returns the items in this page. */ + fun items(): List +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPage.kt new file mode 100644 index 000000000..06d541cd2 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.accountnumbers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.AccountNumberService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see AccountNumberService.list */ +class AccountNumberListPage +private constructor( + private val service: AccountNumberService, + private val params: AccountNumberListParams, + private val response: AccountNumberListPageResponse, +) : Page { + + /** + * Delegates to [AccountNumberListPageResponse], but gracefully handles missing data. + * + * @see AccountNumberListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AccountNumberListPageResponse], but gracefully handles missing data. + * + * @see AccountNumberListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AccountNumberListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): AccountNumberListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): AccountNumberListParams = params + + /** The response that this page was parsed from. */ + fun response(): AccountNumberListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AccountNumberListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccountNumberListPage]. */ + class Builder internal constructor() { + + private var service: AccountNumberService? = null + private var params: AccountNumberListParams? = null + private var response: AccountNumberListPageResponse? = null + + @JvmSynthetic + internal fun from(accountNumberListPage: AccountNumberListPage) = apply { + service = accountNumberListPage.service + params = accountNumberListPage.params + response = accountNumberListPage.response + } + + fun service(service: AccountNumberService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: AccountNumberListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AccountNumberListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [AccountNumberListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AccountNumberListPage = + AccountNumberListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccountNumberListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "AccountNumberListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPageAsync.kt new file mode 100644 index 000000000..a6af769cc --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.accountnumbers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.AccountNumberServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see AccountNumberServiceAsync.list */ +class AccountNumberListPageAsync +private constructor( + private val service: AccountNumberServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: AccountNumberListParams, + private val response: AccountNumberListPageResponse, +) : PageAsync { + + /** + * Delegates to [AccountNumberListPageResponse], but gracefully handles missing data. + * + * @see AccountNumberListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AccountNumberListPageResponse], but gracefully handles missing data. + * + * @see AccountNumberListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AccountNumberListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): AccountNumberListParams = params + + /** The response that this page was parsed from. */ + fun response(): AccountNumberListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AccountNumberListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccountNumberListPageAsync]. */ + class Builder internal constructor() { + + private var service: AccountNumberServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: AccountNumberListParams? = null + private var response: AccountNumberListPageResponse? = null + + @JvmSynthetic + internal fun from(accountNumberListPageAsync: AccountNumberListPageAsync) = apply { + service = accountNumberListPageAsync.service + streamHandlerExecutor = accountNumberListPageAsync.streamHandlerExecutor + params = accountNumberListPageAsync.params + response = accountNumberListPageAsync.response + } + + fun service(service: AccountNumberServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: AccountNumberListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AccountNumberListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [AccountNumberListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AccountNumberListPageAsync = + AccountNumberListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccountNumberListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "AccountNumberListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPageResponse.kt index 9b48cc012..b7d9e2717 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Account Number objects. */ -class AccountNumberListResponse +class AccountNumberListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [AccountNumberListResponse]. + * Returns a mutable builder for constructing an instance of + * [AccountNumberListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AccountNumberListResponse]. */ + /** A builder for [AccountNumberListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,10 +103,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(accountNumberListResponse: AccountNumberListResponse) = apply { - data = accountNumberListResponse.data.map { it.toMutableList() } - nextCursor = accountNumberListResponse.nextCursor - additionalProperties = accountNumberListResponse.additionalProperties.toMutableMap() + internal fun from(accountNumberListPageResponse: AccountNumberListPageResponse) = apply { + data = accountNumberListPageResponse.data.map { it.toMutableList() } + nextCursor = accountNumberListPageResponse.nextCursor + additionalProperties = accountNumberListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -169,7 +170,7 @@ private constructor( } /** - * Returns an immutable instance of [AccountNumberListResponse]. + * Returns an immutable instance of [AccountNumberListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +182,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): AccountNumberListResponse = - AccountNumberListResponse( + fun build(): AccountNumberListPageResponse = + AccountNumberListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +192,7 @@ private constructor( private var validated: Boolean = false - fun validate(): AccountNumberListResponse = apply { + fun validate(): AccountNumberListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +225,7 @@ private constructor( return true } - return other is AccountNumberListResponse && + return other is AccountNumberListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +236,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AccountNumberListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "AccountNumberListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListPage.kt new file mode 100644 index 000000000..83d277337 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.accounts + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.AccountService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see AccountService.list */ +class AccountListPage +private constructor( + private val service: AccountService, + private val params: AccountListParams, + private val response: AccountListPageResponse, +) : Page { + + /** + * Delegates to [AccountListPageResponse], but gracefully handles missing data. + * + * @see AccountListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AccountListPageResponse], but gracefully handles missing data. + * + * @see AccountListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AccountListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): AccountListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): AccountListParams = params + + /** The response that this page was parsed from. */ + fun response(): AccountListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AccountListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccountListPage]. */ + class Builder internal constructor() { + + private var service: AccountService? = null + private var params: AccountListParams? = null + private var response: AccountListPageResponse? = null + + @JvmSynthetic + internal fun from(accountListPage: AccountListPage) = apply { + service = accountListPage.service + params = accountListPage.params + response = accountListPage.response + } + + fun service(service: AccountService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: AccountListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AccountListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [AccountListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AccountListPage = + AccountListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccountListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "AccountListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListPageAsync.kt new file mode 100644 index 000000000..d82c2d263 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.accounts + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.AccountServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see AccountServiceAsync.list */ +class AccountListPageAsync +private constructor( + private val service: AccountServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: AccountListParams, + private val response: AccountListPageResponse, +) : PageAsync { + + /** + * Delegates to [AccountListPageResponse], but gracefully handles missing data. + * + * @see AccountListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AccountListPageResponse], but gracefully handles missing data. + * + * @see AccountListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AccountListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): AccountListParams = params + + /** The response that this page was parsed from. */ + fun response(): AccountListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AccountListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccountListPageAsync]. */ + class Builder internal constructor() { + + private var service: AccountServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: AccountListParams? = null + private var response: AccountListPageResponse? = null + + @JvmSynthetic + internal fun from(accountListPageAsync: AccountListPageAsync) = apply { + service = accountListPageAsync.service + streamHandlerExecutor = accountListPageAsync.streamHandlerExecutor + params = accountListPageAsync.params + response = accountListPageAsync.response + } + + fun service(service: AccountServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: AccountListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AccountListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [AccountListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AccountListPageAsync = + AccountListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccountListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "AccountListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListPageResponse.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListPageResponse.kt index 4bb2ba9af..8867834b1 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Account objects. */ -class AccountListResponse +class AccountListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [AccountListResponse]. + * Returns a mutable builder for constructing an instance of [AccountListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AccountListResponse]. */ + /** A builder for [AccountListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(accountListResponse: AccountListResponse) = apply { - data = accountListResponse.data.map { it.toMutableList() } - nextCursor = accountListResponse.nextCursor - additionalProperties = accountListResponse.additionalProperties.toMutableMap() + internal fun from(accountListPageResponse: AccountListPageResponse) = apply { + data = accountListPageResponse.data.map { it.toMutableList() } + nextCursor = accountListPageResponse.nextCursor + additionalProperties = accountListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [AccountListResponse]. + * Returns an immutable instance of [AccountListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): AccountListResponse = - AccountListResponse( + fun build(): AccountListPageResponse = + AccountListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): AccountListResponse = apply { + fun validate(): AccountListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is AccountListResponse && + return other is AccountListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AccountListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "AccountListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListPage.kt new file mode 100644 index 000000000..aea9fbf46 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.accountstatements + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.AccountStatementService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see AccountStatementService.list */ +class AccountStatementListPage +private constructor( + private val service: AccountStatementService, + private val params: AccountStatementListParams, + private val response: AccountStatementListPageResponse, +) : Page { + + /** + * Delegates to [AccountStatementListPageResponse], but gracefully handles missing data. + * + * @see AccountStatementListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AccountStatementListPageResponse], but gracefully handles missing data. + * + * @see AccountStatementListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AccountStatementListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): AccountStatementListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): AccountStatementListParams = params + + /** The response that this page was parsed from. */ + fun response(): AccountStatementListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AccountStatementListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccountStatementListPage]. */ + class Builder internal constructor() { + + private var service: AccountStatementService? = null + private var params: AccountStatementListParams? = null + private var response: AccountStatementListPageResponse? = null + + @JvmSynthetic + internal fun from(accountStatementListPage: AccountStatementListPage) = apply { + service = accountStatementListPage.service + params = accountStatementListPage.params + response = accountStatementListPage.response + } + + fun service(service: AccountStatementService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: AccountStatementListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AccountStatementListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [AccountStatementListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AccountStatementListPage = + AccountStatementListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccountStatementListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "AccountStatementListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListPageAsync.kt new file mode 100644 index 000000000..4f880a6e3 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListPageAsync.kt @@ -0,0 +1,151 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.accountstatements + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.AccountStatementServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see AccountStatementServiceAsync.list */ +class AccountStatementListPageAsync +private constructor( + private val service: AccountStatementServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: AccountStatementListParams, + private val response: AccountStatementListPageResponse, +) : PageAsync { + + /** + * Delegates to [AccountStatementListPageResponse], but gracefully handles missing data. + * + * @see AccountStatementListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AccountStatementListPageResponse], but gracefully handles missing data. + * + * @see AccountStatementListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AccountStatementListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): AccountStatementListParams = params + + /** The response that this page was parsed from. */ + fun response(): AccountStatementListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [AccountStatementListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccountStatementListPageAsync]. */ + class Builder internal constructor() { + + private var service: AccountStatementServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: AccountStatementListParams? = null + private var response: AccountStatementListPageResponse? = null + + @JvmSynthetic + internal fun from(accountStatementListPageAsync: AccountStatementListPageAsync) = apply { + service = accountStatementListPageAsync.service + streamHandlerExecutor = accountStatementListPageAsync.streamHandlerExecutor + params = accountStatementListPageAsync.params + response = accountStatementListPageAsync.response + } + + fun service(service: AccountStatementServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: AccountStatementListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AccountStatementListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [AccountStatementListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AccountStatementListPageAsync = + AccountStatementListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccountStatementListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "AccountStatementListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListPageResponse.kt index b17a4f7c6..1f40891bb 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accountstatements/AccountStatementListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Account Statement objects. */ -class AccountStatementListResponse +class AccountStatementListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [AccountStatementListResponse]. + * Returns a mutable builder for constructing an instance of + * [AccountStatementListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AccountStatementListResponse]. */ + /** A builder for [AccountStatementListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,11 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(accountStatementListResponse: AccountStatementListResponse) = apply { - data = accountStatementListResponse.data.map { it.toMutableList() } - nextCursor = accountStatementListResponse.nextCursor - additionalProperties = accountStatementListResponse.additionalProperties.toMutableMap() - } + internal fun from(accountStatementListPageResponse: AccountStatementListPageResponse) = + apply { + data = accountStatementListPageResponse.data.map { it.toMutableList() } + nextCursor = accountStatementListPageResponse.nextCursor + additionalProperties = + accountStatementListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -169,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [AccountStatementListResponse]. + * Returns an immutable instance of [AccountStatementListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): AccountStatementListResponse = - AccountStatementListResponse( + fun build(): AccountStatementListPageResponse = + AccountStatementListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): AccountStatementListResponse = apply { + fun validate(): AccountStatementListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +227,7 @@ private constructor( return true } - return other is AccountStatementListResponse && + return other is AccountStatementListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AccountStatementListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "AccountStatementListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPage.kt new file mode 100644 index 000000000..ee6c7e345 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.accounttransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.AccountTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see AccountTransferService.list */ +class AccountTransferListPage +private constructor( + private val service: AccountTransferService, + private val params: AccountTransferListParams, + private val response: AccountTransferListPageResponse, +) : Page { + + /** + * Delegates to [AccountTransferListPageResponse], but gracefully handles missing data. + * + * @see AccountTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AccountTransferListPageResponse], but gracefully handles missing data. + * + * @see AccountTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AccountTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): AccountTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): AccountTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): AccountTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AccountTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccountTransferListPage]. */ + class Builder internal constructor() { + + private var service: AccountTransferService? = null + private var params: AccountTransferListParams? = null + private var response: AccountTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(accountTransferListPage: AccountTransferListPage) = apply { + service = accountTransferListPage.service + params = accountTransferListPage.params + response = accountTransferListPage.response + } + + fun service(service: AccountTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: AccountTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AccountTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [AccountTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AccountTransferListPage = + AccountTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccountTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "AccountTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageAsync.kt new file mode 100644 index 000000000..dd88fd425 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.accounttransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.AccountTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see AccountTransferServiceAsync.list */ +class AccountTransferListPageAsync +private constructor( + private val service: AccountTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: AccountTransferListParams, + private val response: AccountTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [AccountTransferListPageResponse], but gracefully handles missing data. + * + * @see AccountTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AccountTransferListPageResponse], but gracefully handles missing data. + * + * @see AccountTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AccountTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): AccountTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): AccountTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AccountTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AccountTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: AccountTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: AccountTransferListParams? = null + private var response: AccountTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(accountTransferListPageAsync: AccountTransferListPageAsync) = apply { + service = accountTransferListPageAsync.service + streamHandlerExecutor = accountTransferListPageAsync.streamHandlerExecutor + params = accountTransferListPageAsync.params + response = accountTransferListPageAsync.response + } + + fun service(service: AccountTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: AccountTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AccountTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [AccountTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AccountTransferListPageAsync = + AccountTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccountTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "AccountTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageResponse.kt index 25ddcde97..ee7169d0e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Account Transfer objects. */ -class AccountTransferListResponse +class AccountTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [AccountTransferListResponse]. + * Returns a mutable builder for constructing an instance of + * [AccountTransferListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AccountTransferListResponse]. */ + /** A builder for [AccountTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,11 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(accountTransferListResponse: AccountTransferListResponse) = apply { - data = accountTransferListResponse.data.map { it.toMutableList() } - nextCursor = accountTransferListResponse.nextCursor - additionalProperties = accountTransferListResponse.additionalProperties.toMutableMap() - } + internal fun from(accountTransferListPageResponse: AccountTransferListPageResponse) = + apply { + data = accountTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = accountTransferListPageResponse.nextCursor + additionalProperties = + accountTransferListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -169,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [AccountTransferListResponse]. + * Returns an immutable instance of [AccountTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): AccountTransferListResponse = - AccountTransferListResponse( + fun build(): AccountTransferListPageResponse = + AccountTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): AccountTransferListResponse = apply { + fun validate(): AccountTransferListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +227,7 @@ private constructor( return true } - return other is AccountTransferListResponse && + return other is AccountTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AccountTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "AccountTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPage.kt new file mode 100644 index 000000000..525935209 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.achprenotifications + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.AchPrenotificationService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see AchPrenotificationService.list */ +class AchPrenotificationListPage +private constructor( + private val service: AchPrenotificationService, + private val params: AchPrenotificationListParams, + private val response: AchPrenotificationListPageResponse, +) : Page { + + /** + * Delegates to [AchPrenotificationListPageResponse], but gracefully handles missing data. + * + * @see AchPrenotificationListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AchPrenotificationListPageResponse], but gracefully handles missing data. + * + * @see AchPrenotificationListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AchPrenotificationListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): AchPrenotificationListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): AchPrenotificationListParams = params + + /** The response that this page was parsed from. */ + fun response(): AchPrenotificationListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AchPrenotificationListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AchPrenotificationListPage]. */ + class Builder internal constructor() { + + private var service: AchPrenotificationService? = null + private var params: AchPrenotificationListParams? = null + private var response: AchPrenotificationListPageResponse? = null + + @JvmSynthetic + internal fun from(achPrenotificationListPage: AchPrenotificationListPage) = apply { + service = achPrenotificationListPage.service + params = achPrenotificationListPage.params + response = achPrenotificationListPage.response + } + + fun service(service: AchPrenotificationService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: AchPrenotificationListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AchPrenotificationListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [AchPrenotificationListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AchPrenotificationListPage = + AchPrenotificationListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AchPrenotificationListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "AchPrenotificationListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageAsync.kt new file mode 100644 index 000000000..54ede4a4c --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.achprenotifications + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.AchPrenotificationServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see AchPrenotificationServiceAsync.list */ +class AchPrenotificationListPageAsync +private constructor( + private val service: AchPrenotificationServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: AchPrenotificationListParams, + private val response: AchPrenotificationListPageResponse, +) : PageAsync { + + /** + * Delegates to [AchPrenotificationListPageResponse], but gracefully handles missing data. + * + * @see AchPrenotificationListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AchPrenotificationListPageResponse], but gracefully handles missing data. + * + * @see AchPrenotificationListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AchPrenotificationListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): AchPrenotificationListParams = params + + /** The response that this page was parsed from. */ + fun response(): AchPrenotificationListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [AchPrenotificationListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AchPrenotificationListPageAsync]. */ + class Builder internal constructor() { + + private var service: AchPrenotificationServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: AchPrenotificationListParams? = null + private var response: AchPrenotificationListPageResponse? = null + + @JvmSynthetic + internal fun from(achPrenotificationListPageAsync: AchPrenotificationListPageAsync) = + apply { + service = achPrenotificationListPageAsync.service + streamHandlerExecutor = achPrenotificationListPageAsync.streamHandlerExecutor + params = achPrenotificationListPageAsync.params + response = achPrenotificationListPageAsync.response + } + + fun service(service: AchPrenotificationServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: AchPrenotificationListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AchPrenotificationListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [AchPrenotificationListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AchPrenotificationListPageAsync = + AchPrenotificationListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AchPrenotificationListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "AchPrenotificationListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageResponse.kt similarity index 88% rename from increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageResponse.kt index 1824d27ea..683d38ca0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of ACH Prenotification objects. */ -class AchPrenotificationListResponse +class AchPrenotificationListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [AchPrenotificationListResponse]. + * [AchPrenotificationListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AchPrenotificationListResponse]. */ + /** A builder for [AchPrenotificationListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,12 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(achPrenotificationListResponse: AchPrenotificationListResponse) = apply { - data = achPrenotificationListResponse.data.map { it.toMutableList() } - nextCursor = achPrenotificationListResponse.nextCursor - additionalProperties = - achPrenotificationListResponse.additionalProperties.toMutableMap() - } + internal fun from(achPrenotificationListPageResponse: AchPrenotificationListPageResponse) = + apply { + data = achPrenotificationListPageResponse.data.map { it.toMutableList() } + nextCursor = achPrenotificationListPageResponse.nextCursor + additionalProperties = + achPrenotificationListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -171,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [AchPrenotificationListResponse]. + * Returns an immutable instance of [AchPrenotificationListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -183,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): AchPrenotificationListResponse = - AchPrenotificationListResponse( + fun build(): AchPrenotificationListPageResponse = + AchPrenotificationListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -193,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): AchPrenotificationListResponse = apply { + fun validate(): AchPrenotificationListPageResponse = apply { if (validated) { return@apply } @@ -226,7 +227,7 @@ private constructor( return true } - return other is AchPrenotificationListResponse && + return other is AchPrenotificationListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -237,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AchPrenotificationListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "AchPrenotificationListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListPage.kt new file mode 100644 index 000000000..53ba0c336 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.achtransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.AchTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see AchTransferService.list */ +class AchTransferListPage +private constructor( + private val service: AchTransferService, + private val params: AchTransferListParams, + private val response: AchTransferListPageResponse, +) : Page { + + /** + * Delegates to [AchTransferListPageResponse], but gracefully handles missing data. + * + * @see AchTransferListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AchTransferListPageResponse], but gracefully handles missing data. + * + * @see AchTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AchTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): AchTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): AchTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): AchTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AchTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AchTransferListPage]. */ + class Builder internal constructor() { + + private var service: AchTransferService? = null + private var params: AchTransferListParams? = null + private var response: AchTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(achTransferListPage: AchTransferListPage) = apply { + service = achTransferListPage.service + params = achTransferListPage.params + response = achTransferListPage.response + } + + fun service(service: AchTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: AchTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AchTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [AchTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AchTransferListPage = + AchTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AchTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "AchTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListPageAsync.kt new file mode 100644 index 000000000..ed0c92d58 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.achtransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.AchTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see AchTransferServiceAsync.list */ +class AchTransferListPageAsync +private constructor( + private val service: AchTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: AchTransferListParams, + private val response: AchTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [AchTransferListPageResponse], but gracefully handles missing data. + * + * @see AchTransferListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [AchTransferListPageResponse], but gracefully handles missing data. + * + * @see AchTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): AchTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): AchTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): AchTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [AchTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AchTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: AchTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: AchTransferListParams? = null + private var response: AchTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(achTransferListPageAsync: AchTransferListPageAsync) = apply { + service = achTransferListPageAsync.service + streamHandlerExecutor = achTransferListPageAsync.streamHandlerExecutor + params = achTransferListPageAsync.params + response = achTransferListPageAsync.response + } + + fun service(service: AchTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: AchTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: AchTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [AchTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AchTransferListPageAsync = + AchTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AchTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "AchTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponse.kt index de23515d3..ba224a5ea 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of ACH Transfer objects. */ -class AchTransferListResponse +class AchTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [AchTransferListResponse]. + * Returns a mutable builder for constructing an instance of [AchTransferListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AchTransferListResponse]. */ + /** A builder for [AchTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(achTransferListResponse: AchTransferListResponse) = apply { - data = achTransferListResponse.data.map { it.toMutableList() } - nextCursor = achTransferListResponse.nextCursor - additionalProperties = achTransferListResponse.additionalProperties.toMutableMap() + internal fun from(achTransferListPageResponse: AchTransferListPageResponse) = apply { + data = achTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = achTransferListPageResponse.nextCursor + additionalProperties = achTransferListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [AchTransferListResponse]. + * Returns an immutable instance of [AchTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): AchTransferListResponse = - AchTransferListResponse( + fun build(): AchTransferListPageResponse = + AchTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): AchTransferListResponse = apply { + fun validate(): AchTransferListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is AchTransferListResponse && + return other is AchTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AchTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "AchTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPage.kt new file mode 100644 index 000000000..cd7b6b4e7 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.bookkeepingaccounts + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.BookkeepingAccountService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see BookkeepingAccountService.list */ +class BookkeepingAccountListPage +private constructor( + private val service: BookkeepingAccountService, + private val params: BookkeepingAccountListParams, + private val response: BookkeepingAccountListPageResponse, +) : Page { + + /** + * Delegates to [BookkeepingAccountListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingAccountListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [BookkeepingAccountListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingAccountListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): BookkeepingAccountListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): BookkeepingAccountListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): BookkeepingAccountListParams = params + + /** The response that this page was parsed from. */ + fun response(): BookkeepingAccountListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [BookkeepingAccountListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BookkeepingAccountListPage]. */ + class Builder internal constructor() { + + private var service: BookkeepingAccountService? = null + private var params: BookkeepingAccountListParams? = null + private var response: BookkeepingAccountListPageResponse? = null + + @JvmSynthetic + internal fun from(bookkeepingAccountListPage: BookkeepingAccountListPage) = apply { + service = bookkeepingAccountListPage.service + params = bookkeepingAccountListPage.params + response = bookkeepingAccountListPage.response + } + + fun service(service: BookkeepingAccountService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: BookkeepingAccountListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: BookkeepingAccountListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [BookkeepingAccountListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BookkeepingAccountListPage = + BookkeepingAccountListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BookkeepingAccountListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "BookkeepingAccountListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageAsync.kt new file mode 100644 index 000000000..80eecd7c9 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.bookkeepingaccounts + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.BookkeepingAccountServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see BookkeepingAccountServiceAsync.list */ +class BookkeepingAccountListPageAsync +private constructor( + private val service: BookkeepingAccountServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: BookkeepingAccountListParams, + private val response: BookkeepingAccountListPageResponse, +) : PageAsync { + + /** + * Delegates to [BookkeepingAccountListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingAccountListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [BookkeepingAccountListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingAccountListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): BookkeepingAccountListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): BookkeepingAccountListParams = params + + /** The response that this page was parsed from. */ + fun response(): BookkeepingAccountListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [BookkeepingAccountListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BookkeepingAccountListPageAsync]. */ + class Builder internal constructor() { + + private var service: BookkeepingAccountServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: BookkeepingAccountListParams? = null + private var response: BookkeepingAccountListPageResponse? = null + + @JvmSynthetic + internal fun from(bookkeepingAccountListPageAsync: BookkeepingAccountListPageAsync) = + apply { + service = bookkeepingAccountListPageAsync.service + streamHandlerExecutor = bookkeepingAccountListPageAsync.streamHandlerExecutor + params = bookkeepingAccountListPageAsync.params + response = bookkeepingAccountListPageAsync.response + } + + fun service(service: BookkeepingAccountServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: BookkeepingAccountListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: BookkeepingAccountListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [BookkeepingAccountListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BookkeepingAccountListPageAsync = + BookkeepingAccountListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BookkeepingAccountListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "BookkeepingAccountListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageResponse.kt similarity index 88% rename from increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageResponse.kt index e7b3edb98..ab8d56227 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Bookkeeping Account objects. */ -class BookkeepingAccountListResponse +class BookkeepingAccountListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [BookkeepingAccountListResponse]. + * [BookkeepingAccountListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [BookkeepingAccountListResponse]. */ + /** A builder for [BookkeepingAccountListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,12 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(bookkeepingAccountListResponse: BookkeepingAccountListResponse) = apply { - data = bookkeepingAccountListResponse.data.map { it.toMutableList() } - nextCursor = bookkeepingAccountListResponse.nextCursor - additionalProperties = - bookkeepingAccountListResponse.additionalProperties.toMutableMap() - } + internal fun from(bookkeepingAccountListPageResponse: BookkeepingAccountListPageResponse) = + apply { + data = bookkeepingAccountListPageResponse.data.map { it.toMutableList() } + nextCursor = bookkeepingAccountListPageResponse.nextCursor + additionalProperties = + bookkeepingAccountListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -171,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [BookkeepingAccountListResponse]. + * Returns an immutable instance of [BookkeepingAccountListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -183,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): BookkeepingAccountListResponse = - BookkeepingAccountListResponse( + fun build(): BookkeepingAccountListPageResponse = + BookkeepingAccountListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -193,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): BookkeepingAccountListResponse = apply { + fun validate(): BookkeepingAccountListPageResponse = apply { if (validated) { return@apply } @@ -226,7 +227,7 @@ private constructor( return true } - return other is BookkeepingAccountListResponse && + return other is BookkeepingAccountListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -237,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BookkeepingAccountListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "BookkeepingAccountListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPage.kt new file mode 100644 index 000000000..7a7224782 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.bookkeepingentries + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.BookkeepingEntryService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see BookkeepingEntryService.list */ +class BookkeepingEntryListPage +private constructor( + private val service: BookkeepingEntryService, + private val params: BookkeepingEntryListParams, + private val response: BookkeepingEntryListPageResponse, +) : Page { + + /** + * Delegates to [BookkeepingEntryListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingEntryListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [BookkeepingEntryListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingEntryListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): BookkeepingEntryListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): BookkeepingEntryListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): BookkeepingEntryListParams = params + + /** The response that this page was parsed from. */ + fun response(): BookkeepingEntryListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [BookkeepingEntryListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BookkeepingEntryListPage]. */ + class Builder internal constructor() { + + private var service: BookkeepingEntryService? = null + private var params: BookkeepingEntryListParams? = null + private var response: BookkeepingEntryListPageResponse? = null + + @JvmSynthetic + internal fun from(bookkeepingEntryListPage: BookkeepingEntryListPage) = apply { + service = bookkeepingEntryListPage.service + params = bookkeepingEntryListPage.params + response = bookkeepingEntryListPage.response + } + + fun service(service: BookkeepingEntryService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: BookkeepingEntryListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: BookkeepingEntryListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [BookkeepingEntryListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BookkeepingEntryListPage = + BookkeepingEntryListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BookkeepingEntryListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "BookkeepingEntryListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPageAsync.kt new file mode 100644 index 000000000..0b5495cb4 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPageAsync.kt @@ -0,0 +1,151 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.bookkeepingentries + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.BookkeepingEntryServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see BookkeepingEntryServiceAsync.list */ +class BookkeepingEntryListPageAsync +private constructor( + private val service: BookkeepingEntryServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: BookkeepingEntryListParams, + private val response: BookkeepingEntryListPageResponse, +) : PageAsync { + + /** + * Delegates to [BookkeepingEntryListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingEntryListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [BookkeepingEntryListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingEntryListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): BookkeepingEntryListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): BookkeepingEntryListParams = params + + /** The response that this page was parsed from. */ + fun response(): BookkeepingEntryListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [BookkeepingEntryListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BookkeepingEntryListPageAsync]. */ + class Builder internal constructor() { + + private var service: BookkeepingEntryServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: BookkeepingEntryListParams? = null + private var response: BookkeepingEntryListPageResponse? = null + + @JvmSynthetic + internal fun from(bookkeepingEntryListPageAsync: BookkeepingEntryListPageAsync) = apply { + service = bookkeepingEntryListPageAsync.service + streamHandlerExecutor = bookkeepingEntryListPageAsync.streamHandlerExecutor + params = bookkeepingEntryListPageAsync.params + response = bookkeepingEntryListPageAsync.response + } + + fun service(service: BookkeepingEntryServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: BookkeepingEntryListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: BookkeepingEntryListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [BookkeepingEntryListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BookkeepingEntryListPageAsync = + BookkeepingEntryListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BookkeepingEntryListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "BookkeepingEntryListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPageResponse.kt index 9c83e2ac6..6364ab287 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Bookkeeping Entry objects. */ -class BookkeepingEntryListResponse +class BookkeepingEntryListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [BookkeepingEntryListResponse]. + * Returns a mutable builder for constructing an instance of + * [BookkeepingEntryListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [BookkeepingEntryListResponse]. */ + /** A builder for [BookkeepingEntryListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,11 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(bookkeepingEntryListResponse: BookkeepingEntryListResponse) = apply { - data = bookkeepingEntryListResponse.data.map { it.toMutableList() } - nextCursor = bookkeepingEntryListResponse.nextCursor - additionalProperties = bookkeepingEntryListResponse.additionalProperties.toMutableMap() - } + internal fun from(bookkeepingEntryListPageResponse: BookkeepingEntryListPageResponse) = + apply { + data = bookkeepingEntryListPageResponse.data.map { it.toMutableList() } + nextCursor = bookkeepingEntryListPageResponse.nextCursor + additionalProperties = + bookkeepingEntryListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -169,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [BookkeepingEntryListResponse]. + * Returns an immutable instance of [BookkeepingEntryListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): BookkeepingEntryListResponse = - BookkeepingEntryListResponse( + fun build(): BookkeepingEntryListPageResponse = + BookkeepingEntryListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): BookkeepingEntryListResponse = apply { + fun validate(): BookkeepingEntryListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +227,7 @@ private constructor( return true } - return other is BookkeepingEntryListResponse && + return other is BookkeepingEntryListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BookkeepingEntryListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "BookkeepingEntryListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPage.kt new file mode 100644 index 000000000..daaa7cd7d --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.bookkeepingentrysets + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.BookkeepingEntrySetService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see BookkeepingEntrySetService.list */ +class BookkeepingEntrySetListPage +private constructor( + private val service: BookkeepingEntrySetService, + private val params: BookkeepingEntrySetListParams, + private val response: BookkeepingEntrySetListPageResponse, +) : Page { + + /** + * Delegates to [BookkeepingEntrySetListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingEntrySetListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [BookkeepingEntrySetListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingEntrySetListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): BookkeepingEntrySetListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): BookkeepingEntrySetListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): BookkeepingEntrySetListParams = params + + /** The response that this page was parsed from. */ + fun response(): BookkeepingEntrySetListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [BookkeepingEntrySetListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BookkeepingEntrySetListPage]. */ + class Builder internal constructor() { + + private var service: BookkeepingEntrySetService? = null + private var params: BookkeepingEntrySetListParams? = null + private var response: BookkeepingEntrySetListPageResponse? = null + + @JvmSynthetic + internal fun from(bookkeepingEntrySetListPage: BookkeepingEntrySetListPage) = apply { + service = bookkeepingEntrySetListPage.service + params = bookkeepingEntrySetListPage.params + response = bookkeepingEntrySetListPage.response + } + + fun service(service: BookkeepingEntrySetService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: BookkeepingEntrySetListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: BookkeepingEntrySetListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [BookkeepingEntrySetListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BookkeepingEntrySetListPage = + BookkeepingEntrySetListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BookkeepingEntrySetListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "BookkeepingEntrySetListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPageAsync.kt new file mode 100644 index 000000000..b7b003f0a --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.bookkeepingentrysets + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.BookkeepingEntrySetServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see BookkeepingEntrySetServiceAsync.list */ +class BookkeepingEntrySetListPageAsync +private constructor( + private val service: BookkeepingEntrySetServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: BookkeepingEntrySetListParams, + private val response: BookkeepingEntrySetListPageResponse, +) : PageAsync { + + /** + * Delegates to [BookkeepingEntrySetListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingEntrySetListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [BookkeepingEntrySetListPageResponse], but gracefully handles missing data. + * + * @see BookkeepingEntrySetListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): BookkeepingEntrySetListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): BookkeepingEntrySetListParams = params + + /** The response that this page was parsed from. */ + fun response(): BookkeepingEntrySetListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [BookkeepingEntrySetListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [BookkeepingEntrySetListPageAsync]. */ + class Builder internal constructor() { + + private var service: BookkeepingEntrySetServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: BookkeepingEntrySetListParams? = null + private var response: BookkeepingEntrySetListPageResponse? = null + + @JvmSynthetic + internal fun from(bookkeepingEntrySetListPageAsync: BookkeepingEntrySetListPageAsync) = + apply { + service = bookkeepingEntrySetListPageAsync.service + streamHandlerExecutor = bookkeepingEntrySetListPageAsync.streamHandlerExecutor + params = bookkeepingEntrySetListPageAsync.params + response = bookkeepingEntrySetListPageAsync.response + } + + fun service(service: BookkeepingEntrySetServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: BookkeepingEntrySetListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: BookkeepingEntrySetListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [BookkeepingEntrySetListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): BookkeepingEntrySetListPageAsync = + BookkeepingEntrySetListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is BookkeepingEntrySetListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "BookkeepingEntrySetListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPageResponse.kt index 5889a7f04..62ea0aef2 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Bookkeeping Entry Set objects. */ -class BookkeepingEntrySetListResponse +class BookkeepingEntrySetListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [BookkeepingEntrySetListResponse]. + * [BookkeepingEntrySetListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [BookkeepingEntrySetListResponse]. */ + /** A builder for [BookkeepingEntrySetListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,13 +103,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(bookkeepingEntrySetListResponse: BookkeepingEntrySetListResponse) = - apply { - data = bookkeepingEntrySetListResponse.data.map { it.toMutableList() } - nextCursor = bookkeepingEntrySetListResponse.nextCursor - additionalProperties = - bookkeepingEntrySetListResponse.additionalProperties.toMutableMap() - } + internal fun from( + bookkeepingEntrySetListPageResponse: BookkeepingEntrySetListPageResponse + ) = apply { + data = bookkeepingEntrySetListPageResponse.data.map { it.toMutableList() } + nextCursor = bookkeepingEntrySetListPageResponse.nextCursor + additionalProperties = + bookkeepingEntrySetListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -172,7 +173,7 @@ private constructor( } /** - * Returns an immutable instance of [BookkeepingEntrySetListResponse]. + * Returns an immutable instance of [BookkeepingEntrySetListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -184,8 +185,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): BookkeepingEntrySetListResponse = - BookkeepingEntrySetListResponse( + fun build(): BookkeepingEntrySetListPageResponse = + BookkeepingEntrySetListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -194,7 +195,7 @@ private constructor( private var validated: Boolean = false - fun validate(): BookkeepingEntrySetListResponse = apply { + fun validate(): BookkeepingEntrySetListPageResponse = apply { if (validated) { return@apply } @@ -227,7 +228,7 @@ private constructor( return true } - return other is BookkeepingEntrySetListResponse && + return other is BookkeepingEntrySetListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -238,5 +239,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "BookkeepingEntrySetListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "BookkeepingEntrySetListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPage.kt new file mode 100644 index 000000000..abea17ee5 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.carddisputes + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.CardDisputeService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see CardDisputeService.list */ +class CardDisputeListPage +private constructor( + private val service: CardDisputeService, + private val params: CardDisputeListParams, + private val response: CardDisputeListPageResponse, +) : Page { + + /** + * Delegates to [CardDisputeListPageResponse], but gracefully handles missing data. + * + * @see CardDisputeListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardDisputeListPageResponse], but gracefully handles missing data. + * + * @see CardDisputeListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardDisputeListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CardDisputeListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): CardDisputeListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardDisputeListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardDisputeListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardDisputeListPage]. */ + class Builder internal constructor() { + + private var service: CardDisputeService? = null + private var params: CardDisputeListParams? = null + private var response: CardDisputeListPageResponse? = null + + @JvmSynthetic + internal fun from(cardDisputeListPage: CardDisputeListPage) = apply { + service = cardDisputeListPage.service + params = cardDisputeListPage.params + response = cardDisputeListPage.response + } + + fun service(service: CardDisputeService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: CardDisputeListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardDisputeListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CardDisputeListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardDisputeListPage = + CardDisputeListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardDisputeListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "CardDisputeListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageAsync.kt new file mode 100644 index 000000000..a7c681639 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.carddisputes + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.CardDisputeServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see CardDisputeServiceAsync.list */ +class CardDisputeListPageAsync +private constructor( + private val service: CardDisputeServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: CardDisputeListParams, + private val response: CardDisputeListPageResponse, +) : PageAsync { + + /** + * Delegates to [CardDisputeListPageResponse], but gracefully handles missing data. + * + * @see CardDisputeListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardDisputeListPageResponse], but gracefully handles missing data. + * + * @see CardDisputeListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardDisputeListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): CardDisputeListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardDisputeListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardDisputeListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardDisputeListPageAsync]. */ + class Builder internal constructor() { + + private var service: CardDisputeServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: CardDisputeListParams? = null + private var response: CardDisputeListPageResponse? = null + + @JvmSynthetic + internal fun from(cardDisputeListPageAsync: CardDisputeListPageAsync) = apply { + service = cardDisputeListPageAsync.service + streamHandlerExecutor = cardDisputeListPageAsync.streamHandlerExecutor + params = cardDisputeListPageAsync.params + response = cardDisputeListPageAsync.response + } + + fun service(service: CardDisputeServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: CardDisputeListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardDisputeListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CardDisputeListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardDisputeListPageAsync = + CardDisputeListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardDisputeListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "CardDisputeListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponse.kt index 979ebe1e6..8ca9d9a35 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Card Dispute objects. */ -class CardDisputeListResponse +class CardDisputeListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CardDisputeListResponse]. + * Returns a mutable builder for constructing an instance of [CardDisputeListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CardDisputeListResponse]. */ + /** A builder for [CardDisputeListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cardDisputeListResponse: CardDisputeListResponse) = apply { - data = cardDisputeListResponse.data.map { it.toMutableList() } - nextCursor = cardDisputeListResponse.nextCursor - additionalProperties = cardDisputeListResponse.additionalProperties.toMutableMap() + internal fun from(cardDisputeListPageResponse: CardDisputeListPageResponse) = apply { + data = cardDisputeListPageResponse.data.map { it.toMutableList() } + nextCursor = cardDisputeListPageResponse.nextCursor + additionalProperties = cardDisputeListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [CardDisputeListResponse]. + * Returns an immutable instance of [CardDisputeListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CardDisputeListResponse = - CardDisputeListResponse( + fun build(): CardDisputeListPageResponse = + CardDisputeListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CardDisputeListResponse = apply { + fun validate(): CardDisputeListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is CardDisputeListResponse && + return other is CardDisputeListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardDisputeListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "CardDisputeListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListPage.kt new file mode 100644 index 000000000..ea3282ec6 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cardpayments + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.CardPaymentService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see CardPaymentService.list */ +class CardPaymentListPage +private constructor( + private val service: CardPaymentService, + private val params: CardPaymentListParams, + private val response: CardPaymentListPageResponse, +) : Page { + + /** + * Delegates to [CardPaymentListPageResponse], but gracefully handles missing data. + * + * @see CardPaymentListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardPaymentListPageResponse], but gracefully handles missing data. + * + * @see CardPaymentListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardPaymentListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CardPaymentListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): CardPaymentListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardPaymentListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardPaymentListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardPaymentListPage]. */ + class Builder internal constructor() { + + private var service: CardPaymentService? = null + private var params: CardPaymentListParams? = null + private var response: CardPaymentListPageResponse? = null + + @JvmSynthetic + internal fun from(cardPaymentListPage: CardPaymentListPage) = apply { + service = cardPaymentListPage.service + params = cardPaymentListPage.params + response = cardPaymentListPage.response + } + + fun service(service: CardPaymentService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: CardPaymentListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardPaymentListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CardPaymentListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardPaymentListPage = + CardPaymentListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardPaymentListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "CardPaymentListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageAsync.kt new file mode 100644 index 000000000..3660c86a5 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cardpayments + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.CardPaymentServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see CardPaymentServiceAsync.list */ +class CardPaymentListPageAsync +private constructor( + private val service: CardPaymentServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: CardPaymentListParams, + private val response: CardPaymentListPageResponse, +) : PageAsync { + + /** + * Delegates to [CardPaymentListPageResponse], but gracefully handles missing data. + * + * @see CardPaymentListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardPaymentListPageResponse], but gracefully handles missing data. + * + * @see CardPaymentListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardPaymentListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): CardPaymentListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardPaymentListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardPaymentListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardPaymentListPageAsync]. */ + class Builder internal constructor() { + + private var service: CardPaymentServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: CardPaymentListParams? = null + private var response: CardPaymentListPageResponse? = null + + @JvmSynthetic + internal fun from(cardPaymentListPageAsync: CardPaymentListPageAsync) = apply { + service = cardPaymentListPageAsync.service + streamHandlerExecutor = cardPaymentListPageAsync.streamHandlerExecutor + params = cardPaymentListPageAsync.params + response = cardPaymentListPageAsync.response + } + + fun service(service: CardPaymentServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: CardPaymentListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardPaymentListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CardPaymentListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardPaymentListPageAsync = + CardPaymentListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardPaymentListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "CardPaymentListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponse.kt index 73f1bfdbc..ee43e398b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Card Payment objects. */ -class CardPaymentListResponse +class CardPaymentListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CardPaymentListResponse]. + * Returns a mutable builder for constructing an instance of [CardPaymentListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CardPaymentListResponse]. */ + /** A builder for [CardPaymentListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cardPaymentListResponse: CardPaymentListResponse) = apply { - data = cardPaymentListResponse.data.map { it.toMutableList() } - nextCursor = cardPaymentListResponse.nextCursor - additionalProperties = cardPaymentListResponse.additionalProperties.toMutableMap() + internal fun from(cardPaymentListPageResponse: CardPaymentListPageResponse) = apply { + data = cardPaymentListPageResponse.data.map { it.toMutableList() } + nextCursor = cardPaymentListPageResponse.nextCursor + additionalProperties = cardPaymentListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [CardPaymentListResponse]. + * Returns an immutable instance of [CardPaymentListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CardPaymentListResponse = - CardPaymentListResponse( + fun build(): CardPaymentListPageResponse = + CardPaymentListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CardPaymentListResponse = apply { + fun validate(): CardPaymentListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is CardPaymentListResponse && + return other is CardPaymentListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardPaymentListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "CardPaymentListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPage.kt new file mode 100644 index 000000000..9e36ee9ed --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPage.kt @@ -0,0 +1,136 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cardpurchasesupplements + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.CardPurchaseSupplementService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see CardPurchaseSupplementService.list */ +class CardPurchaseSupplementListPage +private constructor( + private val service: CardPurchaseSupplementService, + private val params: CardPurchaseSupplementListParams, + private val response: CardPurchaseSupplementListPageResponse, +) : Page { + + /** + * Delegates to [CardPurchaseSupplementListPageResponse], but gracefully handles missing data. + * + * @see CardPurchaseSupplementListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardPurchaseSupplementListPageResponse], but gracefully handles missing data. + * + * @see CardPurchaseSupplementListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardPurchaseSupplementListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CardPurchaseSupplementListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): CardPurchaseSupplementListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardPurchaseSupplementListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [CardPurchaseSupplementListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardPurchaseSupplementListPage]. */ + class Builder internal constructor() { + + private var service: CardPurchaseSupplementService? = null + private var params: CardPurchaseSupplementListParams? = null + private var response: CardPurchaseSupplementListPageResponse? = null + + @JvmSynthetic + internal fun from(cardPurchaseSupplementListPage: CardPurchaseSupplementListPage) = apply { + service = cardPurchaseSupplementListPage.service + params = cardPurchaseSupplementListPage.params + response = cardPurchaseSupplementListPage.response + } + + fun service(service: CardPurchaseSupplementService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: CardPurchaseSupplementListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardPurchaseSupplementListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [CardPurchaseSupplementListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardPurchaseSupplementListPage = + CardPurchaseSupplementListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardPurchaseSupplementListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "CardPurchaseSupplementListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPageAsync.kt new file mode 100644 index 000000000..14c46682e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPageAsync.kt @@ -0,0 +1,153 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cardpurchasesupplements + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.CardPurchaseSupplementServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see CardPurchaseSupplementServiceAsync.list */ +class CardPurchaseSupplementListPageAsync +private constructor( + private val service: CardPurchaseSupplementServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: CardPurchaseSupplementListParams, + private val response: CardPurchaseSupplementListPageResponse, +) : PageAsync { + + /** + * Delegates to [CardPurchaseSupplementListPageResponse], but gracefully handles missing data. + * + * @see CardPurchaseSupplementListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardPurchaseSupplementListPageResponse], but gracefully handles missing data. + * + * @see CardPurchaseSupplementListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardPurchaseSupplementListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): CardPurchaseSupplementListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardPurchaseSupplementListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [CardPurchaseSupplementListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardPurchaseSupplementListPageAsync]. */ + class Builder internal constructor() { + + private var service: CardPurchaseSupplementServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: CardPurchaseSupplementListParams? = null + private var response: CardPurchaseSupplementListPageResponse? = null + + @JvmSynthetic + internal fun from( + cardPurchaseSupplementListPageAsync: CardPurchaseSupplementListPageAsync + ) = apply { + service = cardPurchaseSupplementListPageAsync.service + streamHandlerExecutor = cardPurchaseSupplementListPageAsync.streamHandlerExecutor + params = cardPurchaseSupplementListPageAsync.params + response = cardPurchaseSupplementListPageAsync.response + } + + fun service(service: CardPurchaseSupplementServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: CardPurchaseSupplementListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardPurchaseSupplementListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [CardPurchaseSupplementListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardPurchaseSupplementListPageAsync = + CardPurchaseSupplementListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardPurchaseSupplementListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "CardPurchaseSupplementListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPageResponse.kt index 4eb072bf7..fb8febe63 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Card Purchase Supplement objects. */ -class CardPurchaseSupplementListResponse +class CardPurchaseSupplementListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -86,7 +86,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [CardPurchaseSupplementListResponse]. + * [CardPurchaseSupplementListPageResponse]. * * The following fields are required: * ```java @@ -97,7 +97,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CardPurchaseSupplementListResponse]. */ + /** A builder for [CardPurchaseSupplementListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -105,13 +105,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cardPurchaseSupplementListResponse: CardPurchaseSupplementListResponse) = - apply { - data = cardPurchaseSupplementListResponse.data.map { it.toMutableList() } - nextCursor = cardPurchaseSupplementListResponse.nextCursor - additionalProperties = - cardPurchaseSupplementListResponse.additionalProperties.toMutableMap() - } + internal fun from( + cardPurchaseSupplementListPageResponse: CardPurchaseSupplementListPageResponse + ) = apply { + data = cardPurchaseSupplementListPageResponse.data.map { it.toMutableList() } + nextCursor = cardPurchaseSupplementListPageResponse.nextCursor + additionalProperties = + cardPurchaseSupplementListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -174,7 +175,7 @@ private constructor( } /** - * Returns an immutable instance of [CardPurchaseSupplementListResponse]. + * Returns an immutable instance of [CardPurchaseSupplementListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -186,8 +187,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CardPurchaseSupplementListResponse = - CardPurchaseSupplementListResponse( + fun build(): CardPurchaseSupplementListPageResponse = + CardPurchaseSupplementListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -196,7 +197,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CardPurchaseSupplementListResponse = apply { + fun validate(): CardPurchaseSupplementListPageResponse = apply { if (validated) { return@apply } @@ -229,7 +230,7 @@ private constructor( return true } - return other is CardPurchaseSupplementListResponse && + return other is CardPurchaseSupplementListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -240,5 +241,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardPurchaseSupplementListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "CardPurchaseSupplementListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPage.kt new file mode 100644 index 000000000..865cf24ad --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cardpushtransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.CardPushTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see CardPushTransferService.list */ +class CardPushTransferListPage +private constructor( + private val service: CardPushTransferService, + private val params: CardPushTransferListParams, + private val response: CardPushTransferListPageResponse, +) : Page { + + /** + * Delegates to [CardPushTransferListPageResponse], but gracefully handles missing data. + * + * @see CardPushTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardPushTransferListPageResponse], but gracefully handles missing data. + * + * @see CardPushTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardPushTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CardPushTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): CardPushTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardPushTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardPushTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardPushTransferListPage]. */ + class Builder internal constructor() { + + private var service: CardPushTransferService? = null + private var params: CardPushTransferListParams? = null + private var response: CardPushTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(cardPushTransferListPage: CardPushTransferListPage) = apply { + service = cardPushTransferListPage.service + params = cardPushTransferListPage.params + response = cardPushTransferListPage.response + } + + fun service(service: CardPushTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: CardPushTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardPushTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [CardPushTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardPushTransferListPage = + CardPushTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardPushTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "CardPushTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageAsync.kt new file mode 100644 index 000000000..603a9c2d0 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageAsync.kt @@ -0,0 +1,151 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cardpushtransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.CardPushTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see CardPushTransferServiceAsync.list */ +class CardPushTransferListPageAsync +private constructor( + private val service: CardPushTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: CardPushTransferListParams, + private val response: CardPushTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [CardPushTransferListPageResponse], but gracefully handles missing data. + * + * @see CardPushTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardPushTransferListPageResponse], but gracefully handles missing data. + * + * @see CardPushTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardPushTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): CardPushTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardPushTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [CardPushTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardPushTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: CardPushTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: CardPushTransferListParams? = null + private var response: CardPushTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(cardPushTransferListPageAsync: CardPushTransferListPageAsync) = apply { + service = cardPushTransferListPageAsync.service + streamHandlerExecutor = cardPushTransferListPageAsync.streamHandlerExecutor + params = cardPushTransferListPageAsync.params + response = cardPushTransferListPageAsync.response + } + + fun service(service: CardPushTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: CardPushTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardPushTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [CardPushTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardPushTransferListPageAsync = + CardPushTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardPushTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "CardPushTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageResponse.kt index e1589efb1..7a8324456 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Card Push Transfer objects. */ -class CardPushTransferListResponse +class CardPushTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CardPushTransferListResponse]. + * Returns a mutable builder for constructing an instance of + * [CardPushTransferListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CardPushTransferListResponse]. */ + /** A builder for [CardPushTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,11 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cardPushTransferListResponse: CardPushTransferListResponse) = apply { - data = cardPushTransferListResponse.data.map { it.toMutableList() } - nextCursor = cardPushTransferListResponse.nextCursor - additionalProperties = cardPushTransferListResponse.additionalProperties.toMutableMap() - } + internal fun from(cardPushTransferListPageResponse: CardPushTransferListPageResponse) = + apply { + data = cardPushTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = cardPushTransferListPageResponse.nextCursor + additionalProperties = + cardPushTransferListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -169,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [CardPushTransferListResponse]. + * Returns an immutable instance of [CardPushTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CardPushTransferListResponse = - CardPushTransferListResponse( + fun build(): CardPushTransferListPageResponse = + CardPushTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CardPushTransferListResponse = apply { + fun validate(): CardPushTransferListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +227,7 @@ private constructor( return true } - return other is CardPushTransferListResponse && + return other is CardPushTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardPushTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "CardPushTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListPage.kt new file mode 100644 index 000000000..e9f8b8978 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListPage.kt @@ -0,0 +1,131 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cards + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.CardService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see CardService.list */ +class CardListPage +private constructor( + private val service: CardService, + private val params: CardListParams, + private val response: CardListPageResponse, +) : Page { + + /** + * Delegates to [CardListPageResponse], but gracefully handles missing data. + * + * @see CardListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardListPageResponse], but gracefully handles missing data. + * + * @see CardListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CardListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): CardListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardListPage]. */ + class Builder internal constructor() { + + private var service: CardService? = null + private var params: CardListParams? = null + private var response: CardListPageResponse? = null + + @JvmSynthetic + internal fun from(cardListPage: CardListPage) = apply { + service = cardListPage.service + params = cardListPage.params + response = cardListPage.response + } + + fun service(service: CardService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: CardListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CardListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardListPage = + CardListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = "CardListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListPageAsync.kt new file mode 100644 index 000000000..4b8f0975b --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListPageAsync.kt @@ -0,0 +1,145 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cards + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.CardServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see CardServiceAsync.list */ +class CardListPageAsync +private constructor( + private val service: CardServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: CardListParams, + private val response: CardListPageResponse, +) : PageAsync { + + /** + * Delegates to [CardListPageResponse], but gracefully handles missing data. + * + * @see CardListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardListPageResponse], but gracefully handles missing data. + * + * @see CardListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): CardListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardListPageAsync]. */ + class Builder internal constructor() { + + private var service: CardServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: CardListParams? = null + private var response: CardListPageResponse? = null + + @JvmSynthetic + internal fun from(cardListPageAsync: CardListPageAsync) = apply { + service = cardListPageAsync.service + streamHandlerExecutor = cardListPageAsync.streamHandlerExecutor + params = cardListPageAsync.params + response = cardListPageAsync.response + } + + fun service(service: CardServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: CardListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CardListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardListPageAsync = + CardListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "CardListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListPageResponse.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListPageResponse.kt index 5bbc28191..69c2b231a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cards/CardListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Card objects. */ -class CardListResponse +class CardListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CardListResponse]. + * Returns a mutable builder for constructing an instance of [CardListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CardListResponse]. */ + /** A builder for [CardListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cardListResponse: CardListResponse) = apply { - data = cardListResponse.data.map { it.toMutableList() } - nextCursor = cardListResponse.nextCursor - additionalProperties = cardListResponse.additionalProperties.toMutableMap() + internal fun from(cardListPageResponse: CardListPageResponse) = apply { + data = cardListPageResponse.data.map { it.toMutableList() } + nextCursor = cardListPageResponse.nextCursor + additionalProperties = cardListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -166,7 +166,7 @@ private constructor( } /** - * Returns an immutable instance of [CardListResponse]. + * Returns an immutable instance of [CardListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -178,8 +178,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CardListResponse = - CardListResponse( + fun build(): CardListPageResponse = + CardListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -188,7 +188,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CardListResponse = apply { + fun validate(): CardListPageResponse = apply { if (validated) { return@apply } @@ -221,7 +221,7 @@ private constructor( return true } - return other is CardListResponse && + return other is CardListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -232,5 +232,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "CardListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListPage.kt new file mode 100644 index 000000000..1c7dfc628 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cardtokens + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.CardTokenService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see CardTokenService.list */ +class CardTokenListPage +private constructor( + private val service: CardTokenService, + private val params: CardTokenListParams, + private val response: CardTokenListPageResponse, +) : Page { + + /** + * Delegates to [CardTokenListPageResponse], but gracefully handles missing data. + * + * @see CardTokenListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardTokenListPageResponse], but gracefully handles missing data. + * + * @see CardTokenListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardTokenListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CardTokenListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): CardTokenListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardTokenListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardTokenListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardTokenListPage]. */ + class Builder internal constructor() { + + private var service: CardTokenService? = null + private var params: CardTokenListParams? = null + private var response: CardTokenListPageResponse? = null + + @JvmSynthetic + internal fun from(cardTokenListPage: CardTokenListPage) = apply { + service = cardTokenListPage.service + params = cardTokenListPage.params + response = cardTokenListPage.response + } + + fun service(service: CardTokenService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: CardTokenListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardTokenListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CardTokenListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardTokenListPage = + CardTokenListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardTokenListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "CardTokenListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListPageAsync.kt new file mode 100644 index 000000000..e1b562f8d --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cardtokens + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.CardTokenServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see CardTokenServiceAsync.list */ +class CardTokenListPageAsync +private constructor( + private val service: CardTokenServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: CardTokenListParams, + private val response: CardTokenListPageResponse, +) : PageAsync { + + /** + * Delegates to [CardTokenListPageResponse], but gracefully handles missing data. + * + * @see CardTokenListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardTokenListPageResponse], but gracefully handles missing data. + * + * @see CardTokenListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardTokenListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): CardTokenListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardTokenListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardTokenListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardTokenListPageAsync]. */ + class Builder internal constructor() { + + private var service: CardTokenServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: CardTokenListParams? = null + private var response: CardTokenListPageResponse? = null + + @JvmSynthetic + internal fun from(cardTokenListPageAsync: CardTokenListPageAsync) = apply { + service = cardTokenListPageAsync.service + streamHandlerExecutor = cardTokenListPageAsync.streamHandlerExecutor + params = cardTokenListPageAsync.params + response = cardTokenListPageAsync.response + } + + fun service(service: CardTokenServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: CardTokenListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardTokenListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CardTokenListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardTokenListPageAsync = + CardTokenListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardTokenListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "CardTokenListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListPageResponse.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListPageResponse.kt index 2e89fc3da..efe5e9148 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardtokens/CardTokenListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Card Token objects. */ -class CardTokenListResponse +class CardTokenListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CardTokenListResponse]. + * Returns a mutable builder for constructing an instance of [CardTokenListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CardTokenListResponse]. */ + /** A builder for [CardTokenListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cardTokenListResponse: CardTokenListResponse) = apply { - data = cardTokenListResponse.data.map { it.toMutableList() } - nextCursor = cardTokenListResponse.nextCursor - additionalProperties = cardTokenListResponse.additionalProperties.toMutableMap() + internal fun from(cardTokenListPageResponse: CardTokenListPageResponse) = apply { + data = cardTokenListPageResponse.data.map { it.toMutableList() } + nextCursor = cardTokenListPageResponse.nextCursor + additionalProperties = cardTokenListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [CardTokenListResponse]. + * Returns an immutable instance of [CardTokenListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CardTokenListResponse = - CardTokenListResponse( + fun build(): CardTokenListPageResponse = + CardTokenListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CardTokenListResponse = apply { + fun validate(): CardTokenListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is CardTokenListResponse && + return other is CardTokenListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardTokenListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "CardTokenListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListPage.kt new file mode 100644 index 000000000..e1688cd1d --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cardvalidations + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.CardValidationService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see CardValidationService.list */ +class CardValidationListPage +private constructor( + private val service: CardValidationService, + private val params: CardValidationListParams, + private val response: CardValidationListPageResponse, +) : Page { + + /** + * Delegates to [CardValidationListPageResponse], but gracefully handles missing data. + * + * @see CardValidationListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardValidationListPageResponse], but gracefully handles missing data. + * + * @see CardValidationListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardValidationListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CardValidationListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): CardValidationListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardValidationListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardValidationListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardValidationListPage]. */ + class Builder internal constructor() { + + private var service: CardValidationService? = null + private var params: CardValidationListParams? = null + private var response: CardValidationListPageResponse? = null + + @JvmSynthetic + internal fun from(cardValidationListPage: CardValidationListPage) = apply { + service = cardValidationListPage.service + params = cardValidationListPage.params + response = cardValidationListPage.response + } + + fun service(service: CardValidationService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: CardValidationListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardValidationListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CardValidationListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardValidationListPage = + CardValidationListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardValidationListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "CardValidationListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageAsync.kt new file mode 100644 index 000000000..138cf333d --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.cardvalidations + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.CardValidationServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see CardValidationServiceAsync.list */ +class CardValidationListPageAsync +private constructor( + private val service: CardValidationServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: CardValidationListParams, + private val response: CardValidationListPageResponse, +) : PageAsync { + + /** + * Delegates to [CardValidationListPageResponse], but gracefully handles missing data. + * + * @see CardValidationListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CardValidationListPageResponse], but gracefully handles missing data. + * + * @see CardValidationListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CardValidationListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): CardValidationListParams = params + + /** The response that this page was parsed from. */ + fun response(): CardValidationListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CardValidationListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardValidationListPageAsync]. */ + class Builder internal constructor() { + + private var service: CardValidationServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: CardValidationListParams? = null + private var response: CardValidationListPageResponse? = null + + @JvmSynthetic + internal fun from(cardValidationListPageAsync: CardValidationListPageAsync) = apply { + service = cardValidationListPageAsync.service + streamHandlerExecutor = cardValidationListPageAsync.streamHandlerExecutor + params = cardValidationListPageAsync.params + response = cardValidationListPageAsync.response + } + + fun service(service: CardValidationServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: CardValidationListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CardValidationListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CardValidationListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardValidationListPageAsync = + CardValidationListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardValidationListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "CardValidationListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageResponse.kt index bbd22a5e3..36bf00502 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Card Validation objects. */ -class CardValidationListResponse +class CardValidationListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CardValidationListResponse]. + * Returns a mutable builder for constructing an instance of + * [CardValidationListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CardValidationListResponse]. */ + /** A builder for [CardValidationListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,10 +103,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cardValidationListResponse: CardValidationListResponse) = apply { - data = cardValidationListResponse.data.map { it.toMutableList() } - nextCursor = cardValidationListResponse.nextCursor - additionalProperties = cardValidationListResponse.additionalProperties.toMutableMap() + internal fun from(cardValidationListPageResponse: CardValidationListPageResponse) = apply { + data = cardValidationListPageResponse.data.map { it.toMutableList() } + nextCursor = cardValidationListPageResponse.nextCursor + additionalProperties = + cardValidationListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -169,7 +171,7 @@ private constructor( } /** - * Returns an immutable instance of [CardValidationListResponse]. + * Returns an immutable instance of [CardValidationListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +183,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CardValidationListResponse = - CardValidationListResponse( + fun build(): CardValidationListPageResponse = + CardValidationListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +193,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CardValidationListResponse = apply { + fun validate(): CardValidationListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +226,7 @@ private constructor( return true } - return other is CardValidationListResponse && + return other is CardValidationListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +237,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardValidationListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "CardValidationListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPage.kt new file mode 100644 index 000000000..a148ee5bb --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.checkdeposits + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.CheckDepositService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see CheckDepositService.list */ +class CheckDepositListPage +private constructor( + private val service: CheckDepositService, + private val params: CheckDepositListParams, + private val response: CheckDepositListPageResponse, +) : Page { + + /** + * Delegates to [CheckDepositListPageResponse], but gracefully handles missing data. + * + * @see CheckDepositListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CheckDepositListPageResponse], but gracefully handles missing data. + * + * @see CheckDepositListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CheckDepositListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CheckDepositListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): CheckDepositListParams = params + + /** The response that this page was parsed from. */ + fun response(): CheckDepositListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CheckDepositListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CheckDepositListPage]. */ + class Builder internal constructor() { + + private var service: CheckDepositService? = null + private var params: CheckDepositListParams? = null + private var response: CheckDepositListPageResponse? = null + + @JvmSynthetic + internal fun from(checkDepositListPage: CheckDepositListPage) = apply { + service = checkDepositListPage.service + params = checkDepositListPage.params + response = checkDepositListPage.response + } + + fun service(service: CheckDepositService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: CheckDepositListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CheckDepositListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CheckDepositListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CheckDepositListPage = + CheckDepositListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CheckDepositListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "CheckDepositListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageAsync.kt new file mode 100644 index 000000000..c383eda8f --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.checkdeposits + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.CheckDepositServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see CheckDepositServiceAsync.list */ +class CheckDepositListPageAsync +private constructor( + private val service: CheckDepositServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: CheckDepositListParams, + private val response: CheckDepositListPageResponse, +) : PageAsync { + + /** + * Delegates to [CheckDepositListPageResponse], but gracefully handles missing data. + * + * @see CheckDepositListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CheckDepositListPageResponse], but gracefully handles missing data. + * + * @see CheckDepositListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CheckDepositListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): CheckDepositListParams = params + + /** The response that this page was parsed from. */ + fun response(): CheckDepositListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CheckDepositListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CheckDepositListPageAsync]. */ + class Builder internal constructor() { + + private var service: CheckDepositServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: CheckDepositListParams? = null + private var response: CheckDepositListPageResponse? = null + + @JvmSynthetic + internal fun from(checkDepositListPageAsync: CheckDepositListPageAsync) = apply { + service = checkDepositListPageAsync.service + streamHandlerExecutor = checkDepositListPageAsync.streamHandlerExecutor + params = checkDepositListPageAsync.params + response = checkDepositListPageAsync.response + } + + fun service(service: CheckDepositServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: CheckDepositListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CheckDepositListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CheckDepositListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CheckDepositListPageAsync = + CheckDepositListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CheckDepositListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "CheckDepositListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponse.kt index 0f07d35ec..fca0aa67e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Check Deposit objects. */ -class CheckDepositListResponse +class CheckDepositListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CheckDepositListResponse]. + * Returns a mutable builder for constructing an instance of [CheckDepositListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +94,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CheckDepositListResponse]. */ + /** A builder for [CheckDepositListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,10 +102,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(checkDepositListResponse: CheckDepositListResponse) = apply { - data = checkDepositListResponse.data.map { it.toMutableList() } - nextCursor = checkDepositListResponse.nextCursor - additionalProperties = checkDepositListResponse.additionalProperties.toMutableMap() + internal fun from(checkDepositListPageResponse: CheckDepositListPageResponse) = apply { + data = checkDepositListPageResponse.data.map { it.toMutableList() } + nextCursor = checkDepositListPageResponse.nextCursor + additionalProperties = checkDepositListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -169,7 +169,7 @@ private constructor( } /** - * Returns an immutable instance of [CheckDepositListResponse]. + * Returns an immutable instance of [CheckDepositListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +181,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CheckDepositListResponse = - CheckDepositListResponse( + fun build(): CheckDepositListPageResponse = + CheckDepositListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +191,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CheckDepositListResponse = apply { + fun validate(): CheckDepositListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +224,7 @@ private constructor( return true } - return other is CheckDepositListResponse && + return other is CheckDepositListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +235,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CheckDepositListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "CheckDepositListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListPage.kt new file mode 100644 index 000000000..2919fc707 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.checktransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.CheckTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see CheckTransferService.list */ +class CheckTransferListPage +private constructor( + private val service: CheckTransferService, + private val params: CheckTransferListParams, + private val response: CheckTransferListPageResponse, +) : Page { + + /** + * Delegates to [CheckTransferListPageResponse], but gracefully handles missing data. + * + * @see CheckTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CheckTransferListPageResponse], but gracefully handles missing data. + * + * @see CheckTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CheckTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CheckTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): CheckTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): CheckTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CheckTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CheckTransferListPage]. */ + class Builder internal constructor() { + + private var service: CheckTransferService? = null + private var params: CheckTransferListParams? = null + private var response: CheckTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(checkTransferListPage: CheckTransferListPage) = apply { + service = checkTransferListPage.service + params = checkTransferListPage.params + response = checkTransferListPage.response + } + + fun service(service: CheckTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: CheckTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CheckTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CheckTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CheckTransferListPage = + CheckTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CheckTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "CheckTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageAsync.kt new file mode 100644 index 000000000..c848e411a --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.checktransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.CheckTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see CheckTransferServiceAsync.list */ +class CheckTransferListPageAsync +private constructor( + private val service: CheckTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: CheckTransferListParams, + private val response: CheckTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [CheckTransferListPageResponse], but gracefully handles missing data. + * + * @see CheckTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [CheckTransferListPageResponse], but gracefully handles missing data. + * + * @see CheckTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): CheckTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): CheckTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): CheckTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [CheckTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CheckTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: CheckTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: CheckTransferListParams? = null + private var response: CheckTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(checkTransferListPageAsync: CheckTransferListPageAsync) = apply { + service = checkTransferListPageAsync.service + streamHandlerExecutor = checkTransferListPageAsync.streamHandlerExecutor + params = checkTransferListPageAsync.params + response = checkTransferListPageAsync.response + } + + fun service(service: CheckTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: CheckTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: CheckTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [CheckTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CheckTransferListPageAsync = + CheckTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CheckTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "CheckTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageResponse.kt index 7cdad0067..011fd93dd 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Check Transfer objects. */ -class CheckTransferListResponse +class CheckTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CheckTransferListResponse]. + * Returns a mutable builder for constructing an instance of + * [CheckTransferListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [CheckTransferListResponse]. */ + /** A builder for [CheckTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,10 +103,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(checkTransferListResponse: CheckTransferListResponse) = apply { - data = checkTransferListResponse.data.map { it.toMutableList() } - nextCursor = checkTransferListResponse.nextCursor - additionalProperties = checkTransferListResponse.additionalProperties.toMutableMap() + internal fun from(checkTransferListPageResponse: CheckTransferListPageResponse) = apply { + data = checkTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = checkTransferListPageResponse.nextCursor + additionalProperties = checkTransferListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -169,7 +170,7 @@ private constructor( } /** - * Returns an immutable instance of [CheckTransferListResponse]. + * Returns an immutable instance of [CheckTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +182,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): CheckTransferListResponse = - CheckTransferListResponse( + fun build(): CheckTransferListPageResponse = + CheckTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +192,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CheckTransferListResponse = apply { + fun validate(): CheckTransferListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +225,7 @@ private constructor( return true } - return other is CheckTransferListResponse && + return other is CheckTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +236,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CheckTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "CheckTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPage.kt new file mode 100644 index 000000000..ebdb124c0 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.declinedtransactions + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.DeclinedTransactionService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see DeclinedTransactionService.list */ +class DeclinedTransactionListPage +private constructor( + private val service: DeclinedTransactionService, + private val params: DeclinedTransactionListParams, + private val response: DeclinedTransactionListPageResponse, +) : Page { + + /** + * Delegates to [DeclinedTransactionListPageResponse], but gracefully handles missing data. + * + * @see DeclinedTransactionListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [DeclinedTransactionListPageResponse], but gracefully handles missing data. + * + * @see DeclinedTransactionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): DeclinedTransactionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): DeclinedTransactionListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): DeclinedTransactionListParams = params + + /** The response that this page was parsed from. */ + fun response(): DeclinedTransactionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [DeclinedTransactionListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DeclinedTransactionListPage]. */ + class Builder internal constructor() { + + private var service: DeclinedTransactionService? = null + private var params: DeclinedTransactionListParams? = null + private var response: DeclinedTransactionListPageResponse? = null + + @JvmSynthetic + internal fun from(declinedTransactionListPage: DeclinedTransactionListPage) = apply { + service = declinedTransactionListPage.service + params = declinedTransactionListPage.params + response = declinedTransactionListPage.response + } + + fun service(service: DeclinedTransactionService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: DeclinedTransactionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: DeclinedTransactionListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [DeclinedTransactionListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DeclinedTransactionListPage = + DeclinedTransactionListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DeclinedTransactionListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "DeclinedTransactionListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageAsync.kt new file mode 100644 index 000000000..c1ddcb079 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.declinedtransactions + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.DeclinedTransactionServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see DeclinedTransactionServiceAsync.list */ +class DeclinedTransactionListPageAsync +private constructor( + private val service: DeclinedTransactionServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: DeclinedTransactionListParams, + private val response: DeclinedTransactionListPageResponse, +) : PageAsync { + + /** + * Delegates to [DeclinedTransactionListPageResponse], but gracefully handles missing data. + * + * @see DeclinedTransactionListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [DeclinedTransactionListPageResponse], but gracefully handles missing data. + * + * @see DeclinedTransactionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): DeclinedTransactionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): DeclinedTransactionListParams = params + + /** The response that this page was parsed from. */ + fun response(): DeclinedTransactionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [DeclinedTransactionListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DeclinedTransactionListPageAsync]. */ + class Builder internal constructor() { + + private var service: DeclinedTransactionServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: DeclinedTransactionListParams? = null + private var response: DeclinedTransactionListPageResponse? = null + + @JvmSynthetic + internal fun from(declinedTransactionListPageAsync: DeclinedTransactionListPageAsync) = + apply { + service = declinedTransactionListPageAsync.service + streamHandlerExecutor = declinedTransactionListPageAsync.streamHandlerExecutor + params = declinedTransactionListPageAsync.params + response = declinedTransactionListPageAsync.response + } + + fun service(service: DeclinedTransactionServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: DeclinedTransactionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: DeclinedTransactionListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [DeclinedTransactionListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DeclinedTransactionListPageAsync = + DeclinedTransactionListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DeclinedTransactionListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "DeclinedTransactionListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponse.kt index 1c3a0b9fd..772ba046e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Declined Transaction objects. */ -class DeclinedTransactionListResponse +class DeclinedTransactionListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [DeclinedTransactionListResponse]. + * [DeclinedTransactionListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [DeclinedTransactionListResponse]. */ + /** A builder for [DeclinedTransactionListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,13 +103,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(declinedTransactionListResponse: DeclinedTransactionListResponse) = - apply { - data = declinedTransactionListResponse.data.map { it.toMutableList() } - nextCursor = declinedTransactionListResponse.nextCursor - additionalProperties = - declinedTransactionListResponse.additionalProperties.toMutableMap() - } + internal fun from( + declinedTransactionListPageResponse: DeclinedTransactionListPageResponse + ) = apply { + data = declinedTransactionListPageResponse.data.map { it.toMutableList() } + nextCursor = declinedTransactionListPageResponse.nextCursor + additionalProperties = + declinedTransactionListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -172,7 +173,7 @@ private constructor( } /** - * Returns an immutable instance of [DeclinedTransactionListResponse]. + * Returns an immutable instance of [DeclinedTransactionListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -184,8 +185,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): DeclinedTransactionListResponse = - DeclinedTransactionListResponse( + fun build(): DeclinedTransactionListPageResponse = + DeclinedTransactionListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -194,7 +195,7 @@ private constructor( private var validated: Boolean = false - fun validate(): DeclinedTransactionListResponse = apply { + fun validate(): DeclinedTransactionListPageResponse = apply { if (validated) { return@apply } @@ -227,7 +228,7 @@ private constructor( return true } - return other is DeclinedTransactionListResponse && + return other is DeclinedTransactionListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -238,5 +239,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "DeclinedTransactionListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "DeclinedTransactionListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPage.kt new file mode 100644 index 000000000..194ce6679 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.digitalcardprofiles + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.DigitalCardProfileService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see DigitalCardProfileService.list */ +class DigitalCardProfileListPage +private constructor( + private val service: DigitalCardProfileService, + private val params: DigitalCardProfileListParams, + private val response: DigitalCardProfileListPageResponse, +) : Page { + + /** + * Delegates to [DigitalCardProfileListPageResponse], but gracefully handles missing data. + * + * @see DigitalCardProfileListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [DigitalCardProfileListPageResponse], but gracefully handles missing data. + * + * @see DigitalCardProfileListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): DigitalCardProfileListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): DigitalCardProfileListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): DigitalCardProfileListParams = params + + /** The response that this page was parsed from. */ + fun response(): DigitalCardProfileListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [DigitalCardProfileListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DigitalCardProfileListPage]. */ + class Builder internal constructor() { + + private var service: DigitalCardProfileService? = null + private var params: DigitalCardProfileListParams? = null + private var response: DigitalCardProfileListPageResponse? = null + + @JvmSynthetic + internal fun from(digitalCardProfileListPage: DigitalCardProfileListPage) = apply { + service = digitalCardProfileListPage.service + params = digitalCardProfileListPage.params + response = digitalCardProfileListPage.response + } + + fun service(service: DigitalCardProfileService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: DigitalCardProfileListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: DigitalCardProfileListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [DigitalCardProfileListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DigitalCardProfileListPage = + DigitalCardProfileListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DigitalCardProfileListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "DigitalCardProfileListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPageAsync.kt new file mode 100644 index 000000000..970db868e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.digitalcardprofiles + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.DigitalCardProfileServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see DigitalCardProfileServiceAsync.list */ +class DigitalCardProfileListPageAsync +private constructor( + private val service: DigitalCardProfileServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: DigitalCardProfileListParams, + private val response: DigitalCardProfileListPageResponse, +) : PageAsync { + + /** + * Delegates to [DigitalCardProfileListPageResponse], but gracefully handles missing data. + * + * @see DigitalCardProfileListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [DigitalCardProfileListPageResponse], but gracefully handles missing data. + * + * @see DigitalCardProfileListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): DigitalCardProfileListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): DigitalCardProfileListParams = params + + /** The response that this page was parsed from. */ + fun response(): DigitalCardProfileListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [DigitalCardProfileListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DigitalCardProfileListPageAsync]. */ + class Builder internal constructor() { + + private var service: DigitalCardProfileServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: DigitalCardProfileListParams? = null + private var response: DigitalCardProfileListPageResponse? = null + + @JvmSynthetic + internal fun from(digitalCardProfileListPageAsync: DigitalCardProfileListPageAsync) = + apply { + service = digitalCardProfileListPageAsync.service + streamHandlerExecutor = digitalCardProfileListPageAsync.streamHandlerExecutor + params = digitalCardProfileListPageAsync.params + response = digitalCardProfileListPageAsync.response + } + + fun service(service: DigitalCardProfileServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: DigitalCardProfileListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: DigitalCardProfileListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [DigitalCardProfileListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DigitalCardProfileListPageAsync = + DigitalCardProfileListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DigitalCardProfileListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "DigitalCardProfileListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPageResponse.kt similarity index 88% rename from increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPageResponse.kt index 8735d0f98..b79889b74 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Digital Card Profile objects. */ -class DigitalCardProfileListResponse +class DigitalCardProfileListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [DigitalCardProfileListResponse]. + * [DigitalCardProfileListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [DigitalCardProfileListResponse]. */ + /** A builder for [DigitalCardProfileListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,12 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(digitalCardProfileListResponse: DigitalCardProfileListResponse) = apply { - data = digitalCardProfileListResponse.data.map { it.toMutableList() } - nextCursor = digitalCardProfileListResponse.nextCursor - additionalProperties = - digitalCardProfileListResponse.additionalProperties.toMutableMap() - } + internal fun from(digitalCardProfileListPageResponse: DigitalCardProfileListPageResponse) = + apply { + data = digitalCardProfileListPageResponse.data.map { it.toMutableList() } + nextCursor = digitalCardProfileListPageResponse.nextCursor + additionalProperties = + digitalCardProfileListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -171,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [DigitalCardProfileListResponse]. + * Returns an immutable instance of [DigitalCardProfileListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -183,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): DigitalCardProfileListResponse = - DigitalCardProfileListResponse( + fun build(): DigitalCardProfileListPageResponse = + DigitalCardProfileListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -193,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): DigitalCardProfileListResponse = apply { + fun validate(): DigitalCardProfileListPageResponse = apply { if (validated) { return@apply } @@ -226,7 +227,7 @@ private constructor( return true } - return other is DigitalCardProfileListResponse && + return other is DigitalCardProfileListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -237,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "DigitalCardProfileListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "DigitalCardProfileListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPage.kt new file mode 100644 index 000000000..df1d5f2d8 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.digitalwallettokens + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.DigitalWalletTokenService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see DigitalWalletTokenService.list */ +class DigitalWalletTokenListPage +private constructor( + private val service: DigitalWalletTokenService, + private val params: DigitalWalletTokenListParams, + private val response: DigitalWalletTokenListPageResponse, +) : Page { + + /** + * Delegates to [DigitalWalletTokenListPageResponse], but gracefully handles missing data. + * + * @see DigitalWalletTokenListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [DigitalWalletTokenListPageResponse], but gracefully handles missing data. + * + * @see DigitalWalletTokenListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): DigitalWalletTokenListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): DigitalWalletTokenListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): DigitalWalletTokenListParams = params + + /** The response that this page was parsed from. */ + fun response(): DigitalWalletTokenListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [DigitalWalletTokenListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DigitalWalletTokenListPage]. */ + class Builder internal constructor() { + + private var service: DigitalWalletTokenService? = null + private var params: DigitalWalletTokenListParams? = null + private var response: DigitalWalletTokenListPageResponse? = null + + @JvmSynthetic + internal fun from(digitalWalletTokenListPage: DigitalWalletTokenListPage) = apply { + service = digitalWalletTokenListPage.service + params = digitalWalletTokenListPage.params + response = digitalWalletTokenListPage.response + } + + fun service(service: DigitalWalletTokenService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: DigitalWalletTokenListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: DigitalWalletTokenListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [DigitalWalletTokenListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DigitalWalletTokenListPage = + DigitalWalletTokenListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DigitalWalletTokenListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "DigitalWalletTokenListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPageAsync.kt new file mode 100644 index 000000000..ef5841287 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.digitalwallettokens + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.DigitalWalletTokenServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see DigitalWalletTokenServiceAsync.list */ +class DigitalWalletTokenListPageAsync +private constructor( + private val service: DigitalWalletTokenServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: DigitalWalletTokenListParams, + private val response: DigitalWalletTokenListPageResponse, +) : PageAsync { + + /** + * Delegates to [DigitalWalletTokenListPageResponse], but gracefully handles missing data. + * + * @see DigitalWalletTokenListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [DigitalWalletTokenListPageResponse], but gracefully handles missing data. + * + * @see DigitalWalletTokenListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): DigitalWalletTokenListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): DigitalWalletTokenListParams = params + + /** The response that this page was parsed from. */ + fun response(): DigitalWalletTokenListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [DigitalWalletTokenListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DigitalWalletTokenListPageAsync]. */ + class Builder internal constructor() { + + private var service: DigitalWalletTokenServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: DigitalWalletTokenListParams? = null + private var response: DigitalWalletTokenListPageResponse? = null + + @JvmSynthetic + internal fun from(digitalWalletTokenListPageAsync: DigitalWalletTokenListPageAsync) = + apply { + service = digitalWalletTokenListPageAsync.service + streamHandlerExecutor = digitalWalletTokenListPageAsync.streamHandlerExecutor + params = digitalWalletTokenListPageAsync.params + response = digitalWalletTokenListPageAsync.response + } + + fun service(service: DigitalWalletTokenServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: DigitalWalletTokenListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: DigitalWalletTokenListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [DigitalWalletTokenListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DigitalWalletTokenListPageAsync = + DigitalWalletTokenListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DigitalWalletTokenListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "DigitalWalletTokenListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPageResponse.kt similarity index 88% rename from increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPageResponse.kt index f8a422357..5a5e6de79 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Digital Wallet Token objects. */ -class DigitalWalletTokenListResponse +class DigitalWalletTokenListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [DigitalWalletTokenListResponse]. + * [DigitalWalletTokenListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [DigitalWalletTokenListResponse]. */ + /** A builder for [DigitalWalletTokenListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,12 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(digitalWalletTokenListResponse: DigitalWalletTokenListResponse) = apply { - data = digitalWalletTokenListResponse.data.map { it.toMutableList() } - nextCursor = digitalWalletTokenListResponse.nextCursor - additionalProperties = - digitalWalletTokenListResponse.additionalProperties.toMutableMap() - } + internal fun from(digitalWalletTokenListPageResponse: DigitalWalletTokenListPageResponse) = + apply { + data = digitalWalletTokenListPageResponse.data.map { it.toMutableList() } + nextCursor = digitalWalletTokenListPageResponse.nextCursor + additionalProperties = + digitalWalletTokenListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -171,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [DigitalWalletTokenListResponse]. + * Returns an immutable instance of [DigitalWalletTokenListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -183,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): DigitalWalletTokenListResponse = - DigitalWalletTokenListResponse( + fun build(): DigitalWalletTokenListPageResponse = + DigitalWalletTokenListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -193,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): DigitalWalletTokenListResponse = apply { + fun validate(): DigitalWalletTokenListPageResponse = apply { if (validated) { return@apply } @@ -226,7 +227,7 @@ private constructor( return true } - return other is DigitalWalletTokenListResponse && + return other is DigitalWalletTokenListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -237,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "DigitalWalletTokenListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "DigitalWalletTokenListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPage.kt new file mode 100644 index 000000000..43fe262a0 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.documents + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.DocumentService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see DocumentService.list */ +class DocumentListPage +private constructor( + private val service: DocumentService, + private val params: DocumentListParams, + private val response: DocumentListPageResponse, +) : Page { + + /** + * Delegates to [DocumentListPageResponse], but gracefully handles missing data. + * + * @see DocumentListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [DocumentListPageResponse], but gracefully handles missing data. + * + * @see DocumentListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): DocumentListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): DocumentListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): DocumentListParams = params + + /** The response that this page was parsed from. */ + fun response(): DocumentListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [DocumentListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DocumentListPage]. */ + class Builder internal constructor() { + + private var service: DocumentService? = null + private var params: DocumentListParams? = null + private var response: DocumentListPageResponse? = null + + @JvmSynthetic + internal fun from(documentListPage: DocumentListPage) = apply { + service = documentListPage.service + params = documentListPage.params + response = documentListPage.response + } + + fun service(service: DocumentService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: DocumentListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: DocumentListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [DocumentListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DocumentListPage = + DocumentListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DocumentListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "DocumentListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageAsync.kt new file mode 100644 index 000000000..1f25b5f54 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.documents + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.DocumentServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see DocumentServiceAsync.list */ +class DocumentListPageAsync +private constructor( + private val service: DocumentServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: DocumentListParams, + private val response: DocumentListPageResponse, +) : PageAsync { + + /** + * Delegates to [DocumentListPageResponse], but gracefully handles missing data. + * + * @see DocumentListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [DocumentListPageResponse], but gracefully handles missing data. + * + * @see DocumentListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): DocumentListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): DocumentListParams = params + + /** The response that this page was parsed from. */ + fun response(): DocumentListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [DocumentListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DocumentListPageAsync]. */ + class Builder internal constructor() { + + private var service: DocumentServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: DocumentListParams? = null + private var response: DocumentListPageResponse? = null + + @JvmSynthetic + internal fun from(documentListPageAsync: DocumentListPageAsync) = apply { + service = documentListPageAsync.service + streamHandlerExecutor = documentListPageAsync.streamHandlerExecutor + params = documentListPageAsync.params + response = documentListPageAsync.response + } + + fun service(service: DocumentServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: DocumentListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: DocumentListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [DocumentListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DocumentListPageAsync = + DocumentListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DocumentListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "DocumentListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageResponse.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageResponse.kt index 1e47c1724..93f51e96a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/documents/DocumentListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Document objects. */ -class DocumentListResponse +class DocumentListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [DocumentListResponse]. + * Returns a mutable builder for constructing an instance of [DocumentListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [DocumentListResponse]. */ + /** A builder for [DocumentListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(documentListResponse: DocumentListResponse) = apply { - data = documentListResponse.data.map { it.toMutableList() } - nextCursor = documentListResponse.nextCursor - additionalProperties = documentListResponse.additionalProperties.toMutableMap() + internal fun from(documentListPageResponse: DocumentListPageResponse) = apply { + data = documentListPageResponse.data.map { it.toMutableList() } + nextCursor = documentListPageResponse.nextCursor + additionalProperties = documentListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [DocumentListResponse]. + * Returns an immutable instance of [DocumentListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): DocumentListResponse = - DocumentListResponse( + fun build(): DocumentListPageResponse = + DocumentListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): DocumentListResponse = apply { + fun validate(): DocumentListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is DocumentListResponse && + return other is DocumentListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "DocumentListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "DocumentListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListPage.kt new file mode 100644 index 000000000..791ed51fc --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListPage.kt @@ -0,0 +1,131 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.entities + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.EntityService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see EntityService.list */ +class EntityListPage +private constructor( + private val service: EntityService, + private val params: EntityListParams, + private val response: EntityListPageResponse, +) : Page { + + /** + * Delegates to [EntityListPageResponse], but gracefully handles missing data. + * + * @see EntityListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [EntityListPageResponse], but gracefully handles missing data. + * + * @see EntityListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): EntityListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): EntityListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): EntityListParams = params + + /** The response that this page was parsed from. */ + fun response(): EntityListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [EntityListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [EntityListPage]. */ + class Builder internal constructor() { + + private var service: EntityService? = null + private var params: EntityListParams? = null + private var response: EntityListPageResponse? = null + + @JvmSynthetic + internal fun from(entityListPage: EntityListPage) = apply { + service = entityListPage.service + params = entityListPage.params + response = entityListPage.response + } + + fun service(service: EntityService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: EntityListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: EntityListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [EntityListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): EntityListPage = + EntityListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is EntityListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = "EntityListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListPageAsync.kt new file mode 100644 index 000000000..122f55861 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListPageAsync.kt @@ -0,0 +1,145 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.entities + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.EntityServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see EntityServiceAsync.list */ +class EntityListPageAsync +private constructor( + private val service: EntityServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: EntityListParams, + private val response: EntityListPageResponse, +) : PageAsync { + + /** + * Delegates to [EntityListPageResponse], but gracefully handles missing data. + * + * @see EntityListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [EntityListPageResponse], but gracefully handles missing data. + * + * @see EntityListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): EntityListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): EntityListParams = params + + /** The response that this page was parsed from. */ + fun response(): EntityListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [EntityListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [EntityListPageAsync]. */ + class Builder internal constructor() { + + private var service: EntityServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: EntityListParams? = null + private var response: EntityListPageResponse? = null + + @JvmSynthetic + internal fun from(entityListPageAsync: EntityListPageAsync) = apply { + service = entityListPageAsync.service + streamHandlerExecutor = entityListPageAsync.streamHandlerExecutor + params = entityListPageAsync.params + response = entityListPageAsync.response + } + + fun service(service: EntityServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: EntityListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: EntityListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [EntityListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): EntityListPageAsync = + EntityListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is EntityListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "EntityListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListPageResponse.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListPageResponse.kt index ab2f6ad8b..0b14c799f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Entity objects. */ -class EntityListResponse +class EntityListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [EntityListResponse]. + * Returns a mutable builder for constructing an instance of [EntityListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [EntityListResponse]. */ + /** A builder for [EntityListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(entityListResponse: EntityListResponse) = apply { - data = entityListResponse.data.map { it.toMutableList() } - nextCursor = entityListResponse.nextCursor - additionalProperties = entityListResponse.additionalProperties.toMutableMap() + internal fun from(entityListPageResponse: EntityListPageResponse) = apply { + data = entityListPageResponse.data.map { it.toMutableList() } + nextCursor = entityListPageResponse.nextCursor + additionalProperties = entityListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [EntityListResponse]. + * Returns an immutable instance of [EntityListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): EntityListResponse = - EntityListResponse( + fun build(): EntityListPageResponse = + EntityListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): EntityListResponse = apply { + fun validate(): EntityListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is EntityListResponse && + return other is EntityListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EntityListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "EntityListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListPage.kt new file mode 100644 index 000000000..826988ccc --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListPage.kt @@ -0,0 +1,131 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.events + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.EventService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see EventService.list */ +class EventListPage +private constructor( + private val service: EventService, + private val params: EventListParams, + private val response: EventListPageResponse, +) : Page { + + /** + * Delegates to [EventListPageResponse], but gracefully handles missing data. + * + * @see EventListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [EventListPageResponse], but gracefully handles missing data. + * + * @see EventListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): EventListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): EventListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): EventListParams = params + + /** The response that this page was parsed from. */ + fun response(): EventListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [EventListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [EventListPage]. */ + class Builder internal constructor() { + + private var service: EventService? = null + private var params: EventListParams? = null + private var response: EventListPageResponse? = null + + @JvmSynthetic + internal fun from(eventListPage: EventListPage) = apply { + service = eventListPage.service + params = eventListPage.params + response = eventListPage.response + } + + fun service(service: EventService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: EventListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: EventListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [EventListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): EventListPage = + EventListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is EventListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = "EventListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListPageAsync.kt new file mode 100644 index 000000000..141cb4a75 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListPageAsync.kt @@ -0,0 +1,145 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.events + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.EventServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see EventServiceAsync.list */ +class EventListPageAsync +private constructor( + private val service: EventServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: EventListParams, + private val response: EventListPageResponse, +) : PageAsync { + + /** + * Delegates to [EventListPageResponse], but gracefully handles missing data. + * + * @see EventListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [EventListPageResponse], but gracefully handles missing data. + * + * @see EventListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): EventListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): EventListParams = params + + /** The response that this page was parsed from. */ + fun response(): EventListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [EventListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [EventListPageAsync]. */ + class Builder internal constructor() { + + private var service: EventServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: EventListParams? = null + private var response: EventListPageResponse? = null + + @JvmSynthetic + internal fun from(eventListPageAsync: EventListPageAsync) = apply { + service = eventListPageAsync.service + streamHandlerExecutor = eventListPageAsync.streamHandlerExecutor + params = eventListPageAsync.params + response = eventListPageAsync.response + } + + fun service(service: EventServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: EventListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: EventListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [EventListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): EventListPageAsync = + EventListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is EventListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "EventListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListPageResponse.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListPageResponse.kt index ccf493b59..e9745d07e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Event objects. */ -class EventListResponse +class EventListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [EventListResponse]. + * Returns a mutable builder for constructing an instance of [EventListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [EventListResponse]. */ + /** A builder for [EventListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(eventListResponse: EventListResponse) = apply { - data = eventListResponse.data.map { it.toMutableList() } - nextCursor = eventListResponse.nextCursor - additionalProperties = eventListResponse.additionalProperties.toMutableMap() + internal fun from(eventListPageResponse: EventListPageResponse) = apply { + data = eventListPageResponse.data.map { it.toMutableList() } + nextCursor = eventListPageResponse.nextCursor + additionalProperties = eventListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [EventListResponse]. + * Returns an immutable instance of [EventListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): EventListResponse = - EventListResponse( + fun build(): EventListPageResponse = + EventListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): EventListResponse = apply { + fun validate(): EventListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is EventListResponse && + return other is EventListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "EventListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPage.kt new file mode 100644 index 000000000..66719630c --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.eventsubscriptions + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.EventSubscriptionService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see EventSubscriptionService.list */ +class EventSubscriptionListPage +private constructor( + private val service: EventSubscriptionService, + private val params: EventSubscriptionListParams, + private val response: EventSubscriptionListPageResponse, +) : Page { + + /** + * Delegates to [EventSubscriptionListPageResponse], but gracefully handles missing data. + * + * @see EventSubscriptionListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [EventSubscriptionListPageResponse], but gracefully handles missing data. + * + * @see EventSubscriptionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): EventSubscriptionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): EventSubscriptionListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): EventSubscriptionListParams = params + + /** The response that this page was parsed from. */ + fun response(): EventSubscriptionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [EventSubscriptionListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [EventSubscriptionListPage]. */ + class Builder internal constructor() { + + private var service: EventSubscriptionService? = null + private var params: EventSubscriptionListParams? = null + private var response: EventSubscriptionListPageResponse? = null + + @JvmSynthetic + internal fun from(eventSubscriptionListPage: EventSubscriptionListPage) = apply { + service = eventSubscriptionListPage.service + params = eventSubscriptionListPage.params + response = eventSubscriptionListPage.response + } + + fun service(service: EventSubscriptionService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: EventSubscriptionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: EventSubscriptionListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [EventSubscriptionListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): EventSubscriptionListPage = + EventSubscriptionListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is EventSubscriptionListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "EventSubscriptionListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPageAsync.kt new file mode 100644 index 000000000..b6deb1f81 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPageAsync.kt @@ -0,0 +1,151 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.eventsubscriptions + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.EventSubscriptionServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see EventSubscriptionServiceAsync.list */ +class EventSubscriptionListPageAsync +private constructor( + private val service: EventSubscriptionServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: EventSubscriptionListParams, + private val response: EventSubscriptionListPageResponse, +) : PageAsync { + + /** + * Delegates to [EventSubscriptionListPageResponse], but gracefully handles missing data. + * + * @see EventSubscriptionListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [EventSubscriptionListPageResponse], but gracefully handles missing data. + * + * @see EventSubscriptionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): EventSubscriptionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): EventSubscriptionListParams = params + + /** The response that this page was parsed from. */ + fun response(): EventSubscriptionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [EventSubscriptionListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [EventSubscriptionListPageAsync]. */ + class Builder internal constructor() { + + private var service: EventSubscriptionServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: EventSubscriptionListParams? = null + private var response: EventSubscriptionListPageResponse? = null + + @JvmSynthetic + internal fun from(eventSubscriptionListPageAsync: EventSubscriptionListPageAsync) = apply { + service = eventSubscriptionListPageAsync.service + streamHandlerExecutor = eventSubscriptionListPageAsync.streamHandlerExecutor + params = eventSubscriptionListPageAsync.params + response = eventSubscriptionListPageAsync.response + } + + fun service(service: EventSubscriptionServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: EventSubscriptionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: EventSubscriptionListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [EventSubscriptionListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): EventSubscriptionListPageAsync = + EventSubscriptionListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is EventSubscriptionListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "EventSubscriptionListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPageResponse.kt index b0dbfff07..7bb8a523c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Event Subscription objects. */ -class EventSubscriptionListResponse +class EventSubscriptionListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [EventSubscriptionListResponse]. + * [EventSubscriptionListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [EventSubscriptionListResponse]. */ + /** A builder for [EventSubscriptionListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,11 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(eventSubscriptionListResponse: EventSubscriptionListResponse) = apply { - data = eventSubscriptionListResponse.data.map { it.toMutableList() } - nextCursor = eventSubscriptionListResponse.nextCursor - additionalProperties = eventSubscriptionListResponse.additionalProperties.toMutableMap() - } + internal fun from(eventSubscriptionListPageResponse: EventSubscriptionListPageResponse) = + apply { + data = eventSubscriptionListPageResponse.data.map { it.toMutableList() } + nextCursor = eventSubscriptionListPageResponse.nextCursor + additionalProperties = + eventSubscriptionListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -170,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [EventSubscriptionListResponse]. + * Returns an immutable instance of [EventSubscriptionListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -182,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): EventSubscriptionListResponse = - EventSubscriptionListResponse( + fun build(): EventSubscriptionListPageResponse = + EventSubscriptionListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -192,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): EventSubscriptionListResponse = apply { + fun validate(): EventSubscriptionListPageResponse = apply { if (validated) { return@apply } @@ -225,7 +227,7 @@ private constructor( return true } - return other is EventSubscriptionListResponse && + return other is EventSubscriptionListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -236,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "EventSubscriptionListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "EventSubscriptionListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListPage.kt new file mode 100644 index 000000000..7f937393e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListPage.kt @@ -0,0 +1,131 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.exports + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.ExportService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see ExportService.list */ +class ExportListPage +private constructor( + private val service: ExportService, + private val params: ExportListParams, + private val response: ExportListPageResponse, +) : Page { + + /** + * Delegates to [ExportListPageResponse], but gracefully handles missing data. + * + * @see ExportListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [ExportListPageResponse], but gracefully handles missing data. + * + * @see ExportListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): ExportListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): ExportListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): ExportListParams = params + + /** The response that this page was parsed from. */ + fun response(): ExportListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ExportListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ExportListPage]. */ + class Builder internal constructor() { + + private var service: ExportService? = null + private var params: ExportListParams? = null + private var response: ExportListPageResponse? = null + + @JvmSynthetic + internal fun from(exportListPage: ExportListPage) = apply { + service = exportListPage.service + params = exportListPage.params + response = exportListPage.response + } + + fun service(service: ExportService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: ExportListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: ExportListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [ExportListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ExportListPage = + ExportListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ExportListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = "ExportListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListPageAsync.kt new file mode 100644 index 000000000..366c4f8a9 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListPageAsync.kt @@ -0,0 +1,145 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.exports + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.ExportServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see ExportServiceAsync.list */ +class ExportListPageAsync +private constructor( + private val service: ExportServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: ExportListParams, + private val response: ExportListPageResponse, +) : PageAsync { + + /** + * Delegates to [ExportListPageResponse], but gracefully handles missing data. + * + * @see ExportListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [ExportListPageResponse], but gracefully handles missing data. + * + * @see ExportListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): ExportListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): ExportListParams = params + + /** The response that this page was parsed from. */ + fun response(): ExportListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ExportListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ExportListPageAsync]. */ + class Builder internal constructor() { + + private var service: ExportServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: ExportListParams? = null + private var response: ExportListPageResponse? = null + + @JvmSynthetic + internal fun from(exportListPageAsync: ExportListPageAsync) = apply { + service = exportListPageAsync.service + streamHandlerExecutor = exportListPageAsync.streamHandlerExecutor + params = exportListPageAsync.params + response = exportListPageAsync.response + } + + fun service(service: ExportServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: ExportListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: ExportListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [ExportListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ExportListPageAsync = + ExportListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ExportListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "ExportListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListPageResponse.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListPageResponse.kt index 2a7b7b913..224854996 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Export objects. */ -class ExportListResponse +class ExportListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [ExportListResponse]. + * Returns a mutable builder for constructing an instance of [ExportListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [ExportListResponse]. */ + /** A builder for [ExportListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(exportListResponse: ExportListResponse) = apply { - data = exportListResponse.data.map { it.toMutableList() } - nextCursor = exportListResponse.nextCursor - additionalProperties = exportListResponse.additionalProperties.toMutableMap() + internal fun from(exportListPageResponse: ExportListPageResponse) = apply { + data = exportListPageResponse.data.map { it.toMutableList() } + nextCursor = exportListPageResponse.nextCursor + additionalProperties = exportListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [ExportListResponse]. + * Returns an immutable instance of [ExportListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): ExportListResponse = - ExportListResponse( + fun build(): ExportListPageResponse = + ExportListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): ExportListResponse = apply { + fun validate(): ExportListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is ExportListResponse && + return other is ExportListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ExportListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "ExportListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPage.kt new file mode 100644 index 000000000..d1737836c --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.externalaccounts + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.ExternalAccountService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see ExternalAccountService.list */ +class ExternalAccountListPage +private constructor( + private val service: ExternalAccountService, + private val params: ExternalAccountListParams, + private val response: ExternalAccountListPageResponse, +) : Page { + + /** + * Delegates to [ExternalAccountListPageResponse], but gracefully handles missing data. + * + * @see ExternalAccountListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [ExternalAccountListPageResponse], but gracefully handles missing data. + * + * @see ExternalAccountListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): ExternalAccountListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): ExternalAccountListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): ExternalAccountListParams = params + + /** The response that this page was parsed from. */ + fun response(): ExternalAccountListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ExternalAccountListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ExternalAccountListPage]. */ + class Builder internal constructor() { + + private var service: ExternalAccountService? = null + private var params: ExternalAccountListParams? = null + private var response: ExternalAccountListPageResponse? = null + + @JvmSynthetic + internal fun from(externalAccountListPage: ExternalAccountListPage) = apply { + service = externalAccountListPage.service + params = externalAccountListPage.params + response = externalAccountListPage.response + } + + fun service(service: ExternalAccountService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: ExternalAccountListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: ExternalAccountListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [ExternalAccountListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ExternalAccountListPage = + ExternalAccountListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ExternalAccountListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "ExternalAccountListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPageAsync.kt new file mode 100644 index 000000000..116109af3 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.externalaccounts + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.ExternalAccountServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see ExternalAccountServiceAsync.list */ +class ExternalAccountListPageAsync +private constructor( + private val service: ExternalAccountServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: ExternalAccountListParams, + private val response: ExternalAccountListPageResponse, +) : PageAsync { + + /** + * Delegates to [ExternalAccountListPageResponse], but gracefully handles missing data. + * + * @see ExternalAccountListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [ExternalAccountListPageResponse], but gracefully handles missing data. + * + * @see ExternalAccountListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): ExternalAccountListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): ExternalAccountListParams = params + + /** The response that this page was parsed from. */ + fun response(): ExternalAccountListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ExternalAccountListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ExternalAccountListPageAsync]. */ + class Builder internal constructor() { + + private var service: ExternalAccountServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: ExternalAccountListParams? = null + private var response: ExternalAccountListPageResponse? = null + + @JvmSynthetic + internal fun from(externalAccountListPageAsync: ExternalAccountListPageAsync) = apply { + service = externalAccountListPageAsync.service + streamHandlerExecutor = externalAccountListPageAsync.streamHandlerExecutor + params = externalAccountListPageAsync.params + response = externalAccountListPageAsync.response + } + + fun service(service: ExternalAccountServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: ExternalAccountListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: ExternalAccountListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [ExternalAccountListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ExternalAccountListPageAsync = + ExternalAccountListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ExternalAccountListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "ExternalAccountListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPageResponse.kt index 55226923b..a2c30b3ad 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of External Account objects. */ -class ExternalAccountListResponse +class ExternalAccountListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [ExternalAccountListResponse]. + * Returns a mutable builder for constructing an instance of + * [ExternalAccountListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [ExternalAccountListResponse]. */ + /** A builder for [ExternalAccountListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,11 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(externalAccountListResponse: ExternalAccountListResponse) = apply { - data = externalAccountListResponse.data.map { it.toMutableList() } - nextCursor = externalAccountListResponse.nextCursor - additionalProperties = externalAccountListResponse.additionalProperties.toMutableMap() - } + internal fun from(externalAccountListPageResponse: ExternalAccountListPageResponse) = + apply { + data = externalAccountListPageResponse.data.map { it.toMutableList() } + nextCursor = externalAccountListPageResponse.nextCursor + additionalProperties = + externalAccountListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -169,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [ExternalAccountListResponse]. + * Returns an immutable instance of [ExternalAccountListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): ExternalAccountListResponse = - ExternalAccountListResponse( + fun build(): ExternalAccountListPageResponse = + ExternalAccountListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): ExternalAccountListResponse = apply { + fun validate(): ExternalAccountListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +227,7 @@ private constructor( return true } - return other is ExternalAccountListResponse && + return other is ExternalAccountListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ExternalAccountListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "ExternalAccountListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPage.kt new file mode 100644 index 000000000..d0e10bbdb --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.FednowTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see FednowTransferService.list */ +class FednowTransferListPage +private constructor( + private val service: FednowTransferService, + private val params: FednowTransferListParams, + private val response: FednowTransferListPageResponse, +) : Page { + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): FednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): FednowTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): FednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): FednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferListPage]. */ + class Builder internal constructor() { + + private var service: FednowTransferService? = null + private var params: FednowTransferListParams? = null + private var response: FednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(fednowTransferListPage: FednowTransferListPage) = apply { + service = fednowTransferListPage.service + params = fednowTransferListPage.params + response = fednowTransferListPage.response + } + + fun service(service: FednowTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: FednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: FednowTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [FednowTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransferListPage = + FednowTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "FednowTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageAsync.kt new file mode 100644 index 000000000..c8812f290 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.FednowTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see FednowTransferServiceAsync.list */ +class FednowTransferListPageAsync +private constructor( + private val service: FednowTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: FednowTransferListParams, + private val response: FednowTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): FednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): FednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): FednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: FednowTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: FednowTransferListParams? = null + private var response: FednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(fednowTransferListPageAsync: FednowTransferListPageAsync) = apply { + service = fednowTransferListPageAsync.service + streamHandlerExecutor = fednowTransferListPageAsync.streamHandlerExecutor + params = fednowTransferListPageAsync.params + response = fednowTransferListPageAsync.response + } + + fun service(service: FednowTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: FednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: FednowTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [FednowTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransferListPageAsync = + FednowTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "FednowTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponse.kt index 5072ac3f6..42b40ec21 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of FedNow Transfer objects. */ -class FednowTransferListResponse +class FednowTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [FednowTransferListResponse]. + * Returns a mutable builder for constructing an instance of + * [FednowTransferListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [FednowTransferListResponse]. */ + /** A builder for [FednowTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,10 +103,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(fednowTransferListResponse: FednowTransferListResponse) = apply { - data = fednowTransferListResponse.data.map { it.toMutableList() } - nextCursor = fednowTransferListResponse.nextCursor - additionalProperties = fednowTransferListResponse.additionalProperties.toMutableMap() + internal fun from(fednowTransferListPageResponse: FednowTransferListPageResponse) = apply { + data = fednowTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = fednowTransferListPageResponse.nextCursor + additionalProperties = + fednowTransferListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -169,7 +171,7 @@ private constructor( } /** - * Returns an immutable instance of [FednowTransferListResponse]. + * Returns an immutable instance of [FednowTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +183,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): FednowTransferListResponse = - FednowTransferListResponse( + fun build(): FednowTransferListPageResponse = + FednowTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +193,7 @@ private constructor( private var validated: Boolean = false - fun validate(): FednowTransferListResponse = apply { + fun validate(): FednowTransferListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +226,7 @@ private constructor( return true } - return other is FednowTransferListResponse && + return other is FednowTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +237,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "FednowTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "FednowTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListPage.kt new file mode 100644 index 000000000..6980ae048 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListPage.kt @@ -0,0 +1,131 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.files + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.FileService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see FileService.list */ +class FileListPage +private constructor( + private val service: FileService, + private val params: FileListParams, + private val response: FileListPageResponse, +) : Page { + + /** + * Delegates to [FileListPageResponse], but gracefully handles missing data. + * + * @see FileListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [FileListPageResponse], but gracefully handles missing data. + * + * @see FileListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): FileListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): FileListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): FileListParams = params + + /** The response that this page was parsed from. */ + fun response(): FileListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FileListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FileListPage]. */ + class Builder internal constructor() { + + private var service: FileService? = null + private var params: FileListParams? = null + private var response: FileListPageResponse? = null + + @JvmSynthetic + internal fun from(fileListPage: FileListPage) = apply { + service = fileListPage.service + params = fileListPage.params + response = fileListPage.response + } + + fun service(service: FileService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: FileListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: FileListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [FileListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FileListPage = + FileListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FileListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = "FileListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListPageAsync.kt new file mode 100644 index 000000000..1b7d4a96a --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListPageAsync.kt @@ -0,0 +1,145 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.files + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.FileServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see FileServiceAsync.list */ +class FileListPageAsync +private constructor( + private val service: FileServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: FileListParams, + private val response: FileListPageResponse, +) : PageAsync { + + /** + * Delegates to [FileListPageResponse], but gracefully handles missing data. + * + * @see FileListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [FileListPageResponse], but gracefully handles missing data. + * + * @see FileListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): FileListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): FileListParams = params + + /** The response that this page was parsed from. */ + fun response(): FileListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FileListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FileListPageAsync]. */ + class Builder internal constructor() { + + private var service: FileServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: FileListParams? = null + private var response: FileListPageResponse? = null + + @JvmSynthetic + internal fun from(fileListPageAsync: FileListPageAsync) = apply { + service = fileListPageAsync.service + streamHandlerExecutor = fileListPageAsync.streamHandlerExecutor + params = fileListPageAsync.params + response = fileListPageAsync.response + } + + fun service(service: FileServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: FileListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: FileListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [FileListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FileListPageAsync = + FileListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FileListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "FileListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListPageResponse.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListPageResponse.kt index a64201fb5..d19d77aa3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/files/FileListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of File objects. */ -class FileListResponse +class FileListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [FileListResponse]. + * Returns a mutable builder for constructing an instance of [FileListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [FileListResponse]. */ + /** A builder for [FileListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(fileListResponse: FileListResponse) = apply { - data = fileListResponse.data.map { it.toMutableList() } - nextCursor = fileListResponse.nextCursor - additionalProperties = fileListResponse.additionalProperties.toMutableMap() + internal fun from(fileListPageResponse: FileListPageResponse) = apply { + data = fileListPageResponse.data.map { it.toMutableList() } + nextCursor = fileListPageResponse.nextCursor + additionalProperties = fileListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -166,7 +166,7 @@ private constructor( } /** - * Returns an immutable instance of [FileListResponse]. + * Returns an immutable instance of [FileListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -178,8 +178,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): FileListResponse = - FileListResponse( + fun build(): FileListPageResponse = + FileListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -188,7 +188,7 @@ private constructor( private var validated: Boolean = false - fun validate(): FileListResponse = apply { + fun validate(): FileListPageResponse = apply { if (validated) { return@apply } @@ -221,7 +221,7 @@ private constructor( return true } - return other is FileListResponse && + return other is FileListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -232,5 +232,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "FileListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "FileListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPage.kt new file mode 100644 index 000000000..744338c48 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundachtransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.InboundAchTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see InboundAchTransferService.list */ +class InboundAchTransferListPage +private constructor( + private val service: InboundAchTransferService, + private val params: InboundAchTransferListParams, + private val response: InboundAchTransferListPageResponse, +) : Page { + + /** + * Delegates to [InboundAchTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundAchTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundAchTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundAchTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundAchTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): InboundAchTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): InboundAchTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundAchTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [InboundAchTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundAchTransferListPage]. */ + class Builder internal constructor() { + + private var service: InboundAchTransferService? = null + private var params: InboundAchTransferListParams? = null + private var response: InboundAchTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundAchTransferListPage: InboundAchTransferListPage) = apply { + service = inboundAchTransferListPage.service + params = inboundAchTransferListPage.params + response = inboundAchTransferListPage.response + } + + fun service(service: InboundAchTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: InboundAchTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundAchTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundAchTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundAchTransferListPage = + InboundAchTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundAchTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "InboundAchTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPageAsync.kt new file mode 100644 index 000000000..72fa30da6 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundachtransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.InboundAchTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see InboundAchTransferServiceAsync.list */ +class InboundAchTransferListPageAsync +private constructor( + private val service: InboundAchTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: InboundAchTransferListParams, + private val response: InboundAchTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [InboundAchTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundAchTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundAchTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundAchTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundAchTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): InboundAchTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundAchTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundAchTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundAchTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: InboundAchTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: InboundAchTransferListParams? = null + private var response: InboundAchTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundAchTransferListPageAsync: InboundAchTransferListPageAsync) = + apply { + service = inboundAchTransferListPageAsync.service + streamHandlerExecutor = inboundAchTransferListPageAsync.streamHandlerExecutor + params = inboundAchTransferListPageAsync.params + response = inboundAchTransferListPageAsync.response + } + + fun service(service: InboundAchTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: InboundAchTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundAchTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundAchTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundAchTransferListPageAsync = + InboundAchTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundAchTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "InboundAchTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPageResponse.kt similarity index 88% rename from increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPageResponse.kt index c56651038..9d5c71ce5 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Inbound ACH Transfer objects. */ -class InboundAchTransferListResponse +class InboundAchTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InboundAchTransferListResponse]. + * [InboundAchTransferListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InboundAchTransferListResponse]. */ + /** A builder for [InboundAchTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,12 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(inboundAchTransferListResponse: InboundAchTransferListResponse) = apply { - data = inboundAchTransferListResponse.data.map { it.toMutableList() } - nextCursor = inboundAchTransferListResponse.nextCursor - additionalProperties = - inboundAchTransferListResponse.additionalProperties.toMutableMap() - } + internal fun from(inboundAchTransferListPageResponse: InboundAchTransferListPageResponse) = + apply { + data = inboundAchTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = inboundAchTransferListPageResponse.nextCursor + additionalProperties = + inboundAchTransferListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -171,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [InboundAchTransferListResponse]. + * Returns an immutable instance of [InboundAchTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -183,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InboundAchTransferListResponse = - InboundAchTransferListResponse( + fun build(): InboundAchTransferListPageResponse = + InboundAchTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -193,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): InboundAchTransferListResponse = apply { + fun validate(): InboundAchTransferListPageResponse = apply { if (validated) { return@apply } @@ -226,7 +227,7 @@ private constructor( return true } - return other is InboundAchTransferListResponse && + return other is InboundAchTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -237,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InboundAchTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "InboundAchTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPage.kt new file mode 100644 index 000000000..2a637fa54 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundcheckdeposits + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.InboundCheckDepositService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see InboundCheckDepositService.list */ +class InboundCheckDepositListPage +private constructor( + private val service: InboundCheckDepositService, + private val params: InboundCheckDepositListParams, + private val response: InboundCheckDepositListPageResponse, +) : Page { + + /** + * Delegates to [InboundCheckDepositListPageResponse], but gracefully handles missing data. + * + * @see InboundCheckDepositListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundCheckDepositListPageResponse], but gracefully handles missing data. + * + * @see InboundCheckDepositListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundCheckDepositListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): InboundCheckDepositListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): InboundCheckDepositListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundCheckDepositListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [InboundCheckDepositListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundCheckDepositListPage]. */ + class Builder internal constructor() { + + private var service: InboundCheckDepositService? = null + private var params: InboundCheckDepositListParams? = null + private var response: InboundCheckDepositListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundCheckDepositListPage: InboundCheckDepositListPage) = apply { + service = inboundCheckDepositListPage.service + params = inboundCheckDepositListPage.params + response = inboundCheckDepositListPage.response + } + + fun service(service: InboundCheckDepositService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: InboundCheckDepositListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundCheckDepositListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundCheckDepositListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundCheckDepositListPage = + InboundCheckDepositListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundCheckDepositListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "InboundCheckDepositListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPageAsync.kt new file mode 100644 index 000000000..37b80f74e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundcheckdeposits + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.InboundCheckDepositServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see InboundCheckDepositServiceAsync.list */ +class InboundCheckDepositListPageAsync +private constructor( + private val service: InboundCheckDepositServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: InboundCheckDepositListParams, + private val response: InboundCheckDepositListPageResponse, +) : PageAsync { + + /** + * Delegates to [InboundCheckDepositListPageResponse], but gracefully handles missing data. + * + * @see InboundCheckDepositListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundCheckDepositListPageResponse], but gracefully handles missing data. + * + * @see InboundCheckDepositListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundCheckDepositListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): InboundCheckDepositListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundCheckDepositListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundCheckDepositListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundCheckDepositListPageAsync]. */ + class Builder internal constructor() { + + private var service: InboundCheckDepositServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: InboundCheckDepositListParams? = null + private var response: InboundCheckDepositListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundCheckDepositListPageAsync: InboundCheckDepositListPageAsync) = + apply { + service = inboundCheckDepositListPageAsync.service + streamHandlerExecutor = inboundCheckDepositListPageAsync.streamHandlerExecutor + params = inboundCheckDepositListPageAsync.params + response = inboundCheckDepositListPageAsync.response + } + + fun service(service: InboundCheckDepositServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: InboundCheckDepositListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundCheckDepositListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundCheckDepositListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundCheckDepositListPageAsync = + InboundCheckDepositListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundCheckDepositListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "InboundCheckDepositListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPageResponse.kt index 8b268c04c..21382c712 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Inbound Check Deposit objects. */ -class InboundCheckDepositListResponse +class InboundCheckDepositListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InboundCheckDepositListResponse]. + * [InboundCheckDepositListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InboundCheckDepositListResponse]. */ + /** A builder for [InboundCheckDepositListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,13 +103,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(inboundCheckDepositListResponse: InboundCheckDepositListResponse) = - apply { - data = inboundCheckDepositListResponse.data.map { it.toMutableList() } - nextCursor = inboundCheckDepositListResponse.nextCursor - additionalProperties = - inboundCheckDepositListResponse.additionalProperties.toMutableMap() - } + internal fun from( + inboundCheckDepositListPageResponse: InboundCheckDepositListPageResponse + ) = apply { + data = inboundCheckDepositListPageResponse.data.map { it.toMutableList() } + nextCursor = inboundCheckDepositListPageResponse.nextCursor + additionalProperties = + inboundCheckDepositListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -172,7 +173,7 @@ private constructor( } /** - * Returns an immutable instance of [InboundCheckDepositListResponse]. + * Returns an immutable instance of [InboundCheckDepositListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -184,8 +185,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InboundCheckDepositListResponse = - InboundCheckDepositListResponse( + fun build(): InboundCheckDepositListPageResponse = + InboundCheckDepositListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -194,7 +195,7 @@ private constructor( private var validated: Boolean = false - fun validate(): InboundCheckDepositListResponse = apply { + fun validate(): InboundCheckDepositListPageResponse = apply { if (validated) { return@apply } @@ -227,7 +228,7 @@ private constructor( return true } - return other is InboundCheckDepositListResponse && + return other is InboundCheckDepositListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -238,5 +239,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InboundCheckDepositListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "InboundCheckDepositListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPage.kt new file mode 100644 index 000000000..88d87e5d4 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPage.kt @@ -0,0 +1,136 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.InboundFednowTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see InboundFednowTransferService.list */ +class InboundFednowTransferListPage +private constructor( + private val service: InboundFednowTransferService, + private val params: InboundFednowTransferListParams, + private val response: InboundFednowTransferListPageResponse, +) : Page { + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundFednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): InboundFednowTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): InboundFednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundFednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferListPage]. */ + class Builder internal constructor() { + + private var service: InboundFednowTransferService? = null + private var params: InboundFednowTransferListParams? = null + private var response: InboundFednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundFednowTransferListPage: InboundFednowTransferListPage) = apply { + service = inboundFednowTransferListPage.service + params = inboundFednowTransferListPage.params + response = inboundFednowTransferListPage.response + } + + fun service(service: InboundFednowTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: InboundFednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundFednowTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundFednowTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransferListPage = + InboundFednowTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "InboundFednowTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageAsync.kt new file mode 100644 index 000000000..95c6b183e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.InboundFednowTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see InboundFednowTransferServiceAsync.list */ +class InboundFednowTransferListPageAsync +private constructor( + private val service: InboundFednowTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: InboundFednowTransferListParams, + private val response: InboundFednowTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundFednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): InboundFednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundFednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: InboundFednowTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: InboundFednowTransferListParams? = null + private var response: InboundFednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundFednowTransferListPageAsync: InboundFednowTransferListPageAsync) = + apply { + service = inboundFednowTransferListPageAsync.service + streamHandlerExecutor = inboundFednowTransferListPageAsync.streamHandlerExecutor + params = inboundFednowTransferListPageAsync.params + response = inboundFednowTransferListPageAsync.response + } + + fun service(service: InboundFednowTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: InboundFednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundFednowTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundFednowTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransferListPageAsync = + InboundFednowTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "InboundFednowTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponse.kt index 1fe58407c..7ba304261 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Inbound FedNow Transfer objects. */ -class InboundFednowTransferListResponse +class InboundFednowTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InboundFednowTransferListResponse]. + * [InboundFednowTransferListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InboundFednowTransferListResponse]. */ + /** A builder for [InboundFednowTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,13 +103,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(inboundFednowTransferListResponse: InboundFednowTransferListResponse) = - apply { - data = inboundFednowTransferListResponse.data.map { it.toMutableList() } - nextCursor = inboundFednowTransferListResponse.nextCursor - additionalProperties = - inboundFednowTransferListResponse.additionalProperties.toMutableMap() - } + internal fun from( + inboundFednowTransferListPageResponse: InboundFednowTransferListPageResponse + ) = apply { + data = inboundFednowTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = inboundFednowTransferListPageResponse.nextCursor + additionalProperties = + inboundFednowTransferListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -172,7 +173,7 @@ private constructor( } /** - * Returns an immutable instance of [InboundFednowTransferListResponse]. + * Returns an immutable instance of [InboundFednowTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -184,8 +185,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InboundFednowTransferListResponse = - InboundFednowTransferListResponse( + fun build(): InboundFednowTransferListPageResponse = + InboundFednowTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -194,7 +195,7 @@ private constructor( private var validated: Boolean = false - fun validate(): InboundFednowTransferListResponse = apply { + fun validate(): InboundFednowTransferListPageResponse = apply { if (validated) { return@apply } @@ -227,7 +228,7 @@ private constructor( return true } - return other is InboundFednowTransferListResponse && + return other is InboundFednowTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -238,5 +239,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InboundFednowTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "InboundFednowTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPage.kt new file mode 100644 index 000000000..c31f2b7b9 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundmailitems + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.InboundMailItemService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see InboundMailItemService.list */ +class InboundMailItemListPage +private constructor( + private val service: InboundMailItemService, + private val params: InboundMailItemListParams, + private val response: InboundMailItemListPageResponse, +) : Page { + + /** + * Delegates to [InboundMailItemListPageResponse], but gracefully handles missing data. + * + * @see InboundMailItemListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundMailItemListPageResponse], but gracefully handles missing data. + * + * @see InboundMailItemListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundMailItemListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): InboundMailItemListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): InboundMailItemListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundMailItemListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [InboundMailItemListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundMailItemListPage]. */ + class Builder internal constructor() { + + private var service: InboundMailItemService? = null + private var params: InboundMailItemListParams? = null + private var response: InboundMailItemListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundMailItemListPage: InboundMailItemListPage) = apply { + service = inboundMailItemListPage.service + params = inboundMailItemListPage.params + response = inboundMailItemListPage.response + } + + fun service(service: InboundMailItemService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: InboundMailItemListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundMailItemListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [InboundMailItemListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundMailItemListPage = + InboundMailItemListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundMailItemListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "InboundMailItemListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageAsync.kt new file mode 100644 index 000000000..fd626951e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundmailitems + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.InboundMailItemServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see InboundMailItemServiceAsync.list */ +class InboundMailItemListPageAsync +private constructor( + private val service: InboundMailItemServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: InboundMailItemListParams, + private val response: InboundMailItemListPageResponse, +) : PageAsync { + + /** + * Delegates to [InboundMailItemListPageResponse], but gracefully handles missing data. + * + * @see InboundMailItemListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundMailItemListPageResponse], but gracefully handles missing data. + * + * @see InboundMailItemListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundMailItemListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): InboundMailItemListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundMailItemListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [InboundMailItemListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundMailItemListPageAsync]. */ + class Builder internal constructor() { + + private var service: InboundMailItemServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: InboundMailItemListParams? = null + private var response: InboundMailItemListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundMailItemListPageAsync: InboundMailItemListPageAsync) = apply { + service = inboundMailItemListPageAsync.service + streamHandlerExecutor = inboundMailItemListPageAsync.streamHandlerExecutor + params = inboundMailItemListPageAsync.params + response = inboundMailItemListPageAsync.response + } + + fun service(service: InboundMailItemServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: InboundMailItemListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundMailItemListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [InboundMailItemListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundMailItemListPageAsync = + InboundMailItemListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundMailItemListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "InboundMailItemListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponse.kt index 3c30dd73b..71b62bea8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Inbound Mail Item objects. */ -class InboundMailItemListResponse +class InboundMailItemListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [InboundMailItemListResponse]. + * Returns a mutable builder for constructing an instance of + * [InboundMailItemListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InboundMailItemListResponse]. */ + /** A builder for [InboundMailItemListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,11 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(inboundMailItemListResponse: InboundMailItemListResponse) = apply { - data = inboundMailItemListResponse.data.map { it.toMutableList() } - nextCursor = inboundMailItemListResponse.nextCursor - additionalProperties = inboundMailItemListResponse.additionalProperties.toMutableMap() - } + internal fun from(inboundMailItemListPageResponse: InboundMailItemListPageResponse) = + apply { + data = inboundMailItemListPageResponse.data.map { it.toMutableList() } + nextCursor = inboundMailItemListPageResponse.nextCursor + additionalProperties = + inboundMailItemListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -169,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [InboundMailItemListResponse]. + * Returns an immutable instance of [InboundMailItemListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InboundMailItemListResponse = - InboundMailItemListResponse( + fun build(): InboundMailItemListPageResponse = + InboundMailItemListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): InboundMailItemListResponse = apply { + fun validate(): InboundMailItemListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +227,7 @@ private constructor( return true } - return other is InboundMailItemListResponse && + return other is InboundMailItemListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InboundMailItemListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "InboundMailItemListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPage.kt new file mode 100644 index 000000000..3d0e406c2 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPage.kt @@ -0,0 +1,145 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundrealtimepaymentstransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.InboundRealTimePaymentsTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see InboundRealTimePaymentsTransferService.list */ +class InboundRealTimePaymentsTransferListPage +private constructor( + private val service: InboundRealTimePaymentsTransferService, + private val params: InboundRealTimePaymentsTransferListParams, + private val response: InboundRealTimePaymentsTransferListPageResponse, +) : Page { + + /** + * Delegates to [InboundRealTimePaymentsTransferListPageResponse], but gracefully handles + * missing data. + * + * @see InboundRealTimePaymentsTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundRealTimePaymentsTransferListPageResponse], but gracefully handles + * missing data. + * + * @see InboundRealTimePaymentsTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundRealTimePaymentsTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): InboundRealTimePaymentsTransferListPage = + service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): InboundRealTimePaymentsTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundRealTimePaymentsTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundRealTimePaymentsTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundRealTimePaymentsTransferListPage]. */ + class Builder internal constructor() { + + private var service: InboundRealTimePaymentsTransferService? = null + private var params: InboundRealTimePaymentsTransferListParams? = null + private var response: InboundRealTimePaymentsTransferListPageResponse? = null + + @JvmSynthetic + internal fun from( + inboundRealTimePaymentsTransferListPage: InboundRealTimePaymentsTransferListPage + ) = apply { + service = inboundRealTimePaymentsTransferListPage.service + params = inboundRealTimePaymentsTransferListPage.params + response = inboundRealTimePaymentsTransferListPage.response + } + + fun service(service: InboundRealTimePaymentsTransferService) = apply { + this.service = service + } + + /** The parameters that were used to request this page. */ + fun params(params: InboundRealTimePaymentsTransferListParams) = apply { + this.params = params + } + + /** The response that this page was parsed from. */ + fun response(response: InboundRealTimePaymentsTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundRealTimePaymentsTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundRealTimePaymentsTransferListPage = + InboundRealTimePaymentsTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundRealTimePaymentsTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "InboundRealTimePaymentsTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPageAsync.kt new file mode 100644 index 000000000..1f48912fc --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPageAsync.kt @@ -0,0 +1,161 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundrealtimepaymentstransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.InboundRealTimePaymentsTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see InboundRealTimePaymentsTransferServiceAsync.list */ +class InboundRealTimePaymentsTransferListPageAsync +private constructor( + private val service: InboundRealTimePaymentsTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: InboundRealTimePaymentsTransferListParams, + private val response: InboundRealTimePaymentsTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [InboundRealTimePaymentsTransferListPageResponse], but gracefully handles + * missing data. + * + * @see InboundRealTimePaymentsTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundRealTimePaymentsTransferListPageResponse], but gracefully handles + * missing data. + * + * @see InboundRealTimePaymentsTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundRealTimePaymentsTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): InboundRealTimePaymentsTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundRealTimePaymentsTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundRealTimePaymentsTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundRealTimePaymentsTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: InboundRealTimePaymentsTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: InboundRealTimePaymentsTransferListParams? = null + private var response: InboundRealTimePaymentsTransferListPageResponse? = null + + @JvmSynthetic + internal fun from( + inboundRealTimePaymentsTransferListPageAsync: + InboundRealTimePaymentsTransferListPageAsync + ) = apply { + service = inboundRealTimePaymentsTransferListPageAsync.service + streamHandlerExecutor = + inboundRealTimePaymentsTransferListPageAsync.streamHandlerExecutor + params = inboundRealTimePaymentsTransferListPageAsync.params + response = inboundRealTimePaymentsTransferListPageAsync.response + } + + fun service(service: InboundRealTimePaymentsTransferServiceAsync) = apply { + this.service = service + } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: InboundRealTimePaymentsTransferListParams) = apply { + this.params = params + } + + /** The response that this page was parsed from. */ + fun response(response: InboundRealTimePaymentsTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundRealTimePaymentsTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundRealTimePaymentsTransferListPageAsync = + InboundRealTimePaymentsTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundRealTimePaymentsTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "InboundRealTimePaymentsTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPageResponse.kt similarity index 88% rename from increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPageResponse.kt index ac0a3219f..8dfaacb78 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Inbound Real-Time Payments Transfer objects. */ -class InboundRealTimePaymentsTransferListResponse +class InboundRealTimePaymentsTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -86,7 +86,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InboundRealTimePaymentsTransferListResponse]. + * [InboundRealTimePaymentsTransferListPageResponse]. * * The following fields are required: * ```java @@ -97,7 +97,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InboundRealTimePaymentsTransferListResponse]. */ + /** A builder for [InboundRealTimePaymentsTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -106,12 +106,13 @@ private constructor( @JvmSynthetic internal fun from( - inboundRealTimePaymentsTransferListResponse: InboundRealTimePaymentsTransferListResponse + inboundRealTimePaymentsTransferListPageResponse: + InboundRealTimePaymentsTransferListPageResponse ) = apply { - data = inboundRealTimePaymentsTransferListResponse.data.map { it.toMutableList() } - nextCursor = inboundRealTimePaymentsTransferListResponse.nextCursor + data = inboundRealTimePaymentsTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = inboundRealTimePaymentsTransferListPageResponse.nextCursor additionalProperties = - inboundRealTimePaymentsTransferListResponse.additionalProperties.toMutableMap() + inboundRealTimePaymentsTransferListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -175,7 +176,7 @@ private constructor( } /** - * Returns an immutable instance of [InboundRealTimePaymentsTransferListResponse]. + * Returns an immutable instance of [InboundRealTimePaymentsTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -187,8 +188,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InboundRealTimePaymentsTransferListResponse = - InboundRealTimePaymentsTransferListResponse( + fun build(): InboundRealTimePaymentsTransferListPageResponse = + InboundRealTimePaymentsTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -197,7 +198,7 @@ private constructor( private var validated: Boolean = false - fun validate(): InboundRealTimePaymentsTransferListResponse = apply { + fun validate(): InboundRealTimePaymentsTransferListPageResponse = apply { if (validated) { return@apply } @@ -230,7 +231,7 @@ private constructor( return true } - return other is InboundRealTimePaymentsTransferListResponse && + return other is InboundRealTimePaymentsTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -241,5 +242,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InboundRealTimePaymentsTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "InboundRealTimePaymentsTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPage.kt new file mode 100644 index 000000000..30b8e63fa --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPage.kt @@ -0,0 +1,139 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundwiredrawdownrequests + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.InboundWireDrawdownRequestService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see InboundWireDrawdownRequestService.list */ +class InboundWireDrawdownRequestListPage +private constructor( + private val service: InboundWireDrawdownRequestService, + private val params: InboundWireDrawdownRequestListParams, + private val response: InboundWireDrawdownRequestListPageResponse, +) : Page { + + /** + * Delegates to [InboundWireDrawdownRequestListPageResponse], but gracefully handles missing + * data. + * + * @see InboundWireDrawdownRequestListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundWireDrawdownRequestListPageResponse], but gracefully handles missing + * data. + * + * @see InboundWireDrawdownRequestListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundWireDrawdownRequestListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): InboundWireDrawdownRequestListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): InboundWireDrawdownRequestListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundWireDrawdownRequestListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundWireDrawdownRequestListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundWireDrawdownRequestListPage]. */ + class Builder internal constructor() { + + private var service: InboundWireDrawdownRequestService? = null + private var params: InboundWireDrawdownRequestListParams? = null + private var response: InboundWireDrawdownRequestListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundWireDrawdownRequestListPage: InboundWireDrawdownRequestListPage) = + apply { + service = inboundWireDrawdownRequestListPage.service + params = inboundWireDrawdownRequestListPage.params + response = inboundWireDrawdownRequestListPage.response + } + + fun service(service: InboundWireDrawdownRequestService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: InboundWireDrawdownRequestListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundWireDrawdownRequestListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundWireDrawdownRequestListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundWireDrawdownRequestListPage = + InboundWireDrawdownRequestListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundWireDrawdownRequestListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "InboundWireDrawdownRequestListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPageAsync.kt new file mode 100644 index 000000000..c5072493c --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPageAsync.kt @@ -0,0 +1,157 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundwiredrawdownrequests + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.InboundWireDrawdownRequestServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see InboundWireDrawdownRequestServiceAsync.list */ +class InboundWireDrawdownRequestListPageAsync +private constructor( + private val service: InboundWireDrawdownRequestServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: InboundWireDrawdownRequestListParams, + private val response: InboundWireDrawdownRequestListPageResponse, +) : PageAsync { + + /** + * Delegates to [InboundWireDrawdownRequestListPageResponse], but gracefully handles missing + * data. + * + * @see InboundWireDrawdownRequestListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundWireDrawdownRequestListPageResponse], but gracefully handles missing + * data. + * + * @see InboundWireDrawdownRequestListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundWireDrawdownRequestListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): InboundWireDrawdownRequestListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundWireDrawdownRequestListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundWireDrawdownRequestListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundWireDrawdownRequestListPageAsync]. */ + class Builder internal constructor() { + + private var service: InboundWireDrawdownRequestServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: InboundWireDrawdownRequestListParams? = null + private var response: InboundWireDrawdownRequestListPageResponse? = null + + @JvmSynthetic + internal fun from( + inboundWireDrawdownRequestListPageAsync: InboundWireDrawdownRequestListPageAsync + ) = apply { + service = inboundWireDrawdownRequestListPageAsync.service + streamHandlerExecutor = inboundWireDrawdownRequestListPageAsync.streamHandlerExecutor + params = inboundWireDrawdownRequestListPageAsync.params + response = inboundWireDrawdownRequestListPageAsync.response + } + + fun service(service: InboundWireDrawdownRequestServiceAsync) = apply { + this.service = service + } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: InboundWireDrawdownRequestListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundWireDrawdownRequestListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundWireDrawdownRequestListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundWireDrawdownRequestListPageAsync = + InboundWireDrawdownRequestListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundWireDrawdownRequestListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "InboundWireDrawdownRequestListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPageResponse.kt index a059de1c2..0694fbae6 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Inbound Wire Drawdown Request objects. */ -class InboundWireDrawdownRequestListResponse +class InboundWireDrawdownRequestListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -86,7 +86,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InboundWireDrawdownRequestListResponse]. + * [InboundWireDrawdownRequestListPageResponse]. * * The following fields are required: * ```java @@ -97,7 +97,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InboundWireDrawdownRequestListResponse]. */ + /** A builder for [InboundWireDrawdownRequestListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -106,12 +106,12 @@ private constructor( @JvmSynthetic internal fun from( - inboundWireDrawdownRequestListResponse: InboundWireDrawdownRequestListResponse + inboundWireDrawdownRequestListPageResponse: InboundWireDrawdownRequestListPageResponse ) = apply { - data = inboundWireDrawdownRequestListResponse.data.map { it.toMutableList() } - nextCursor = inboundWireDrawdownRequestListResponse.nextCursor + data = inboundWireDrawdownRequestListPageResponse.data.map { it.toMutableList() } + nextCursor = inboundWireDrawdownRequestListPageResponse.nextCursor additionalProperties = - inboundWireDrawdownRequestListResponse.additionalProperties.toMutableMap() + inboundWireDrawdownRequestListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -175,7 +175,7 @@ private constructor( } /** - * Returns an immutable instance of [InboundWireDrawdownRequestListResponse]. + * Returns an immutable instance of [InboundWireDrawdownRequestListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -187,8 +187,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InboundWireDrawdownRequestListResponse = - InboundWireDrawdownRequestListResponse( + fun build(): InboundWireDrawdownRequestListPageResponse = + InboundWireDrawdownRequestListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -197,7 +197,7 @@ private constructor( private var validated: Boolean = false - fun validate(): InboundWireDrawdownRequestListResponse = apply { + fun validate(): InboundWireDrawdownRequestListPageResponse = apply { if (validated) { return@apply } @@ -230,7 +230,7 @@ private constructor( return true } - return other is InboundWireDrawdownRequestListResponse && + return other is InboundWireDrawdownRequestListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -241,5 +241,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InboundWireDrawdownRequestListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "InboundWireDrawdownRequestListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPage.kt new file mode 100644 index 000000000..c6515db06 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundwiretransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.InboundWireTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see InboundWireTransferService.list */ +class InboundWireTransferListPage +private constructor( + private val service: InboundWireTransferService, + private val params: InboundWireTransferListParams, + private val response: InboundWireTransferListPageResponse, +) : Page { + + /** + * Delegates to [InboundWireTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundWireTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundWireTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundWireTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundWireTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): InboundWireTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): InboundWireTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundWireTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [InboundWireTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundWireTransferListPage]. */ + class Builder internal constructor() { + + private var service: InboundWireTransferService? = null + private var params: InboundWireTransferListParams? = null + private var response: InboundWireTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundWireTransferListPage: InboundWireTransferListPage) = apply { + service = inboundWireTransferListPage.service + params = inboundWireTransferListPage.params + response = inboundWireTransferListPage.response + } + + fun service(service: InboundWireTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: InboundWireTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundWireTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundWireTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundWireTransferListPage = + InboundWireTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundWireTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "InboundWireTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPageAsync.kt new file mode 100644 index 000000000..9cfcb91d5 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundwiretransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.InboundWireTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see InboundWireTransferServiceAsync.list */ +class InboundWireTransferListPageAsync +private constructor( + private val service: InboundWireTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: InboundWireTransferListParams, + private val response: InboundWireTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [InboundWireTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundWireTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundWireTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundWireTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundWireTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): InboundWireTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundWireTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundWireTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundWireTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: InboundWireTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: InboundWireTransferListParams? = null + private var response: InboundWireTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundWireTransferListPageAsync: InboundWireTransferListPageAsync) = + apply { + service = inboundWireTransferListPageAsync.service + streamHandlerExecutor = inboundWireTransferListPageAsync.streamHandlerExecutor + params = inboundWireTransferListPageAsync.params + response = inboundWireTransferListPageAsync.response + } + + fun service(service: InboundWireTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: InboundWireTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundWireTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundWireTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundWireTransferListPageAsync = + InboundWireTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundWireTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "InboundWireTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPageResponse.kt index 900fb89c2..9a819fa83 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Inbound Wire Transfer objects. */ -class InboundWireTransferListResponse +class InboundWireTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InboundWireTransferListResponse]. + * [InboundWireTransferListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [InboundWireTransferListResponse]. */ + /** A builder for [InboundWireTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,13 +103,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(inboundWireTransferListResponse: InboundWireTransferListResponse) = - apply { - data = inboundWireTransferListResponse.data.map { it.toMutableList() } - nextCursor = inboundWireTransferListResponse.nextCursor - additionalProperties = - inboundWireTransferListResponse.additionalProperties.toMutableMap() - } + internal fun from( + inboundWireTransferListPageResponse: InboundWireTransferListPageResponse + ) = apply { + data = inboundWireTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = inboundWireTransferListPageResponse.nextCursor + additionalProperties = + inboundWireTransferListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -172,7 +173,7 @@ private constructor( } /** - * Returns an immutable instance of [InboundWireTransferListResponse]. + * Returns an immutable instance of [InboundWireTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -184,8 +185,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): InboundWireTransferListResponse = - InboundWireTransferListResponse( + fun build(): InboundWireTransferListPageResponse = + InboundWireTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -194,7 +195,7 @@ private constructor( private var validated: Boolean = false - fun validate(): InboundWireTransferListResponse = apply { + fun validate(): InboundWireTransferListPageResponse = apply { if (validated) { return@apply } @@ -227,7 +228,7 @@ private constructor( return true } - return other is InboundWireTransferListResponse && + return other is InboundWireTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -238,5 +239,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "InboundWireTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "InboundWireTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPage.kt new file mode 100644 index 000000000..f39354f51 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPage.kt @@ -0,0 +1,137 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.intrafiaccountenrollments + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.IntrafiAccountEnrollmentService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see IntrafiAccountEnrollmentService.list */ +class IntrafiAccountEnrollmentListPage +private constructor( + private val service: IntrafiAccountEnrollmentService, + private val params: IntrafiAccountEnrollmentListParams, + private val response: IntrafiAccountEnrollmentListPageResponse, +) : Page { + + /** + * Delegates to [IntrafiAccountEnrollmentListPageResponse], but gracefully handles missing data. + * + * @see IntrafiAccountEnrollmentListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [IntrafiAccountEnrollmentListPageResponse], but gracefully handles missing data. + * + * @see IntrafiAccountEnrollmentListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): IntrafiAccountEnrollmentListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): IntrafiAccountEnrollmentListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): IntrafiAccountEnrollmentListParams = params + + /** The response that this page was parsed from. */ + fun response(): IntrafiAccountEnrollmentListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [IntrafiAccountEnrollmentListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [IntrafiAccountEnrollmentListPage]. */ + class Builder internal constructor() { + + private var service: IntrafiAccountEnrollmentService? = null + private var params: IntrafiAccountEnrollmentListParams? = null + private var response: IntrafiAccountEnrollmentListPageResponse? = null + + @JvmSynthetic + internal fun from(intrafiAccountEnrollmentListPage: IntrafiAccountEnrollmentListPage) = + apply { + service = intrafiAccountEnrollmentListPage.service + params = intrafiAccountEnrollmentListPage.params + response = intrafiAccountEnrollmentListPage.response + } + + fun service(service: IntrafiAccountEnrollmentService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: IntrafiAccountEnrollmentListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: IntrafiAccountEnrollmentListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [IntrafiAccountEnrollmentListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): IntrafiAccountEnrollmentListPage = + IntrafiAccountEnrollmentListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is IntrafiAccountEnrollmentListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "IntrafiAccountEnrollmentListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPageAsync.kt new file mode 100644 index 000000000..e86ab9e2f --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPageAsync.kt @@ -0,0 +1,155 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.intrafiaccountenrollments + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.IntrafiAccountEnrollmentServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see IntrafiAccountEnrollmentServiceAsync.list */ +class IntrafiAccountEnrollmentListPageAsync +private constructor( + private val service: IntrafiAccountEnrollmentServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: IntrafiAccountEnrollmentListParams, + private val response: IntrafiAccountEnrollmentListPageResponse, +) : PageAsync { + + /** + * Delegates to [IntrafiAccountEnrollmentListPageResponse], but gracefully handles missing data. + * + * @see IntrafiAccountEnrollmentListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [IntrafiAccountEnrollmentListPageResponse], but gracefully handles missing data. + * + * @see IntrafiAccountEnrollmentListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): IntrafiAccountEnrollmentListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): IntrafiAccountEnrollmentListParams = params + + /** The response that this page was parsed from. */ + fun response(): IntrafiAccountEnrollmentListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [IntrafiAccountEnrollmentListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [IntrafiAccountEnrollmentListPageAsync]. */ + class Builder internal constructor() { + + private var service: IntrafiAccountEnrollmentServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: IntrafiAccountEnrollmentListParams? = null + private var response: IntrafiAccountEnrollmentListPageResponse? = null + + @JvmSynthetic + internal fun from( + intrafiAccountEnrollmentListPageAsync: IntrafiAccountEnrollmentListPageAsync + ) = apply { + service = intrafiAccountEnrollmentListPageAsync.service + streamHandlerExecutor = intrafiAccountEnrollmentListPageAsync.streamHandlerExecutor + params = intrafiAccountEnrollmentListPageAsync.params + response = intrafiAccountEnrollmentListPageAsync.response + } + + fun service(service: IntrafiAccountEnrollmentServiceAsync) = apply { + this.service = service + } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: IntrafiAccountEnrollmentListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: IntrafiAccountEnrollmentListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [IntrafiAccountEnrollmentListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): IntrafiAccountEnrollmentListPageAsync = + IntrafiAccountEnrollmentListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is IntrafiAccountEnrollmentListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "IntrafiAccountEnrollmentListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPageResponse.kt index 4ae9165c3..baa3b0ff3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of IntraFi Account Enrollment objects. */ -class IntrafiAccountEnrollmentListResponse +class IntrafiAccountEnrollmentListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -86,7 +86,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [IntrafiAccountEnrollmentListResponse]. + * [IntrafiAccountEnrollmentListPageResponse]. * * The following fields are required: * ```java @@ -97,7 +97,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [IntrafiAccountEnrollmentListResponse]. */ + /** A builder for [IntrafiAccountEnrollmentListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -106,12 +106,12 @@ private constructor( @JvmSynthetic internal fun from( - intrafiAccountEnrollmentListResponse: IntrafiAccountEnrollmentListResponse + intrafiAccountEnrollmentListPageResponse: IntrafiAccountEnrollmentListPageResponse ) = apply { - data = intrafiAccountEnrollmentListResponse.data.map { it.toMutableList() } - nextCursor = intrafiAccountEnrollmentListResponse.nextCursor + data = intrafiAccountEnrollmentListPageResponse.data.map { it.toMutableList() } + nextCursor = intrafiAccountEnrollmentListPageResponse.nextCursor additionalProperties = - intrafiAccountEnrollmentListResponse.additionalProperties.toMutableMap() + intrafiAccountEnrollmentListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -175,7 +175,7 @@ private constructor( } /** - * Returns an immutable instance of [IntrafiAccountEnrollmentListResponse]. + * Returns an immutable instance of [IntrafiAccountEnrollmentListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -187,8 +187,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): IntrafiAccountEnrollmentListResponse = - IntrafiAccountEnrollmentListResponse( + fun build(): IntrafiAccountEnrollmentListPageResponse = + IntrafiAccountEnrollmentListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -197,7 +197,7 @@ private constructor( private var validated: Boolean = false - fun validate(): IntrafiAccountEnrollmentListResponse = apply { + fun validate(): IntrafiAccountEnrollmentListPageResponse = apply { if (validated) { return@apply } @@ -230,7 +230,7 @@ private constructor( return true } - return other is IntrafiAccountEnrollmentListResponse && + return other is IntrafiAccountEnrollmentListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -241,5 +241,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IntrafiAccountEnrollmentListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "IntrafiAccountEnrollmentListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPage.kt new file mode 100644 index 000000000..5b48cf044 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.intrafiexclusions + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.IntrafiExclusionService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see IntrafiExclusionService.list */ +class IntrafiExclusionListPage +private constructor( + private val service: IntrafiExclusionService, + private val params: IntrafiExclusionListParams, + private val response: IntrafiExclusionListPageResponse, +) : Page { + + /** + * Delegates to [IntrafiExclusionListPageResponse], but gracefully handles missing data. + * + * @see IntrafiExclusionListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [IntrafiExclusionListPageResponse], but gracefully handles missing data. + * + * @see IntrafiExclusionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): IntrafiExclusionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): IntrafiExclusionListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): IntrafiExclusionListParams = params + + /** The response that this page was parsed from. */ + fun response(): IntrafiExclusionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [IntrafiExclusionListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [IntrafiExclusionListPage]. */ + class Builder internal constructor() { + + private var service: IntrafiExclusionService? = null + private var params: IntrafiExclusionListParams? = null + private var response: IntrafiExclusionListPageResponse? = null + + @JvmSynthetic + internal fun from(intrafiExclusionListPage: IntrafiExclusionListPage) = apply { + service = intrafiExclusionListPage.service + params = intrafiExclusionListPage.params + response = intrafiExclusionListPage.response + } + + fun service(service: IntrafiExclusionService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: IntrafiExclusionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: IntrafiExclusionListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [IntrafiExclusionListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): IntrafiExclusionListPage = + IntrafiExclusionListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is IntrafiExclusionListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "IntrafiExclusionListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPageAsync.kt new file mode 100644 index 000000000..403a0ce46 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPageAsync.kt @@ -0,0 +1,151 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.intrafiexclusions + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.IntrafiExclusionServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see IntrafiExclusionServiceAsync.list */ +class IntrafiExclusionListPageAsync +private constructor( + private val service: IntrafiExclusionServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: IntrafiExclusionListParams, + private val response: IntrafiExclusionListPageResponse, +) : PageAsync { + + /** + * Delegates to [IntrafiExclusionListPageResponse], but gracefully handles missing data. + * + * @see IntrafiExclusionListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [IntrafiExclusionListPageResponse], but gracefully handles missing data. + * + * @see IntrafiExclusionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): IntrafiExclusionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): IntrafiExclusionListParams = params + + /** The response that this page was parsed from. */ + fun response(): IntrafiExclusionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [IntrafiExclusionListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [IntrafiExclusionListPageAsync]. */ + class Builder internal constructor() { + + private var service: IntrafiExclusionServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: IntrafiExclusionListParams? = null + private var response: IntrafiExclusionListPageResponse? = null + + @JvmSynthetic + internal fun from(intrafiExclusionListPageAsync: IntrafiExclusionListPageAsync) = apply { + service = intrafiExclusionListPageAsync.service + streamHandlerExecutor = intrafiExclusionListPageAsync.streamHandlerExecutor + params = intrafiExclusionListPageAsync.params + response = intrafiExclusionListPageAsync.response + } + + fun service(service: IntrafiExclusionServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: IntrafiExclusionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: IntrafiExclusionListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [IntrafiExclusionListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): IntrafiExclusionListPageAsync = + IntrafiExclusionListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is IntrafiExclusionListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "IntrafiExclusionListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPageResponse.kt index c799e6ec4..24c9ea4fb 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of IntraFi Exclusion objects. */ -class IntrafiExclusionListResponse +class IntrafiExclusionListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [IntrafiExclusionListResponse]. + * Returns a mutable builder for constructing an instance of + * [IntrafiExclusionListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [IntrafiExclusionListResponse]. */ + /** A builder for [IntrafiExclusionListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,11 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(intrafiExclusionListResponse: IntrafiExclusionListResponse) = apply { - data = intrafiExclusionListResponse.data.map { it.toMutableList() } - nextCursor = intrafiExclusionListResponse.nextCursor - additionalProperties = intrafiExclusionListResponse.additionalProperties.toMutableMap() - } + internal fun from(intrafiExclusionListPageResponse: IntrafiExclusionListPageResponse) = + apply { + data = intrafiExclusionListPageResponse.data.map { it.toMutableList() } + nextCursor = intrafiExclusionListPageResponse.nextCursor + additionalProperties = + intrafiExclusionListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -169,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [IntrafiExclusionListResponse]. + * Returns an immutable instance of [IntrafiExclusionListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): IntrafiExclusionListResponse = - IntrafiExclusionListResponse( + fun build(): IntrafiExclusionListPageResponse = + IntrafiExclusionListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): IntrafiExclusionListResponse = apply { + fun validate(): IntrafiExclusionListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +227,7 @@ private constructor( return true } - return other is IntrafiExclusionListResponse && + return other is IntrafiExclusionListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "IntrafiExclusionListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "IntrafiExclusionListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPage.kt new file mode 100644 index 000000000..ade6e2650 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxes + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.LockboxService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see LockboxService.list */ +class LockboxListPage +private constructor( + private val service: LockboxService, + private val params: LockboxListParams, + private val response: LockboxListPageResponse, +) : Page { + + /** + * Delegates to [LockboxListPageResponse], but gracefully handles missing data. + * + * @see LockboxListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [LockboxListPageResponse], but gracefully handles missing data. + * + * @see LockboxListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): LockboxListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): LockboxListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): LockboxListParams = params + + /** The response that this page was parsed from. */ + fun response(): LockboxListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LockboxListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LockboxListPage]. */ + class Builder internal constructor() { + + private var service: LockboxService? = null + private var params: LockboxListParams? = null + private var response: LockboxListPageResponse? = null + + @JvmSynthetic + internal fun from(lockboxListPage: LockboxListPage) = apply { + service = lockboxListPage.service + params = lockboxListPage.params + response = lockboxListPage.response + } + + fun service(service: LockboxService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: LockboxListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: LockboxListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [LockboxListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LockboxListPage = + LockboxListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LockboxListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "LockboxListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageAsync.kt new file mode 100644 index 000000000..10e81908f --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.lockboxes + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.LockboxServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see LockboxServiceAsync.list */ +class LockboxListPageAsync +private constructor( + private val service: LockboxServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: LockboxListParams, + private val response: LockboxListPageResponse, +) : PageAsync { + + /** + * Delegates to [LockboxListPageResponse], but gracefully handles missing data. + * + * @see LockboxListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [LockboxListPageResponse], but gracefully handles missing data. + * + * @see LockboxListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): LockboxListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): LockboxListParams = params + + /** The response that this page was parsed from. */ + fun response(): LockboxListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [LockboxListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [LockboxListPageAsync]. */ + class Builder internal constructor() { + + private var service: LockboxServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: LockboxListParams? = null + private var response: LockboxListPageResponse? = null + + @JvmSynthetic + internal fun from(lockboxListPageAsync: LockboxListPageAsync) = apply { + service = lockboxListPageAsync.service + streamHandlerExecutor = lockboxListPageAsync.streamHandlerExecutor + params = lockboxListPageAsync.params + response = lockboxListPageAsync.response + } + + fun service(service: LockboxServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: LockboxListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: LockboxListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [LockboxListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): LockboxListPageAsync = + LockboxListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is LockboxListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "LockboxListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponse.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponse.kt index 45eb46ca7..6f58c0358 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Lockbox objects. */ -class LockboxListResponse +class LockboxListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [LockboxListResponse]. + * Returns a mutable builder for constructing an instance of [LockboxListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [LockboxListResponse]. */ + /** A builder for [LockboxListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(lockboxListResponse: LockboxListResponse) = apply { - data = lockboxListResponse.data.map { it.toMutableList() } - nextCursor = lockboxListResponse.nextCursor - additionalProperties = lockboxListResponse.additionalProperties.toMutableMap() + internal fun from(lockboxListPageResponse: LockboxListPageResponse) = apply { + data = lockboxListPageResponse.data.map { it.toMutableList() } + nextCursor = lockboxListPageResponse.nextCursor + additionalProperties = lockboxListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [LockboxListResponse]. + * Returns an immutable instance of [LockboxListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): LockboxListResponse = - LockboxListResponse( + fun build(): LockboxListPageResponse = + LockboxListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): LockboxListResponse = apply { + fun validate(): LockboxListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is LockboxListResponse && + return other is LockboxListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "LockboxListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "LockboxListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPage.kt new file mode 100644 index 000000000..57d7b2fe0 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.oauthapplications + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.OAuthApplicationService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see OAuthApplicationService.list */ +class OAuthApplicationListPage +private constructor( + private val service: OAuthApplicationService, + private val params: OAuthApplicationListParams, + private val response: OAuthApplicationListPageResponse, +) : Page { + + /** + * Delegates to [OAuthApplicationListPageResponse], but gracefully handles missing data. + * + * @see OAuthApplicationListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [OAuthApplicationListPageResponse], but gracefully handles missing data. + * + * @see OAuthApplicationListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): OAuthApplicationListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): OAuthApplicationListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): OAuthApplicationListParams = params + + /** The response that this page was parsed from. */ + fun response(): OAuthApplicationListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [OAuthApplicationListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [OAuthApplicationListPage]. */ + class Builder internal constructor() { + + private var service: OAuthApplicationService? = null + private var params: OAuthApplicationListParams? = null + private var response: OAuthApplicationListPageResponse? = null + + @JvmSynthetic + internal fun from(oauthApplicationListPage: OAuthApplicationListPage) = apply { + service = oauthApplicationListPage.service + params = oauthApplicationListPage.params + response = oauthApplicationListPage.response + } + + fun service(service: OAuthApplicationService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: OAuthApplicationListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: OAuthApplicationListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [OAuthApplicationListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): OAuthApplicationListPage = + OAuthApplicationListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is OAuthApplicationListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "OAuthApplicationListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPageAsync.kt new file mode 100644 index 000000000..6eb16dbc4 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPageAsync.kt @@ -0,0 +1,151 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.oauthapplications + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.OAuthApplicationServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see OAuthApplicationServiceAsync.list */ +class OAuthApplicationListPageAsync +private constructor( + private val service: OAuthApplicationServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: OAuthApplicationListParams, + private val response: OAuthApplicationListPageResponse, +) : PageAsync { + + /** + * Delegates to [OAuthApplicationListPageResponse], but gracefully handles missing data. + * + * @see OAuthApplicationListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [OAuthApplicationListPageResponse], but gracefully handles missing data. + * + * @see OAuthApplicationListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): OAuthApplicationListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): OAuthApplicationListParams = params + + /** The response that this page was parsed from. */ + fun response(): OAuthApplicationListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [OAuthApplicationListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [OAuthApplicationListPageAsync]. */ + class Builder internal constructor() { + + private var service: OAuthApplicationServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: OAuthApplicationListParams? = null + private var response: OAuthApplicationListPageResponse? = null + + @JvmSynthetic + internal fun from(oauthApplicationListPageAsync: OAuthApplicationListPageAsync) = apply { + service = oauthApplicationListPageAsync.service + streamHandlerExecutor = oauthApplicationListPageAsync.streamHandlerExecutor + params = oauthApplicationListPageAsync.params + response = oauthApplicationListPageAsync.response + } + + fun service(service: OAuthApplicationServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: OAuthApplicationListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: OAuthApplicationListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [OAuthApplicationListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): OAuthApplicationListPageAsync = + OAuthApplicationListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is OAuthApplicationListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "OAuthApplicationListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPageResponse.kt index 4b8444e24..fbe4d6bfe 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of OAuth Application objects. */ -class OAuthApplicationListResponse +class OAuthApplicationListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [OAuthApplicationListResponse]. + * Returns a mutable builder for constructing an instance of + * [OAuthApplicationListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [OAuthApplicationListResponse]. */ + /** A builder for [OAuthApplicationListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,11 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(oauthApplicationListResponse: OAuthApplicationListResponse) = apply { - data = oauthApplicationListResponse.data.map { it.toMutableList() } - nextCursor = oauthApplicationListResponse.nextCursor - additionalProperties = oauthApplicationListResponse.additionalProperties.toMutableMap() - } + internal fun from(oauthApplicationListPageResponse: OAuthApplicationListPageResponse) = + apply { + data = oauthApplicationListPageResponse.data.map { it.toMutableList() } + nextCursor = oauthApplicationListPageResponse.nextCursor + additionalProperties = + oauthApplicationListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -169,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [OAuthApplicationListResponse]. + * Returns an immutable instance of [OAuthApplicationListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): OAuthApplicationListResponse = - OAuthApplicationListResponse( + fun build(): OAuthApplicationListPageResponse = + OAuthApplicationListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): OAuthApplicationListResponse = apply { + fun validate(): OAuthApplicationListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +227,7 @@ private constructor( return true } - return other is OAuthApplicationListResponse && + return other is OAuthApplicationListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OAuthApplicationListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "OAuthApplicationListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPage.kt new file mode 100644 index 000000000..e7f4364b1 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.oauthconnections + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.OAuthConnectionService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see OAuthConnectionService.list */ +class OAuthConnectionListPage +private constructor( + private val service: OAuthConnectionService, + private val params: OAuthConnectionListParams, + private val response: OAuthConnectionListPageResponse, +) : Page { + + /** + * Delegates to [OAuthConnectionListPageResponse], but gracefully handles missing data. + * + * @see OAuthConnectionListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [OAuthConnectionListPageResponse], but gracefully handles missing data. + * + * @see OAuthConnectionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): OAuthConnectionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): OAuthConnectionListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): OAuthConnectionListParams = params + + /** The response that this page was parsed from. */ + fun response(): OAuthConnectionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [OAuthConnectionListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [OAuthConnectionListPage]. */ + class Builder internal constructor() { + + private var service: OAuthConnectionService? = null + private var params: OAuthConnectionListParams? = null + private var response: OAuthConnectionListPageResponse? = null + + @JvmSynthetic + internal fun from(oauthConnectionListPage: OAuthConnectionListPage) = apply { + service = oauthConnectionListPage.service + params = oauthConnectionListPage.params + response = oauthConnectionListPage.response + } + + fun service(service: OAuthConnectionService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: OAuthConnectionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: OAuthConnectionListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [OAuthConnectionListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): OAuthConnectionListPage = + OAuthConnectionListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is OAuthConnectionListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "OAuthConnectionListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPageAsync.kt new file mode 100644 index 000000000..9ca53e4c5 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.oauthconnections + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.OAuthConnectionServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see OAuthConnectionServiceAsync.list */ +class OAuthConnectionListPageAsync +private constructor( + private val service: OAuthConnectionServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: OAuthConnectionListParams, + private val response: OAuthConnectionListPageResponse, +) : PageAsync { + + /** + * Delegates to [OAuthConnectionListPageResponse], but gracefully handles missing data. + * + * @see OAuthConnectionListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [OAuthConnectionListPageResponse], but gracefully handles missing data. + * + * @see OAuthConnectionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): OAuthConnectionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): OAuthConnectionListParams = params + + /** The response that this page was parsed from. */ + fun response(): OAuthConnectionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [OAuthConnectionListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [OAuthConnectionListPageAsync]. */ + class Builder internal constructor() { + + private var service: OAuthConnectionServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: OAuthConnectionListParams? = null + private var response: OAuthConnectionListPageResponse? = null + + @JvmSynthetic + internal fun from(oauthConnectionListPageAsync: OAuthConnectionListPageAsync) = apply { + service = oauthConnectionListPageAsync.service + streamHandlerExecutor = oauthConnectionListPageAsync.streamHandlerExecutor + params = oauthConnectionListPageAsync.params + response = oauthConnectionListPageAsync.response + } + + fun service(service: OAuthConnectionServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: OAuthConnectionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: OAuthConnectionListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [OAuthConnectionListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): OAuthConnectionListPageAsync = + OAuthConnectionListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is OAuthConnectionListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "OAuthConnectionListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPageResponse.kt index aa9132adf..8f2c66a26 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of OAuth Connection objects. */ -class OAuthConnectionListResponse +class OAuthConnectionListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,8 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [OAuthConnectionListResponse]. + * Returns a mutable builder for constructing an instance of + * [OAuthConnectionListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [OAuthConnectionListResponse]. */ + /** A builder for [OAuthConnectionListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,11 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(oauthConnectionListResponse: OAuthConnectionListResponse) = apply { - data = oauthConnectionListResponse.data.map { it.toMutableList() } - nextCursor = oauthConnectionListResponse.nextCursor - additionalProperties = oauthConnectionListResponse.additionalProperties.toMutableMap() - } + internal fun from(oauthConnectionListPageResponse: OAuthConnectionListPageResponse) = + apply { + data = oauthConnectionListPageResponse.data.map { it.toMutableList() } + nextCursor = oauthConnectionListPageResponse.nextCursor + additionalProperties = + oauthConnectionListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -169,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [OAuthConnectionListResponse]. + * Returns an immutable instance of [OAuthConnectionListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): OAuthConnectionListResponse = - OAuthConnectionListResponse( + fun build(): OAuthConnectionListPageResponse = + OAuthConnectionListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): OAuthConnectionListResponse = apply { + fun validate(): OAuthConnectionListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +227,7 @@ private constructor( return true } - return other is OAuthConnectionListResponse && + return other is OAuthConnectionListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "OAuthConnectionListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "OAuthConnectionListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPage.kt new file mode 100644 index 000000000..c7aaa0fc9 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.pendingtransactions + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.PendingTransactionService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see PendingTransactionService.list */ +class PendingTransactionListPage +private constructor( + private val service: PendingTransactionService, + private val params: PendingTransactionListParams, + private val response: PendingTransactionListPageResponse, +) : Page { + + /** + * Delegates to [PendingTransactionListPageResponse], but gracefully handles missing data. + * + * @see PendingTransactionListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [PendingTransactionListPageResponse], but gracefully handles missing data. + * + * @see PendingTransactionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): PendingTransactionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): PendingTransactionListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): PendingTransactionListParams = params + + /** The response that this page was parsed from. */ + fun response(): PendingTransactionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [PendingTransactionListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PendingTransactionListPage]. */ + class Builder internal constructor() { + + private var service: PendingTransactionService? = null + private var params: PendingTransactionListParams? = null + private var response: PendingTransactionListPageResponse? = null + + @JvmSynthetic + internal fun from(pendingTransactionListPage: PendingTransactionListPage) = apply { + service = pendingTransactionListPage.service + params = pendingTransactionListPage.params + response = pendingTransactionListPage.response + } + + fun service(service: PendingTransactionService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: PendingTransactionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: PendingTransactionListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [PendingTransactionListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PendingTransactionListPage = + PendingTransactionListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PendingTransactionListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "PendingTransactionListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageAsync.kt new file mode 100644 index 000000000..63331bc3e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.pendingtransactions + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.PendingTransactionServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see PendingTransactionServiceAsync.list */ +class PendingTransactionListPageAsync +private constructor( + private val service: PendingTransactionServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: PendingTransactionListParams, + private val response: PendingTransactionListPageResponse, +) : PageAsync { + + /** + * Delegates to [PendingTransactionListPageResponse], but gracefully handles missing data. + * + * @see PendingTransactionListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [PendingTransactionListPageResponse], but gracefully handles missing data. + * + * @see PendingTransactionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): PendingTransactionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): PendingTransactionListParams = params + + /** The response that this page was parsed from. */ + fun response(): PendingTransactionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [PendingTransactionListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PendingTransactionListPageAsync]. */ + class Builder internal constructor() { + + private var service: PendingTransactionServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: PendingTransactionListParams? = null + private var response: PendingTransactionListPageResponse? = null + + @JvmSynthetic + internal fun from(pendingTransactionListPageAsync: PendingTransactionListPageAsync) = + apply { + service = pendingTransactionListPageAsync.service + streamHandlerExecutor = pendingTransactionListPageAsync.streamHandlerExecutor + params = pendingTransactionListPageAsync.params + response = pendingTransactionListPageAsync.response + } + + fun service(service: PendingTransactionServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: PendingTransactionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: PendingTransactionListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [PendingTransactionListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PendingTransactionListPageAsync = + PendingTransactionListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PendingTransactionListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "PendingTransactionListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponse.kt similarity index 88% rename from increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponse.kt index a8e32b4ab..d7db61a20 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Pending Transaction objects. */ -class PendingTransactionListResponse +class PendingTransactionListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [PendingTransactionListResponse]. + * [PendingTransactionListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [PendingTransactionListResponse]. */ + /** A builder for [PendingTransactionListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,12 +103,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(pendingTransactionListResponse: PendingTransactionListResponse) = apply { - data = pendingTransactionListResponse.data.map { it.toMutableList() } - nextCursor = pendingTransactionListResponse.nextCursor - additionalProperties = - pendingTransactionListResponse.additionalProperties.toMutableMap() - } + internal fun from(pendingTransactionListPageResponse: PendingTransactionListPageResponse) = + apply { + data = pendingTransactionListPageResponse.data.map { it.toMutableList() } + nextCursor = pendingTransactionListPageResponse.nextCursor + additionalProperties = + pendingTransactionListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -171,7 +172,7 @@ private constructor( } /** - * Returns an immutable instance of [PendingTransactionListResponse]. + * Returns an immutable instance of [PendingTransactionListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -183,8 +184,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): PendingTransactionListResponse = - PendingTransactionListResponse( + fun build(): PendingTransactionListPageResponse = + PendingTransactionListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -193,7 +194,7 @@ private constructor( private var validated: Boolean = false - fun validate(): PendingTransactionListResponse = apply { + fun validate(): PendingTransactionListPageResponse = apply { if (validated) { return@apply } @@ -226,7 +227,7 @@ private constructor( return true } - return other is PendingTransactionListResponse && + return other is PendingTransactionListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -237,5 +238,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PendingTransactionListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "PendingTransactionListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPage.kt new file mode 100644 index 000000000..dd7338c6f --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.physicalcardprofiles + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.PhysicalCardProfileService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see PhysicalCardProfileService.list */ +class PhysicalCardProfileListPage +private constructor( + private val service: PhysicalCardProfileService, + private val params: PhysicalCardProfileListParams, + private val response: PhysicalCardProfileListPageResponse, +) : Page { + + /** + * Delegates to [PhysicalCardProfileListPageResponse], but gracefully handles missing data. + * + * @see PhysicalCardProfileListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [PhysicalCardProfileListPageResponse], but gracefully handles missing data. + * + * @see PhysicalCardProfileListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): PhysicalCardProfileListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): PhysicalCardProfileListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): PhysicalCardProfileListParams = params + + /** The response that this page was parsed from. */ + fun response(): PhysicalCardProfileListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [PhysicalCardProfileListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PhysicalCardProfileListPage]. */ + class Builder internal constructor() { + + private var service: PhysicalCardProfileService? = null + private var params: PhysicalCardProfileListParams? = null + private var response: PhysicalCardProfileListPageResponse? = null + + @JvmSynthetic + internal fun from(physicalCardProfileListPage: PhysicalCardProfileListPage) = apply { + service = physicalCardProfileListPage.service + params = physicalCardProfileListPage.params + response = physicalCardProfileListPage.response + } + + fun service(service: PhysicalCardProfileService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: PhysicalCardProfileListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: PhysicalCardProfileListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [PhysicalCardProfileListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PhysicalCardProfileListPage = + PhysicalCardProfileListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PhysicalCardProfileListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "PhysicalCardProfileListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPageAsync.kt new file mode 100644 index 000000000..27bccad0a --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.physicalcardprofiles + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.PhysicalCardProfileServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see PhysicalCardProfileServiceAsync.list */ +class PhysicalCardProfileListPageAsync +private constructor( + private val service: PhysicalCardProfileServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: PhysicalCardProfileListParams, + private val response: PhysicalCardProfileListPageResponse, +) : PageAsync { + + /** + * Delegates to [PhysicalCardProfileListPageResponse], but gracefully handles missing data. + * + * @see PhysicalCardProfileListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [PhysicalCardProfileListPageResponse], but gracefully handles missing data. + * + * @see PhysicalCardProfileListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): PhysicalCardProfileListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): PhysicalCardProfileListParams = params + + /** The response that this page was parsed from. */ + fun response(): PhysicalCardProfileListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [PhysicalCardProfileListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PhysicalCardProfileListPageAsync]. */ + class Builder internal constructor() { + + private var service: PhysicalCardProfileServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: PhysicalCardProfileListParams? = null + private var response: PhysicalCardProfileListPageResponse? = null + + @JvmSynthetic + internal fun from(physicalCardProfileListPageAsync: PhysicalCardProfileListPageAsync) = + apply { + service = physicalCardProfileListPageAsync.service + streamHandlerExecutor = physicalCardProfileListPageAsync.streamHandlerExecutor + params = physicalCardProfileListPageAsync.params + response = physicalCardProfileListPageAsync.response + } + + fun service(service: PhysicalCardProfileServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: PhysicalCardProfileListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: PhysicalCardProfileListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [PhysicalCardProfileListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PhysicalCardProfileListPageAsync = + PhysicalCardProfileListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PhysicalCardProfileListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "PhysicalCardProfileListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPageResponse.kt index a987f1290..f67b66899 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Physical Card Profile objects. */ -class PhysicalCardProfileListResponse +class PhysicalCardProfileListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [PhysicalCardProfileListResponse]. + * [PhysicalCardProfileListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [PhysicalCardProfileListResponse]. */ + /** A builder for [PhysicalCardProfileListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,13 +103,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(physicalCardProfileListResponse: PhysicalCardProfileListResponse) = - apply { - data = physicalCardProfileListResponse.data.map { it.toMutableList() } - nextCursor = physicalCardProfileListResponse.nextCursor - additionalProperties = - physicalCardProfileListResponse.additionalProperties.toMutableMap() - } + internal fun from( + physicalCardProfileListPageResponse: PhysicalCardProfileListPageResponse + ) = apply { + data = physicalCardProfileListPageResponse.data.map { it.toMutableList() } + nextCursor = physicalCardProfileListPageResponse.nextCursor + additionalProperties = + physicalCardProfileListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -172,7 +173,7 @@ private constructor( } /** - * Returns an immutable instance of [PhysicalCardProfileListResponse]. + * Returns an immutable instance of [PhysicalCardProfileListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -184,8 +185,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): PhysicalCardProfileListResponse = - PhysicalCardProfileListResponse( + fun build(): PhysicalCardProfileListPageResponse = + PhysicalCardProfileListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -194,7 +195,7 @@ private constructor( private var validated: Boolean = false - fun validate(): PhysicalCardProfileListResponse = apply { + fun validate(): PhysicalCardProfileListPageResponse = apply { if (validated) { return@apply } @@ -227,7 +228,7 @@ private constructor( return true } - return other is PhysicalCardProfileListResponse && + return other is PhysicalCardProfileListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -238,5 +239,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PhysicalCardProfileListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "PhysicalCardProfileListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPage.kt new file mode 100644 index 000000000..dd4b27f81 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.physicalcards + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.PhysicalCardService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see PhysicalCardService.list */ +class PhysicalCardListPage +private constructor( + private val service: PhysicalCardService, + private val params: PhysicalCardListParams, + private val response: PhysicalCardListPageResponse, +) : Page { + + /** + * Delegates to [PhysicalCardListPageResponse], but gracefully handles missing data. + * + * @see PhysicalCardListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [PhysicalCardListPageResponse], but gracefully handles missing data. + * + * @see PhysicalCardListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): PhysicalCardListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): PhysicalCardListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): PhysicalCardListParams = params + + /** The response that this page was parsed from. */ + fun response(): PhysicalCardListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [PhysicalCardListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PhysicalCardListPage]. */ + class Builder internal constructor() { + + private var service: PhysicalCardService? = null + private var params: PhysicalCardListParams? = null + private var response: PhysicalCardListPageResponse? = null + + @JvmSynthetic + internal fun from(physicalCardListPage: PhysicalCardListPage) = apply { + service = physicalCardListPage.service + params = physicalCardListPage.params + response = physicalCardListPage.response + } + + fun service(service: PhysicalCardService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: PhysicalCardListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: PhysicalCardListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [PhysicalCardListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PhysicalCardListPage = + PhysicalCardListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PhysicalCardListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "PhysicalCardListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPageAsync.kt new file mode 100644 index 000000000..1a63b48ed --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.physicalcards + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.PhysicalCardServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see PhysicalCardServiceAsync.list */ +class PhysicalCardListPageAsync +private constructor( + private val service: PhysicalCardServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: PhysicalCardListParams, + private val response: PhysicalCardListPageResponse, +) : PageAsync { + + /** + * Delegates to [PhysicalCardListPageResponse], but gracefully handles missing data. + * + * @see PhysicalCardListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [PhysicalCardListPageResponse], but gracefully handles missing data. + * + * @see PhysicalCardListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): PhysicalCardListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): PhysicalCardListParams = params + + /** The response that this page was parsed from. */ + fun response(): PhysicalCardListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [PhysicalCardListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [PhysicalCardListPageAsync]. */ + class Builder internal constructor() { + + private var service: PhysicalCardServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: PhysicalCardListParams? = null + private var response: PhysicalCardListPageResponse? = null + + @JvmSynthetic + internal fun from(physicalCardListPageAsync: PhysicalCardListPageAsync) = apply { + service = physicalCardListPageAsync.service + streamHandlerExecutor = physicalCardListPageAsync.streamHandlerExecutor + params = physicalCardListPageAsync.params + response = physicalCardListPageAsync.response + } + + fun service(service: PhysicalCardServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: PhysicalCardListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: PhysicalCardListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [PhysicalCardListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): PhysicalCardListPageAsync = + PhysicalCardListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PhysicalCardListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "PhysicalCardListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPageResponse.kt index 7c7a4b696..c70a9bc5c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Physical Card objects. */ -class PhysicalCardListResponse +class PhysicalCardListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [PhysicalCardListResponse]. + * Returns a mutable builder for constructing an instance of [PhysicalCardListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +94,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [PhysicalCardListResponse]. */ + /** A builder for [PhysicalCardListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,10 +102,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(physicalCardListResponse: PhysicalCardListResponse) = apply { - data = physicalCardListResponse.data.map { it.toMutableList() } - nextCursor = physicalCardListResponse.nextCursor - additionalProperties = physicalCardListResponse.additionalProperties.toMutableMap() + internal fun from(physicalCardListPageResponse: PhysicalCardListPageResponse) = apply { + data = physicalCardListPageResponse.data.map { it.toMutableList() } + nextCursor = physicalCardListPageResponse.nextCursor + additionalProperties = physicalCardListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -169,7 +169,7 @@ private constructor( } /** - * Returns an immutable instance of [PhysicalCardListResponse]. + * Returns an immutable instance of [PhysicalCardListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +181,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): PhysicalCardListResponse = - PhysicalCardListResponse( + fun build(): PhysicalCardListPageResponse = + PhysicalCardListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +191,7 @@ private constructor( private var validated: Boolean = false - fun validate(): PhysicalCardListResponse = apply { + fun validate(): PhysicalCardListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +224,7 @@ private constructor( return true } - return other is PhysicalCardListResponse && + return other is PhysicalCardListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +235,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PhysicalCardListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "PhysicalCardListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListPage.kt new file mode 100644 index 000000000..993cd3c0b --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.programs + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.ProgramService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see ProgramService.list */ +class ProgramListPage +private constructor( + private val service: ProgramService, + private val params: ProgramListParams, + private val response: ProgramListPageResponse, +) : Page { + + /** + * Delegates to [ProgramListPageResponse], but gracefully handles missing data. + * + * @see ProgramListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [ProgramListPageResponse], but gracefully handles missing data. + * + * @see ProgramListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): ProgramListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): ProgramListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): ProgramListParams = params + + /** The response that this page was parsed from. */ + fun response(): ProgramListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ProgramListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ProgramListPage]. */ + class Builder internal constructor() { + + private var service: ProgramService? = null + private var params: ProgramListParams? = null + private var response: ProgramListPageResponse? = null + + @JvmSynthetic + internal fun from(programListPage: ProgramListPage) = apply { + service = programListPage.service + params = programListPage.params + response = programListPage.response + } + + fun service(service: ProgramService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: ProgramListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: ProgramListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [ProgramListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ProgramListPage = + ProgramListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ProgramListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "ProgramListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListPageAsync.kt new file mode 100644 index 000000000..c995d9181 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.programs + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.ProgramServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see ProgramServiceAsync.list */ +class ProgramListPageAsync +private constructor( + private val service: ProgramServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: ProgramListParams, + private val response: ProgramListPageResponse, +) : PageAsync { + + /** + * Delegates to [ProgramListPageResponse], but gracefully handles missing data. + * + * @see ProgramListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [ProgramListPageResponse], but gracefully handles missing data. + * + * @see ProgramListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): ProgramListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): ProgramListParams = params + + /** The response that this page was parsed from. */ + fun response(): ProgramListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [ProgramListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ProgramListPageAsync]. */ + class Builder internal constructor() { + + private var service: ProgramServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: ProgramListParams? = null + private var response: ProgramListPageResponse? = null + + @JvmSynthetic + internal fun from(programListPageAsync: ProgramListPageAsync) = apply { + service = programListPageAsync.service + streamHandlerExecutor = programListPageAsync.streamHandlerExecutor + params = programListPageAsync.params + response = programListPageAsync.response + } + + fun service(service: ProgramServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: ProgramListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: ProgramListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [ProgramListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ProgramListPageAsync = + ProgramListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ProgramListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "ProgramListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListPageResponse.kt similarity index 90% rename from increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListPageResponse.kt index 074d739d0..f653285aa 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/programs/ProgramListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Program objects. */ -class ProgramListResponse +class ProgramListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [ProgramListResponse]. + * Returns a mutable builder for constructing an instance of [ProgramListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [ProgramListResponse]. */ + /** A builder for [ProgramListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(programListResponse: ProgramListResponse) = apply { - data = programListResponse.data.map { it.toMutableList() } - nextCursor = programListResponse.nextCursor - additionalProperties = programListResponse.additionalProperties.toMutableMap() + internal fun from(programListPageResponse: ProgramListPageResponse) = apply { + data = programListPageResponse.data.map { it.toMutableList() } + nextCursor = programListPageResponse.nextCursor + additionalProperties = programListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [ProgramListResponse]. + * Returns an immutable instance of [ProgramListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): ProgramListResponse = - ProgramListResponse( + fun build(): ProgramListPageResponse = + ProgramListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): ProgramListResponse = apply { + fun validate(): ProgramListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is ProgramListResponse && + return other is ProgramListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ProgramListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "ProgramListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPage.kt new file mode 100644 index 000000000..f4af3a383 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPage.kt @@ -0,0 +1,137 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.realtimepaymentstransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.RealTimePaymentsTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see RealTimePaymentsTransferService.list */ +class RealTimePaymentsTransferListPage +private constructor( + private val service: RealTimePaymentsTransferService, + private val params: RealTimePaymentsTransferListParams, + private val response: RealTimePaymentsTransferListPageResponse, +) : Page { + + /** + * Delegates to [RealTimePaymentsTransferListPageResponse], but gracefully handles missing data. + * + * @see RealTimePaymentsTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [RealTimePaymentsTransferListPageResponse], but gracefully handles missing data. + * + * @see RealTimePaymentsTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): RealTimePaymentsTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): RealTimePaymentsTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): RealTimePaymentsTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): RealTimePaymentsTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [RealTimePaymentsTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RealTimePaymentsTransferListPage]. */ + class Builder internal constructor() { + + private var service: RealTimePaymentsTransferService? = null + private var params: RealTimePaymentsTransferListParams? = null + private var response: RealTimePaymentsTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(realTimePaymentsTransferListPage: RealTimePaymentsTransferListPage) = + apply { + service = realTimePaymentsTransferListPage.service + params = realTimePaymentsTransferListPage.params + response = realTimePaymentsTransferListPage.response + } + + fun service(service: RealTimePaymentsTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: RealTimePaymentsTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: RealTimePaymentsTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [RealTimePaymentsTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RealTimePaymentsTransferListPage = + RealTimePaymentsTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RealTimePaymentsTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "RealTimePaymentsTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageAsync.kt new file mode 100644 index 000000000..7468ca5b8 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageAsync.kt @@ -0,0 +1,155 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.realtimepaymentstransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.RealTimePaymentsTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see RealTimePaymentsTransferServiceAsync.list */ +class RealTimePaymentsTransferListPageAsync +private constructor( + private val service: RealTimePaymentsTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: RealTimePaymentsTransferListParams, + private val response: RealTimePaymentsTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [RealTimePaymentsTransferListPageResponse], but gracefully handles missing data. + * + * @see RealTimePaymentsTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [RealTimePaymentsTransferListPageResponse], but gracefully handles missing data. + * + * @see RealTimePaymentsTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): RealTimePaymentsTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): RealTimePaymentsTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): RealTimePaymentsTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [RealTimePaymentsTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RealTimePaymentsTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: RealTimePaymentsTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: RealTimePaymentsTransferListParams? = null + private var response: RealTimePaymentsTransferListPageResponse? = null + + @JvmSynthetic + internal fun from( + realTimePaymentsTransferListPageAsync: RealTimePaymentsTransferListPageAsync + ) = apply { + service = realTimePaymentsTransferListPageAsync.service + streamHandlerExecutor = realTimePaymentsTransferListPageAsync.streamHandlerExecutor + params = realTimePaymentsTransferListPageAsync.params + response = realTimePaymentsTransferListPageAsync.response + } + + fun service(service: RealTimePaymentsTransferServiceAsync) = apply { + this.service = service + } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: RealTimePaymentsTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: RealTimePaymentsTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [RealTimePaymentsTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RealTimePaymentsTransferListPageAsync = + RealTimePaymentsTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RealTimePaymentsTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "RealTimePaymentsTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageResponse.kt index 2756501d6..ca717db89 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Real-Time Payments Transfer objects. */ -class RealTimePaymentsTransferListResponse +class RealTimePaymentsTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -86,7 +86,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [RealTimePaymentsTransferListResponse]. + * [RealTimePaymentsTransferListPageResponse]. * * The following fields are required: * ```java @@ -97,7 +97,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [RealTimePaymentsTransferListResponse]. */ + /** A builder for [RealTimePaymentsTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -106,12 +106,12 @@ private constructor( @JvmSynthetic internal fun from( - realTimePaymentsTransferListResponse: RealTimePaymentsTransferListResponse + realTimePaymentsTransferListPageResponse: RealTimePaymentsTransferListPageResponse ) = apply { - data = realTimePaymentsTransferListResponse.data.map { it.toMutableList() } - nextCursor = realTimePaymentsTransferListResponse.nextCursor + data = realTimePaymentsTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = realTimePaymentsTransferListPageResponse.nextCursor additionalProperties = - realTimePaymentsTransferListResponse.additionalProperties.toMutableMap() + realTimePaymentsTransferListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -175,7 +175,7 @@ private constructor( } /** - * Returns an immutable instance of [RealTimePaymentsTransferListResponse]. + * Returns an immutable instance of [RealTimePaymentsTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -187,8 +187,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): RealTimePaymentsTransferListResponse = - RealTimePaymentsTransferListResponse( + fun build(): RealTimePaymentsTransferListPageResponse = + RealTimePaymentsTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -197,7 +197,7 @@ private constructor( private var validated: Boolean = false - fun validate(): RealTimePaymentsTransferListResponse = apply { + fun validate(): RealTimePaymentsTransferListPageResponse = apply { if (validated) { return@apply } @@ -230,7 +230,7 @@ private constructor( return true } - return other is RealTimePaymentsTransferListResponse && + return other is RealTimePaymentsTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -241,5 +241,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "RealTimePaymentsTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "RealTimePaymentsTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPage.kt new file mode 100644 index 000000000..bc0550cb3 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.routingnumbers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.RoutingNumberService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see RoutingNumberService.list */ +class RoutingNumberListPage +private constructor( + private val service: RoutingNumberService, + private val params: RoutingNumberListParams, + private val response: RoutingNumberListPageResponse, +) : Page { + + /** + * Delegates to [RoutingNumberListPageResponse], but gracefully handles missing data. + * + * @see RoutingNumberListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [RoutingNumberListPageResponse], but gracefully handles missing data. + * + * @see RoutingNumberListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): RoutingNumberListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): RoutingNumberListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): RoutingNumberListParams = params + + /** The response that this page was parsed from. */ + fun response(): RoutingNumberListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [RoutingNumberListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RoutingNumberListPage]. */ + class Builder internal constructor() { + + private var service: RoutingNumberService? = null + private var params: RoutingNumberListParams? = null + private var response: RoutingNumberListPageResponse? = null + + @JvmSynthetic + internal fun from(routingNumberListPage: RoutingNumberListPage) = apply { + service = routingNumberListPage.service + params = routingNumberListPage.params + response = routingNumberListPage.response + } + + fun service(service: RoutingNumberService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: RoutingNumberListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: RoutingNumberListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [RoutingNumberListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RoutingNumberListPage = + RoutingNumberListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RoutingNumberListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "RoutingNumberListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPageAsync.kt new file mode 100644 index 000000000..d84692df1 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.routingnumbers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.RoutingNumberServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see RoutingNumberServiceAsync.list */ +class RoutingNumberListPageAsync +private constructor( + private val service: RoutingNumberServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: RoutingNumberListParams, + private val response: RoutingNumberListPageResponse, +) : PageAsync { + + /** + * Delegates to [RoutingNumberListPageResponse], but gracefully handles missing data. + * + * @see RoutingNumberListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [RoutingNumberListPageResponse], but gracefully handles missing data. + * + * @see RoutingNumberListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): RoutingNumberListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): RoutingNumberListParams = params + + /** The response that this page was parsed from. */ + fun response(): RoutingNumberListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [RoutingNumberListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RoutingNumberListPageAsync]. */ + class Builder internal constructor() { + + private var service: RoutingNumberServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: RoutingNumberListParams? = null + private var response: RoutingNumberListPageResponse? = null + + @JvmSynthetic + internal fun from(routingNumberListPageAsync: RoutingNumberListPageAsync) = apply { + service = routingNumberListPageAsync.service + streamHandlerExecutor = routingNumberListPageAsync.streamHandlerExecutor + params = routingNumberListPageAsync.params + response = routingNumberListPageAsync.response + } + + fun service(service: RoutingNumberServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: RoutingNumberListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: RoutingNumberListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [RoutingNumberListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RoutingNumberListPageAsync = + RoutingNumberListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RoutingNumberListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "RoutingNumberListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPageResponse.kt new file mode 100644 index 000000000..8b944fbe8 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPageResponse.kt @@ -0,0 +1,242 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.routingnumbers + +import com.fasterxml.jackson.annotation.JsonAnyGetter +import com.fasterxml.jackson.annotation.JsonAnySetter +import com.fasterxml.jackson.annotation.JsonCreator +import com.fasterxml.jackson.annotation.JsonProperty +import com.increase.api.core.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.checkKnown +import com.increase.api.core.checkRequired +import com.increase.api.core.toImmutable +import com.increase.api.errors.IncreaseInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A list of Routing Number objects. */ +class RoutingNumberListPageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val nextCursor: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") + @ExcludeMissing + data: JsonField> = JsonMissing.of(), + @JsonProperty("next_cursor") + @ExcludeMissing + nextCursor: JsonField = JsonMissing.of(), + ) : this(data, nextCursor, mutableMapOf()) + + /** + * The contents of the list. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List = data.getRequired("data") + + /** + * A pointer to a place in the list. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun nextCursor(): Optional = nextCursor.getOptional("next_cursor") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") + @ExcludeMissing + fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [nextCursor]. + * + * Unlike [nextCursor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("next_cursor") @ExcludeMissing fun _nextCursor(): JsonField = nextCursor + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [RoutingNumberListPageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RoutingNumberListPageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var nextCursor: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(routingNumberListPageResponse: RoutingNumberListPageResponse) = apply { + data = routingNumberListPageResponse.data.map { it.toMutableList() } + nextCursor = routingNumberListPageResponse.nextCursor + additionalProperties = routingNumberListPageResponse.additionalProperties.toMutableMap() + } + + /** The contents of the list. */ + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed + * `List` value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [RoutingNumberListResponse] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: RoutingNumberListResponse) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + /** A pointer to a place in the list. */ + fun nextCursor(nextCursor: String?) = nextCursor(JsonField.ofNullable(nextCursor)) + + /** Alias for calling [Builder.nextCursor] with `nextCursor.orElse(null)`. */ + fun nextCursor(nextCursor: Optional) = nextCursor(nextCursor.getOrNull()) + + /** + * Sets [Builder.nextCursor] to an arbitrary JSON value. + * + * You should usually call [Builder.nextCursor] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [RoutingNumberListPageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RoutingNumberListPageResponse = + RoutingNumberListPageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("nextCursor", nextCursor), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): RoutingNumberListPageResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + nextCursor() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (nextCursor.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RoutingNumberListPageResponse && + data == other.data && + nextCursor == other.nextCursor && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(data, nextCursor, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "RoutingNumberListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListResponse.kt index d112a93b2..11de04d8a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListResponse.kt @@ -11,61 +11,174 @@ import com.increase.api.core.ExcludeMissing import com.increase.api.core.JsonField import com.increase.api.core.JsonMissing import com.increase.api.core.JsonValue -import com.increase.api.core.checkKnown import com.increase.api.core.checkRequired -import com.increase.api.core.toImmutable import com.increase.api.errors.IncreaseInvalidDataException import java.util.Collections import java.util.Objects -import java.util.Optional import kotlin.jvm.optionals.getOrNull -/** A list of Routing Number objects. */ +/** Routing numbers are used to identify your bank in a financial transaction. */ class RoutingNumberListResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val data: JsonField>, - private val nextCursor: JsonField, + private val achTransfers: JsonField, + private val fednowTransfers: JsonField, + private val name: JsonField, + private val realTimePaymentsTransfers: JsonField, + private val routingNumber: JsonField, + private val type: JsonField, + private val wireTransfers: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("data") @ExcludeMissing data: JsonField> = JsonMissing.of(), - @JsonProperty("next_cursor") + @JsonProperty("ach_transfers") + @ExcludeMissing + achTransfers: JsonField = JsonMissing.of(), + @JsonProperty("fednow_transfers") + @ExcludeMissing + fednowTransfers: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("real_time_payments_transfers") + @ExcludeMissing + realTimePaymentsTransfers: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") + @ExcludeMissing + routingNumber: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + @JsonProperty("wire_transfers") @ExcludeMissing - nextCursor: JsonField = JsonMissing.of(), - ) : this(data, nextCursor, mutableMapOf()) + wireTransfers: JsonField = JsonMissing.of(), + ) : this( + achTransfers, + fednowTransfers, + name, + realTimePaymentsTransfers, + routingNumber, + type, + wireTransfers, + mutableMapOf(), + ) + + /** + * This routing number's support for ACH Transfers. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun achTransfers(): AchTransfers = achTransfers.getRequired("ach_transfers") + + /** + * This routing number's support for FedNow Transfers. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun fednowTransfers(): FednowTransfers = fednowTransfers.getRequired("fednow_transfers") + + /** + * The name of the financial institution belonging to a routing number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun name(): String = name.getRequired("name") + + /** + * This routing number's support for Real-Time Payments Transfers. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun realTimePaymentsTransfers(): RealTimePaymentsTransfers = + realTimePaymentsTransfers.getRequired("real_time_payments_transfers") + + /** + * The nine digit routing number identifier. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun routingNumber(): String = routingNumber.getRequired("routing_number") /** - * The contents of the list. + * A constant representing the object's type. For this resource it will always be + * `routing_number`. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun data(): List = data.getRequired("data") + fun type(): Type = type.getRequired("type") + + /** + * This routing number's support for Wire Transfers. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun wireTransfers(): WireTransfers = wireTransfers.getRequired("wire_transfers") + + /** + * Returns the raw JSON value of [achTransfers]. + * + * Unlike [achTransfers], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("ach_transfers") + @ExcludeMissing + fun _achTransfers(): JsonField = achTransfers + + /** + * Returns the raw JSON value of [fednowTransfers]. + * + * Unlike [fednowTransfers], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("fednow_transfers") + @ExcludeMissing + fun _fednowTransfers(): JsonField = fednowTransfers + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [realTimePaymentsTransfers]. + * + * Unlike [realTimePaymentsTransfers], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("real_time_payments_transfers") + @ExcludeMissing + fun _realTimePaymentsTransfers(): JsonField = + realTimePaymentsTransfers /** - * A pointer to a place in the list. + * Returns the raw JSON value of [routingNumber]. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). + * Unlike [routingNumber], this method doesn't throw if the JSON field has an unexpected type. */ - fun nextCursor(): Optional = nextCursor.getOptional("next_cursor") + @JsonProperty("routing_number") + @ExcludeMissing + fun _routingNumber(): JsonField = routingNumber /** - * Returns the raw JSON value of [data]. + * Returns the raw JSON value of [type]. * - * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type /** - * Returns the raw JSON value of [nextCursor]. + * Returns the raw JSON value of [wireTransfers]. * - * Unlike [nextCursor], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [wireTransfers], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("next_cursor") @ExcludeMissing fun _nextCursor(): JsonField = nextCursor + @JsonProperty("wire_transfers") + @ExcludeMissing + fun _wireTransfers(): JsonField = wireTransfers @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -86,8 +199,13 @@ private constructor( * * The following fields are required: * ```java - * .data() - * .nextCursor() + * .achTransfers() + * .fednowTransfers() + * .name() + * .realTimePaymentsTransfers() + * .routingNumber() + * .type() + * .wireTransfers() * ``` */ @JvmStatic fun builder() = Builder() @@ -96,56 +214,123 @@ private constructor( /** A builder for [RoutingNumberListResponse]. */ class Builder internal constructor() { - private var data: JsonField>? = null - private var nextCursor: JsonField? = null + private var achTransfers: JsonField? = null + private var fednowTransfers: JsonField? = null + private var name: JsonField? = null + private var realTimePaymentsTransfers: JsonField? = null + private var routingNumber: JsonField? = null + private var type: JsonField? = null + private var wireTransfers: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(routingNumberListResponse: RoutingNumberListResponse) = apply { - data = routingNumberListResponse.data.map { it.toMutableList() } - nextCursor = routingNumberListResponse.nextCursor + achTransfers = routingNumberListResponse.achTransfers + fednowTransfers = routingNumberListResponse.fednowTransfers + name = routingNumberListResponse.name + realTimePaymentsTransfers = routingNumberListResponse.realTimePaymentsTransfers + routingNumber = routingNumberListResponse.routingNumber + type = routingNumberListResponse.type + wireTransfers = routingNumberListResponse.wireTransfers additionalProperties = routingNumberListResponse.additionalProperties.toMutableMap() } - /** The contents of the list. */ - fun data(data: List) = data(JsonField.of(data)) + /** This routing number's support for ACH Transfers. */ + fun achTransfers(achTransfers: AchTransfers) = achTransfers(JsonField.of(achTransfers)) /** - * Sets [Builder.data] to an arbitrary JSON value. + * Sets [Builder.achTransfers] to an arbitrary JSON value. * - * You should usually call [Builder.data] with a well-typed `List` value instead. This - * method is primarily for setting the field to an undocumented or not yet supported value. + * You should usually call [Builder.achTransfers] with a well-typed [AchTransfers] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun data(data: JsonField>) = apply { - this.data = data.map { it.toMutableList() } + fun achTransfers(achTransfers: JsonField) = apply { + this.achTransfers = achTransfers } + /** This routing number's support for FedNow Transfers. */ + fun fednowTransfers(fednowTransfers: FednowTransfers) = + fednowTransfers(JsonField.of(fednowTransfers)) + /** - * Adds a single [Data] to [Builder.data]. + * Sets [Builder.fednowTransfers] to an arbitrary JSON value. * - * @throws IllegalStateException if the field was previously set to a non-list. + * You should usually call [Builder.fednowTransfers] with a well-typed [FednowTransfers] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. */ - fun addData(data: Data) = apply { - this.data = - (this.data ?: JsonField.of(mutableListOf())).also { - checkKnown("data", it).add(data) - } + fun fednowTransfers(fednowTransfers: JsonField) = apply { + this.fednowTransfers = fednowTransfers } - /** A pointer to a place in the list. */ - fun nextCursor(nextCursor: String?) = nextCursor(JsonField.ofNullable(nextCursor)) + /** The name of the financial institution belonging to a routing number. */ + fun name(name: String) = name(JsonField.of(name)) - /** Alias for calling [Builder.nextCursor] with `nextCursor.orElse(null)`. */ - fun nextCursor(nextCursor: Optional) = nextCursor(nextCursor.getOrNull()) + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + /** This routing number's support for Real-Time Payments Transfers. */ + fun realTimePaymentsTransfers(realTimePaymentsTransfers: RealTimePaymentsTransfers) = + realTimePaymentsTransfers(JsonField.of(realTimePaymentsTransfers)) /** - * Sets [Builder.nextCursor] to an arbitrary JSON value. + * Sets [Builder.realTimePaymentsTransfers] to an arbitrary JSON value. * - * You should usually call [Builder.nextCursor] with a well-typed [String] value instead. + * You should usually call [Builder.realTimePaymentsTransfers] with a well-typed + * [RealTimePaymentsTransfers] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun realTimePaymentsTransfers( + realTimePaymentsTransfers: JsonField + ) = apply { this.realTimePaymentsTransfers = realTimePaymentsTransfers } + + /** The nine digit routing number identifier. */ + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + + /** + * Sets [Builder.routingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.routingNumber] with a well-typed [String] value instead. * This method is primarily for setting the field to an undocumented or not yet supported * value. */ - fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor } + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } + + /** + * A constant representing the object's type. For this resource it will always be + * `routing_number`. + */ + fun type(type: Type) = type(JsonField.of(type)) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [Type] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun type(type: JsonField) = apply { this.type = type } + + /** This routing number's support for Wire Transfers. */ + fun wireTransfers(wireTransfers: WireTransfers) = wireTransfers(JsonField.of(wireTransfers)) + + /** + * Sets [Builder.wireTransfers] to an arbitrary JSON value. + * + * You should usually call [Builder.wireTransfers] with a well-typed [WireTransfers] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun wireTransfers(wireTransfers: JsonField) = apply { + this.wireTransfers = wireTransfers + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -173,16 +358,26 @@ private constructor( * * The following fields are required: * ```java - * .data() - * .nextCursor() + * .achTransfers() + * .fednowTransfers() + * .name() + * .realTimePaymentsTransfers() + * .routingNumber() + * .type() + * .wireTransfers() * ``` * * @throws IllegalStateException if any required field is unset. */ fun build(): RoutingNumberListResponse = RoutingNumberListResponse( - checkRequired("data", data).map { it.toImmutable() }, - checkRequired("nextCursor", nextCursor), + checkRequired("achTransfers", achTransfers), + checkRequired("fednowTransfers", fednowTransfers), + checkRequired("name", name), + checkRequired("realTimePaymentsTransfers", realTimePaymentsTransfers), + checkRequired("routingNumber", routingNumber), + checkRequired("type", type), + checkRequired("wireTransfers", wireTransfers), additionalProperties.toMutableMap(), ) } @@ -194,8 +389,13 @@ private constructor( return@apply } - data().forEach { it.validate() } - nextCursor() + achTransfers().validate() + fednowTransfers().validate() + name() + realTimePaymentsTransfers().validate() + routingNumber() + type().validate() + wireTransfers().validate() validated = true } @@ -214,395 +414,257 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + - (if (nextCursor.asKnown().isPresent) 1 else 0) - - /** Routing numbers are used to identify your bank in a financial transaction. */ - class Data - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val achTransfers: JsonField, - private val fednowTransfers: JsonField, - private val name: JsonField, - private val realTimePaymentsTransfers: JsonField, - private val routingNumber: JsonField, - private val type: JsonField, - private val wireTransfers: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("ach_transfers") - @ExcludeMissing - achTransfers: JsonField = JsonMissing.of(), - @JsonProperty("fednow_transfers") - @ExcludeMissing - fednowTransfers: JsonField = JsonMissing.of(), - @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), - @JsonProperty("real_time_payments_transfers") - @ExcludeMissing - realTimePaymentsTransfers: JsonField = JsonMissing.of(), - @JsonProperty("routing_number") - @ExcludeMissing - routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), - @JsonProperty("wire_transfers") - @ExcludeMissing - wireTransfers: JsonField = JsonMissing.of(), - ) : this( - achTransfers, - fednowTransfers, - name, - realTimePaymentsTransfers, - routingNumber, - type, - wireTransfers, - mutableMapOf(), - ) + (achTransfers.asKnown().getOrNull()?.validity() ?: 0) + + (fednowTransfers.asKnown().getOrNull()?.validity() ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) + + (realTimePaymentsTransfers.asKnown().getOrNull()?.validity() ?: 0) + + (if (routingNumber.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + (wireTransfers.asKnown().getOrNull()?.validity() ?: 0) + + /** This routing number's support for ACH Transfers. */ + class AchTransfers @JsonCreator private constructor(private val value: JsonField) : + Enum { /** - * This routing number's support for ACH Transfers. + * Returns this class instance's raw value. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. */ - fun achTransfers(): AchTransfers = achTransfers.getRequired("ach_transfers") + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - /** - * This routing number's support for FedNow Transfers. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun fednowTransfers(): FednowTransfers = fednowTransfers.getRequired("fednow_transfers") - - /** - * The name of the financial institution belonging to a routing number. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun name(): String = name.getRequired("name") - - /** - * This routing number's support for Real-Time Payments Transfers. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun realTimePaymentsTransfers(): RealTimePaymentsTransfers = - realTimePaymentsTransfers.getRequired("real_time_payments_transfers") + companion object { - /** - * The nine digit routing number identifier. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun routingNumber(): String = routingNumber.getRequired("routing_number") + /** The routing number can receive this transfer type. */ + @JvmField val SUPPORTED = of("supported") - /** - * A constant representing the object's type. For this resource it will always be - * `routing_number`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun type(): Type = type.getRequired("type") + /** The routing number cannot receive this transfer type. */ + @JvmField val NOT_SUPPORTED = of("not_supported") - /** - * This routing number's support for Wire Transfers. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected value). - */ - fun wireTransfers(): WireTransfers = wireTransfers.getRequired("wire_transfers") + @JvmStatic fun of(value: String) = AchTransfers(JsonField.of(value)) + } - /** - * Returns the raw JSON value of [achTransfers]. - * - * Unlike [achTransfers], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("ach_transfers") - @ExcludeMissing - fun _achTransfers(): JsonField = achTransfers + /** An enum containing [AchTransfers]'s known values. */ + enum class Known { + /** The routing number can receive this transfer type. */ + SUPPORTED, + /** The routing number cannot receive this transfer type. */ + NOT_SUPPORTED, + } /** - * Returns the raw JSON value of [fednowTransfers]. + * An enum containing [AchTransfers]'s known values, as well as an [_UNKNOWN] member. * - * Unlike [fednowTransfers], this method doesn't throw if the JSON field has an unexpected - * type. + * An instance of [AchTransfers] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. */ - @JsonProperty("fednow_transfers") - @ExcludeMissing - fun _fednowTransfers(): JsonField = fednowTransfers + enum class Value { + /** The routing number can receive this transfer type. */ + SUPPORTED, + /** The routing number cannot receive this transfer type. */ + NOT_SUPPORTED, + /** + * An enum member indicating that [AchTransfers] was instantiated with an unknown value. + */ + _UNKNOWN, + } /** - * Returns the raw JSON value of [name]. + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. * - * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. */ - @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + fun value(): Value = + when (this) { + SUPPORTED -> Value.SUPPORTED + NOT_SUPPORTED -> Value.NOT_SUPPORTED + else -> Value._UNKNOWN + } /** - * Returns the raw JSON value of [realTimePaymentsTransfers]. + * Returns an enum member corresponding to this class instance's value. * - * Unlike [realTimePaymentsTransfers], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("real_time_payments_transfers") - @ExcludeMissing - fun _realTimePaymentsTransfers(): JsonField = - realTimePaymentsTransfers - - /** - * Returns the raw JSON value of [routingNumber]. + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. * - * Unlike [routingNumber], this method doesn't throw if the JSON field has an unexpected - * type. + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. */ - @JsonProperty("routing_number") - @ExcludeMissing - fun _routingNumber(): JsonField = routingNumber + fun known(): Known = + when (this) { + SUPPORTED -> Known.SUPPORTED + NOT_SUPPORTED -> Known.NOT_SUPPORTED + else -> throw IncreaseInvalidDataException("Unknown AchTransfers: $value") + } /** - * Returns the raw JSON value of [type]. + * Returns this class instance's primitive wire representation. * - * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type - - /** - * Returns the raw JSON value of [wireTransfers]. + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. * - * Unlike [wireTransfers], this method doesn't throw if the JSON field has an unexpected - * type. + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. */ - @JsonProperty("wire_transfers") - @ExcludeMissing - fun _wireTransfers(): JsonField = wireTransfers - - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } - fun toBuilder() = Builder().from(this) + private var validated: Boolean = false - companion object { + fun validate(): AchTransfers = apply { + if (validated) { + return@apply + } - /** - * Returns a mutable builder for constructing an instance of [Data]. - * - * The following fields are required: - * ```java - * .achTransfers() - * .fednowTransfers() - * .name() - * .realTimePaymentsTransfers() - * .routingNumber() - * .type() - * .wireTransfers() - * ``` - */ - @JvmStatic fun builder() = Builder() + known() + validated = true } - /** A builder for [Data]. */ - class Builder internal constructor() { - - private var achTransfers: JsonField? = null - private var fednowTransfers: JsonField? = null - private var name: JsonField? = null - private var realTimePaymentsTransfers: JsonField? = null - private var routingNumber: JsonField? = null - private var type: JsonField? = null - private var wireTransfers: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(data: Data) = apply { - achTransfers = data.achTransfers - fednowTransfers = data.fednowTransfers - name = data.name - realTimePaymentsTransfers = data.realTimePaymentsTransfers - routingNumber = data.routingNumber - type = data.type - wireTransfers = data.wireTransfers - additionalProperties = data.additionalProperties.toMutableMap() + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false } - /** This routing number's support for ACH Transfers. */ - fun achTransfers(achTransfers: AchTransfers) = achTransfers(JsonField.of(achTransfers)) + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - /** - * Sets [Builder.achTransfers] to an arbitrary JSON value. - * - * You should usually call [Builder.achTransfers] with a well-typed [AchTransfers] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun achTransfers(achTransfers: JsonField) = apply { - this.achTransfers = achTransfers + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** This routing number's support for FedNow Transfers. */ - fun fednowTransfers(fednowTransfers: FednowTransfers) = - fednowTransfers(JsonField.of(fednowTransfers)) - - /** - * Sets [Builder.fednowTransfers] to an arbitrary JSON value. - * - * You should usually call [Builder.fednowTransfers] with a well-typed [FednowTransfers] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun fednowTransfers(fednowTransfers: JsonField) = apply { - this.fednowTransfers = fednowTransfers - } + return other is AchTransfers && value == other.value + } - /** The name of the financial institution belonging to a routing number. */ - fun name(name: String) = name(JsonField.of(name)) + override fun hashCode() = value.hashCode() - /** - * Sets [Builder.name] to an arbitrary JSON value. - * - * You should usually call [Builder.name] with a well-typed [String] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun name(name: JsonField) = apply { this.name = name } + override fun toString() = value.toString() + } - /** This routing number's support for Real-Time Payments Transfers. */ - fun realTimePaymentsTransfers(realTimePaymentsTransfers: RealTimePaymentsTransfers) = - realTimePaymentsTransfers(JsonField.of(realTimePaymentsTransfers)) + /** This routing number's support for FedNow Transfers. */ + class FednowTransfers @JsonCreator private constructor(private val value: JsonField) : + Enum { - /** - * Sets [Builder.realTimePaymentsTransfers] to an arbitrary JSON value. - * - * You should usually call [Builder.realTimePaymentsTransfers] with a well-typed - * [RealTimePaymentsTransfers] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun realTimePaymentsTransfers( - realTimePaymentsTransfers: JsonField - ) = apply { this.realTimePaymentsTransfers = realTimePaymentsTransfers } + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - /** The nine digit routing number identifier. */ - fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + companion object { - /** - * Sets [Builder.routingNumber] to an arbitrary JSON value. - * - * You should usually call [Builder.routingNumber] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber - } + /** The routing number can receive this transfer type. */ + @JvmField val SUPPORTED = of("supported") - /** - * A constant representing the object's type. For this resource it will always be - * `routing_number`. - */ - fun type(type: Type) = type(JsonField.of(type)) + /** The routing number cannot receive this transfer type. */ + @JvmField val NOT_SUPPORTED = of("not_supported") - /** - * Sets [Builder.type] to an arbitrary JSON value. - * - * You should usually call [Builder.type] with a well-typed [Type] value instead. This - * method is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun type(type: JsonField) = apply { this.type = type } + @JvmStatic fun of(value: String) = FednowTransfers(JsonField.of(value)) + } - /** This routing number's support for Wire Transfers. */ - fun wireTransfers(wireTransfers: WireTransfers) = - wireTransfers(JsonField.of(wireTransfers)) + /** An enum containing [FednowTransfers]'s known values. */ + enum class Known { + /** The routing number can receive this transfer type. */ + SUPPORTED, + /** The routing number cannot receive this transfer type. */ + NOT_SUPPORTED, + } + /** + * An enum containing [FednowTransfers]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [FednowTransfers] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** The routing number can receive this transfer type. */ + SUPPORTED, + /** The routing number cannot receive this transfer type. */ + NOT_SUPPORTED, /** - * Sets [Builder.wireTransfers] to an arbitrary JSON value. - * - * You should usually call [Builder.wireTransfers] with a well-typed [WireTransfers] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. + * An enum member indicating that [FednowTransfers] was instantiated with an unknown + * value. */ - fun wireTransfers(wireTransfers: JsonField) = apply { - this.wireTransfers = wireTransfers - } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + _UNKNOWN, + } - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SUPPORTED -> Value.SUPPORTED + NOT_SUPPORTED -> Value.NOT_SUPPORTED + else -> Value._UNKNOWN } - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + SUPPORTED -> Known.SUPPORTED + NOT_SUPPORTED -> Known.NOT_SUPPORTED + else -> throw IncreaseInvalidDataException("Unknown FednowTransfers: $value") } - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } - - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") } - /** - * Returns an immutable instance of [Data]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .achTransfers() - * .fednowTransfers() - * .name() - * .realTimePaymentsTransfers() - * .routingNumber() - * .type() - * .wireTransfers() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): Data = - Data( - checkRequired("achTransfers", achTransfers), - checkRequired("fednowTransfers", fednowTransfers), - checkRequired("name", name), - checkRequired("realTimePaymentsTransfers", realTimePaymentsTransfers), - checkRequired("routingNumber", routingNumber), - checkRequired("type", type), - checkRequired("wireTransfers", wireTransfers), - additionalProperties.toMutableMap(), - ) - } - private var validated: Boolean = false - fun validate(): Data = apply { + fun validate(): FednowTransfers = apply { if (validated) { return@apply } - achTransfers().validate() - fednowTransfers().validate() - name() - realTimePaymentsTransfers().validate() - routingNumber() - type().validate() - wireTransfers().validate() + known() validated = true } @@ -620,733 +682,424 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = - (achTransfers.asKnown().getOrNull()?.validity() ?: 0) + - (fednowTransfers.asKnown().getOrNull()?.validity() ?: 0) + - (if (name.asKnown().isPresent) 1 else 0) + - (realTimePaymentsTransfers.asKnown().getOrNull()?.validity() ?: 0) + - (if (routingNumber.asKnown().isPresent) 1 else 0) + - (type.asKnown().getOrNull()?.validity() ?: 0) + - (wireTransfers.asKnown().getOrNull()?.validity() ?: 0) - - /** This routing number's support for ACH Transfers. */ - class AchTransfers @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** The routing number can receive this transfer type. */ - @JvmField val SUPPORTED = of("supported") - - /** The routing number cannot receive this transfer type. */ - @JvmField val NOT_SUPPORTED = of("not_supported") - - @JvmStatic fun of(value: String) = AchTransfers(JsonField.of(value)) - } - - /** An enum containing [AchTransfers]'s known values. */ - enum class Known { - /** The routing number can receive this transfer type. */ - SUPPORTED, - /** The routing number cannot receive this transfer type. */ - NOT_SUPPORTED, - } + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - /** - * An enum containing [AchTransfers]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [AchTransfers] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** The routing number can receive this transfer type. */ - SUPPORTED, - /** The routing number cannot receive this transfer type. */ - NOT_SUPPORTED, - /** - * An enum member indicating that [AchTransfers] was instantiated with an unknown - * value. - */ - _UNKNOWN, + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - SUPPORTED -> Value.SUPPORTED - NOT_SUPPORTED -> Value.NOT_SUPPORTED - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - SUPPORTED -> Known.SUPPORTED - NOT_SUPPORTED -> Known.NOT_SUPPORTED - else -> throw IncreaseInvalidDataException("Unknown AchTransfers: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false + return other is FednowTransfers && value == other.value + } - fun validate(): AchTransfers = apply { - if (validated) { - return@apply - } + override fun hashCode() = value.hashCode() - known() - validated = true - } + override fun toString() = value.toString() + } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + /** This routing number's support for Real-Time Payments Transfers. */ + class RealTimePaymentsTransfers + @JsonCreator + private constructor(private val value: JsonField) : Enum { - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + companion object { - return other is AchTransfers && value == other.value - } + /** The routing number can receive this transfer type. */ + @JvmField val SUPPORTED = of("supported") - override fun hashCode() = value.hashCode() + /** The routing number cannot receive this transfer type. */ + @JvmField val NOT_SUPPORTED = of("not_supported") - override fun toString() = value.toString() + @JvmStatic fun of(value: String) = RealTimePaymentsTransfers(JsonField.of(value)) } - /** This routing number's support for FedNow Transfers. */ - class FednowTransfers - @JsonCreator - private constructor(private val value: JsonField) : Enum { + /** An enum containing [RealTimePaymentsTransfers]'s known values. */ + enum class Known { + /** The routing number can receive this transfer type. */ + SUPPORTED, + /** The routing number cannot receive this transfer type. */ + NOT_SUPPORTED, + } + /** + * An enum containing [RealTimePaymentsTransfers]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [RealTimePaymentsTransfers] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** The routing number can receive this transfer type. */ + SUPPORTED, + /** The routing number cannot receive this transfer type. */ + NOT_SUPPORTED, /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. + * An enum member indicating that [RealTimePaymentsTransfers] was instantiated with an + * unknown value. */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** The routing number can receive this transfer type. */ - @JvmField val SUPPORTED = of("supported") - - /** The routing number cannot receive this transfer type. */ - @JvmField val NOT_SUPPORTED = of("not_supported") - - @JvmStatic fun of(value: String) = FednowTransfers(JsonField.of(value)) - } + _UNKNOWN, + } - /** An enum containing [FednowTransfers]'s known values. */ - enum class Known { - /** The routing number can receive this transfer type. */ - SUPPORTED, - /** The routing number cannot receive this transfer type. */ - NOT_SUPPORTED, + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SUPPORTED -> Value.SUPPORTED + NOT_SUPPORTED -> Value.NOT_SUPPORTED + else -> Value._UNKNOWN } - /** - * An enum containing [FednowTransfers]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [FednowTransfers] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** The routing number can receive this transfer type. */ - SUPPORTED, - /** The routing number cannot receive this transfer type. */ - NOT_SUPPORTED, - /** - * An enum member indicating that [FednowTransfers] was instantiated with an unknown - * value. - */ - _UNKNOWN, + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + SUPPORTED -> Known.SUPPORTED + NOT_SUPPORTED -> Known.NOT_SUPPORTED + else -> + throw IncreaseInvalidDataException("Unknown RealTimePaymentsTransfers: $value") } - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - SUPPORTED -> Value.SUPPORTED - NOT_SUPPORTED -> Value.NOT_SUPPORTED - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - SUPPORTED -> Known.SUPPORTED - NOT_SUPPORTED -> Known.NOT_SUPPORTED - else -> throw IncreaseInvalidDataException("Unknown FednowTransfers: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): FednowTransfers = apply { - if (validated) { - return@apply - } - - known() - validated = true + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + private var validated: Boolean = false - return other is FednowTransfers && value == other.value + fun validate(): RealTimePaymentsTransfers = apply { + if (validated) { + return@apply } - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() + known() + validated = true } - /** This routing number's support for Real-Time Payments Transfers. */ - class RealTimePaymentsTransfers - @JsonCreator - private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** The routing number can receive this transfer type. */ - @JvmField val SUPPORTED = of("supported") - - /** The routing number cannot receive this transfer type. */ - @JvmField val NOT_SUPPORTED = of("not_supported") - - @JvmStatic fun of(value: String) = RealTimePaymentsTransfers(JsonField.of(value)) + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false } - /** An enum containing [RealTimePaymentsTransfers]'s known values. */ - enum class Known { - /** The routing number can receive this transfer type. */ - SUPPORTED, - /** The routing number cannot receive this transfer type. */ - NOT_SUPPORTED, - } + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - /** - * An enum containing [RealTimePaymentsTransfers]'s known values, as well as an - * [_UNKNOWN] member. - * - * An instance of [RealTimePaymentsTransfers] can contain an unknown value in a couple - * of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** The routing number can receive this transfer type. */ - SUPPORTED, - /** The routing number cannot receive this transfer type. */ - NOT_SUPPORTED, - /** - * An enum member indicating that [RealTimePaymentsTransfers] was instantiated with - * an unknown value. - */ - _UNKNOWN, + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - SUPPORTED -> Value.SUPPORTED - NOT_SUPPORTED -> Value.NOT_SUPPORTED - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - SUPPORTED -> Known.SUPPORTED - NOT_SUPPORTED -> Known.NOT_SUPPORTED - else -> - throw IncreaseInvalidDataException( - "Unknown RealTimePaymentsTransfers: $value" - ) - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false + return other is RealTimePaymentsTransfers && value == other.value + } - fun validate(): RealTimePaymentsTransfers = apply { - if (validated) { - return@apply - } + override fun hashCode() = value.hashCode() - known() - validated = true - } + override fun toString() = value.toString() + } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + /** + * A constant representing the object's type. For this resource it will always be + * `routing_number`. + */ + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + companion object { - return other is RealTimePaymentsTransfers && value == other.value - } + @JvmField val ROUTING_NUMBER = of("routing_number") - override fun hashCode() = value.hashCode() + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + } - override fun toString() = value.toString() + /** An enum containing [Type]'s known values. */ + enum class Known { + ROUTING_NUMBER } /** - * A constant representing the object's type. For this resource it will always be - * `routing_number`. + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Type] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. */ - class Type @JsonCreator private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - @JvmField val ROUTING_NUMBER = of("routing_number") + enum class Value { + ROUTING_NUMBER, + /** An enum member indicating that [Type] was instantiated with an unknown value. */ + _UNKNOWN, + } - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + ROUTING_NUMBER -> Value.ROUTING_NUMBER + else -> Value._UNKNOWN } - /** An enum containing [Type]'s known values. */ - enum class Known { - ROUTING_NUMBER + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ROUTING_NUMBER -> Known.ROUTING_NUMBER + else -> throw IncreaseInvalidDataException("Unknown Type: $value") } - /** - * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Type] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - ROUTING_NUMBER, - /** An enum member indicating that [Type] was instantiated with an unknown value. */ - _UNKNOWN, + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") } - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - ROUTING_NUMBER -> Value.ROUTING_NUMBER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - ROUTING_NUMBER -> Known.ROUTING_NUMBER - else -> throw IncreaseInvalidDataException("Unknown Type: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Type = apply { - if (validated) { - return@apply - } + private var validated: Boolean = false - known() - validated = true + fun validate(): Type = apply { + if (validated) { + return@apply } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + known() + validated = true + } - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - return other is Type && value == other.value + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() + return other is Type && value == other.value } - /** This routing number's support for Wire Transfers. */ - class WireTransfers @JsonCreator private constructor(private val value: JsonField) : - Enum { + override fun hashCode() = value.hashCode() - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { + override fun toString() = value.toString() + } - /** The routing number can receive this transfer type. */ - @JvmField val SUPPORTED = of("supported") + /** This routing number's support for Wire Transfers. */ + class WireTransfers @JsonCreator private constructor(private val value: JsonField) : + Enum { - /** The routing number cannot receive this transfer type. */ - @JvmField val NOT_SUPPORTED = of("not_supported") + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is on an + * older version than the API, then the API may respond with new members that the SDK is + * unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - @JvmStatic fun of(value: String) = WireTransfers(JsonField.of(value)) - } + companion object { - /** An enum containing [WireTransfers]'s known values. */ - enum class Known { - /** The routing number can receive this transfer type. */ - SUPPORTED, - /** The routing number cannot receive this transfer type. */ - NOT_SUPPORTED, - } + /** The routing number can receive this transfer type. */ + @JvmField val SUPPORTED = of("supported") - /** - * An enum containing [WireTransfers]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [WireTransfers] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** The routing number can receive this transfer type. */ - SUPPORTED, - /** The routing number cannot receive this transfer type. */ - NOT_SUPPORTED, - /** - * An enum member indicating that [WireTransfers] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } + /** The routing number cannot receive this transfer type. */ + @JvmField val NOT_SUPPORTED = of("not_supported") - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - SUPPORTED -> Value.SUPPORTED - NOT_SUPPORTED -> Value.NOT_SUPPORTED - else -> Value._UNKNOWN - } + @JvmStatic fun of(value: String) = WireTransfers(JsonField.of(value)) + } - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - SUPPORTED -> Known.SUPPORTED - NOT_SUPPORTED -> Known.NOT_SUPPORTED - else -> throw IncreaseInvalidDataException("Unknown WireTransfers: $value") - } + /** An enum containing [WireTransfers]'s known values. */ + enum class Known { + /** The routing number can receive this transfer type. */ + SUPPORTED, + /** The routing number cannot receive this transfer type. */ + NOT_SUPPORTED, + } + /** + * An enum containing [WireTransfers]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [WireTransfers] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if the + * SDK is on an older version than the API, then the API may respond with new members that + * the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** The routing number can receive this transfer type. */ + SUPPORTED, + /** The routing number cannot receive this transfer type. */ + NOT_SUPPORTED, /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. + * An enum member indicating that [WireTransfers] was instantiated with an unknown + * value. */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } + _UNKNOWN, + } - private var validated: Boolean = false + /** + * Returns an enum member corresponding to this class instance's value, or [Value._UNKNOWN] + * if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you want + * to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SUPPORTED -> Value.SUPPORTED + NOT_SUPPORTED -> Value.NOT_SUPPORTED + else -> Value._UNKNOWN + } - fun validate(): WireTransfers = apply { - if (validated) { - return@apply - } + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and don't + * want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + SUPPORTED -> Known.SUPPORTED + NOT_SUPPORTED -> Known.NOT_SUPPORTED + else -> throw IncreaseInvalidDataException("Unknown WireTransfers: $value") + } - known() - validated = true + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + private var validated: Boolean = false - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + fun validate(): WireTransfers = apply { + if (validated) { + return@apply + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + known() + validated = true + } - return other is WireTransfers && value == other.value + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false } - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Data && - achTransfers == other.achTransfers && - fednowTransfers == other.fednowTransfers && - name == other.name && - realTimePaymentsTransfers == other.realTimePaymentsTransfers && - routingNumber == other.routingNumber && - type == other.type && - wireTransfers == other.wireTransfers && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - achTransfers, - fednowTransfers, - name, - realTimePaymentsTransfers, - routingNumber, - type, - wireTransfers, - additionalProperties, - ) + return other is WireTransfers && value == other.value } - override fun hashCode(): Int = hashCode + override fun hashCode() = value.hashCode() - override fun toString() = - "Data{achTransfers=$achTransfers, fednowTransfers=$fednowTransfers, name=$name, realTimePaymentsTransfers=$realTimePaymentsTransfers, routingNumber=$routingNumber, type=$type, wireTransfers=$wireTransfers, additionalProperties=$additionalProperties}" + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -1355,15 +1108,31 @@ private constructor( } return other is RoutingNumberListResponse && - data == other.data && - nextCursor == other.nextCursor && + achTransfers == other.achTransfers && + fednowTransfers == other.fednowTransfers && + name == other.name && + realTimePaymentsTransfers == other.realTimePaymentsTransfers && + routingNumber == other.routingNumber && + type == other.type && + wireTransfers == other.wireTransfers && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(data, nextCursor, additionalProperties) } + private val hashCode: Int by lazy { + Objects.hash( + achTransfers, + fednowTransfers, + name, + realTimePaymentsTransfers, + routingNumber, + type, + wireTransfers, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode override fun toString() = - "RoutingNumberListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "RoutingNumberListResponse{achTransfers=$achTransfers, fednowTransfers=$fednowTransfers, name=$name, realTimePaymentsTransfers=$realTimePaymentsTransfers, routingNumber=$routingNumber, type=$type, wireTransfers=$wireTransfers, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPage.kt new file mode 100644 index 000000000..363840e40 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.supplementaldocuments + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.SupplementalDocumentService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see SupplementalDocumentService.list */ +class SupplementalDocumentListPage +private constructor( + private val service: SupplementalDocumentService, + private val params: SupplementalDocumentListParams, + private val response: SupplementalDocumentListPageResponse, +) : Page { + + /** + * Delegates to [SupplementalDocumentListPageResponse], but gracefully handles missing data. + * + * @see SupplementalDocumentListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [SupplementalDocumentListPageResponse], but gracefully handles missing data. + * + * @see SupplementalDocumentListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): SupplementalDocumentListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): SupplementalDocumentListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): SupplementalDocumentListParams = params + + /** The response that this page was parsed from. */ + fun response(): SupplementalDocumentListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [SupplementalDocumentListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [SupplementalDocumentListPage]. */ + class Builder internal constructor() { + + private var service: SupplementalDocumentService? = null + private var params: SupplementalDocumentListParams? = null + private var response: SupplementalDocumentListPageResponse? = null + + @JvmSynthetic + internal fun from(supplementalDocumentListPage: SupplementalDocumentListPage) = apply { + service = supplementalDocumentListPage.service + params = supplementalDocumentListPage.params + response = supplementalDocumentListPage.response + } + + fun service(service: SupplementalDocumentService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: SupplementalDocumentListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: SupplementalDocumentListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [SupplementalDocumentListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): SupplementalDocumentListPage = + SupplementalDocumentListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is SupplementalDocumentListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "SupplementalDocumentListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPageAsync.kt new file mode 100644 index 000000000..a5f795cb1 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.supplementaldocuments + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.SupplementalDocumentServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see SupplementalDocumentServiceAsync.list */ +class SupplementalDocumentListPageAsync +private constructor( + private val service: SupplementalDocumentServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: SupplementalDocumentListParams, + private val response: SupplementalDocumentListPageResponse, +) : PageAsync { + + /** + * Delegates to [SupplementalDocumentListPageResponse], but gracefully handles missing data. + * + * @see SupplementalDocumentListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [SupplementalDocumentListPageResponse], but gracefully handles missing data. + * + * @see SupplementalDocumentListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): SupplementalDocumentListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): SupplementalDocumentListParams = params + + /** The response that this page was parsed from. */ + fun response(): SupplementalDocumentListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [SupplementalDocumentListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [SupplementalDocumentListPageAsync]. */ + class Builder internal constructor() { + + private var service: SupplementalDocumentServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: SupplementalDocumentListParams? = null + private var response: SupplementalDocumentListPageResponse? = null + + @JvmSynthetic + internal fun from(supplementalDocumentListPageAsync: SupplementalDocumentListPageAsync) = + apply { + service = supplementalDocumentListPageAsync.service + streamHandlerExecutor = supplementalDocumentListPageAsync.streamHandlerExecutor + params = supplementalDocumentListPageAsync.params + response = supplementalDocumentListPageAsync.response + } + + fun service(service: SupplementalDocumentServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: SupplementalDocumentListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: SupplementalDocumentListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [SupplementalDocumentListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): SupplementalDocumentListPageAsync = + SupplementalDocumentListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is SupplementalDocumentListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "SupplementalDocumentListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPageResponse.kt index 029417cd4..87630b151 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Supplemental Document objects. */ -class SupplementalDocumentListResponse +class SupplementalDocumentListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -86,7 +86,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [SupplementalDocumentListResponse]. + * [SupplementalDocumentListPageResponse]. * * The following fields are required: * ```java @@ -97,7 +97,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [SupplementalDocumentListResponse]. */ + /** A builder for [SupplementalDocumentListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -105,13 +105,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(supplementalDocumentListResponse: SupplementalDocumentListResponse) = - apply { - data = supplementalDocumentListResponse.data.map { it.toMutableList() } - nextCursor = supplementalDocumentListResponse.nextCursor - additionalProperties = - supplementalDocumentListResponse.additionalProperties.toMutableMap() - } + internal fun from( + supplementalDocumentListPageResponse: SupplementalDocumentListPageResponse + ) = apply { + data = supplementalDocumentListPageResponse.data.map { it.toMutableList() } + nextCursor = supplementalDocumentListPageResponse.nextCursor + additionalProperties = + supplementalDocumentListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -174,7 +175,7 @@ private constructor( } /** - * Returns an immutable instance of [SupplementalDocumentListResponse]. + * Returns an immutable instance of [SupplementalDocumentListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -186,8 +187,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): SupplementalDocumentListResponse = - SupplementalDocumentListResponse( + fun build(): SupplementalDocumentListPageResponse = + SupplementalDocumentListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -196,7 +197,7 @@ private constructor( private var validated: Boolean = false - fun validate(): SupplementalDocumentListResponse = apply { + fun validate(): SupplementalDocumentListPageResponse = apply { if (validated) { return@apply } @@ -229,7 +230,7 @@ private constructor( return true } - return other is SupplementalDocumentListResponse && + return other is SupplementalDocumentListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -240,5 +241,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "SupplementalDocumentListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "SupplementalDocumentListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListPage.kt new file mode 100644 index 000000000..39195ec5a --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.transactions + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.TransactionService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see TransactionService.list */ +class TransactionListPage +private constructor( + private val service: TransactionService, + private val params: TransactionListParams, + private val response: TransactionListPageResponse, +) : Page { + + /** + * Delegates to [TransactionListPageResponse], but gracefully handles missing data. + * + * @see TransactionListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [TransactionListPageResponse], but gracefully handles missing data. + * + * @see TransactionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): TransactionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): TransactionListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): TransactionListParams = params + + /** The response that this page was parsed from. */ + fun response(): TransactionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [TransactionListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TransactionListPage]. */ + class Builder internal constructor() { + + private var service: TransactionService? = null + private var params: TransactionListParams? = null + private var response: TransactionListPageResponse? = null + + @JvmSynthetic + internal fun from(transactionListPage: TransactionListPage) = apply { + service = transactionListPage.service + params = transactionListPage.params + response = transactionListPage.response + } + + fun service(service: TransactionService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: TransactionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: TransactionListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [TransactionListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TransactionListPage = + TransactionListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TransactionListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "TransactionListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListPageAsync.kt new file mode 100644 index 000000000..6ac1142b1 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.transactions + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.TransactionServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see TransactionServiceAsync.list */ +class TransactionListPageAsync +private constructor( + private val service: TransactionServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: TransactionListParams, + private val response: TransactionListPageResponse, +) : PageAsync { + + /** + * Delegates to [TransactionListPageResponse], but gracefully handles missing data. + * + * @see TransactionListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [TransactionListPageResponse], but gracefully handles missing data. + * + * @see TransactionListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): TransactionListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): TransactionListParams = params + + /** The response that this page was parsed from. */ + fun response(): TransactionListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [TransactionListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TransactionListPageAsync]. */ + class Builder internal constructor() { + + private var service: TransactionServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: TransactionListParams? = null + private var response: TransactionListPageResponse? = null + + @JvmSynthetic + internal fun from(transactionListPageAsync: TransactionListPageAsync) = apply { + service = transactionListPageAsync.service + streamHandlerExecutor = transactionListPageAsync.streamHandlerExecutor + params = transactionListPageAsync.params + response = transactionListPageAsync.response + } + + fun service(service: TransactionServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: TransactionListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: TransactionListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [TransactionListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TransactionListPageAsync = + TransactionListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TransactionListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "TransactionListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListPageResponse.kt index 50bdecc55..463455347 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/TransactionListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Transaction objects. */ -class TransactionListResponse +class TransactionListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -81,7 +81,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [TransactionListResponse]. + * Returns a mutable builder for constructing an instance of [TransactionListPageResponse]. * * The following fields are required: * ```java @@ -92,7 +92,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [TransactionListResponse]. */ + /** A builder for [TransactionListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -100,10 +100,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(transactionListResponse: TransactionListResponse) = apply { - data = transactionListResponse.data.map { it.toMutableList() } - nextCursor = transactionListResponse.nextCursor - additionalProperties = transactionListResponse.additionalProperties.toMutableMap() + internal fun from(transactionListPageResponse: TransactionListPageResponse) = apply { + data = transactionListPageResponse.data.map { it.toMutableList() } + nextCursor = transactionListPageResponse.nextCursor + additionalProperties = transactionListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -167,7 +167,7 @@ private constructor( } /** - * Returns an immutable instance of [TransactionListResponse]. + * Returns an immutable instance of [TransactionListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -179,8 +179,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): TransactionListResponse = - TransactionListResponse( + fun build(): TransactionListPageResponse = + TransactionListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -189,7 +189,7 @@ private constructor( private var validated: Boolean = false - fun validate(): TransactionListResponse = apply { + fun validate(): TransactionListPageResponse = apply { if (validated) { return@apply } @@ -222,7 +222,7 @@ private constructor( return true } - return other is TransactionListResponse && + return other is TransactionListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -233,5 +233,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "TransactionListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "TransactionListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPage.kt new file mode 100644 index 000000000..06ca2a61d --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPage.kt @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.wiredrawdownrequests + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.WireDrawdownRequestService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see WireDrawdownRequestService.list */ +class WireDrawdownRequestListPage +private constructor( + private val service: WireDrawdownRequestService, + private val params: WireDrawdownRequestListParams, + private val response: WireDrawdownRequestListPageResponse, +) : Page { + + /** + * Delegates to [WireDrawdownRequestListPageResponse], but gracefully handles missing data. + * + * @see WireDrawdownRequestListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [WireDrawdownRequestListPageResponse], but gracefully handles missing data. + * + * @see WireDrawdownRequestListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): WireDrawdownRequestListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): WireDrawdownRequestListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): WireDrawdownRequestListParams = params + + /** The response that this page was parsed from. */ + fun response(): WireDrawdownRequestListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [WireDrawdownRequestListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [WireDrawdownRequestListPage]. */ + class Builder internal constructor() { + + private var service: WireDrawdownRequestService? = null + private var params: WireDrawdownRequestListParams? = null + private var response: WireDrawdownRequestListPageResponse? = null + + @JvmSynthetic + internal fun from(wireDrawdownRequestListPage: WireDrawdownRequestListPage) = apply { + service = wireDrawdownRequestListPage.service + params = wireDrawdownRequestListPage.params + response = wireDrawdownRequestListPage.response + } + + fun service(service: WireDrawdownRequestService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: WireDrawdownRequestListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: WireDrawdownRequestListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [WireDrawdownRequestListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): WireDrawdownRequestListPage = + WireDrawdownRequestListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is WireDrawdownRequestListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "WireDrawdownRequestListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPageAsync.kt new file mode 100644 index 000000000..1b2f9dd6f --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.wiredrawdownrequests + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.WireDrawdownRequestServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see WireDrawdownRequestServiceAsync.list */ +class WireDrawdownRequestListPageAsync +private constructor( + private val service: WireDrawdownRequestServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: WireDrawdownRequestListParams, + private val response: WireDrawdownRequestListPageResponse, +) : PageAsync { + + /** + * Delegates to [WireDrawdownRequestListPageResponse], but gracefully handles missing data. + * + * @see WireDrawdownRequestListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [WireDrawdownRequestListPageResponse], but gracefully handles missing data. + * + * @see WireDrawdownRequestListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): WireDrawdownRequestListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): WireDrawdownRequestListParams = params + + /** The response that this page was parsed from. */ + fun response(): WireDrawdownRequestListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [WireDrawdownRequestListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [WireDrawdownRequestListPageAsync]. */ + class Builder internal constructor() { + + private var service: WireDrawdownRequestServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: WireDrawdownRequestListParams? = null + private var response: WireDrawdownRequestListPageResponse? = null + + @JvmSynthetic + internal fun from(wireDrawdownRequestListPageAsync: WireDrawdownRequestListPageAsync) = + apply { + service = wireDrawdownRequestListPageAsync.service + streamHandlerExecutor = wireDrawdownRequestListPageAsync.streamHandlerExecutor + params = wireDrawdownRequestListPageAsync.params + response = wireDrawdownRequestListPageAsync.response + } + + fun service(service: WireDrawdownRequestServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: WireDrawdownRequestListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: WireDrawdownRequestListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [WireDrawdownRequestListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): WireDrawdownRequestListPageAsync = + WireDrawdownRequestListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is WireDrawdownRequestListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "WireDrawdownRequestListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPageResponse.kt index 88f69104a..52e9d6477 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Wire Drawdown Request objects. */ -class WireDrawdownRequestListResponse +class WireDrawdownRequestListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -84,7 +84,7 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [WireDrawdownRequestListResponse]. + * [WireDrawdownRequestListPageResponse]. * * The following fields are required: * ```java @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [WireDrawdownRequestListResponse]. */ + /** A builder for [WireDrawdownRequestListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -103,13 +103,14 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(wireDrawdownRequestListResponse: WireDrawdownRequestListResponse) = - apply { - data = wireDrawdownRequestListResponse.data.map { it.toMutableList() } - nextCursor = wireDrawdownRequestListResponse.nextCursor - additionalProperties = - wireDrawdownRequestListResponse.additionalProperties.toMutableMap() - } + internal fun from( + wireDrawdownRequestListPageResponse: WireDrawdownRequestListPageResponse + ) = apply { + data = wireDrawdownRequestListPageResponse.data.map { it.toMutableList() } + nextCursor = wireDrawdownRequestListPageResponse.nextCursor + additionalProperties = + wireDrawdownRequestListPageResponse.additionalProperties.toMutableMap() + } /** The contents of the list. */ fun data(data: List) = data(JsonField.of(data)) @@ -172,7 +173,7 @@ private constructor( } /** - * Returns an immutable instance of [WireDrawdownRequestListResponse]. + * Returns an immutable instance of [WireDrawdownRequestListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -184,8 +185,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): WireDrawdownRequestListResponse = - WireDrawdownRequestListResponse( + fun build(): WireDrawdownRequestListPageResponse = + WireDrawdownRequestListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -194,7 +195,7 @@ private constructor( private var validated: Boolean = false - fun validate(): WireDrawdownRequestListResponse = apply { + fun validate(): WireDrawdownRequestListPageResponse = apply { if (validated) { return@apply } @@ -227,7 +228,7 @@ private constructor( return true } - return other is WireDrawdownRequestListResponse && + return other is WireDrawdownRequestListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -238,5 +239,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WireDrawdownRequestListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "WireDrawdownRequestListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListPage.kt new file mode 100644 index 000000000..12a197685 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListPage.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.wiretransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.WireTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see WireTransferService.list */ +class WireTransferListPage +private constructor( + private val service: WireTransferService, + private val params: WireTransferListParams, + private val response: WireTransferListPageResponse, +) : Page { + + /** + * Delegates to [WireTransferListPageResponse], but gracefully handles missing data. + * + * @see WireTransferListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [WireTransferListPageResponse], but gracefully handles missing data. + * + * @see WireTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): WireTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): WireTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): WireTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): WireTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [WireTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [WireTransferListPage]. */ + class Builder internal constructor() { + + private var service: WireTransferService? = null + private var params: WireTransferListParams? = null + private var response: WireTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(wireTransferListPage: WireTransferListPage) = apply { + service = wireTransferListPage.service + params = wireTransferListPage.params + response = wireTransferListPage.response + } + + fun service(service: WireTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: WireTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: WireTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [WireTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): WireTransferListPage = + WireTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is WireTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "WireTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageAsync.kt new file mode 100644 index 000000000..92d257bd6 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageAsync.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.wiretransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.WireTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see WireTransferServiceAsync.list */ +class WireTransferListPageAsync +private constructor( + private val service: WireTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: WireTransferListParams, + private val response: WireTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [WireTransferListPageResponse], but gracefully handles missing data. + * + * @see WireTransferListPageResponse.data + */ + fun data(): List = response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [WireTransferListPageResponse], but gracefully handles missing data. + * + * @see WireTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): WireTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): WireTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): WireTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [WireTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [WireTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: WireTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: WireTransferListParams? = null + private var response: WireTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(wireTransferListPageAsync: WireTransferListPageAsync) = apply { + service = wireTransferListPageAsync.service + streamHandlerExecutor = wireTransferListPageAsync.streamHandlerExecutor + params = wireTransferListPageAsync.params + response = wireTransferListPageAsync.response + } + + fun service(service: WireTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: WireTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: WireTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [WireTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): WireTransferListPageAsync = + WireTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is WireTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "WireTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponse.kt similarity index 89% rename from increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListResponse.kt rename to increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponse.kt index 88788abb7..8f775277a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListResponse.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponse.kt @@ -20,7 +20,7 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** A list of Wire Transfer objects. */ -class WireTransferListResponse +class WireTransferListPageResponse @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val data: JsonField>, @@ -83,7 +83,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [WireTransferListResponse]. + * Returns a mutable builder for constructing an instance of [WireTransferListPageResponse]. * * The following fields are required: * ```java @@ -94,7 +94,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [WireTransferListResponse]. */ + /** A builder for [WireTransferListPageResponse]. */ class Builder internal constructor() { private var data: JsonField>? = null @@ -102,10 +102,10 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(wireTransferListResponse: WireTransferListResponse) = apply { - data = wireTransferListResponse.data.map { it.toMutableList() } - nextCursor = wireTransferListResponse.nextCursor - additionalProperties = wireTransferListResponse.additionalProperties.toMutableMap() + internal fun from(wireTransferListPageResponse: WireTransferListPageResponse) = apply { + data = wireTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = wireTransferListPageResponse.nextCursor + additionalProperties = wireTransferListPageResponse.additionalProperties.toMutableMap() } /** The contents of the list. */ @@ -169,7 +169,7 @@ private constructor( } /** - * Returns an immutable instance of [WireTransferListResponse]. + * Returns an immutable instance of [WireTransferListPageResponse]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -181,8 +181,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): WireTransferListResponse = - WireTransferListResponse( + fun build(): WireTransferListPageResponse = + WireTransferListPageResponse( checkRequired("data", data).map { it.toImmutable() }, checkRequired("nextCursor", nextCursor), additionalProperties.toMutableMap(), @@ -191,7 +191,7 @@ private constructor( private var validated: Boolean = false - fun validate(): WireTransferListResponse = apply { + fun validate(): WireTransferListPageResponse = apply { if (validated) { return@apply } @@ -224,7 +224,7 @@ private constructor( return true } - return other is WireTransferListResponse && + return other is WireTransferListPageResponse && data == other.data && nextCursor == other.nextCursor && additionalProperties == other.additionalProperties @@ -235,5 +235,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WireTransferListResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" + "WireTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountNumberServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountNumberServiceAsync.kt index ca160e686..9b72bf3f4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountNumberServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountNumberServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.accountnumbers.AccountNumber import com.increase.api.models.accountnumbers.AccountNumberCreateParams +import com.increase.api.models.accountnumbers.AccountNumberListPageAsync import com.increase.api.models.accountnumbers.AccountNumberListParams -import com.increase.api.models.accountnumbers.AccountNumberListResponse import com.increase.api.models.accountnumbers.AccountNumberRetrieveParams import com.increase.api.models.accountnumbers.AccountNumberUpdateParams import java.util.concurrent.CompletableFuture @@ -109,21 +109,21 @@ interface AccountNumberServiceAsync { update(accountNumberId, AccountNumberUpdateParams.none(), requestOptions) /** List Account Numbers */ - fun list(): CompletableFuture = list(AccountNumberListParams.none()) + fun list(): CompletableFuture = list(AccountNumberListParams.none()) /** @see list */ fun list( params: AccountNumberListParams = AccountNumberListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: AccountNumberListParams = AccountNumberListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(AccountNumberListParams.none(), requestOptions) /** @@ -240,25 +240,25 @@ interface AccountNumberServiceAsync { * Returns a raw HTTP response for `get /account_numbers`, but is otherwise the same as * [AccountNumberServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(AccountNumberListParams.none()) /** @see list */ fun list( params: AccountNumberListParams = AccountNumberListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: AccountNumberListParams = AccountNumberListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(AccountNumberListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountNumberServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountNumberServiceAsyncImpl.kt index 6ff13e233..7d3a780f8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountNumberServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountNumberServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.accountnumbers.AccountNumber import com.increase.api.models.accountnumbers.AccountNumberCreateParams +import com.increase.api.models.accountnumbers.AccountNumberListPageAsync +import com.increase.api.models.accountnumbers.AccountNumberListPageResponse import com.increase.api.models.accountnumbers.AccountNumberListParams -import com.increase.api.models.accountnumbers.AccountNumberListResponse import com.increase.api.models.accountnumbers.AccountNumberRetrieveParams import com.increase.api.models.accountnumbers.AccountNumberUpdateParams import java.util.concurrent.CompletableFuture @@ -62,7 +63,7 @@ class AccountNumberServiceAsyncImpl internal constructor(private val clientOptio override fun list( params: AccountNumberListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /account_numbers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -177,13 +178,13 @@ class AccountNumberServiceAsyncImpl internal constructor(private val clientOptio } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AccountNumberListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -203,6 +204,14 @@ class AccountNumberServiceAsyncImpl internal constructor(private val clientOptio it.validate() } } + .let { + AccountNumberListPageAsync.builder() + .service(AccountNumberServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountServiceAsync.kt index ce6d2e149..8cbebecce 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountServiceAsync.kt @@ -9,8 +9,8 @@ import com.increase.api.models.accounts.Account import com.increase.api.models.accounts.AccountBalanceParams import com.increase.api.models.accounts.AccountCloseParams import com.increase.api.models.accounts.AccountCreateParams +import com.increase.api.models.accounts.AccountListPageAsync import com.increase.api.models.accounts.AccountListParams -import com.increase.api.models.accounts.AccountListResponse import com.increase.api.models.accounts.AccountRetrieveParams import com.increase.api.models.accounts.AccountUpdateParams import com.increase.api.models.accounts.BalanceLookup @@ -106,21 +106,21 @@ interface AccountServiceAsync { update(accountId, AccountUpdateParams.none(), requestOptions) /** List Accounts */ - fun list(): CompletableFuture = list(AccountListParams.none()) + fun list(): CompletableFuture = list(AccountListParams.none()) /** @see list */ fun list( params: AccountListParams = AccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: AccountListParams = AccountListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(AccountListParams.none(), requestOptions) /** @@ -302,25 +302,25 @@ interface AccountServiceAsync { * Returns a raw HTTP response for `get /accounts`, but is otherwise the same as * [AccountServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(AccountListParams.none()) /** @see list */ fun list( params: AccountListParams = AccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: AccountListParams = AccountListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(AccountListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountServiceAsyncImpl.kt index d11664f84..236b8462e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountServiceAsyncImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.accounts.Account import com.increase.api.models.accounts.AccountBalanceParams import com.increase.api.models.accounts.AccountCloseParams import com.increase.api.models.accounts.AccountCreateParams +import com.increase.api.models.accounts.AccountListPageAsync +import com.increase.api.models.accounts.AccountListPageResponse import com.increase.api.models.accounts.AccountListParams -import com.increase.api.models.accounts.AccountListResponse import com.increase.api.models.accounts.AccountRetrieveParams import com.increase.api.models.accounts.AccountUpdateParams import com.increase.api.models.accounts.BalanceLookup @@ -65,7 +66,7 @@ class AccountServiceAsyncImpl internal constructor(private val clientOptions: Cl override fun list( params: AccountListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /accounts withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -192,13 +193,13 @@ class AccountServiceAsyncImpl internal constructor(private val clientOptions: Cl } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AccountListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -218,6 +219,14 @@ class AccountServiceAsyncImpl internal constructor(private val clientOptions: Cl it.validate() } } + .let { + AccountListPageAsync.builder() + .service(AccountServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountStatementServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountStatementServiceAsync.kt index 476b5eb3d..b6a0da9c0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountStatementServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountStatementServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.accountstatements.AccountStatement +import com.increase.api.models.accountstatements.AccountStatementListPageAsync import com.increase.api.models.accountstatements.AccountStatementListParams -import com.increase.api.models.accountstatements.AccountStatementListResponse import com.increase.api.models.accountstatements.AccountStatementRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -63,22 +63,22 @@ interface AccountStatementServiceAsync { retrieve(accountStatementId, AccountStatementRetrieveParams.none(), requestOptions) /** List Account Statements */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(AccountStatementListParams.none()) /** @see list */ fun list( params: AccountStatementListParams = AccountStatementListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: AccountStatementListParams = AccountStatementListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(AccountStatementListParams.none(), requestOptions) /** @@ -146,25 +146,25 @@ interface AccountStatementServiceAsync { * Returns a raw HTTP response for `get /account_statements`, but is otherwise the same as * [AccountStatementServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(AccountStatementListParams.none()) /** @see list */ fun list( params: AccountStatementListParams = AccountStatementListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: AccountStatementListParams = AccountStatementListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(AccountStatementListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountStatementServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountStatementServiceAsyncImpl.kt index c1402cf11..7958f4ff1 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountStatementServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountStatementServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.accountstatements.AccountStatement +import com.increase.api.models.accountstatements.AccountStatementListPageAsync +import com.increase.api.models.accountstatements.AccountStatementListPageResponse import com.increase.api.models.accountstatements.AccountStatementListParams -import com.increase.api.models.accountstatements.AccountStatementListResponse import com.increase.api.models.accountstatements.AccountStatementRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -47,7 +48,7 @@ internal constructor(private val clientOptions: ClientOptions) : AccountStatemen override fun list( params: AccountStatementListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /account_statements withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -97,13 +98,13 @@ internal constructor(private val clientOptions: ClientOptions) : AccountStatemen } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AccountStatementListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -123,6 +124,14 @@ internal constructor(private val clientOptions: ClientOptions) : AccountStatemen it.validate() } } + .let { + AccountStatementListPageAsync.builder() + .service(AccountStatementServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountTransferServiceAsync.kt index 57ec6b181..04ab44dce 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountTransferServiceAsync.kt @@ -9,8 +9,8 @@ import com.increase.api.models.accounttransfers.AccountTransfer import com.increase.api.models.accounttransfers.AccountTransferApproveParams import com.increase.api.models.accounttransfers.AccountTransferCancelParams import com.increase.api.models.accounttransfers.AccountTransferCreateParams +import com.increase.api.models.accounttransfers.AccountTransferListPageAsync import com.increase.api.models.accounttransfers.AccountTransferListParams -import com.increase.api.models.accounttransfers.AccountTransferListResponse import com.increase.api.models.accounttransfers.AccountTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -76,22 +76,22 @@ interface AccountTransferServiceAsync { retrieve(accountTransferId, AccountTransferRetrieveParams.none(), requestOptions) /** List Account Transfers */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(AccountTransferListParams.none()) /** @see list */ fun list( params: AccountTransferListParams = AccountTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: AccountTransferListParams = AccountTransferListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(AccountTransferListParams.none(), requestOptions) /** Approves an Account Transfer in status `pending_approval`. */ @@ -245,25 +245,25 @@ interface AccountTransferServiceAsync { * Returns a raw HTTP response for `get /account_transfers`, but is otherwise the same as * [AccountTransferServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(AccountTransferListParams.none()) /** @see list */ fun list( params: AccountTransferListParams = AccountTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: AccountTransferListParams = AccountTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(AccountTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountTransferServiceAsyncImpl.kt index aa7c5cb2b..f1176b6d7 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AccountTransferServiceAsyncImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.accounttransfers.AccountTransfer import com.increase.api.models.accounttransfers.AccountTransferApproveParams import com.increase.api.models.accounttransfers.AccountTransferCancelParams import com.increase.api.models.accounttransfers.AccountTransferCreateParams +import com.increase.api.models.accounttransfers.AccountTransferListPageAsync +import com.increase.api.models.accounttransfers.AccountTransferListPageResponse import com.increase.api.models.accounttransfers.AccountTransferListParams -import com.increase.api.models.accounttransfers.AccountTransferListResponse import com.increase.api.models.accounttransfers.AccountTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -58,7 +59,7 @@ internal constructor(private val clientOptions: ClientOptions) : AccountTransfer override fun list( params: AccountTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /account_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -153,13 +154,13 @@ internal constructor(private val clientOptions: ClientOptions) : AccountTransfer } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AccountTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -179,6 +180,14 @@ internal constructor(private val clientOptions: ClientOptions) : AccountTransfer it.validate() } } + .let { + AccountTransferListPageAsync.builder() + .service(AccountTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsync.kt index 0a55b336c..e1b0d5a45 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.achprenotifications.AchPrenotification import com.increase.api.models.achprenotifications.AchPrenotificationCreateParams +import com.increase.api.models.achprenotifications.AchPrenotificationListPageAsync import com.increase.api.models.achprenotifications.AchPrenotificationListParams -import com.increase.api.models.achprenotifications.AchPrenotificationListResponse import com.increase.api.models.achprenotifications.AchPrenotificationRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -77,22 +77,22 @@ interface AchPrenotificationServiceAsync { retrieve(achPrenotificationId, AchPrenotificationRetrieveParams.none(), requestOptions) /** List ACH Prenotifications */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(AchPrenotificationListParams.none()) /** @see list */ fun list( params: AchPrenotificationListParams = AchPrenotificationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: AchPrenotificationListParams = AchPrenotificationListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(AchPrenotificationListParams.none(), requestOptions) /** @@ -175,25 +175,25 @@ interface AchPrenotificationServiceAsync { * Returns a raw HTTP response for `get /ach_prenotifications`, but is otherwise the same as * [AchPrenotificationServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(AchPrenotificationListParams.none()) /** @see list */ fun list( params: AchPrenotificationListParams = AchPrenotificationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: AchPrenotificationListParams = AchPrenotificationListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(AchPrenotificationListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsyncImpl.kt index babd14f56..44378140a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.achprenotifications.AchPrenotification import com.increase.api.models.achprenotifications.AchPrenotificationCreateParams +import com.increase.api.models.achprenotifications.AchPrenotificationListPageAsync +import com.increase.api.models.achprenotifications.AchPrenotificationListPageResponse import com.increase.api.models.achprenotifications.AchPrenotificationListParams -import com.increase.api.models.achprenotifications.AchPrenotificationListResponse import com.increase.api.models.achprenotifications.AchPrenotificationRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -58,7 +59,7 @@ internal constructor(private val clientOptions: ClientOptions) : AchPrenotificat override fun list( params: AchPrenotificationListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /ach_prenotifications withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -139,13 +140,13 @@ internal constructor(private val clientOptions: ClientOptions) : AchPrenotificat } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AchPrenotificationListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -165,6 +166,14 @@ internal constructor(private val clientOptions: ClientOptions) : AchPrenotificat it.validate() } } + .let { + AchPrenotificationListPageAsync.builder() + .service(AchPrenotificationServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchTransferServiceAsync.kt index 04fbc61e2..28fc3c023 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchTransferServiceAsync.kt @@ -9,8 +9,8 @@ import com.increase.api.models.achtransfers.AchTransfer import com.increase.api.models.achtransfers.AchTransferApproveParams import com.increase.api.models.achtransfers.AchTransferCancelParams import com.increase.api.models.achtransfers.AchTransferCreateParams +import com.increase.api.models.achtransfers.AchTransferListPageAsync import com.increase.api.models.achtransfers.AchTransferListParams -import com.increase.api.models.achtransfers.AchTransferListResponse import com.increase.api.models.achtransfers.AchTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -75,21 +75,21 @@ interface AchTransferServiceAsync { retrieve(achTransferId, AchTransferRetrieveParams.none(), requestOptions) /** List ACH Transfers */ - fun list(): CompletableFuture = list(AchTransferListParams.none()) + fun list(): CompletableFuture = list(AchTransferListParams.none()) /** @see list */ fun list( params: AchTransferListParams = AchTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: AchTransferListParams = AchTransferListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(AchTransferListParams.none(), requestOptions) /** Approves an ACH Transfer in a pending_approval state. */ @@ -235,25 +235,25 @@ interface AchTransferServiceAsync { * Returns a raw HTTP response for `get /ach_transfers`, but is otherwise the same as * [AchTransferServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(AchTransferListParams.none()) /** @see list */ fun list( params: AchTransferListParams = AchTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: AchTransferListParams = AchTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(AchTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchTransferServiceAsyncImpl.kt index 4f138bb77..b96b42809 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/AchTransferServiceAsyncImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.achtransfers.AchTransfer import com.increase.api.models.achtransfers.AchTransferApproveParams import com.increase.api.models.achtransfers.AchTransferCancelParams import com.increase.api.models.achtransfers.AchTransferCreateParams +import com.increase.api.models.achtransfers.AchTransferListPageAsync +import com.increase.api.models.achtransfers.AchTransferListPageResponse import com.increase.api.models.achtransfers.AchTransferListParams -import com.increase.api.models.achtransfers.AchTransferListResponse import com.increase.api.models.achtransfers.AchTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -56,7 +57,7 @@ class AchTransferServiceAsyncImpl internal constructor(private val clientOptions override fun list( params: AchTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /ach_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -151,13 +152,13 @@ class AchTransferServiceAsyncImpl internal constructor(private val clientOptions } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AchTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -177,6 +178,14 @@ class AchTransferServiceAsyncImpl internal constructor(private val clientOptions it.validate() } } + .let { + AchTransferListPageAsync.builder() + .service(AchTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsync.kt index c34cc50c9..a0a1d3f58 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsync.kt @@ -8,8 +8,8 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.bookkeepingaccounts.BookkeepingAccount import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountBalanceParams import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountCreateParams +import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListPageAsync import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListParams -import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListResponse import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountUpdateParams import com.increase.api.models.bookkeepingaccounts.BookkeepingBalanceLookup import java.util.concurrent.CompletableFuture @@ -68,22 +68,22 @@ interface BookkeepingAccountServiceAsync { ): CompletableFuture /** List Bookkeeping Accounts */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(BookkeepingAccountListParams.none()) /** @see list */ fun list( params: BookkeepingAccountListParams = BookkeepingAccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: BookkeepingAccountListParams = BookkeepingAccountListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(BookkeepingAccountListParams.none(), requestOptions) /** Retrieve a Bookkeeping Account Balance */ @@ -193,25 +193,25 @@ interface BookkeepingAccountServiceAsync { * Returns a raw HTTP response for `get /bookkeeping_accounts`, but is otherwise the same as * [BookkeepingAccountServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(BookkeepingAccountListParams.none()) /** @see list */ fun list( params: BookkeepingAccountListParams = BookkeepingAccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: BookkeepingAccountListParams = BookkeepingAccountListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(BookkeepingAccountListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsyncImpl.kt index c6ad477df..821815ac7 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsyncImpl.kt @@ -19,8 +19,9 @@ import com.increase.api.core.prepareAsync import com.increase.api.models.bookkeepingaccounts.BookkeepingAccount import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountBalanceParams import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountCreateParams +import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListPageAsync +import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListPageResponse import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListParams -import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListResponse import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountUpdateParams import com.increase.api.models.bookkeepingaccounts.BookkeepingBalanceLookup import java.util.concurrent.CompletableFuture @@ -60,7 +61,7 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingAcco override fun list( params: BookkeepingAccountListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /bookkeeping_accounts withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -149,13 +150,13 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingAcco } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: BookkeepingAccountListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -175,6 +176,14 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingAcco it.validate() } } + .let { + BookkeepingAccountListPageAsync.builder() + .service(BookkeepingAccountServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsync.kt index 596cb45a2..1320c427f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.bookkeepingentries.BookkeepingEntry +import com.increase.api.models.bookkeepingentries.BookkeepingEntryListPageAsync import com.increase.api.models.bookkeepingentries.BookkeepingEntryListParams -import com.increase.api.models.bookkeepingentries.BookkeepingEntryListResponse import com.increase.api.models.bookkeepingentries.BookkeepingEntryRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -63,22 +63,22 @@ interface BookkeepingEntryServiceAsync { retrieve(bookkeepingEntryId, BookkeepingEntryRetrieveParams.none(), requestOptions) /** List Bookkeeping Entries */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(BookkeepingEntryListParams.none()) /** @see list */ fun list( params: BookkeepingEntryListParams = BookkeepingEntryListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: BookkeepingEntryListParams = BookkeepingEntryListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(BookkeepingEntryListParams.none(), requestOptions) /** @@ -146,25 +146,25 @@ interface BookkeepingEntryServiceAsync { * Returns a raw HTTP response for `get /bookkeeping_entries`, but is otherwise the same as * [BookkeepingEntryServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(BookkeepingEntryListParams.none()) /** @see list */ fun list( params: BookkeepingEntryListParams = BookkeepingEntryListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: BookkeepingEntryListParams = BookkeepingEntryListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(BookkeepingEntryListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsyncImpl.kt index d2e2e1ed9..b4577b894 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.bookkeepingentries.BookkeepingEntry +import com.increase.api.models.bookkeepingentries.BookkeepingEntryListPageAsync +import com.increase.api.models.bookkeepingentries.BookkeepingEntryListPageResponse import com.increase.api.models.bookkeepingentries.BookkeepingEntryListParams -import com.increase.api.models.bookkeepingentries.BookkeepingEntryListResponse import com.increase.api.models.bookkeepingentries.BookkeepingEntryRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -47,7 +48,7 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingEntr override fun list( params: BookkeepingEntryListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /bookkeeping_entries withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -97,13 +98,13 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingEntr } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: BookkeepingEntryListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -123,6 +124,14 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingEntr it.validate() } } + .let { + BookkeepingEntryListPageAsync.builder() + .service(BookkeepingEntryServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsync.kt index b82402b42..166d683a0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySet import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetCreateParams +import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListPageAsync import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListParams -import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListResponse import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -78,22 +78,22 @@ interface BookkeepingEntrySetServiceAsync { retrieve(bookkeepingEntrySetId, BookkeepingEntrySetRetrieveParams.none(), requestOptions) /** List Bookkeeping Entry Sets */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(BookkeepingEntrySetListParams.none()) /** @see list */ fun list( params: BookkeepingEntrySetListParams = BookkeepingEntrySetListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: BookkeepingEntrySetListParams = BookkeepingEntrySetListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(BookkeepingEntrySetListParams.none(), requestOptions) /** @@ -180,25 +180,25 @@ interface BookkeepingEntrySetServiceAsync { * Returns a raw HTTP response for `get /bookkeeping_entry_sets`, but is otherwise the same * as [BookkeepingEntrySetServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(BookkeepingEntrySetListParams.none()) /** @see list */ fun list( params: BookkeepingEntrySetListParams = BookkeepingEntrySetListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: BookkeepingEntrySetListParams = BookkeepingEntrySetListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(BookkeepingEntrySetListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsyncImpl.kt index b924b7e52..9531c2895 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySet import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetCreateParams +import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListPageAsync +import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListPageResponse import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListParams -import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListResponse import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -59,7 +60,7 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingEntr override fun list( params: BookkeepingEntrySetListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /bookkeeping_entry_sets withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -140,13 +141,13 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingEntr } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: BookkeepingEntrySetListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -166,6 +167,14 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingEntr it.validate() } } + .let { + BookkeepingEntrySetListPageAsync.builder() + .service(BookkeepingEntrySetServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardDisputeServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardDisputeServiceAsync.kt index cd15c03b0..da5b6fddc 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardDisputeServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardDisputeServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.carddisputes.CardDispute import com.increase.api.models.carddisputes.CardDisputeCreateParams +import com.increase.api.models.carddisputes.CardDisputeListPageAsync import com.increase.api.models.carddisputes.CardDisputeListParams -import com.increase.api.models.carddisputes.CardDisputeListResponse import com.increase.api.models.carddisputes.CardDisputeRetrieveParams import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams import com.increase.api.models.carddisputes.CardDisputeWithdrawParams @@ -75,21 +75,21 @@ interface CardDisputeServiceAsync { retrieve(cardDisputeId, CardDisputeRetrieveParams.none(), requestOptions) /** List Card Disputes */ - fun list(): CompletableFuture = list(CardDisputeListParams.none()) + fun list(): CompletableFuture = list(CardDisputeListParams.none()) /** @see list */ fun list( params: CardDisputeListParams = CardDisputeListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: CardDisputeListParams = CardDisputeListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(CardDisputeListParams.none(), requestOptions) /** Submit a User Submission for a Card Dispute */ @@ -229,25 +229,25 @@ interface CardDisputeServiceAsync { * Returns a raw HTTP response for `get /card_disputes`, but is otherwise the same as * [CardDisputeServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(CardDisputeListParams.none()) /** @see list */ fun list( params: CardDisputeListParams = CardDisputeListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: CardDisputeListParams = CardDisputeListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(CardDisputeListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncImpl.kt index e298e1ca9..8714063fe 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.carddisputes.CardDispute import com.increase.api.models.carddisputes.CardDisputeCreateParams +import com.increase.api.models.carddisputes.CardDisputeListPageAsync +import com.increase.api.models.carddisputes.CardDisputeListPageResponse import com.increase.api.models.carddisputes.CardDisputeListParams -import com.increase.api.models.carddisputes.CardDisputeListResponse import com.increase.api.models.carddisputes.CardDisputeRetrieveParams import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams import com.increase.api.models.carddisputes.CardDisputeWithdrawParams @@ -56,7 +57,7 @@ class CardDisputeServiceAsyncImpl internal constructor(private val clientOptions override fun list( params: CardDisputeListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /card_disputes withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -151,13 +152,13 @@ class CardDisputeServiceAsyncImpl internal constructor(private val clientOptions } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardDisputeListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -177,6 +178,14 @@ class CardDisputeServiceAsyncImpl internal constructor(private val clientOptions it.validate() } } + .let { + CardDisputeListPageAsync.builder() + .service(CardDisputeServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPaymentServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPaymentServiceAsync.kt index 71d45942e..233e0fcc3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPaymentServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPaymentServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.cardpayments.CardPayment +import com.increase.api.models.cardpayments.CardPaymentListPageAsync import com.increase.api.models.cardpayments.CardPaymentListParams -import com.increase.api.models.cardpayments.CardPaymentListResponse import com.increase.api.models.cardpayments.CardPaymentRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -62,21 +62,21 @@ interface CardPaymentServiceAsync { retrieve(cardPaymentId, CardPaymentRetrieveParams.none(), requestOptions) /** List Card Payments */ - fun list(): CompletableFuture = list(CardPaymentListParams.none()) + fun list(): CompletableFuture = list(CardPaymentListParams.none()) /** @see list */ fun list( params: CardPaymentListParams = CardPaymentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: CardPaymentListParams = CardPaymentListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(CardPaymentListParams.none(), requestOptions) /** @@ -138,25 +138,25 @@ interface CardPaymentServiceAsync { * Returns a raw HTTP response for `get /card_payments`, but is otherwise the same as * [CardPaymentServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(CardPaymentListParams.none()) /** @see list */ fun list( params: CardPaymentListParams = CardPaymentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: CardPaymentListParams = CardPaymentListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(CardPaymentListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPaymentServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPaymentServiceAsyncImpl.kt index 565fa254e..602987d3c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPaymentServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPaymentServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.cardpayments.CardPayment +import com.increase.api.models.cardpayments.CardPaymentListPageAsync +import com.increase.api.models.cardpayments.CardPaymentListPageResponse import com.increase.api.models.cardpayments.CardPaymentListParams -import com.increase.api.models.cardpayments.CardPaymentListResponse import com.increase.api.models.cardpayments.CardPaymentRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -45,7 +46,7 @@ class CardPaymentServiceAsyncImpl internal constructor(private val clientOptions override fun list( params: CardPaymentListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /card_payments withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -95,13 +96,13 @@ class CardPaymentServiceAsyncImpl internal constructor(private val clientOptions } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardPaymentListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -121,6 +122,14 @@ class CardPaymentServiceAsyncImpl internal constructor(private val clientOptions it.validate() } } + .let { + CardPaymentListPageAsync.builder() + .service(CardPaymentServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsync.kt index 9ff60fcdc..7cdcc2d98 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplement +import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListPageAsync import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListParams -import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListResponse import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -71,24 +71,24 @@ interface CardPurchaseSupplementServiceAsync { ) /** List Card Purchase Supplements */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(CardPurchaseSupplementListParams.none()) /** @see list */ fun list( params: CardPurchaseSupplementListParams = CardPurchaseSupplementListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: CardPurchaseSupplementListParams = CardPurchaseSupplementListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture = + ): CompletableFuture = list(CardPurchaseSupplementListParams.none(), requestOptions) /** @@ -163,25 +163,25 @@ interface CardPurchaseSupplementServiceAsync { * Returns a raw HTTP response for `get /card_purchase_supplements`, but is otherwise the * same as [CardPurchaseSupplementServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(CardPurchaseSupplementListParams.none()) /** @see list */ fun list( params: CardPurchaseSupplementListParams = CardPurchaseSupplementListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: CardPurchaseSupplementListParams = CardPurchaseSupplementListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(CardPurchaseSupplementListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsyncImpl.kt index 2b4b3604b..20c2a998c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplement +import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListPageAsync +import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListPageResponse import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListParams -import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListResponse import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -51,7 +52,7 @@ internal constructor(private val clientOptions: ClientOptions) : override fun list( params: CardPurchaseSupplementListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /card_purchase_supplements withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -101,13 +102,13 @@ internal constructor(private val clientOptions: ClientOptions) : } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardPurchaseSupplementListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -127,6 +128,14 @@ internal constructor(private val clientOptions: ClientOptions) : it.validate() } } + .let { + CardPurchaseSupplementListPageAsync.builder() + .service(CardPurchaseSupplementServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPushTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPushTransferServiceAsync.kt index ce1c615db..c403c059f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPushTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPushTransferServiceAsync.kt @@ -9,8 +9,8 @@ import com.increase.api.models.cardpushtransfers.CardPushTransfer import com.increase.api.models.cardpushtransfers.CardPushTransferApproveParams import com.increase.api.models.cardpushtransfers.CardPushTransferCancelParams import com.increase.api.models.cardpushtransfers.CardPushTransferCreateParams +import com.increase.api.models.cardpushtransfers.CardPushTransferListPageAsync import com.increase.api.models.cardpushtransfers.CardPushTransferListParams -import com.increase.api.models.cardpushtransfers.CardPushTransferListResponse import com.increase.api.models.cardpushtransfers.CardPushTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -76,22 +76,22 @@ interface CardPushTransferServiceAsync { retrieve(cardPushTransferId, CardPushTransferRetrieveParams.none(), requestOptions) /** List Card Push Transfers */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(CardPushTransferListParams.none()) /** @see list */ fun list( params: CardPushTransferListParams = CardPushTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: CardPushTransferListParams = CardPushTransferListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(CardPushTransferListParams.none(), requestOptions) /** Approves a Card Push Transfer in a pending_approval state. */ @@ -246,25 +246,25 @@ interface CardPushTransferServiceAsync { * Returns a raw HTTP response for `get /card_push_transfers`, but is otherwise the same as * [CardPushTransferServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(CardPushTransferListParams.none()) /** @see list */ fun list( params: CardPushTransferListParams = CardPushTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: CardPushTransferListParams = CardPushTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(CardPushTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPushTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPushTransferServiceAsyncImpl.kt index 288de93d3..96ac722c2 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPushTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardPushTransferServiceAsyncImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.cardpushtransfers.CardPushTransfer import com.increase.api.models.cardpushtransfers.CardPushTransferApproveParams import com.increase.api.models.cardpushtransfers.CardPushTransferCancelParams import com.increase.api.models.cardpushtransfers.CardPushTransferCreateParams +import com.increase.api.models.cardpushtransfers.CardPushTransferListPageAsync +import com.increase.api.models.cardpushtransfers.CardPushTransferListPageResponse import com.increase.api.models.cardpushtransfers.CardPushTransferListParams -import com.increase.api.models.cardpushtransfers.CardPushTransferListResponse import com.increase.api.models.cardpushtransfers.CardPushTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -58,7 +59,7 @@ internal constructor(private val clientOptions: ClientOptions) : CardPushTransfe override fun list( params: CardPushTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /card_push_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -153,13 +154,13 @@ internal constructor(private val clientOptions: ClientOptions) : CardPushTransfe } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardPushTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -179,6 +180,14 @@ internal constructor(private val clientOptions: ClientOptions) : CardPushTransfe it.validate() } } + .let { + CardPushTransferListPageAsync.builder() + .service(CardPushTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardServiceAsync.kt index 94de5a262..61e3df8f8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardServiceAsync.kt @@ -11,8 +11,8 @@ import com.increase.api.models.cards.CardCreateParams import com.increase.api.models.cards.CardDetails import com.increase.api.models.cards.CardDetailsParams import com.increase.api.models.cards.CardIframeUrl +import com.increase.api.models.cards.CardListPageAsync import com.increase.api.models.cards.CardListParams -import com.increase.api.models.cards.CardListResponse import com.increase.api.models.cards.CardRetrieveParams import com.increase.api.models.cards.CardUpdateParams import com.increase.api.models.cards.CardUpdatePinParams @@ -105,20 +105,20 @@ interface CardServiceAsync { update(cardId, CardUpdateParams.none(), requestOptions) /** List Cards */ - fun list(): CompletableFuture = list(CardListParams.none()) + fun list(): CompletableFuture = list(CardListParams.none()) /** @see list */ fun list( params: CardListParams = CardListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ - fun list(params: CardListParams = CardListParams.none()): CompletableFuture = + fun list(params: CardListParams = CardListParams.none()): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(CardListParams.none(), requestOptions) /** @@ -321,25 +321,25 @@ interface CardServiceAsync { * Returns a raw HTTP response for `get /cards`, but is otherwise the same as * [CardServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(CardListParams.none()) /** @see list */ fun list( params: CardListParams = CardListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: CardListParams = CardListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(CardListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardServiceAsyncImpl.kt index d96941338..4c3d94703 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardServiceAsyncImpl.kt @@ -22,8 +22,9 @@ import com.increase.api.models.cards.CardCreateParams import com.increase.api.models.cards.CardDetails import com.increase.api.models.cards.CardDetailsParams import com.increase.api.models.cards.CardIframeUrl +import com.increase.api.models.cards.CardListPageAsync +import com.increase.api.models.cards.CardListPageResponse import com.increase.api.models.cards.CardListParams -import com.increase.api.models.cards.CardListResponse import com.increase.api.models.cards.CardRetrieveParams import com.increase.api.models.cards.CardUpdateParams import com.increase.api.models.cards.CardUpdatePinParams @@ -67,7 +68,7 @@ class CardServiceAsyncImpl internal constructor(private val clientOptions: Clien override fun list( params: CardListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /cards withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -200,13 +201,13 @@ class CardServiceAsyncImpl internal constructor(private val clientOptions: Clien } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -226,6 +227,14 @@ class CardServiceAsyncImpl internal constructor(private val clientOptions: Clien it.validate() } } + .let { + CardListPageAsync.builder() + .service(CardServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardTokenServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardTokenServiceAsync.kt index c6b22c5b5..0f575bd74 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardTokenServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardTokenServiceAsync.kt @@ -8,8 +8,8 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.cardtokens.CardToken import com.increase.api.models.cardtokens.CardTokenCapabilities import com.increase.api.models.cardtokens.CardTokenCapabilitiesParams +import com.increase.api.models.cardtokens.CardTokenListPageAsync import com.increase.api.models.cardtokens.CardTokenListParams -import com.increase.api.models.cardtokens.CardTokenListResponse import com.increase.api.models.cardtokens.CardTokenRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -64,21 +64,21 @@ interface CardTokenServiceAsync { retrieve(cardTokenId, CardTokenRetrieveParams.none(), requestOptions) /** List Card Tokens */ - fun list(): CompletableFuture = list(CardTokenListParams.none()) + fun list(): CompletableFuture = list(CardTokenListParams.none()) /** @see list */ fun list( params: CardTokenListParams = CardTokenListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: CardTokenListParams = CardTokenListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(CardTokenListParams.none(), requestOptions) /** @@ -180,25 +180,25 @@ interface CardTokenServiceAsync { * Returns a raw HTTP response for `get /card_tokens`, but is otherwise the same as * [CardTokenServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(CardTokenListParams.none()) /** @see list */ fun list( params: CardTokenListParams = CardTokenListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: CardTokenListParams = CardTokenListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(CardTokenListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardTokenServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardTokenServiceAsyncImpl.kt index 4259a4125..4d23b37f2 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardTokenServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardTokenServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.prepareAsync import com.increase.api.models.cardtokens.CardToken import com.increase.api.models.cardtokens.CardTokenCapabilities import com.increase.api.models.cardtokens.CardTokenCapabilitiesParams +import com.increase.api.models.cardtokens.CardTokenListPageAsync +import com.increase.api.models.cardtokens.CardTokenListPageResponse import com.increase.api.models.cardtokens.CardTokenListParams -import com.increase.api.models.cardtokens.CardTokenListResponse import com.increase.api.models.cardtokens.CardTokenRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -47,7 +48,7 @@ class CardTokenServiceAsyncImpl internal constructor(private val clientOptions: override fun list( params: CardTokenListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /card_tokens withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -104,13 +105,13 @@ class CardTokenServiceAsyncImpl internal constructor(private val clientOptions: } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardTokenListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -130,6 +131,14 @@ class CardTokenServiceAsyncImpl internal constructor(private val clientOptions: it.validate() } } + .let { + CardTokenListPageAsync.builder() + .service(CardTokenServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardValidationServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardValidationServiceAsync.kt index eee35d979..5e203d626 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardValidationServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardValidationServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.cardvalidations.CardValidation import com.increase.api.models.cardvalidations.CardValidationCreateParams +import com.increase.api.models.cardvalidations.CardValidationListPageAsync import com.increase.api.models.cardvalidations.CardValidationListParams -import com.increase.api.models.cardvalidations.CardValidationListResponse import com.increase.api.models.cardvalidations.CardValidationRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -73,22 +73,22 @@ interface CardValidationServiceAsync { retrieve(cardValidationId, CardValidationRetrieveParams.none(), requestOptions) /** List Card Validations */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(CardValidationListParams.none()) /** @see list */ fun list( params: CardValidationListParams = CardValidationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: CardValidationListParams = CardValidationListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(CardValidationListParams.none(), requestOptions) /** @@ -166,25 +166,25 @@ interface CardValidationServiceAsync { * Returns a raw HTTP response for `get /card_validations`, but is otherwise the same as * [CardValidationServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(CardValidationListParams.none()) /** @see list */ fun list( params: CardValidationListParams = CardValidationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: CardValidationListParams = CardValidationListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(CardValidationListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardValidationServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardValidationServiceAsyncImpl.kt index 16d93d450..2e217097b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardValidationServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CardValidationServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.cardvalidations.CardValidation import com.increase.api.models.cardvalidations.CardValidationCreateParams +import com.increase.api.models.cardvalidations.CardValidationListPageAsync +import com.increase.api.models.cardvalidations.CardValidationListPageResponse import com.increase.api.models.cardvalidations.CardValidationListParams -import com.increase.api.models.cardvalidations.CardValidationListResponse import com.increase.api.models.cardvalidations.CardValidationRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -56,7 +57,7 @@ internal constructor(private val clientOptions: ClientOptions) : CardValidationS override fun list( params: CardValidationListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /card_validations withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -137,13 +138,13 @@ internal constructor(private val clientOptions: ClientOptions) : CardValidationS } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardValidationListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -163,6 +164,14 @@ internal constructor(private val clientOptions: ClientOptions) : CardValidationS it.validate() } } + .let { + CardValidationListPageAsync.builder() + .service(CardValidationServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckDepositServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckDepositServiceAsync.kt index 3ac16705b..872a0668f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckDepositServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckDepositServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.checkdeposits.CheckDeposit import com.increase.api.models.checkdeposits.CheckDepositCreateParams +import com.increase.api.models.checkdeposits.CheckDepositListPageAsync import com.increase.api.models.checkdeposits.CheckDepositListParams -import com.increase.api.models.checkdeposits.CheckDepositListResponse import com.increase.api.models.checkdeposits.CheckDepositRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -73,21 +73,21 @@ interface CheckDepositServiceAsync { retrieve(checkDepositId, CheckDepositRetrieveParams.none(), requestOptions) /** List Check Deposits */ - fun list(): CompletableFuture = list(CheckDepositListParams.none()) + fun list(): CompletableFuture = list(CheckDepositListParams.none()) /** @see list */ fun list( params: CheckDepositListParams = CheckDepositListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: CheckDepositListParams = CheckDepositListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(CheckDepositListParams.none(), requestOptions) /** @@ -164,25 +164,25 @@ interface CheckDepositServiceAsync { * Returns a raw HTTP response for `get /check_deposits`, but is otherwise the same as * [CheckDepositServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(CheckDepositListParams.none()) /** @see list */ fun list( params: CheckDepositListParams = CheckDepositListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: CheckDepositListParams = CheckDepositListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(CheckDepositListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckDepositServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckDepositServiceAsyncImpl.kt index f07f50a6b..7c30a4977 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckDepositServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckDepositServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.checkdeposits.CheckDeposit import com.increase.api.models.checkdeposits.CheckDepositCreateParams +import com.increase.api.models.checkdeposits.CheckDepositListPageAsync +import com.increase.api.models.checkdeposits.CheckDepositListPageResponse import com.increase.api.models.checkdeposits.CheckDepositListParams -import com.increase.api.models.checkdeposits.CheckDepositListResponse import com.increase.api.models.checkdeposits.CheckDepositRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -54,7 +55,7 @@ class CheckDepositServiceAsyncImpl internal constructor(private val clientOption override fun list( params: CheckDepositListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /check_deposits withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -135,13 +136,13 @@ class CheckDepositServiceAsyncImpl internal constructor(private val clientOption } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CheckDepositListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -161,6 +162,14 @@ class CheckDepositServiceAsyncImpl internal constructor(private val clientOption it.validate() } } + .let { + CheckDepositListPageAsync.builder() + .service(CheckDepositServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckTransferServiceAsync.kt index ace3fa1d5..a5410383f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckTransferServiceAsync.kt @@ -9,8 +9,8 @@ import com.increase.api.models.checktransfers.CheckTransfer import com.increase.api.models.checktransfers.CheckTransferApproveParams import com.increase.api.models.checktransfers.CheckTransferCancelParams import com.increase.api.models.checktransfers.CheckTransferCreateParams +import com.increase.api.models.checktransfers.CheckTransferListPageAsync import com.increase.api.models.checktransfers.CheckTransferListParams -import com.increase.api.models.checktransfers.CheckTransferListResponse import com.increase.api.models.checktransfers.CheckTransferRetrieveParams import com.increase.api.models.checktransfers.CheckTransferStopPaymentParams import java.util.concurrent.CompletableFuture @@ -76,21 +76,21 @@ interface CheckTransferServiceAsync { retrieve(checkTransferId, CheckTransferRetrieveParams.none(), requestOptions) /** List Check Transfers */ - fun list(): CompletableFuture = list(CheckTransferListParams.none()) + fun list(): CompletableFuture = list(CheckTransferListParams.none()) /** @see list */ fun list( params: CheckTransferListParams = CheckTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: CheckTransferListParams = CheckTransferListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(CheckTransferListParams.none(), requestOptions) /** Approve a Check Transfer */ @@ -276,25 +276,25 @@ interface CheckTransferServiceAsync { * Returns a raw HTTP response for `get /check_transfers`, but is otherwise the same as * [CheckTransferServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(CheckTransferListParams.none()) /** @see list */ fun list( params: CheckTransferListParams = CheckTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: CheckTransferListParams = CheckTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(CheckTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncImpl.kt index e075c9b67..dad6fc30e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.checktransfers.CheckTransfer import com.increase.api.models.checktransfers.CheckTransferApproveParams import com.increase.api.models.checktransfers.CheckTransferCancelParams import com.increase.api.models.checktransfers.CheckTransferCreateParams +import com.increase.api.models.checktransfers.CheckTransferListPageAsync +import com.increase.api.models.checktransfers.CheckTransferListPageResponse import com.increase.api.models.checktransfers.CheckTransferListParams -import com.increase.api.models.checktransfers.CheckTransferListResponse import com.increase.api.models.checktransfers.CheckTransferRetrieveParams import com.increase.api.models.checktransfers.CheckTransferStopPaymentParams import java.util.concurrent.CompletableFuture @@ -57,7 +58,7 @@ class CheckTransferServiceAsyncImpl internal constructor(private val clientOptio override fun list( params: CheckTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /check_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -159,13 +160,13 @@ class CheckTransferServiceAsyncImpl internal constructor(private val clientOptio } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CheckTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -185,6 +186,14 @@ class CheckTransferServiceAsyncImpl internal constructor(private val clientOptio it.validate() } } + .let { + CheckTransferListPageAsync.builder() + .service(CheckTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsync.kt index 2e0c8df12..70c6024a4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.declinedtransactions.DeclinedTransaction +import com.increase.api.models.declinedtransactions.DeclinedTransactionListPageAsync import com.increase.api.models.declinedtransactions.DeclinedTransactionListParams -import com.increase.api.models.declinedtransactions.DeclinedTransactionListResponse import com.increase.api.models.declinedtransactions.DeclinedTransactionRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -67,22 +67,22 @@ interface DeclinedTransactionServiceAsync { retrieve(declinedTransactionId, DeclinedTransactionRetrieveParams.none(), requestOptions) /** List Declined Transactions */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(DeclinedTransactionListParams.none()) /** @see list */ fun list( params: DeclinedTransactionListParams = DeclinedTransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: DeclinedTransactionListParams = DeclinedTransactionListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(DeclinedTransactionListParams.none(), requestOptions) /** @@ -154,25 +154,25 @@ interface DeclinedTransactionServiceAsync { * Returns a raw HTTP response for `get /declined_transactions`, but is otherwise the same * as [DeclinedTransactionServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(DeclinedTransactionListParams.none()) /** @see list */ fun list( params: DeclinedTransactionListParams = DeclinedTransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: DeclinedTransactionListParams = DeclinedTransactionListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(DeclinedTransactionListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsyncImpl.kt index 7b48e3dfa..7c7004f71 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.declinedtransactions.DeclinedTransaction +import com.increase.api.models.declinedtransactions.DeclinedTransactionListPageAsync +import com.increase.api.models.declinedtransactions.DeclinedTransactionListPageResponse import com.increase.api.models.declinedtransactions.DeclinedTransactionListParams -import com.increase.api.models.declinedtransactions.DeclinedTransactionListResponse import com.increase.api.models.declinedtransactions.DeclinedTransactionRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -50,7 +51,7 @@ internal constructor(private val clientOptions: ClientOptions) : DeclinedTransac override fun list( params: DeclinedTransactionListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /declined_transactions withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -100,13 +101,13 @@ internal constructor(private val clientOptions: ClientOptions) : DeclinedTransac } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: DeclinedTransactionListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -126,6 +127,14 @@ internal constructor(private val clientOptions: ClientOptions) : DeclinedTransac it.validate() } } + .let { + DeclinedTransactionListPageAsync.builder() + .service(DeclinedTransactionServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsync.kt index 6d8d00644..7d6ad0783 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsync.kt @@ -9,8 +9,8 @@ import com.increase.api.models.digitalcardprofiles.DigitalCardProfile import com.increase.api.models.digitalcardprofiles.DigitalCardProfileArchiveParams import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCloneParams import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCreateParams +import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListPageAsync import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListParams -import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListResponse import com.increase.api.models.digitalcardprofiles.DigitalCardProfileRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -79,22 +79,22 @@ interface DigitalCardProfileServiceAsync { retrieve(digitalCardProfileId, DigitalCardProfileRetrieveParams.none(), requestOptions) /** List Card Profiles */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(DigitalCardProfileListParams.none()) /** @see list */ fun list( params: DigitalCardProfileListParams = DigitalCardProfileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: DigitalCardProfileListParams = DigitalCardProfileListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(DigitalCardProfileListParams.none(), requestOptions) /** Archive a Digital Card Profile */ @@ -252,25 +252,25 @@ interface DigitalCardProfileServiceAsync { * Returns a raw HTTP response for `get /digital_card_profiles`, but is otherwise the same * as [DigitalCardProfileServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(DigitalCardProfileListParams.none()) /** @see list */ fun list( params: DigitalCardProfileListParams = DigitalCardProfileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: DigitalCardProfileListParams = DigitalCardProfileListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(DigitalCardProfileListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncImpl.kt index 5cda95adc..d420cc521 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.digitalcardprofiles.DigitalCardProfile import com.increase.api.models.digitalcardprofiles.DigitalCardProfileArchiveParams import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCloneParams import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCreateParams +import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListPageAsync +import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListPageResponse import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListParams -import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListResponse import com.increase.api.models.digitalcardprofiles.DigitalCardProfileRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -60,7 +61,7 @@ internal constructor(private val clientOptions: ClientOptions) : DigitalCardProf override fun list( params: DigitalCardProfileListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /digital_card_profiles withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -155,13 +156,13 @@ internal constructor(private val clientOptions: ClientOptions) : DigitalCardProf } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: DigitalCardProfileListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -181,6 +182,14 @@ internal constructor(private val clientOptions: ClientOptions) : DigitalCardProf it.validate() } } + .let { + DigitalCardProfileListPageAsync.builder() + .service(DigitalCardProfileServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsync.kt index dcb286e77..b69eee3df 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.digitalwallettokens.DigitalWalletToken +import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListPageAsync import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListParams -import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListResponse import com.increase.api.models.digitalwallettokens.DigitalWalletTokenRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -66,22 +66,22 @@ interface DigitalWalletTokenServiceAsync { retrieve(digitalWalletTokenId, DigitalWalletTokenRetrieveParams.none(), requestOptions) /** List Digital Wallet Tokens */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(DigitalWalletTokenListParams.none()) /** @see list */ fun list( params: DigitalWalletTokenListParams = DigitalWalletTokenListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: DigitalWalletTokenListParams = DigitalWalletTokenListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(DigitalWalletTokenListParams.none(), requestOptions) /** @@ -149,25 +149,25 @@ interface DigitalWalletTokenServiceAsync { * Returns a raw HTTP response for `get /digital_wallet_tokens`, but is otherwise the same * as [DigitalWalletTokenServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(DigitalWalletTokenListParams.none()) /** @see list */ fun list( params: DigitalWalletTokenListParams = DigitalWalletTokenListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: DigitalWalletTokenListParams = DigitalWalletTokenListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(DigitalWalletTokenListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsyncImpl.kt index 41d815e00..22a3893fd 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.digitalwallettokens.DigitalWalletToken +import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListPageAsync +import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListPageResponse import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListParams -import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListResponse import com.increase.api.models.digitalwallettokens.DigitalWalletTokenRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -49,7 +50,7 @@ internal constructor(private val clientOptions: ClientOptions) : DigitalWalletTo override fun list( params: DigitalWalletTokenListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /digital_wallet_tokens withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -99,13 +100,13 @@ internal constructor(private val clientOptions: ClientOptions) : DigitalWalletTo } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: DigitalWalletTokenListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -125,6 +126,14 @@ internal constructor(private val clientOptions: ClientOptions) : DigitalWalletTo it.validate() } } + .let { + DigitalWalletTokenListPageAsync.builder() + .service(DigitalWalletTokenServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DocumentServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DocumentServiceAsync.kt index c9021a0eb..7937b5154 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DocumentServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DocumentServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.documents.Document import com.increase.api.models.documents.DocumentCreateParams +import com.increase.api.models.documents.DocumentListPageAsync import com.increase.api.models.documents.DocumentListParams -import com.increase.api.models.documents.DocumentListResponse import com.increase.api.models.documents.DocumentRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -70,21 +70,21 @@ interface DocumentServiceAsync { retrieve(documentId, DocumentRetrieveParams.none(), requestOptions) /** List Documents */ - fun list(): CompletableFuture = list(DocumentListParams.none()) + fun list(): CompletableFuture = list(DocumentListParams.none()) /** @see list */ fun list( params: DocumentListParams = DocumentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: DocumentListParams = DocumentListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(DocumentListParams.none(), requestOptions) /** @@ -157,25 +157,25 @@ interface DocumentServiceAsync { * Returns a raw HTTP response for `get /documents`, but is otherwise the same as * [DocumentServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(DocumentListParams.none()) /** @see list */ fun list( params: DocumentListParams = DocumentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: DocumentListParams = DocumentListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(DocumentListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DocumentServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DocumentServiceAsyncImpl.kt index ef796649a..52526bde0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/DocumentServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/DocumentServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.documents.Document import com.increase.api.models.documents.DocumentCreateParams +import com.increase.api.models.documents.DocumentListPageAsync +import com.increase.api.models.documents.DocumentListPageResponse import com.increase.api.models.documents.DocumentListParams -import com.increase.api.models.documents.DocumentListResponse import com.increase.api.models.documents.DocumentRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -54,7 +55,7 @@ class DocumentServiceAsyncImpl internal constructor(private val clientOptions: C override fun list( params: DocumentListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /documents withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -135,13 +136,13 @@ class DocumentServiceAsyncImpl internal constructor(private val clientOptions: C } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: DocumentListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -161,6 +162,14 @@ class DocumentServiceAsyncImpl internal constructor(private val clientOptions: C it.validate() } } + .let { + DocumentListPageAsync.builder() + .service(DocumentServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EntityServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EntityServiceAsync.kt index 6f19e7895..8c250e1c0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EntityServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EntityServiceAsync.kt @@ -11,8 +11,8 @@ import com.increase.api.models.entities.EntityArchiveParams import com.increase.api.models.entities.EntityConfirmParams import com.increase.api.models.entities.EntityCreateBeneficialOwnerParams import com.increase.api.models.entities.EntityCreateParams +import com.increase.api.models.entities.EntityListPageAsync import com.increase.api.models.entities.EntityListParams -import com.increase.api.models.entities.EntityListResponse import com.increase.api.models.entities.EntityRetrieveParams import com.increase.api.models.entities.EntityUpdateAddressParams import com.increase.api.models.entities.EntityUpdateBeneficialOwnerAddressParams @@ -110,21 +110,21 @@ interface EntityServiceAsync { update(entityId, EntityUpdateParams.none(), requestOptions) /** List Entities */ - fun list(): CompletableFuture = list(EntityListParams.none()) + fun list(): CompletableFuture = list(EntityListParams.none()) /** @see list */ fun list( params: EntityListParams = EntityListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: EntityListParams = EntityListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(EntityListParams.none(), requestOptions) /** Archive an Entity */ @@ -428,25 +428,25 @@ interface EntityServiceAsync { * Returns a raw HTTP response for `get /entities`, but is otherwise the same as * [EntityServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(EntityListParams.none()) /** @see list */ fun list( params: EntityListParams = EntityListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: EntityListParams = EntityListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(EntityListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EntityServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EntityServiceAsyncImpl.kt index 492afcf89..3f0ad0bdf 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EntityServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EntityServiceAsyncImpl.kt @@ -22,8 +22,9 @@ import com.increase.api.models.entities.EntityArchiveParams import com.increase.api.models.entities.EntityConfirmParams import com.increase.api.models.entities.EntityCreateBeneficialOwnerParams import com.increase.api.models.entities.EntityCreateParams +import com.increase.api.models.entities.EntityListPageAsync +import com.increase.api.models.entities.EntityListPageResponse import com.increase.api.models.entities.EntityListParams -import com.increase.api.models.entities.EntityListResponse import com.increase.api.models.entities.EntityRetrieveParams import com.increase.api.models.entities.EntityUpdateAddressParams import com.increase.api.models.entities.EntityUpdateBeneficialOwnerAddressParams @@ -69,7 +70,7 @@ class EntityServiceAsyncImpl internal constructor(private val clientOptions: Cli override fun list( params: EntityListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /entities withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -232,13 +233,13 @@ class EntityServiceAsyncImpl internal constructor(private val clientOptions: Cli } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: EntityListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -258,6 +259,14 @@ class EntityServiceAsyncImpl internal constructor(private val clientOptions: Cli it.validate() } } + .let { + EntityListPageAsync.builder() + .service(EntityServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventServiceAsync.kt index 80e1a57c7..129d1066e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.events.Event +import com.increase.api.models.events.EventListPageAsync import com.increase.api.models.events.EventListParams -import com.increase.api.models.events.EventListResponse import com.increase.api.models.events.EventRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -59,21 +59,21 @@ interface EventServiceAsync { retrieve(eventId, EventRetrieveParams.none(), requestOptions) /** List Events */ - fun list(): CompletableFuture = list(EventListParams.none()) + fun list(): CompletableFuture = list(EventListParams.none()) /** @see list */ fun list( params: EventListParams = EventListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: EventListParams = EventListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(EventListParams.none(), requestOptions) /** A view of [EventServiceAsync] that provides access to raw HTTP responses for each method. */ @@ -131,25 +131,25 @@ interface EventServiceAsync { * Returns a raw HTTP response for `get /events`, but is otherwise the same as * [EventServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(EventListParams.none()) /** @see list */ fun list( params: EventListParams = EventListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: EventListParams = EventListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(EventListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventServiceAsyncImpl.kt index ca53db1d6..ab2e1b434 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.events.Event +import com.increase.api.models.events.EventListPageAsync +import com.increase.api.models.events.EventListPageResponse import com.increase.api.models.events.EventListParams -import com.increase.api.models.events.EventListResponse import com.increase.api.models.events.EventRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -45,7 +46,7 @@ class EventServiceAsyncImpl internal constructor(private val clientOptions: Clie override fun list( params: EventListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /events withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -94,13 +95,13 @@ class EventServiceAsyncImpl internal constructor(private val clientOptions: Clie } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: EventListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -120,6 +121,14 @@ class EventServiceAsyncImpl internal constructor(private val clientOptions: Clie it.validate() } } + .let { + EventListPageAsync.builder() + .service(EventServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsync.kt index 451e42e62..7f7d429c0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.eventsubscriptions.EventSubscription import com.increase.api.models.eventsubscriptions.EventSubscriptionCreateParams +import com.increase.api.models.eventsubscriptions.EventSubscriptionListPageAsync import com.increase.api.models.eventsubscriptions.EventSubscriptionListParams -import com.increase.api.models.eventsubscriptions.EventSubscriptionListResponse import com.increase.api.models.eventsubscriptions.EventSubscriptionRetrieveParams import com.increase.api.models.eventsubscriptions.EventSubscriptionUpdateParams import java.util.concurrent.CompletableFuture @@ -114,22 +114,22 @@ interface EventSubscriptionServiceAsync { update(eventSubscriptionId, EventSubscriptionUpdateParams.none(), requestOptions) /** List Event Subscriptions */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(EventSubscriptionListParams.none()) /** @see list */ fun list( params: EventSubscriptionListParams = EventSubscriptionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: EventSubscriptionListParams = EventSubscriptionListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(EventSubscriptionListParams.none(), requestOptions) /** @@ -258,25 +258,25 @@ interface EventSubscriptionServiceAsync { * Returns a raw HTTP response for `get /event_subscriptions`, but is otherwise the same as * [EventSubscriptionServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(EventSubscriptionListParams.none()) /** @see list */ fun list( params: EventSubscriptionListParams = EventSubscriptionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: EventSubscriptionListParams = EventSubscriptionListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(EventSubscriptionListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsyncImpl.kt index 933dd1bf1..062b4d1b8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.eventsubscriptions.EventSubscription import com.increase.api.models.eventsubscriptions.EventSubscriptionCreateParams +import com.increase.api.models.eventsubscriptions.EventSubscriptionListPageAsync +import com.increase.api.models.eventsubscriptions.EventSubscriptionListPageResponse import com.increase.api.models.eventsubscriptions.EventSubscriptionListParams -import com.increase.api.models.eventsubscriptions.EventSubscriptionListResponse import com.increase.api.models.eventsubscriptions.EventSubscriptionRetrieveParams import com.increase.api.models.eventsubscriptions.EventSubscriptionUpdateParams import java.util.concurrent.CompletableFuture @@ -64,7 +65,7 @@ internal constructor(private val clientOptions: ClientOptions) : EventSubscripti override fun list( params: EventSubscriptionListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /event_subscriptions withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -179,13 +180,13 @@ internal constructor(private val clientOptions: ClientOptions) : EventSubscripti } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: EventSubscriptionListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -205,6 +206,14 @@ internal constructor(private val clientOptions: ClientOptions) : EventSubscripti it.validate() } } + .let { + EventSubscriptionListPageAsync.builder() + .service(EventSubscriptionServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExportServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExportServiceAsync.kt index 50978de79..8a230658a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExportServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExportServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.exports.Export import com.increase.api.models.exports.ExportCreateParams +import com.increase.api.models.exports.ExportListPageAsync import com.increase.api.models.exports.ExportListParams -import com.increase.api.models.exports.ExportListResponse import com.increase.api.models.exports.ExportRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -70,21 +70,21 @@ interface ExportServiceAsync { retrieve(exportId, ExportRetrieveParams.none(), requestOptions) /** List Exports */ - fun list(): CompletableFuture = list(ExportListParams.none()) + fun list(): CompletableFuture = list(ExportListParams.none()) /** @see list */ fun list( params: ExportListParams = ExportListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: ExportListParams = ExportListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(ExportListParams.none(), requestOptions) /** @@ -157,25 +157,25 @@ interface ExportServiceAsync { * Returns a raw HTTP response for `get /exports`, but is otherwise the same as * [ExportServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(ExportListParams.none()) /** @see list */ fun list( params: ExportListParams = ExportListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: ExportListParams = ExportListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(ExportListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExportServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExportServiceAsyncImpl.kt index a5b17a119..2e84caf14 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExportServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExportServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.exports.Export import com.increase.api.models.exports.ExportCreateParams +import com.increase.api.models.exports.ExportListPageAsync +import com.increase.api.models.exports.ExportListPageResponse import com.increase.api.models.exports.ExportListParams -import com.increase.api.models.exports.ExportListResponse import com.increase.api.models.exports.ExportRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -54,7 +55,7 @@ class ExportServiceAsyncImpl internal constructor(private val clientOptions: Cli override fun list( params: ExportListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /exports withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -133,13 +134,13 @@ class ExportServiceAsyncImpl internal constructor(private val clientOptions: Cli } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: ExportListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -159,6 +160,14 @@ class ExportServiceAsyncImpl internal constructor(private val clientOptions: Cli it.validate() } } + .let { + ExportListPageAsync.builder() + .service(ExportServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExternalAccountServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExternalAccountServiceAsync.kt index 2ca480383..888dd9063 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExternalAccountServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExternalAccountServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.externalaccounts.ExternalAccount import com.increase.api.models.externalaccounts.ExternalAccountCreateParams +import com.increase.api.models.externalaccounts.ExternalAccountListPageAsync import com.increase.api.models.externalaccounts.ExternalAccountListParams -import com.increase.api.models.externalaccounts.ExternalAccountListResponse import com.increase.api.models.externalaccounts.ExternalAccountRetrieveParams import com.increase.api.models.externalaccounts.ExternalAccountUpdateParams import java.util.concurrent.CompletableFuture @@ -110,22 +110,22 @@ interface ExternalAccountServiceAsync { update(externalAccountId, ExternalAccountUpdateParams.none(), requestOptions) /** List External Accounts */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(ExternalAccountListParams.none()) /** @see list */ fun list( params: ExternalAccountListParams = ExternalAccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: ExternalAccountListParams = ExternalAccountListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(ExternalAccountListParams.none(), requestOptions) /** @@ -249,25 +249,25 @@ interface ExternalAccountServiceAsync { * Returns a raw HTTP response for `get /external_accounts`, but is otherwise the same as * [ExternalAccountServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(ExternalAccountListParams.none()) /** @see list */ fun list( params: ExternalAccountListParams = ExternalAccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: ExternalAccountListParams = ExternalAccountListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(ExternalAccountListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExternalAccountServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExternalAccountServiceAsyncImpl.kt index 31b0eee19..a5cd30d49 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExternalAccountServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ExternalAccountServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.externalaccounts.ExternalAccount import com.increase.api.models.externalaccounts.ExternalAccountCreateParams +import com.increase.api.models.externalaccounts.ExternalAccountListPageAsync +import com.increase.api.models.externalaccounts.ExternalAccountListPageResponse import com.increase.api.models.externalaccounts.ExternalAccountListParams -import com.increase.api.models.externalaccounts.ExternalAccountListResponse import com.increase.api.models.externalaccounts.ExternalAccountRetrieveParams import com.increase.api.models.externalaccounts.ExternalAccountUpdateParams import java.util.concurrent.CompletableFuture @@ -64,7 +65,7 @@ internal constructor(private val clientOptions: ClientOptions) : ExternalAccount override fun list( params: ExternalAccountListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /external_accounts withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -179,13 +180,13 @@ internal constructor(private val clientOptions: ClientOptions) : ExternalAccount } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: ExternalAccountListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -205,6 +206,14 @@ internal constructor(private val clientOptions: ClientOptions) : ExternalAccount it.validate() } } + .let { + ExternalAccountListPageAsync.builder() + .service(ExternalAccountServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt index 616a367b4..1debb37e7 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt @@ -9,8 +9,8 @@ import com.increase.api.models.fednowtransfers.FednowTransfer import com.increase.api.models.fednowtransfers.FednowTransferApproveParams import com.increase.api.models.fednowtransfers.FednowTransferCancelParams import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPageAsync import com.increase.api.models.fednowtransfers.FednowTransferListParams -import com.increase.api.models.fednowtransfers.FednowTransferListResponse import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -75,22 +75,22 @@ interface FednowTransferServiceAsync { retrieve(fednowTransferId, FednowTransferRetrieveParams.none(), requestOptions) /** List FedNow Transfers */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(FednowTransferListParams.none()) /** @see list */ fun list( params: FednowTransferListParams = FednowTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: FednowTransferListParams = FednowTransferListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(FednowTransferListParams.none(), requestOptions) /** Approve a FedNow Transfer */ @@ -238,25 +238,25 @@ interface FednowTransferServiceAsync { * Returns a raw HTTP response for `get /fednow_transfers`, but is otherwise the same as * [FednowTransferServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(FednowTransferListParams.none()) /** @see list */ fun list( params: FednowTransferListParams = FednowTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: FednowTransferListParams = FednowTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(FednowTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt index 6e12ba735..ea4c3f72e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.fednowtransfers.FednowTransfer import com.increase.api.models.fednowtransfers.FednowTransferApproveParams import com.increase.api.models.fednowtransfers.FednowTransferCancelParams import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPageAsync +import com.increase.api.models.fednowtransfers.FednowTransferListPageResponse import com.increase.api.models.fednowtransfers.FednowTransferListParams -import com.increase.api.models.fednowtransfers.FednowTransferListResponse import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -58,7 +59,7 @@ internal constructor(private val clientOptions: ClientOptions) : FednowTransferS override fun list( params: FednowTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /fednow_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -153,13 +154,13 @@ internal constructor(private val clientOptions: ClientOptions) : FednowTransferS } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: FednowTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -179,6 +180,14 @@ internal constructor(private val clientOptions: ClientOptions) : FednowTransferS it.validate() } } + .let { + FednowTransferListPageAsync.builder() + .service(FednowTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FileServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FileServiceAsync.kt index 7e53c77b2..4816f4ac2 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FileServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FileServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.files.File import com.increase.api.models.files.FileCreateParams +import com.increase.api.models.files.FileListPageAsync import com.increase.api.models.files.FileListParams -import com.increase.api.models.files.FileListResponse import com.increase.api.models.files.FileRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -73,20 +73,20 @@ interface FileServiceAsync { retrieve(fileId, FileRetrieveParams.none(), requestOptions) /** List Files */ - fun list(): CompletableFuture = list(FileListParams.none()) + fun list(): CompletableFuture = list(FileListParams.none()) /** @see list */ fun list( params: FileListParams = FileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ - fun list(params: FileListParams = FileListParams.none()): CompletableFuture = + fun list(params: FileListParams = FileListParams.none()): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(FileListParams.none(), requestOptions) /** A view of [FileServiceAsync] that provides access to raw HTTP responses for each method. */ @@ -155,25 +155,25 @@ interface FileServiceAsync { * Returns a raw HTTP response for `get /files`, but is otherwise the same as * [FileServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(FileListParams.none()) /** @see list */ fun list( params: FileListParams = FileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: FileListParams = FileListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(FileListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FileServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FileServiceAsyncImpl.kt index 8349d96a3..a71d8a3e5 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FileServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FileServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.files.File import com.increase.api.models.files.FileCreateParams +import com.increase.api.models.files.FileListPageAsync +import com.increase.api.models.files.FileListPageResponse import com.increase.api.models.files.FileListParams -import com.increase.api.models.files.FileListResponse import com.increase.api.models.files.FileRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -54,7 +55,7 @@ class FileServiceAsyncImpl internal constructor(private val clientOptions: Clien override fun list( params: FileListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /files withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -133,13 +134,13 @@ class FileServiceAsyncImpl internal constructor(private val clientOptions: Clien } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: FileListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -159,6 +160,14 @@ class FileServiceAsyncImpl internal constructor(private val clientOptions: Clien it.validate() } } + .let { + FileListPageAsync.builder() + .service(FileServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsync.kt index ec3c76390..24c657782 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsync.kt @@ -8,8 +8,8 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundachtransfers.InboundAchTransfer import com.increase.api.models.inboundachtransfers.InboundAchTransferCreateNotificationOfChangeParams import com.increase.api.models.inboundachtransfers.InboundAchTransferDeclineParams +import com.increase.api.models.inboundachtransfers.InboundAchTransferListPageAsync import com.increase.api.models.inboundachtransfers.InboundAchTransferListParams -import com.increase.api.models.inboundachtransfers.InboundAchTransferListResponse import com.increase.api.models.inboundachtransfers.InboundAchTransferRetrieveParams import com.increase.api.models.inboundachtransfers.InboundAchTransferTransferReturnParams import java.util.concurrent.CompletableFuture @@ -69,22 +69,22 @@ interface InboundAchTransferServiceAsync { retrieve(inboundAchTransferId, InboundAchTransferRetrieveParams.none(), requestOptions) /** List Inbound ACH Transfers */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(InboundAchTransferListParams.none()) /** @see list */ fun list( params: InboundAchTransferListParams = InboundAchTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: InboundAchTransferListParams = InboundAchTransferListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(InboundAchTransferListParams.none(), requestOptions) /** Create a notification of change for an Inbound ACH Transfer */ @@ -272,25 +272,25 @@ interface InboundAchTransferServiceAsync { * Returns a raw HTTP response for `get /inbound_ach_transfers`, but is otherwise the same * as [InboundAchTransferServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(InboundAchTransferListParams.none()) /** @see list */ fun list( params: InboundAchTransferListParams = InboundAchTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: InboundAchTransferListParams = InboundAchTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(InboundAchTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsyncImpl.kt index 831882495..21832a6f1 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsyncImpl.kt @@ -19,8 +19,9 @@ import com.increase.api.core.prepareAsync import com.increase.api.models.inboundachtransfers.InboundAchTransfer import com.increase.api.models.inboundachtransfers.InboundAchTransferCreateNotificationOfChangeParams import com.increase.api.models.inboundachtransfers.InboundAchTransferDeclineParams +import com.increase.api.models.inboundachtransfers.InboundAchTransferListPageAsync +import com.increase.api.models.inboundachtransfers.InboundAchTransferListPageResponse import com.increase.api.models.inboundachtransfers.InboundAchTransferListParams -import com.increase.api.models.inboundachtransfers.InboundAchTransferListResponse import com.increase.api.models.inboundachtransfers.InboundAchTransferRetrieveParams import com.increase.api.models.inboundachtransfers.InboundAchTransferTransferReturnParams import java.util.concurrent.CompletableFuture @@ -53,7 +54,7 @@ internal constructor(private val clientOptions: ClientOptions) : InboundAchTrans override fun list( params: InboundAchTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /inbound_ach_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -126,13 +127,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundAchTrans } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundAchTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -152,6 +153,14 @@ internal constructor(private val clientOptions: ClientOptions) : InboundAchTrans it.validate() } } + .let { + InboundAchTransferListPageAsync.builder() + .service(InboundAchTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsync.kt index 56c0c1a50..d716b2693 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundcheckdeposits.InboundCheckDeposit import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositDeclineParams +import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListPageAsync import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListParams -import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListResponse import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositRetrieveParams import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositReturnParams import java.util.concurrent.CompletableFuture @@ -69,22 +69,22 @@ interface InboundCheckDepositServiceAsync { retrieve(inboundCheckDepositId, InboundCheckDepositRetrieveParams.none(), requestOptions) /** List Inbound Check Deposits */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(InboundCheckDepositListParams.none()) /** @see list */ fun list( params: InboundCheckDepositListParams = InboundCheckDepositListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: InboundCheckDepositListParams = InboundCheckDepositListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(InboundCheckDepositListParams.none(), requestOptions) /** Decline an Inbound Check Deposit */ @@ -223,25 +223,25 @@ interface InboundCheckDepositServiceAsync { * Returns a raw HTTP response for `get /inbound_check_deposits`, but is otherwise the same * as [InboundCheckDepositServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(InboundCheckDepositListParams.none()) /** @see list */ fun list( params: InboundCheckDepositListParams = InboundCheckDepositListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: InboundCheckDepositListParams = InboundCheckDepositListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(InboundCheckDepositListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsyncImpl.kt index 33b2a9d46..f2010b57e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.inboundcheckdeposits.InboundCheckDeposit import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositDeclineParams +import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListPageAsync +import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListPageResponse import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListParams -import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListResponse import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositRetrieveParams import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositReturnParams import java.util.concurrent.CompletableFuture @@ -53,7 +54,7 @@ internal constructor(private val clientOptions: ClientOptions) : InboundCheckDep override fun list( params: InboundCheckDepositListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /inbound_check_deposits withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -117,13 +118,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundCheckDep } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundCheckDepositListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -143,6 +144,14 @@ internal constructor(private val clientOptions: ClientOptions) : InboundCheckDep it.validate() } } + .let { + InboundCheckDepositListPageAsync.builder() + .service(InboundCheckDepositServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt index 7931eb69d..ca737e1bf 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageAsync import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams -import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListResponse import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -71,22 +71,24 @@ interface InboundFednowTransferServiceAsync { ) /** List Inbound FedNow Transfers */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(InboundFednowTransferListParams.none()) /** @see list */ fun list( params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list( + requestOptions: RequestOptions + ): CompletableFuture = list(InboundFednowTransferListParams.none(), requestOptions) /** @@ -160,25 +162,25 @@ interface InboundFednowTransferServiceAsync { * Returns a raw HTTP response for `get /inbound_fednow_transfers`, but is otherwise the * same as [InboundFednowTransferServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(InboundFednowTransferListParams.none()) /** @see list */ fun list( params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(InboundFednowTransferListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt index 682f55597..992a3cf7e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageAsync +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageResponse import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams -import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListResponse import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -50,7 +51,7 @@ internal constructor(private val clientOptions: ClientOptions) : InboundFednowTr override fun list( params: InboundFednowTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /inbound_fednow_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -100,13 +101,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundFednowTr } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundFednowTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -126,6 +127,14 @@ internal constructor(private val clientOptions: ClientOptions) : InboundFednowTr it.validate() } } + .let { + InboundFednowTransferListPageAsync.builder() + .service(InboundFednowTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsync.kt index 10b7ce5ca..77f3f8ba8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundmailitems.InboundMailItem import com.increase.api.models.inboundmailitems.InboundMailItemActionParams +import com.increase.api.models.inboundmailitems.InboundMailItemListPageAsync import com.increase.api.models.inboundmailitems.InboundMailItemListParams -import com.increase.api.models.inboundmailitems.InboundMailItemListResponse import com.increase.api.models.inboundmailitems.InboundMailItemRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -64,22 +64,22 @@ interface InboundMailItemServiceAsync { retrieve(inboundMailItemId, InboundMailItemRetrieveParams.none(), requestOptions) /** List Inbound Mail Items */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(InboundMailItemListParams.none()) /** @see list */ fun list( params: InboundMailItemListParams = InboundMailItemListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: InboundMailItemListParams = InboundMailItemListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(InboundMailItemListParams.none(), requestOptions) /** Action a Inbound Mail Item */ @@ -171,25 +171,25 @@ interface InboundMailItemServiceAsync { * Returns a raw HTTP response for `get /inbound_mail_items`, but is otherwise the same as * [InboundMailItemServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(InboundMailItemListParams.none()) /** @see list */ fun list( params: InboundMailItemListParams = InboundMailItemListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: InboundMailItemListParams = InboundMailItemListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(InboundMailItemListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncImpl.kt index 9803b2378..fe75afcc4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.inboundmailitems.InboundMailItem import com.increase.api.models.inboundmailitems.InboundMailItemActionParams +import com.increase.api.models.inboundmailitems.InboundMailItemListPageAsync +import com.increase.api.models.inboundmailitems.InboundMailItemListPageResponse import com.increase.api.models.inboundmailitems.InboundMailItemListParams -import com.increase.api.models.inboundmailitems.InboundMailItemListResponse import com.increase.api.models.inboundmailitems.InboundMailItemRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -49,7 +50,7 @@ internal constructor(private val clientOptions: ClientOptions) : InboundMailItem override fun list( params: InboundMailItemListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /inbound_mail_items withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -106,13 +107,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundMailItem } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundMailItemListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -132,6 +133,14 @@ internal constructor(private val clientOptions: ClientOptions) : InboundMailItem it.validate() } } + .let { + InboundMailItemListPageAsync.builder() + .service(InboundMailItemServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsync.kt index c8a472693..a1468191c 100755 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransfer +import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListPageAsync import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListParams -import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListResponse import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -83,7 +83,7 @@ interface InboundRealTimePaymentsTransferServiceAsync { ) /** List Inbound Real-Time Payments Transfers */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(InboundRealTimePaymentsTransferListParams.none()) /** @see list */ @@ -91,19 +91,19 @@ interface InboundRealTimePaymentsTransferServiceAsync { params: InboundRealTimePaymentsTransferListParams = InboundRealTimePaymentsTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: InboundRealTimePaymentsTransferListParams = InboundRealTimePaymentsTransferListParams.none() - ): CompletableFuture = + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture = + ): CompletableFuture = list(InboundRealTimePaymentsTransferListParams.none(), requestOptions) /** @@ -185,7 +185,7 @@ interface InboundRealTimePaymentsTransferServiceAsync { * otherwise the same as [InboundRealTimePaymentsTransferServiceAsync.list]. */ fun list(): - CompletableFuture> = + CompletableFuture> = list(InboundRealTimePaymentsTransferListParams.none()) /** @see list */ @@ -193,19 +193,19 @@ interface InboundRealTimePaymentsTransferServiceAsync { params: InboundRealTimePaymentsTransferListParams = InboundRealTimePaymentsTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: InboundRealTimePaymentsTransferListParams = InboundRealTimePaymentsTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(InboundRealTimePaymentsTransferListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsyncImpl.kt index a381c93bd..192058dc8 100755 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransfer +import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListPageAsync +import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListPageResponse import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListParams -import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListResponse import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -52,7 +53,7 @@ internal constructor(private val clientOptions: ClientOptions) : override fun list( params: InboundRealTimePaymentsTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /inbound_real_time_payments_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -105,13 +106,13 @@ internal constructor(private val clientOptions: ClientOptions) : } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundRealTimePaymentsTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -131,6 +132,18 @@ internal constructor(private val clientOptions: ClientOptions) : it.validate() } } + .let { + InboundRealTimePaymentsTransferListPageAsync.builder() + .service( + InboundRealTimePaymentsTransferServiceAsyncImpl( + clientOptions + ) + ) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsync.kt index 1af06845f..78f0d33f8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequest +import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListPageAsync import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListParams -import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListResponse import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -77,25 +77,25 @@ interface InboundWireDrawdownRequestServiceAsync { ) /** List Inbound Wire Drawdown Requests */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(InboundWireDrawdownRequestListParams.none()) /** @see list */ fun list( params: InboundWireDrawdownRequestListParams = InboundWireDrawdownRequestListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: InboundWireDrawdownRequestListParams = InboundWireDrawdownRequestListParams.none() - ): CompletableFuture = + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture = + ): CompletableFuture = list(InboundWireDrawdownRequestListParams.none(), requestOptions) /** @@ -173,7 +173,7 @@ interface InboundWireDrawdownRequestServiceAsync { * Returns a raw HTTP response for `get /inbound_wire_drawdown_requests`, but is otherwise * the same as [InboundWireDrawdownRequestServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(InboundWireDrawdownRequestListParams.none()) /** @see list */ @@ -181,19 +181,19 @@ interface InboundWireDrawdownRequestServiceAsync { params: InboundWireDrawdownRequestListParams = InboundWireDrawdownRequestListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: InboundWireDrawdownRequestListParams = InboundWireDrawdownRequestListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(InboundWireDrawdownRequestListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsyncImpl.kt index 9d5a8538b..3b1139387 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequest +import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListPageAsync +import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListPageResponse import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListParams -import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListResponse import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -51,7 +52,7 @@ internal constructor(private val clientOptions: ClientOptions) : override fun list( params: InboundWireDrawdownRequestListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /inbound_wire_drawdown_requests withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -104,13 +105,13 @@ internal constructor(private val clientOptions: ClientOptions) : } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundWireDrawdownRequestListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -130,6 +131,16 @@ internal constructor(private val clientOptions: ClientOptions) : it.validate() } } + .let { + InboundWireDrawdownRequestListPageAsync.builder() + .service( + InboundWireDrawdownRequestServiceAsyncImpl(clientOptions) + ) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsync.kt index ef2793304..65e4aa4db 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundwiretransfers.InboundWireTransfer +import com.increase.api.models.inboundwiretransfers.InboundWireTransferListPageAsync import com.increase.api.models.inboundwiretransfers.InboundWireTransferListParams -import com.increase.api.models.inboundwiretransfers.InboundWireTransferListResponse import com.increase.api.models.inboundwiretransfers.InboundWireTransferRetrieveParams import com.increase.api.models.inboundwiretransfers.InboundWireTransferReverseParams import java.util.concurrent.CompletableFuture @@ -68,22 +68,22 @@ interface InboundWireTransferServiceAsync { retrieve(inboundWireTransferId, InboundWireTransferRetrieveParams.none(), requestOptions) /** List Inbound Wire Transfers */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(InboundWireTransferListParams.none()) /** @see list */ fun list( params: InboundWireTransferListParams = InboundWireTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: InboundWireTransferListParams = InboundWireTransferListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(InboundWireTransferListParams.none(), requestOptions) /** Reverse an Inbound Wire Transfer */ @@ -183,25 +183,25 @@ interface InboundWireTransferServiceAsync { * Returns a raw HTTP response for `get /inbound_wire_transfers`, but is otherwise the same * as [InboundWireTransferServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(InboundWireTransferListParams.none()) /** @see list */ fun list( params: InboundWireTransferListParams = InboundWireTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: InboundWireTransferListParams = InboundWireTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(InboundWireTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsyncImpl.kt index 70af1b732..d91283019 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsyncImpl.kt @@ -17,8 +17,9 @@ import com.increase.api.core.http.json import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.inboundwiretransfers.InboundWireTransfer +import com.increase.api.models.inboundwiretransfers.InboundWireTransferListPageAsync +import com.increase.api.models.inboundwiretransfers.InboundWireTransferListPageResponse import com.increase.api.models.inboundwiretransfers.InboundWireTransferListParams -import com.increase.api.models.inboundwiretransfers.InboundWireTransferListResponse import com.increase.api.models.inboundwiretransfers.InboundWireTransferRetrieveParams import com.increase.api.models.inboundwiretransfers.InboundWireTransferReverseParams import java.util.concurrent.CompletableFuture @@ -52,7 +53,7 @@ internal constructor(private val clientOptions: ClientOptions) : InboundWireTran override fun list( params: InboundWireTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /inbound_wire_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -109,13 +110,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundWireTran } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundWireTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -135,6 +136,14 @@ internal constructor(private val clientOptions: ClientOptions) : InboundWireTran it.validate() } } + .let { + InboundWireTransferListPageAsync.builder() + .service(InboundWireTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsync.kt index de72d0297..ef29391f8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollment import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentCreateParams +import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListPageAsync import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListParams -import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListResponse import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentRetrieveParams import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentUnenrollParams import java.util.concurrent.CompletableFuture @@ -86,24 +86,25 @@ interface IntrafiAccountEnrollmentServiceAsync { ) /** List IntraFi Account Enrollments */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(IntrafiAccountEnrollmentListParams.none()) /** @see list */ fun list( params: IntrafiAccountEnrollmentListParams = IntrafiAccountEnrollmentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: IntrafiAccountEnrollmentListParams = IntrafiAccountEnrollmentListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = + list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture = + ): CompletableFuture = list(IntrafiAccountEnrollmentListParams.none(), requestOptions) /** Unenroll an account from IntraFi */ @@ -239,25 +240,25 @@ interface IntrafiAccountEnrollmentServiceAsync { * Returns a raw HTTP response for `get /intrafi_account_enrollments`, but is otherwise the * same as [IntrafiAccountEnrollmentServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(IntrafiAccountEnrollmentListParams.none()) /** @see list */ fun list( params: IntrafiAccountEnrollmentListParams = IntrafiAccountEnrollmentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: IntrafiAccountEnrollmentListParams = IntrafiAccountEnrollmentListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(IntrafiAccountEnrollmentListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsyncImpl.kt index e34cf1a6e..7b22b5e0d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollment import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentCreateParams +import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListPageAsync +import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListPageResponse import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListParams -import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListResponse import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentRetrieveParams import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentUnenrollParams import java.util.concurrent.CompletableFuture @@ -61,7 +62,7 @@ internal constructor(private val clientOptions: ClientOptions) : override fun list( params: IntrafiAccountEnrollmentListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /intrafi_account_enrollments withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -152,13 +153,13 @@ internal constructor(private val clientOptions: ClientOptions) : } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: IntrafiAccountEnrollmentListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -178,6 +179,16 @@ internal constructor(private val clientOptions: ClientOptions) : it.validate() } } + .let { + IntrafiAccountEnrollmentListPageAsync.builder() + .service( + IntrafiAccountEnrollmentServiceAsyncImpl(clientOptions) + ) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsync.kt index 1df3a6221..a058ca05f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsync.kt @@ -8,8 +8,8 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.intrafiexclusions.IntrafiExclusion import com.increase.api.models.intrafiexclusions.IntrafiExclusionArchiveParams import com.increase.api.models.intrafiexclusions.IntrafiExclusionCreateParams +import com.increase.api.models.intrafiexclusions.IntrafiExclusionListPageAsync import com.increase.api.models.intrafiexclusions.IntrafiExclusionListParams -import com.increase.api.models.intrafiexclusions.IntrafiExclusionListResponse import com.increase.api.models.intrafiexclusions.IntrafiExclusionRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -75,22 +75,22 @@ interface IntrafiExclusionServiceAsync { retrieve(intrafiExclusionId, IntrafiExclusionRetrieveParams.none(), requestOptions) /** List IntraFi Exclusions */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(IntrafiExclusionListParams.none()) /** @see list */ fun list( params: IntrafiExclusionListParams = IntrafiExclusionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: IntrafiExclusionListParams = IntrafiExclusionListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(IntrafiExclusionListParams.none(), requestOptions) /** Archive an IntraFi Exclusion */ @@ -209,25 +209,25 @@ interface IntrafiExclusionServiceAsync { * Returns a raw HTTP response for `get /intrafi_exclusions`, but is otherwise the same as * [IntrafiExclusionServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(IntrafiExclusionListParams.none()) /** @see list */ fun list( params: IntrafiExclusionListParams = IntrafiExclusionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: IntrafiExclusionListParams = IntrafiExclusionListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(IntrafiExclusionListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsyncImpl.kt index d59245abc..3a152331a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsyncImpl.kt @@ -19,8 +19,9 @@ import com.increase.api.core.prepareAsync import com.increase.api.models.intrafiexclusions.IntrafiExclusion import com.increase.api.models.intrafiexclusions.IntrafiExclusionArchiveParams import com.increase.api.models.intrafiexclusions.IntrafiExclusionCreateParams +import com.increase.api.models.intrafiexclusions.IntrafiExclusionListPageAsync +import com.increase.api.models.intrafiexclusions.IntrafiExclusionListPageResponse import com.increase.api.models.intrafiexclusions.IntrafiExclusionListParams -import com.increase.api.models.intrafiexclusions.IntrafiExclusionListResponse import com.increase.api.models.intrafiexclusions.IntrafiExclusionRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -57,7 +58,7 @@ internal constructor(private val clientOptions: ClientOptions) : IntrafiExclusio override fun list( params: IntrafiExclusionListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /intrafi_exclusions withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -145,13 +146,13 @@ internal constructor(private val clientOptions: ClientOptions) : IntrafiExclusio } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: IntrafiExclusionListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -171,6 +172,14 @@ internal constructor(private val clientOptions: ClientOptions) : IntrafiExclusio it.validate() } } + .let { + IntrafiExclusionListPageAsync.builder() + .service(IntrafiExclusionServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsync.kt index 64fecbc82..82fee8d70 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.lockboxes.Lockbox import com.increase.api.models.lockboxes.LockboxCreateParams +import com.increase.api.models.lockboxes.LockboxListPageAsync import com.increase.api.models.lockboxes.LockboxListParams -import com.increase.api.models.lockboxes.LockboxListResponse import com.increase.api.models.lockboxes.LockboxRetrieveParams import com.increase.api.models.lockboxes.LockboxUpdateParams import java.util.concurrent.CompletableFuture @@ -103,21 +103,21 @@ interface LockboxServiceAsync { update(lockboxId, LockboxUpdateParams.none(), requestOptions) /** List Lockboxes */ - fun list(): CompletableFuture = list(LockboxListParams.none()) + fun list(): CompletableFuture = list(LockboxListParams.none()) /** @see list */ fun list( params: LockboxListParams = LockboxListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: LockboxListParams = LockboxListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(LockboxListParams.none(), requestOptions) /** @@ -229,25 +229,25 @@ interface LockboxServiceAsync { * Returns a raw HTTP response for `get /lockboxes`, but is otherwise the same as * [LockboxServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(LockboxListParams.none()) /** @see list */ fun list( params: LockboxListParams = LockboxListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: LockboxListParams = LockboxListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(LockboxListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsyncImpl.kt index ef95ff901..47eb14424 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/LockboxServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.lockboxes.Lockbox import com.increase.api.models.lockboxes.LockboxCreateParams +import com.increase.api.models.lockboxes.LockboxListPageAsync +import com.increase.api.models.lockboxes.LockboxListPageResponse import com.increase.api.models.lockboxes.LockboxListParams -import com.increase.api.models.lockboxes.LockboxListResponse import com.increase.api.models.lockboxes.LockboxRetrieveParams import com.increase.api.models.lockboxes.LockboxUpdateParams import java.util.concurrent.CompletableFuture @@ -62,7 +63,7 @@ class LockboxServiceAsyncImpl internal constructor(private val clientOptions: Cl override fun list( params: LockboxListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /lockboxes withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -175,13 +176,13 @@ class LockboxServiceAsyncImpl internal constructor(private val clientOptions: Cl } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: LockboxListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -201,6 +202,14 @@ class LockboxServiceAsyncImpl internal constructor(private val clientOptions: Cl it.validate() } } + .let { + LockboxListPageAsync.builder() + .service(LockboxServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsync.kt index a5473793f..7855599d9 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.oauthapplications.OAuthApplication +import com.increase.api.models.oauthapplications.OAuthApplicationListPageAsync import com.increase.api.models.oauthapplications.OAuthApplicationListParams -import com.increase.api.models.oauthapplications.OAuthApplicationListResponse import com.increase.api.models.oauthapplications.OAuthApplicationRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -63,22 +63,22 @@ interface OAuthApplicationServiceAsync { retrieve(oauthApplicationId, OAuthApplicationRetrieveParams.none(), requestOptions) /** List OAuth Applications */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(OAuthApplicationListParams.none()) /** @see list */ fun list( params: OAuthApplicationListParams = OAuthApplicationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: OAuthApplicationListParams = OAuthApplicationListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(OAuthApplicationListParams.none(), requestOptions) /** @@ -146,25 +146,25 @@ interface OAuthApplicationServiceAsync { * Returns a raw HTTP response for `get /oauth_applications`, but is otherwise the same as * [OAuthApplicationServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(OAuthApplicationListParams.none()) /** @see list */ fun list( params: OAuthApplicationListParams = OAuthApplicationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: OAuthApplicationListParams = OAuthApplicationListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(OAuthApplicationListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsyncImpl.kt index a64c11a11..71dd6934e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.oauthapplications.OAuthApplication +import com.increase.api.models.oauthapplications.OAuthApplicationListPageAsync +import com.increase.api.models.oauthapplications.OAuthApplicationListPageResponse import com.increase.api.models.oauthapplications.OAuthApplicationListParams -import com.increase.api.models.oauthapplications.OAuthApplicationListResponse import com.increase.api.models.oauthapplications.OAuthApplicationRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -47,7 +48,7 @@ internal constructor(private val clientOptions: ClientOptions) : OAuthApplicatio override fun list( params: OAuthApplicationListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /oauth_applications withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -97,13 +98,13 @@ internal constructor(private val clientOptions: ClientOptions) : OAuthApplicatio } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: OAuthApplicationListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -123,6 +124,14 @@ internal constructor(private val clientOptions: ClientOptions) : OAuthApplicatio it.validate() } } + .let { + OAuthApplicationListPageAsync.builder() + .service(OAuthApplicationServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsync.kt index 1b53a258f..d2551c5cc 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.oauthconnections.OAuthConnection +import com.increase.api.models.oauthconnections.OAuthConnectionListPageAsync import com.increase.api.models.oauthconnections.OAuthConnectionListParams -import com.increase.api.models.oauthconnections.OAuthConnectionListResponse import com.increase.api.models.oauthconnections.OAuthConnectionRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -63,22 +63,22 @@ interface OAuthConnectionServiceAsync { retrieve(oauthConnectionId, OAuthConnectionRetrieveParams.none(), requestOptions) /** List OAuth Connections */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(OAuthConnectionListParams.none()) /** @see list */ fun list( params: OAuthConnectionListParams = OAuthConnectionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: OAuthConnectionListParams = OAuthConnectionListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(OAuthConnectionListParams.none(), requestOptions) /** @@ -146,25 +146,25 @@ interface OAuthConnectionServiceAsync { * Returns a raw HTTP response for `get /oauth_connections`, but is otherwise the same as * [OAuthConnectionServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(OAuthConnectionListParams.none()) /** @see list */ fun list( params: OAuthConnectionListParams = OAuthConnectionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: OAuthConnectionListParams = OAuthConnectionListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(OAuthConnectionListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsyncImpl.kt index d1a1f63d8..2583c9b33 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.oauthconnections.OAuthConnection +import com.increase.api.models.oauthconnections.OAuthConnectionListPageAsync +import com.increase.api.models.oauthconnections.OAuthConnectionListPageResponse import com.increase.api.models.oauthconnections.OAuthConnectionListParams -import com.increase.api.models.oauthconnections.OAuthConnectionListResponse import com.increase.api.models.oauthconnections.OAuthConnectionRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -47,7 +48,7 @@ internal constructor(private val clientOptions: ClientOptions) : OAuthConnection override fun list( params: OAuthConnectionListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /oauth_connections withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -97,13 +98,13 @@ internal constructor(private val clientOptions: ClientOptions) : OAuthConnection } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: OAuthConnectionListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -123,6 +124,14 @@ internal constructor(private val clientOptions: ClientOptions) : OAuthConnection it.validate() } } + .let { + OAuthConnectionListPageAsync.builder() + .service(OAuthConnectionServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PendingTransactionServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PendingTransactionServiceAsync.kt index 1976e0c9c..89147a5a6 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PendingTransactionServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PendingTransactionServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.pendingtransactions.PendingTransaction import com.increase.api.models.pendingtransactions.PendingTransactionCreateParams +import com.increase.api.models.pendingtransactions.PendingTransactionListPageAsync import com.increase.api.models.pendingtransactions.PendingTransactionListParams -import com.increase.api.models.pendingtransactions.PendingTransactionListResponse import com.increase.api.models.pendingtransactions.PendingTransactionReleaseParams import com.increase.api.models.pendingtransactions.PendingTransactionRetrieveParams import java.util.concurrent.CompletableFuture @@ -83,22 +83,22 @@ interface PendingTransactionServiceAsync { retrieve(pendingTransactionId, PendingTransactionRetrieveParams.none(), requestOptions) /** List Pending Transactions */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(PendingTransactionListParams.none()) /** @see list */ fun list( params: PendingTransactionListParams = PendingTransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: PendingTransactionListParams = PendingTransactionListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(PendingTransactionListParams.none(), requestOptions) /** @@ -224,25 +224,25 @@ interface PendingTransactionServiceAsync { * Returns a raw HTTP response for `get /pending_transactions`, but is otherwise the same as * [PendingTransactionServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(PendingTransactionListParams.none()) /** @see list */ fun list( params: PendingTransactionListParams = PendingTransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: PendingTransactionListParams = PendingTransactionListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(PendingTransactionListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PendingTransactionServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PendingTransactionServiceAsyncImpl.kt index 680d591f3..972ee4956 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PendingTransactionServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PendingTransactionServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.pendingtransactions.PendingTransaction import com.increase.api.models.pendingtransactions.PendingTransactionCreateParams +import com.increase.api.models.pendingtransactions.PendingTransactionListPageAsync +import com.increase.api.models.pendingtransactions.PendingTransactionListPageResponse import com.increase.api.models.pendingtransactions.PendingTransactionListParams -import com.increase.api.models.pendingtransactions.PendingTransactionListResponse import com.increase.api.models.pendingtransactions.PendingTransactionReleaseParams import com.increase.api.models.pendingtransactions.PendingTransactionRetrieveParams import java.util.concurrent.CompletableFuture @@ -59,7 +60,7 @@ internal constructor(private val clientOptions: ClientOptions) : PendingTransact override fun list( params: PendingTransactionListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /pending_transactions withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -147,13 +148,13 @@ internal constructor(private val clientOptions: ClientOptions) : PendingTransact } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: PendingTransactionListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -173,6 +174,14 @@ internal constructor(private val clientOptions: ClientOptions) : PendingTransact it.validate() } } + .let { + PendingTransactionListPageAsync.builder() + .service(PendingTransactionServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsync.kt index db8b6af84..c5fc02f83 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsync.kt @@ -9,8 +9,8 @@ import com.increase.api.models.physicalcardprofiles.PhysicalCardProfile import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileArchiveParams import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCloneParams import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCreateParams +import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListPageAsync import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListParams -import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListResponse import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -80,22 +80,22 @@ interface PhysicalCardProfileServiceAsync { retrieve(physicalCardProfileId, PhysicalCardProfileRetrieveParams.none(), requestOptions) /** List Physical Card Profiles */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(PhysicalCardProfileListParams.none()) /** @see list */ fun list( params: PhysicalCardProfileListParams = PhysicalCardProfileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: PhysicalCardProfileListParams = PhysicalCardProfileListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(PhysicalCardProfileListParams.none(), requestOptions) /** Archive a Physical Card Profile */ @@ -260,25 +260,25 @@ interface PhysicalCardProfileServiceAsync { * Returns a raw HTTP response for `get /physical_card_profiles`, but is otherwise the same * as [PhysicalCardProfileServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(PhysicalCardProfileListParams.none()) /** @see list */ fun list( params: PhysicalCardProfileListParams = PhysicalCardProfileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: PhysicalCardProfileListParams = PhysicalCardProfileListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(PhysicalCardProfileListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsyncImpl.kt index dbf58c1ba..54481dfe0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsyncImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.physicalcardprofiles.PhysicalCardProfile import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileArchiveParams import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCloneParams import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCreateParams +import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListPageAsync +import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListPageResponse import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListParams -import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListResponse import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -61,7 +62,7 @@ internal constructor(private val clientOptions: ClientOptions) : PhysicalCardPro override fun list( params: PhysicalCardProfileListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /physical_card_profiles withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -156,13 +157,13 @@ internal constructor(private val clientOptions: ClientOptions) : PhysicalCardPro } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: PhysicalCardProfileListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -182,6 +183,14 @@ internal constructor(private val clientOptions: ClientOptions) : PhysicalCardPro it.validate() } } + .let { + PhysicalCardProfileListPageAsync.builder() + .service(PhysicalCardProfileServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardServiceAsync.kt index aa18f3492..5e93df7d5 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.physicalcards.PhysicalCard import com.increase.api.models.physicalcards.PhysicalCardCreateParams +import com.increase.api.models.physicalcards.PhysicalCardListPageAsync import com.increase.api.models.physicalcards.PhysicalCardListParams -import com.increase.api.models.physicalcards.PhysicalCardListResponse import com.increase.api.models.physicalcards.PhysicalCardRetrieveParams import com.increase.api.models.physicalcards.PhysicalCardUpdateParams import java.util.concurrent.CompletableFuture @@ -98,21 +98,21 @@ interface PhysicalCardServiceAsync { ): CompletableFuture /** List Physical Cards */ - fun list(): CompletableFuture = list(PhysicalCardListParams.none()) + fun list(): CompletableFuture = list(PhysicalCardListParams.none()) /** @see list */ fun list( params: PhysicalCardListParams = PhysicalCardListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: PhysicalCardListParams = PhysicalCardListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(PhysicalCardListParams.none(), requestOptions) /** @@ -218,25 +218,25 @@ interface PhysicalCardServiceAsync { * Returns a raw HTTP response for `get /physical_cards`, but is otherwise the same as * [PhysicalCardServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(PhysicalCardListParams.none()) /** @see list */ fun list( params: PhysicalCardListParams = PhysicalCardListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: PhysicalCardListParams = PhysicalCardListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(PhysicalCardListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardServiceAsyncImpl.kt index 26dc67506..9573e1ec7 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/PhysicalCardServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.physicalcards.PhysicalCard import com.increase.api.models.physicalcards.PhysicalCardCreateParams +import com.increase.api.models.physicalcards.PhysicalCardListPageAsync +import com.increase.api.models.physicalcards.PhysicalCardListPageResponse import com.increase.api.models.physicalcards.PhysicalCardListParams -import com.increase.api.models.physicalcards.PhysicalCardListResponse import com.increase.api.models.physicalcards.PhysicalCardRetrieveParams import com.increase.api.models.physicalcards.PhysicalCardUpdateParams import java.util.concurrent.CompletableFuture @@ -62,7 +63,7 @@ class PhysicalCardServiceAsyncImpl internal constructor(private val clientOption override fun list( params: PhysicalCardListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /physical_cards withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -177,13 +178,13 @@ class PhysicalCardServiceAsyncImpl internal constructor(private val clientOption } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: PhysicalCardListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -203,6 +204,14 @@ class PhysicalCardServiceAsyncImpl internal constructor(private val clientOption it.validate() } } + .let { + PhysicalCardListPageAsync.builder() + .service(PhysicalCardServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ProgramServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ProgramServiceAsync.kt index 29fb72997..62d5553b6 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ProgramServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ProgramServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.programs.Program +import com.increase.api.models.programs.ProgramListPageAsync import com.increase.api.models.programs.ProgramListParams -import com.increase.api.models.programs.ProgramListResponse import com.increase.api.models.programs.ProgramRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -59,21 +59,21 @@ interface ProgramServiceAsync { retrieve(programId, ProgramRetrieveParams.none(), requestOptions) /** List Programs */ - fun list(): CompletableFuture = list(ProgramListParams.none()) + fun list(): CompletableFuture = list(ProgramListParams.none()) /** @see list */ fun list( params: ProgramListParams = ProgramListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: ProgramListParams = ProgramListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(ProgramListParams.none(), requestOptions) /** @@ -133,25 +133,25 @@ interface ProgramServiceAsync { * Returns a raw HTTP response for `get /programs`, but is otherwise the same as * [ProgramServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(ProgramListParams.none()) /** @see list */ fun list( params: ProgramListParams = ProgramListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: ProgramListParams = ProgramListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(ProgramListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ProgramServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ProgramServiceAsyncImpl.kt index 700cc7818..2d81b6a6b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/ProgramServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/ProgramServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.programs.Program +import com.increase.api.models.programs.ProgramListPageAsync +import com.increase.api.models.programs.ProgramListPageResponse import com.increase.api.models.programs.ProgramListParams -import com.increase.api.models.programs.ProgramListResponse import com.increase.api.models.programs.ProgramRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -45,7 +46,7 @@ class ProgramServiceAsyncImpl internal constructor(private val clientOptions: Cl override fun list( params: ProgramListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /programs withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -95,13 +96,13 @@ class ProgramServiceAsyncImpl internal constructor(private val clientOptions: Cl } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: ProgramListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -121,6 +122,14 @@ class ProgramServiceAsyncImpl internal constructor(private val clientOptions: Cl it.validate() } } + .let { + ProgramListPageAsync.builder() + .service(ProgramServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsync.kt index 3b11a3b65..0ed14add4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsync.kt @@ -9,8 +9,8 @@ import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransfe import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferApproveParams import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferCancelParams import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferCreateParams +import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListPageAsync import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListParams -import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListResponse import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -87,24 +87,25 @@ interface RealTimePaymentsTransferServiceAsync { ) /** List Real-Time Payments Transfers */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(RealTimePaymentsTransferListParams.none()) /** @see list */ fun list( params: RealTimePaymentsTransferListParams = RealTimePaymentsTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: RealTimePaymentsTransferListParams = RealTimePaymentsTransferListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = + list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture = + ): CompletableFuture = list(RealTimePaymentsTransferListParams.none(), requestOptions) /** Approves a Real-Time Payments Transfer in a pending_approval state. */ @@ -283,25 +284,25 @@ interface RealTimePaymentsTransferServiceAsync { * Returns a raw HTTP response for `get /real_time_payments_transfers`, but is otherwise the * same as [RealTimePaymentsTransferServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(RealTimePaymentsTransferListParams.none()) /** @see list */ fun list( params: RealTimePaymentsTransferListParams = RealTimePaymentsTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: RealTimePaymentsTransferListParams = RealTimePaymentsTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(RealTimePaymentsTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsyncImpl.kt index e2af980cd..e5c3dd82e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsyncImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransfe import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferApproveParams import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferCancelParams import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferCreateParams +import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListPageAsync +import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListPageResponse import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListParams -import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListResponse import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -62,7 +63,7 @@ internal constructor(private val clientOptions: ClientOptions) : override fun list( params: RealTimePaymentsTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /real_time_payments_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -160,13 +161,13 @@ internal constructor(private val clientOptions: ClientOptions) : } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: RealTimePaymentsTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -186,6 +187,16 @@ internal constructor(private val clientOptions: ClientOptions) : it.validate() } } + .let { + RealTimePaymentsTransferListPageAsync.builder() + .service( + RealTimePaymentsTransferServiceAsyncImpl(clientOptions) + ) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/RoutingNumberServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/RoutingNumberServiceAsync.kt index 01af340c4..7b3af3587 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/RoutingNumberServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/RoutingNumberServiceAsync.kt @@ -5,8 +5,8 @@ package com.increase.api.services.async import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.routingnumbers.RoutingNumberListPageAsync import com.increase.api.models.routingnumbers.RoutingNumberListParams -import com.increase.api.models.routingnumbers.RoutingNumberListResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -30,14 +30,14 @@ interface RoutingNumberServiceAsync { * will always return 0 or 1 entry. In Sandbox, the only valid routing number for this method * is 110000000. */ - fun list(params: RoutingNumberListParams): CompletableFuture = + fun list(params: RoutingNumberListParams): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ fun list( params: RoutingNumberListParams, requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** * A view of [RoutingNumberServiceAsync] that provides access to raw HTTP responses for each @@ -60,13 +60,13 @@ interface RoutingNumberServiceAsync { */ fun list( params: RoutingNumberListParams - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( params: RoutingNumberListParams, requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/RoutingNumberServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/RoutingNumberServiceAsyncImpl.kt index 8a08f7b93..9a29e733a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/RoutingNumberServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/RoutingNumberServiceAsyncImpl.kt @@ -14,8 +14,9 @@ import com.increase.api.core.http.HttpResponse.Handler import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync +import com.increase.api.models.routingnumbers.RoutingNumberListPageAsync +import com.increase.api.models.routingnumbers.RoutingNumberListPageResponse import com.increase.api.models.routingnumbers.RoutingNumberListParams -import com.increase.api.models.routingnumbers.RoutingNumberListResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -34,7 +35,7 @@ class RoutingNumberServiceAsyncImpl internal constructor(private val clientOptio override fun list( params: RoutingNumberListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /routing_numbers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -51,13 +52,13 @@ class RoutingNumberServiceAsyncImpl internal constructor(private val clientOptio clientOptions.toBuilder().apply(modifier::accept).build() ) - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: RoutingNumberListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -77,6 +78,14 @@ class RoutingNumberServiceAsyncImpl internal constructor(private val clientOptio it.validate() } } + .let { + RoutingNumberListPageAsync.builder() + .service(RoutingNumberServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsync.kt index 078900cc7..9f9a06895 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.supplementaldocuments.EntitySupplementalDocument import com.increase.api.models.supplementaldocuments.SupplementalDocumentCreateParams +import com.increase.api.models.supplementaldocuments.SupplementalDocumentListPageAsync import com.increase.api.models.supplementaldocuments.SupplementalDocumentListParams -import com.increase.api.models.supplementaldocuments.SupplementalDocumentListResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -40,13 +40,13 @@ interface SupplementalDocumentServiceAsync { /** List Entity Supplemental Document Submissions */ fun list( params: SupplementalDocumentListParams - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ fun list( params: SupplementalDocumentListParams, requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** * A view of [SupplementalDocumentServiceAsync] that provides access to raw HTTP responses for @@ -84,13 +84,13 @@ interface SupplementalDocumentServiceAsync { */ fun list( params: SupplementalDocumentListParams - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( params: SupplementalDocumentListParams, requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsyncImpl.kt index 29e5d1f85..cd610944d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsyncImpl.kt @@ -17,8 +17,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.supplementaldocuments.EntitySupplementalDocument import com.increase.api.models.supplementaldocuments.SupplementalDocumentCreateParams +import com.increase.api.models.supplementaldocuments.SupplementalDocumentListPageAsync +import com.increase.api.models.supplementaldocuments.SupplementalDocumentListPageResponse import com.increase.api.models.supplementaldocuments.SupplementalDocumentListParams -import com.increase.api.models.supplementaldocuments.SupplementalDocumentListResponse import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -49,7 +50,7 @@ internal constructor(private val clientOptions: ClientOptions) : SupplementalDoc override fun list( params: SupplementalDocumentListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /entity_supplemental_documents withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -97,13 +98,13 @@ internal constructor(private val clientOptions: ClientOptions) : SupplementalDoc } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: SupplementalDocumentListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -123,6 +124,14 @@ internal constructor(private val clientOptions: ClientOptions) : SupplementalDoc it.validate() } } + .let { + SupplementalDocumentListPageAsync.builder() + .service(SupplementalDocumentServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/TransactionServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/TransactionServiceAsync.kt index 82cc24986..420ce8bd8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/TransactionServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/TransactionServiceAsync.kt @@ -6,8 +6,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.transactions.Transaction +import com.increase.api.models.transactions.TransactionListPageAsync import com.increase.api.models.transactions.TransactionListParams -import com.increase.api.models.transactions.TransactionListResponse import com.increase.api.models.transactions.TransactionRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -62,21 +62,21 @@ interface TransactionServiceAsync { retrieve(transactionId, TransactionRetrieveParams.none(), requestOptions) /** List Transactions */ - fun list(): CompletableFuture = list(TransactionListParams.none()) + fun list(): CompletableFuture = list(TransactionListParams.none()) /** @see list */ fun list( params: TransactionListParams = TransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: TransactionListParams = TransactionListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(TransactionListParams.none(), requestOptions) /** @@ -138,25 +138,25 @@ interface TransactionServiceAsync { * Returns a raw HTTP response for `get /transactions`, but is otherwise the same as * [TransactionServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(TransactionListParams.none()) /** @see list */ fun list( params: TransactionListParams = TransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: TransactionListParams = TransactionListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(TransactionListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/TransactionServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/TransactionServiceAsyncImpl.kt index 1ca067e59..f1b045b1f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/TransactionServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/TransactionServiceAsyncImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.transactions.Transaction +import com.increase.api.models.transactions.TransactionListPageAsync +import com.increase.api.models.transactions.TransactionListPageResponse import com.increase.api.models.transactions.TransactionListParams -import com.increase.api.models.transactions.TransactionListResponse import com.increase.api.models.transactions.TransactionRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -45,7 +46,7 @@ class TransactionServiceAsyncImpl internal constructor(private val clientOptions override fun list( params: TransactionListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /transactions withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -95,13 +96,13 @@ class TransactionServiceAsyncImpl internal constructor(private val clientOptions } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: TransactionListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -121,6 +122,14 @@ class TransactionServiceAsyncImpl internal constructor(private val clientOptions it.validate() } } + .let { + TransactionListPageAsync.builder() + .service(TransactionServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsync.kt index d07988ee3..0fcb9d60c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsync.kt @@ -7,8 +7,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequest import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestCreateParams +import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListPageAsync import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListParams -import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListResponse import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -78,22 +78,22 @@ interface WireDrawdownRequestServiceAsync { retrieve(wireDrawdownRequestId, WireDrawdownRequestRetrieveParams.none(), requestOptions) /** List Wire Drawdown Requests */ - fun list(): CompletableFuture = + fun list(): CompletableFuture = list(WireDrawdownRequestListParams.none()) /** @see list */ fun list( params: WireDrawdownRequestListParams = WireDrawdownRequestListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: WireDrawdownRequestListParams = WireDrawdownRequestListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(WireDrawdownRequestListParams.none(), requestOptions) /** @@ -180,25 +180,25 @@ interface WireDrawdownRequestServiceAsync { * Returns a raw HTTP response for `get /wire_drawdown_requests`, but is otherwise the same * as [WireDrawdownRequestServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(WireDrawdownRequestListParams.none()) /** @see list */ fun list( params: WireDrawdownRequestListParams = WireDrawdownRequestListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: WireDrawdownRequestListParams = WireDrawdownRequestListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(WireDrawdownRequestListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsyncImpl.kt index ca162d18a..7ba178476 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsyncImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepareAsync import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequest import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestCreateParams +import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListPageAsync +import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListPageResponse import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListParams -import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListResponse import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -59,7 +60,7 @@ internal constructor(private val clientOptions: ClientOptions) : WireDrawdownReq override fun list( params: WireDrawdownRequestListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /wire_drawdown_requests withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -140,13 +141,13 @@ internal constructor(private val clientOptions: ClientOptions) : WireDrawdownReq } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: WireDrawdownRequestListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -166,6 +167,14 @@ internal constructor(private val clientOptions: ClientOptions) : WireDrawdownReq it.validate() } } + .let { + WireDrawdownRequestListPageAsync.builder() + .service(WireDrawdownRequestServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireTransferServiceAsync.kt index 000dd68e1..96a41454c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireTransferServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireTransferServiceAsync.kt @@ -9,8 +9,8 @@ import com.increase.api.models.wiretransfers.WireTransfer import com.increase.api.models.wiretransfers.WireTransferApproveParams import com.increase.api.models.wiretransfers.WireTransferCancelParams import com.increase.api.models.wiretransfers.WireTransferCreateParams +import com.increase.api.models.wiretransfers.WireTransferListPageAsync import com.increase.api.models.wiretransfers.WireTransferListParams -import com.increase.api.models.wiretransfers.WireTransferListResponse import com.increase.api.models.wiretransfers.WireTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -75,21 +75,21 @@ interface WireTransferServiceAsync { retrieve(wireTransferId, WireTransferRetrieveParams.none(), requestOptions) /** List Wire Transfers */ - fun list(): CompletableFuture = list(WireTransferListParams.none()) + fun list(): CompletableFuture = list(WireTransferListParams.none()) /** @see list */ fun list( params: WireTransferListParams = WireTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture + ): CompletableFuture /** @see list */ fun list( params: WireTransferListParams = WireTransferListParams.none() - ): CompletableFuture = list(params, RequestOptions.none()) + ): CompletableFuture = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CompletableFuture = + fun list(requestOptions: RequestOptions): CompletableFuture = list(WireTransferListParams.none(), requestOptions) /** Approve a Wire Transfer */ @@ -236,25 +236,25 @@ interface WireTransferServiceAsync { * Returns a raw HTTP response for `get /wire_transfers`, but is otherwise the same as * [WireTransferServiceAsync.list]. */ - fun list(): CompletableFuture> = + fun list(): CompletableFuture> = list(WireTransferListParams.none()) /** @see list */ fun list( params: WireTransferListParams = WireTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CompletableFuture> + ): CompletableFuture> /** @see list */ fun list( params: WireTransferListParams = WireTransferListParams.none() - ): CompletableFuture> = + ): CompletableFuture> = list(params, RequestOptions.none()) /** @see list */ fun list( requestOptions: RequestOptions - ): CompletableFuture> = + ): CompletableFuture> = list(WireTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireTransferServiceAsyncImpl.kt index 31e28d3cd..351492acd 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireTransferServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/WireTransferServiceAsyncImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.wiretransfers.WireTransfer import com.increase.api.models.wiretransfers.WireTransferApproveParams import com.increase.api.models.wiretransfers.WireTransferCancelParams import com.increase.api.models.wiretransfers.WireTransferCreateParams +import com.increase.api.models.wiretransfers.WireTransferListPageAsync +import com.increase.api.models.wiretransfers.WireTransferListPageResponse import com.increase.api.models.wiretransfers.WireTransferListParams -import com.increase.api.models.wiretransfers.WireTransferListResponse import com.increase.api.models.wiretransfers.WireTransferRetrieveParams import java.util.concurrent.CompletableFuture import java.util.function.Consumer @@ -56,7 +57,7 @@ class WireTransferServiceAsyncImpl internal constructor(private val clientOption override fun list( params: WireTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture = + ): CompletableFuture = // get /wire_transfers withRawResponse().list(params, requestOptions).thenApply { it.parse() } @@ -151,13 +152,13 @@ class WireTransferServiceAsyncImpl internal constructor(private val clientOption } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: WireTransferListParams, requestOptions: RequestOptions, - ): CompletableFuture> { + ): CompletableFuture> { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -177,6 +178,14 @@ class WireTransferServiceAsyncImpl internal constructor(private val clientOption it.validate() } } + .let { + WireTransferListPageAsync.builder() + .service(WireTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountNumberService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountNumberService.kt index 8f2310fca..74a746c0c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountNumberService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountNumberService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.accountnumbers.AccountNumber import com.increase.api.models.accountnumbers.AccountNumberCreateParams +import com.increase.api.models.accountnumbers.AccountNumberListPage import com.increase.api.models.accountnumbers.AccountNumberListParams -import com.increase.api.models.accountnumbers.AccountNumberListResponse import com.increase.api.models.accountnumbers.AccountNumberRetrieveParams import com.increase.api.models.accountnumbers.AccountNumberUpdateParams import java.util.function.Consumer @@ -103,21 +103,21 @@ interface AccountNumberService { update(accountNumberId, AccountNumberUpdateParams.none(), requestOptions) /** List Account Numbers */ - fun list(): AccountNumberListResponse = list(AccountNumberListParams.none()) + fun list(): AccountNumberListPage = list(AccountNumberListParams.none()) /** @see list */ fun list( params: AccountNumberListParams = AccountNumberListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): AccountNumberListResponse + ): AccountNumberListPage /** @see list */ fun list( params: AccountNumberListParams = AccountNumberListParams.none() - ): AccountNumberListResponse = list(params, RequestOptions.none()) + ): AccountNumberListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): AccountNumberListResponse = + fun list(requestOptions: RequestOptions): AccountNumberListPage = list(AccountNumberListParams.none(), requestOptions) /** @@ -242,25 +242,24 @@ interface AccountNumberService { * [AccountNumberService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = - list(AccountNumberListParams.none()) + fun list(): HttpResponseFor = list(AccountNumberListParams.none()) /** @see list */ @MustBeClosed fun list( params: AccountNumberListParams = AccountNumberListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: AccountNumberListParams = AccountNumberListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(AccountNumberListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountNumberServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountNumberServiceImpl.kt index 277934218..ecae7d25e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountNumberServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountNumberServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.accountnumbers.AccountNumber import com.increase.api.models.accountnumbers.AccountNumberCreateParams +import com.increase.api.models.accountnumbers.AccountNumberListPage +import com.increase.api.models.accountnumbers.AccountNumberListPageResponse import com.increase.api.models.accountnumbers.AccountNumberListParams -import com.increase.api.models.accountnumbers.AccountNumberListResponse import com.increase.api.models.accountnumbers.AccountNumberRetrieveParams import com.increase.api.models.accountnumbers.AccountNumberUpdateParams import java.util.function.Consumer @@ -61,7 +62,7 @@ class AccountNumberServiceImpl internal constructor(private val clientOptions: C override fun list( params: AccountNumberListParams, requestOptions: RequestOptions, - ): AccountNumberListResponse = + ): AccountNumberListPage = // get /account_numbers withRawResponse().list(params, requestOptions).parse() @@ -167,13 +168,13 @@ class AccountNumberServiceImpl internal constructor(private val clientOptions: C } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AccountNumberListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -191,6 +192,13 @@ class AccountNumberServiceImpl internal constructor(private val clientOptions: C it.validate() } } + .let { + AccountNumberListPage.builder() + .service(AccountNumberServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountService.kt index d30cbd4b1..de9c50d79 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountService.kt @@ -10,8 +10,8 @@ import com.increase.api.models.accounts.Account import com.increase.api.models.accounts.AccountBalanceParams import com.increase.api.models.accounts.AccountCloseParams import com.increase.api.models.accounts.AccountCreateParams +import com.increase.api.models.accounts.AccountListPage import com.increase.api.models.accounts.AccountListParams -import com.increase.api.models.accounts.AccountListResponse import com.increase.api.models.accounts.AccountRetrieveParams import com.increase.api.models.accounts.AccountUpdateParams import com.increase.api.models.accounts.BalanceLookup @@ -99,20 +99,20 @@ interface AccountService { update(accountId, AccountUpdateParams.none(), requestOptions) /** List Accounts */ - fun list(): AccountListResponse = list(AccountListParams.none()) + fun list(): AccountListPage = list(AccountListParams.none()) /** @see list */ fun list( params: AccountListParams = AccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): AccountListResponse + ): AccountListPage /** @see list */ - fun list(params: AccountListParams = AccountListParams.none()): AccountListResponse = + fun list(params: AccountListParams = AccountListParams.none()): AccountListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): AccountListResponse = + fun list(requestOptions: RequestOptions): AccountListPage = list(AccountListParams.none(), requestOptions) /** @@ -286,25 +286,24 @@ interface AccountService { * Returns a raw HTTP response for `get /accounts`, but is otherwise the same as * [AccountService.list]. */ - @MustBeClosed - fun list(): HttpResponseFor = list(AccountListParams.none()) + @MustBeClosed fun list(): HttpResponseFor = list(AccountListParams.none()) /** @see list */ @MustBeClosed fun list( params: AccountListParams = AccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: AccountListParams = AccountListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(AccountListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountServiceImpl.kt index e26325ca6..d84c42c18 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountServiceImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.accounts.Account import com.increase.api.models.accounts.AccountBalanceParams import com.increase.api.models.accounts.AccountCloseParams import com.increase.api.models.accounts.AccountCreateParams +import com.increase.api.models.accounts.AccountListPage +import com.increase.api.models.accounts.AccountListPageResponse import com.increase.api.models.accounts.AccountListParams -import com.increase.api.models.accounts.AccountListResponse import com.increase.api.models.accounts.AccountRetrieveParams import com.increase.api.models.accounts.AccountUpdateParams import com.increase.api.models.accounts.BalanceLookup @@ -52,10 +53,7 @@ class AccountServiceImpl internal constructor(private val clientOptions: ClientO // patch /accounts/{account_id} withRawResponse().update(params, requestOptions).parse() - override fun list( - params: AccountListParams, - requestOptions: RequestOptions, - ): AccountListResponse = + override fun list(params: AccountListParams, requestOptions: RequestOptions): AccountListPage = // get /accounts withRawResponse().list(params, requestOptions).parse() @@ -170,13 +168,13 @@ class AccountServiceImpl internal constructor(private val clientOptions: ClientO } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AccountListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -194,6 +192,13 @@ class AccountServiceImpl internal constructor(private val clientOptions: ClientO it.validate() } } + .let { + AccountListPage.builder() + .service(AccountServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountStatementService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountStatementService.kt index c0b754877..6d4a9967d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountStatementService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountStatementService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.accountstatements.AccountStatement +import com.increase.api.models.accountstatements.AccountStatementListPage import com.increase.api.models.accountstatements.AccountStatementListParams -import com.increase.api.models.accountstatements.AccountStatementListResponse import com.increase.api.models.accountstatements.AccountStatementRetrieveParams import java.util.function.Consumer @@ -59,21 +59,21 @@ interface AccountStatementService { retrieve(accountStatementId, AccountStatementRetrieveParams.none(), requestOptions) /** List Account Statements */ - fun list(): AccountStatementListResponse = list(AccountStatementListParams.none()) + fun list(): AccountStatementListPage = list(AccountStatementListParams.none()) /** @see list */ fun list( params: AccountStatementListParams = AccountStatementListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): AccountStatementListResponse + ): AccountStatementListPage /** @see list */ fun list( params: AccountStatementListParams = AccountStatementListParams.none() - ): AccountStatementListResponse = list(params, RequestOptions.none()) + ): AccountStatementListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): AccountStatementListResponse = + fun list(requestOptions: RequestOptions): AccountStatementListPage = list(AccountStatementListParams.none(), requestOptions) /** @@ -144,7 +144,7 @@ interface AccountStatementService { * [AccountStatementService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(AccountStatementListParams.none()) /** @see list */ @@ -152,17 +152,17 @@ interface AccountStatementService { fun list( params: AccountStatementListParams = AccountStatementListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: AccountStatementListParams = AccountStatementListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(AccountStatementListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountStatementServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountStatementServiceImpl.kt index 122f8a953..c8301c019 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountStatementServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountStatementServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.accountstatements.AccountStatement +import com.increase.api.models.accountstatements.AccountStatementListPage +import com.increase.api.models.accountstatements.AccountStatementListPageResponse import com.increase.api.models.accountstatements.AccountStatementListParams -import com.increase.api.models.accountstatements.AccountStatementListResponse import com.increase.api.models.accountstatements.AccountStatementRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -44,7 +45,7 @@ class AccountStatementServiceImpl internal constructor(private val clientOptions override fun list( params: AccountStatementListParams, requestOptions: RequestOptions, - ): AccountStatementListResponse = + ): AccountStatementListPage = // get /account_statements withRawResponse().list(params, requestOptions).parse() @@ -91,13 +92,13 @@ class AccountStatementServiceImpl internal constructor(private val clientOptions } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AccountStatementListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -115,6 +116,13 @@ class AccountStatementServiceImpl internal constructor(private val clientOptions it.validate() } } + .let { + AccountStatementListPage.builder() + .service(AccountStatementServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountTransferService.kt index 78c0a8e24..8b809fa2d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountTransferService.kt @@ -10,8 +10,8 @@ import com.increase.api.models.accounttransfers.AccountTransfer import com.increase.api.models.accounttransfers.AccountTransferApproveParams import com.increase.api.models.accounttransfers.AccountTransferCancelParams import com.increase.api.models.accounttransfers.AccountTransferCreateParams +import com.increase.api.models.accounttransfers.AccountTransferListPage import com.increase.api.models.accounttransfers.AccountTransferListParams -import com.increase.api.models.accounttransfers.AccountTransferListResponse import com.increase.api.models.accounttransfers.AccountTransferRetrieveParams import java.util.function.Consumer @@ -72,21 +72,21 @@ interface AccountTransferService { retrieve(accountTransferId, AccountTransferRetrieveParams.none(), requestOptions) /** List Account Transfers */ - fun list(): AccountTransferListResponse = list(AccountTransferListParams.none()) + fun list(): AccountTransferListPage = list(AccountTransferListParams.none()) /** @see list */ fun list( params: AccountTransferListParams = AccountTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): AccountTransferListResponse + ): AccountTransferListPage /** @see list */ fun list( params: AccountTransferListParams = AccountTransferListParams.none() - ): AccountTransferListResponse = list(params, RequestOptions.none()) + ): AccountTransferListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): AccountTransferListResponse = + fun list(requestOptions: RequestOptions): AccountTransferListPage = list(AccountTransferListParams.none(), requestOptions) /** Approves an Account Transfer in status `pending_approval`. */ @@ -236,7 +236,7 @@ interface AccountTransferService { * [AccountTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(AccountTransferListParams.none()) /** @see list */ @@ -244,17 +244,17 @@ interface AccountTransferService { fun list( params: AccountTransferListParams = AccountTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: AccountTransferListParams = AccountTransferListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(AccountTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountTransferServiceImpl.kt index 2ac103c23..641c4f6ed 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AccountTransferServiceImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.accounttransfers.AccountTransfer import com.increase.api.models.accounttransfers.AccountTransferApproveParams import com.increase.api.models.accounttransfers.AccountTransferCancelParams import com.increase.api.models.accounttransfers.AccountTransferCreateParams +import com.increase.api.models.accounttransfers.AccountTransferListPage +import com.increase.api.models.accounttransfers.AccountTransferListPageResponse import com.increase.api.models.accounttransfers.AccountTransferListParams -import com.increase.api.models.accounttransfers.AccountTransferListResponse import com.increase.api.models.accounttransfers.AccountTransferRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -55,7 +56,7 @@ class AccountTransferServiceImpl internal constructor(private val clientOptions: override fun list( params: AccountTransferListParams, requestOptions: RequestOptions, - ): AccountTransferListResponse = + ): AccountTransferListPage = // get /account_transfers withRawResponse().list(params, requestOptions).parse() @@ -144,13 +145,13 @@ class AccountTransferServiceImpl internal constructor(private val clientOptions: } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AccountTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -168,6 +169,13 @@ class AccountTransferServiceImpl internal constructor(private val clientOptions: it.validate() } } + .let { + AccountTransferListPage.builder() + .service(AccountTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchPrenotificationService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchPrenotificationService.kt index 39ffc0da7..c0eb5ea78 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchPrenotificationService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchPrenotificationService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.achprenotifications.AchPrenotification import com.increase.api.models.achprenotifications.AchPrenotificationCreateParams +import com.increase.api.models.achprenotifications.AchPrenotificationListPage import com.increase.api.models.achprenotifications.AchPrenotificationListParams -import com.increase.api.models.achprenotifications.AchPrenotificationListResponse import com.increase.api.models.achprenotifications.AchPrenotificationRetrieveParams import java.util.function.Consumer @@ -73,21 +73,21 @@ interface AchPrenotificationService { retrieve(achPrenotificationId, AchPrenotificationRetrieveParams.none(), requestOptions) /** List ACH Prenotifications */ - fun list(): AchPrenotificationListResponse = list(AchPrenotificationListParams.none()) + fun list(): AchPrenotificationListPage = list(AchPrenotificationListParams.none()) /** @see list */ fun list( params: AchPrenotificationListParams = AchPrenotificationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): AchPrenotificationListResponse + ): AchPrenotificationListPage /** @see list */ fun list( params: AchPrenotificationListParams = AchPrenotificationListParams.none() - ): AchPrenotificationListResponse = list(params, RequestOptions.none()) + ): AchPrenotificationListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): AchPrenotificationListResponse = + fun list(requestOptions: RequestOptions): AchPrenotificationListPage = list(AchPrenotificationListParams.none(), requestOptions) /** @@ -174,7 +174,7 @@ interface AchPrenotificationService { * [AchPrenotificationService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(AchPrenotificationListParams.none()) /** @see list */ @@ -182,17 +182,17 @@ interface AchPrenotificationService { fun list( params: AchPrenotificationListParams = AchPrenotificationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: AchPrenotificationListParams = AchPrenotificationListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(AchPrenotificationListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchPrenotificationServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchPrenotificationServiceImpl.kt index dbdc8bde9..7b4dd565b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchPrenotificationServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchPrenotificationServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.achprenotifications.AchPrenotification import com.increase.api.models.achprenotifications.AchPrenotificationCreateParams +import com.increase.api.models.achprenotifications.AchPrenotificationListPage +import com.increase.api.models.achprenotifications.AchPrenotificationListPageResponse import com.increase.api.models.achprenotifications.AchPrenotificationListParams -import com.increase.api.models.achprenotifications.AchPrenotificationListResponse import com.increase.api.models.achprenotifications.AchPrenotificationRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -53,7 +54,7 @@ class AchPrenotificationServiceImpl internal constructor(private val clientOptio override fun list( params: AchPrenotificationListParams, requestOptions: RequestOptions, - ): AchPrenotificationListResponse = + ): AchPrenotificationListPage = // get /ach_prenotifications withRawResponse().list(params, requestOptions).parse() @@ -128,13 +129,13 @@ class AchPrenotificationServiceImpl internal constructor(private val clientOptio } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AchPrenotificationListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -152,6 +153,13 @@ class AchPrenotificationServiceImpl internal constructor(private val clientOptio it.validate() } } + .let { + AchPrenotificationListPage.builder() + .service(AchPrenotificationServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchTransferService.kt index 9cbacda02..ae72d27f3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchTransferService.kt @@ -10,8 +10,8 @@ import com.increase.api.models.achtransfers.AchTransfer import com.increase.api.models.achtransfers.AchTransferApproveParams import com.increase.api.models.achtransfers.AchTransferCancelParams import com.increase.api.models.achtransfers.AchTransferCreateParams +import com.increase.api.models.achtransfers.AchTransferListPage import com.increase.api.models.achtransfers.AchTransferListParams -import com.increase.api.models.achtransfers.AchTransferListResponse import com.increase.api.models.achtransfers.AchTransferRetrieveParams import java.util.function.Consumer @@ -71,21 +71,20 @@ interface AchTransferService { retrieve(achTransferId, AchTransferRetrieveParams.none(), requestOptions) /** List ACH Transfers */ - fun list(): AchTransferListResponse = list(AchTransferListParams.none()) + fun list(): AchTransferListPage = list(AchTransferListParams.none()) /** @see list */ fun list( params: AchTransferListParams = AchTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): AchTransferListResponse + ): AchTransferListPage /** @see list */ - fun list( - params: AchTransferListParams = AchTransferListParams.none() - ): AchTransferListResponse = list(params, RequestOptions.none()) + fun list(params: AchTransferListParams = AchTransferListParams.none()): AchTransferListPage = + list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): AchTransferListResponse = + fun list(requestOptions: RequestOptions): AchTransferListPage = list(AchTransferListParams.none(), requestOptions) /** Approves an ACH Transfer in a pending_approval state. */ @@ -228,24 +227,24 @@ interface AchTransferService { * [AchTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = list(AchTransferListParams.none()) + fun list(): HttpResponseFor = list(AchTransferListParams.none()) /** @see list */ @MustBeClosed fun list( params: AchTransferListParams = AchTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: AchTransferListParams = AchTransferListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(AchTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchTransferServiceImpl.kt index 365f55fc0..1edcf5ca1 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/AchTransferServiceImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.achtransfers.AchTransfer import com.increase.api.models.achtransfers.AchTransferApproveParams import com.increase.api.models.achtransfers.AchTransferCancelParams import com.increase.api.models.achtransfers.AchTransferCreateParams +import com.increase.api.models.achtransfers.AchTransferListPage +import com.increase.api.models.achtransfers.AchTransferListPageResponse import com.increase.api.models.achtransfers.AchTransferListParams -import com.increase.api.models.achtransfers.AchTransferListResponse import com.increase.api.models.achtransfers.AchTransferRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -55,7 +56,7 @@ class AchTransferServiceImpl internal constructor(private val clientOptions: Cli override fun list( params: AchTransferListParams, requestOptions: RequestOptions, - ): AchTransferListResponse = + ): AchTransferListPage = // get /ach_transfers withRawResponse().list(params, requestOptions).parse() @@ -144,13 +145,13 @@ class AchTransferServiceImpl internal constructor(private val clientOptions: Cli } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: AchTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -168,6 +169,13 @@ class AchTransferServiceImpl internal constructor(private val clientOptions: Cli it.validate() } } + .let { + AchTransferListPage.builder() + .service(AchTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingAccountService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingAccountService.kt index bff9dec90..4a579385e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingAccountService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingAccountService.kt @@ -9,8 +9,8 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.bookkeepingaccounts.BookkeepingAccount import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountBalanceParams import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountCreateParams +import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListPage import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListParams -import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListResponse import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountUpdateParams import com.increase.api.models.bookkeepingaccounts.BookkeepingBalanceLookup import java.util.function.Consumer @@ -67,21 +67,21 @@ interface BookkeepingAccountService { ): BookkeepingAccount /** List Bookkeeping Accounts */ - fun list(): BookkeepingAccountListResponse = list(BookkeepingAccountListParams.none()) + fun list(): BookkeepingAccountListPage = list(BookkeepingAccountListParams.none()) /** @see list */ fun list( params: BookkeepingAccountListParams = BookkeepingAccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): BookkeepingAccountListResponse + ): BookkeepingAccountListPage /** @see list */ fun list( params: BookkeepingAccountListParams = BookkeepingAccountListParams.none() - ): BookkeepingAccountListResponse = list(params, RequestOptions.none()) + ): BookkeepingAccountListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): BookkeepingAccountListResponse = + fun list(requestOptions: RequestOptions): BookkeepingAccountListPage = list(BookkeepingAccountListParams.none(), requestOptions) /** Retrieve a Bookkeeping Account Balance */ @@ -192,7 +192,7 @@ interface BookkeepingAccountService { * [BookkeepingAccountService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(BookkeepingAccountListParams.none()) /** @see list */ @@ -200,17 +200,17 @@ interface BookkeepingAccountService { fun list( params: BookkeepingAccountListParams = BookkeepingAccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: BookkeepingAccountListParams = BookkeepingAccountListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(BookkeepingAccountListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingAccountServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingAccountServiceImpl.kt index b72140bf9..6517520a9 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingAccountServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingAccountServiceImpl.kt @@ -19,8 +19,9 @@ import com.increase.api.core.prepare import com.increase.api.models.bookkeepingaccounts.BookkeepingAccount import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountBalanceParams import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountCreateParams +import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListPage +import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListPageResponse import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListParams -import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListResponse import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountUpdateParams import com.increase.api.models.bookkeepingaccounts.BookkeepingBalanceLookup import java.util.function.Consumer @@ -55,7 +56,7 @@ class BookkeepingAccountServiceImpl internal constructor(private val clientOptio override fun list( params: BookkeepingAccountListParams, requestOptions: RequestOptions, - ): BookkeepingAccountListResponse = + ): BookkeepingAccountListPage = // get /bookkeeping_accounts withRawResponse().list(params, requestOptions).parse() @@ -138,13 +139,13 @@ class BookkeepingAccountServiceImpl internal constructor(private val clientOptio } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: BookkeepingAccountListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -162,6 +163,13 @@ class BookkeepingAccountServiceImpl internal constructor(private val clientOptio it.validate() } } + .let { + BookkeepingAccountListPage.builder() + .service(BookkeepingAccountServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntryService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntryService.kt index 91edc2acc..c4503f12b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntryService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntryService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.bookkeepingentries.BookkeepingEntry +import com.increase.api.models.bookkeepingentries.BookkeepingEntryListPage import com.increase.api.models.bookkeepingentries.BookkeepingEntryListParams -import com.increase.api.models.bookkeepingentries.BookkeepingEntryListResponse import com.increase.api.models.bookkeepingentries.BookkeepingEntryRetrieveParams import java.util.function.Consumer @@ -59,21 +59,21 @@ interface BookkeepingEntryService { retrieve(bookkeepingEntryId, BookkeepingEntryRetrieveParams.none(), requestOptions) /** List Bookkeeping Entries */ - fun list(): BookkeepingEntryListResponse = list(BookkeepingEntryListParams.none()) + fun list(): BookkeepingEntryListPage = list(BookkeepingEntryListParams.none()) /** @see list */ fun list( params: BookkeepingEntryListParams = BookkeepingEntryListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): BookkeepingEntryListResponse + ): BookkeepingEntryListPage /** @see list */ fun list( params: BookkeepingEntryListParams = BookkeepingEntryListParams.none() - ): BookkeepingEntryListResponse = list(params, RequestOptions.none()) + ): BookkeepingEntryListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): BookkeepingEntryListResponse = + fun list(requestOptions: RequestOptions): BookkeepingEntryListPage = list(BookkeepingEntryListParams.none(), requestOptions) /** @@ -144,7 +144,7 @@ interface BookkeepingEntryService { * [BookkeepingEntryService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(BookkeepingEntryListParams.none()) /** @see list */ @@ -152,17 +152,17 @@ interface BookkeepingEntryService { fun list( params: BookkeepingEntryListParams = BookkeepingEntryListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: BookkeepingEntryListParams = BookkeepingEntryListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(BookkeepingEntryListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntryServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntryServiceImpl.kt index 0ee9474f3..7cfee297e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntryServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntryServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.bookkeepingentries.BookkeepingEntry +import com.increase.api.models.bookkeepingentries.BookkeepingEntryListPage +import com.increase.api.models.bookkeepingentries.BookkeepingEntryListPageResponse import com.increase.api.models.bookkeepingentries.BookkeepingEntryListParams -import com.increase.api.models.bookkeepingentries.BookkeepingEntryListResponse import com.increase.api.models.bookkeepingentries.BookkeepingEntryRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -44,7 +45,7 @@ class BookkeepingEntryServiceImpl internal constructor(private val clientOptions override fun list( params: BookkeepingEntryListParams, requestOptions: RequestOptions, - ): BookkeepingEntryListResponse = + ): BookkeepingEntryListPage = // get /bookkeeping_entries withRawResponse().list(params, requestOptions).parse() @@ -91,13 +92,13 @@ class BookkeepingEntryServiceImpl internal constructor(private val clientOptions } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: BookkeepingEntryListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -115,6 +116,13 @@ class BookkeepingEntryServiceImpl internal constructor(private val clientOptions it.validate() } } + .let { + BookkeepingEntryListPage.builder() + .service(BookkeepingEntryServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetService.kt index 12fadc483..04ffd9016 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySet import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetCreateParams +import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListPage import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListParams -import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListResponse import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetRetrieveParams import java.util.function.Consumer @@ -76,21 +76,21 @@ interface BookkeepingEntrySetService { retrieve(bookkeepingEntrySetId, BookkeepingEntrySetRetrieveParams.none(), requestOptions) /** List Bookkeeping Entry Sets */ - fun list(): BookkeepingEntrySetListResponse = list(BookkeepingEntrySetListParams.none()) + fun list(): BookkeepingEntrySetListPage = list(BookkeepingEntrySetListParams.none()) /** @see list */ fun list( params: BookkeepingEntrySetListParams = BookkeepingEntrySetListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): BookkeepingEntrySetListResponse + ): BookkeepingEntrySetListPage /** @see list */ fun list( params: BookkeepingEntrySetListParams = BookkeepingEntrySetListParams.none() - ): BookkeepingEntrySetListResponse = list(params, RequestOptions.none()) + ): BookkeepingEntrySetListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): BookkeepingEntrySetListResponse = + fun list(requestOptions: RequestOptions): BookkeepingEntrySetListPage = list(BookkeepingEntrySetListParams.none(), requestOptions) /** @@ -181,7 +181,7 @@ interface BookkeepingEntrySetService { * as [BookkeepingEntrySetService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(BookkeepingEntrySetListParams.none()) /** @see list */ @@ -189,17 +189,17 @@ interface BookkeepingEntrySetService { fun list( params: BookkeepingEntrySetListParams = BookkeepingEntrySetListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: BookkeepingEntrySetListParams = BookkeepingEntrySetListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(BookkeepingEntrySetListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetServiceImpl.kt index 925fa3d80..27ba27ccf 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySet import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetCreateParams +import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListPage +import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListPageResponse import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListParams -import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListResponse import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -55,7 +56,7 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingEntr override fun list( params: BookkeepingEntrySetListParams, requestOptions: RequestOptions, - ): BookkeepingEntrySetListResponse = + ): BookkeepingEntrySetListPage = // get /bookkeeping_entry_sets withRawResponse().list(params, requestOptions).parse() @@ -130,13 +131,13 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingEntr } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: BookkeepingEntrySetListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -154,6 +155,13 @@ internal constructor(private val clientOptions: ClientOptions) : BookkeepingEntr it.validate() } } + .let { + BookkeepingEntrySetListPage.builder() + .service(BookkeepingEntrySetServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardDisputeService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardDisputeService.kt index 5bfb9c9d9..335bce7f8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardDisputeService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardDisputeService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.carddisputes.CardDispute import com.increase.api.models.carddisputes.CardDisputeCreateParams +import com.increase.api.models.carddisputes.CardDisputeListPage import com.increase.api.models.carddisputes.CardDisputeListParams -import com.increase.api.models.carddisputes.CardDisputeListResponse import com.increase.api.models.carddisputes.CardDisputeRetrieveParams import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams import com.increase.api.models.carddisputes.CardDisputeWithdrawParams @@ -71,21 +71,20 @@ interface CardDisputeService { retrieve(cardDisputeId, CardDisputeRetrieveParams.none(), requestOptions) /** List Card Disputes */ - fun list(): CardDisputeListResponse = list(CardDisputeListParams.none()) + fun list(): CardDisputeListPage = list(CardDisputeListParams.none()) /** @see list */ fun list( params: CardDisputeListParams = CardDisputeListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CardDisputeListResponse + ): CardDisputeListPage /** @see list */ - fun list( - params: CardDisputeListParams = CardDisputeListParams.none() - ): CardDisputeListResponse = list(params, RequestOptions.none()) + fun list(params: CardDisputeListParams = CardDisputeListParams.none()): CardDisputeListPage = + list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CardDisputeListResponse = + fun list(requestOptions: RequestOptions): CardDisputeListPage = list(CardDisputeListParams.none(), requestOptions) /** Submit a User Submission for a Card Dispute */ @@ -225,24 +224,24 @@ interface CardDisputeService { * [CardDisputeService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = list(CardDisputeListParams.none()) + fun list(): HttpResponseFor = list(CardDisputeListParams.none()) /** @see list */ @MustBeClosed fun list( params: CardDisputeListParams = CardDisputeListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: CardDisputeListParams = CardDisputeListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(CardDisputeListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardDisputeServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardDisputeServiceImpl.kt index 5103f9977..d40ef689d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardDisputeServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardDisputeServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.carddisputes.CardDispute import com.increase.api.models.carddisputes.CardDisputeCreateParams +import com.increase.api.models.carddisputes.CardDisputeListPage +import com.increase.api.models.carddisputes.CardDisputeListPageResponse import com.increase.api.models.carddisputes.CardDisputeListParams -import com.increase.api.models.carddisputes.CardDisputeListResponse import com.increase.api.models.carddisputes.CardDisputeRetrieveParams import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams import com.increase.api.models.carddisputes.CardDisputeWithdrawParams @@ -55,7 +56,7 @@ class CardDisputeServiceImpl internal constructor(private val clientOptions: Cli override fun list( params: CardDisputeListParams, requestOptions: RequestOptions, - ): CardDisputeListResponse = + ): CardDisputeListPage = // get /card_disputes withRawResponse().list(params, requestOptions).parse() @@ -144,13 +145,13 @@ class CardDisputeServiceImpl internal constructor(private val clientOptions: Cli } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardDisputeListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -168,6 +169,13 @@ class CardDisputeServiceImpl internal constructor(private val clientOptions: Cli it.validate() } } + .let { + CardDisputeListPage.builder() + .service(CardDisputeServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPaymentService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPaymentService.kt index c25892861..6a65fae30 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPaymentService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPaymentService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.cardpayments.CardPayment +import com.increase.api.models.cardpayments.CardPaymentListPage import com.increase.api.models.cardpayments.CardPaymentListParams -import com.increase.api.models.cardpayments.CardPaymentListResponse import com.increase.api.models.cardpayments.CardPaymentRetrieveParams import java.util.function.Consumer @@ -59,21 +59,20 @@ interface CardPaymentService { retrieve(cardPaymentId, CardPaymentRetrieveParams.none(), requestOptions) /** List Card Payments */ - fun list(): CardPaymentListResponse = list(CardPaymentListParams.none()) + fun list(): CardPaymentListPage = list(CardPaymentListParams.none()) /** @see list */ fun list( params: CardPaymentListParams = CardPaymentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CardPaymentListResponse + ): CardPaymentListPage /** @see list */ - fun list( - params: CardPaymentListParams = CardPaymentListParams.none() - ): CardPaymentListResponse = list(params, RequestOptions.none()) + fun list(params: CardPaymentListParams = CardPaymentListParams.none()): CardPaymentListPage = + list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CardPaymentListResponse = + fun list(requestOptions: RequestOptions): CardPaymentListPage = list(CardPaymentListParams.none(), requestOptions) /** @@ -139,24 +138,24 @@ interface CardPaymentService { * [CardPaymentService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = list(CardPaymentListParams.none()) + fun list(): HttpResponseFor = list(CardPaymentListParams.none()) /** @see list */ @MustBeClosed fun list( params: CardPaymentListParams = CardPaymentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: CardPaymentListParams = CardPaymentListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(CardPaymentListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPaymentServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPaymentServiceImpl.kt index 848eb23b3..dc1b249b3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPaymentServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPaymentServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.cardpayments.CardPayment +import com.increase.api.models.cardpayments.CardPaymentListPage +import com.increase.api.models.cardpayments.CardPaymentListPageResponse import com.increase.api.models.cardpayments.CardPaymentListParams -import com.increase.api.models.cardpayments.CardPaymentListResponse import com.increase.api.models.cardpayments.CardPaymentRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -44,7 +45,7 @@ class CardPaymentServiceImpl internal constructor(private val clientOptions: Cli override fun list( params: CardPaymentListParams, requestOptions: RequestOptions, - ): CardPaymentListResponse = + ): CardPaymentListPage = // get /card_payments withRawResponse().list(params, requestOptions).parse() @@ -91,13 +92,13 @@ class CardPaymentServiceImpl internal constructor(private val clientOptions: Cli } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardPaymentListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -115,6 +116,13 @@ class CardPaymentServiceImpl internal constructor(private val clientOptions: Cli it.validate() } } + .let { + CardPaymentListPage.builder() + .service(CardPaymentServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementService.kt index 89aa97d0d..e3b0e5f4d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplement +import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListPage import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListParams -import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListResponse import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementRetrieveParams import java.util.function.Consumer @@ -69,21 +69,21 @@ interface CardPurchaseSupplementService { ) /** List Card Purchase Supplements */ - fun list(): CardPurchaseSupplementListResponse = list(CardPurchaseSupplementListParams.none()) + fun list(): CardPurchaseSupplementListPage = list(CardPurchaseSupplementListParams.none()) /** @see list */ fun list( params: CardPurchaseSupplementListParams = CardPurchaseSupplementListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CardPurchaseSupplementListResponse + ): CardPurchaseSupplementListPage /** @see list */ fun list( params: CardPurchaseSupplementListParams = CardPurchaseSupplementListParams.none() - ): CardPurchaseSupplementListResponse = list(params, RequestOptions.none()) + ): CardPurchaseSupplementListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CardPurchaseSupplementListResponse = + fun list(requestOptions: RequestOptions): CardPurchaseSupplementListPage = list(CardPurchaseSupplementListParams.none(), requestOptions) /** @@ -162,7 +162,7 @@ interface CardPurchaseSupplementService { * same as [CardPurchaseSupplementService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(CardPurchaseSupplementListParams.none()) /** @see list */ @@ -170,19 +170,17 @@ interface CardPurchaseSupplementService { fun list( params: CardPurchaseSupplementListParams = CardPurchaseSupplementListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: CardPurchaseSupplementListParams = CardPurchaseSupplementListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list( - requestOptions: RequestOptions - ): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(CardPurchaseSupplementListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementServiceImpl.kt index 888cec723..20e041395 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplement +import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListPage +import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListPageResponse import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListParams -import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListResponse import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -46,7 +47,7 @@ internal constructor(private val clientOptions: ClientOptions) : CardPurchaseSup override fun list( params: CardPurchaseSupplementListParams, requestOptions: RequestOptions, - ): CardPurchaseSupplementListResponse = + ): CardPurchaseSupplementListPage = // get /card_purchase_supplements withRawResponse().list(params, requestOptions).parse() @@ -93,13 +94,13 @@ internal constructor(private val clientOptions: ClientOptions) : CardPurchaseSup } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardPurchaseSupplementListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -117,6 +118,13 @@ internal constructor(private val clientOptions: ClientOptions) : CardPurchaseSup it.validate() } } + .let { + CardPurchaseSupplementListPage.builder() + .service(CardPurchaseSupplementServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPushTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPushTransferService.kt index 4338fa995..8f616591d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPushTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPushTransferService.kt @@ -10,8 +10,8 @@ import com.increase.api.models.cardpushtransfers.CardPushTransfer import com.increase.api.models.cardpushtransfers.CardPushTransferApproveParams import com.increase.api.models.cardpushtransfers.CardPushTransferCancelParams import com.increase.api.models.cardpushtransfers.CardPushTransferCreateParams +import com.increase.api.models.cardpushtransfers.CardPushTransferListPage import com.increase.api.models.cardpushtransfers.CardPushTransferListParams -import com.increase.api.models.cardpushtransfers.CardPushTransferListResponse import com.increase.api.models.cardpushtransfers.CardPushTransferRetrieveParams import java.util.function.Consumer @@ -72,21 +72,21 @@ interface CardPushTransferService { retrieve(cardPushTransferId, CardPushTransferRetrieveParams.none(), requestOptions) /** List Card Push Transfers */ - fun list(): CardPushTransferListResponse = list(CardPushTransferListParams.none()) + fun list(): CardPushTransferListPage = list(CardPushTransferListParams.none()) /** @see list */ fun list( params: CardPushTransferListParams = CardPushTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CardPushTransferListResponse + ): CardPushTransferListPage /** @see list */ fun list( params: CardPushTransferListParams = CardPushTransferListParams.none() - ): CardPushTransferListResponse = list(params, RequestOptions.none()) + ): CardPushTransferListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CardPushTransferListResponse = + fun list(requestOptions: RequestOptions): CardPushTransferListPage = list(CardPushTransferListParams.none(), requestOptions) /** Approves a Card Push Transfer in a pending_approval state. */ @@ -236,7 +236,7 @@ interface CardPushTransferService { * [CardPushTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(CardPushTransferListParams.none()) /** @see list */ @@ -244,17 +244,17 @@ interface CardPushTransferService { fun list( params: CardPushTransferListParams = CardPushTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: CardPushTransferListParams = CardPushTransferListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(CardPushTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPushTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPushTransferServiceImpl.kt index 847d095f4..ea2025b6a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPushTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardPushTransferServiceImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.cardpushtransfers.CardPushTransfer import com.increase.api.models.cardpushtransfers.CardPushTransferApproveParams import com.increase.api.models.cardpushtransfers.CardPushTransferCancelParams import com.increase.api.models.cardpushtransfers.CardPushTransferCreateParams +import com.increase.api.models.cardpushtransfers.CardPushTransferListPage +import com.increase.api.models.cardpushtransfers.CardPushTransferListPageResponse import com.increase.api.models.cardpushtransfers.CardPushTransferListParams -import com.increase.api.models.cardpushtransfers.CardPushTransferListResponse import com.increase.api.models.cardpushtransfers.CardPushTransferRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -55,7 +56,7 @@ class CardPushTransferServiceImpl internal constructor(private val clientOptions override fun list( params: CardPushTransferListParams, requestOptions: RequestOptions, - ): CardPushTransferListResponse = + ): CardPushTransferListPage = // get /card_push_transfers withRawResponse().list(params, requestOptions).parse() @@ -144,13 +145,13 @@ class CardPushTransferServiceImpl internal constructor(private val clientOptions } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardPushTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -168,6 +169,13 @@ class CardPushTransferServiceImpl internal constructor(private val clientOptions it.validate() } } + .let { + CardPushTransferListPage.builder() + .service(CardPushTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardService.kt index 38fa36967..501e3d077 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardService.kt @@ -12,8 +12,8 @@ import com.increase.api.models.cards.CardCreateParams import com.increase.api.models.cards.CardDetails import com.increase.api.models.cards.CardDetailsParams import com.increase.api.models.cards.CardIframeUrl +import com.increase.api.models.cards.CardListPage import com.increase.api.models.cards.CardListParams -import com.increase.api.models.cards.CardListResponse import com.increase.api.models.cards.CardRetrieveParams import com.increase.api.models.cards.CardUpdateParams import com.increase.api.models.cards.CardUpdatePinParams @@ -97,20 +97,20 @@ interface CardService { update(cardId, CardUpdateParams.none(), requestOptions) /** List Cards */ - fun list(): CardListResponse = list(CardListParams.none()) + fun list(): CardListPage = list(CardListParams.none()) /** @see list */ fun list( params: CardListParams = CardListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CardListResponse + ): CardListPage /** @see list */ - fun list(params: CardListParams = CardListParams.none()): CardListResponse = + fun list(params: CardListParams = CardListParams.none()): CardListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CardListResponse = + fun list(requestOptions: RequestOptions): CardListPage = list(CardListParams.none(), requestOptions) /** @@ -308,24 +308,23 @@ interface CardService { * Returns a raw HTTP response for `get /cards`, but is otherwise the same as * [CardService.list]. */ - @MustBeClosed fun list(): HttpResponseFor = list(CardListParams.none()) + @MustBeClosed fun list(): HttpResponseFor = list(CardListParams.none()) /** @see list */ @MustBeClosed fun list( params: CardListParams = CardListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed - fun list( - params: CardListParams = CardListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + fun list(params: CardListParams = CardListParams.none()): HttpResponseFor = + list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(CardListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardServiceImpl.kt index d35f40a9b..23c39914f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardServiceImpl.kt @@ -22,8 +22,9 @@ import com.increase.api.models.cards.CardCreateParams import com.increase.api.models.cards.CardDetails import com.increase.api.models.cards.CardDetailsParams import com.increase.api.models.cards.CardIframeUrl +import com.increase.api.models.cards.CardListPage +import com.increase.api.models.cards.CardListPageResponse import com.increase.api.models.cards.CardListParams -import com.increase.api.models.cards.CardListResponse import com.increase.api.models.cards.CardRetrieveParams import com.increase.api.models.cards.CardUpdateParams import com.increase.api.models.cards.CardUpdatePinParams @@ -53,7 +54,7 @@ class CardServiceImpl internal constructor(private val clientOptions: ClientOpti // patch /cards/{card_id} withRawResponse().update(params, requestOptions).parse() - override fun list(params: CardListParams, requestOptions: RequestOptions): CardListResponse = + override fun list(params: CardListParams, requestOptions: RequestOptions): CardListPage = // get /cards withRawResponse().list(params, requestOptions).parse() @@ -174,13 +175,13 @@ class CardServiceImpl internal constructor(private val clientOptions: ClientOpti } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -198,6 +199,13 @@ class CardServiceImpl internal constructor(private val clientOptions: ClientOpti it.validate() } } + .let { + CardListPage.builder() + .service(CardServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardTokenService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardTokenService.kt index 6242cc94a..8ed7df58d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardTokenService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardTokenService.kt @@ -9,8 +9,8 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.cardtokens.CardToken import com.increase.api.models.cardtokens.CardTokenCapabilities import com.increase.api.models.cardtokens.CardTokenCapabilitiesParams +import com.increase.api.models.cardtokens.CardTokenListPage import com.increase.api.models.cardtokens.CardTokenListParams -import com.increase.api.models.cardtokens.CardTokenListResponse import com.increase.api.models.cardtokens.CardTokenRetrieveParams import java.util.function.Consumer @@ -60,20 +60,20 @@ interface CardTokenService { retrieve(cardTokenId, CardTokenRetrieveParams.none(), requestOptions) /** List Card Tokens */ - fun list(): CardTokenListResponse = list(CardTokenListParams.none()) + fun list(): CardTokenListPage = list(CardTokenListParams.none()) /** @see list */ fun list( params: CardTokenListParams = CardTokenListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CardTokenListResponse + ): CardTokenListPage /** @see list */ - fun list(params: CardTokenListParams = CardTokenListParams.none()): CardTokenListResponse = + fun list(params: CardTokenListParams = CardTokenListParams.none()): CardTokenListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CardTokenListResponse = + fun list(requestOptions: RequestOptions): CardTokenListPage = list(CardTokenListParams.none(), requestOptions) /** @@ -171,24 +171,24 @@ interface CardTokenService { * [CardTokenService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = list(CardTokenListParams.none()) + fun list(): HttpResponseFor = list(CardTokenListParams.none()) /** @see list */ @MustBeClosed fun list( params: CardTokenListParams = CardTokenListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: CardTokenListParams = CardTokenListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(CardTokenListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardTokenServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardTokenServiceImpl.kt index d27ee202b..09bc5b07f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardTokenServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardTokenServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.prepare import com.increase.api.models.cardtokens.CardToken import com.increase.api.models.cardtokens.CardTokenCapabilities import com.increase.api.models.cardtokens.CardTokenCapabilitiesParams +import com.increase.api.models.cardtokens.CardTokenListPage +import com.increase.api.models.cardtokens.CardTokenListPageResponse import com.increase.api.models.cardtokens.CardTokenListParams -import com.increase.api.models.cardtokens.CardTokenListResponse import com.increase.api.models.cardtokens.CardTokenRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -46,7 +47,7 @@ class CardTokenServiceImpl internal constructor(private val clientOptions: Clien override fun list( params: CardTokenListParams, requestOptions: RequestOptions, - ): CardTokenListResponse = + ): CardTokenListPage = // get /card_tokens withRawResponse().list(params, requestOptions).parse() @@ -100,13 +101,13 @@ class CardTokenServiceImpl internal constructor(private val clientOptions: Clien } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardTokenListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -124,6 +125,13 @@ class CardTokenServiceImpl internal constructor(private val clientOptions: Clien it.validate() } } + .let { + CardTokenListPage.builder() + .service(CardTokenServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardValidationService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardValidationService.kt index b9cf33fde..45388c39b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardValidationService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardValidationService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.cardvalidations.CardValidation import com.increase.api.models.cardvalidations.CardValidationCreateParams +import com.increase.api.models.cardvalidations.CardValidationListPage import com.increase.api.models.cardvalidations.CardValidationListParams -import com.increase.api.models.cardvalidations.CardValidationListResponse import com.increase.api.models.cardvalidations.CardValidationRetrieveParams import java.util.function.Consumer @@ -70,21 +70,21 @@ interface CardValidationService { retrieve(cardValidationId, CardValidationRetrieveParams.none(), requestOptions) /** List Card Validations */ - fun list(): CardValidationListResponse = list(CardValidationListParams.none()) + fun list(): CardValidationListPage = list(CardValidationListParams.none()) /** @see list */ fun list( params: CardValidationListParams = CardValidationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CardValidationListResponse + ): CardValidationListPage /** @see list */ fun list( params: CardValidationListParams = CardValidationListParams.none() - ): CardValidationListResponse = list(params, RequestOptions.none()) + ): CardValidationListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CardValidationListResponse = + fun list(requestOptions: RequestOptions): CardValidationListPage = list(CardValidationListParams.none(), requestOptions) /** @@ -166,25 +166,24 @@ interface CardValidationService { * [CardValidationService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = - list(CardValidationListParams.none()) + fun list(): HttpResponseFor = list(CardValidationListParams.none()) /** @see list */ @MustBeClosed fun list( params: CardValidationListParams = CardValidationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: CardValidationListParams = CardValidationListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(CardValidationListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardValidationServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardValidationServiceImpl.kt index 07686dd02..8e60fc198 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardValidationServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CardValidationServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.cardvalidations.CardValidation import com.increase.api.models.cardvalidations.CardValidationCreateParams +import com.increase.api.models.cardvalidations.CardValidationListPage +import com.increase.api.models.cardvalidations.CardValidationListPageResponse import com.increase.api.models.cardvalidations.CardValidationListParams -import com.increase.api.models.cardvalidations.CardValidationListResponse import com.increase.api.models.cardvalidations.CardValidationRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -53,7 +54,7 @@ class CardValidationServiceImpl internal constructor(private val clientOptions: override fun list( params: CardValidationListParams, requestOptions: RequestOptions, - ): CardValidationListResponse = + ): CardValidationListPage = // get /card_validations withRawResponse().list(params, requestOptions).parse() @@ -128,13 +129,13 @@ class CardValidationServiceImpl internal constructor(private val clientOptions: } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CardValidationListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -152,6 +153,13 @@ class CardValidationServiceImpl internal constructor(private val clientOptions: it.validate() } } + .let { + CardValidationListPage.builder() + .service(CardValidationServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckDepositService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckDepositService.kt index c555fc8cd..7e6550916 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckDepositService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckDepositService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.checkdeposits.CheckDeposit import com.increase.api.models.checkdeposits.CheckDepositCreateParams +import com.increase.api.models.checkdeposits.CheckDepositListPage import com.increase.api.models.checkdeposits.CheckDepositListParams -import com.increase.api.models.checkdeposits.CheckDepositListResponse import com.increase.api.models.checkdeposits.CheckDepositRetrieveParams import java.util.function.Consumer @@ -70,21 +70,20 @@ interface CheckDepositService { retrieve(checkDepositId, CheckDepositRetrieveParams.none(), requestOptions) /** List Check Deposits */ - fun list(): CheckDepositListResponse = list(CheckDepositListParams.none()) + fun list(): CheckDepositListPage = list(CheckDepositListParams.none()) /** @see list */ fun list( params: CheckDepositListParams = CheckDepositListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CheckDepositListResponse + ): CheckDepositListPage /** @see list */ - fun list( - params: CheckDepositListParams = CheckDepositListParams.none() - ): CheckDepositListResponse = list(params, RequestOptions.none()) + fun list(params: CheckDepositListParams = CheckDepositListParams.none()): CheckDepositListPage = + list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CheckDepositListResponse = + fun list(requestOptions: RequestOptions): CheckDepositListPage = list(CheckDepositListParams.none(), requestOptions) /** @@ -165,24 +164,24 @@ interface CheckDepositService { * [CheckDepositService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = list(CheckDepositListParams.none()) + fun list(): HttpResponseFor = list(CheckDepositListParams.none()) /** @see list */ @MustBeClosed fun list( params: CheckDepositListParams = CheckDepositListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: CheckDepositListParams = CheckDepositListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(CheckDepositListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckDepositServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckDepositServiceImpl.kt index 3b0f3135f..543301178 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckDepositServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckDepositServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.checkdeposits.CheckDeposit import com.increase.api.models.checkdeposits.CheckDepositCreateParams +import com.increase.api.models.checkdeposits.CheckDepositListPage +import com.increase.api.models.checkdeposits.CheckDepositListPageResponse import com.increase.api.models.checkdeposits.CheckDepositListParams -import com.increase.api.models.checkdeposits.CheckDepositListResponse import com.increase.api.models.checkdeposits.CheckDepositRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -53,7 +54,7 @@ class CheckDepositServiceImpl internal constructor(private val clientOptions: Cl override fun list( params: CheckDepositListParams, requestOptions: RequestOptions, - ): CheckDepositListResponse = + ): CheckDepositListPage = // get /check_deposits withRawResponse().list(params, requestOptions).parse() @@ -128,13 +129,13 @@ class CheckDepositServiceImpl internal constructor(private val clientOptions: Cl } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CheckDepositListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -152,6 +153,13 @@ class CheckDepositServiceImpl internal constructor(private val clientOptions: Cl it.validate() } } + .let { + CheckDepositListPage.builder() + .service(CheckDepositServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckTransferService.kt index 96f2908da..bab9a5d27 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckTransferService.kt @@ -10,8 +10,8 @@ import com.increase.api.models.checktransfers.CheckTransfer import com.increase.api.models.checktransfers.CheckTransferApproveParams import com.increase.api.models.checktransfers.CheckTransferCancelParams import com.increase.api.models.checktransfers.CheckTransferCreateParams +import com.increase.api.models.checktransfers.CheckTransferListPage import com.increase.api.models.checktransfers.CheckTransferListParams -import com.increase.api.models.checktransfers.CheckTransferListResponse import com.increase.api.models.checktransfers.CheckTransferRetrieveParams import com.increase.api.models.checktransfers.CheckTransferStopPaymentParams import java.util.function.Consumer @@ -73,21 +73,21 @@ interface CheckTransferService { retrieve(checkTransferId, CheckTransferRetrieveParams.none(), requestOptions) /** List Check Transfers */ - fun list(): CheckTransferListResponse = list(CheckTransferListParams.none()) + fun list(): CheckTransferListPage = list(CheckTransferListParams.none()) /** @see list */ fun list( params: CheckTransferListParams = CheckTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): CheckTransferListResponse + ): CheckTransferListPage /** @see list */ fun list( params: CheckTransferListParams = CheckTransferListParams.none() - ): CheckTransferListResponse = list(params, RequestOptions.none()) + ): CheckTransferListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): CheckTransferListResponse = + fun list(requestOptions: RequestOptions): CheckTransferListPage = list(CheckTransferListParams.none(), requestOptions) /** Approve a Check Transfer */ @@ -267,25 +267,24 @@ interface CheckTransferService { * [CheckTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = - list(CheckTransferListParams.none()) + fun list(): HttpResponseFor = list(CheckTransferListParams.none()) /** @see list */ @MustBeClosed fun list( params: CheckTransferListParams = CheckTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: CheckTransferListParams = CheckTransferListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(CheckTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckTransferServiceImpl.kt index 4ad27740a..60b714ead 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/CheckTransferServiceImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.checktransfers.CheckTransfer import com.increase.api.models.checktransfers.CheckTransferApproveParams import com.increase.api.models.checktransfers.CheckTransferCancelParams import com.increase.api.models.checktransfers.CheckTransferCreateParams +import com.increase.api.models.checktransfers.CheckTransferListPage +import com.increase.api.models.checktransfers.CheckTransferListPageResponse import com.increase.api.models.checktransfers.CheckTransferListParams -import com.increase.api.models.checktransfers.CheckTransferListResponse import com.increase.api.models.checktransfers.CheckTransferRetrieveParams import com.increase.api.models.checktransfers.CheckTransferStopPaymentParams import java.util.function.Consumer @@ -56,7 +57,7 @@ class CheckTransferServiceImpl internal constructor(private val clientOptions: C override fun list( params: CheckTransferListParams, requestOptions: RequestOptions, - ): CheckTransferListResponse = + ): CheckTransferListPage = // get /check_transfers withRawResponse().list(params, requestOptions).parse() @@ -152,13 +153,13 @@ class CheckTransferServiceImpl internal constructor(private val clientOptions: C } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: CheckTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -176,6 +177,13 @@ class CheckTransferServiceImpl internal constructor(private val clientOptions: C it.validate() } } + .let { + CheckTransferListPage.builder() + .service(CheckTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DeclinedTransactionService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DeclinedTransactionService.kt index a02acaca5..853594e74 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DeclinedTransactionService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DeclinedTransactionService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.declinedtransactions.DeclinedTransaction +import com.increase.api.models.declinedtransactions.DeclinedTransactionListPage import com.increase.api.models.declinedtransactions.DeclinedTransactionListParams -import com.increase.api.models.declinedtransactions.DeclinedTransactionListResponse import com.increase.api.models.declinedtransactions.DeclinedTransactionRetrieveParams import java.util.function.Consumer @@ -65,21 +65,21 @@ interface DeclinedTransactionService { retrieve(declinedTransactionId, DeclinedTransactionRetrieveParams.none(), requestOptions) /** List Declined Transactions */ - fun list(): DeclinedTransactionListResponse = list(DeclinedTransactionListParams.none()) + fun list(): DeclinedTransactionListPage = list(DeclinedTransactionListParams.none()) /** @see list */ fun list( params: DeclinedTransactionListParams = DeclinedTransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): DeclinedTransactionListResponse + ): DeclinedTransactionListPage /** @see list */ fun list( params: DeclinedTransactionListParams = DeclinedTransactionListParams.none() - ): DeclinedTransactionListResponse = list(params, RequestOptions.none()) + ): DeclinedTransactionListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): DeclinedTransactionListResponse = + fun list(requestOptions: RequestOptions): DeclinedTransactionListPage = list(DeclinedTransactionListParams.none(), requestOptions) /** @@ -155,7 +155,7 @@ interface DeclinedTransactionService { * as [DeclinedTransactionService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(DeclinedTransactionListParams.none()) /** @see list */ @@ -163,17 +163,17 @@ interface DeclinedTransactionService { fun list( params: DeclinedTransactionListParams = DeclinedTransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: DeclinedTransactionListParams = DeclinedTransactionListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(DeclinedTransactionListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DeclinedTransactionServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DeclinedTransactionServiceImpl.kt index c6554f074..03e13e21a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DeclinedTransactionServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DeclinedTransactionServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.declinedtransactions.DeclinedTransaction +import com.increase.api.models.declinedtransactions.DeclinedTransactionListPage +import com.increase.api.models.declinedtransactions.DeclinedTransactionListPageResponse import com.increase.api.models.declinedtransactions.DeclinedTransactionListParams -import com.increase.api.models.declinedtransactions.DeclinedTransactionListResponse import com.increase.api.models.declinedtransactions.DeclinedTransactionRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -46,7 +47,7 @@ internal constructor(private val clientOptions: ClientOptions) : DeclinedTransac override fun list( params: DeclinedTransactionListParams, requestOptions: RequestOptions, - ): DeclinedTransactionListResponse = + ): DeclinedTransactionListPage = // get /declined_transactions withRawResponse().list(params, requestOptions).parse() @@ -93,13 +94,13 @@ internal constructor(private val clientOptions: ClientOptions) : DeclinedTransac } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: DeclinedTransactionListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -117,6 +118,13 @@ internal constructor(private val clientOptions: ClientOptions) : DeclinedTransac it.validate() } } + .let { + DeclinedTransactionListPage.builder() + .service(DeclinedTransactionServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalCardProfileService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalCardProfileService.kt index 5c2d183ee..04d0e86e9 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalCardProfileService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalCardProfileService.kt @@ -10,8 +10,8 @@ import com.increase.api.models.digitalcardprofiles.DigitalCardProfile import com.increase.api.models.digitalcardprofiles.DigitalCardProfileArchiveParams import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCloneParams import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCreateParams +import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListPage import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListParams -import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListResponse import com.increase.api.models.digitalcardprofiles.DigitalCardProfileRetrieveParams import java.util.function.Consumer @@ -75,21 +75,21 @@ interface DigitalCardProfileService { retrieve(digitalCardProfileId, DigitalCardProfileRetrieveParams.none(), requestOptions) /** List Card Profiles */ - fun list(): DigitalCardProfileListResponse = list(DigitalCardProfileListParams.none()) + fun list(): DigitalCardProfileListPage = list(DigitalCardProfileListParams.none()) /** @see list */ fun list( params: DigitalCardProfileListParams = DigitalCardProfileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): DigitalCardProfileListResponse + ): DigitalCardProfileListPage /** @see list */ fun list( params: DigitalCardProfileListParams = DigitalCardProfileListParams.none() - ): DigitalCardProfileListResponse = list(params, RequestOptions.none()) + ): DigitalCardProfileListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): DigitalCardProfileListResponse = + fun list(requestOptions: RequestOptions): DigitalCardProfileListPage = list(DigitalCardProfileListParams.none(), requestOptions) /** Archive a Digital Card Profile */ @@ -243,7 +243,7 @@ interface DigitalCardProfileService { * as [DigitalCardProfileService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(DigitalCardProfileListParams.none()) /** @see list */ @@ -251,17 +251,17 @@ interface DigitalCardProfileService { fun list( params: DigitalCardProfileListParams = DigitalCardProfileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: DigitalCardProfileListParams = DigitalCardProfileListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(DigitalCardProfileListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceImpl.kt index df82a476c..3f8cc55e1 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.digitalcardprofiles.DigitalCardProfile import com.increase.api.models.digitalcardprofiles.DigitalCardProfileArchiveParams import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCloneParams import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCreateParams +import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListPage +import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListPageResponse import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListParams -import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListResponse import com.increase.api.models.digitalcardprofiles.DigitalCardProfileRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -55,7 +56,7 @@ class DigitalCardProfileServiceImpl internal constructor(private val clientOptio override fun list( params: DigitalCardProfileListParams, requestOptions: RequestOptions, - ): DigitalCardProfileListResponse = + ): DigitalCardProfileListPage = // get /digital_card_profiles withRawResponse().list(params, requestOptions).parse() @@ -144,13 +145,13 @@ class DigitalCardProfileServiceImpl internal constructor(private val clientOptio } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: DigitalCardProfileListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -168,6 +169,13 @@ class DigitalCardProfileServiceImpl internal constructor(private val clientOptio it.validate() } } + .let { + DigitalCardProfileListPage.builder() + .service(DigitalCardProfileServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalWalletTokenService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalWalletTokenService.kt index a109ff98e..4279d4569 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalWalletTokenService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalWalletTokenService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.digitalwallettokens.DigitalWalletToken +import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListPage import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListParams -import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListResponse import com.increase.api.models.digitalwallettokens.DigitalWalletTokenRetrieveParams import java.util.function.Consumer @@ -62,21 +62,21 @@ interface DigitalWalletTokenService { retrieve(digitalWalletTokenId, DigitalWalletTokenRetrieveParams.none(), requestOptions) /** List Digital Wallet Tokens */ - fun list(): DigitalWalletTokenListResponse = list(DigitalWalletTokenListParams.none()) + fun list(): DigitalWalletTokenListPage = list(DigitalWalletTokenListParams.none()) /** @see list */ fun list( params: DigitalWalletTokenListParams = DigitalWalletTokenListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): DigitalWalletTokenListResponse + ): DigitalWalletTokenListPage /** @see list */ fun list( params: DigitalWalletTokenListParams = DigitalWalletTokenListParams.none() - ): DigitalWalletTokenListResponse = list(params, RequestOptions.none()) + ): DigitalWalletTokenListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): DigitalWalletTokenListResponse = + fun list(requestOptions: RequestOptions): DigitalWalletTokenListPage = list(DigitalWalletTokenListParams.none(), requestOptions) /** @@ -148,7 +148,7 @@ interface DigitalWalletTokenService { * as [DigitalWalletTokenService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(DigitalWalletTokenListParams.none()) /** @see list */ @@ -156,17 +156,17 @@ interface DigitalWalletTokenService { fun list( params: DigitalWalletTokenListParams = DigitalWalletTokenListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: DigitalWalletTokenListParams = DigitalWalletTokenListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(DigitalWalletTokenListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalWalletTokenServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalWalletTokenServiceImpl.kt index a730fb3dd..c9015eb00 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalWalletTokenServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DigitalWalletTokenServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.digitalwallettokens.DigitalWalletToken +import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListPage +import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListPageResponse import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListParams -import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListResponse import com.increase.api.models.digitalwallettokens.DigitalWalletTokenRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -44,7 +45,7 @@ class DigitalWalletTokenServiceImpl internal constructor(private val clientOptio override fun list( params: DigitalWalletTokenListParams, requestOptions: RequestOptions, - ): DigitalWalletTokenListResponse = + ): DigitalWalletTokenListPage = // get /digital_wallet_tokens withRawResponse().list(params, requestOptions).parse() @@ -91,13 +92,13 @@ class DigitalWalletTokenServiceImpl internal constructor(private val clientOptio } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: DigitalWalletTokenListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -115,6 +116,13 @@ class DigitalWalletTokenServiceImpl internal constructor(private val clientOptio it.validate() } } + .let { + DigitalWalletTokenListPage.builder() + .service(DigitalWalletTokenServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DocumentService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DocumentService.kt index 3619d2d68..e605ab8a4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DocumentService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DocumentService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.documents.Document import com.increase.api.models.documents.DocumentCreateParams +import com.increase.api.models.documents.DocumentListPage import com.increase.api.models.documents.DocumentListParams -import com.increase.api.models.documents.DocumentListResponse import com.increase.api.models.documents.DocumentRetrieveParams import java.util.function.Consumer @@ -66,20 +66,20 @@ interface DocumentService { retrieve(documentId, DocumentRetrieveParams.none(), requestOptions) /** List Documents */ - fun list(): DocumentListResponse = list(DocumentListParams.none()) + fun list(): DocumentListPage = list(DocumentListParams.none()) /** @see list */ fun list( params: DocumentListParams = DocumentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): DocumentListResponse + ): DocumentListPage /** @see list */ - fun list(params: DocumentListParams = DocumentListParams.none()): DocumentListResponse = + fun list(params: DocumentListParams = DocumentListParams.none()): DocumentListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): DocumentListResponse = + fun list(requestOptions: RequestOptions): DocumentListPage = list(DocumentListParams.none(), requestOptions) /** A view of [DocumentService] that provides access to raw HTTP responses for each method. */ @@ -156,24 +156,24 @@ interface DocumentService { * [DocumentService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = list(DocumentListParams.none()) + fun list(): HttpResponseFor = list(DocumentListParams.none()) /** @see list */ @MustBeClosed fun list( params: DocumentListParams = DocumentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: DocumentListParams = DocumentListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(DocumentListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DocumentServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DocumentServiceImpl.kt index 62b94db4b..fb6b1e538 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DocumentServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/DocumentServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.documents.Document import com.increase.api.models.documents.DocumentCreateParams +import com.increase.api.models.documents.DocumentListPage +import com.increase.api.models.documents.DocumentListPageResponse import com.increase.api.models.documents.DocumentListParams -import com.increase.api.models.documents.DocumentListResponse import com.increase.api.models.documents.DocumentRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -50,7 +51,7 @@ class DocumentServiceImpl internal constructor(private val clientOptions: Client override fun list( params: DocumentListParams, requestOptions: RequestOptions, - ): DocumentListResponse = + ): DocumentListPage = // get /documents withRawResponse().list(params, requestOptions).parse() @@ -125,13 +126,13 @@ class DocumentServiceImpl internal constructor(private val clientOptions: Client } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: DocumentListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -149,6 +150,13 @@ class DocumentServiceImpl internal constructor(private val clientOptions: Client it.validate() } } + .let { + DocumentListPage.builder() + .service(DocumentServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EntityService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EntityService.kt index fb7920372..30a409ceb 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EntityService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EntityService.kt @@ -12,8 +12,8 @@ import com.increase.api.models.entities.EntityArchiveParams import com.increase.api.models.entities.EntityConfirmParams import com.increase.api.models.entities.EntityCreateBeneficialOwnerParams import com.increase.api.models.entities.EntityCreateParams +import com.increase.api.models.entities.EntityListPage import com.increase.api.models.entities.EntityListParams -import com.increase.api.models.entities.EntityListResponse import com.increase.api.models.entities.EntityRetrieveParams import com.increase.api.models.entities.EntityUpdateAddressParams import com.increase.api.models.entities.EntityUpdateBeneficialOwnerAddressParams @@ -101,20 +101,20 @@ interface EntityService { update(entityId, EntityUpdateParams.none(), requestOptions) /** List Entities */ - fun list(): EntityListResponse = list(EntityListParams.none()) + fun list(): EntityListPage = list(EntityListParams.none()) /** @see list */ fun list( params: EntityListParams = EntityListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): EntityListResponse + ): EntityListPage /** @see list */ - fun list(params: EntityListParams = EntityListParams.none()): EntityListResponse = + fun list(params: EntityListParams = EntityListParams.none()): EntityListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): EntityListResponse = + fun list(requestOptions: RequestOptions): EntityListPage = list(EntityListParams.none(), requestOptions) /** Archive an Entity */ @@ -401,25 +401,24 @@ interface EntityService { * Returns a raw HTTP response for `get /entities`, but is otherwise the same as * [EntityService.list]. */ - @MustBeClosed - fun list(): HttpResponseFor = list(EntityListParams.none()) + @MustBeClosed fun list(): HttpResponseFor = list(EntityListParams.none()) /** @see list */ @MustBeClosed fun list( params: EntityListParams = EntityListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: EntityListParams = EntityListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(EntityListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EntityServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EntityServiceImpl.kt index 2c21e1ff1..efb424b7f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EntityServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EntityServiceImpl.kt @@ -22,8 +22,9 @@ import com.increase.api.models.entities.EntityArchiveParams import com.increase.api.models.entities.EntityConfirmParams import com.increase.api.models.entities.EntityCreateBeneficialOwnerParams import com.increase.api.models.entities.EntityCreateParams +import com.increase.api.models.entities.EntityListPage +import com.increase.api.models.entities.EntityListPageResponse import com.increase.api.models.entities.EntityListParams -import com.increase.api.models.entities.EntityListResponse import com.increase.api.models.entities.EntityRetrieveParams import com.increase.api.models.entities.EntityUpdateAddressParams import com.increase.api.models.entities.EntityUpdateBeneficialOwnerAddressParams @@ -56,10 +57,7 @@ class EntityServiceImpl internal constructor(private val clientOptions: ClientOp // patch /entities/{entity_id} withRawResponse().update(params, requestOptions).parse() - override fun list( - params: EntityListParams, - requestOptions: RequestOptions, - ): EntityListResponse = + override fun list(params: EntityListParams, requestOptions: RequestOptions): EntityListPage = // get /entities withRawResponse().list(params, requestOptions).parse() @@ -205,13 +203,13 @@ class EntityServiceImpl internal constructor(private val clientOptions: ClientOp } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: EntityListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -229,6 +227,13 @@ class EntityServiceImpl internal constructor(private val clientOptions: ClientOp it.validate() } } + .let { + EntityListPage.builder() + .service(EntityServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventService.kt index 6801e4fcc..b5ef780ae 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.events.Event +import com.increase.api.models.events.EventListPage import com.increase.api.models.events.EventListParams -import com.increase.api.models.events.EventListResponse import com.increase.api.models.events.EventRetrieveParams import java.util.function.Consumer @@ -54,20 +54,20 @@ interface EventService { retrieve(eventId, EventRetrieveParams.none(), requestOptions) /** List Events */ - fun list(): EventListResponse = list(EventListParams.none()) + fun list(): EventListPage = list(EventListParams.none()) /** @see list */ fun list( params: EventListParams = EventListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): EventListResponse + ): EventListPage /** @see list */ - fun list(params: EventListParams = EventListParams.none()): EventListResponse = + fun list(params: EventListParams = EventListParams.none()): EventListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): EventListResponse = + fun list(requestOptions: RequestOptions): EventListPage = list(EventListParams.none(), requestOptions) /** A view of [EventService] that provides access to raw HTTP responses for each method. */ @@ -125,24 +125,23 @@ interface EventService { * Returns a raw HTTP response for `get /events`, but is otherwise the same as * [EventService.list]. */ - @MustBeClosed fun list(): HttpResponseFor = list(EventListParams.none()) + @MustBeClosed fun list(): HttpResponseFor = list(EventListParams.none()) /** @see list */ @MustBeClosed fun list( params: EventListParams = EventListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed - fun list( - params: EventListParams = EventListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + fun list(params: EventListParams = EventListParams.none()): HttpResponseFor = + list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(EventListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventServiceImpl.kt index 6c0e27595..1d9737984 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.events.Event +import com.increase.api.models.events.EventListPage +import com.increase.api.models.events.EventListPageResponse import com.increase.api.models.events.EventListParams -import com.increase.api.models.events.EventListResponse import com.increase.api.models.events.EventRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -38,7 +39,7 @@ class EventServiceImpl internal constructor(private val clientOptions: ClientOpt // get /events/{event_id} withRawResponse().retrieve(params, requestOptions).parse() - override fun list(params: EventListParams, requestOptions: RequestOptions): EventListResponse = + override fun list(params: EventListParams, requestOptions: RequestOptions): EventListPage = // get /events withRawResponse().list(params, requestOptions).parse() @@ -84,13 +85,13 @@ class EventServiceImpl internal constructor(private val clientOptions: ClientOpt } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: EventListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -108,6 +109,13 @@ class EventServiceImpl internal constructor(private val clientOptions: ClientOpt it.validate() } } + .let { + EventListPage.builder() + .service(EventServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventSubscriptionService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventSubscriptionService.kt index db6574555..7a04d41d7 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventSubscriptionService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventSubscriptionService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.eventsubscriptions.EventSubscription import com.increase.api.models.eventsubscriptions.EventSubscriptionCreateParams +import com.increase.api.models.eventsubscriptions.EventSubscriptionListPage import com.increase.api.models.eventsubscriptions.EventSubscriptionListParams -import com.increase.api.models.eventsubscriptions.EventSubscriptionListResponse import com.increase.api.models.eventsubscriptions.EventSubscriptionRetrieveParams import com.increase.api.models.eventsubscriptions.EventSubscriptionUpdateParams import java.util.function.Consumer @@ -106,21 +106,21 @@ interface EventSubscriptionService { update(eventSubscriptionId, EventSubscriptionUpdateParams.none(), requestOptions) /** List Event Subscriptions */ - fun list(): EventSubscriptionListResponse = list(EventSubscriptionListParams.none()) + fun list(): EventSubscriptionListPage = list(EventSubscriptionListParams.none()) /** @see list */ fun list( params: EventSubscriptionListParams = EventSubscriptionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): EventSubscriptionListResponse + ): EventSubscriptionListPage /** @see list */ fun list( params: EventSubscriptionListParams = EventSubscriptionListParams.none() - ): EventSubscriptionListResponse = list(params, RequestOptions.none()) + ): EventSubscriptionListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): EventSubscriptionListResponse = + fun list(requestOptions: RequestOptions): EventSubscriptionListPage = list(EventSubscriptionListParams.none(), requestOptions) /** @@ -254,7 +254,7 @@ interface EventSubscriptionService { * [EventSubscriptionService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(EventSubscriptionListParams.none()) /** @see list */ @@ -262,17 +262,17 @@ interface EventSubscriptionService { fun list( params: EventSubscriptionListParams = EventSubscriptionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: EventSubscriptionListParams = EventSubscriptionListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(EventSubscriptionListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventSubscriptionServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventSubscriptionServiceImpl.kt index 1d8788e22..17c854137 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventSubscriptionServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/EventSubscriptionServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.eventsubscriptions.EventSubscription import com.increase.api.models.eventsubscriptions.EventSubscriptionCreateParams +import com.increase.api.models.eventsubscriptions.EventSubscriptionListPage +import com.increase.api.models.eventsubscriptions.EventSubscriptionListPageResponse import com.increase.api.models.eventsubscriptions.EventSubscriptionListParams -import com.increase.api.models.eventsubscriptions.EventSubscriptionListResponse import com.increase.api.models.eventsubscriptions.EventSubscriptionRetrieveParams import com.increase.api.models.eventsubscriptions.EventSubscriptionUpdateParams import java.util.function.Consumer @@ -61,7 +62,7 @@ class EventSubscriptionServiceImpl internal constructor(private val clientOption override fun list( params: EventSubscriptionListParams, requestOptions: RequestOptions, - ): EventSubscriptionListResponse = + ): EventSubscriptionListPage = // get /event_subscriptions withRawResponse().list(params, requestOptions).parse() @@ -167,13 +168,13 @@ class EventSubscriptionServiceImpl internal constructor(private val clientOption } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: EventSubscriptionListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -191,6 +192,13 @@ class EventSubscriptionServiceImpl internal constructor(private val clientOption it.validate() } } + .let { + EventSubscriptionListPage.builder() + .service(EventSubscriptionServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExportService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExportService.kt index 98167e66b..fa1470329 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExportService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExportService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.exports.Export import com.increase.api.models.exports.ExportCreateParams +import com.increase.api.models.exports.ExportListPage import com.increase.api.models.exports.ExportListParams -import com.increase.api.models.exports.ExportListResponse import com.increase.api.models.exports.ExportRetrieveParams import java.util.function.Consumer @@ -66,20 +66,20 @@ interface ExportService { retrieve(exportId, ExportRetrieveParams.none(), requestOptions) /** List Exports */ - fun list(): ExportListResponse = list(ExportListParams.none()) + fun list(): ExportListPage = list(ExportListParams.none()) /** @see list */ fun list( params: ExportListParams = ExportListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): ExportListResponse + ): ExportListPage /** @see list */ - fun list(params: ExportListParams = ExportListParams.none()): ExportListResponse = + fun list(params: ExportListParams = ExportListParams.none()): ExportListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): ExportListResponse = + fun list(requestOptions: RequestOptions): ExportListPage = list(ExportListParams.none(), requestOptions) /** A view of [ExportService] that provides access to raw HTTP responses for each method. */ @@ -152,25 +152,24 @@ interface ExportService { * Returns a raw HTTP response for `get /exports`, but is otherwise the same as * [ExportService.list]. */ - @MustBeClosed - fun list(): HttpResponseFor = list(ExportListParams.none()) + @MustBeClosed fun list(): HttpResponseFor = list(ExportListParams.none()) /** @see list */ @MustBeClosed fun list( params: ExportListParams = ExportListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: ExportListParams = ExportListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(ExportListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExportServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExportServiceImpl.kt index 7c1cae2e3..0b86ca87b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExportServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExportServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.exports.Export import com.increase.api.models.exports.ExportCreateParams +import com.increase.api.models.exports.ExportListPage +import com.increase.api.models.exports.ExportListPageResponse import com.increase.api.models.exports.ExportListParams -import com.increase.api.models.exports.ExportListResponse import com.increase.api.models.exports.ExportRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -44,10 +45,7 @@ class ExportServiceImpl internal constructor(private val clientOptions: ClientOp // get /exports/{export_id} withRawResponse().retrieve(params, requestOptions).parse() - override fun list( - params: ExportListParams, - requestOptions: RequestOptions, - ): ExportListResponse = + override fun list(params: ExportListParams, requestOptions: RequestOptions): ExportListPage = // get /exports withRawResponse().list(params, requestOptions).parse() @@ -120,13 +118,13 @@ class ExportServiceImpl internal constructor(private val clientOptions: ClientOp } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: ExportListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -144,6 +142,13 @@ class ExportServiceImpl internal constructor(private val clientOptions: ClientOp it.validate() } } + .let { + ExportListPage.builder() + .service(ExportServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExternalAccountService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExternalAccountService.kt index 8409d3593..a21bcfece 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExternalAccountService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExternalAccountService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.externalaccounts.ExternalAccount import com.increase.api.models.externalaccounts.ExternalAccountCreateParams +import com.increase.api.models.externalaccounts.ExternalAccountListPage import com.increase.api.models.externalaccounts.ExternalAccountListParams -import com.increase.api.models.externalaccounts.ExternalAccountListResponse import com.increase.api.models.externalaccounts.ExternalAccountRetrieveParams import com.increase.api.models.externalaccounts.ExternalAccountUpdateParams import java.util.function.Consumer @@ -103,21 +103,21 @@ interface ExternalAccountService { update(externalAccountId, ExternalAccountUpdateParams.none(), requestOptions) /** List External Accounts */ - fun list(): ExternalAccountListResponse = list(ExternalAccountListParams.none()) + fun list(): ExternalAccountListPage = list(ExternalAccountListParams.none()) /** @see list */ fun list( params: ExternalAccountListParams = ExternalAccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): ExternalAccountListResponse + ): ExternalAccountListPage /** @see list */ fun list( params: ExternalAccountListParams = ExternalAccountListParams.none() - ): ExternalAccountListResponse = list(params, RequestOptions.none()) + ): ExternalAccountListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): ExternalAccountListResponse = + fun list(requestOptions: RequestOptions): ExternalAccountListPage = list(ExternalAccountListParams.none(), requestOptions) /** @@ -248,7 +248,7 @@ interface ExternalAccountService { * [ExternalAccountService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(ExternalAccountListParams.none()) /** @see list */ @@ -256,17 +256,17 @@ interface ExternalAccountService { fun list( params: ExternalAccountListParams = ExternalAccountListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: ExternalAccountListParams = ExternalAccountListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(ExternalAccountListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExternalAccountServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExternalAccountServiceImpl.kt index 077e5d9b1..a5fb56fdf 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExternalAccountServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ExternalAccountServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.externalaccounts.ExternalAccount import com.increase.api.models.externalaccounts.ExternalAccountCreateParams +import com.increase.api.models.externalaccounts.ExternalAccountListPage +import com.increase.api.models.externalaccounts.ExternalAccountListPageResponse import com.increase.api.models.externalaccounts.ExternalAccountListParams -import com.increase.api.models.externalaccounts.ExternalAccountListResponse import com.increase.api.models.externalaccounts.ExternalAccountRetrieveParams import com.increase.api.models.externalaccounts.ExternalAccountUpdateParams import java.util.function.Consumer @@ -61,7 +62,7 @@ class ExternalAccountServiceImpl internal constructor(private val clientOptions: override fun list( params: ExternalAccountListParams, requestOptions: RequestOptions, - ): ExternalAccountListResponse = + ): ExternalAccountListPage = // get /external_accounts withRawResponse().list(params, requestOptions).parse() @@ -167,13 +168,13 @@ class ExternalAccountServiceImpl internal constructor(private val clientOptions: } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: ExternalAccountListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -191,6 +192,13 @@ class ExternalAccountServiceImpl internal constructor(private val clientOptions: it.validate() } } + .let { + ExternalAccountListPage.builder() + .service(ExternalAccountServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt index e14471cca..f0447c0dd 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt @@ -10,8 +10,8 @@ import com.increase.api.models.fednowtransfers.FednowTransfer import com.increase.api.models.fednowtransfers.FednowTransferApproveParams import com.increase.api.models.fednowtransfers.FednowTransferCancelParams import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPage import com.increase.api.models.fednowtransfers.FednowTransferListParams -import com.increase.api.models.fednowtransfers.FednowTransferListResponse import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams import java.util.function.Consumer @@ -72,21 +72,21 @@ interface FednowTransferService { retrieve(fednowTransferId, FednowTransferRetrieveParams.none(), requestOptions) /** List FedNow Transfers */ - fun list(): FednowTransferListResponse = list(FednowTransferListParams.none()) + fun list(): FednowTransferListPage = list(FednowTransferListParams.none()) /** @see list */ fun list( params: FednowTransferListParams = FednowTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): FednowTransferListResponse + ): FednowTransferListPage /** @see list */ fun list( params: FednowTransferListParams = FednowTransferListParams.none() - ): FednowTransferListResponse = list(params, RequestOptions.none()) + ): FednowTransferListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): FednowTransferListResponse = + fun list(requestOptions: RequestOptions): FednowTransferListPage = list(FednowTransferListParams.none(), requestOptions) /** Approve a FedNow Transfer */ @@ -232,25 +232,24 @@ interface FednowTransferService { * [FednowTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = - list(FednowTransferListParams.none()) + fun list(): HttpResponseFor = list(FednowTransferListParams.none()) /** @see list */ @MustBeClosed fun list( params: FednowTransferListParams = FednowTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: FednowTransferListParams = FednowTransferListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(FednowTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt index abf97b021..4f4632985 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.fednowtransfers.FednowTransfer import com.increase.api.models.fednowtransfers.FednowTransferApproveParams import com.increase.api.models.fednowtransfers.FednowTransferCancelParams import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPage +import com.increase.api.models.fednowtransfers.FednowTransferListPageResponse import com.increase.api.models.fednowtransfers.FednowTransferListParams -import com.increase.api.models.fednowtransfers.FednowTransferListResponse import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -55,7 +56,7 @@ class FednowTransferServiceImpl internal constructor(private val clientOptions: override fun list( params: FednowTransferListParams, requestOptions: RequestOptions, - ): FednowTransferListResponse = + ): FednowTransferListPage = // get /fednow_transfers withRawResponse().list(params, requestOptions).parse() @@ -144,13 +145,13 @@ class FednowTransferServiceImpl internal constructor(private val clientOptions: } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: FednowTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -168,6 +169,13 @@ class FednowTransferServiceImpl internal constructor(private val clientOptions: it.validate() } } + .let { + FednowTransferListPage.builder() + .service(FednowTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FileService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FileService.kt index 8937bcf0d..c061c7d88 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FileService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FileService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.files.File import com.increase.api.models.files.FileCreateParams +import com.increase.api.models.files.FileListPage import com.increase.api.models.files.FileListParams -import com.increase.api.models.files.FileListResponse import com.increase.api.models.files.FileRetrieveParams import java.util.function.Consumer @@ -68,20 +68,20 @@ interface FileService { retrieve(fileId, FileRetrieveParams.none(), requestOptions) /** List Files */ - fun list(): FileListResponse = list(FileListParams.none()) + fun list(): FileListPage = list(FileListParams.none()) /** @see list */ fun list( params: FileListParams = FileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): FileListResponse + ): FileListPage /** @see list */ - fun list(params: FileListParams = FileListParams.none()): FileListResponse = + fun list(params: FileListParams = FileListParams.none()): FileListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): FileListResponse = + fun list(requestOptions: RequestOptions): FileListPage = list(FileListParams.none(), requestOptions) /** A view of [FileService] that provides access to raw HTTP responses for each method. */ @@ -154,24 +154,23 @@ interface FileService { * Returns a raw HTTP response for `get /files`, but is otherwise the same as * [FileService.list]. */ - @MustBeClosed fun list(): HttpResponseFor = list(FileListParams.none()) + @MustBeClosed fun list(): HttpResponseFor = list(FileListParams.none()) /** @see list */ @MustBeClosed fun list( params: FileListParams = FileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed - fun list( - params: FileListParams = FileListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + fun list(params: FileListParams = FileListParams.none()): HttpResponseFor = + list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(FileListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FileServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FileServiceImpl.kt index cfd74f865..00361dd38 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FileServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FileServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.files.File import com.increase.api.models.files.FileCreateParams +import com.increase.api.models.files.FileListPage +import com.increase.api.models.files.FileListPageResponse import com.increase.api.models.files.FileListParams -import com.increase.api.models.files.FileListResponse import com.increase.api.models.files.FileRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -43,7 +44,7 @@ class FileServiceImpl internal constructor(private val clientOptions: ClientOpti // get /files/{file_id} withRawResponse().retrieve(params, requestOptions).parse() - override fun list(params: FileListParams, requestOptions: RequestOptions): FileListResponse = + override fun list(params: FileListParams, requestOptions: RequestOptions): FileListPage = // get /files withRawResponse().list(params, requestOptions).parse() @@ -116,13 +117,13 @@ class FileServiceImpl internal constructor(private val clientOptions: ClientOpti } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: FileListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -140,6 +141,13 @@ class FileServiceImpl internal constructor(private val clientOptions: ClientOpti it.validate() } } + .let { + FileListPage.builder() + .service(FileServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundAchTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundAchTransferService.kt index b623b2490..1d43a6187 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundAchTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundAchTransferService.kt @@ -9,8 +9,8 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundachtransfers.InboundAchTransfer import com.increase.api.models.inboundachtransfers.InboundAchTransferCreateNotificationOfChangeParams import com.increase.api.models.inboundachtransfers.InboundAchTransferDeclineParams +import com.increase.api.models.inboundachtransfers.InboundAchTransferListPage import com.increase.api.models.inboundachtransfers.InboundAchTransferListParams -import com.increase.api.models.inboundachtransfers.InboundAchTransferListResponse import com.increase.api.models.inboundachtransfers.InboundAchTransferRetrieveParams import com.increase.api.models.inboundachtransfers.InboundAchTransferTransferReturnParams import java.util.function.Consumer @@ -65,21 +65,21 @@ interface InboundAchTransferService { retrieve(inboundAchTransferId, InboundAchTransferRetrieveParams.none(), requestOptions) /** List Inbound ACH Transfers */ - fun list(): InboundAchTransferListResponse = list(InboundAchTransferListParams.none()) + fun list(): InboundAchTransferListPage = list(InboundAchTransferListParams.none()) /** @see list */ fun list( params: InboundAchTransferListParams = InboundAchTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): InboundAchTransferListResponse + ): InboundAchTransferListPage /** @see list */ fun list( params: InboundAchTransferListParams = InboundAchTransferListParams.none() - ): InboundAchTransferListResponse = list(params, RequestOptions.none()) + ): InboundAchTransferListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): InboundAchTransferListResponse = + fun list(requestOptions: RequestOptions): InboundAchTransferListPage = list(InboundAchTransferListParams.none(), requestOptions) /** Create a notification of change for an Inbound ACH Transfer */ @@ -262,7 +262,7 @@ interface InboundAchTransferService { * as [InboundAchTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(InboundAchTransferListParams.none()) /** @see list */ @@ -270,17 +270,17 @@ interface InboundAchTransferService { fun list( params: InboundAchTransferListParams = InboundAchTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: InboundAchTransferListParams = InboundAchTransferListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(InboundAchTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundAchTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundAchTransferServiceImpl.kt index df9a330f5..d4ecf5c59 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundAchTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundAchTransferServiceImpl.kt @@ -19,8 +19,9 @@ import com.increase.api.core.prepare import com.increase.api.models.inboundachtransfers.InboundAchTransfer import com.increase.api.models.inboundachtransfers.InboundAchTransferCreateNotificationOfChangeParams import com.increase.api.models.inboundachtransfers.InboundAchTransferDeclineParams +import com.increase.api.models.inboundachtransfers.InboundAchTransferListPage +import com.increase.api.models.inboundachtransfers.InboundAchTransferListPageResponse import com.increase.api.models.inboundachtransfers.InboundAchTransferListParams -import com.increase.api.models.inboundachtransfers.InboundAchTransferListResponse import com.increase.api.models.inboundachtransfers.InboundAchTransferRetrieveParams import com.increase.api.models.inboundachtransfers.InboundAchTransferTransferReturnParams import java.util.function.Consumer @@ -48,7 +49,7 @@ class InboundAchTransferServiceImpl internal constructor(private val clientOptio override fun list( params: InboundAchTransferListParams, requestOptions: RequestOptions, - ): InboundAchTransferListResponse = + ): InboundAchTransferListPage = // get /inbound_ach_transfers withRawResponse().list(params, requestOptions).parse() @@ -116,13 +117,13 @@ class InboundAchTransferServiceImpl internal constructor(private val clientOptio } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundAchTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -140,6 +141,13 @@ class InboundAchTransferServiceImpl internal constructor(private val clientOptio it.validate() } } + .let { + InboundAchTransferListPage.builder() + .service(InboundAchTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundCheckDepositService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundCheckDepositService.kt index 9ffe6b015..e66602102 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundCheckDepositService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundCheckDepositService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundcheckdeposits.InboundCheckDeposit import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositDeclineParams +import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListPage import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListParams -import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListResponse import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositRetrieveParams import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositReturnParams import java.util.function.Consumer @@ -67,21 +67,21 @@ interface InboundCheckDepositService { retrieve(inboundCheckDepositId, InboundCheckDepositRetrieveParams.none(), requestOptions) /** List Inbound Check Deposits */ - fun list(): InboundCheckDepositListResponse = list(InboundCheckDepositListParams.none()) + fun list(): InboundCheckDepositListPage = list(InboundCheckDepositListParams.none()) /** @see list */ fun list( params: InboundCheckDepositListParams = InboundCheckDepositListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): InboundCheckDepositListResponse + ): InboundCheckDepositListPage /** @see list */ fun list( params: InboundCheckDepositListParams = InboundCheckDepositListParams.none() - ): InboundCheckDepositListResponse = list(params, RequestOptions.none()) + ): InboundCheckDepositListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): InboundCheckDepositListResponse = + fun list(requestOptions: RequestOptions): InboundCheckDepositListPage = list(InboundCheckDepositListParams.none(), requestOptions) /** Decline an Inbound Check Deposit */ @@ -222,7 +222,7 @@ interface InboundCheckDepositService { * as [InboundCheckDepositService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(InboundCheckDepositListParams.none()) /** @see list */ @@ -230,17 +230,17 @@ interface InboundCheckDepositService { fun list( params: InboundCheckDepositListParams = InboundCheckDepositListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: InboundCheckDepositListParams = InboundCheckDepositListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(InboundCheckDepositListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundCheckDepositServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundCheckDepositServiceImpl.kt index d90b1019a..34a959466 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundCheckDepositServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundCheckDepositServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.inboundcheckdeposits.InboundCheckDeposit import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositDeclineParams +import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListPage +import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListPageResponse import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListParams -import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListResponse import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositRetrieveParams import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositReturnParams import java.util.function.Consumer @@ -49,7 +50,7 @@ internal constructor(private val clientOptions: ClientOptions) : InboundCheckDep override fun list( params: InboundCheckDepositListParams, requestOptions: RequestOptions, - ): InboundCheckDepositListResponse = + ): InboundCheckDepositListPage = // get /inbound_check_deposits withRawResponse().list(params, requestOptions).parse() @@ -110,13 +111,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundCheckDep } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundCheckDepositListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -134,6 +135,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundCheckDep it.validate() } } + .let { + InboundCheckDepositListPage.builder() + .service(InboundCheckDepositServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt index 9d6e45d43..c62b7542f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPage import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams -import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListResponse import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams import java.util.function.Consumer @@ -69,21 +69,21 @@ interface InboundFednowTransferService { ) /** List Inbound FedNow Transfers */ - fun list(): InboundFednowTransferListResponse = list(InboundFednowTransferListParams.none()) + fun list(): InboundFednowTransferListPage = list(InboundFednowTransferListParams.none()) /** @see list */ fun list( params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): InboundFednowTransferListResponse + ): InboundFednowTransferListPage /** @see list */ fun list( params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() - ): InboundFednowTransferListResponse = list(params, RequestOptions.none()) + ): InboundFednowTransferListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): InboundFednowTransferListResponse = + fun list(requestOptions: RequestOptions): InboundFednowTransferListPage = list(InboundFednowTransferListParams.none(), requestOptions) /** @@ -161,7 +161,7 @@ interface InboundFednowTransferService { * same as [InboundFednowTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(InboundFednowTransferListParams.none()) /** @see list */ @@ -169,19 +169,17 @@ interface InboundFednowTransferService { fun list( params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list( - requestOptions: RequestOptions - ): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(InboundFednowTransferListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt index f8ce767c1..6df0ed717 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPage +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageResponse import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams -import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListResponse import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -46,7 +47,7 @@ internal constructor(private val clientOptions: ClientOptions) : InboundFednowTr override fun list( params: InboundFednowTransferListParams, requestOptions: RequestOptions, - ): InboundFednowTransferListResponse = + ): InboundFednowTransferListPage = // get /inbound_fednow_transfers withRawResponse().list(params, requestOptions).parse() @@ -93,13 +94,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundFednowTr } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundFednowTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -117,6 +118,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundFednowTr it.validate() } } + .let { + InboundFednowTransferListPage.builder() + .service(InboundFednowTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemService.kt index 38571053b..82e377d95 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundmailitems.InboundMailItem import com.increase.api.models.inboundmailitems.InboundMailItemActionParams +import com.increase.api.models.inboundmailitems.InboundMailItemListPage import com.increase.api.models.inboundmailitems.InboundMailItemListParams -import com.increase.api.models.inboundmailitems.InboundMailItemListResponse import com.increase.api.models.inboundmailitems.InboundMailItemRetrieveParams import java.util.function.Consumer @@ -60,21 +60,21 @@ interface InboundMailItemService { retrieve(inboundMailItemId, InboundMailItemRetrieveParams.none(), requestOptions) /** List Inbound Mail Items */ - fun list(): InboundMailItemListResponse = list(InboundMailItemListParams.none()) + fun list(): InboundMailItemListPage = list(InboundMailItemListParams.none()) /** @see list */ fun list( params: InboundMailItemListParams = InboundMailItemListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): InboundMailItemListResponse + ): InboundMailItemListPage /** @see list */ fun list( params: InboundMailItemListParams = InboundMailItemListParams.none() - ): InboundMailItemListResponse = list(params, RequestOptions.none()) + ): InboundMailItemListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): InboundMailItemListResponse = + fun list(requestOptions: RequestOptions): InboundMailItemListPage = list(InboundMailItemListParams.none(), requestOptions) /** Action a Inbound Mail Item */ @@ -167,7 +167,7 @@ interface InboundMailItemService { * [InboundMailItemService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(InboundMailItemListParams.none()) /** @see list */ @@ -175,17 +175,17 @@ interface InboundMailItemService { fun list( params: InboundMailItemListParams = InboundMailItemListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: InboundMailItemListParams = InboundMailItemListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(InboundMailItemListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemServiceImpl.kt index e57598ff9..31805785e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundMailItemServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.inboundmailitems.InboundMailItem import com.increase.api.models.inboundmailitems.InboundMailItemActionParams +import com.increase.api.models.inboundmailitems.InboundMailItemListPage +import com.increase.api.models.inboundmailitems.InboundMailItemListPageResponse import com.increase.api.models.inboundmailitems.InboundMailItemListParams -import com.increase.api.models.inboundmailitems.InboundMailItemListResponse import com.increase.api.models.inboundmailitems.InboundMailItemRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -46,7 +47,7 @@ class InboundMailItemServiceImpl internal constructor(private val clientOptions: override fun list( params: InboundMailItemListParams, requestOptions: RequestOptions, - ): InboundMailItemListResponse = + ): InboundMailItemListPage = // get /inbound_mail_items withRawResponse().list(params, requestOptions).parse() @@ -100,13 +101,13 @@ class InboundMailItemServiceImpl internal constructor(private val clientOptions: } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundMailItemListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -124,6 +125,13 @@ class InboundMailItemServiceImpl internal constructor(private val clientOptions: it.validate() } } + .let { + InboundMailItemListPage.builder() + .service(InboundMailItemServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferService.kt index 85e2b391c..a3bbf8f71 100755 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransfer +import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListPage import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListParams -import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListResponse import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferRetrieveParams import java.util.function.Consumer @@ -81,7 +81,7 @@ interface InboundRealTimePaymentsTransferService { ) /** List Inbound Real-Time Payments Transfers */ - fun list(): InboundRealTimePaymentsTransferListResponse = + fun list(): InboundRealTimePaymentsTransferListPage = list(InboundRealTimePaymentsTransferListParams.none()) /** @see list */ @@ -89,16 +89,16 @@ interface InboundRealTimePaymentsTransferService { params: InboundRealTimePaymentsTransferListParams = InboundRealTimePaymentsTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): InboundRealTimePaymentsTransferListResponse + ): InboundRealTimePaymentsTransferListPage /** @see list */ fun list( params: InboundRealTimePaymentsTransferListParams = InboundRealTimePaymentsTransferListParams.none() - ): InboundRealTimePaymentsTransferListResponse = list(params, RequestOptions.none()) + ): InboundRealTimePaymentsTransferListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): InboundRealTimePaymentsTransferListResponse = + fun list(requestOptions: RequestOptions): InboundRealTimePaymentsTransferListPage = list(InboundRealTimePaymentsTransferListParams.none(), requestOptions) /** @@ -186,7 +186,7 @@ interface InboundRealTimePaymentsTransferService { * otherwise the same as [InboundRealTimePaymentsTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(InboundRealTimePaymentsTransferListParams.none()) /** @see list */ @@ -195,21 +195,21 @@ interface InboundRealTimePaymentsTransferService { params: InboundRealTimePaymentsTransferListParams = InboundRealTimePaymentsTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: InboundRealTimePaymentsTransferListParams = InboundRealTimePaymentsTransferListParams.none() - ): HttpResponseFor = + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed fun list( requestOptions: RequestOptions - ): HttpResponseFor = + ): HttpResponseFor = list(InboundRealTimePaymentsTransferListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferServiceImpl.kt index 6ecb20410..1bac9db55 100755 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransfer +import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListPage +import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListPageResponse import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListParams -import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListResponse import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -50,7 +51,7 @@ internal constructor(private val clientOptions: ClientOptions) : override fun list( params: InboundRealTimePaymentsTransferListParams, requestOptions: RequestOptions, - ): InboundRealTimePaymentsTransferListResponse = + ): InboundRealTimePaymentsTransferListPage = // get /inbound_real_time_payments_transfers withRawResponse().list(params, requestOptions).parse() @@ -100,13 +101,13 @@ internal constructor(private val clientOptions: ClientOptions) : } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundRealTimePaymentsTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -124,6 +125,13 @@ internal constructor(private val clientOptions: ClientOptions) : it.validate() } } + .let { + InboundRealTimePaymentsTransferListPage.builder() + .service(InboundRealTimePaymentsTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestService.kt index 2b8e105bc..a7ba2f3fc 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequest +import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListPage import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListParams -import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListResponse import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestRetrieveParams import java.util.function.Consumer @@ -72,22 +72,22 @@ interface InboundWireDrawdownRequestService { ) /** List Inbound Wire Drawdown Requests */ - fun list(): InboundWireDrawdownRequestListResponse = + fun list(): InboundWireDrawdownRequestListPage = list(InboundWireDrawdownRequestListParams.none()) /** @see list */ fun list( params: InboundWireDrawdownRequestListParams = InboundWireDrawdownRequestListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): InboundWireDrawdownRequestListResponse + ): InboundWireDrawdownRequestListPage /** @see list */ fun list( params: InboundWireDrawdownRequestListParams = InboundWireDrawdownRequestListParams.none() - ): InboundWireDrawdownRequestListResponse = list(params, RequestOptions.none()) + ): InboundWireDrawdownRequestListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): InboundWireDrawdownRequestListResponse = + fun list(requestOptions: RequestOptions): InboundWireDrawdownRequestListPage = list(InboundWireDrawdownRequestListParams.none(), requestOptions) /** @@ -171,7 +171,7 @@ interface InboundWireDrawdownRequestService { * the same as [InboundWireDrawdownRequestService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(InboundWireDrawdownRequestListParams.none()) /** @see list */ @@ -180,21 +180,20 @@ interface InboundWireDrawdownRequestService { params: InboundWireDrawdownRequestListParams = InboundWireDrawdownRequestListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: InboundWireDrawdownRequestListParams = InboundWireDrawdownRequestListParams.none() - ): HttpResponseFor = - list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed fun list( requestOptions: RequestOptions - ): HttpResponseFor = + ): HttpResponseFor = list(InboundWireDrawdownRequestListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestServiceImpl.kt index 028e509e2..b41c6b587 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequest +import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListPage +import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListPageResponse import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListParams -import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListResponse import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -49,7 +50,7 @@ internal constructor(private val clientOptions: ClientOptions) : InboundWireDraw override fun list( params: InboundWireDrawdownRequestListParams, requestOptions: RequestOptions, - ): InboundWireDrawdownRequestListResponse = + ): InboundWireDrawdownRequestListPage = // get /inbound_wire_drawdown_requests withRawResponse().list(params, requestOptions).parse() @@ -99,13 +100,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundWireDraw } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundWireDrawdownRequestListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -123,6 +124,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundWireDraw it.validate() } } + .let { + InboundWireDrawdownRequestListPage.builder() + .service(InboundWireDrawdownRequestServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireTransferService.kt index 2dafb48d1..84cb2ccb2 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireTransferService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.inboundwiretransfers.InboundWireTransfer +import com.increase.api.models.inboundwiretransfers.InboundWireTransferListPage import com.increase.api.models.inboundwiretransfers.InboundWireTransferListParams -import com.increase.api.models.inboundwiretransfers.InboundWireTransferListResponse import com.increase.api.models.inboundwiretransfers.InboundWireTransferRetrieveParams import com.increase.api.models.inboundwiretransfers.InboundWireTransferReverseParams import java.util.function.Consumer @@ -66,21 +66,21 @@ interface InboundWireTransferService { retrieve(inboundWireTransferId, InboundWireTransferRetrieveParams.none(), requestOptions) /** List Inbound Wire Transfers */ - fun list(): InboundWireTransferListResponse = list(InboundWireTransferListParams.none()) + fun list(): InboundWireTransferListPage = list(InboundWireTransferListParams.none()) /** @see list */ fun list( params: InboundWireTransferListParams = InboundWireTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): InboundWireTransferListResponse + ): InboundWireTransferListPage /** @see list */ fun list( params: InboundWireTransferListParams = InboundWireTransferListParams.none() - ): InboundWireTransferListResponse = list(params, RequestOptions.none()) + ): InboundWireTransferListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): InboundWireTransferListResponse = + fun list(requestOptions: RequestOptions): InboundWireTransferListPage = list(InboundWireTransferListParams.none(), requestOptions) /** Reverse an Inbound Wire Transfer */ @@ -183,7 +183,7 @@ interface InboundWireTransferService { * as [InboundWireTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(InboundWireTransferListParams.none()) /** @see list */ @@ -191,17 +191,17 @@ interface InboundWireTransferService { fun list( params: InboundWireTransferListParams = InboundWireTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: InboundWireTransferListParams = InboundWireTransferListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(InboundWireTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireTransferServiceImpl.kt index 689a4dccd..8a1290124 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundWireTransferServiceImpl.kt @@ -17,8 +17,9 @@ import com.increase.api.core.http.json import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.inboundwiretransfers.InboundWireTransfer +import com.increase.api.models.inboundwiretransfers.InboundWireTransferListPage +import com.increase.api.models.inboundwiretransfers.InboundWireTransferListPageResponse import com.increase.api.models.inboundwiretransfers.InboundWireTransferListParams -import com.increase.api.models.inboundwiretransfers.InboundWireTransferListResponse import com.increase.api.models.inboundwiretransfers.InboundWireTransferRetrieveParams import com.increase.api.models.inboundwiretransfers.InboundWireTransferReverseParams import java.util.function.Consumer @@ -48,7 +49,7 @@ internal constructor(private val clientOptions: ClientOptions) : InboundWireTran override fun list( params: InboundWireTransferListParams, requestOptions: RequestOptions, - ): InboundWireTransferListResponse = + ): InboundWireTransferListPage = // get /inbound_wire_transfers withRawResponse().list(params, requestOptions).parse() @@ -102,13 +103,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundWireTran } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: InboundWireTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -126,6 +127,13 @@ internal constructor(private val clientOptions: ClientOptions) : InboundWireTran it.validate() } } + .let { + InboundWireTransferListPage.builder() + .service(InboundWireTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentService.kt index 2e8a32b5d..707101542 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollment import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentCreateParams +import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListPage import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListParams -import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListResponse import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentRetrieveParams import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentUnenrollParams import java.util.function.Consumer @@ -84,22 +84,21 @@ interface IntrafiAccountEnrollmentService { ) /** List IntraFi Account Enrollments */ - fun list(): IntrafiAccountEnrollmentListResponse = - list(IntrafiAccountEnrollmentListParams.none()) + fun list(): IntrafiAccountEnrollmentListPage = list(IntrafiAccountEnrollmentListParams.none()) /** @see list */ fun list( params: IntrafiAccountEnrollmentListParams = IntrafiAccountEnrollmentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): IntrafiAccountEnrollmentListResponse + ): IntrafiAccountEnrollmentListPage /** @see list */ fun list( params: IntrafiAccountEnrollmentListParams = IntrafiAccountEnrollmentListParams.none() - ): IntrafiAccountEnrollmentListResponse = list(params, RequestOptions.none()) + ): IntrafiAccountEnrollmentListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): IntrafiAccountEnrollmentListResponse = + fun list(requestOptions: RequestOptions): IntrafiAccountEnrollmentListPage = list(IntrafiAccountEnrollmentListParams.none(), requestOptions) /** Unenroll an account from IntraFi */ @@ -241,7 +240,7 @@ interface IntrafiAccountEnrollmentService { * same as [IntrafiAccountEnrollmentService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(IntrafiAccountEnrollmentListParams.none()) /** @see list */ @@ -249,20 +248,19 @@ interface IntrafiAccountEnrollmentService { fun list( params: IntrafiAccountEnrollmentListParams = IntrafiAccountEnrollmentListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: IntrafiAccountEnrollmentListParams = IntrafiAccountEnrollmentListParams.none() - ): HttpResponseFor = - list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed fun list( requestOptions: RequestOptions - ): HttpResponseFor = + ): HttpResponseFor = list(IntrafiAccountEnrollmentListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentServiceImpl.kt index 183d58caa..a0a00c40e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollment import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentCreateParams +import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListPage +import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListPageResponse import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListParams -import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListResponse import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentRetrieveParams import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentUnenrollParams import java.util.function.Consumer @@ -59,7 +60,7 @@ internal constructor(private val clientOptions: ClientOptions) : IntrafiAccountE override fun list( params: IntrafiAccountEnrollmentListParams, requestOptions: RequestOptions, - ): IntrafiAccountEnrollmentListResponse = + ): IntrafiAccountEnrollmentListPage = // get /intrafi_account_enrollments withRawResponse().list(params, requestOptions).parse() @@ -144,13 +145,13 @@ internal constructor(private val clientOptions: ClientOptions) : IntrafiAccountE } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: IntrafiAccountEnrollmentListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -168,6 +169,13 @@ internal constructor(private val clientOptions: ClientOptions) : IntrafiAccountE it.validate() } } + .let { + IntrafiAccountEnrollmentListPage.builder() + .service(IntrafiAccountEnrollmentServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiExclusionService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiExclusionService.kt index c720e6054..96ac5a5a2 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiExclusionService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiExclusionService.kt @@ -9,8 +9,8 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.intrafiexclusions.IntrafiExclusion import com.increase.api.models.intrafiexclusions.IntrafiExclusionArchiveParams import com.increase.api.models.intrafiexclusions.IntrafiExclusionCreateParams +import com.increase.api.models.intrafiexclusions.IntrafiExclusionListPage import com.increase.api.models.intrafiexclusions.IntrafiExclusionListParams -import com.increase.api.models.intrafiexclusions.IntrafiExclusionListResponse import com.increase.api.models.intrafiexclusions.IntrafiExclusionRetrieveParams import java.util.function.Consumer @@ -71,21 +71,21 @@ interface IntrafiExclusionService { retrieve(intrafiExclusionId, IntrafiExclusionRetrieveParams.none(), requestOptions) /** List IntraFi Exclusions */ - fun list(): IntrafiExclusionListResponse = list(IntrafiExclusionListParams.none()) + fun list(): IntrafiExclusionListPage = list(IntrafiExclusionListParams.none()) /** @see list */ fun list( params: IntrafiExclusionListParams = IntrafiExclusionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): IntrafiExclusionListResponse + ): IntrafiExclusionListPage /** @see list */ fun list( params: IntrafiExclusionListParams = IntrafiExclusionListParams.none() - ): IntrafiExclusionListResponse = list(params, RequestOptions.none()) + ): IntrafiExclusionListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): IntrafiExclusionListResponse = + fun list(requestOptions: RequestOptions): IntrafiExclusionListPage = list(IntrafiExclusionListParams.none(), requestOptions) /** Archive an IntraFi Exclusion */ @@ -203,7 +203,7 @@ interface IntrafiExclusionService { * [IntrafiExclusionService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(IntrafiExclusionListParams.none()) /** @see list */ @@ -211,17 +211,17 @@ interface IntrafiExclusionService { fun list( params: IntrafiExclusionListParams = IntrafiExclusionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: IntrafiExclusionListParams = IntrafiExclusionListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(IntrafiExclusionListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiExclusionServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiExclusionServiceImpl.kt index bd1b66aad..0baa10a1d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiExclusionServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/IntrafiExclusionServiceImpl.kt @@ -19,8 +19,9 @@ import com.increase.api.core.prepare import com.increase.api.models.intrafiexclusions.IntrafiExclusion import com.increase.api.models.intrafiexclusions.IntrafiExclusionArchiveParams import com.increase.api.models.intrafiexclusions.IntrafiExclusionCreateParams +import com.increase.api.models.intrafiexclusions.IntrafiExclusionListPage +import com.increase.api.models.intrafiexclusions.IntrafiExclusionListPageResponse import com.increase.api.models.intrafiexclusions.IntrafiExclusionListParams -import com.increase.api.models.intrafiexclusions.IntrafiExclusionListResponse import com.increase.api.models.intrafiexclusions.IntrafiExclusionRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -54,7 +55,7 @@ class IntrafiExclusionServiceImpl internal constructor(private val clientOptions override fun list( params: IntrafiExclusionListParams, requestOptions: RequestOptions, - ): IntrafiExclusionListResponse = + ): IntrafiExclusionListPage = // get /intrafi_exclusions withRawResponse().list(params, requestOptions).parse() @@ -136,13 +137,13 @@ class IntrafiExclusionServiceImpl internal constructor(private val clientOptions } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: IntrafiExclusionListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -160,6 +161,13 @@ class IntrafiExclusionServiceImpl internal constructor(private val clientOptions it.validate() } } + .let { + IntrafiExclusionListPage.builder() + .service(IntrafiExclusionServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxService.kt index f0815359a..cde1eb2c6 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.lockboxes.Lockbox import com.increase.api.models.lockboxes.LockboxCreateParams +import com.increase.api.models.lockboxes.LockboxListPage import com.increase.api.models.lockboxes.LockboxListParams -import com.increase.api.models.lockboxes.LockboxListResponse import com.increase.api.models.lockboxes.LockboxRetrieveParams import com.increase.api.models.lockboxes.LockboxUpdateParams import java.util.function.Consumer @@ -96,20 +96,20 @@ interface LockboxService { update(lockboxId, LockboxUpdateParams.none(), requestOptions) /** List Lockboxes */ - fun list(): LockboxListResponse = list(LockboxListParams.none()) + fun list(): LockboxListPage = list(LockboxListParams.none()) /** @see list */ fun list( params: LockboxListParams = LockboxListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): LockboxListResponse + ): LockboxListPage /** @see list */ - fun list(params: LockboxListParams = LockboxListParams.none()): LockboxListResponse = + fun list(params: LockboxListParams = LockboxListParams.none()): LockboxListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): LockboxListResponse = + fun list(requestOptions: RequestOptions): LockboxListPage = list(LockboxListParams.none(), requestOptions) /** A view of [LockboxService] that provides access to raw HTTP responses for each method. */ @@ -223,25 +223,24 @@ interface LockboxService { * Returns a raw HTTP response for `get /lockboxes`, but is otherwise the same as * [LockboxService.list]. */ - @MustBeClosed - fun list(): HttpResponseFor = list(LockboxListParams.none()) + @MustBeClosed fun list(): HttpResponseFor = list(LockboxListParams.none()) /** @see list */ @MustBeClosed fun list( params: LockboxListParams = LockboxListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: LockboxListParams = LockboxListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(LockboxListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxServiceImpl.kt index 4f8f7dd21..5bf790592 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/LockboxServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.lockboxes.Lockbox import com.increase.api.models.lockboxes.LockboxCreateParams +import com.increase.api.models.lockboxes.LockboxListPage +import com.increase.api.models.lockboxes.LockboxListPageResponse import com.increase.api.models.lockboxes.LockboxListParams -import com.increase.api.models.lockboxes.LockboxListResponse import com.increase.api.models.lockboxes.LockboxRetrieveParams import com.increase.api.models.lockboxes.LockboxUpdateParams import java.util.function.Consumer @@ -49,10 +50,7 @@ class LockboxServiceImpl internal constructor(private val clientOptions: ClientO // patch /lockboxes/{lockbox_id} withRawResponse().update(params, requestOptions).parse() - override fun list( - params: LockboxListParams, - requestOptions: RequestOptions, - ): LockboxListResponse = + override fun list(params: LockboxListParams, requestOptions: RequestOptions): LockboxListPage = // get /lockboxes withRawResponse().list(params, requestOptions).parse() @@ -156,13 +154,13 @@ class LockboxServiceImpl internal constructor(private val clientOptions: ClientO } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: LockboxListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -180,6 +178,13 @@ class LockboxServiceImpl internal constructor(private val clientOptions: ClientO it.validate() } } + .let { + LockboxListPage.builder() + .service(LockboxServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthApplicationService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthApplicationService.kt index 987298694..f351dc462 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthApplicationService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthApplicationService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.oauthapplications.OAuthApplication +import com.increase.api.models.oauthapplications.OAuthApplicationListPage import com.increase.api.models.oauthapplications.OAuthApplicationListParams -import com.increase.api.models.oauthapplications.OAuthApplicationListResponse import com.increase.api.models.oauthapplications.OAuthApplicationRetrieveParams import java.util.function.Consumer @@ -59,21 +59,21 @@ interface OAuthApplicationService { retrieve(oauthApplicationId, OAuthApplicationRetrieveParams.none(), requestOptions) /** List OAuth Applications */ - fun list(): OAuthApplicationListResponse = list(OAuthApplicationListParams.none()) + fun list(): OAuthApplicationListPage = list(OAuthApplicationListParams.none()) /** @see list */ fun list( params: OAuthApplicationListParams = OAuthApplicationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): OAuthApplicationListResponse + ): OAuthApplicationListPage /** @see list */ fun list( params: OAuthApplicationListParams = OAuthApplicationListParams.none() - ): OAuthApplicationListResponse = list(params, RequestOptions.none()) + ): OAuthApplicationListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): OAuthApplicationListResponse = + fun list(requestOptions: RequestOptions): OAuthApplicationListPage = list(OAuthApplicationListParams.none(), requestOptions) /** @@ -144,7 +144,7 @@ interface OAuthApplicationService { * [OAuthApplicationService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(OAuthApplicationListParams.none()) /** @see list */ @@ -152,17 +152,17 @@ interface OAuthApplicationService { fun list( params: OAuthApplicationListParams = OAuthApplicationListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: OAuthApplicationListParams = OAuthApplicationListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(OAuthApplicationListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthApplicationServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthApplicationServiceImpl.kt index cc3a146f4..7a1bca392 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthApplicationServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthApplicationServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.oauthapplications.OAuthApplication +import com.increase.api.models.oauthapplications.OAuthApplicationListPage +import com.increase.api.models.oauthapplications.OAuthApplicationListPageResponse import com.increase.api.models.oauthapplications.OAuthApplicationListParams -import com.increase.api.models.oauthapplications.OAuthApplicationListResponse import com.increase.api.models.oauthapplications.OAuthApplicationRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -44,7 +45,7 @@ class OAuthApplicationServiceImpl internal constructor(private val clientOptions override fun list( params: OAuthApplicationListParams, requestOptions: RequestOptions, - ): OAuthApplicationListResponse = + ): OAuthApplicationListPage = // get /oauth_applications withRawResponse().list(params, requestOptions).parse() @@ -91,13 +92,13 @@ class OAuthApplicationServiceImpl internal constructor(private val clientOptions } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: OAuthApplicationListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -115,6 +116,13 @@ class OAuthApplicationServiceImpl internal constructor(private val clientOptions it.validate() } } + .let { + OAuthApplicationListPage.builder() + .service(OAuthApplicationServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthConnectionService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthConnectionService.kt index a5a761fc9..33213a98b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthConnectionService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthConnectionService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.oauthconnections.OAuthConnection +import com.increase.api.models.oauthconnections.OAuthConnectionListPage import com.increase.api.models.oauthconnections.OAuthConnectionListParams -import com.increase.api.models.oauthconnections.OAuthConnectionListResponse import com.increase.api.models.oauthconnections.OAuthConnectionRetrieveParams import java.util.function.Consumer @@ -59,21 +59,21 @@ interface OAuthConnectionService { retrieve(oauthConnectionId, OAuthConnectionRetrieveParams.none(), requestOptions) /** List OAuth Connections */ - fun list(): OAuthConnectionListResponse = list(OAuthConnectionListParams.none()) + fun list(): OAuthConnectionListPage = list(OAuthConnectionListParams.none()) /** @see list */ fun list( params: OAuthConnectionListParams = OAuthConnectionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): OAuthConnectionListResponse + ): OAuthConnectionListPage /** @see list */ fun list( params: OAuthConnectionListParams = OAuthConnectionListParams.none() - ): OAuthConnectionListResponse = list(params, RequestOptions.none()) + ): OAuthConnectionListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): OAuthConnectionListResponse = + fun list(requestOptions: RequestOptions): OAuthConnectionListPage = list(OAuthConnectionListParams.none(), requestOptions) /** @@ -144,7 +144,7 @@ interface OAuthConnectionService { * [OAuthConnectionService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(OAuthConnectionListParams.none()) /** @see list */ @@ -152,17 +152,17 @@ interface OAuthConnectionService { fun list( params: OAuthConnectionListParams = OAuthConnectionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: OAuthConnectionListParams = OAuthConnectionListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(OAuthConnectionListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthConnectionServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthConnectionServiceImpl.kt index 9f7690eaa..5d619edda 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthConnectionServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/OAuthConnectionServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.oauthconnections.OAuthConnection +import com.increase.api.models.oauthconnections.OAuthConnectionListPage +import com.increase.api.models.oauthconnections.OAuthConnectionListPageResponse import com.increase.api.models.oauthconnections.OAuthConnectionListParams -import com.increase.api.models.oauthconnections.OAuthConnectionListResponse import com.increase.api.models.oauthconnections.OAuthConnectionRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -44,7 +45,7 @@ class OAuthConnectionServiceImpl internal constructor(private val clientOptions: override fun list( params: OAuthConnectionListParams, requestOptions: RequestOptions, - ): OAuthConnectionListResponse = + ): OAuthConnectionListPage = // get /oauth_connections withRawResponse().list(params, requestOptions).parse() @@ -91,13 +92,13 @@ class OAuthConnectionServiceImpl internal constructor(private val clientOptions: } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: OAuthConnectionListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -115,6 +116,13 @@ class OAuthConnectionServiceImpl internal constructor(private val clientOptions: it.validate() } } + .let { + OAuthConnectionListPage.builder() + .service(OAuthConnectionServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PendingTransactionService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PendingTransactionService.kt index 4f49fe99d..ed95d6335 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PendingTransactionService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PendingTransactionService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.pendingtransactions.PendingTransaction import com.increase.api.models.pendingtransactions.PendingTransactionCreateParams +import com.increase.api.models.pendingtransactions.PendingTransactionListPage import com.increase.api.models.pendingtransactions.PendingTransactionListParams -import com.increase.api.models.pendingtransactions.PendingTransactionListResponse import com.increase.api.models.pendingtransactions.PendingTransactionReleaseParams import com.increase.api.models.pendingtransactions.PendingTransactionRetrieveParams import java.util.function.Consumer @@ -79,21 +79,21 @@ interface PendingTransactionService { retrieve(pendingTransactionId, PendingTransactionRetrieveParams.none(), requestOptions) /** List Pending Transactions */ - fun list(): PendingTransactionListResponse = list(PendingTransactionListParams.none()) + fun list(): PendingTransactionListPage = list(PendingTransactionListParams.none()) /** @see list */ fun list( params: PendingTransactionListParams = PendingTransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): PendingTransactionListResponse + ): PendingTransactionListPage /** @see list */ fun list( params: PendingTransactionListParams = PendingTransactionListParams.none() - ): PendingTransactionListResponse = list(params, RequestOptions.none()) + ): PendingTransactionListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): PendingTransactionListResponse = + fun list(requestOptions: RequestOptions): PendingTransactionListPage = list(PendingTransactionListParams.none(), requestOptions) /** @@ -219,7 +219,7 @@ interface PendingTransactionService { * [PendingTransactionService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(PendingTransactionListParams.none()) /** @see list */ @@ -227,17 +227,17 @@ interface PendingTransactionService { fun list( params: PendingTransactionListParams = PendingTransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: PendingTransactionListParams = PendingTransactionListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(PendingTransactionListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PendingTransactionServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PendingTransactionServiceImpl.kt index 1335feb61..cecbf4919 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PendingTransactionServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PendingTransactionServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.pendingtransactions.PendingTransaction import com.increase.api.models.pendingtransactions.PendingTransactionCreateParams +import com.increase.api.models.pendingtransactions.PendingTransactionListPage +import com.increase.api.models.pendingtransactions.PendingTransactionListPageResponse import com.increase.api.models.pendingtransactions.PendingTransactionListParams -import com.increase.api.models.pendingtransactions.PendingTransactionListResponse import com.increase.api.models.pendingtransactions.PendingTransactionReleaseParams import com.increase.api.models.pendingtransactions.PendingTransactionRetrieveParams import java.util.function.Consumer @@ -54,7 +55,7 @@ class PendingTransactionServiceImpl internal constructor(private val clientOptio override fun list( params: PendingTransactionListParams, requestOptions: RequestOptions, - ): PendingTransactionListResponse = + ): PendingTransactionListPage = // get /pending_transactions withRawResponse().list(params, requestOptions).parse() @@ -136,13 +137,13 @@ class PendingTransactionServiceImpl internal constructor(private val clientOptio } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: PendingTransactionListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -160,6 +161,13 @@ class PendingTransactionServiceImpl internal constructor(private val clientOptio it.validate() } } + .let { + PendingTransactionListPage.builder() + .service(PendingTransactionServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardProfileService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardProfileService.kt index c8470466a..ae886f3de 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardProfileService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardProfileService.kt @@ -10,8 +10,8 @@ import com.increase.api.models.physicalcardprofiles.PhysicalCardProfile import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileArchiveParams import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCloneParams import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCreateParams +import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListPage import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListParams -import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListResponse import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileRetrieveParams import java.util.function.Consumer @@ -78,21 +78,21 @@ interface PhysicalCardProfileService { retrieve(physicalCardProfileId, PhysicalCardProfileRetrieveParams.none(), requestOptions) /** List Physical Card Profiles */ - fun list(): PhysicalCardProfileListResponse = list(PhysicalCardProfileListParams.none()) + fun list(): PhysicalCardProfileListPage = list(PhysicalCardProfileListParams.none()) /** @see list */ fun list( params: PhysicalCardProfileListParams = PhysicalCardProfileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): PhysicalCardProfileListResponse + ): PhysicalCardProfileListPage /** @see list */ fun list( params: PhysicalCardProfileListParams = PhysicalCardProfileListParams.none() - ): PhysicalCardProfileListResponse = list(params, RequestOptions.none()) + ): PhysicalCardProfileListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): PhysicalCardProfileListResponse = + fun list(requestOptions: RequestOptions): PhysicalCardProfileListPage = list(PhysicalCardProfileListParams.none(), requestOptions) /** Archive a Physical Card Profile */ @@ -256,7 +256,7 @@ interface PhysicalCardProfileService { * as [PhysicalCardProfileService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(PhysicalCardProfileListParams.none()) /** @see list */ @@ -264,17 +264,17 @@ interface PhysicalCardProfileService { fun list( params: PhysicalCardProfileListParams = PhysicalCardProfileListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: PhysicalCardProfileListParams = PhysicalCardProfileListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(PhysicalCardProfileListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardProfileServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardProfileServiceImpl.kt index 68fb57be2..40e0ff72d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardProfileServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardProfileServiceImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.physicalcardprofiles.PhysicalCardProfile import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileArchiveParams import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCloneParams import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCreateParams +import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListPage +import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListPageResponse import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListParams -import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListResponse import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -57,7 +58,7 @@ internal constructor(private val clientOptions: ClientOptions) : PhysicalCardPro override fun list( params: PhysicalCardProfileListParams, requestOptions: RequestOptions, - ): PhysicalCardProfileListResponse = + ): PhysicalCardProfileListPage = // get /physical_card_profiles withRawResponse().list(params, requestOptions).parse() @@ -146,13 +147,13 @@ internal constructor(private val clientOptions: ClientOptions) : PhysicalCardPro } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: PhysicalCardProfileListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -170,6 +171,13 @@ internal constructor(private val clientOptions: ClientOptions) : PhysicalCardPro it.validate() } } + .let { + PhysicalCardProfileListPage.builder() + .service(PhysicalCardProfileServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardService.kt index b5451908d..29dceaa41 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.physicalcards.PhysicalCard import com.increase.api.models.physicalcards.PhysicalCardCreateParams +import com.increase.api.models.physicalcards.PhysicalCardListPage import com.increase.api.models.physicalcards.PhysicalCardListParams -import com.increase.api.models.physicalcards.PhysicalCardListResponse import com.increase.api.models.physicalcards.PhysicalCardRetrieveParams import com.increase.api.models.physicalcards.PhysicalCardUpdateParams import java.util.function.Consumer @@ -93,21 +93,20 @@ interface PhysicalCardService { ): PhysicalCard /** List Physical Cards */ - fun list(): PhysicalCardListResponse = list(PhysicalCardListParams.none()) + fun list(): PhysicalCardListPage = list(PhysicalCardListParams.none()) /** @see list */ fun list( params: PhysicalCardListParams = PhysicalCardListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): PhysicalCardListResponse + ): PhysicalCardListPage /** @see list */ - fun list( - params: PhysicalCardListParams = PhysicalCardListParams.none() - ): PhysicalCardListResponse = list(params, RequestOptions.none()) + fun list(params: PhysicalCardListParams = PhysicalCardListParams.none()): PhysicalCardListPage = + list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): PhysicalCardListResponse = + fun list(requestOptions: RequestOptions): PhysicalCardListPage = list(PhysicalCardListParams.none(), requestOptions) /** @@ -219,24 +218,24 @@ interface PhysicalCardService { * [PhysicalCardService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = list(PhysicalCardListParams.none()) + fun list(): HttpResponseFor = list(PhysicalCardListParams.none()) /** @see list */ @MustBeClosed fun list( params: PhysicalCardListParams = PhysicalCardListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: PhysicalCardListParams = PhysicalCardListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(PhysicalCardListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardServiceImpl.kt index e29a2f5e0..012caa92b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/PhysicalCardServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.physicalcards.PhysicalCard import com.increase.api.models.physicalcards.PhysicalCardCreateParams +import com.increase.api.models.physicalcards.PhysicalCardListPage +import com.increase.api.models.physicalcards.PhysicalCardListPageResponse import com.increase.api.models.physicalcards.PhysicalCardListParams -import com.increase.api.models.physicalcards.PhysicalCardListResponse import com.increase.api.models.physicalcards.PhysicalCardRetrieveParams import com.increase.api.models.physicalcards.PhysicalCardUpdateParams import java.util.function.Consumer @@ -61,7 +62,7 @@ class PhysicalCardServiceImpl internal constructor(private val clientOptions: Cl override fun list( params: PhysicalCardListParams, requestOptions: RequestOptions, - ): PhysicalCardListResponse = + ): PhysicalCardListPage = // get /physical_cards withRawResponse().list(params, requestOptions).parse() @@ -167,13 +168,13 @@ class PhysicalCardServiceImpl internal constructor(private val clientOptions: Cl } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: PhysicalCardListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -191,6 +192,13 @@ class PhysicalCardServiceImpl internal constructor(private val clientOptions: Cl it.validate() } } + .let { + PhysicalCardListPage.builder() + .service(PhysicalCardServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ProgramService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ProgramService.kt index 528cacf55..c2397a28e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ProgramService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ProgramService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.programs.Program +import com.increase.api.models.programs.ProgramListPage import com.increase.api.models.programs.ProgramListParams -import com.increase.api.models.programs.ProgramListResponse import com.increase.api.models.programs.ProgramRetrieveParams import java.util.function.Consumer @@ -56,20 +56,20 @@ interface ProgramService { retrieve(programId, ProgramRetrieveParams.none(), requestOptions) /** List Programs */ - fun list(): ProgramListResponse = list(ProgramListParams.none()) + fun list(): ProgramListPage = list(ProgramListParams.none()) /** @see list */ fun list( params: ProgramListParams = ProgramListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): ProgramListResponse + ): ProgramListPage /** @see list */ - fun list(params: ProgramListParams = ProgramListParams.none()): ProgramListResponse = + fun list(params: ProgramListParams = ProgramListParams.none()): ProgramListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): ProgramListResponse = + fun list(requestOptions: RequestOptions): ProgramListPage = list(ProgramListParams.none(), requestOptions) /** A view of [ProgramService] that provides access to raw HTTP responses for each method. */ @@ -127,25 +127,24 @@ interface ProgramService { * Returns a raw HTTP response for `get /programs`, but is otherwise the same as * [ProgramService.list]. */ - @MustBeClosed - fun list(): HttpResponseFor = list(ProgramListParams.none()) + @MustBeClosed fun list(): HttpResponseFor = list(ProgramListParams.none()) /** @see list */ @MustBeClosed fun list( params: ProgramListParams = ProgramListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: ProgramListParams = ProgramListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(ProgramListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ProgramServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ProgramServiceImpl.kt index 4577609e8..8196bf916 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ProgramServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/ProgramServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.programs.Program +import com.increase.api.models.programs.ProgramListPage +import com.increase.api.models.programs.ProgramListPageResponse import com.increase.api.models.programs.ProgramListParams -import com.increase.api.models.programs.ProgramListResponse import com.increase.api.models.programs.ProgramRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -38,10 +39,7 @@ class ProgramServiceImpl internal constructor(private val clientOptions: ClientO // get /programs/{program_id} withRawResponse().retrieve(params, requestOptions).parse() - override fun list( - params: ProgramListParams, - requestOptions: RequestOptions, - ): ProgramListResponse = + override fun list(params: ProgramListParams, requestOptions: RequestOptions): ProgramListPage = // get /programs withRawResponse().list(params, requestOptions).parse() @@ -88,13 +86,13 @@ class ProgramServiceImpl internal constructor(private val clientOptions: ClientO } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: ProgramListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -112,6 +110,13 @@ class ProgramServiceImpl internal constructor(private val clientOptions: ClientO it.validate() } } + .let { + ProgramListPage.builder() + .service(ProgramServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferService.kt index 9be33a5e8..6c94bd631 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferService.kt @@ -10,8 +10,8 @@ import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransfe import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferApproveParams import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferCancelParams import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferCreateParams +import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListPage import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListParams -import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListResponse import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferRetrieveParams import java.util.function.Consumer @@ -85,22 +85,21 @@ interface RealTimePaymentsTransferService { ) /** List Real-Time Payments Transfers */ - fun list(): RealTimePaymentsTransferListResponse = - list(RealTimePaymentsTransferListParams.none()) + fun list(): RealTimePaymentsTransferListPage = list(RealTimePaymentsTransferListParams.none()) /** @see list */ fun list( params: RealTimePaymentsTransferListParams = RealTimePaymentsTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): RealTimePaymentsTransferListResponse + ): RealTimePaymentsTransferListPage /** @see list */ fun list( params: RealTimePaymentsTransferListParams = RealTimePaymentsTransferListParams.none() - ): RealTimePaymentsTransferListResponse = list(params, RequestOptions.none()) + ): RealTimePaymentsTransferListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): RealTimePaymentsTransferListResponse = + fun list(requestOptions: RequestOptions): RealTimePaymentsTransferListPage = list(RealTimePaymentsTransferListParams.none(), requestOptions) /** Approves a Real-Time Payments Transfer in a pending_approval state. */ @@ -282,7 +281,7 @@ interface RealTimePaymentsTransferService { * same as [RealTimePaymentsTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(RealTimePaymentsTransferListParams.none()) /** @see list */ @@ -290,20 +289,19 @@ interface RealTimePaymentsTransferService { fun list( params: RealTimePaymentsTransferListParams = RealTimePaymentsTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: RealTimePaymentsTransferListParams = RealTimePaymentsTransferListParams.none() - ): HttpResponseFor = - list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed fun list( requestOptions: RequestOptions - ): HttpResponseFor = + ): HttpResponseFor = list(RealTimePaymentsTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferServiceImpl.kt index b3b90d32f..e215aa58e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferServiceImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransfe import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferApproveParams import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferCancelParams import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferCreateParams +import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListPage +import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListPageResponse import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListParams -import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListResponse import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -60,7 +61,7 @@ internal constructor(private val clientOptions: ClientOptions) : RealTimePayment override fun list( params: RealTimePaymentsTransferListParams, requestOptions: RequestOptions, - ): RealTimePaymentsTransferListResponse = + ): RealTimePaymentsTransferListPage = // get /real_time_payments_transfers withRawResponse().list(params, requestOptions).parse() @@ -152,13 +153,13 @@ internal constructor(private val clientOptions: ClientOptions) : RealTimePayment } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: RealTimePaymentsTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -176,6 +177,13 @@ internal constructor(private val clientOptions: ClientOptions) : RealTimePayment it.validate() } } + .let { + RealTimePaymentsTransferListPage.builder() + .service(RealTimePaymentsTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RoutingNumberService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RoutingNumberService.kt index 77ad01114..7510b7104 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RoutingNumberService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RoutingNumberService.kt @@ -6,8 +6,8 @@ import com.google.errorprone.annotations.MustBeClosed import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.routingnumbers.RoutingNumberListPage import com.increase.api.models.routingnumbers.RoutingNumberListParams -import com.increase.api.models.routingnumbers.RoutingNumberListResponse import java.util.function.Consumer interface RoutingNumberService { @@ -30,14 +30,14 @@ interface RoutingNumberService { * will always return 0 or 1 entry. In Sandbox, the only valid routing number for this method * is 110000000. */ - fun list(params: RoutingNumberListParams): RoutingNumberListResponse = + fun list(params: RoutingNumberListParams): RoutingNumberListPage = list(params, RequestOptions.none()) /** @see list */ fun list( params: RoutingNumberListParams, requestOptions: RequestOptions = RequestOptions.none(), - ): RoutingNumberListResponse + ): RoutingNumberListPage /** * A view of [RoutingNumberService] that provides access to raw HTTP responses for each method. @@ -58,7 +58,7 @@ interface RoutingNumberService { * [RoutingNumberService.list]. */ @MustBeClosed - fun list(params: RoutingNumberListParams): HttpResponseFor = + fun list(params: RoutingNumberListParams): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @@ -66,6 +66,6 @@ interface RoutingNumberService { fun list( params: RoutingNumberListParams, requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RoutingNumberServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RoutingNumberServiceImpl.kt index e0aa7eab0..5dd9da36c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RoutingNumberServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/RoutingNumberServiceImpl.kt @@ -14,8 +14,9 @@ import com.increase.api.core.http.HttpResponse.Handler import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare +import com.increase.api.models.routingnumbers.RoutingNumberListPage +import com.increase.api.models.routingnumbers.RoutingNumberListPageResponse import com.increase.api.models.routingnumbers.RoutingNumberListParams -import com.increase.api.models.routingnumbers.RoutingNumberListResponse import java.util.function.Consumer class RoutingNumberServiceImpl internal constructor(private val clientOptions: ClientOptions) : @@ -33,7 +34,7 @@ class RoutingNumberServiceImpl internal constructor(private val clientOptions: C override fun list( params: RoutingNumberListParams, requestOptions: RequestOptions, - ): RoutingNumberListResponse = + ): RoutingNumberListPage = // get /routing_numbers withRawResponse().list(params, requestOptions).parse() @@ -50,13 +51,13 @@ class RoutingNumberServiceImpl internal constructor(private val clientOptions: C clientOptions.toBuilder().apply(modifier::accept).build() ) - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: RoutingNumberListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -74,6 +75,13 @@ class RoutingNumberServiceImpl internal constructor(private val clientOptions: C it.validate() } } + .let { + RoutingNumberListPage.builder() + .service(RoutingNumberServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SupplementalDocumentService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SupplementalDocumentService.kt index 4f29f367d..c1769312b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SupplementalDocumentService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SupplementalDocumentService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.supplementaldocuments.EntitySupplementalDocument import com.increase.api.models.supplementaldocuments.SupplementalDocumentCreateParams +import com.increase.api.models.supplementaldocuments.SupplementalDocumentListPage import com.increase.api.models.supplementaldocuments.SupplementalDocumentListParams -import com.increase.api.models.supplementaldocuments.SupplementalDocumentListResponse import java.util.function.Consumer interface SupplementalDocumentService { @@ -37,14 +37,14 @@ interface SupplementalDocumentService { ): EntitySupplementalDocument /** List Entity Supplemental Document Submissions */ - fun list(params: SupplementalDocumentListParams): SupplementalDocumentListResponse = + fun list(params: SupplementalDocumentListParams): SupplementalDocumentListPage = list(params, RequestOptions.none()) /** @see list */ fun list( params: SupplementalDocumentListParams, requestOptions: RequestOptions = RequestOptions.none(), - ): SupplementalDocumentListResponse + ): SupplementalDocumentListPage /** * A view of [SupplementalDocumentService] that provides access to raw HTTP responses for each @@ -84,13 +84,13 @@ interface SupplementalDocumentService { @MustBeClosed fun list( params: SupplementalDocumentListParams - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed fun list( params: SupplementalDocumentListParams, requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SupplementalDocumentServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SupplementalDocumentServiceImpl.kt index f9c26b017..c41832bcc 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SupplementalDocumentServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SupplementalDocumentServiceImpl.kt @@ -17,8 +17,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.supplementaldocuments.EntitySupplementalDocument import com.increase.api.models.supplementaldocuments.SupplementalDocumentCreateParams +import com.increase.api.models.supplementaldocuments.SupplementalDocumentListPage +import com.increase.api.models.supplementaldocuments.SupplementalDocumentListPageResponse import com.increase.api.models.supplementaldocuments.SupplementalDocumentListParams -import com.increase.api.models.supplementaldocuments.SupplementalDocumentListResponse import java.util.function.Consumer class SupplementalDocumentServiceImpl @@ -45,7 +46,7 @@ internal constructor(private val clientOptions: ClientOptions) : SupplementalDoc override fun list( params: SupplementalDocumentListParams, requestOptions: RequestOptions, - ): SupplementalDocumentListResponse = + ): SupplementalDocumentListPage = // get /entity_supplemental_documents withRawResponse().list(params, requestOptions).parse() @@ -90,13 +91,13 @@ internal constructor(private val clientOptions: ClientOptions) : SupplementalDoc } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: SupplementalDocumentListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -114,6 +115,13 @@ internal constructor(private val clientOptions: ClientOptions) : SupplementalDoc it.validate() } } + .let { + SupplementalDocumentListPage.builder() + .service(SupplementalDocumentServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/TransactionService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/TransactionService.kt index d81286329..ebb11aa3c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/TransactionService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/TransactionService.kt @@ -7,8 +7,8 @@ import com.increase.api.core.ClientOptions import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.transactions.Transaction +import com.increase.api.models.transactions.TransactionListPage import com.increase.api.models.transactions.TransactionListParams -import com.increase.api.models.transactions.TransactionListResponse import com.increase.api.models.transactions.TransactionRetrieveParams import java.util.function.Consumer @@ -59,21 +59,20 @@ interface TransactionService { retrieve(transactionId, TransactionRetrieveParams.none(), requestOptions) /** List Transactions */ - fun list(): TransactionListResponse = list(TransactionListParams.none()) + fun list(): TransactionListPage = list(TransactionListParams.none()) /** @see list */ fun list( params: TransactionListParams = TransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): TransactionListResponse + ): TransactionListPage /** @see list */ - fun list( - params: TransactionListParams = TransactionListParams.none() - ): TransactionListResponse = list(params, RequestOptions.none()) + fun list(params: TransactionListParams = TransactionListParams.none()): TransactionListPage = + list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): TransactionListResponse = + fun list(requestOptions: RequestOptions): TransactionListPage = list(TransactionListParams.none(), requestOptions) /** @@ -139,24 +138,24 @@ interface TransactionService { * [TransactionService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = list(TransactionListParams.none()) + fun list(): HttpResponseFor = list(TransactionListParams.none()) /** @see list */ @MustBeClosed fun list( params: TransactionListParams = TransactionListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: TransactionListParams = TransactionListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(TransactionListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/TransactionServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/TransactionServiceImpl.kt index c62027991..38782bb61 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/TransactionServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/TransactionServiceImpl.kt @@ -16,8 +16,9 @@ import com.increase.api.core.http.HttpResponseFor import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.transactions.Transaction +import com.increase.api.models.transactions.TransactionListPage +import com.increase.api.models.transactions.TransactionListPageResponse import com.increase.api.models.transactions.TransactionListParams -import com.increase.api.models.transactions.TransactionListResponse import com.increase.api.models.transactions.TransactionRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -44,7 +45,7 @@ class TransactionServiceImpl internal constructor(private val clientOptions: Cli override fun list( params: TransactionListParams, requestOptions: RequestOptions, - ): TransactionListResponse = + ): TransactionListPage = // get /transactions withRawResponse().list(params, requestOptions).parse() @@ -91,13 +92,13 @@ class TransactionServiceImpl internal constructor(private val clientOptions: Cli } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: TransactionListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -115,6 +116,13 @@ class TransactionServiceImpl internal constructor(private val clientOptions: Cli it.validate() } } + .let { + TransactionListPage.builder() + .service(TransactionServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireDrawdownRequestService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireDrawdownRequestService.kt index 8725fbf27..bb519359d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireDrawdownRequestService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireDrawdownRequestService.kt @@ -8,8 +8,8 @@ import com.increase.api.core.RequestOptions import com.increase.api.core.http.HttpResponseFor import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequest import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestCreateParams +import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListPage import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListParams -import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListResponse import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestRetrieveParams import java.util.function.Consumer @@ -76,21 +76,21 @@ interface WireDrawdownRequestService { retrieve(wireDrawdownRequestId, WireDrawdownRequestRetrieveParams.none(), requestOptions) /** List Wire Drawdown Requests */ - fun list(): WireDrawdownRequestListResponse = list(WireDrawdownRequestListParams.none()) + fun list(): WireDrawdownRequestListPage = list(WireDrawdownRequestListParams.none()) /** @see list */ fun list( params: WireDrawdownRequestListParams = WireDrawdownRequestListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): WireDrawdownRequestListResponse + ): WireDrawdownRequestListPage /** @see list */ fun list( params: WireDrawdownRequestListParams = WireDrawdownRequestListParams.none() - ): WireDrawdownRequestListResponse = list(params, RequestOptions.none()) + ): WireDrawdownRequestListPage = list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): WireDrawdownRequestListResponse = + fun list(requestOptions: RequestOptions): WireDrawdownRequestListPage = list(WireDrawdownRequestListParams.none(), requestOptions) /** @@ -181,7 +181,7 @@ interface WireDrawdownRequestService { * as [WireDrawdownRequestService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = + fun list(): HttpResponseFor = list(WireDrawdownRequestListParams.none()) /** @see list */ @@ -189,17 +189,17 @@ interface WireDrawdownRequestService { fun list( params: WireDrawdownRequestListParams = WireDrawdownRequestListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: WireDrawdownRequestListParams = WireDrawdownRequestListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(WireDrawdownRequestListParams.none(), requestOptions) } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireDrawdownRequestServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireDrawdownRequestServiceImpl.kt index bb4a7573e..8de84220c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireDrawdownRequestServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireDrawdownRequestServiceImpl.kt @@ -18,8 +18,9 @@ import com.increase.api.core.http.parseable import com.increase.api.core.prepare import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequest import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestCreateParams +import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListPage +import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListPageResponse import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListParams -import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListResponse import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -55,7 +56,7 @@ internal constructor(private val clientOptions: ClientOptions) : WireDrawdownReq override fun list( params: WireDrawdownRequestListParams, requestOptions: RequestOptions, - ): WireDrawdownRequestListResponse = + ): WireDrawdownRequestListPage = // get /wire_drawdown_requests withRawResponse().list(params, requestOptions).parse() @@ -130,13 +131,13 @@ internal constructor(private val clientOptions: ClientOptions) : WireDrawdownReq } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: WireDrawdownRequestListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -154,6 +155,13 @@ internal constructor(private val clientOptions: ClientOptions) : WireDrawdownReq it.validate() } } + .let { + WireDrawdownRequestListPage.builder() + .service(WireDrawdownRequestServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireTransferService.kt index 37b4ff691..b5be5d880 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireTransferService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireTransferService.kt @@ -10,8 +10,8 @@ import com.increase.api.models.wiretransfers.WireTransfer import com.increase.api.models.wiretransfers.WireTransferApproveParams import com.increase.api.models.wiretransfers.WireTransferCancelParams import com.increase.api.models.wiretransfers.WireTransferCreateParams +import com.increase.api.models.wiretransfers.WireTransferListPage import com.increase.api.models.wiretransfers.WireTransferListParams -import com.increase.api.models.wiretransfers.WireTransferListResponse import com.increase.api.models.wiretransfers.WireTransferRetrieveParams import java.util.function.Consumer @@ -72,21 +72,20 @@ interface WireTransferService { retrieve(wireTransferId, WireTransferRetrieveParams.none(), requestOptions) /** List Wire Transfers */ - fun list(): WireTransferListResponse = list(WireTransferListParams.none()) + fun list(): WireTransferListPage = list(WireTransferListParams.none()) /** @see list */ fun list( params: WireTransferListParams = WireTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): WireTransferListResponse + ): WireTransferListPage /** @see list */ - fun list( - params: WireTransferListParams = WireTransferListParams.none() - ): WireTransferListResponse = list(params, RequestOptions.none()) + fun list(params: WireTransferListParams = WireTransferListParams.none()): WireTransferListPage = + list(params, RequestOptions.none()) /** @see list */ - fun list(requestOptions: RequestOptions): WireTransferListResponse = + fun list(requestOptions: RequestOptions): WireTransferListPage = list(WireTransferListParams.none(), requestOptions) /** Approve a Wire Transfer */ @@ -231,24 +230,24 @@ interface WireTransferService { * [WireTransferService.list]. */ @MustBeClosed - fun list(): HttpResponseFor = list(WireTransferListParams.none()) + fun list(): HttpResponseFor = list(WireTransferListParams.none()) /** @see list */ @MustBeClosed fun list( params: WireTransferListParams = WireTransferListParams.none(), requestOptions: RequestOptions = RequestOptions.none(), - ): HttpResponseFor + ): HttpResponseFor /** @see list */ @MustBeClosed fun list( params: WireTransferListParams = WireTransferListParams.none() - ): HttpResponseFor = list(params, RequestOptions.none()) + ): HttpResponseFor = list(params, RequestOptions.none()) /** @see list */ @MustBeClosed - fun list(requestOptions: RequestOptions): HttpResponseFor = + fun list(requestOptions: RequestOptions): HttpResponseFor = list(WireTransferListParams.none(), requestOptions) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireTransferServiceImpl.kt index 949bb9097..6a4ee137a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireTransferServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/WireTransferServiceImpl.kt @@ -20,8 +20,9 @@ import com.increase.api.models.wiretransfers.WireTransfer import com.increase.api.models.wiretransfers.WireTransferApproveParams import com.increase.api.models.wiretransfers.WireTransferCancelParams import com.increase.api.models.wiretransfers.WireTransferCreateParams +import com.increase.api.models.wiretransfers.WireTransferListPage +import com.increase.api.models.wiretransfers.WireTransferListPageResponse import com.increase.api.models.wiretransfers.WireTransferListParams -import com.increase.api.models.wiretransfers.WireTransferListResponse import com.increase.api.models.wiretransfers.WireTransferRetrieveParams import java.util.function.Consumer import kotlin.jvm.optionals.getOrNull @@ -55,7 +56,7 @@ class WireTransferServiceImpl internal constructor(private val clientOptions: Cl override fun list( params: WireTransferListParams, requestOptions: RequestOptions, - ): WireTransferListResponse = + ): WireTransferListPage = // get /wire_transfers withRawResponse().list(params, requestOptions).parse() @@ -144,13 +145,13 @@ class WireTransferServiceImpl internal constructor(private val clientOptions: Cl } } - private val listHandler: Handler = - jsonHandler(clientOptions.jsonMapper) + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) override fun list( params: WireTransferListParams, requestOptions: RequestOptions, - ): HttpResponseFor { + ): HttpResponseFor { val request = HttpRequest.builder() .method(HttpMethod.GET) @@ -168,6 +169,13 @@ class WireTransferServiceImpl internal constructor(private val clientOptions: Cl it.validate() } } + .let { + WireTransferListPage.builder() + .service(WireTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/core/AutoPagerAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/core/AutoPagerAsyncTest.kt new file mode 100644 index 000000000..564e8cb6c --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/core/AutoPagerAsyncTest.kt @@ -0,0 +1,182 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.core + +import com.increase.api.core.http.AsyncStreamResponse +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.api.Assertions.catchThrowable +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith +import org.mockito.junit.jupiter.MockitoExtension +import org.mockito.kotlin.any +import org.mockito.kotlin.clearInvocations +import org.mockito.kotlin.doAnswer +import org.mockito.kotlin.inOrder +import org.mockito.kotlin.mock +import org.mockito.kotlin.never +import org.mockito.kotlin.spy +import org.mockito.kotlin.times +import org.mockito.kotlin.verify +import org.mockito.kotlin.whenever + +@ExtendWith(MockitoExtension::class) +internal class AutoPagerAsyncTest { + + companion object { + + private val ERROR = RuntimeException("ERROR!") + } + + private class PageAsyncImpl( + private val items: List, + private val hasNext: Boolean = true, + ) : PageAsync { + + val nextPageFuture: CompletableFuture> = CompletableFuture() + + override fun hasNextPage(): Boolean = hasNext + + override fun nextPage(): CompletableFuture> = nextPageFuture + + override fun items(): List = items + } + + private val executor = + spy { + doAnswer { invocation -> invocation.getArgument(0).run() } + .whenever(it) + .execute(any()) + } + private val handler = mock>() + + @Test + fun subscribe_whenAlreadySubscribed_throws() { + val autoPagerAsync = AutoPagerAsync.from(PageAsyncImpl(emptyList()), executor) + autoPagerAsync.subscribe {} + clearInvocations(executor) + + val throwable = catchThrowable { autoPagerAsync.subscribe {} } + + assertThat(throwable).isInstanceOf(IllegalStateException::class.java) + assertThat(throwable).hasMessage("Cannot subscribe more than once") + verify(executor, never()).execute(any()) + } + + @Test + fun subscribe_whenClosed_throws() { + val autoPagerAsync = AutoPagerAsync.from(PageAsyncImpl(emptyList()), executor) + autoPagerAsync.close() + + val throwable = catchThrowable { autoPagerAsync.subscribe {} } + + assertThat(throwable).isInstanceOf(IllegalStateException::class.java) + assertThat(throwable).hasMessage("Cannot subscribe after the response is closed") + verify(executor, never()).execute(any()) + } + + @Test + fun subscribe_whenFirstPageNonEmpty_runsHandler() { + val page = PageAsyncImpl(listOf("item1", "item2", "item3"), hasNext = false) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + + autoPagerAsync.subscribe(handler) + + inOrder(executor, handler) { + verify(executor, times(1)).execute(any()) + verify(handler, times(1)).onNext("item1") + verify(handler, times(1)).onNext("item2") + verify(handler, times(1)).onNext("item3") + verify(handler, times(1)).onComplete(Optional.empty()) + } + } + + @Test + fun subscribe_whenFutureCompletesAfterClose_doesNothing() { + val page = PageAsyncImpl(listOf("page1")) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + autoPagerAsync.subscribe(handler) + autoPagerAsync.close() + + page.nextPageFuture.complete(PageAsyncImpl(listOf("page2"))) + + verify(handler, times(1)).onNext("page1") + verify(handler, never()).onNext("page2") + verify(handler, times(1)).onComplete(Optional.empty()) + verify(executor, times(1)).execute(any()) + } + + @Test + fun subscribe_whenFutureErrors_callsOnComplete() { + val page = PageAsyncImpl(emptyList()) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + autoPagerAsync.subscribe(handler) + + page.nextPageFuture.completeExceptionally(ERROR) + + verify(executor, times(1)).execute(any()) + verify(handler, never()).onNext(any()) + verify(handler, times(1)).onComplete(Optional.of(ERROR)) + } + + @Test + fun subscribe_whenFutureCompletes_runsHandler() { + val page = PageAsyncImpl(listOf("chunk1", "chunk2")) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + + autoPagerAsync.subscribe(handler) + + verify(handler, never()).onComplete(any()) + inOrder(executor, handler) { + verify(executor, times(1)).execute(any()) + verify(handler, times(1)).onNext("chunk1") + verify(handler, times(1)).onNext("chunk2") + } + clearInvocations(executor, handler) + + page.nextPageFuture.complete(PageAsyncImpl(listOf("chunk3", "chunk4"), hasNext = false)) + + verify(executor, never()).execute(any()) + inOrder(handler) { + verify(handler, times(1)).onNext("chunk3") + verify(handler, times(1)).onNext("chunk4") + verify(handler, times(1)).onComplete(Optional.empty()) + } + } + + @Test + fun onCompleteFuture_whenNextPageFutureNotCompleted_onCompleteFutureNotCompleted() { + val page = PageAsyncImpl(listOf("chunk1", "chunk2")) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + autoPagerAsync.subscribe {} + + val onCompletableFuture = autoPagerAsync.onCompleteFuture() + + assertThat(onCompletableFuture).isNotCompleted + } + + @Test + fun onCompleteFuture_whenNextPageFutureErrors_onCompleteFutureCompletedExceptionally() { + val page = PageAsyncImpl(listOf("chunk1", "chunk2")) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + autoPagerAsync.subscribe {} + page.nextPageFuture.completeExceptionally(ERROR) + + val onCompletableFuture = autoPagerAsync.onCompleteFuture() + + assertThat(onCompletableFuture).isCompletedExceptionally + } + + @Test + fun onCompleteFuture_whenNoNextPage_onCompleteFutureCompleted() { + val page = PageAsyncImpl(listOf("chunk1", "chunk2"), hasNext = false) + val autoPagerAsync = AutoPagerAsync.from(page, executor) + autoPagerAsync.subscribe {} + + val onCompletableFuture = autoPagerAsync.onCompleteFuture() + + assertThat(onCompletableFuture).isCompleted + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/core/AutoPagerTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/core/AutoPagerTest.kt new file mode 100644 index 000000000..dff7c4091 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/core/AutoPagerTest.kt @@ -0,0 +1,41 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.core + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class AutoPagerTest { + + private class PageImpl( + private val items: List, + private val nextPage: Page? = null, + ) : Page { + + override fun hasNextPage(): Boolean = nextPage != null + + override fun nextPage(): Page = nextPage!! + + override fun items(): List = items + } + + @Test + fun iterator() { + val firstPage = + PageImpl(listOf("chunk1", "chunk2"), nextPage = PageImpl(listOf("chunk3", "chunk4"))) + + val autoPager = AutoPager.from(firstPage) + + assertThat(autoPager).containsExactly("chunk1", "chunk2", "chunk3", "chunk4") + } + + @Test + fun stream() { + val firstPage = + PageImpl(listOf("chunk1", "chunk2"), nextPage = PageImpl(listOf("chunk3", "chunk4"))) + + val autoPager = AutoPager.from(firstPage) + + assertThat(autoPager.stream()).containsExactly("chunk1", "chunk2", "chunk3", "chunk4") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/accountnumbers/AccountNumberListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPageResponseTest.kt similarity index 85% rename from increase-java-core/src/test/kotlin/com/increase/api/models/accountnumbers/AccountNumberListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPageResponseTest.kt index 72b137cfb..b01014c83 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/accountnumbers/AccountNumberListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/accountnumbers/AccountNumberListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class AccountNumberListResponseTest { +internal class AccountNumberListPageResponseTest { @Test fun create() { - val accountNumberListResponse = - AccountNumberListResponse.builder() + val accountNumberListPageResponse = + AccountNumberListPageResponse.builder() .addData( AccountNumber.builder() .id("account_number_v18nkfqm6afpsrvy82b2") @@ -40,7 +40,7 @@ internal class AccountNumberListResponseTest { .nextCursor("v57w5d") .build() - assertThat(accountNumberListResponse.data()) + assertThat(accountNumberListPageResponse.data()) .containsExactly( AccountNumber.builder() .id("account_number_v18nkfqm6afpsrvy82b2") @@ -64,14 +64,14 @@ internal class AccountNumberListResponseTest { .type(AccountNumber.Type.ACCOUNT_NUMBER) .build() ) - assertThat(accountNumberListResponse.nextCursor()).contains("v57w5d") + assertThat(accountNumberListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val accountNumberListResponse = - AccountNumberListResponse.builder() + val accountNumberListPageResponse = + AccountNumberListPageResponse.builder() .addData( AccountNumber.builder() .id("account_number_v18nkfqm6afpsrvy82b2") @@ -98,12 +98,13 @@ internal class AccountNumberListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedAccountNumberListResponse = + val roundtrippedAccountNumberListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(accountNumberListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(accountNumberListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedAccountNumberListResponse).isEqualTo(accountNumberListResponse) + assertThat(roundtrippedAccountNumberListPageResponse) + .isEqualTo(accountNumberListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/accounts/AccountListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/accounts/AccountListPageResponseTest.kt similarity index 85% rename from increase-java-core/src/test/kotlin/com/increase/api/models/accounts/AccountListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/accounts/AccountListPageResponseTest.kt index 49008d3bb..a9a2fab89 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/accounts/AccountListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/accounts/AccountListPageResponseTest.kt @@ -9,12 +9,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class AccountListResponseTest { +internal class AccountListPageResponseTest { @Test fun create() { - val accountListResponse = - AccountListResponse.builder() + val accountListPageResponse = + AccountListPageResponse.builder() .addData( Account.builder() .id("account_in71c4amph0vgo2qllky") @@ -38,7 +38,7 @@ internal class AccountListResponseTest { .nextCursor("v57w5d") .build() - assertThat(accountListResponse.data()) + assertThat(accountListPageResponse.data()) .containsExactly( Account.builder() .id("account_in71c4amph0vgo2qllky") @@ -59,14 +59,14 @@ internal class AccountListResponseTest { .type(Account.Type.ACCOUNT) .build() ) - assertThat(accountListResponse.nextCursor()).contains("v57w5d") + assertThat(accountListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val accountListResponse = - AccountListResponse.builder() + val accountListPageResponse = + AccountListPageResponse.builder() .addData( Account.builder() .id("account_in71c4amph0vgo2qllky") @@ -90,12 +90,12 @@ internal class AccountListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedAccountListResponse = + val roundtrippedAccountListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(accountListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(accountListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedAccountListResponse).isEqualTo(accountListResponse) + assertThat(roundtrippedAccountListPageResponse).isEqualTo(accountListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/accountstatements/AccountStatementListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/accountstatements/AccountStatementListPageResponseTest.kt similarity index 81% rename from increase-java-core/src/test/kotlin/com/increase/api/models/accountstatements/AccountStatementListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/accountstatements/AccountStatementListPageResponseTest.kt index 66090c014..0db8780d7 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/accountstatements/AccountStatementListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/accountstatements/AccountStatementListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class AccountStatementListResponseTest { +internal class AccountStatementListPageResponseTest { @Test fun create() { - val accountStatementListResponse = - AccountStatementListResponse.builder() + val accountStatementListPageResponse = + AccountStatementListPageResponse.builder() .addData( AccountStatement.builder() .id("account_statement_lkc03a4skm2k7f38vj15") @@ -30,7 +30,7 @@ internal class AccountStatementListResponseTest { .nextCursor("v57w5d") .build() - assertThat(accountStatementListResponse.data()) + assertThat(accountStatementListPageResponse.data()) .containsExactly( AccountStatement.builder() .id("account_statement_lkc03a4skm2k7f38vj15") @@ -44,14 +44,14 @@ internal class AccountStatementListResponseTest { .type(AccountStatement.Type.ACCOUNT_STATEMENT) .build() ) - assertThat(accountStatementListResponse.nextCursor()).contains("v57w5d") + assertThat(accountStatementListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val accountStatementListResponse = - AccountStatementListResponse.builder() + val accountStatementListPageResponse = + AccountStatementListPageResponse.builder() .addData( AccountStatement.builder() .id("account_statement_lkc03a4skm2k7f38vj15") @@ -68,12 +68,13 @@ internal class AccountStatementListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedAccountStatementListResponse = + val roundtrippedAccountStatementListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(accountStatementListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(accountStatementListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedAccountStatementListResponse).isEqualTo(accountStatementListResponse) + assertThat(roundtrippedAccountStatementListPageResponse) + .isEqualTo(accountStatementListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageResponseTest.kt similarity index 92% rename from increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageResponseTest.kt index 01c1ea64f..31b8858cf 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/accounttransfers/AccountTransferListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class AccountTransferListResponseTest { +internal class AccountTransferListPageResponseTest { @Test fun create() { - val accountTransferListResponse = - AccountTransferListResponse.builder() + val accountTransferListPageResponse = + AccountTransferListPageResponse.builder() .addData( AccountTransfer.builder() .id("account_transfer_7k9qe1ysdgqztnt63l7n") @@ -66,7 +66,7 @@ internal class AccountTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(accountTransferListResponse.data()) + assertThat(accountTransferListPageResponse.data()) .containsExactly( AccountTransfer.builder() .id("account_transfer_7k9qe1ysdgqztnt63l7n") @@ -116,14 +116,14 @@ internal class AccountTransferListResponseTest { .type(AccountTransfer.Type.ACCOUNT_TRANSFER) .build() ) - assertThat(accountTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(accountTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val accountTransferListResponse = - AccountTransferListResponse.builder() + val accountTransferListPageResponse = + AccountTransferListPageResponse.builder() .addData( AccountTransfer.builder() .id("account_transfer_7k9qe1ysdgqztnt63l7n") @@ -176,12 +176,13 @@ internal class AccountTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedAccountTransferListResponse = + val roundtrippedAccountTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(accountTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(accountTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedAccountTransferListResponse).isEqualTo(accountTransferListResponse) + assertThat(roundtrippedAccountTransferListPageResponse) + .isEqualTo(accountTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageResponseTest.kt similarity index 91% rename from increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageResponseTest.kt index f578c9a33..42deb3c4a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achprenotifications/AchPrenotificationListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class AchPrenotificationListResponseTest { +internal class AchPrenotificationListPageResponseTest { @Test fun create() { - val achPrenotificationListResponse = - AchPrenotificationListResponse.builder() + val achPrenotificationListPageResponse = + AchPrenotificationListPageResponse.builder() .addData( AchPrenotification.builder() .id("ach_prenotification_ubjf9qqsxl3obbcn1u34") @@ -58,7 +58,7 @@ internal class AchPrenotificationListResponseTest { .nextCursor("v57w5d") .build() - assertThat(achPrenotificationListResponse.data()) + assertThat(achPrenotificationListPageResponse.data()) .containsExactly( AchPrenotification.builder() .id("ach_prenotification_ubjf9qqsxl3obbcn1u34") @@ -100,14 +100,14 @@ internal class AchPrenotificationListResponseTest { .type(AchPrenotification.Type.ACH_PRENOTIFICATION) .build() ) - assertThat(achPrenotificationListResponse.nextCursor()).contains("v57w5d") + assertThat(achPrenotificationListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val achPrenotificationListResponse = - AchPrenotificationListResponse.builder() + val achPrenotificationListPageResponse = + AchPrenotificationListPageResponse.builder() .addData( AchPrenotification.builder() .id("ach_prenotification_ubjf9qqsxl3obbcn1u34") @@ -152,13 +152,13 @@ internal class AchPrenotificationListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedAchPrenotificationListResponse = + val roundtrippedAchPrenotificationListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(achPrenotificationListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(achPrenotificationListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedAchPrenotificationListResponse) - .isEqualTo(achPrenotificationListResponse) + assertThat(roundtrippedAchPrenotificationListPageResponse) + .isEqualTo(achPrenotificationListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt similarity index 97% rename from increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt index cca763820..e755df7b5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt @@ -9,12 +9,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class AchTransferListResponseTest { +internal class AchTransferListPageResponseTest { @Test fun create() { - val achTransferListResponse = - AchTransferListResponse.builder() + val achTransferListPageResponse = + AchTransferListPageResponse.builder() .addData( AchTransfer.builder() .id("ach_transfer_uoxatyh3lt5evrsdvo7q") @@ -177,7 +177,7 @@ internal class AchTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(achTransferListResponse.data()) + assertThat(achTransferListPageResponse.data()) .containsExactly( AchTransfer.builder() .id("ach_transfer_uoxatyh3lt5evrsdvo7q") @@ -331,14 +331,14 @@ internal class AchTransferListResponseTest { .type(AchTransfer.Type.ACH_TRANSFER) .build() ) - assertThat(achTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(achTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val achTransferListResponse = - AchTransferListResponse.builder() + val achTransferListPageResponse = + AchTransferListPageResponse.builder() .addData( AchTransfer.builder() .id("ach_transfer_uoxatyh3lt5evrsdvo7q") @@ -501,12 +501,12 @@ internal class AchTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedAchTransferListResponse = + val roundtrippedAchTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(achTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(achTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedAchTransferListResponse).isEqualTo(achTransferListResponse) + assertThat(roundtrippedAchTransferListPageResponse).isEqualTo(achTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageResponseTest.kt similarity index 77% rename from increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageResponseTest.kt index 65cfc430e..c9a4ec90a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingaccounts/BookkeepingAccountListPageResponseTest.kt @@ -7,12 +7,12 @@ import com.increase.api.core.jsonMapper import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class BookkeepingAccountListResponseTest { +internal class BookkeepingAccountListPageResponseTest { @Test fun create() { - val bookkeepingAccountListResponse = - BookkeepingAccountListResponse.builder() + val bookkeepingAccountListPageResponse = + BookkeepingAccountListPageResponse.builder() .addData( BookkeepingAccount.builder() .id("bookkeeping_account_e37p1f1iuocw5intf35v") @@ -27,7 +27,7 @@ internal class BookkeepingAccountListResponseTest { .nextCursor("v57w5d") .build() - assertThat(bookkeepingAccountListResponse.data()) + assertThat(bookkeepingAccountListPageResponse.data()) .containsExactly( BookkeepingAccount.builder() .id("bookkeeping_account_e37p1f1iuocw5intf35v") @@ -39,14 +39,14 @@ internal class BookkeepingAccountListResponseTest { .type(BookkeepingAccount.Type.BOOKKEEPING_ACCOUNT) .build() ) - assertThat(bookkeepingAccountListResponse.nextCursor()).contains("v57w5d") + assertThat(bookkeepingAccountListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val bookkeepingAccountListResponse = - BookkeepingAccountListResponse.builder() + val bookkeepingAccountListPageResponse = + BookkeepingAccountListPageResponse.builder() .addData( BookkeepingAccount.builder() .id("bookkeeping_account_e37p1f1iuocw5intf35v") @@ -61,13 +61,13 @@ internal class BookkeepingAccountListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedBookkeepingAccountListResponse = + val roundtrippedBookkeepingAccountListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(bookkeepingAccountListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(bookkeepingAccountListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedBookkeepingAccountListResponse) - .isEqualTo(bookkeepingAccountListResponse) + assertThat(roundtrippedBookkeepingAccountListPageResponse) + .isEqualTo(bookkeepingAccountListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPageResponseTest.kt similarity index 77% rename from increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPageResponseTest.kt index a8a9223e7..78015ad43 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentries/BookkeepingEntryListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class BookkeepingEntryListResponseTest { +internal class BookkeepingEntryListPageResponseTest { @Test fun create() { - val bookkeepingEntryListResponse = - BookkeepingEntryListResponse.builder() + val bookkeepingEntryListPageResponse = + BookkeepingEntryListPageResponse.builder() .addData( BookkeepingEntry.builder() .id("bookkeeping_entry_ctjpajsj3ks2blx10375") @@ -27,7 +27,7 @@ internal class BookkeepingEntryListResponseTest { .nextCursor("v57w5d") .build() - assertThat(bookkeepingEntryListResponse.data()) + assertThat(bookkeepingEntryListPageResponse.data()) .containsExactly( BookkeepingEntry.builder() .id("bookkeeping_entry_ctjpajsj3ks2blx10375") @@ -38,14 +38,14 @@ internal class BookkeepingEntryListResponseTest { .type(BookkeepingEntry.Type.BOOKKEEPING_ENTRY) .build() ) - assertThat(bookkeepingEntryListResponse.nextCursor()).contains("v57w5d") + assertThat(bookkeepingEntryListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val bookkeepingEntryListResponse = - BookkeepingEntryListResponse.builder() + val bookkeepingEntryListPageResponse = + BookkeepingEntryListPageResponse.builder() .addData( BookkeepingEntry.builder() .id("bookkeeping_entry_ctjpajsj3ks2blx10375") @@ -59,12 +59,13 @@ internal class BookkeepingEntryListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedBookkeepingEntryListResponse = + val roundtrippedBookkeepingEntryListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(bookkeepingEntryListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(bookkeepingEntryListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedBookkeepingEntryListResponse).isEqualTo(bookkeepingEntryListResponse) + assertThat(roundtrippedBookkeepingEntryListPageResponse) + .isEqualTo(bookkeepingEntryListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPageResponseTest.kt similarity index 86% rename from increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPageResponseTest.kt index bf7d2237c..2aab9fd20 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/bookkeepingentrysets/BookkeepingEntrySetListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class BookkeepingEntrySetListResponseTest { +internal class BookkeepingEntrySetListPageResponseTest { @Test fun create() { - val bookkeepingEntrySetListResponse = - BookkeepingEntrySetListResponse.builder() + val bookkeepingEntrySetListPageResponse = + BookkeepingEntrySetListPageResponse.builder() .addData( BookkeepingEntrySet.builder() .id("bookkeeping_entry_set_n80c6wr2p8gtc6p4ingf") @@ -41,7 +41,7 @@ internal class BookkeepingEntrySetListResponseTest { .nextCursor("v57w5d") .build() - assertThat(bookkeepingEntrySetListResponse.data()) + assertThat(bookkeepingEntrySetListPageResponse.data()) .containsExactly( BookkeepingEntrySet.builder() .id("bookkeeping_entry_set_n80c6wr2p8gtc6p4ingf") @@ -66,14 +66,14 @@ internal class BookkeepingEntrySetListResponseTest { .type(BookkeepingEntrySet.Type.BOOKKEEPING_ENTRY_SET) .build() ) - assertThat(bookkeepingEntrySetListResponse.nextCursor()).contains("v57w5d") + assertThat(bookkeepingEntrySetListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val bookkeepingEntrySetListResponse = - BookkeepingEntrySetListResponse.builder() + val bookkeepingEntrySetListPageResponse = + BookkeepingEntrySetListPageResponse.builder() .addData( BookkeepingEntrySet.builder() .id("bookkeeping_entry_set_n80c6wr2p8gtc6p4ingf") @@ -101,13 +101,13 @@ internal class BookkeepingEntrySetListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedBookkeepingEntrySetListResponse = + val roundtrippedBookkeepingEntrySetListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(bookkeepingEntrySetListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(bookkeepingEntrySetListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedBookkeepingEntrySetListResponse) - .isEqualTo(bookkeepingEntrySetListResponse) + assertThat(roundtrippedBookkeepingEntrySetListPageResponse) + .isEqualTo(bookkeepingEntrySetListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt similarity index 99% rename from increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt index 40bb24081..9b87a2a8c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt @@ -9,12 +9,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CardDisputeListResponseTest { +internal class CardDisputeListPageResponseTest { @Test fun create() { - val cardDisputeListResponse = - CardDisputeListResponse.builder() + val cardDisputeListPageResponse = + CardDisputeListPageResponse.builder() .addData( CardDispute.builder() .id("card_dispute_h9sc95nbl1cgltpp7men") @@ -1397,7 +1397,7 @@ internal class CardDisputeListResponseTest { .nextCursor("v57w5d") .build() - assertThat(cardDisputeListResponse.data()) + assertThat(cardDisputeListPageResponse.data()) .containsExactly( CardDispute.builder() .id("card_dispute_h9sc95nbl1cgltpp7men") @@ -2684,14 +2684,14 @@ internal class CardDisputeListResponseTest { ) .build() ) - assertThat(cardDisputeListResponse.nextCursor()).contains("v57w5d") + assertThat(cardDisputeListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val cardDisputeListResponse = - CardDisputeListResponse.builder() + val cardDisputeListPageResponse = + CardDisputeListPageResponse.builder() .addData( CardDispute.builder() .id("card_dispute_h9sc95nbl1cgltpp7men") @@ -4074,12 +4074,12 @@ internal class CardDisputeListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedCardDisputeListResponse = + val roundtrippedCardDisputeListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(cardDisputeListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(cardDisputeListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedCardDisputeListResponse).isEqualTo(cardDisputeListResponse) + assertThat(roundtrippedCardDisputeListPageResponse).isEqualTo(cardDisputeListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt similarity index 99% rename from increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt index 673750c87..669bb9398 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt @@ -9,12 +9,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CardPaymentListResponseTest { +internal class CardPaymentListPageResponseTest { @Test fun create() { - val cardPaymentListResponse = - CardPaymentListResponse.builder() + val cardPaymentListPageResponse = + CardPaymentListPageResponse.builder() .addData( CardPayment.builder() .id("card_payment_nd3k2kacrqjli8482ave") @@ -7020,7 +7020,7 @@ internal class CardPaymentListResponseTest { .nextCursor("v57w5d") .build() - assertThat(cardPaymentListResponse.data()) + assertThat(cardPaymentListPageResponse.data()) .containsExactly( CardPayment.builder() .id("card_payment_nd3k2kacrqjli8482ave") @@ -13675,14 +13675,14 @@ internal class CardPaymentListResponseTest { .type(CardPayment.Type.CARD_PAYMENT) .build() ) - assertThat(cardPaymentListResponse.nextCursor()).contains("v57w5d") + assertThat(cardPaymentListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val cardPaymentListResponse = - CardPaymentListResponse.builder() + val cardPaymentListPageResponse = + CardPaymentListPageResponse.builder() .addData( CardPayment.builder() .id("card_payment_nd3k2kacrqjli8482ave") @@ -20688,12 +20688,12 @@ internal class CardPaymentListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedCardPaymentListResponse = + val roundtrippedCardPaymentListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(cardPaymentListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(cardPaymentListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedCardPaymentListResponse).isEqualTo(cardPaymentListResponse) + assertThat(roundtrippedCardPaymentListPageResponse).isEqualTo(cardPaymentListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPageResponseTest.kt similarity index 92% rename from increase-java-core/src/test/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPageResponseTest.kt index 608009b20..cac7459c1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpurchasesupplements/CardPurchaseSupplementListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CardPurchaseSupplementListResponseTest { +internal class CardPurchaseSupplementListPageResponseTest { @Test fun create() { - val cardPurchaseSupplementListResponse = - CardPurchaseSupplementListResponse.builder() + val cardPurchaseSupplementListPageResponse = + CardPurchaseSupplementListPageResponse.builder() .addData( CardPurchaseSupplement.builder() .id("card_purchase_supplement_ijuc45iym4jchnh2sfk3") @@ -70,7 +70,7 @@ internal class CardPurchaseSupplementListResponseTest { .nextCursor("v57w5d") .build() - assertThat(cardPurchaseSupplementListResponse.data()) + assertThat(cardPurchaseSupplementListPageResponse.data()) .containsExactly( CardPurchaseSupplement.builder() .id("card_purchase_supplement_ijuc45iym4jchnh2sfk3") @@ -120,14 +120,14 @@ internal class CardPurchaseSupplementListResponseTest { .type(CardPurchaseSupplement.Type.CARD_PURCHASE_SUPPLEMENT) .build() ) - assertThat(cardPurchaseSupplementListResponse.nextCursor()).contains("v57w5d") + assertThat(cardPurchaseSupplementListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val cardPurchaseSupplementListResponse = - CardPurchaseSupplementListResponse.builder() + val cardPurchaseSupplementListPageResponse = + CardPurchaseSupplementListPageResponse.builder() .addData( CardPurchaseSupplement.builder() .id("card_purchase_supplement_ijuc45iym4jchnh2sfk3") @@ -184,13 +184,13 @@ internal class CardPurchaseSupplementListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedCardPurchaseSupplementListResponse = + val roundtrippedCardPurchaseSupplementListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(cardPurchaseSupplementListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(cardPurchaseSupplementListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedCardPurchaseSupplementListResponse) - .isEqualTo(cardPurchaseSupplementListResponse) + assertThat(roundtrippedCardPurchaseSupplementListPageResponse) + .isEqualTo(cardPurchaseSupplementListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageResponseTest.kt similarity index 95% rename from increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageResponseTest.kt index 24f07a4bd..2c9928d63 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpushtransfers/CardPushTransferListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CardPushTransferListResponseTest { +internal class CardPushTransferListPageResponseTest { @Test fun create() { - val cardPushTransferListResponse = - CardPushTransferListResponse.builder() + val cardPushTransferListPageResponse = + CardPushTransferListPageResponse.builder() .addData( CardPushTransfer.builder() .id("outbound_card_push_transfer_e0z9rdpamraczh4tvwye") @@ -108,7 +108,7 @@ internal class CardPushTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(cardPushTransferListResponse.data()) + assertThat(cardPushTransferListPageResponse.data()) .containsExactly( CardPushTransfer.builder() .id("outbound_card_push_transfer_e0z9rdpamraczh4tvwye") @@ -200,14 +200,14 @@ internal class CardPushTransferListResponseTest { .type(CardPushTransfer.Type.CARD_PUSH_TRANSFER) .build() ) - assertThat(cardPushTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(cardPushTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val cardPushTransferListResponse = - CardPushTransferListResponse.builder() + val cardPushTransferListPageResponse = + CardPushTransferListPageResponse.builder() .addData( CardPushTransfer.builder() .id("outbound_card_push_transfer_e0z9rdpamraczh4tvwye") @@ -302,12 +302,13 @@ internal class CardPushTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedCardPushTransferListResponse = + val roundtrippedCardPushTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(cardPushTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(cardPushTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedCardPushTransferListResponse).isEqualTo(cardPushTransferListResponse) + assertThat(roundtrippedCardPushTransferListPageResponse) + .isEqualTo(cardPushTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardListPageResponseTest.kt similarity index 89% rename from increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardListPageResponseTest.kt index a99466abf..29223dc47 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CardListResponseTest { +internal class CardListPageResponseTest { @Test fun create() { - val cardListResponse = - CardListResponse.builder() + val cardListPageResponse = + CardListPageResponse.builder() .addData( Card.builder() .id("card_oubs0hwk5rn6knuecxg2") @@ -48,7 +48,7 @@ internal class CardListResponseTest { .nextCursor("v57w5d") .build() - assertThat(cardListResponse.data()) + assertThat(cardListPageResponse.data()) .containsExactly( Card.builder() .id("card_oubs0hwk5rn6knuecxg2") @@ -80,14 +80,14 @@ internal class CardListResponseTest { .type(Card.Type.CARD) .build() ) - assertThat(cardListResponse.nextCursor()).contains("v57w5d") + assertThat(cardListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val cardListResponse = - CardListResponse.builder() + val cardListPageResponse = + CardListPageResponse.builder() .addData( Card.builder() .id("card_oubs0hwk5rn6knuecxg2") @@ -122,12 +122,12 @@ internal class CardListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedCardListResponse = + val roundtrippedCardListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(cardListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(cardListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedCardListResponse).isEqualTo(cardListResponse) + assertThat(roundtrippedCardListPageResponse).isEqualTo(cardListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardtokens/CardTokenListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardtokens/CardTokenListPageResponseTest.kt similarity index 77% rename from increase-java-core/src/test/kotlin/com/increase/api/models/cardtokens/CardTokenListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/cardtokens/CardTokenListPageResponseTest.kt index 5f8efe0fc..c1bfd4133 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardtokens/CardTokenListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardtokens/CardTokenListPageResponseTest.kt @@ -9,12 +9,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CardTokenListResponseTest { +internal class CardTokenListPageResponseTest { @Test fun create() { - val cardTokenListResponse = - CardTokenListResponse.builder() + val cardTokenListPageResponse = + CardTokenListPageResponse.builder() .addData( CardToken.builder() .id("outbound_card_token_zlt0ml6youq3q7vcdlg0") @@ -29,7 +29,7 @@ internal class CardTokenListResponseTest { .nextCursor("v57w5d") .build() - assertThat(cardTokenListResponse.data()) + assertThat(cardTokenListPageResponse.data()) .containsExactly( CardToken.builder() .id("outbound_card_token_zlt0ml6youq3q7vcdlg0") @@ -41,14 +41,14 @@ internal class CardTokenListResponseTest { .type(CardToken.Type.CARD_TOKEN) .build() ) - assertThat(cardTokenListResponse.nextCursor()).contains("v57w5d") + assertThat(cardTokenListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val cardTokenListResponse = - CardTokenListResponse.builder() + val cardTokenListPageResponse = + CardTokenListPageResponse.builder() .addData( CardToken.builder() .id("outbound_card_token_zlt0ml6youq3q7vcdlg0") @@ -63,12 +63,12 @@ internal class CardTokenListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedCardTokenListResponse = + val roundtrippedCardTokenListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(cardTokenListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(cardTokenListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedCardTokenListResponse).isEqualTo(cardTokenListResponse) + assertThat(roundtrippedCardTokenListPageResponse).isEqualTo(cardTokenListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageResponseTest.kt similarity index 95% rename from increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageResponseTest.kt index e30c19695..7c2f9b5e9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardvalidations/CardValidationListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CardValidationListResponseTest { +internal class CardValidationListPageResponseTest { @Test fun create() { - val cardValidationListResponse = - CardValidationListResponse.builder() + val cardValidationListPageResponse = + CardValidationListPageResponse.builder() .addData( CardValidation.builder() .id("outbound_card_validation_qqlzagpc6v1x2gcdhe24") @@ -89,7 +89,7 @@ internal class CardValidationListResponseTest { .nextCursor("v57w5d") .build() - assertThat(cardValidationListResponse.data()) + assertThat(cardValidationListPageResponse.data()) .containsExactly( CardValidation.builder() .id("outbound_card_validation_qqlzagpc6v1x2gcdhe24") @@ -162,14 +162,14 @@ internal class CardValidationListResponseTest { .type(CardValidation.Type.CARD_VALIDATION) .build() ) - assertThat(cardValidationListResponse.nextCursor()).contains("v57w5d") + assertThat(cardValidationListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val cardValidationListResponse = - CardValidationListResponse.builder() + val cardValidationListPageResponse = + CardValidationListPageResponse.builder() .addData( CardValidation.builder() .id("outbound_card_validation_qqlzagpc6v1x2gcdhe24") @@ -245,12 +245,13 @@ internal class CardValidationListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedCardValidationListResponse = + val roundtrippedCardValidationListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(cardValidationListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(cardValidationListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedCardValidationListResponse).isEqualTo(cardValidationListResponse) + assertThat(roundtrippedCardValidationListPageResponse) + .isEqualTo(cardValidationListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt similarity index 95% rename from increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt index 1cb9f4cd7..8c9c45213 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CheckDepositListResponseTest { +internal class CheckDepositListPageResponseTest { @Test fun create() { - val checkDepositListResponse = - CheckDepositListResponse.builder() + val checkDepositListPageResponse = + CheckDepositListPageResponse.builder() .addData( CheckDeposit.builder() .id("check_deposit_f06n9gpg7sxn8t19lfc1") @@ -89,7 +89,7 @@ internal class CheckDepositListResponseTest { .nextCursor("v57w5d") .build() - assertThat(checkDepositListResponse.data()) + assertThat(checkDepositListPageResponse.data()) .containsExactly( CheckDeposit.builder() .id("check_deposit_f06n9gpg7sxn8t19lfc1") @@ -160,14 +160,14 @@ internal class CheckDepositListResponseTest { .type(CheckDeposit.Type.CHECK_DEPOSIT) .build() ) - assertThat(checkDepositListResponse.nextCursor()).contains("v57w5d") + assertThat(checkDepositListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val checkDepositListResponse = - CheckDepositListResponse.builder() + val checkDepositListPageResponse = + CheckDepositListPageResponse.builder() .addData( CheckDeposit.builder() .id("check_deposit_f06n9gpg7sxn8t19lfc1") @@ -243,12 +243,12 @@ internal class CheckDepositListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedCheckDepositListResponse = + val roundtrippedCheckDepositListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(checkDepositListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(checkDepositListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedCheckDepositListResponse).isEqualTo(checkDepositListResponse) + assertThat(roundtrippedCheckDepositListPageResponse).isEqualTo(checkDepositListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageResponseTest.kt similarity index 97% rename from increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageResponseTest.kt index e92e37e86..12480a8d6 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class CheckTransferListResponseTest { +internal class CheckTransferListPageResponseTest { @Test fun create() { - val checkTransferListResponse = - CheckTransferListResponse.builder() + val checkTransferListPageResponse = + CheckTransferListPageResponse.builder() .addData( CheckTransfer.builder() .id("check_transfer_30b43acfu9vw8fyc4f5") @@ -168,7 +168,7 @@ internal class CheckTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(checkTransferListResponse.data()) + assertThat(checkTransferListPageResponse.data()) .containsExactly( CheckTransfer.builder() .id("check_transfer_30b43acfu9vw8fyc4f5") @@ -316,14 +316,14 @@ internal class CheckTransferListResponseTest { .validUntilDate(null) .build() ) - assertThat(checkTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(checkTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val checkTransferListResponse = - CheckTransferListResponse.builder() + val checkTransferListPageResponse = + CheckTransferListPageResponse.builder() .addData( CheckTransfer.builder() .id("check_transfer_30b43acfu9vw8fyc4f5") @@ -478,12 +478,13 @@ internal class CheckTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedCheckTransferListResponse = + val roundtrippedCheckTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(checkTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(checkTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedCheckTransferListResponse).isEqualTo(checkTransferListResponse) + assertThat(roundtrippedCheckTransferListPageResponse) + .isEqualTo(checkTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt similarity index 99% rename from increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt index a0634602b..e2eaccef2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class DeclinedTransactionListResponseTest { +internal class DeclinedTransactionListPageResponseTest { @Test fun create() { - val declinedTransactionListResponse = - DeclinedTransactionListResponse.builder() + val declinedTransactionListPageResponse = + DeclinedTransactionListPageResponse.builder() .addData( DeclinedTransaction.builder() .id("declined_transaction_17jbn0yyhvkt4v4ooym8") @@ -373,7 +373,7 @@ internal class DeclinedTransactionListResponseTest { .nextCursor("v57w5d") .build() - assertThat(declinedTransactionListResponse.data()) + assertThat(declinedTransactionListPageResponse.data()) .containsExactly( DeclinedTransaction.builder() .id("declined_transaction_17jbn0yyhvkt4v4ooym8") @@ -718,14 +718,14 @@ internal class DeclinedTransactionListResponseTest { .type(DeclinedTransaction.Type.DECLINED_TRANSACTION) .build() ) - assertThat(declinedTransactionListResponse.nextCursor()).contains("v57w5d") + assertThat(declinedTransactionListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val declinedTransactionListResponse = - DeclinedTransactionListResponse.builder() + val declinedTransactionListPageResponse = + DeclinedTransactionListPageResponse.builder() .addData( DeclinedTransaction.builder() .id("declined_transaction_17jbn0yyhvkt4v4ooym8") @@ -1085,13 +1085,13 @@ internal class DeclinedTransactionListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedDeclinedTransactionListResponse = + val roundtrippedDeclinedTransactionListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(declinedTransactionListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(declinedTransactionListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedDeclinedTransactionListResponse) - .isEqualTo(declinedTransactionListResponse) + assertThat(roundtrippedDeclinedTransactionListPageResponse) + .isEqualTo(declinedTransactionListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPageResponseTest.kt similarity index 86% rename from increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPageResponseTest.kt index 2b7cb8620..761eaf3ab 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class DigitalCardProfileListResponseTest { +internal class DigitalCardProfileListPageResponseTest { @Test fun create() { - val digitalCardProfileListResponse = - DigitalCardProfileListResponse.builder() + val digitalCardProfileListPageResponse = + DigitalCardProfileListPageResponse.builder() .addData( DigitalCardProfile.builder() .id("digital_card_profile_s3puplu90f04xhcwkiga") @@ -41,7 +41,7 @@ internal class DigitalCardProfileListResponseTest { .nextCursor("v57w5d") .build() - assertThat(digitalCardProfileListResponse.data()) + assertThat(digitalCardProfileListPageResponse.data()) .containsExactly( DigitalCardProfile.builder() .id("digital_card_profile_s3puplu90f04xhcwkiga") @@ -66,14 +66,14 @@ internal class DigitalCardProfileListResponseTest { .type(DigitalCardProfile.Type.DIGITAL_CARD_PROFILE) .build() ) - assertThat(digitalCardProfileListResponse.nextCursor()).contains("v57w5d") + assertThat(digitalCardProfileListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val digitalCardProfileListResponse = - DigitalCardProfileListResponse.builder() + val digitalCardProfileListPageResponse = + DigitalCardProfileListPageResponse.builder() .addData( DigitalCardProfile.builder() .id("digital_card_profile_s3puplu90f04xhcwkiga") @@ -101,13 +101,13 @@ internal class DigitalCardProfileListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedDigitalCardProfileListResponse = + val roundtrippedDigitalCardProfileListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(digitalCardProfileListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(digitalCardProfileListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedDigitalCardProfileListResponse) - .isEqualTo(digitalCardProfileListResponse) + assertThat(roundtrippedDigitalCardProfileListPageResponse) + .isEqualTo(digitalCardProfileListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPageResponseTest.kt similarity index 88% rename from increase-java-core/src/test/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPageResponseTest.kt index 36fb3d7ce..bc7b67a4a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/digitalwallettokens/DigitalWalletTokenListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class DigitalWalletTokenListResponseTest { +internal class DigitalWalletTokenListPageResponseTest { @Test fun create() { - val digitalWalletTokenListResponse = - DigitalWalletTokenListResponse.builder() + val digitalWalletTokenListPageResponse = + DigitalWalletTokenListPageResponse.builder() .addData( DigitalWalletToken.builder() .id("digital_wallet_token_izi62go3h51p369jrie0") @@ -44,7 +44,7 @@ internal class DigitalWalletTokenListResponseTest { .nextCursor("v57w5d") .build() - assertThat(digitalWalletTokenListResponse.data()) + assertThat(digitalWalletTokenListPageResponse.data()) .containsExactly( DigitalWalletToken.builder() .id("digital_wallet_token_izi62go3h51p369jrie0") @@ -70,14 +70,14 @@ internal class DigitalWalletTokenListResponseTest { ) .build() ) - assertThat(digitalWalletTokenListResponse.nextCursor()).contains("v57w5d") + assertThat(digitalWalletTokenListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val digitalWalletTokenListResponse = - DigitalWalletTokenListResponse.builder() + val digitalWalletTokenListPageResponse = + DigitalWalletTokenListPageResponse.builder() .addData( DigitalWalletToken.builder() .id("digital_wallet_token_izi62go3h51p369jrie0") @@ -108,13 +108,13 @@ internal class DigitalWalletTokenListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedDigitalWalletTokenListResponse = + val roundtrippedDigitalWalletTokenListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(digitalWalletTokenListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(digitalWalletTokenListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedDigitalWalletTokenListResponse) - .isEqualTo(digitalWalletTokenListResponse) + assertThat(roundtrippedDigitalWalletTokenListPageResponse) + .isEqualTo(digitalWalletTokenListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/documents/DocumentListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/documents/DocumentListPageResponseTest.kt similarity index 85% rename from increase-java-core/src/test/kotlin/com/increase/api/models/documents/DocumentListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/documents/DocumentListPageResponseTest.kt index 312739cc6..a70ea25e2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/documents/DocumentListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/documents/DocumentListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class DocumentListResponseTest { +internal class DocumentListPageResponseTest { @Test fun create() { - val documentListResponse = - DocumentListResponse.builder() + val documentListPageResponse = + DocumentListPageResponse.builder() .addData( Document.builder() .id("document_qjtqc6s4c14ve2q89izm") @@ -38,7 +38,7 @@ internal class DocumentListResponseTest { .nextCursor("v57w5d") .build() - assertThat(documentListResponse.data()) + assertThat(documentListPageResponse.data()) .containsExactly( Document.builder() .id("document_qjtqc6s4c14ve2q89izm") @@ -60,14 +60,14 @@ internal class DocumentListResponseTest { .type(Document.Type.DOCUMENT) .build() ) - assertThat(documentListResponse.nextCursor()).contains("v57w5d") + assertThat(documentListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val documentListResponse = - DocumentListResponse.builder() + val documentListPageResponse = + DocumentListPageResponse.builder() .addData( Document.builder() .id("document_qjtqc6s4c14ve2q89izm") @@ -92,12 +92,12 @@ internal class DocumentListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedDocumentListResponse = + val roundtrippedDocumentListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(documentListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(documentListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedDocumentListResponse).isEqualTo(documentListResponse) + assertThat(roundtrippedDocumentListPageResponse).isEqualTo(documentListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityListPageResponseTest.kt similarity index 98% rename from increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityListPageResponseTest.kt index d86d1d3bd..7694837e5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityListPageResponseTest.kt @@ -10,12 +10,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class EntityListResponseTest { +internal class EntityListPageResponseTest { @Test fun create() { - val entityListResponse = - EntityListResponse.builder() + val entityListPageResponse = + EntityListPageResponse.builder() .addData( Entity.builder() .id("entity_n8y8tnk2p9339ti393yi") @@ -262,7 +262,7 @@ internal class EntityListResponseTest { .nextCursor("v57w5d") .build() - assertThat(entityListResponse.data()) + assertThat(entityListPageResponse.data()) .containsExactly( Entity.builder() .id("entity_n8y8tnk2p9339ti393yi") @@ -505,14 +505,14 @@ internal class EntityListResponseTest { .type(Entity.Type.ENTITY) .build() ) - assertThat(entityListResponse.nextCursor()).contains("v57w5d") + assertThat(entityListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val entityListResponse = - EntityListResponse.builder() + val entityListPageResponse = + EntityListPageResponse.builder() .addData( Entity.builder() .id("entity_n8y8tnk2p9339ti393yi") @@ -759,12 +759,12 @@ internal class EntityListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedEntityListResponse = + val roundtrippedEntityListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(entityListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(entityListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedEntityListResponse).isEqualTo(entityListResponse) + assertThat(roundtrippedEntityListPageResponse).isEqualTo(entityListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/events/EventListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/events/EventListPageResponseTest.kt similarity index 78% rename from increase-java-core/src/test/kotlin/com/increase/api/models/events/EventListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/events/EventListPageResponseTest.kt index 99b14e5f4..e74eb2d04 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/events/EventListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/events/EventListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class EventListResponseTest { +internal class EventListPageResponseTest { @Test fun create() { - val eventListResponse = - EventListResponse.builder() + val eventListPageResponse = + EventListPageResponse.builder() .addData( Event.builder() .id("event_001dzz0r20rzr4zrhrr1364hy80") @@ -27,7 +27,7 @@ internal class EventListResponseTest { .nextCursor("v57w5d") .build() - assertThat(eventListResponse.data()) + assertThat(eventListPageResponse.data()) .containsExactly( Event.builder() .id("event_001dzz0r20rzr4zrhrr1364hy80") @@ -38,14 +38,14 @@ internal class EventListResponseTest { .type(Event.Type.EVENT) .build() ) - assertThat(eventListResponse.nextCursor()).contains("v57w5d") + assertThat(eventListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val eventListResponse = - EventListResponse.builder() + val eventListPageResponse = + EventListPageResponse.builder() .addData( Event.builder() .id("event_001dzz0r20rzr4zrhrr1364hy80") @@ -59,12 +59,12 @@ internal class EventListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedEventListResponse = + val roundtrippedEventListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(eventListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(eventListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedEventListResponse).isEqualTo(eventListResponse) + assertThat(roundtrippedEventListPageResponse).isEqualTo(eventListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPageResponseTest.kt similarity index 78% rename from increase-java-core/src/test/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPageResponseTest.kt index 81ec6d1d5..a2dc7a9ae 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class EventSubscriptionListResponseTest { +internal class EventSubscriptionListPageResponseTest { @Test fun create() { - val eventSubscriptionListResponse = - EventSubscriptionListResponse.builder() + val eventSubscriptionListPageResponse = + EventSubscriptionListPageResponse.builder() .addData( EventSubscription.builder() .id("event_subscription_001dzz0r20rcdxgb013zqb8m04g") @@ -29,7 +29,7 @@ internal class EventSubscriptionListResponseTest { .nextCursor("v57w5d") .build() - assertThat(eventSubscriptionListResponse.data()) + assertThat(eventSubscriptionListPageResponse.data()) .containsExactly( EventSubscription.builder() .id("event_subscription_001dzz0r20rcdxgb013zqb8m04g") @@ -42,14 +42,14 @@ internal class EventSubscriptionListResponseTest { .url("https://website.com/webhooks") .build() ) - assertThat(eventSubscriptionListResponse.nextCursor()).contains("v57w5d") + assertThat(eventSubscriptionListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val eventSubscriptionListResponse = - EventSubscriptionListResponse.builder() + val eventSubscriptionListPageResponse = + EventSubscriptionListPageResponse.builder() .addData( EventSubscription.builder() .id("event_subscription_001dzz0r20rcdxgb013zqb8m04g") @@ -65,13 +65,13 @@ internal class EventSubscriptionListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedEventSubscriptionListResponse = + val roundtrippedEventSubscriptionListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(eventSubscriptionListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(eventSubscriptionListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedEventSubscriptionListResponse) - .isEqualTo(eventSubscriptionListResponse) + assertThat(roundtrippedEventSubscriptionListPageResponse) + .isEqualTo(eventSubscriptionListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportListPageResponseTest.kt similarity index 79% rename from increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportListPageResponseTest.kt index 1e9570cc2..9499a50d8 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class ExportListResponseTest { +internal class ExportListPageResponseTest { @Test fun create() { - val exportListResponse = - ExportListResponse.builder() + val exportListPageResponse = + ExportListPageResponse.builder() .addData( Export.builder() .id("export_8s4m48qz3bclzje0zwh9") @@ -29,7 +29,7 @@ internal class ExportListResponseTest { .nextCursor("v57w5d") .build() - assertThat(exportListResponse.data()) + assertThat(exportListPageResponse.data()) .containsExactly( Export.builder() .id("export_8s4m48qz3bclzje0zwh9") @@ -42,14 +42,14 @@ internal class ExportListResponseTest { .type(Export.Type.EXPORT) .build() ) - assertThat(exportListResponse.nextCursor()).contains("v57w5d") + assertThat(exportListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val exportListResponse = - ExportListResponse.builder() + val exportListPageResponse = + ExportListPageResponse.builder() .addData( Export.builder() .id("export_8s4m48qz3bclzje0zwh9") @@ -65,12 +65,12 @@ internal class ExportListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedExportListResponse = + val roundtrippedExportListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(exportListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(exportListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedExportListResponse).isEqualTo(exportListResponse) + assertThat(roundtrippedExportListPageResponse).isEqualTo(exportListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPageResponseTest.kt similarity index 81% rename from increase-java-core/src/test/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPageResponseTest.kt index ec719eec6..1a0aac157 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/externalaccounts/ExternalAccountListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class ExternalAccountListResponseTest { +internal class ExternalAccountListPageResponseTest { @Test fun create() { - val externalAccountListResponse = - ExternalAccountListResponse.builder() + val externalAccountListPageResponse = + ExternalAccountListPageResponse.builder() .addData( ExternalAccount.builder() .id("external_account_ukk55lr923a3ac0pp7iv") @@ -31,7 +31,7 @@ internal class ExternalAccountListResponseTest { .nextCursor("v57w5d") .build() - assertThat(externalAccountListResponse.data()) + assertThat(externalAccountListPageResponse.data()) .containsExactly( ExternalAccount.builder() .id("external_account_ukk55lr923a3ac0pp7iv") @@ -46,14 +46,14 @@ internal class ExternalAccountListResponseTest { .type(ExternalAccount.Type.EXTERNAL_ACCOUNT) .build() ) - assertThat(externalAccountListResponse.nextCursor()).contains("v57w5d") + assertThat(externalAccountListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val externalAccountListResponse = - ExternalAccountListResponse.builder() + val externalAccountListPageResponse = + ExternalAccountListPageResponse.builder() .addData( ExternalAccount.builder() .id("external_account_ukk55lr923a3ac0pp7iv") @@ -71,12 +71,13 @@ internal class ExternalAccountListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedExternalAccountListResponse = + val roundtrippedExternalAccountListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(externalAccountListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(externalAccountListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedExternalAccountListResponse).isEqualTo(externalAccountListResponse) + assertThat(roundtrippedExternalAccountListPageResponse) + .isEqualTo(externalAccountListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt similarity index 94% rename from increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt index b37a89dbf..555be5ebb 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class FednowTransferListResponseTest { +internal class FednowTransferListPageResponseTest { @Test fun create() { - val fednowTransferListResponse = - FednowTransferListResponse.builder() + val fednowTransferListPageResponse = + FednowTransferListPageResponse.builder() .addData( FednowTransfer.builder() .id("fednow_transfer_4i0mptrdu1mueg1196bg") @@ -77,7 +77,7 @@ internal class FednowTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(fednowTransferListResponse.data()) + assertThat(fednowTransferListPageResponse.data()) .containsExactly( FednowTransfer.builder() .id("fednow_transfer_4i0mptrdu1mueg1196bg") @@ -138,14 +138,14 @@ internal class FednowTransferListResponseTest { .unstructuredRemittanceInformation("Invoice 29582") .build() ) - assertThat(fednowTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(fednowTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val fednowTransferListResponse = - FednowTransferListResponse.builder() + val fednowTransferListPageResponse = + FednowTransferListPageResponse.builder() .addData( FednowTransfer.builder() .id("fednow_transfer_4i0mptrdu1mueg1196bg") @@ -209,12 +209,13 @@ internal class FednowTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedFednowTransferListResponse = + val roundtrippedFednowTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(fednowTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(fednowTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedFednowTransferListResponse).isEqualTo(fednowTransferListResponse) + assertThat(roundtrippedFednowTransferListPageResponse) + .isEqualTo(fednowTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/files/FileListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/files/FileListPageResponseTest.kt similarity index 81% rename from increase-java-core/src/test/kotlin/com/increase/api/models/files/FileListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/files/FileListPageResponseTest.kt index 6118f1760..d1664c379 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/files/FileListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/files/FileListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class FileListResponseTest { +internal class FileListPageResponseTest { @Test fun create() { - val fileListResponse = - FileListResponse.builder() + val fileListPageResponse = + FileListPageResponse.builder() .addData( File.builder() .id("file_makxrc67oh9l6sg7w9yc") @@ -30,7 +30,7 @@ internal class FileListResponseTest { .nextCursor("v57w5d") .build() - assertThat(fileListResponse.data()) + assertThat(fileListPageResponse.data()) .containsExactly( File.builder() .id("file_makxrc67oh9l6sg7w9yc") @@ -44,14 +44,14 @@ internal class FileListResponseTest { .type(File.Type.FILE) .build() ) - assertThat(fileListResponse.nextCursor()).contains("v57w5d") + assertThat(fileListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val fileListResponse = - FileListResponse.builder() + val fileListPageResponse = + FileListPageResponse.builder() .addData( File.builder() .id("file_makxrc67oh9l6sg7w9yc") @@ -68,12 +68,12 @@ internal class FileListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedFileListResponse = + val roundtrippedFileListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(fileListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(fileListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedFileListResponse).isEqualTo(fileListResponse) + assertThat(roundtrippedFileListPageResponse).isEqualTo(fileListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPageResponseTest.kt similarity index 97% rename from increase-java-core/src/test/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPageResponseTest.kt index b502b65aa..187456f3d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundachtransfers/InboundAchTransferListPageResponseTest.kt @@ -9,12 +9,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InboundAchTransferListResponseTest { +internal class InboundAchTransferListPageResponseTest { @Test fun create() { - val inboundAchTransferListResponse = - InboundAchTransferListResponse.builder() + val inboundAchTransferListPageResponse = + InboundAchTransferListPageResponse.builder() .addData( InboundAchTransfer.builder() .id("inbound_ach_transfer_tdrwqr3fq9gnnq49odev") @@ -152,7 +152,7 @@ internal class InboundAchTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(inboundAchTransferListResponse.data()) + assertThat(inboundAchTransferListPageResponse.data()) .containsExactly( InboundAchTransfer.builder() .id("inbound_ach_transfer_tdrwqr3fq9gnnq49odev") @@ -287,14 +287,14 @@ internal class InboundAchTransferListResponseTest { .type(InboundAchTransfer.Type.INBOUND_ACH_TRANSFER) .build() ) - assertThat(inboundAchTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(inboundAchTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val inboundAchTransferListResponse = - InboundAchTransferListResponse.builder() + val inboundAchTransferListPageResponse = + InboundAchTransferListPageResponse.builder() .addData( InboundAchTransfer.builder() .id("inbound_ach_transfer_tdrwqr3fq9gnnq49odev") @@ -432,13 +432,13 @@ internal class InboundAchTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedInboundAchTransferListResponse = + val roundtrippedInboundAchTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(inboundAchTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(inboundAchTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedInboundAchTransferListResponse) - .isEqualTo(inboundAchTransferListResponse) + assertThat(roundtrippedInboundAchTransferListPageResponse) + .isEqualTo(inboundAchTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPageResponseTest.kt similarity index 91% rename from increase-java-core/src/test/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPageResponseTest.kt index 8b76afd9c..3bf50d07c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundcheckdeposits/InboundCheckDepositListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InboundCheckDepositListResponseTest { +internal class InboundCheckDepositListPageResponseTest { @Test fun create() { - val inboundCheckDepositListResponse = - InboundCheckDepositListResponse.builder() + val inboundCheckDepositListPageResponse = + InboundCheckDepositListPageResponse.builder() .addData( InboundCheckDeposit.builder() .id("inbound_check_deposit_zoshvqybq0cjjm31mra") @@ -56,7 +56,7 @@ internal class InboundCheckDepositListResponseTest { .nextCursor("v57w5d") .build() - assertThat(inboundCheckDepositListResponse.data()) + assertThat(inboundCheckDepositListPageResponse.data()) .containsExactly( InboundCheckDeposit.builder() .id("inbound_check_deposit_zoshvqybq0cjjm31mra") @@ -94,14 +94,14 @@ internal class InboundCheckDepositListResponseTest { .type(InboundCheckDeposit.Type.INBOUND_CHECK_DEPOSIT) .build() ) - assertThat(inboundCheckDepositListResponse.nextCursor()).contains("v57w5d") + assertThat(inboundCheckDepositListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val inboundCheckDepositListResponse = - InboundCheckDepositListResponse.builder() + val inboundCheckDepositListPageResponse = + InboundCheckDepositListPageResponse.builder() .addData( InboundCheckDeposit.builder() .id("inbound_check_deposit_zoshvqybq0cjjm31mra") @@ -144,13 +144,13 @@ internal class InboundCheckDepositListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedInboundCheckDepositListResponse = + val roundtrippedInboundCheckDepositListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(inboundCheckDepositListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(inboundCheckDepositListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedInboundCheckDepositListResponse) - .isEqualTo(inboundCheckDepositListResponse) + assertThat(roundtrippedInboundCheckDepositListPageResponse) + .isEqualTo(inboundCheckDepositListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponseTest.kt similarity index 88% rename from increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponseTest.kt index 514d66f86..9ad0c3f5d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InboundFednowTransferListResponseTest { +internal class InboundFednowTransferListPageResponseTest { @Test fun create() { - val inboundFednowTransferListResponse = - InboundFednowTransferListResponse.builder() + val inboundFednowTransferListPageResponse = + InboundFednowTransferListPageResponse.builder() .addData( InboundFednowTransfer.builder() .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") @@ -48,7 +48,7 @@ internal class InboundFednowTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(inboundFednowTransferListResponse.data()) + assertThat(inboundFednowTransferListPageResponse.data()) .containsExactly( InboundFednowTransfer.builder() .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") @@ -78,14 +78,14 @@ internal class InboundFednowTransferListResponseTest { .unstructuredRemittanceInformation("Invoice 29582") .build() ) - assertThat(inboundFednowTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(inboundFednowTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val inboundFednowTransferListResponse = - InboundFednowTransferListResponse.builder() + val inboundFednowTransferListPageResponse = + InboundFednowTransferListPageResponse.builder() .addData( InboundFednowTransfer.builder() .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") @@ -120,13 +120,13 @@ internal class InboundFednowTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedInboundFednowTransferListResponse = + val roundtrippedInboundFednowTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(inboundFednowTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(inboundFednowTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedInboundFednowTransferListResponse) - .isEqualTo(inboundFednowTransferListResponse) + assertThat(roundtrippedInboundFednowTransferListPageResponse) + .isEqualTo(inboundFednowTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt similarity index 89% rename from increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt index a0d7c4a6c..768d45eb6 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundmailitems/InboundMailItemListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InboundMailItemListResponseTest { +internal class InboundMailItemListPageResponseTest { @Test fun create() { - val inboundMailItemListResponse = - InboundMailItemListResponse.builder() + val inboundMailItemListPageResponse = + InboundMailItemListPageResponse.builder() .addData( InboundMailItem.builder() .id("inbound_mail_item_q6rrg7mmqpplx80zceev") @@ -47,7 +47,7 @@ internal class InboundMailItemListResponseTest { .nextCursor("v57w5d") .build() - assertThat(inboundMailItemListResponse.data()) + assertThat(inboundMailItemListPageResponse.data()) .containsExactly( InboundMailItem.builder() .id("inbound_mail_item_q6rrg7mmqpplx80zceev") @@ -78,14 +78,14 @@ internal class InboundMailItemListResponseTest { .type(InboundMailItem.Type.INBOUND_MAIL_ITEM) .build() ) - assertThat(inboundMailItemListResponse.nextCursor()).contains("v57w5d") + assertThat(inboundMailItemListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val inboundMailItemListResponse = - InboundMailItemListResponse.builder() + val inboundMailItemListPageResponse = + InboundMailItemListPageResponse.builder() .addData( InboundMailItem.builder() .id("inbound_mail_item_q6rrg7mmqpplx80zceev") @@ -119,12 +119,13 @@ internal class InboundMailItemListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedInboundMailItemListResponse = + val roundtrippedInboundMailItemListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(inboundMailItemListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(inboundMailItemListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedInboundMailItemListResponse).isEqualTo(inboundMailItemListResponse) + assertThat(roundtrippedInboundMailItemListPageResponse) + .isEqualTo(inboundMailItemListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPageResponseTest.kt similarity index 90% rename from increase-java-core/src/test/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPageResponseTest.kt index f181feede..4e9a0a751 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundrealtimepaymentstransfers/InboundRealTimePaymentsTransferListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InboundRealTimePaymentsTransferListResponseTest { +internal class InboundRealTimePaymentsTransferListPageResponseTest { @Test fun create() { - val inboundRealTimePaymentsTransferListResponse = - InboundRealTimePaymentsTransferListResponse.builder() + val inboundRealTimePaymentsTransferListPageResponse = + InboundRealTimePaymentsTransferListPageResponse.builder() .addData( InboundRealTimePaymentsTransfer.builder() .id("inbound_real_time_payments_transfer_63hlz498vcxg644hcrzr") @@ -53,7 +53,7 @@ internal class InboundRealTimePaymentsTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(inboundRealTimePaymentsTransferListResponse.data()) + assertThat(inboundRealTimePaymentsTransferListPageResponse.data()) .containsExactly( InboundRealTimePaymentsTransfer.builder() .id("inbound_real_time_payments_transfer_63hlz498vcxg644hcrzr") @@ -88,14 +88,14 @@ internal class InboundRealTimePaymentsTransferListResponseTest { .type(InboundRealTimePaymentsTransfer.Type.INBOUND_REAL_TIME_PAYMENTS_TRANSFER) .build() ) - assertThat(inboundRealTimePaymentsTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(inboundRealTimePaymentsTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val inboundRealTimePaymentsTransferListResponse = - InboundRealTimePaymentsTransferListResponse.builder() + val inboundRealTimePaymentsTransferListPageResponse = + InboundRealTimePaymentsTransferListPageResponse.builder() .addData( InboundRealTimePaymentsTransfer.builder() .id("inbound_real_time_payments_transfer_63hlz498vcxg644hcrzr") @@ -135,13 +135,13 @@ internal class InboundRealTimePaymentsTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedInboundRealTimePaymentsTransferListResponse = + val roundtrippedInboundRealTimePaymentsTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(inboundRealTimePaymentsTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(inboundRealTimePaymentsTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedInboundRealTimePaymentsTransferListResponse) - .isEqualTo(inboundRealTimePaymentsTransferListResponse) + assertThat(roundtrippedInboundRealTimePaymentsTransferListPageResponse) + .isEqualTo(inboundRealTimePaymentsTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPageResponseTest.kt similarity index 86% rename from increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPageResponseTest.kt index 95ee8a8b7..6a00d99a5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiredrawdownrequests/InboundWireDrawdownRequestListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InboundWireDrawdownRequestListResponseTest { +internal class InboundWireDrawdownRequestListPageResponseTest { @Test fun create() { - val inboundWireDrawdownRequestListResponse = - InboundWireDrawdownRequestListResponse.builder() + val inboundWireDrawdownRequestListPageResponse = + InboundWireDrawdownRequestListPageResponse.builder() .addData( InboundWireDrawdownRequest.builder() .id("inbound_wire_drawdown_request_u5a92ikqhz1ytphn799e") @@ -42,7 +42,7 @@ internal class InboundWireDrawdownRequestListResponseTest { .nextCursor("v57w5d") .build() - assertThat(inboundWireDrawdownRequestListResponse.data()) + assertThat(inboundWireDrawdownRequestListPageResponse.data()) .containsExactly( InboundWireDrawdownRequest.builder() .id("inbound_wire_drawdown_request_u5a92ikqhz1ytphn799e") @@ -68,14 +68,14 @@ internal class InboundWireDrawdownRequestListResponseTest { .unstructuredRemittanceInformation(null) .build() ) - assertThat(inboundWireDrawdownRequestListResponse.nextCursor()).contains("v57w5d") + assertThat(inboundWireDrawdownRequestListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val inboundWireDrawdownRequestListResponse = - InboundWireDrawdownRequestListResponse.builder() + val inboundWireDrawdownRequestListPageResponse = + InboundWireDrawdownRequestListPageResponse.builder() .addData( InboundWireDrawdownRequest.builder() .id("inbound_wire_drawdown_request_u5a92ikqhz1ytphn799e") @@ -104,13 +104,13 @@ internal class InboundWireDrawdownRequestListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedInboundWireDrawdownRequestListResponse = + val roundtrippedInboundWireDrawdownRequestListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(inboundWireDrawdownRequestListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(inboundWireDrawdownRequestListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedInboundWireDrawdownRequestListResponse) - .isEqualTo(inboundWireDrawdownRequestListResponse) + assertThat(roundtrippedInboundWireDrawdownRequestListPageResponse) + .isEqualTo(inboundWireDrawdownRequestListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPageResponseTest.kt similarity index 89% rename from increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPageResponseTest.kt index 83986ab46..384936e4e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundwiretransfers/InboundWireTransferListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class InboundWireTransferListResponseTest { +internal class InboundWireTransferListPageResponseTest { @Test fun create() { - val inboundWireTransferListResponse = - InboundWireTransferListResponse.builder() + val inboundWireTransferListPageResponse = + InboundWireTransferListPageResponse.builder() .addData( InboundWireTransfer.builder() .id("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") @@ -50,7 +50,7 @@ internal class InboundWireTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(inboundWireTransferListResponse.data()) + assertThat(inboundWireTransferListPageResponse.data()) .containsExactly( InboundWireTransfer.builder() .id("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") @@ -84,14 +84,14 @@ internal class InboundWireTransferListResponseTest { .wireDrawdownRequestId(null) .build() ) - assertThat(inboundWireTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(inboundWireTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val inboundWireTransferListResponse = - InboundWireTransferListResponse.builder() + val inboundWireTransferListPageResponse = + InboundWireTransferListPageResponse.builder() .addData( InboundWireTransfer.builder() .id("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") @@ -128,13 +128,13 @@ internal class InboundWireTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedInboundWireTransferListResponse = + val roundtrippedInboundWireTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(inboundWireTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(inboundWireTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedInboundWireTransferListResponse) - .isEqualTo(inboundWireTransferListResponse) + assertThat(roundtrippedInboundWireTransferListPageResponse) + .isEqualTo(inboundWireTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPageResponseTest.kt similarity index 77% rename from increase-java-core/src/test/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPageResponseTest.kt index cd2a5e71f..0f1859214 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/intrafiaccountenrollments/IntrafiAccountEnrollmentListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class IntrafiAccountEnrollmentListResponseTest { +internal class IntrafiAccountEnrollmentListPageResponseTest { @Test fun create() { - val intrafiAccountEnrollmentListResponse = - IntrafiAccountEnrollmentListResponse.builder() + val intrafiAccountEnrollmentListPageResponse = + IntrafiAccountEnrollmentListPageResponse.builder() .addData( IntrafiAccountEnrollment.builder() .id("intrafi_account_enrollment_w8l97znzreopkwf2tg75") @@ -29,7 +29,7 @@ internal class IntrafiAccountEnrollmentListResponseTest { .nextCursor("v57w5d") .build() - assertThat(intrafiAccountEnrollmentListResponse.data()) + assertThat(intrafiAccountEnrollmentListPageResponse.data()) .containsExactly( IntrafiAccountEnrollment.builder() .id("intrafi_account_enrollment_w8l97znzreopkwf2tg75") @@ -42,14 +42,14 @@ internal class IntrafiAccountEnrollmentListResponseTest { .type(IntrafiAccountEnrollment.Type.INTRAFI_ACCOUNT_ENROLLMENT) .build() ) - assertThat(intrafiAccountEnrollmentListResponse.nextCursor()).contains("v57w5d") + assertThat(intrafiAccountEnrollmentListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val intrafiAccountEnrollmentListResponse = - IntrafiAccountEnrollmentListResponse.builder() + val intrafiAccountEnrollmentListPageResponse = + IntrafiAccountEnrollmentListPageResponse.builder() .addData( IntrafiAccountEnrollment.builder() .id("intrafi_account_enrollment_w8l97znzreopkwf2tg75") @@ -65,13 +65,13 @@ internal class IntrafiAccountEnrollmentListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedIntrafiAccountEnrollmentListResponse = + val roundtrippedIntrafiAccountEnrollmentListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(intrafiAccountEnrollmentListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(intrafiAccountEnrollmentListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedIntrafiAccountEnrollmentListResponse) - .isEqualTo(intrafiAccountEnrollmentListResponse) + assertThat(roundtrippedIntrafiAccountEnrollmentListPageResponse) + .isEqualTo(intrafiAccountEnrollmentListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPageResponseTest.kt similarity index 81% rename from increase-java-core/src/test/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPageResponseTest.kt index 58d41a986..abd005a92 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/intrafiexclusions/IntrafiExclusionListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class IntrafiExclusionListResponseTest { +internal class IntrafiExclusionListPageResponseTest { @Test fun create() { - val intrafiExclusionListResponse = - IntrafiExclusionListResponse.builder() + val intrafiExclusionListPageResponse = + IntrafiExclusionListPageResponse.builder() .addData( IntrafiExclusion.builder() .id("intrafi_exclusion_ygfqduuzpau3jqof6jyh") @@ -31,7 +31,7 @@ internal class IntrafiExclusionListResponseTest { .nextCursor("v57w5d") .build() - assertThat(intrafiExclusionListResponse.data()) + assertThat(intrafiExclusionListPageResponse.data()) .containsExactly( IntrafiExclusion.builder() .id("intrafi_exclusion_ygfqduuzpau3jqof6jyh") @@ -46,14 +46,14 @@ internal class IntrafiExclusionListResponseTest { .type(IntrafiExclusion.Type.INTRAFI_EXCLUSION) .build() ) - assertThat(intrafiExclusionListResponse.nextCursor()).contains("v57w5d") + assertThat(intrafiExclusionListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val intrafiExclusionListResponse = - IntrafiExclusionListResponse.builder() + val intrafiExclusionListPageResponse = + IntrafiExclusionListPageResponse.builder() .addData( IntrafiExclusion.builder() .id("intrafi_exclusion_ygfqduuzpau3jqof6jyh") @@ -71,12 +71,13 @@ internal class IntrafiExclusionListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedIntrafiExclusionListResponse = + val roundtrippedIntrafiExclusionListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(intrafiExclusionListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(intrafiExclusionListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedIntrafiExclusionListResponse).isEqualTo(intrafiExclusionListResponse) + assertThat(roundtrippedIntrafiExclusionListPageResponse) + .isEqualTo(intrafiExclusionListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponseTest.kt similarity index 86% rename from increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponseTest.kt index 36a82346f..10f673ed9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/lockboxes/LockboxListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class LockboxListResponseTest { +internal class LockboxListPageResponseTest { @Test fun create() { - val lockboxListResponse = - LockboxListResponse.builder() + val lockboxListPageResponse = + LockboxListPageResponse.builder() .addData( Lockbox.builder() .id("lockbox_3xt21ok13q19advds4t5") @@ -39,7 +39,7 @@ internal class LockboxListResponseTest { .nextCursor("v57w5d") .build() - assertThat(lockboxListResponse.data()) + assertThat(lockboxListPageResponse.data()) .containsExactly( Lockbox.builder() .id("lockbox_3xt21ok13q19advds4t5") @@ -62,14 +62,14 @@ internal class LockboxListResponseTest { .type(Lockbox.Type.LOCKBOX) .build() ) - assertThat(lockboxListResponse.nextCursor()).contains("v57w5d") + assertThat(lockboxListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val lockboxListResponse = - LockboxListResponse.builder() + val lockboxListPageResponse = + LockboxListPageResponse.builder() .addData( Lockbox.builder() .id("lockbox_3xt21ok13q19advds4t5") @@ -95,12 +95,12 @@ internal class LockboxListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedLockboxListResponse = + val roundtrippedLockboxListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(lockboxListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(lockboxListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedLockboxListResponse).isEqualTo(lockboxListResponse) + assertThat(roundtrippedLockboxListPageResponse).isEqualTo(lockboxListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPageResponseTest.kt similarity index 77% rename from increase-java-core/src/test/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPageResponseTest.kt index 6c184f57f..c58fadad5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/oauthapplications/OAuthApplicationListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class OAuthApplicationListResponseTest { +internal class OAuthApplicationListPageResponseTest { @Test fun create() { - val oauthApplicationListResponse = - OAuthApplicationListResponse.builder() + val oauthApplicationListPageResponse = + OAuthApplicationListPageResponse.builder() .addData( OAuthApplication.builder() .id("application_gj9ufmpgh5i56k4vyriy") @@ -28,7 +28,7 @@ internal class OAuthApplicationListResponseTest { .nextCursor("v57w5d") .build() - assertThat(oauthApplicationListResponse.data()) + assertThat(oauthApplicationListPageResponse.data()) .containsExactly( OAuthApplication.builder() .id("application_gj9ufmpgh5i56k4vyriy") @@ -40,14 +40,14 @@ internal class OAuthApplicationListResponseTest { .type(OAuthApplication.Type.OAUTH_APPLICATION) .build() ) - assertThat(oauthApplicationListResponse.nextCursor()).contains("v57w5d") + assertThat(oauthApplicationListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val oauthApplicationListResponse = - OAuthApplicationListResponse.builder() + val oauthApplicationListPageResponse = + OAuthApplicationListPageResponse.builder() .addData( OAuthApplication.builder() .id("application_gj9ufmpgh5i56k4vyriy") @@ -62,12 +62,13 @@ internal class OAuthApplicationListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedOAuthApplicationListResponse = + val roundtrippedOAuthApplicationListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(oauthApplicationListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(oauthApplicationListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedOAuthApplicationListResponse).isEqualTo(oauthApplicationListResponse) + assertThat(roundtrippedOAuthApplicationListPageResponse) + .isEqualTo(oauthApplicationListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPageResponseTest.kt similarity index 78% rename from increase-java-core/src/test/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPageResponseTest.kt index 3c7a23816..7d2363491 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/oauthconnections/OAuthConnectionListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class OAuthConnectionListResponseTest { +internal class OAuthConnectionListPageResponseTest { @Test fun create() { - val oauthConnectionListResponse = - OAuthConnectionListResponse.builder() + val oauthConnectionListPageResponse = + OAuthConnectionListPageResponse.builder() .addData( OAuthConnection.builder() .id("connection_dauknoksyr4wilz4e6my") @@ -28,7 +28,7 @@ internal class OAuthConnectionListResponseTest { .nextCursor("v57w5d") .build() - assertThat(oauthConnectionListResponse.data()) + assertThat(oauthConnectionListPageResponse.data()) .containsExactly( OAuthConnection.builder() .id("connection_dauknoksyr4wilz4e6my") @@ -40,14 +40,14 @@ internal class OAuthConnectionListResponseTest { .type(OAuthConnection.Type.OAUTH_CONNECTION) .build() ) - assertThat(oauthConnectionListResponse.nextCursor()).contains("v57w5d") + assertThat(oauthConnectionListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val oauthConnectionListResponse = - OAuthConnectionListResponse.builder() + val oauthConnectionListPageResponse = + OAuthConnectionListPageResponse.builder() .addData( OAuthConnection.builder() .id("connection_dauknoksyr4wilz4e6my") @@ -62,12 +62,13 @@ internal class OAuthConnectionListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedOAuthConnectionListResponse = + val roundtrippedOAuthConnectionListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(oauthConnectionListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(oauthConnectionListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedOAuthConnectionListResponse).isEqualTo(oauthConnectionListResponse) + assertThat(roundtrippedOAuthConnectionListPageResponse) + .isEqualTo(oauthConnectionListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt similarity index 99% rename from increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt index 7dd05bbff..3cdb94983 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt @@ -9,12 +9,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class PendingTransactionListResponseTest { +internal class PendingTransactionListPageResponseTest { @Test fun create() { - val pendingTransactionListResponse = - PendingTransactionListResponse.builder() + val pendingTransactionListPageResponse = + PendingTransactionListPageResponse.builder() .addData( PendingTransaction.builder() .id("pending_transaction_k1sfetcau2qbvjbzgju4") @@ -386,7 +386,7 @@ internal class PendingTransactionListResponseTest { .nextCursor("v57w5d") .build() - assertThat(pendingTransactionListResponse.data()) + assertThat(pendingTransactionListPageResponse.data()) .containsExactly( PendingTransaction.builder() .id("pending_transaction_k1sfetcau2qbvjbzgju4") @@ -740,14 +740,14 @@ internal class PendingTransactionListResponseTest { .type(PendingTransaction.Type.PENDING_TRANSACTION) .build() ) - assertThat(pendingTransactionListResponse.nextCursor()).contains("v57w5d") + assertThat(pendingTransactionListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val pendingTransactionListResponse = - PendingTransactionListResponse.builder() + val pendingTransactionListPageResponse = + PendingTransactionListPageResponse.builder() .addData( PendingTransaction.builder() .id("pending_transaction_k1sfetcau2qbvjbzgju4") @@ -1119,13 +1119,13 @@ internal class PendingTransactionListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedPendingTransactionListResponse = + val roundtrippedPendingTransactionListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(pendingTransactionListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(pendingTransactionListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedPendingTransactionListResponse) - .isEqualTo(pendingTransactionListResponse) + assertThat(roundtrippedPendingTransactionListPageResponse) + .isEqualTo(pendingTransactionListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPageResponseTest.kt similarity index 83% rename from increase-java-core/src/test/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPageResponseTest.kt index a8b6d77c7..9d22f9d7b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/physicalcardprofiles/PhysicalCardProfileListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class PhysicalCardProfileListResponseTest { +internal class PhysicalCardProfileListPageResponseTest { @Test fun create() { - val physicalCardProfileListResponse = - PhysicalCardProfileListResponse.builder() + val physicalCardProfileListPageResponse = + PhysicalCardProfileListPageResponse.builder() .addData( PhysicalCardProfile.builder() .id("physical_card_profile_m534d5rn9qyy9ufqxoec") @@ -34,7 +34,7 @@ internal class PhysicalCardProfileListResponseTest { .nextCursor("v57w5d") .build() - assertThat(physicalCardProfileListResponse.data()) + assertThat(physicalCardProfileListPageResponse.data()) .containsExactly( PhysicalCardProfile.builder() .id("physical_card_profile_m534d5rn9qyy9ufqxoec") @@ -52,14 +52,14 @@ internal class PhysicalCardProfileListResponseTest { .type(PhysicalCardProfile.Type.PHYSICAL_CARD_PROFILE) .build() ) - assertThat(physicalCardProfileListResponse.nextCursor()).contains("v57w5d") + assertThat(physicalCardProfileListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val physicalCardProfileListResponse = - PhysicalCardProfileListResponse.builder() + val physicalCardProfileListPageResponse = + PhysicalCardProfileListPageResponse.builder() .addData( PhysicalCardProfile.builder() .id("physical_card_profile_m534d5rn9qyy9ufqxoec") @@ -80,13 +80,13 @@ internal class PhysicalCardProfileListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedPhysicalCardProfileListResponse = + val roundtrippedPhysicalCardProfileListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(physicalCardProfileListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(physicalCardProfileListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedPhysicalCardProfileListResponse) - .isEqualTo(physicalCardProfileListResponse) + assertThat(roundtrippedPhysicalCardProfileListPageResponse) + .isEqualTo(physicalCardProfileListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/physicalcards/PhysicalCardListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPageResponseTest.kt similarity index 93% rename from increase-java-core/src/test/kotlin/com/increase/api/models/physicalcards/PhysicalCardListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPageResponseTest.kt index 6aba81d17..4724449d3 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/physicalcards/PhysicalCardListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/physicalcards/PhysicalCardListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class PhysicalCardListResponseTest { +internal class PhysicalCardListPageResponseTest { @Test fun create() { - val physicalCardListResponse = - PhysicalCardListResponse.builder() + val physicalCardListPageResponse = + PhysicalCardListPageResponse.builder() .addData( PhysicalCard.builder() .id("physical_card_ode8duyq5v2ynhjoharl") @@ -76,7 +76,7 @@ internal class PhysicalCardListResponseTest { .nextCursor("v57w5d") .build() - assertThat(physicalCardListResponse.data()) + assertThat(physicalCardListPageResponse.data()) .containsExactly( PhysicalCard.builder() .id("physical_card_ode8duyq5v2ynhjoharl") @@ -134,14 +134,14 @@ internal class PhysicalCardListResponseTest { .type(PhysicalCard.Type.PHYSICAL_CARD) .build() ) - assertThat(physicalCardListResponse.nextCursor()).contains("v57w5d") + assertThat(physicalCardListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val physicalCardListResponse = - PhysicalCardListResponse.builder() + val physicalCardListPageResponse = + PhysicalCardListPageResponse.builder() .addData( PhysicalCard.builder() .id("physical_card_ode8duyq5v2ynhjoharl") @@ -204,12 +204,12 @@ internal class PhysicalCardListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedPhysicalCardListResponse = + val roundtrippedPhysicalCardListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(physicalCardListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(physicalCardListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedPhysicalCardListResponse).isEqualTo(physicalCardListResponse) + assertThat(roundtrippedPhysicalCardListPageResponse).isEqualTo(physicalCardListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/programs/ProgramListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/programs/ProgramListPageResponseTest.kt similarity index 80% rename from increase-java-core/src/test/kotlin/com/increase/api/models/programs/ProgramListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/programs/ProgramListPageResponseTest.kt index 2536d3eb6..6f1391854 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/programs/ProgramListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/programs/ProgramListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class ProgramListResponseTest { +internal class ProgramListPageResponseTest { @Test fun create() { - val programListResponse = - ProgramListResponse.builder() + val programListPageResponse = + ProgramListPageResponse.builder() .addData( Program.builder() .id("program_i2v2os4mwza1oetokh9i") @@ -30,7 +30,7 @@ internal class ProgramListResponseTest { .nextCursor("v57w5d") .build() - assertThat(programListResponse.data()) + assertThat(programListPageResponse.data()) .containsExactly( Program.builder() .id("program_i2v2os4mwza1oetokh9i") @@ -44,14 +44,14 @@ internal class ProgramListResponseTest { .updatedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .build() ) - assertThat(programListResponse.nextCursor()).contains("v57w5d") + assertThat(programListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val programListResponse = - ProgramListResponse.builder() + val programListPageResponse = + ProgramListPageResponse.builder() .addData( Program.builder() .id("program_i2v2os4mwza1oetokh9i") @@ -68,12 +68,12 @@ internal class ProgramListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedProgramListResponse = + val roundtrippedProgramListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(programListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(programListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedProgramListResponse).isEqualTo(programListResponse) + assertThat(roundtrippedProgramListPageResponse).isEqualTo(programListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageResponseTest.kt similarity index 94% rename from increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageResponseTest.kt index a4481e58c..ceea65faf 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimepaymentstransfers/RealTimePaymentsTransferListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class RealTimePaymentsTransferListResponseTest { +internal class RealTimePaymentsTransferListPageResponseTest { @Test fun create() { - val realTimePaymentsTransferListResponse = - RealTimePaymentsTransferListResponse.builder() + val realTimePaymentsTransferListPageResponse = + RealTimePaymentsTransferListPageResponse.builder() .addData( RealTimePaymentsTransfer.builder() .id("real_time_payments_transfer_iyuhl5kdn7ssmup83mvq") @@ -93,7 +93,7 @@ internal class RealTimePaymentsTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(realTimePaymentsTransferListResponse.data()) + assertThat(realTimePaymentsTransferListPageResponse.data()) .containsExactly( RealTimePaymentsTransfer.builder() .id("real_time_payments_transfer_iyuhl5kdn7ssmup83mvq") @@ -169,14 +169,14 @@ internal class RealTimePaymentsTransferListResponseTest { .ultimateDebtorName(null) .build() ) - assertThat(realTimePaymentsTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(realTimePaymentsTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val realTimePaymentsTransferListResponse = - RealTimePaymentsTransferListResponse.builder() + val realTimePaymentsTransferListPageResponse = + RealTimePaymentsTransferListPageResponse.builder() .addData( RealTimePaymentsTransfer.builder() .id("real_time_payments_transfer_iyuhl5kdn7ssmup83mvq") @@ -256,13 +256,13 @@ internal class RealTimePaymentsTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedRealTimePaymentsTransferListResponse = + val roundtrippedRealTimePaymentsTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(realTimePaymentsTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(realTimePaymentsTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedRealTimePaymentsTransferListResponse) - .isEqualTo(realTimePaymentsTransferListResponse) + assertThat(roundtrippedRealTimePaymentsTransferListPageResponse) + .isEqualTo(realTimePaymentsTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPageResponseTest.kt new file mode 100644 index 000000000..22f3d3bd3 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListPageResponseTest.kt @@ -0,0 +1,79 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.routingnumbers + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.increase.api.core.jsonMapper +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class RoutingNumberListPageResponseTest { + + @Test + fun create() { + val routingNumberListPageResponse = + RoutingNumberListPageResponse.builder() + .addData( + RoutingNumberListResponse.builder() + .achTransfers(RoutingNumberListResponse.AchTransfers.SUPPORTED) + .fednowTransfers(RoutingNumberListResponse.FednowTransfers.SUPPORTED) + .name("First Bank of the United States") + .realTimePaymentsTransfers( + RoutingNumberListResponse.RealTimePaymentsTransfers.SUPPORTED + ) + .routingNumber("021000021") + .type(RoutingNumberListResponse.Type.ROUTING_NUMBER) + .wireTransfers(RoutingNumberListResponse.WireTransfers.SUPPORTED) + .build() + ) + .nextCursor("v57w5d") + .build() + + assertThat(routingNumberListPageResponse.data()) + .containsExactly( + RoutingNumberListResponse.builder() + .achTransfers(RoutingNumberListResponse.AchTransfers.SUPPORTED) + .fednowTransfers(RoutingNumberListResponse.FednowTransfers.SUPPORTED) + .name("First Bank of the United States") + .realTimePaymentsTransfers( + RoutingNumberListResponse.RealTimePaymentsTransfers.SUPPORTED + ) + .routingNumber("021000021") + .type(RoutingNumberListResponse.Type.ROUTING_NUMBER) + .wireTransfers(RoutingNumberListResponse.WireTransfers.SUPPORTED) + .build() + ) + assertThat(routingNumberListPageResponse.nextCursor()).contains("v57w5d") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val routingNumberListPageResponse = + RoutingNumberListPageResponse.builder() + .addData( + RoutingNumberListResponse.builder() + .achTransfers(RoutingNumberListResponse.AchTransfers.SUPPORTED) + .fednowTransfers(RoutingNumberListResponse.FednowTransfers.SUPPORTED) + .name("First Bank of the United States") + .realTimePaymentsTransfers( + RoutingNumberListResponse.RealTimePaymentsTransfers.SUPPORTED + ) + .routingNumber("021000021") + .type(RoutingNumberListResponse.Type.ROUTING_NUMBER) + .wireTransfers(RoutingNumberListResponse.WireTransfers.SUPPORTED) + .build() + ) + .nextCursor("v57w5d") + .build() + + val roundtrippedRoutingNumberListPageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(routingNumberListPageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedRoutingNumberListPageResponse) + .isEqualTo(routingNumberListPageResponse) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListResponseTest.kt index 1bf3a2b88..154ff33ff 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/routingnumbers/RoutingNumberListResponseTest.kt @@ -13,37 +13,29 @@ internal class RoutingNumberListResponseTest { fun create() { val routingNumberListResponse = RoutingNumberListResponse.builder() - .addData( - RoutingNumberListResponse.Data.builder() - .achTransfers(RoutingNumberListResponse.Data.AchTransfers.SUPPORTED) - .fednowTransfers(RoutingNumberListResponse.Data.FednowTransfers.SUPPORTED) - .name("First Bank of the United States") - .realTimePaymentsTransfers( - RoutingNumberListResponse.Data.RealTimePaymentsTransfers.SUPPORTED - ) - .routingNumber("021000021") - .type(RoutingNumberListResponse.Data.Type.ROUTING_NUMBER) - .wireTransfers(RoutingNumberListResponse.Data.WireTransfers.SUPPORTED) - .build() + .achTransfers(RoutingNumberListResponse.AchTransfers.SUPPORTED) + .fednowTransfers(RoutingNumberListResponse.FednowTransfers.SUPPORTED) + .name("First Bank of the United States") + .realTimePaymentsTransfers( + RoutingNumberListResponse.RealTimePaymentsTransfers.SUPPORTED ) - .nextCursor("v57w5d") + .routingNumber("021000021") + .type(RoutingNumberListResponse.Type.ROUTING_NUMBER) + .wireTransfers(RoutingNumberListResponse.WireTransfers.SUPPORTED) .build() - assertThat(routingNumberListResponse.data()) - .containsExactly( - RoutingNumberListResponse.Data.builder() - .achTransfers(RoutingNumberListResponse.Data.AchTransfers.SUPPORTED) - .fednowTransfers(RoutingNumberListResponse.Data.FednowTransfers.SUPPORTED) - .name("First Bank of the United States") - .realTimePaymentsTransfers( - RoutingNumberListResponse.Data.RealTimePaymentsTransfers.SUPPORTED - ) - .routingNumber("021000021") - .type(RoutingNumberListResponse.Data.Type.ROUTING_NUMBER) - .wireTransfers(RoutingNumberListResponse.Data.WireTransfers.SUPPORTED) - .build() - ) - assertThat(routingNumberListResponse.nextCursor()).contains("v57w5d") + assertThat(routingNumberListResponse.achTransfers()) + .isEqualTo(RoutingNumberListResponse.AchTransfers.SUPPORTED) + assertThat(routingNumberListResponse.fednowTransfers()) + .isEqualTo(RoutingNumberListResponse.FednowTransfers.SUPPORTED) + assertThat(routingNumberListResponse.name()).isEqualTo("First Bank of the United States") + assertThat(routingNumberListResponse.realTimePaymentsTransfers()) + .isEqualTo(RoutingNumberListResponse.RealTimePaymentsTransfers.SUPPORTED) + assertThat(routingNumberListResponse.routingNumber()).isEqualTo("021000021") + assertThat(routingNumberListResponse.type()) + .isEqualTo(RoutingNumberListResponse.Type.ROUTING_NUMBER) + assertThat(routingNumberListResponse.wireTransfers()) + .isEqualTo(RoutingNumberListResponse.WireTransfers.SUPPORTED) } @Test @@ -51,20 +43,15 @@ internal class RoutingNumberListResponseTest { val jsonMapper = jsonMapper() val routingNumberListResponse = RoutingNumberListResponse.builder() - .addData( - RoutingNumberListResponse.Data.builder() - .achTransfers(RoutingNumberListResponse.Data.AchTransfers.SUPPORTED) - .fednowTransfers(RoutingNumberListResponse.Data.FednowTransfers.SUPPORTED) - .name("First Bank of the United States") - .realTimePaymentsTransfers( - RoutingNumberListResponse.Data.RealTimePaymentsTransfers.SUPPORTED - ) - .routingNumber("021000021") - .type(RoutingNumberListResponse.Data.Type.ROUTING_NUMBER) - .wireTransfers(RoutingNumberListResponse.Data.WireTransfers.SUPPORTED) - .build() + .achTransfers(RoutingNumberListResponse.AchTransfers.SUPPORTED) + .fednowTransfers(RoutingNumberListResponse.FednowTransfers.SUPPORTED) + .name("First Bank of the United States") + .realTimePaymentsTransfers( + RoutingNumberListResponse.RealTimePaymentsTransfers.SUPPORTED ) - .nextCursor("v57w5d") + .routingNumber("021000021") + .type(RoutingNumberListResponse.Type.ROUTING_NUMBER) + .wireTransfers(RoutingNumberListResponse.WireTransfers.SUPPORTED) .build() val roundtrippedRoutingNumberListResponse = diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPageResponseTest.kt similarity index 74% rename from increase-java-core/src/test/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPageResponseTest.kt index fef9f3dbb..dd24c41aa 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/supplementaldocuments/SupplementalDocumentListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class SupplementalDocumentListResponseTest { +internal class SupplementalDocumentListPageResponseTest { @Test fun create() { - val supplementalDocumentListResponse = - SupplementalDocumentListResponse.builder() + val supplementalDocumentListPageResponse = + SupplementalDocumentListPageResponse.builder() .addData( EntitySupplementalDocument.builder() .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -26,7 +26,7 @@ internal class SupplementalDocumentListResponseTest { .nextCursor("v57w5d") .build() - assertThat(supplementalDocumentListResponse.data()) + assertThat(supplementalDocumentListPageResponse.data()) .containsExactly( EntitySupplementalDocument.builder() .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -36,14 +36,14 @@ internal class SupplementalDocumentListResponseTest { .type(EntitySupplementalDocument.Type.ENTITY_SUPPLEMENTAL_DOCUMENT) .build() ) - assertThat(supplementalDocumentListResponse.nextCursor()).contains("v57w5d") + assertThat(supplementalDocumentListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val supplementalDocumentListResponse = - SupplementalDocumentListResponse.builder() + val supplementalDocumentListPageResponse = + SupplementalDocumentListPageResponse.builder() .addData( EntitySupplementalDocument.builder() .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -56,13 +56,13 @@ internal class SupplementalDocumentListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedSupplementalDocumentListResponse = + val roundtrippedSupplementalDocumentListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(supplementalDocumentListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(supplementalDocumentListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedSupplementalDocumentListResponse) - .isEqualTo(supplementalDocumentListResponse) + assertThat(roundtrippedSupplementalDocumentListPageResponse) + .isEqualTo(supplementalDocumentListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt similarity index 99% rename from increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt index a9f93690a..24860bbc4 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt @@ -9,12 +9,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class TransactionListResponseTest { +internal class TransactionListPageResponseTest { @Test fun create() { - val transactionListResponse = - TransactionListResponse.builder() + val transactionListPageResponse = + TransactionListPageResponse.builder() .addData( Transaction.builder() .id("transaction_uyrp7fld2ium70oa7oi") @@ -1136,7 +1136,7 @@ internal class TransactionListResponseTest { .nextCursor("v57w5d") .build() - assertThat(transactionListResponse.data()) + assertThat(transactionListPageResponse.data()) .containsExactly( Transaction.builder() .id("transaction_uyrp7fld2ium70oa7oi") @@ -2186,14 +2186,14 @@ internal class TransactionListResponseTest { .type(Transaction.Type.TRANSACTION) .build() ) - assertThat(transactionListResponse.nextCursor()).contains("v57w5d") + assertThat(transactionListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val transactionListResponse = - TransactionListResponse.builder() + val transactionListPageResponse = + TransactionListPageResponse.builder() .addData( Transaction.builder() .id("transaction_uyrp7fld2ium70oa7oi") @@ -3315,12 +3315,12 @@ internal class TransactionListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedTransactionListResponse = + val roundtrippedTransactionListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(transactionListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(transactionListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedTransactionListResponse).isEqualTo(transactionListResponse) + assertThat(roundtrippedTransactionListPageResponse).isEqualTo(transactionListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPageResponseTest.kt similarity index 91% rename from increase-java-core/src/test/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPageResponseTest.kt index 23a3825a0..3d542a228 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/wiredrawdownrequests/WireDrawdownRequestListPageResponseTest.kt @@ -8,12 +8,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class WireDrawdownRequestListResponseTest { +internal class WireDrawdownRequestListPageResponseTest { @Test fun create() { - val wireDrawdownRequestListResponse = - WireDrawdownRequestListResponse.builder() + val wireDrawdownRequestListPageResponse = + WireDrawdownRequestListPageResponse.builder() .addData( WireDrawdownRequest.builder() .id("wire_drawdown_request_q6lmocus3glo0lr2bfv3") @@ -63,7 +63,7 @@ internal class WireDrawdownRequestListResponseTest { .nextCursor("v57w5d") .build() - assertThat(wireDrawdownRequestListResponse.data()) + assertThat(wireDrawdownRequestListPageResponse.data()) .containsExactly( WireDrawdownRequest.builder() .id("wire_drawdown_request_q6lmocus3glo0lr2bfv3") @@ -108,14 +108,14 @@ internal class WireDrawdownRequestListResponseTest { .unstructuredRemittanceInformation("Invoice 29582") .build() ) - assertThat(wireDrawdownRequestListResponse.nextCursor()).contains("v57w5d") + assertThat(wireDrawdownRequestListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val wireDrawdownRequestListResponse = - WireDrawdownRequestListResponse.builder() + val wireDrawdownRequestListPageResponse = + WireDrawdownRequestListPageResponse.builder() .addData( WireDrawdownRequest.builder() .id("wire_drawdown_request_q6lmocus3glo0lr2bfv3") @@ -165,13 +165,13 @@ internal class WireDrawdownRequestListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedWireDrawdownRequestListResponse = + val roundtrippedWireDrawdownRequestListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(wireDrawdownRequestListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(wireDrawdownRequestListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedWireDrawdownRequestListResponse) - .isEqualTo(wireDrawdownRequestListResponse) + assertThat(roundtrippedWireDrawdownRequestListPageResponse) + .isEqualTo(wireDrawdownRequestListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt similarity index 96% rename from increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListResponseTest.kt rename to increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt index 8b32d4494..25e92a0da 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt @@ -9,12 +9,12 @@ import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test -internal class WireTransferListResponseTest { +internal class WireTransferListPageResponseTest { @Test fun create() { - val wireTransferListResponse = - WireTransferListResponse.builder() + val wireTransferListPageResponse = + WireTransferListPageResponse.builder() .addData( WireTransfer.builder() .id("wire_transfer_5akynk7dqsq25qwk9q2u") @@ -143,7 +143,7 @@ internal class WireTransferListResponseTest { .nextCursor("v57w5d") .build() - assertThat(wireTransferListResponse.data()) + assertThat(wireTransferListPageResponse.data()) .containsExactly( WireTransfer.builder() .id("wire_transfer_5akynk7dqsq25qwk9q2u") @@ -269,14 +269,14 @@ internal class WireTransferListResponseTest { .type(WireTransfer.Type.WIRE_TRANSFER) .build() ) - assertThat(wireTransferListResponse.nextCursor()).contains("v57w5d") + assertThat(wireTransferListPageResponse.nextCursor()).contains("v57w5d") } @Test fun roundtrip() { val jsonMapper = jsonMapper() - val wireTransferListResponse = - WireTransferListResponse.builder() + val wireTransferListPageResponse = + WireTransferListPageResponse.builder() .addData( WireTransfer.builder() .id("wire_transfer_5akynk7dqsq25qwk9q2u") @@ -405,12 +405,12 @@ internal class WireTransferListResponseTest { .nextCursor("v57w5d") .build() - val roundtrippedWireTransferListResponse = + val roundtrippedWireTransferListPageResponse = jsonMapper.readValue( - jsonMapper.writeValueAsString(wireTransferListResponse), - jacksonTypeRef(), + jsonMapper.writeValueAsString(wireTransferListPageResponse), + jacksonTypeRef(), ) - assertThat(roundtrippedWireTransferListResponse).isEqualTo(wireTransferListResponse) + assertThat(roundtrippedWireTransferListPageResponse).isEqualTo(wireTransferListPageResponse) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountNumberServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountNumberServiceAsyncTest.kt index 59ae52bd6..500c4ca2c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountNumberServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountNumberServiceAsyncTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.accountnumbers.AccountNumberCreateParams -import com.increase.api.models.accountnumbers.AccountNumberListParams import com.increase.api.models.accountnumbers.AccountNumberUpdateParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -102,35 +100,9 @@ internal class AccountNumberServiceAsyncTest { .build() val accountNumberServiceAsync = client.accountNumbers() - val accountNumbersFuture = - accountNumberServiceAsync.list( - AccountNumberListParams.builder() - .accountId("account_id") - .achDebitStatus( - AccountNumberListParams.AchDebitStatus.builder() - .addIn(AccountNumberListParams.AchDebitStatus.In.ALLOWED) - .build() - ) - .createdAt( - AccountNumberListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - AccountNumberListParams.Status.builder() - .addIn(AccountNumberListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) + val pageFuture = accountNumberServiceAsync.list() - val accountNumbers = accountNumbersFuture.get() - accountNumbers.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountServiceAsyncTest.kt index 95d4fb12d..0483ee5a1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountServiceAsyncTest.kt @@ -6,7 +6,6 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.accounts.AccountBalanceParams import com.increase.api.models.accounts.AccountCreateParams -import com.increase.api.models.accounts.AccountListParams import com.increase.api.models.accounts.AccountUpdateParams import java.time.OffsetDateTime import org.junit.jupiter.api.Test @@ -84,33 +83,10 @@ internal class AccountServiceAsyncTest { .build() val accountServiceAsync = client.accounts() - val accountsFuture = - accountServiceAsync.list( - AccountListParams.builder() - .createdAt( - AccountListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .entityId("entity_id") - .idempotencyKey("x") - .informationalEntityId("informational_entity_id") - .limit(1L) - .programId("program_id") - .status( - AccountListParams.Status.builder() - .addIn(AccountListParams.Status.In.CLOSED) - .build() - ) - .build() - ) + val pageFuture = accountServiceAsync.list() - val accounts = accountsFuture.get() - accounts.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountStatementServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountStatementServiceAsyncTest.kt index 27e985ff7..07dcdfe06 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountStatementServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountStatementServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.accountstatements.AccountStatementListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -37,24 +35,9 @@ internal class AccountStatementServiceAsyncTest { .build() val accountStatementServiceAsync = client.accountStatements() - val accountStatementsFuture = - accountStatementServiceAsync.list( - AccountStatementListParams.builder() - .accountId("account_id") - .cursor("cursor") - .limit(1L) - .statementPeriodStart( - AccountStatementListParams.StatementPeriodStart.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .build() - ) - - val accountStatements = accountStatementsFuture.get() - accountStatements.validate() + val pageFuture = accountStatementServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountTransferServiceAsyncTest.kt index bed94fc2d..f7dee8bb3 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AccountTransferServiceAsyncTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.accounttransfers.AccountTransferCreateParams -import com.increase.api.models.accounttransfers.AccountTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -62,26 +60,10 @@ internal class AccountTransferServiceAsyncTest { .build() val accountTransferServiceAsync = client.accountTransfers() - val accountTransfersFuture = - accountTransferServiceAsync.list( - AccountTransferListParams.builder() - .accountId("account_id") - .createdAt( - AccountTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val pageFuture = accountTransferServiceAsync.list() - val accountTransfers = accountTransfersFuture.get() - accountTransfers.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsyncTest.kt index 72273a8c4..304a98efd 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AchPrenotificationServiceAsyncTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.achprenotifications.AchPrenotificationCreateParams -import com.increase.api.models.achprenotifications.AchPrenotificationListParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -76,24 +74,9 @@ internal class AchPrenotificationServiceAsyncTest { .build() val achPrenotificationServiceAsync = client.achPrenotifications() - val achPrenotificationsFuture = - achPrenotificationServiceAsync.list( - AchPrenotificationListParams.builder() - .createdAt( - AchPrenotificationListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val pageFuture = achPrenotificationServiceAsync.list() - val achPrenotifications = achPrenotificationsFuture.get() - achPrenotifications.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AchTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AchTransferServiceAsyncTest.kt index 3f946b737..565f8c48d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/AchTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/AchTransferServiceAsyncTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.achtransfers.AchTransferCreateParams -import com.increase.api.models.achtransfers.AchTransferListParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -115,32 +113,10 @@ internal class AchTransferServiceAsyncTest { .build() val achTransferServiceAsync = client.achTransfers() - val achTransfersFuture = - achTransferServiceAsync.list( - AchTransferListParams.builder() - .accountId("account_id") - .createdAt( - AchTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .externalAccountId("external_account_id") - .idempotencyKey("x") - .limit(1L) - .status( - AchTransferListParams.Status.builder() - .addIn(AchTransferListParams.Status.In.PENDING_APPROVAL) - .build() - ) - .build() - ) + val pageFuture = achTransferServiceAsync.list() - val achTransfers = achTransfersFuture.get() - achTransfers.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsyncTest.kt index 34440875e..e3a495c5e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingAccountServiceAsyncTest.kt @@ -6,7 +6,6 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountBalanceParams import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountCreateParams -import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListParams import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountUpdateParams import java.time.OffsetDateTime import org.junit.jupiter.api.Test @@ -70,17 +69,10 @@ internal class BookkeepingAccountServiceAsyncTest { .build() val bookkeepingAccountServiceAsync = client.bookkeepingAccounts() - val bookkeepingAccountsFuture = - bookkeepingAccountServiceAsync.list( - BookkeepingAccountListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val pageFuture = bookkeepingAccountServiceAsync.list() - val bookkeepingAccounts = bookkeepingAccountsFuture.get() - bookkeepingAccounts.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsyncTest.kt index be458654a..c87285aa0 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingEntryServiceAsyncTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.bookkeepingentries.BookkeepingEntryListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -36,16 +35,9 @@ internal class BookkeepingEntryServiceAsyncTest { .build() val bookkeepingEntryServiceAsync = client.bookkeepingEntries() - val bookkeepingEntriesFuture = - bookkeepingEntryServiceAsync.list( - BookkeepingEntryListParams.builder() - .accountId("account_id") - .cursor("cursor") - .limit(1L) - .build() - ) - - val bookkeepingEntries = bookkeepingEntriesFuture.get() - bookkeepingEntries.validate() + val pageFuture = bookkeepingEntryServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsyncTest.kt index be19c5a21..488598ab1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/BookkeepingEntrySetServiceAsyncTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetCreateParams -import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListParams import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -71,17 +70,9 @@ internal class BookkeepingEntrySetServiceAsyncTest { .build() val bookkeepingEntrySetServiceAsync = client.bookkeepingEntrySets() - val bookkeepingEntrySetsFuture = - bookkeepingEntrySetServiceAsync.list( - BookkeepingEntrySetListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .transactionId("transaction_id") - .build() - ) + val pageFuture = bookkeepingEntrySetServiceAsync.list() - val bookkeepingEntrySets = bookkeepingEntrySetsFuture.get() - bookkeepingEntrySets.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt index 93a9cb2a0..274501834 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt @@ -5,10 +5,8 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.carddisputes.CardDisputeCreateParams -import com.increase.api.models.carddisputes.CardDisputeListParams import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -786,30 +784,10 @@ internal class CardDisputeServiceAsyncTest { .build() val cardDisputeServiceAsync = client.cardDisputes() - val cardDisputesFuture = - cardDisputeServiceAsync.list( - CardDisputeListParams.builder() - .createdAt( - CardDisputeListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - CardDisputeListParams.Status.builder() - .addIn(CardDisputeListParams.Status.In.USER_SUBMISSION_REQUIRED) - .build() - ) - .build() - ) + val pageFuture = cardDisputeServiceAsync.list() - val cardDisputes = cardDisputesFuture.get() - cardDisputes.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPaymentServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPaymentServiceAsyncTest.kt index 194490300..b247d9aae 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPaymentServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPaymentServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.cardpayments.CardPaymentListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -37,25 +35,9 @@ internal class CardPaymentServiceAsyncTest { .build() val cardPaymentServiceAsync = client.cardPayments() - val cardPaymentsFuture = - cardPaymentServiceAsync.list( - CardPaymentListParams.builder() - .accountId("account_id") - .cardId("card_id") - .createdAt( - CardPaymentListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) - - val cardPayments = cardPaymentsFuture.get() - cardPayments.validate() + val pageFuture = cardPaymentServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsyncTest.kt index d79385d9a..86721e6e5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPurchaseSupplementServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -39,24 +37,9 @@ internal class CardPurchaseSupplementServiceAsyncTest { .build() val cardPurchaseSupplementServiceAsync = client.cardPurchaseSupplements() - val cardPurchaseSupplementsFuture = - cardPurchaseSupplementServiceAsync.list( - CardPurchaseSupplementListParams.builder() - .cardPaymentId("card_payment_id") - .createdAt( - CardPurchaseSupplementListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) + val pageFuture = cardPurchaseSupplementServiceAsync.list() - val cardPurchaseSupplements = cardPurchaseSupplementsFuture.get() - cardPurchaseSupplements.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPushTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPushTransferServiceAsyncTest.kt index 383c97f47..376a27cf9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPushTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardPushTransferServiceAsyncTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.cardpushtransfers.CardPushTransferCreateParams -import com.increase.api.models.cardpushtransfers.CardPushTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -84,31 +82,10 @@ internal class CardPushTransferServiceAsyncTest { .build() val cardPushTransferServiceAsync = client.cardPushTransfers() - val cardPushTransfersFuture = - cardPushTransferServiceAsync.list( - CardPushTransferListParams.builder() - .accountId("account_id") - .createdAt( - CardPushTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - CardPushTransferListParams.Status.builder() - .addIn(CardPushTransferListParams.Status.In.PENDING_APPROVAL) - .build() - ) - .build() - ) + val pageFuture = cardPushTransferServiceAsync.list() - val cardPushTransfers = cardPushTransfersFuture.get() - cardPushTransfers.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt index 670a9797e..e781b600b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt @@ -6,10 +6,8 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.cards.CardCreateDetailsIframeParams import com.increase.api.models.cards.CardCreateParams -import com.increase.api.models.cards.CardListParams import com.increase.api.models.cards.CardUpdateParams import com.increase.api.models.cards.CardUpdatePinParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -117,31 +115,10 @@ internal class CardServiceAsyncTest { .build() val cardServiceAsync = client.cards() - val cardsFuture = - cardServiceAsync.list( - CardListParams.builder() - .accountId("account_id") - .createdAt( - CardListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - CardListParams.Status.builder() - .addIn(CardListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) + val pageFuture = cardServiceAsync.list() - val cards = cardsFuture.get() - cards.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardTokenServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardTokenServiceAsyncTest.kt index 6e9a525a7..63f41f4f6 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardTokenServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardTokenServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.cardtokens.CardTokenListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -37,24 +35,10 @@ internal class CardTokenServiceAsyncTest { .build() val cardTokenServiceAsync = client.cardTokens() - val cardTokensFuture = - cardTokenServiceAsync.list( - CardTokenListParams.builder() - .createdAt( - CardTokenListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) + val pageFuture = cardTokenServiceAsync.list() - val cardTokens = cardTokensFuture.get() - cardTokens.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardValidationServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardValidationServiceAsyncTest.kt index 6ff5922d9..0d70a2259 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardValidationServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardValidationServiceAsyncTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.cardvalidations.CardValidationCreateParams -import com.increase.api.models.cardvalidations.CardValidationListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -69,30 +67,9 @@ internal class CardValidationServiceAsyncTest { .build() val cardValidationServiceAsync = client.cardValidations() - val cardValidationsFuture = - cardValidationServiceAsync.list( - CardValidationListParams.builder() - .accountId("account_id") - .createdAt( - CardValidationListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - CardValidationListParams.Status.builder() - .addIn(CardValidationListParams.Status.In.REQUIRES_ATTENTION) - .build() - ) - .build() - ) + val pageFuture = cardValidationServiceAsync.list() - val cardValidations = cardValidationsFuture.get() - cardValidations.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckDepositServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckDepositServiceAsyncTest.kt index 00b401890..1ab7eb281 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckDepositServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckDepositServiceAsyncTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.checkdeposits.CheckDepositCreateParams -import com.increase.api.models.checkdeposits.CheckDepositListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -62,25 +60,9 @@ internal class CheckDepositServiceAsyncTest { .build() val checkDepositServiceAsync = client.checkDeposits() - val checkDepositsFuture = - checkDepositServiceAsync.list( - CheckDepositListParams.builder() - .accountId("account_id") - .createdAt( - CheckDepositListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val pageFuture = checkDepositServiceAsync.list() - val checkDeposits = checkDepositsFuture.get() - checkDeposits.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt index 917c9ccce..fc4c2180d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt @@ -5,10 +5,8 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.checktransfers.CheckTransferCreateParams -import com.increase.api.models.checktransfers.CheckTransferListParams import com.increase.api.models.checktransfers.CheckTransferStopPaymentParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -110,31 +108,10 @@ internal class CheckTransferServiceAsyncTest { .build() val checkTransferServiceAsync = client.checkTransfers() - val checkTransfersFuture = - checkTransferServiceAsync.list( - CheckTransferListParams.builder() - .accountId("account_id") - .createdAt( - CheckTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - CheckTransferListParams.Status.builder() - .addIn(CheckTransferListParams.Status.In.PENDING_APPROVAL) - .build() - ) - .build() - ) + val pageFuture = checkTransferServiceAsync.list() - val checkTransfers = checkTransfersFuture.get() - checkTransfers.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsyncTest.kt index 6e89de026..46bf8a54f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DeclinedTransactionServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.declinedtransactions.DeclinedTransactionListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -37,30 +35,9 @@ internal class DeclinedTransactionServiceAsyncTest { .build() val declinedTransactionServiceAsync = client.declinedTransactions() - val declinedTransactionsFuture = - declinedTransactionServiceAsync.list( - DeclinedTransactionListParams.builder() - .accountId("account_id") - .category( - DeclinedTransactionListParams.Category.builder() - .addIn(DeclinedTransactionListParams.Category.In.ACH_DECLINE) - .build() - ) - .createdAt( - DeclinedTransactionListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .routeId("route_id") - .build() - ) + val pageFuture = declinedTransactionServiceAsync.list() - val declinedTransactions = declinedTransactionsFuture.get() - declinedTransactions.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt index 33e5d8936..d3c0b122b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt @@ -6,7 +6,6 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCloneParams import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCreateParams -import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -72,22 +71,10 @@ internal class DigitalCardProfileServiceAsyncTest { .build() val digitalCardProfileServiceAsync = client.digitalCardProfiles() - val digitalCardProfilesFuture = - digitalCardProfileServiceAsync.list( - DigitalCardProfileListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - DigitalCardProfileListParams.Status.builder() - .addIn(DigitalCardProfileListParams.Status.In.PENDING) - .build() - ) - .build() - ) + val pageFuture = digitalCardProfileServiceAsync.list() - val digitalCardProfiles = digitalCardProfilesFuture.get() - digitalCardProfiles.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsyncTest.kt index 243318985..2e37edb84 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalWalletTokenServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -37,24 +35,9 @@ internal class DigitalWalletTokenServiceAsyncTest { .build() val digitalWalletTokenServiceAsync = client.digitalWalletTokens() - val digitalWalletTokensFuture = - digitalWalletTokenServiceAsync.list( - DigitalWalletTokenListParams.builder() - .cardId("card_id") - .createdAt( - DigitalWalletTokenListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) - - val digitalWalletTokens = digitalWalletTokensFuture.get() - digitalWalletTokens.validate() + val pageFuture = digitalWalletTokenServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DocumentServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DocumentServiceAsyncTest.kt index c54d40d97..fe7058967 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DocumentServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DocumentServiceAsyncTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.documents.DocumentCreateParams -import com.increase.api.models.documents.DocumentListParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -69,30 +67,9 @@ internal class DocumentServiceAsyncTest { .build() val documentServiceAsync = client.documents() - val documentsFuture = - documentServiceAsync.list( - DocumentListParams.builder() - .category( - DocumentListParams.Category.builder() - .addIn(DocumentListParams.Category.In.FORM_1099_INT) - .build() - ) - .createdAt( - DocumentListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .entityId("entity_id") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val pageFuture = documentServiceAsync.list() - val documents = documentsFuture.get() - documents.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt index 5c9796919..516c84c32 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt @@ -8,7 +8,6 @@ import com.increase.api.models.entities.EntityArchiveBeneficialOwnerParams import com.increase.api.models.entities.EntityConfirmParams import com.increase.api.models.entities.EntityCreateBeneficialOwnerParams import com.increase.api.models.entities.EntityCreateParams -import com.increase.api.models.entities.EntityListParams import com.increase.api.models.entities.EntityUpdateAddressParams import com.increase.api.models.entities.EntityUpdateBeneficialOwnerAddressParams import com.increase.api.models.entities.EntityUpdateIndustryCodeParams @@ -570,30 +569,10 @@ internal class EntityServiceAsyncTest { .build() val entityServiceAsync = client.entities() - val entitiesFuture = - entityServiceAsync.list( - EntityListParams.builder() - .createdAt( - EntityListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - EntityListParams.Status.builder() - .addIn(EntityListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) + val pageFuture = entityServiceAsync.list() - val entities = entitiesFuture.get() - entities.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/EventServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/EventServiceAsyncTest.kt index 3b06fa2f5..8cb73f7e3 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/EventServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/EventServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.events.EventListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -36,29 +34,9 @@ internal class EventServiceAsyncTest { .build() val eventServiceAsync = client.events() - val eventsFuture = - eventServiceAsync.list( - EventListParams.builder() - .associatedObjectId("associated_object_id") - .category( - EventListParams.Category.builder() - .addIn(EventListParams.Category.In.ACCOUNT_CREATED) - .build() - ) - .createdAt( - EventListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) + val pageFuture = eventServiceAsync.list() - val events = eventsFuture.get() - events.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsyncTest.kt index 1dc00522b..93b9bd618 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/EventSubscriptionServiceAsyncTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.eventsubscriptions.EventSubscriptionCreateParams -import com.increase.api.models.eventsubscriptions.EventSubscriptionListParams import com.increase.api.models.eventsubscriptions.EventSubscriptionUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -85,16 +84,9 @@ internal class EventSubscriptionServiceAsyncTest { .build() val eventSubscriptionServiceAsync = client.eventSubscriptions() - val eventSubscriptionsFuture = - eventSubscriptionServiceAsync.list( - EventSubscriptionListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val pageFuture = eventSubscriptionServiceAsync.list() - val eventSubscriptions = eventSubscriptionsFuture.get() - eventSubscriptions.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt index 67d850247..b044e39d9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.exports.ExportCreateParams -import com.increase.api.models.exports.ExportListParams import java.time.LocalDate import java.time.OffsetDateTime import org.junit.jupiter.api.Test @@ -129,34 +128,9 @@ internal class ExportServiceAsyncTest { .build() val exportServiceAsync = client.exports() - val exportsFuture = - exportServiceAsync.list( - ExportListParams.builder() - .category( - ExportListParams.Category.builder() - .addIn(ExportListParams.Category.In.ACCOUNT_STATEMENT_OFX) - .build() - ) - .createdAt( - ExportListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - ExportListParams.Status.builder() - .addIn(ExportListParams.Status.In.PENDING) - .build() - ) - .build() - ) + val pageFuture = exportServiceAsync.list() - val exports = exportsFuture.get() - exports.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExternalAccountServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExternalAccountServiceAsyncTest.kt index 34393cae2..dab270e8d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExternalAccountServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExternalAccountServiceAsyncTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.externalaccounts.ExternalAccountCreateParams -import com.increase.api.models.externalaccounts.ExternalAccountListParams import com.increase.api.models.externalaccounts.ExternalAccountUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -86,22 +85,9 @@ internal class ExternalAccountServiceAsyncTest { .build() val externalAccountServiceAsync = client.externalAccounts() - val externalAccountsFuture = - externalAccountServiceAsync.list( - ExternalAccountListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .routingNumber("xxxxxxxxx") - .status( - ExternalAccountListParams.Status.builder() - .addIn(ExternalAccountListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) + val pageFuture = externalAccountServiceAsync.list() - val externalAccounts = externalAccountsFuture.get() - externalAccounts.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt index 1db2dbf9c..129774f41 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.fednowtransfers.FednowTransferCreateParams -import com.increase.api.models.fednowtransfers.FednowTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -83,32 +81,10 @@ internal class FednowTransferServiceAsyncTest { .build() val fednowTransferServiceAsync = client.fednowTransfers() - val fednowTransfersFuture = - fednowTransferServiceAsync.list( - FednowTransferListParams.builder() - .accountId("account_id") - .createdAt( - FednowTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .externalAccountId("external_account_id") - .idempotencyKey("x") - .limit(1L) - .status( - FednowTransferListParams.Status.builder() - .addIn(FednowTransferListParams.Status.In.PENDING_REVIEWING) - .build() - ) - .build() - ) + val pageFuture = fednowTransferServiceAsync.list() - val fednowTransfers = fednowTransfersFuture.get() - fednowTransfers.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/FileServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/FileServiceAsyncTest.kt index 98e3e6217..e5a99c8d9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/FileServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/FileServiceAsyncTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.files.FileCreateParams -import com.increase.api.models.files.FileListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -59,29 +57,9 @@ internal class FileServiceAsyncTest { .build() val fileServiceAsync = client.files() - val filesFuture = - fileServiceAsync.list( - FileListParams.builder() - .createdAt( - FileListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .purpose( - FileListParams.Purpose.builder() - .addIn(FileListParams.Purpose.In.CARD_DISPUTE_ATTACHMENT) - .build() - ) - .build() - ) + val pageFuture = fileServiceAsync.list() - val files = filesFuture.get() - files.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsyncTest.kt index 433b0806e..85e52412b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundAchTransferServiceAsyncTest.kt @@ -6,9 +6,7 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.inboundachtransfers.InboundAchTransferCreateNotificationOfChangeParams import com.increase.api.models.inboundachtransfers.InboundAchTransferDeclineParams -import com.increase.api.models.inboundachtransfers.InboundAchTransferListParams import com.increase.api.models.inboundachtransfers.InboundAchTransferTransferReturnParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -40,31 +38,10 @@ internal class InboundAchTransferServiceAsyncTest { .build() val inboundAchTransferServiceAsync = client.inboundAchTransfers() - val inboundAchTransfersFuture = - inboundAchTransferServiceAsync.list( - InboundAchTransferListParams.builder() - .accountId("account_id") - .accountNumberId("account_number_id") - .createdAt( - InboundAchTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .status( - InboundAchTransferListParams.Status.builder() - .addIn(InboundAchTransferListParams.Status.In.PENDING) - .build() - ) - .build() - ) + val pageFuture = inboundAchTransferServiceAsync.list() - val inboundAchTransfers = inboundAchTransfersFuture.get() - inboundAchTransfers.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsyncTest.kt index e577d1215..65772d285 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundCheckDepositServiceAsyncTest.kt @@ -4,9 +4,7 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListParams import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositReturnParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -38,26 +36,10 @@ internal class InboundCheckDepositServiceAsyncTest { .build() val inboundCheckDepositServiceAsync = client.inboundCheckDeposits() - val inboundCheckDepositsFuture = - inboundCheckDepositServiceAsync.list( - InboundCheckDepositListParams.builder() - .accountId("account_id") - .checkTransferId("check_transfer_id") - .createdAt( - InboundCheckDepositListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) + val pageFuture = inboundCheckDepositServiceAsync.list() - val inboundCheckDeposits = inboundCheckDepositsFuture.get() - inboundCheckDeposits.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt index a6a38e2df..71b6d422b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -39,25 +37,9 @@ internal class InboundFednowTransferServiceAsyncTest { .build() val inboundFednowTransferServiceAsync = client.inboundFednowTransfers() - val inboundFednowTransfersFuture = - inboundFednowTransferServiceAsync.list( - InboundFednowTransferListParams.builder() - .accountId("account_id") - .accountNumberId("account_number_id") - .createdAt( - InboundFednowTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) + val pageFuture = inboundFednowTransferServiceAsync.list() - val inboundFednowTransfers = inboundFednowTransfersFuture.get() - inboundFednowTransfers.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncTest.kt index 019ba3aa8..908d760e7 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundMailItemServiceAsyncTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.inboundmailitems.InboundMailItemActionParams -import com.increase.api.models.inboundmailitems.InboundMailItemListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -38,25 +36,10 @@ internal class InboundMailItemServiceAsyncTest { .build() val inboundMailItemServiceAsync = client.inboundMailItems() - val inboundMailItemsFuture = - inboundMailItemServiceAsync.list( - InboundMailItemListParams.builder() - .createdAt( - InboundMailItemListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .lockboxId("lockbox_id") - .build() - ) + val pageFuture = inboundMailItemServiceAsync.list() - val inboundMailItems = inboundMailItemsFuture.get() - inboundMailItems.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsyncTest.kt index c3213cd5d..49a0fb5f0 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundRealTimePaymentsTransferServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -39,25 +37,9 @@ internal class InboundRealTimePaymentsTransferServiceAsyncTest { .build() val inboundRealTimePaymentsTransferServiceAsync = client.inboundRealTimePaymentsTransfers() - val inboundRealTimePaymentsTransfersFuture = - inboundRealTimePaymentsTransferServiceAsync.list( - InboundRealTimePaymentsTransferListParams.builder() - .accountId("account_id") - .accountNumberId("account_number_id") - .createdAt( - InboundRealTimePaymentsTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) + val pageFuture = inboundRealTimePaymentsTransferServiceAsync.list() - val inboundRealTimePaymentsTransfers = inboundRealTimePaymentsTransfersFuture.get() - inboundRealTimePaymentsTransfers.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsyncTest.kt index 0bed6a342..cf4e55311 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundWireDrawdownRequestServiceAsyncTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -38,12 +37,9 @@ internal class InboundWireDrawdownRequestServiceAsyncTest { .build() val inboundWireDrawdownRequestServiceAsync = client.inboundWireDrawdownRequests() - val inboundWireDrawdownRequestsFuture = - inboundWireDrawdownRequestServiceAsync.list( - InboundWireDrawdownRequestListParams.builder().cursor("cursor").limit(1L).build() - ) + val pageFuture = inboundWireDrawdownRequestServiceAsync.list() - val inboundWireDrawdownRequests = inboundWireDrawdownRequestsFuture.get() - inboundWireDrawdownRequests.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsyncTest.kt index 3d07f80e2..f9eff3102 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundWireTransferServiceAsyncTest.kt @@ -4,9 +4,7 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.inboundwiretransfers.InboundWireTransferListParams import com.increase.api.models.inboundwiretransfers.InboundWireTransferReverseParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -38,32 +36,10 @@ internal class InboundWireTransferServiceAsyncTest { .build() val inboundWireTransferServiceAsync = client.inboundWireTransfers() - val inboundWireTransfersFuture = - inboundWireTransferServiceAsync.list( - InboundWireTransferListParams.builder() - .accountId("account_id") - .accountNumberId("account_number_id") - .createdAt( - InboundWireTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .status( - InboundWireTransferListParams.Status.builder() - .addIn(InboundWireTransferListParams.Status.In.PENDING) - .build() - ) - .wireDrawdownRequestId("wire_drawdown_request_id") - .build() - ) + val pageFuture = inboundWireTransferServiceAsync.list() - val inboundWireTransfers = inboundWireTransfersFuture.get() - inboundWireTransfers.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsyncTest.kt index a0b282259..4165318ed 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/IntrafiAccountEnrollmentServiceAsyncTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentCreateParams -import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -60,23 +59,10 @@ internal class IntrafiAccountEnrollmentServiceAsyncTest { .build() val intrafiAccountEnrollmentServiceAsync = client.intrafiAccountEnrollments() - val intrafiAccountEnrollmentsFuture = - intrafiAccountEnrollmentServiceAsync.list( - IntrafiAccountEnrollmentListParams.builder() - .accountId("account_id") - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - IntrafiAccountEnrollmentListParams.Status.builder() - .addIn(IntrafiAccountEnrollmentListParams.Status.In.PENDING_ENROLLING) - .build() - ) - .build() - ) + val pageFuture = intrafiAccountEnrollmentServiceAsync.list() - val intrafiAccountEnrollments = intrafiAccountEnrollmentsFuture.get() - intrafiAccountEnrollments.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsyncTest.kt index 05d06ec2a..cc112e5a1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/IntrafiExclusionServiceAsyncTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.intrafiexclusions.IntrafiExclusionCreateParams -import com.increase.api.models.intrafiexclusions.IntrafiExclusionListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -58,18 +57,10 @@ internal class IntrafiExclusionServiceAsyncTest { .build() val intrafiExclusionServiceAsync = client.intrafiExclusions() - val intrafiExclusionsFuture = - intrafiExclusionServiceAsync.list( - IntrafiExclusionListParams.builder() - .cursor("cursor") - .entityId("entity_id") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val pageFuture = intrafiExclusionServiceAsync.list() - val intrafiExclusions = intrafiExclusionsFuture.get() - intrafiExclusions.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxServiceAsyncTest.kt index 470eb2ab9..722e1d4a9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/LockboxServiceAsyncTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.lockboxes.LockboxCreateParams -import com.increase.api.models.lockboxes.LockboxListParams import com.increase.api.models.lockboxes.LockboxUpdateParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -83,25 +81,9 @@ internal class LockboxServiceAsyncTest { .build() val lockboxServiceAsync = client.lockboxes() - val lockboxesFuture = - lockboxServiceAsync.list( - LockboxListParams.builder() - .accountId("account_id") - .createdAt( - LockboxListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val pageFuture = lockboxServiceAsync.list() - val lockboxes = lockboxesFuture.get() - lockboxes.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsyncTest.kt index 43a1af63b..6bf584883 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/OAuthApplicationServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.oauthapplications.OAuthApplicationListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -37,28 +35,9 @@ internal class OAuthApplicationServiceAsyncTest { .build() val oauthApplicationServiceAsync = client.oauthApplications() - val oauthApplicationsFuture = - oauthApplicationServiceAsync.list( - OAuthApplicationListParams.builder() - .createdAt( - OAuthApplicationListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .status( - OAuthApplicationListParams.Status.builder() - .addIn(OAuthApplicationListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) + val pageFuture = oauthApplicationServiceAsync.list() - val oauthApplications = oauthApplicationsFuture.get() - oauthApplications.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsyncTest.kt index 0ac421f30..7e4c12812 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/OAuthConnectionServiceAsyncTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.oauthconnections.OAuthConnectionListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -36,21 +35,9 @@ internal class OAuthConnectionServiceAsyncTest { .build() val oauthConnectionServiceAsync = client.oauthConnections() - val oauthConnectionsFuture = - oauthConnectionServiceAsync.list( - OAuthConnectionListParams.builder() - .cursor("cursor") - .limit(1L) - .oauthApplicationId("oauth_application_id") - .status( - OAuthConnectionListParams.Status.builder() - .addIn(OAuthConnectionListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) - - val oauthConnections = oauthConnectionsFuture.get() - oauthConnections.validate() + val pageFuture = oauthConnectionServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/PendingTransactionServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/PendingTransactionServiceAsyncTest.kt index 3cbc1575b..4bdf755e8 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/PendingTransactionServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/PendingTransactionServiceAsyncTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.pendingtransactions.PendingTransactionCreateParams -import com.increase.api.models.pendingtransactions.PendingTransactionListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -60,39 +58,10 @@ internal class PendingTransactionServiceAsyncTest { .build() val pendingTransactionServiceAsync = client.pendingTransactions() - val pendingTransactionsFuture = - pendingTransactionServiceAsync.list( - PendingTransactionListParams.builder() - .accountId("account_id") - .category( - PendingTransactionListParams.Category.builder() - .addIn( - PendingTransactionListParams.Category.In - .ACCOUNT_TRANSFER_INSTRUCTION - ) - .build() - ) - .createdAt( - PendingTransactionListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .routeId("route_id") - .status( - PendingTransactionListParams.Status.builder() - .addIn(PendingTransactionListParams.Status.In.PENDING) - .build() - ) - .build() - ) + val pageFuture = pendingTransactionServiceAsync.list() - val pendingTransactions = pendingTransactionsFuture.get() - pendingTransactions.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsyncTest.kt index a9737d30c..56233a018 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/PhysicalCardProfileServiceAsyncTest.kt @@ -6,7 +6,6 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCloneParams import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCreateParams -import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -68,22 +67,10 @@ internal class PhysicalCardProfileServiceAsyncTest { .build() val physicalCardProfileServiceAsync = client.physicalCardProfiles() - val physicalCardProfilesFuture = - physicalCardProfileServiceAsync.list( - PhysicalCardProfileListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - PhysicalCardProfileListParams.Status.builder() - .addIn(PhysicalCardProfileListParams.Status.In.PENDING_CREATING) - .build() - ) - .build() - ) + val pageFuture = physicalCardProfileServiceAsync.list() - val physicalCardProfiles = physicalCardProfilesFuture.get() - physicalCardProfiles.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/PhysicalCardServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/PhysicalCardServiceAsyncTest.kt index 4f88f5687..985e64f1c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/PhysicalCardServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/PhysicalCardServiceAsyncTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.physicalcards.PhysicalCardCreateParams -import com.increase.api.models.physicalcards.PhysicalCardListParams import com.increase.api.models.physicalcards.PhysicalCardUpdateParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -106,25 +104,9 @@ internal class PhysicalCardServiceAsyncTest { .build() val physicalCardServiceAsync = client.physicalCards() - val physicalCardsFuture = - physicalCardServiceAsync.list( - PhysicalCardListParams.builder() - .cardId("card_id") - .createdAt( - PhysicalCardListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val pageFuture = physicalCardServiceAsync.list() - val physicalCards = physicalCardsFuture.get() - physicalCards.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ProgramServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ProgramServiceAsyncTest.kt index 564ae3557..f3c6c953e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ProgramServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ProgramServiceAsyncTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.programs.ProgramListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -35,10 +34,9 @@ internal class ProgramServiceAsyncTest { .build() val programServiceAsync = client.programs() - val programsFuture = - programServiceAsync.list(ProgramListParams.builder().cursor("cursor").limit(1L).build()) + val pageFuture = programServiceAsync.list() - val programs = programsFuture.get() - programs.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsyncTest.kt index 1d17d2e17..5ee858f6b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimePaymentsTransferServiceAsyncTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferCreateParams -import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -70,32 +68,10 @@ internal class RealTimePaymentsTransferServiceAsyncTest { .build() val realTimePaymentsTransferServiceAsync = client.realTimePaymentsTransfers() - val realTimePaymentsTransfersFuture = - realTimePaymentsTransferServiceAsync.list( - RealTimePaymentsTransferListParams.builder() - .accountId("account_id") - .createdAt( - RealTimePaymentsTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .externalAccountId("external_account_id") - .idempotencyKey("x") - .limit(1L) - .status( - RealTimePaymentsTransferListParams.Status.builder() - .addIn(RealTimePaymentsTransferListParams.Status.In.PENDING_APPROVAL) - .build() - ) - .build() - ) + val pageFuture = realTimePaymentsTransferServiceAsync.list() - val realTimePaymentsTransfers = realTimePaymentsTransfersFuture.get() - realTimePaymentsTransfers.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RoutingNumberServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RoutingNumberServiceAsyncTest.kt index e2643a0df..d6e89a104 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RoutingNumberServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RoutingNumberServiceAsyncTest.kt @@ -20,16 +20,12 @@ internal class RoutingNumberServiceAsyncTest { .build() val routingNumberServiceAsync = client.routingNumbers() - val routingNumbersFuture = + val pageFuture = routingNumberServiceAsync.list( - RoutingNumberListParams.builder() - .routingNumber("xxxxxxxxx") - .cursor("cursor") - .limit(1L) - .build() + RoutingNumberListParams.builder().routingNumber("xxxxxxxxx").build() ) - val routingNumbers = routingNumbersFuture.get() - routingNumbers.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsyncTest.kt index e80616159..26ae90a18 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/SupplementalDocumentServiceAsyncTest.kt @@ -42,17 +42,12 @@ internal class SupplementalDocumentServiceAsyncTest { .build() val supplementalDocumentServiceAsync = client.supplementalDocuments() - val supplementalDocumentsFuture = + val pageFuture = supplementalDocumentServiceAsync.list( - SupplementalDocumentListParams.builder() - .entityId("entity_id") - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() + SupplementalDocumentListParams.builder().entityId("entity_id").build() ) - val supplementalDocuments = supplementalDocumentsFuture.get() - supplementalDocuments.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/TransactionServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/TransactionServiceAsyncTest.kt index 735da9639..bc7caa32f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/TransactionServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/TransactionServiceAsyncTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.models.transactions.TransactionListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -36,30 +34,9 @@ internal class TransactionServiceAsyncTest { .build() val transactionServiceAsync = client.transactions() - val transactionsFuture = - transactionServiceAsync.list( - TransactionListParams.builder() - .accountId("account_id") - .category( - TransactionListParams.Category.builder() - .addIn(TransactionListParams.Category.In.ACCOUNT_TRANSFER_INTENTION) - .build() - ) - .createdAt( - TransactionListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .routeId("route_id") - .build() - ) + val pageFuture = transactionServiceAsync.list() - val transactions = transactionsFuture.get() - transactions.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsyncTest.kt index 75127067f..68f966318 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireDrawdownRequestServiceAsyncTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestCreateParams -import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -84,21 +83,9 @@ internal class WireDrawdownRequestServiceAsyncTest { .build() val wireDrawdownRequestServiceAsync = client.wireDrawdownRequests() - val wireDrawdownRequestsFuture = - wireDrawdownRequestServiceAsync.list( - WireDrawdownRequestListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - WireDrawdownRequestListParams.Status.builder() - .addIn(WireDrawdownRequestListParams.Status.In.PENDING_SUBMISSION) - .build() - ) - .build() - ) + val pageFuture = wireDrawdownRequestServiceAsync.list() - val wireDrawdownRequests = wireDrawdownRequestsFuture.get() - wireDrawdownRequests.validate() + val page = pageFuture.get() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt index 2d82882ce..29516b117 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync import com.increase.api.models.wiretransfers.WireTransferCreateParams -import com.increase.api.models.wiretransfers.WireTransferListParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -117,27 +115,10 @@ internal class WireTransferServiceAsyncTest { .build() val wireTransferServiceAsync = client.wireTransfers() - val wireTransfersFuture = - wireTransferServiceAsync.list( - WireTransferListParams.builder() - .accountId("account_id") - .createdAt( - WireTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .externalAccountId("external_account_id") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val pageFuture = wireTransferServiceAsync.list() - val wireTransfers = wireTransfersFuture.get() - wireTransfers.validate() + val page = pageFuture.get() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountNumberServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountNumberServiceTest.kt index c89da7f0d..8bdbe6689 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountNumberServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountNumberServiceTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.accountnumbers.AccountNumberCreateParams -import com.increase.api.models.accountnumbers.AccountNumberListParams import com.increase.api.models.accountnumbers.AccountNumberUpdateParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -98,34 +96,8 @@ internal class AccountNumberServiceTest { .build() val accountNumberService = client.accountNumbers() - val accountNumbers = - accountNumberService.list( - AccountNumberListParams.builder() - .accountId("account_id") - .achDebitStatus( - AccountNumberListParams.AchDebitStatus.builder() - .addIn(AccountNumberListParams.AchDebitStatus.In.ALLOWED) - .build() - ) - .createdAt( - AccountNumberListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - AccountNumberListParams.Status.builder() - .addIn(AccountNumberListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) + val page = accountNumberService.list() - accountNumbers.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountServiceTest.kt index 4d8324157..299f3c373 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountServiceTest.kt @@ -6,7 +6,6 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.accounts.AccountBalanceParams import com.increase.api.models.accounts.AccountCreateParams -import com.increase.api.models.accounts.AccountListParams import com.increase.api.models.accounts.AccountUpdateParams import java.time.OffsetDateTime import org.junit.jupiter.api.Test @@ -81,32 +80,9 @@ internal class AccountServiceTest { .build() val accountService = client.accounts() - val accounts = - accountService.list( - AccountListParams.builder() - .createdAt( - AccountListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .entityId("entity_id") - .idempotencyKey("x") - .informationalEntityId("informational_entity_id") - .limit(1L) - .programId("program_id") - .status( - AccountListParams.Status.builder() - .addIn(AccountListParams.Status.In.CLOSED) - .build() - ) - .build() - ) + val page = accountService.list() - accounts.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountStatementServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountStatementServiceTest.kt index 03c4c29e1..c0c7b3e53 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountStatementServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountStatementServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.accountstatements.AccountStatementListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -36,23 +34,8 @@ internal class AccountStatementServiceTest { .build() val accountStatementService = client.accountStatements() - val accountStatements = - accountStatementService.list( - AccountStatementListParams.builder() - .accountId("account_id") - .cursor("cursor") - .limit(1L) - .statementPeriodStart( - AccountStatementListParams.StatementPeriodStart.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .build() - ) - - accountStatements.validate() + val page = accountStatementService.list() + + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountTransferServiceTest.kt index 6cb5b1a24..cf35b517d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AccountTransferServiceTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.accounttransfers.AccountTransferCreateParams -import com.increase.api.models.accounttransfers.AccountTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -60,25 +58,9 @@ internal class AccountTransferServiceTest { .build() val accountTransferService = client.accountTransfers() - val accountTransfers = - accountTransferService.list( - AccountTransferListParams.builder() - .accountId("account_id") - .createdAt( - AccountTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val page = accountTransferService.list() - accountTransfers.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AchPrenotificationServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AchPrenotificationServiceTest.kt index fd7f72451..32e48cdef 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AchPrenotificationServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AchPrenotificationServiceTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.achprenotifications.AchPrenotificationCreateParams -import com.increase.api.models.achprenotifications.AchPrenotificationListParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -74,23 +72,8 @@ internal class AchPrenotificationServiceTest { .build() val achPrenotificationService = client.achPrenotifications() - val achPrenotifications = - achPrenotificationService.list( - AchPrenotificationListParams.builder() - .createdAt( - AchPrenotificationListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val page = achPrenotificationService.list() - achPrenotifications.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AchTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AchTransferServiceTest.kt index b98938162..93b7cb6a4 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AchTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/AchTransferServiceTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.achtransfers.AchTransferCreateParams -import com.increase.api.models.achtransfers.AchTransferListParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -112,31 +110,9 @@ internal class AchTransferServiceTest { .build() val achTransferService = client.achTransfers() - val achTransfers = - achTransferService.list( - AchTransferListParams.builder() - .accountId("account_id") - .createdAt( - AchTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .externalAccountId("external_account_id") - .idempotencyKey("x") - .limit(1L) - .status( - AchTransferListParams.Status.builder() - .addIn(AchTransferListParams.Status.In.PENDING_APPROVAL) - .build() - ) - .build() - ) + val page = achTransferService.list() - achTransfers.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingAccountServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingAccountServiceTest.kt index 4f1f97061..aa25ea295 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingAccountServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingAccountServiceTest.kt @@ -6,7 +6,6 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountBalanceParams import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountCreateParams -import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountListParams import com.increase.api.models.bookkeepingaccounts.BookkeepingAccountUpdateParams import java.time.OffsetDateTime import org.junit.jupiter.api.Test @@ -68,16 +67,9 @@ internal class BookkeepingAccountServiceTest { .build() val bookkeepingAccountService = client.bookkeepingAccounts() - val bookkeepingAccounts = - bookkeepingAccountService.list( - BookkeepingAccountListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val page = bookkeepingAccountService.list() - bookkeepingAccounts.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingEntryServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingEntryServiceTest.kt index d81727782..04a415582 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingEntryServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingEntryServiceTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.bookkeepingentries.BookkeepingEntryListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -35,15 +34,8 @@ internal class BookkeepingEntryServiceTest { .build() val bookkeepingEntryService = client.bookkeepingEntries() - val bookkeepingEntries = - bookkeepingEntryService.list( - BookkeepingEntryListParams.builder() - .accountId("account_id") - .cursor("cursor") - .limit(1L) - .build() - ) + val page = bookkeepingEntryService.list() - bookkeepingEntries.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetServiceTest.kt index 68a3bccc2..4e5db7b7e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/BookkeepingEntrySetServiceTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetCreateParams -import com.increase.api.models.bookkeepingentrysets.BookkeepingEntrySetListParams import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -69,16 +68,8 @@ internal class BookkeepingEntrySetServiceTest { .build() val bookkeepingEntrySetService = client.bookkeepingEntrySets() - val bookkeepingEntrySets = - bookkeepingEntrySetService.list( - BookkeepingEntrySetListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .transactionId("transaction_id") - .build() - ) + val page = bookkeepingEntrySetService.list() - bookkeepingEntrySets.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt index ae412181b..e4296d8d5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt @@ -5,10 +5,8 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.carddisputes.CardDisputeCreateParams -import com.increase.api.models.carddisputes.CardDisputeListParams import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -783,29 +781,9 @@ internal class CardDisputeServiceTest { .build() val cardDisputeService = client.cardDisputes() - val cardDisputes = - cardDisputeService.list( - CardDisputeListParams.builder() - .createdAt( - CardDisputeListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - CardDisputeListParams.Status.builder() - .addIn(CardDisputeListParams.Status.In.USER_SUBMISSION_REQUIRED) - .build() - ) - .build() - ) + val page = cardDisputeService.list() - cardDisputes.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPaymentServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPaymentServiceTest.kt index 99559ac9f..1d83492f6 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPaymentServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPaymentServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.cardpayments.CardPaymentListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -35,24 +33,8 @@ internal class CardPaymentServiceTest { .build() val cardPaymentService = client.cardPayments() - val cardPayments = - cardPaymentService.list( - CardPaymentListParams.builder() - .accountId("account_id") - .cardId("card_id") - .createdAt( - CardPaymentListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) - - cardPayments.validate() + val page = cardPaymentService.list() + + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementServiceTest.kt index d2947ede5..146639d98 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPurchaseSupplementServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.cardpurchasesupplements.CardPurchaseSupplementListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -36,23 +34,8 @@ internal class CardPurchaseSupplementServiceTest { .build() val cardPurchaseSupplementService = client.cardPurchaseSupplements() - val cardPurchaseSupplements = - cardPurchaseSupplementService.list( - CardPurchaseSupplementListParams.builder() - .cardPaymentId("card_payment_id") - .createdAt( - CardPurchaseSupplementListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) - - cardPurchaseSupplements.validate() + val page = cardPurchaseSupplementService.list() + + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPushTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPushTransferServiceTest.kt index ab50f370d..a406c3052 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPushTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardPushTransferServiceTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.cardpushtransfers.CardPushTransferCreateParams -import com.increase.api.models.cardpushtransfers.CardPushTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -80,30 +78,9 @@ internal class CardPushTransferServiceTest { .build() val cardPushTransferService = client.cardPushTransfers() - val cardPushTransfers = - cardPushTransferService.list( - CardPushTransferListParams.builder() - .accountId("account_id") - .createdAt( - CardPushTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - CardPushTransferListParams.Status.builder() - .addIn(CardPushTransferListParams.Status.In.PENDING_APPROVAL) - .build() - ) - .build() - ) + val page = cardPushTransferService.list() - cardPushTransfers.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt index 454876590..ecab06e8f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt @@ -6,10 +6,8 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.cards.CardCreateDetailsIframeParams import com.increase.api.models.cards.CardCreateParams -import com.increase.api.models.cards.CardListParams import com.increase.api.models.cards.CardUpdateParams import com.increase.api.models.cards.CardUpdatePinParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -114,30 +112,9 @@ internal class CardServiceTest { .build() val cardService = client.cards() - val cards = - cardService.list( - CardListParams.builder() - .accountId("account_id") - .createdAt( - CardListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - CardListParams.Status.builder() - .addIn(CardListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) + val page = cardService.list() - cards.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardTokenServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardTokenServiceTest.kt index 8180ea47f..636c60786 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardTokenServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardTokenServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.cardtokens.CardTokenListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -35,23 +33,9 @@ internal class CardTokenServiceTest { .build() val cardTokenService = client.cardTokens() - val cardTokens = - cardTokenService.list( - CardTokenListParams.builder() - .createdAt( - CardTokenListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) + val page = cardTokenService.list() - cardTokens.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardValidationServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardValidationServiceTest.kt index 32a77a349..c17f21ca5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardValidationServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardValidationServiceTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.cardvalidations.CardValidationCreateParams -import com.increase.api.models.cardvalidations.CardValidationListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -67,29 +65,8 @@ internal class CardValidationServiceTest { .build() val cardValidationService = client.cardValidations() - val cardValidations = - cardValidationService.list( - CardValidationListParams.builder() - .accountId("account_id") - .createdAt( - CardValidationListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - CardValidationListParams.Status.builder() - .addIn(CardValidationListParams.Status.In.REQUIRES_ATTENTION) - .build() - ) - .build() - ) + val page = cardValidationService.list() - cardValidations.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckDepositServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckDepositServiceTest.kt index fe9b1661a..fcad45c52 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckDepositServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckDepositServiceTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.checkdeposits.CheckDepositCreateParams -import com.increase.api.models.checkdeposits.CheckDepositListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -59,24 +57,8 @@ internal class CheckDepositServiceTest { .build() val checkDepositService = client.checkDeposits() - val checkDeposits = - checkDepositService.list( - CheckDepositListParams.builder() - .accountId("account_id") - .createdAt( - CheckDepositListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val page = checkDepositService.list() - checkDeposits.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt index 9fe7297d7..d1755c695 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt @@ -5,10 +5,8 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.checktransfers.CheckTransferCreateParams -import com.increase.api.models.checktransfers.CheckTransferListParams import com.increase.api.models.checktransfers.CheckTransferStopPaymentParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -107,30 +105,9 @@ internal class CheckTransferServiceTest { .build() val checkTransferService = client.checkTransfers() - val checkTransfers = - checkTransferService.list( - CheckTransferListParams.builder() - .accountId("account_id") - .createdAt( - CheckTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - CheckTransferListParams.Status.builder() - .addIn(CheckTransferListParams.Status.In.PENDING_APPROVAL) - .build() - ) - .build() - ) + val page = checkTransferService.list() - checkTransfers.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DeclinedTransactionServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DeclinedTransactionServiceTest.kt index b59590254..efa38cff9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DeclinedTransactionServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DeclinedTransactionServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.declinedtransactions.DeclinedTransactionListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -36,29 +34,8 @@ internal class DeclinedTransactionServiceTest { .build() val declinedTransactionService = client.declinedTransactions() - val declinedTransactions = - declinedTransactionService.list( - DeclinedTransactionListParams.builder() - .accountId("account_id") - .category( - DeclinedTransactionListParams.Category.builder() - .addIn(DeclinedTransactionListParams.Category.In.ACH_DECLINE) - .build() - ) - .createdAt( - DeclinedTransactionListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .routeId("route_id") - .build() - ) + val page = declinedTransactionService.list() - declinedTransactions.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt index 4a405c7c1..ac93dd20c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt @@ -6,7 +6,6 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCloneParams import com.increase.api.models.digitalcardprofiles.DigitalCardProfileCreateParams -import com.increase.api.models.digitalcardprofiles.DigitalCardProfileListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -70,21 +69,9 @@ internal class DigitalCardProfileServiceTest { .build() val digitalCardProfileService = client.digitalCardProfiles() - val digitalCardProfiles = - digitalCardProfileService.list( - DigitalCardProfileListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - DigitalCardProfileListParams.Status.builder() - .addIn(DigitalCardProfileListParams.Status.In.PENDING) - .build() - ) - .build() - ) + val page = digitalCardProfileService.list() - digitalCardProfiles.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalWalletTokenServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalWalletTokenServiceTest.kt index 8c231b500..7f151f7f1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalWalletTokenServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalWalletTokenServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.digitalwallettokens.DigitalWalletTokenListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -36,23 +34,8 @@ internal class DigitalWalletTokenServiceTest { .build() val digitalWalletTokenService = client.digitalWalletTokens() - val digitalWalletTokens = - digitalWalletTokenService.list( - DigitalWalletTokenListParams.builder() - .cardId("card_id") - .createdAt( - DigitalWalletTokenListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) - - digitalWalletTokens.validate() + val page = digitalWalletTokenService.list() + + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DocumentServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DocumentServiceTest.kt index ec049380f..e64bfb09d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DocumentServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DocumentServiceTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.documents.DocumentCreateParams -import com.increase.api.models.documents.DocumentListParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -67,29 +65,8 @@ internal class DocumentServiceTest { .build() val documentService = client.documents() - val documents = - documentService.list( - DocumentListParams.builder() - .category( - DocumentListParams.Category.builder() - .addIn(DocumentListParams.Category.In.FORM_1099_INT) - .build() - ) - .createdAt( - DocumentListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .entityId("entity_id") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val page = documentService.list() - documents.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt index 3e265ad30..fb0a01cf1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt @@ -8,7 +8,6 @@ import com.increase.api.models.entities.EntityArchiveBeneficialOwnerParams import com.increase.api.models.entities.EntityConfirmParams import com.increase.api.models.entities.EntityCreateBeneficialOwnerParams import com.increase.api.models.entities.EntityCreateParams -import com.increase.api.models.entities.EntityListParams import com.increase.api.models.entities.EntityUpdateAddressParams import com.increase.api.models.entities.EntityUpdateBeneficialOwnerAddressParams import com.increase.api.models.entities.EntityUpdateIndustryCodeParams @@ -567,29 +566,9 @@ internal class EntityServiceTest { .build() val entityService = client.entities() - val entities = - entityService.list( - EntityListParams.builder() - .createdAt( - EntityListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - EntityListParams.Status.builder() - .addIn(EntityListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) + val page = entityService.list() - entities.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EventServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EventServiceTest.kt index 6cc860848..b3cabcbbb 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EventServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EventServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.events.EventListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -35,28 +33,8 @@ internal class EventServiceTest { .build() val eventService = client.events() - val events = - eventService.list( - EventListParams.builder() - .associatedObjectId("associated_object_id") - .category( - EventListParams.Category.builder() - .addIn(EventListParams.Category.In.ACCOUNT_CREATED) - .build() - ) - .createdAt( - EventListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) - - events.validate() + val page = eventService.list() + + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EventSubscriptionServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EventSubscriptionServiceTest.kt index db58b42be..6f1e4eb22 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EventSubscriptionServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EventSubscriptionServiceTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.eventsubscriptions.EventSubscriptionCreateParams -import com.increase.api.models.eventsubscriptions.EventSubscriptionListParams import com.increase.api.models.eventsubscriptions.EventSubscriptionUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -82,15 +81,8 @@ internal class EventSubscriptionServiceTest { .build() val eventSubscriptionService = client.eventSubscriptions() - val eventSubscriptions = - eventSubscriptionService.list( - EventSubscriptionListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val page = eventSubscriptionService.list() - eventSubscriptions.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt index 4edcd4412..c98cd80d1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.exports.ExportCreateParams -import com.increase.api.models.exports.ExportListParams import java.time.LocalDate import java.time.OffsetDateTime import org.junit.jupiter.api.Test @@ -127,33 +126,8 @@ internal class ExportServiceTest { .build() val exportService = client.exports() - val exports = - exportService.list( - ExportListParams.builder() - .category( - ExportListParams.Category.builder() - .addIn(ExportListParams.Category.In.ACCOUNT_STATEMENT_OFX) - .build() - ) - .createdAt( - ExportListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - ExportListParams.Status.builder() - .addIn(ExportListParams.Status.In.PENDING) - .build() - ) - .build() - ) + val page = exportService.list() - exports.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExternalAccountServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExternalAccountServiceTest.kt index 61327f607..922721cb3 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExternalAccountServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExternalAccountServiceTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.externalaccounts.ExternalAccountCreateParams -import com.increase.api.models.externalaccounts.ExternalAccountListParams import com.increase.api.models.externalaccounts.ExternalAccountUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -83,21 +82,8 @@ internal class ExternalAccountServiceTest { .build() val externalAccountService = client.externalAccounts() - val externalAccounts = - externalAccountService.list( - ExternalAccountListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .routingNumber("xxxxxxxxx") - .status( - ExternalAccountListParams.Status.builder() - .addIn(ExternalAccountListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) + val page = externalAccountService.list() - externalAccounts.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt index 5086c7316..7dcad0dc8 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.fednowtransfers.FednowTransferCreateParams -import com.increase.api.models.fednowtransfers.FednowTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -80,31 +78,9 @@ internal class FednowTransferServiceTest { .build() val fednowTransferService = client.fednowTransfers() - val fednowTransfers = - fednowTransferService.list( - FednowTransferListParams.builder() - .accountId("account_id") - .createdAt( - FednowTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .externalAccountId("external_account_id") - .idempotencyKey("x") - .limit(1L) - .status( - FednowTransferListParams.Status.builder() - .addIn(FednowTransferListParams.Status.In.PENDING_REVIEWING) - .build() - ) - .build() - ) + val page = fednowTransferService.list() - fednowTransfers.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FileServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FileServiceTest.kt index d60564adf..cb3570b2a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FileServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FileServiceTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.files.FileCreateParams -import com.increase.api.models.files.FileListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -57,28 +55,8 @@ internal class FileServiceTest { .build() val fileService = client.files() - val files = - fileService.list( - FileListParams.builder() - .createdAt( - FileListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .purpose( - FileListParams.Purpose.builder() - .addIn(FileListParams.Purpose.In.CARD_DISPUTE_ATTACHMENT) - .build() - ) - .build() - ) + val page = fileService.list() - files.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundAchTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundAchTransferServiceTest.kt index 82090363c..fa3ed19de 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundAchTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundAchTransferServiceTest.kt @@ -6,9 +6,7 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.inboundachtransfers.InboundAchTransferCreateNotificationOfChangeParams import com.increase.api.models.inboundachtransfers.InboundAchTransferDeclineParams -import com.increase.api.models.inboundachtransfers.InboundAchTransferListParams import com.increase.api.models.inboundachtransfers.InboundAchTransferTransferReturnParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -39,30 +37,9 @@ internal class InboundAchTransferServiceTest { .build() val inboundAchTransferService = client.inboundAchTransfers() - val inboundAchTransfers = - inboundAchTransferService.list( - InboundAchTransferListParams.builder() - .accountId("account_id") - .accountNumberId("account_number_id") - .createdAt( - InboundAchTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .status( - InboundAchTransferListParams.Status.builder() - .addIn(InboundAchTransferListParams.Status.In.PENDING) - .build() - ) - .build() - ) + val page = inboundAchTransferService.list() - inboundAchTransfers.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundCheckDepositServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundCheckDepositServiceTest.kt index 2d5bb62e3..9b66d2269 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundCheckDepositServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundCheckDepositServiceTest.kt @@ -4,9 +4,7 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositListParams import com.increase.api.models.inboundcheckdeposits.InboundCheckDepositReturnParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -37,25 +35,9 @@ internal class InboundCheckDepositServiceTest { .build() val inboundCheckDepositService = client.inboundCheckDeposits() - val inboundCheckDeposits = - inboundCheckDepositService.list( - InboundCheckDepositListParams.builder() - .accountId("account_id") - .checkTransferId("check_transfer_id") - .createdAt( - InboundCheckDepositListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) + val page = inboundCheckDepositService.list() - inboundCheckDeposits.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt index 32750eb86..52147b35f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -36,24 +34,8 @@ internal class InboundFednowTransferServiceTest { .build() val inboundFednowTransferService = client.inboundFednowTransfers() - val inboundFednowTransfers = - inboundFednowTransferService.list( - InboundFednowTransferListParams.builder() - .accountId("account_id") - .accountNumberId("account_number_id") - .createdAt( - InboundFednowTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) - - inboundFednowTransfers.validate() + val page = inboundFednowTransferService.list() + + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundMailItemServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundMailItemServiceTest.kt index 3f4037b01..df84998b1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundMailItemServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundMailItemServiceTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.inboundmailitems.InboundMailItemActionParams -import com.increase.api.models.inboundmailitems.InboundMailItemListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -37,24 +35,9 @@ internal class InboundMailItemServiceTest { .build() val inboundMailItemService = client.inboundMailItems() - val inboundMailItems = - inboundMailItemService.list( - InboundMailItemListParams.builder() - .createdAt( - InboundMailItemListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .lockboxId("lockbox_id") - .build() - ) + val page = inboundMailItemService.list() - inboundMailItems.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferServiceTest.kt index 06e7c8f9d..ba010e944 100755 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundRealTimePaymentsTransferServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.inboundrealtimepaymentstransfers.InboundRealTimePaymentsTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -38,24 +36,8 @@ internal class InboundRealTimePaymentsTransferServiceTest { .build() val inboundRealTimePaymentsTransferService = client.inboundRealTimePaymentsTransfers() - val inboundRealTimePaymentsTransfers = - inboundRealTimePaymentsTransferService.list( - InboundRealTimePaymentsTransferListParams.builder() - .accountId("account_id") - .accountNumberId("account_number_id") - .createdAt( - InboundRealTimePaymentsTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .build() - ) + val page = inboundRealTimePaymentsTransferService.list() - inboundRealTimePaymentsTransfers.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestServiceTest.kt index 42a19a1b6..0533025bd 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundWireDrawdownRequestServiceTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.inboundwiredrawdownrequests.InboundWireDrawdownRequestListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -37,11 +36,8 @@ internal class InboundWireDrawdownRequestServiceTest { .build() val inboundWireDrawdownRequestService = client.inboundWireDrawdownRequests() - val inboundWireDrawdownRequests = - inboundWireDrawdownRequestService.list( - InboundWireDrawdownRequestListParams.builder().cursor("cursor").limit(1L).build() - ) + val page = inboundWireDrawdownRequestService.list() - inboundWireDrawdownRequests.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundWireTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundWireTransferServiceTest.kt index 1b5b0648f..7f1070aa5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundWireTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundWireTransferServiceTest.kt @@ -4,9 +4,7 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.inboundwiretransfers.InboundWireTransferListParams import com.increase.api.models.inboundwiretransfers.InboundWireTransferReverseParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -37,31 +35,9 @@ internal class InboundWireTransferServiceTest { .build() val inboundWireTransferService = client.inboundWireTransfers() - val inboundWireTransfers = - inboundWireTransferService.list( - InboundWireTransferListParams.builder() - .accountId("account_id") - .accountNumberId("account_number_id") - .createdAt( - InboundWireTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .status( - InboundWireTransferListParams.Status.builder() - .addIn(InboundWireTransferListParams.Status.In.PENDING) - .build() - ) - .wireDrawdownRequestId("wire_drawdown_request_id") - .build() - ) + val page = inboundWireTransferService.list() - inboundWireTransfers.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentServiceTest.kt index 1fee4201b..05254a947 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/IntrafiAccountEnrollmentServiceTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentCreateParams -import com.increase.api.models.intrafiaccountenrollments.IntrafiAccountEnrollmentListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -58,22 +57,9 @@ internal class IntrafiAccountEnrollmentServiceTest { .build() val intrafiAccountEnrollmentService = client.intrafiAccountEnrollments() - val intrafiAccountEnrollments = - intrafiAccountEnrollmentService.list( - IntrafiAccountEnrollmentListParams.builder() - .accountId("account_id") - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - IntrafiAccountEnrollmentListParams.Status.builder() - .addIn(IntrafiAccountEnrollmentListParams.Status.In.PENDING_ENROLLING) - .build() - ) - .build() - ) + val page = intrafiAccountEnrollmentService.list() - intrafiAccountEnrollments.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/IntrafiExclusionServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/IntrafiExclusionServiceTest.kt index c70728895..7317db982 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/IntrafiExclusionServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/IntrafiExclusionServiceTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.intrafiexclusions.IntrafiExclusionCreateParams -import com.increase.api.models.intrafiexclusions.IntrafiExclusionListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -55,17 +54,9 @@ internal class IntrafiExclusionServiceTest { .build() val intrafiExclusionService = client.intrafiExclusions() - val intrafiExclusions = - intrafiExclusionService.list( - IntrafiExclusionListParams.builder() - .cursor("cursor") - .entityId("entity_id") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val page = intrafiExclusionService.list() - intrafiExclusions.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxServiceTest.kt index ef0877e7f..41da8d7e3 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/LockboxServiceTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.lockboxes.LockboxCreateParams -import com.increase.api.models.lockboxes.LockboxListParams import com.increase.api.models.lockboxes.LockboxUpdateParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -80,24 +78,8 @@ internal class LockboxServiceTest { .build() val lockboxService = client.lockboxes() - val lockboxes = - lockboxService.list( - LockboxListParams.builder() - .accountId("account_id") - .createdAt( - LockboxListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val page = lockboxService.list() - lockboxes.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/OAuthApplicationServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/OAuthApplicationServiceTest.kt index 389bf81dc..5fc05d30a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/OAuthApplicationServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/OAuthApplicationServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.oauthapplications.OAuthApplicationListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -35,27 +33,8 @@ internal class OAuthApplicationServiceTest { .build() val oauthApplicationService = client.oauthApplications() - val oauthApplications = - oauthApplicationService.list( - OAuthApplicationListParams.builder() - .createdAt( - OAuthApplicationListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .status( - OAuthApplicationListParams.Status.builder() - .addIn(OAuthApplicationListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) - - oauthApplications.validate() + val page = oauthApplicationService.list() + + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/OAuthConnectionServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/OAuthConnectionServiceTest.kt index ecfdca91e..ab97186fc 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/OAuthConnectionServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/OAuthConnectionServiceTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.oauthconnections.OAuthConnectionListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -34,20 +33,8 @@ internal class OAuthConnectionServiceTest { .build() val oauthConnectionService = client.oauthConnections() - val oauthConnections = - oauthConnectionService.list( - OAuthConnectionListParams.builder() - .cursor("cursor") - .limit(1L) - .oauthApplicationId("oauth_application_id") - .status( - OAuthConnectionListParams.Status.builder() - .addIn(OAuthConnectionListParams.Status.In.ACTIVE) - .build() - ) - .build() - ) - - oauthConnections.validate() + val page = oauthConnectionService.list() + + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PendingTransactionServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PendingTransactionServiceTest.kt index a9176b799..4584faf2d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PendingTransactionServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PendingTransactionServiceTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.pendingtransactions.PendingTransactionCreateParams -import com.increase.api.models.pendingtransactions.PendingTransactionListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -58,38 +56,9 @@ internal class PendingTransactionServiceTest { .build() val pendingTransactionService = client.pendingTransactions() - val pendingTransactions = - pendingTransactionService.list( - PendingTransactionListParams.builder() - .accountId("account_id") - .category( - PendingTransactionListParams.Category.builder() - .addIn( - PendingTransactionListParams.Category.In - .ACCOUNT_TRANSFER_INSTRUCTION - ) - .build() - ) - .createdAt( - PendingTransactionListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .routeId("route_id") - .status( - PendingTransactionListParams.Status.builder() - .addIn(PendingTransactionListParams.Status.In.PENDING) - .build() - ) - .build() - ) + val page = pendingTransactionService.list() - pendingTransactions.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PhysicalCardProfileServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PhysicalCardProfileServiceTest.kt index 2cf01991a..318ef8435 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PhysicalCardProfileServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PhysicalCardProfileServiceTest.kt @@ -6,7 +6,6 @@ import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCloneParams import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileCreateParams -import com.increase.api.models.physicalcardprofiles.PhysicalCardProfileListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -66,21 +65,9 @@ internal class PhysicalCardProfileServiceTest { .build() val physicalCardProfileService = client.physicalCardProfiles() - val physicalCardProfiles = - physicalCardProfileService.list( - PhysicalCardProfileListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - PhysicalCardProfileListParams.Status.builder() - .addIn(PhysicalCardProfileListParams.Status.In.PENDING_CREATING) - .build() - ) - .build() - ) + val page = physicalCardProfileService.list() - physicalCardProfiles.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PhysicalCardServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PhysicalCardServiceTest.kt index 89c82b618..d91ddec90 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PhysicalCardServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/PhysicalCardServiceTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.physicalcards.PhysicalCardCreateParams -import com.increase.api.models.physicalcards.PhysicalCardListParams import com.increase.api.models.physicalcards.PhysicalCardUpdateParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -102,24 +100,8 @@ internal class PhysicalCardServiceTest { .build() val physicalCardService = client.physicalCards() - val physicalCards = - physicalCardService.list( - PhysicalCardListParams.builder() - .cardId("card_id") - .createdAt( - PhysicalCardListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val page = physicalCardService.list() - physicalCards.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ProgramServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ProgramServiceTest.kt index af50efdcf..edd825c71 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ProgramServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ProgramServiceTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.programs.ProgramListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -34,9 +33,8 @@ internal class ProgramServiceTest { .build() val programService = client.programs() - val programs = - programService.list(ProgramListParams.builder().cursor("cursor").limit(1L).build()) + val page = programService.list() - programs.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferServiceTest.kt index 216fcacd1..c084cc8ea 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimePaymentsTransferServiceTest.kt @@ -5,8 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferCreateParams -import com.increase.api.models.realtimepaymentstransfers.RealTimePaymentsTransferListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -68,31 +66,9 @@ internal class RealTimePaymentsTransferServiceTest { .build() val realTimePaymentsTransferService = client.realTimePaymentsTransfers() - val realTimePaymentsTransfers = - realTimePaymentsTransferService.list( - RealTimePaymentsTransferListParams.builder() - .accountId("account_id") - .createdAt( - RealTimePaymentsTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .externalAccountId("external_account_id") - .idempotencyKey("x") - .limit(1L) - .status( - RealTimePaymentsTransferListParams.Status.builder() - .addIn(RealTimePaymentsTransferListParams.Status.In.PENDING_APPROVAL) - .build() - ) - .build() - ) + val page = realTimePaymentsTransferService.list() - realTimePaymentsTransfers.validate() + page.response().validate() } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RoutingNumberServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RoutingNumberServiceTest.kt index a55dd5f68..2228f5d44 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RoutingNumberServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RoutingNumberServiceTest.kt @@ -20,15 +20,11 @@ internal class RoutingNumberServiceTest { .build() val routingNumberService = client.routingNumbers() - val routingNumbers = + val page = routingNumberService.list( - RoutingNumberListParams.builder() - .routingNumber("xxxxxxxxx") - .cursor("cursor") - .limit(1L) - .build() + RoutingNumberListParams.builder().routingNumber("xxxxxxxxx").build() ) - routingNumbers.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/SupplementalDocumentServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/SupplementalDocumentServiceTest.kt index 0f3f8a263..80b3ebe25 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/SupplementalDocumentServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/SupplementalDocumentServiceTest.kt @@ -41,16 +41,11 @@ internal class SupplementalDocumentServiceTest { .build() val supplementalDocumentService = client.supplementalDocuments() - val supplementalDocuments = + val page = supplementalDocumentService.list( - SupplementalDocumentListParams.builder() - .entityId("entity_id") - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .build() + SupplementalDocumentListParams.builder().entityId("entity_id").build() ) - supplementalDocuments.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/TransactionServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/TransactionServiceTest.kt index 7805b01f4..b981b3091 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/TransactionServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/TransactionServiceTest.kt @@ -4,8 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.models.transactions.TransactionListParams -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -35,29 +33,8 @@ internal class TransactionServiceTest { .build() val transactionService = client.transactions() - val transactions = - transactionService.list( - TransactionListParams.builder() - .accountId("account_id") - .category( - TransactionListParams.Category.builder() - .addIn(TransactionListParams.Category.In.ACCOUNT_TRANSFER_INTENTION) - .build() - ) - .createdAt( - TransactionListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .limit(1L) - .routeId("route_id") - .build() - ) - - transactions.validate() + val page = transactionService.list() + + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireDrawdownRequestServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireDrawdownRequestServiceTest.kt index 7094ad6b8..2b12197e8 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireDrawdownRequestServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireDrawdownRequestServiceTest.kt @@ -5,7 +5,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestCreateParams -import com.increase.api.models.wiredrawdownrequests.WireDrawdownRequestListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -82,20 +81,8 @@ internal class WireDrawdownRequestServiceTest { .build() val wireDrawdownRequestService = client.wireDrawdownRequests() - val wireDrawdownRequests = - wireDrawdownRequestService.list( - WireDrawdownRequestListParams.builder() - .cursor("cursor") - .idempotencyKey("x") - .limit(1L) - .status( - WireDrawdownRequestListParams.Status.builder() - .addIn(WireDrawdownRequestListParams.Status.In.PENDING_SUBMISSION) - .build() - ) - .build() - ) + val page = wireDrawdownRequestService.list() - wireDrawdownRequests.validate() + page.response().validate() } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt index d0b134b61..1b446956d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt @@ -5,9 +5,7 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient import com.increase.api.models.wiretransfers.WireTransferCreateParams -import com.increase.api.models.wiretransfers.WireTransferListParams import java.time.LocalDate -import java.time.OffsetDateTime import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -114,26 +112,9 @@ internal class WireTransferServiceTest { .build() val wireTransferService = client.wireTransfers() - val wireTransfers = - wireTransferService.list( - WireTransferListParams.builder() - .accountId("account_id") - .createdAt( - WireTransferListParams.CreatedAt.builder() - .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .build() - ) - .cursor("cursor") - .externalAccountId("external_account_id") - .idempotencyKey("x") - .limit(1L) - .build() - ) + val page = wireTransferService.list() - wireTransfers.validate() + page.response().validate() } @Test