diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 023d4032..728fa2a0 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: 5bbaa3a9-baa0-471b-ba6a-13fd88e8c119 management: - docChecksum: a72d31b18ba219e4b2c49d8d031dcb9d + docChecksum: 5731f5876ef44ba0ff4c1cc3696ba1ad docVersion: 1.0.0 - speakeasyVersion: 1.784.1 - generationVersion: 2.911.3 - releaseVersion: 2.16.96 - configChecksum: be40dc9d66c822b4339cb61074d70111 + speakeasyVersion: 1.785.0 + generationVersion: 2.912.1 + releaseVersion: 2.16.97 + configChecksum: c5e78e9e149bb981a627c0b61dc109ba repoURL: https://github.com/gr4vy/gr4vy-java.git installationURL: https://github.com/gr4vy/gr4vy-java published: true persistentEdits: - generation_id: 7d4774a0-3eb1-44f4-8e79-0659495e9847 - pristine_commit_hash: 262b2a8f71662cabbd40e9dc55ccfd73d13555b8 - pristine_tree_hash: e315a30abd568d4dae8841c78e3b8eb724961340 + generation_id: 74f43643-5b7c-4cda-b462-7ab21c4693f5 + pristine_commit_hash: 6d045030b62e3c0d7c3b306ffcc992a270fc0225 + pristine_tree_hash: 4e37a6dd2fba17b805a0416c22dfd097ed21c4d3 features: java: additionalDependencies: 0.1.0 @@ -2270,8 +2270,8 @@ trackedFiles: pristine_git_object: ef22c73cd87ed78ea945584ff7d25a74408f3832 docs/models/operations/ListPayoutsRequest.md: id: 5741c3297272 - last_write_checksum: sha1:d55fd22ced545979ffb26b15999d2769d7bda3c0 - pristine_git_object: 630fdc94c9a384d5b71ec494d82cf38cb98acd3b + last_write_checksum: sha1:5247935669a6559df60151700f2784ec675434b3 + pristine_git_object: cf281459e5cf3d8602fb865e557a328b30cc5fbe docs/models/operations/ListPayoutsResponse.md: id: 85d1cf88e0e0 last_write_checksum: sha1:3784fba931de22932d7147fffad40227f39b321b @@ -2606,8 +2606,8 @@ trackedFiles: pristine_git_object: 96a7b93bfe7ec5cf6c6af1ef543d701b8d6b1a3b docs/sdks/payouts/README.md: id: 184ed4a74471 - last_write_checksum: sha1:b257112c6c65b709faf52e9968c99d95accc1a81 - pristine_git_object: 641062efe804dfc49b9d5361363f4f98ac95646b + last_write_checksum: sha1:58195bfb43578cd2a68cd408c9b7ad6225716fb4 + pristine_git_object: d3791fbdbe44016f023feb62905cf4f9e6ae9d0c docs/sdks/refunds/README.md: id: 451a9838a921 last_write_checksum: sha1:eb04e9c323edf2ab9cd4c1e248fff25d3ca44a3f @@ -2654,8 +2654,8 @@ trackedFiles: pristine_git_object: 15c4e4642f204ccb312d8814155b69e153b4e19b gradle.properties: id: 2afbb999f001 - last_write_checksum: sha1:03fea2cca61d87403757dc9531327ead04ab8ff7 - pristine_git_object: 9af894007fdb701430e613a587ffda4389ac6352 + last_write_checksum: sha1:acb6e3435025819743115651731a41f169675912 + pristine_git_object: b981ae6bd5ebc9fe3f1298ecf757cee39ff635f0 gradle/wrapper/gradle-wrapper.jar: id: ec27dae6e852 last_write_checksum: sha1:f725fb1467084142d74fd7cd8eab691ab3442611 @@ -2802,8 +2802,8 @@ trackedFiles: pristine_git_object: 13a36eb2b625103fc8660c25d980fb572a0790c4 src/main/java/com/gr4vy/sdk/AsyncPayouts.java: id: 9b84e4b1d9a6 - last_write_checksum: sha1:d0073039275fe7a3c8a4d8499973f2951626e1d1 - pristine_git_object: 82671f8fd2ff0a7a1c5a1d223245f54f7e8a8ce2 + last_write_checksum: sha1:fd75312fbd240dd7746d0da91a228ca6889272db + pristine_git_object: af1b4ed683be8d1699ac10dd44db7d1d02b90fc7 src/main/java/com/gr4vy/sdk/AsyncRefunds.java: id: a3f797240c0b last_write_checksum: sha1:b63f824668f6727b2da240f04611cc2837a87e10 @@ -2942,8 +2942,8 @@ trackedFiles: pristine_git_object: 0ecdd593aac949d3c6e58180303e55c790bb39e9 src/main/java/com/gr4vy/sdk/Payouts.java: id: 5fe07a63563d - last_write_checksum: sha1:1241a6668e42d6968e670b3c034c319138fcfd01 - pristine_git_object: 4bc5c22aa75b0526916c7f2430261df68c28915c + last_write_checksum: sha1:c2aba9e00fbf965d882cc6fb3d4a5ef1ac12af37 + pristine_git_object: db7a6f5ff8f060588bf95d622a972aef5a1fce4e src/main/java/com/gr4vy/sdk/Refunds.java: id: 06d73de40717 last_write_checksum: sha1:e9cb2f4548b10a59ef2b2185313e6d76bea7d4ea @@ -2958,8 +2958,8 @@ trackedFiles: pristine_git_object: 502a7312d3dc82c102dbaf7ed5e952d0c793e26f src/main/java/com/gr4vy/sdk/SDKConfiguration.java: id: 73a7edeaca45 - last_write_checksum: sha1:1ab43afcf6f8d1c84e1c37a92ebab54ae7170b13 - pristine_git_object: 14018d0be311cb9afaa880e60d6e7f9dccae96c8 + last_write_checksum: sha1:d7f7ed2fb30b5498d5b253ebc8f838a116fc8f21 + pristine_git_object: 4bb82e559b0ad0aa918a48f9ff7baecf07280f0a src/main/java/com/gr4vy/sdk/SecuritySource.java: id: 1b6add6b9b50 last_write_checksum: sha1:2f365cc823c6243188e83f4df618c9737fcee8bd @@ -4902,8 +4902,8 @@ trackedFiles: pristine_git_object: 4bd9c617481dd976fa0ea7c49103446580744ab2 src/main/java/com/gr4vy/sdk/models/operations//async/ListPayoutsRequestBuilder.java: id: becd331cbe79 - last_write_checksum: sha1:b31acb55060e253d52be51e863ed846f3bbae219 - pristine_git_object: 4a945edf31e4ff01e422ac6b5d800c71c68227c6 + last_write_checksum: sha1:f7e0fe82a83b887f01d669bee1057304898f359b + pristine_git_object: 661bf2cce5207e40838a87f7c23d4382e13dda1e src/main/java/com/gr4vy/sdk/models/operations//async/ListReportExecutionsRequestBuilder.java: id: 37f5a16a0bf5 last_write_checksum: sha1:5595803897c1b5ed9194e1d448cc2a470b22d2b6 @@ -5998,12 +5998,12 @@ trackedFiles: pristine_git_object: d813e6dd151043b0b8fe0d92dda093e49a272fbc src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsRequest.java: id: 18b46ff85caa - last_write_checksum: sha1:b76dfa61f6f590c6a107358dc23b6524c55d85ff - pristine_git_object: 67a7c47feaf20cebf761d28efe771ddc6261e824 + last_write_checksum: sha1:69edc8ccf40330a8c0a3420ce5610c89019081cc + pristine_git_object: 35205ec9bcd54d38f314c3bbe1360a67fcf9deca src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsRequestBuilder.java: id: 2255045436f9 - last_write_checksum: sha1:a9011a89933862fc0218e12fc3fe4624eb6edc96 - pristine_git_object: d469174121b90e3c2a08e1f5a13214f9bec35cf3 + last_write_checksum: sha1:007d786a3d2ba16a8a35a62268c5ba413dbc4791 + pristine_git_object: 4038ffafa33206e4f54a5ae9b1e4cba0507a6b64 src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsResponse.java: id: 880f269c81ff last_write_checksum: sha1:8c4aa6b531de0a50e495c91113ce1935f1290cc7 @@ -11477,7 +11477,9 @@ examples: application/json: {"type": "error", "code": "gateway_timeout", "status": 504, "message": "Request could not be processed"} examplesVersion: 1.0.2 generatedTests: {} -releaseNotes: "## Java SDK Changes:\n* `gr4vy.transactions.create()`: \n * `request.transactionCreate.connectionOptions.stripeCard.customerId` **Added**\n* `gr4vy.transactions.update()`: \n * `request.transactionUpdate.connectionOptions.stripeCard.customerId` **Added**\n* `gr4vy.paymentLinks.create()`: \n * `request.paymentLinkCreate.connectionOptions.stripeCard.customerId` **Added**\n" +releaseNotes: | + ## Java SDK Changes: + * `gr4vy.payouts.list()`: `request` **Changed** (Breaking ⚠️) generatedFiles: - .gitattributes - USAGE.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index a0ff116c..c6525d80 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -30,7 +30,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false java: - version: 2.16.96 + version: 2.16.97 additionalDependencies: - testImplementation:org.junit.jupiter:junit-jupiter:5.10.0 - implementation:com.auth0:java-jwt:4.5.0 diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 35018c88..d2503e91 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,4 +1,4 @@ -speakeasyVersion: 1.784.1 +speakeasyVersion: 1.785.0 sources: Gr4vy: sourceNamespace: openapi @@ -9,8 +9,8 @@ sources: - 1.0.0 openapi: sourceNamespace: openapi - sourceRevisionDigest: sha256:e626fe2823ebef0de9d5e508900ea4cf19ecd26ce8f3838e99dae4052c343725 - sourceBlobDigest: sha256:77daf457ab2d159b33081c46481ab66e8cf69fc2d761b60636ecd490928f28b9 + sourceRevisionDigest: sha256:54be5e43abd6df230347c759940a7108a664204e0d5ecf923578045c742884fc + sourceBlobDigest: sha256:5d9d3bf1956ff83447d51874da255166fae0173f407a0bd3cd24b6ee58baacc6 tags: - latest - 1.0.0 @@ -25,10 +25,10 @@ targets: java: source: openapi sourceNamespace: openapi - sourceRevisionDigest: sha256:e626fe2823ebef0de9d5e508900ea4cf19ecd26ce8f3838e99dae4052c343725 - sourceBlobDigest: sha256:77daf457ab2d159b33081c46481ab66e8cf69fc2d761b60636ecd490928f28b9 + sourceRevisionDigest: sha256:54be5e43abd6df230347c759940a7108a664204e0d5ecf923578045c742884fc + sourceBlobDigest: sha256:5d9d3bf1956ff83447d51874da255166fae0173f407a0bd3cd24b6ee58baacc6 codeSamplesNamespace: openapi-java-code-samples - codeSamplesRevisionDigest: sha256:7cbac8907cce87ccd671c4939e8e1c599d362a7c54b2e7637f20ddea2d5a5d0f + codeSamplesRevisionDigest: sha256:4b475774c4b031b2e23c5bfb0851b2729188a5af31507cc1e4fa663de9edf3a8 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 6b705c92..c97f38e5 100644 --- a/README.md +++ b/README.md @@ -59,7 +59,7 @@ The samples below show how a published SDK artifact is used: Gradle: ```groovy -implementation 'com.gr4vy:sdk:2.16.96' +implementation 'com.gr4vy:sdk:2.16.97' ``` Maven: @@ -67,7 +67,7 @@ Maven: com.gr4vy sdk - 2.16.96 + 2.16.97 ``` diff --git a/RELEASES.md b/RELEASES.md index af64e49d..49d6cc6d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1798,4 +1798,14 @@ Based on: ### Generated - [java v2.16.96] . ### Releases -- [Maven Central v2.16.96] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.96 - . \ No newline at end of file +- [Maven Central v2.16.96] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.96 - . + +## 2026-06-24 07:57:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.785.0 (2.912.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [java v2.16.97] . +### Releases +- [Maven Central v2.16.97] https://central.sonatype.com/artifact/com.gr4vy/sdk/2.16.97 - . \ No newline at end of file diff --git a/docs/models/operations/ListPayoutsRequest.md b/docs/models/operations/ListPayoutsRequest.md index 630fdc94..cf281459 100644 --- a/docs/models/operations/ListPayoutsRequest.md +++ b/docs/models/operations/ListPayoutsRequest.md @@ -3,8 +3,15 @@ ## Fields -| Field | Type | Required | Description | Example | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `cursor` | *JsonNullable\* | :heavy_minus_sign: | A pointer to the page of results to return. | ZXhhbXBsZTE | -| `limit` | *Optional\* | :heavy_minus_sign: | The maximum number of items that are at returned. | 20 | -| `merchantAccountId` | *JsonNullable\* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | | \ No newline at end of file +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `cursor` | *JsonNullable\* | :heavy_minus_sign: | A pointer to the page of results to return. | ZXhhbXBsZTE | +| `limit` | *Optional\* | :heavy_minus_sign: | The maximum number of items that are at returned. | 20 | +| `createdAtLte` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | Filters the results to only payouts created before this ISO date-time string. The time zone must be included. Ensure that the date-time string is URL encoded, e.g. `2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. | 2022-01-01T12:00:00+08:00 | +| `createdAtGte` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | Filters the results to only payouts created after this ISO date-time string. The time zone must be included. Ensure that the date-time string is URL encoded, e.g. `2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. | 2022-01-01T12:00:00+08:00 | +| `updatedAtLte` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | Filters the results to only payouts updated before this ISO date-time string. The time zone must be included. Ensure that the date-time string is URL encoded, e.g. `2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. | 2022-01-01T12:00:00+08:00 | +| `updatedAtGte` | [OffsetDateTime](https://docs.oracle.com/javase/8/docs/api/java/time/OffsetDateTime.html) | :heavy_minus_sign: | Filters the results to only payouts updated after this ISO date-time string. The time zone must be included. Ensure that the date-time string is URL encoded, e.g. `2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. | 2022-01-01T12:00:00+08:00 | +| `externalIdentifier` | *JsonNullable\* | :heavy_minus_sign: | Filters the results to only the payouts that have an `external_identifier` that exactly matches this value. | payout-12345 | +| `paymentServicePayoutId` | *JsonNullable\* | :heavy_minus_sign: | Filters the results to only the payouts that have a `payment_service_payout_id` that exactly matches this value. | po_1234567890 | +| `status` | List\<[PayoutStatus](../../models/components/PayoutStatus.md)> | :heavy_minus_sign: | Filters the results to only the payouts that have a `status` that matches with any of the provided status values. | | +| `merchantAccountId` | *JsonNullable\* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | | \ No newline at end of file diff --git a/docs/sdks/payouts/README.md b/docs/sdks/payouts/README.md index 641062ef..d3791fbd 100644 --- a/docs/sdks/payouts/README.md +++ b/docs/sdks/payouts/README.md @@ -20,6 +20,7 @@ package hello.world; import com.gr4vy.sdk.Gr4vy; import com.gr4vy.sdk.models.errors.*; +import com.gr4vy.sdk.models.operations.ListPayoutsRequest; import com.gr4vy.sdk.models.operations.ListPayoutsResponse; import java.lang.Exception; @@ -32,10 +33,12 @@ public class Application { .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", "")) .build(); + ListPayoutsRequest req = ListPayoutsRequest.builder() + .cursor("ZXhhbXBsZTE") + .build(); + sdk.payouts().list() - .cursor("ZXhhbXBsZTE") - .limit(20L) .callAsStream() .forEach((ListPayoutsResponse item) -> { // handle page @@ -47,11 +50,9 @@ public class Application { ### Parameters -| Parameter | Type | Required | Description | Example | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `cursor` | *JsonNullable\* | :heavy_minus_sign: | A pointer to the page of results to return. | ZXhhbXBsZTE | -| `limit` | *Optional\* | :heavy_minus_sign: | The maximum number of items that are at returned. | 20 | -| `merchantAccountId` | *JsonNullable\* | :heavy_minus_sign: | The ID of the merchant account to use for this request. | | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `request` | [ListPayoutsRequest](../../models/operations/ListPayoutsRequest.md) | :heavy_check_mark: | The request object to use for the request. | ### Response diff --git a/gradle.properties b/gradle.properties index 9af89400..b981ae6b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ groupId=com.gr4vy artifactId=sdk -version=2.16.96 +version=2.16.97 org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/src/main/java/com/gr4vy/sdk/AsyncPayouts.java b/src/main/java/com/gr4vy/sdk/AsyncPayouts.java index 82671f8f..af1b4ed6 100644 --- a/src/main/java/com/gr4vy/sdk/AsyncPayouts.java +++ b/src/main/java/com/gr4vy/sdk/AsyncPayouts.java @@ -20,7 +20,6 @@ import com.gr4vy.sdk.operations.ListPayouts; import com.gr4vy.sdk.utils.Headers; import com.gr4vy.sdk.utils.Options; -import java.lang.Long; import java.lang.String; import java.util.Optional; import java.util.concurrent.CompletableFuture; @@ -63,12 +62,11 @@ public ListPayoutsRequestBuilder list() { * *

Returns a list of payouts made. * + * @param request The request object containing all the parameters for the API call. * @return {@code CompletableFuture} - The async response */ - public CompletableFuture listDirect() { - return list( - JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + public CompletableFuture list(ListPayoutsRequest request) { + return list(request, Optional.empty()); } /** @@ -76,22 +74,11 @@ public CompletableFuture listDirect() { * *

Returns a list of payouts made. * - * @param cursor A pointer to the page of results to return. - * @param limit The maximum number of items that are at returned. - * @param merchantAccountId + * @param request The request object containing all the parameters for the API call. * @param options additional options * @return {@code CompletableFuture} - The async response */ - public CompletableFuture list( - JsonNullable cursor, Optional limit, - JsonNullable merchantAccountId, Optional options) { - ListPayoutsRequest request = - ListPayoutsRequest - .builder() - .cursor(cursor) - .limit(limit) - .merchantAccountId(merchantAccountId) - .build(); + public CompletableFuture list(ListPayoutsRequest request, Optional options) { AsyncRequestOperation operation = new ListPayouts.Async( sdkConfiguration, options, sdkConfiguration.retryScheduler(), diff --git a/src/main/java/com/gr4vy/sdk/Payouts.java b/src/main/java/com/gr4vy/sdk/Payouts.java index 4bc5c22a..db7a6f5f 100644 --- a/src/main/java/com/gr4vy/sdk/Payouts.java +++ b/src/main/java/com/gr4vy/sdk/Payouts.java @@ -20,7 +20,6 @@ import com.gr4vy.sdk.operations.ListPayouts; import com.gr4vy.sdk.utils.Headers; import com.gr4vy.sdk.utils.Options; -import java.lang.Long; import java.lang.String; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -61,12 +60,12 @@ public ListPayoutsRequestBuilder list() { * *

Returns a list of payouts made. * + * @param request The request object containing all the parameters for the API call. * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ - public ListPayoutsResponse listDirect() { - return list(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), - Optional.empty()); + public ListPayoutsResponse list(ListPayoutsRequest request) { + return list(request, Optional.empty()); } /** @@ -74,23 +73,12 @@ public ListPayoutsResponse listDirect() { * *

Returns a list of payouts made. * - * @param cursor A pointer to the page of results to return. - * @param limit The maximum number of items that are at returned. - * @param merchantAccountId + * @param request The request object containing all the parameters for the API call. * @param options additional options * @return The response from the API call * @throws RuntimeException subclass if the API call fails */ - public ListPayoutsResponse list( - JsonNullable cursor, Optional limit, - JsonNullable merchantAccountId, Optional options) { - ListPayoutsRequest request = - ListPayoutsRequest - .builder() - .cursor(cursor) - .limit(limit) - .merchantAccountId(merchantAccountId) - .build(); + public ListPayoutsResponse list(ListPayoutsRequest request, Optional options) { RequestOperation operation = new ListPayouts.Sync(sdkConfiguration, options, _headers); return operation.handleResponse(operation.doRequest(request)); diff --git a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java index 14018d0b..4bb82e55 100644 --- a/src/main/java/com/gr4vy/sdk/SDKConfiguration.java +++ b/src/main/java/com/gr4vy/sdk/SDKConfiguration.java @@ -22,8 +22,8 @@ public class SDKConfiguration { private static final String LANGUAGE = "java"; public static final String OPENAPI_DOC_VERSION = "1.0.0"; - public static final String SDK_VERSION = "2.16.96"; - public static final String GEN_VERSION = "2.911.3"; + public static final String SDK_VERSION = "2.16.97"; + public static final String GEN_VERSION = "2.912.1"; private static final String BASE_PACKAGE = "com.gr4vy.sdk"; public static final String USER_AGENT = String.format("speakeasy-sdk/%s %s %s %s %s", diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsRequest.java b/src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsRequest.java index 67a7c47f..35205ec9 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsRequest.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsRequest.java @@ -6,12 +6,16 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.core.type.TypeReference; +import com.gr4vy.sdk.models.components.PayoutStatus; import com.gr4vy.sdk.utils.LazySingletonValue; import com.gr4vy.sdk.utils.SpeakeasyMetadata; import com.gr4vy.sdk.utils.Utils; import java.lang.Long; import java.lang.Override; import java.lang.String; +import java.lang.SuppressWarnings; +import java.time.OffsetDateTime; +import java.util.List; import java.util.Optional; import org.openapitools.jackson.nullable.JsonNullable; @@ -29,6 +33,63 @@ public class ListPayoutsRequest { @SpeakeasyMetadata("queryParam:style=form,explode=true,name=limit") private Optional limit; + /** + * Filters the results to only payouts created before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=created_at_lte") + private JsonNullable createdAtLte; + + /** + * Filters the results to only payouts created after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=created_at_gte") + private JsonNullable createdAtGte; + + /** + * Filters the results to only payouts updated before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=updated_at_lte") + private JsonNullable updatedAtLte; + + /** + * Filters the results to only payouts updated after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=updated_at_gte") + private JsonNullable updatedAtGte; + + /** + * Filters the results to only the payouts that have an `external_identifier` that exactly matches this + * value. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=external_identifier") + private JsonNullable externalIdentifier; + + /** + * Filters the results to only the payouts that have a `payment_service_payout_id` that exactly matches + * this value. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=payment_service_payout_id") + private JsonNullable paymentServicePayoutId; + + /** + * Filters the results to only the payouts that have a `status` that matches with any of the provided + * status values. + */ + @SpeakeasyMetadata("queryParam:style=form,explode=true,name=status") + private JsonNullable> status; + /** * The ID of the merchant account to use for this request. */ @@ -39,17 +100,41 @@ public class ListPayoutsRequest { public ListPayoutsRequest( JsonNullable cursor, Optional limit, + JsonNullable createdAtLte, + JsonNullable createdAtGte, + JsonNullable updatedAtLte, + JsonNullable updatedAtGte, + JsonNullable externalIdentifier, + JsonNullable paymentServicePayoutId, + JsonNullable> status, JsonNullable merchantAccountId) { Utils.checkNotNull(cursor, "cursor"); Utils.checkNotNull(limit, "limit"); + Utils.checkNotNull(createdAtLte, "createdAtLte"); + Utils.checkNotNull(createdAtGte, "createdAtGte"); + Utils.checkNotNull(updatedAtLte, "updatedAtLte"); + Utils.checkNotNull(updatedAtGte, "updatedAtGte"); + Utils.checkNotNull(externalIdentifier, "externalIdentifier"); + Utils.checkNotNull(paymentServicePayoutId, "paymentServicePayoutId"); + Utils.checkNotNull(status, "status"); Utils.checkNotNull(merchantAccountId, "merchantAccountId"); this.cursor = cursor; this.limit = limit; + this.createdAtLte = createdAtLte; + this.createdAtGte = createdAtGte; + this.updatedAtLte = updatedAtLte; + this.updatedAtGte = updatedAtGte; + this.externalIdentifier = externalIdentifier; + this.paymentServicePayoutId = paymentServicePayoutId; + this.status = status; this.merchantAccountId = merchantAccountId; } public ListPayoutsRequest() { - this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined()); + this(JsonNullable.undefined(), Optional.empty(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined(), JsonNullable.undefined(), JsonNullable.undefined(), + JsonNullable.undefined()); } /** @@ -68,6 +153,78 @@ public Optional limit() { return limit; } + /** + * Filters the results to only payouts created before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + @JsonIgnore + public JsonNullable createdAtLte() { + return createdAtLte; + } + + /** + * Filters the results to only payouts created after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + @JsonIgnore + public JsonNullable createdAtGte() { + return createdAtGte; + } + + /** + * Filters the results to only payouts updated before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + @JsonIgnore + public JsonNullable updatedAtLte() { + return updatedAtLte; + } + + /** + * Filters the results to only payouts updated after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + @JsonIgnore + public JsonNullable updatedAtGte() { + return updatedAtGte; + } + + /** + * Filters the results to only the payouts that have an `external_identifier` that exactly matches this + * value. + */ + @JsonIgnore + public JsonNullable externalIdentifier() { + return externalIdentifier; + } + + /** + * Filters the results to only the payouts that have a `payment_service_payout_id` that exactly matches + * this value. + */ + @JsonIgnore + public JsonNullable paymentServicePayoutId() { + return paymentServicePayoutId; + } + + /** + * Filters the results to only the payouts that have a `status` that matches with any of the provided + * status values. + */ + @SuppressWarnings("unchecked") + @JsonIgnore + public JsonNullable> status() { + return (JsonNullable>) status; + } + /** * The ID of the merchant account to use for this request. */ @@ -118,6 +275,162 @@ public ListPayoutsRequest withLimit(Optional limit) { return this; } + /** + * Filters the results to only payouts created before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public ListPayoutsRequest withCreatedAtLte(OffsetDateTime createdAtLte) { + Utils.checkNotNull(createdAtLte, "createdAtLte"); + this.createdAtLte = JsonNullable.of(createdAtLte); + return this; + } + + /** + * Filters the results to only payouts created before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public ListPayoutsRequest withCreatedAtLte(JsonNullable createdAtLte) { + Utils.checkNotNull(createdAtLte, "createdAtLte"); + this.createdAtLte = createdAtLte; + return this; + } + + /** + * Filters the results to only payouts created after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public ListPayoutsRequest withCreatedAtGte(OffsetDateTime createdAtGte) { + Utils.checkNotNull(createdAtGte, "createdAtGte"); + this.createdAtGte = JsonNullable.of(createdAtGte); + return this; + } + + /** + * Filters the results to only payouts created after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public ListPayoutsRequest withCreatedAtGte(JsonNullable createdAtGte) { + Utils.checkNotNull(createdAtGte, "createdAtGte"); + this.createdAtGte = createdAtGte; + return this; + } + + /** + * Filters the results to only payouts updated before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public ListPayoutsRequest withUpdatedAtLte(OffsetDateTime updatedAtLte) { + Utils.checkNotNull(updatedAtLte, "updatedAtLte"); + this.updatedAtLte = JsonNullable.of(updatedAtLte); + return this; + } + + /** + * Filters the results to only payouts updated before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public ListPayoutsRequest withUpdatedAtLte(JsonNullable updatedAtLte) { + Utils.checkNotNull(updatedAtLte, "updatedAtLte"); + this.updatedAtLte = updatedAtLte; + return this; + } + + /** + * Filters the results to only payouts updated after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public ListPayoutsRequest withUpdatedAtGte(OffsetDateTime updatedAtGte) { + Utils.checkNotNull(updatedAtGte, "updatedAtGte"); + this.updatedAtGte = JsonNullable.of(updatedAtGte); + return this; + } + + /** + * Filters the results to only payouts updated after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public ListPayoutsRequest withUpdatedAtGte(JsonNullable updatedAtGte) { + Utils.checkNotNull(updatedAtGte, "updatedAtGte"); + this.updatedAtGte = updatedAtGte; + return this; + } + + /** + * Filters the results to only the payouts that have an `external_identifier` that exactly matches this + * value. + */ + public ListPayoutsRequest withExternalIdentifier(String externalIdentifier) { + Utils.checkNotNull(externalIdentifier, "externalIdentifier"); + this.externalIdentifier = JsonNullable.of(externalIdentifier); + return this; + } + + /** + * Filters the results to only the payouts that have an `external_identifier` that exactly matches this + * value. + */ + public ListPayoutsRequest withExternalIdentifier(JsonNullable externalIdentifier) { + Utils.checkNotNull(externalIdentifier, "externalIdentifier"); + this.externalIdentifier = externalIdentifier; + return this; + } + + /** + * Filters the results to only the payouts that have a `payment_service_payout_id` that exactly matches + * this value. + */ + public ListPayoutsRequest withPaymentServicePayoutId(String paymentServicePayoutId) { + Utils.checkNotNull(paymentServicePayoutId, "paymentServicePayoutId"); + this.paymentServicePayoutId = JsonNullable.of(paymentServicePayoutId); + return this; + } + + /** + * Filters the results to only the payouts that have a `payment_service_payout_id` that exactly matches + * this value. + */ + public ListPayoutsRequest withPaymentServicePayoutId(JsonNullable paymentServicePayoutId) { + Utils.checkNotNull(paymentServicePayoutId, "paymentServicePayoutId"); + this.paymentServicePayoutId = paymentServicePayoutId; + return this; + } + + /** + * Filters the results to only the payouts that have a `status` that matches with any of the provided + * status values. + */ + public ListPayoutsRequest withStatus(List status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * Filters the results to only the payouts that have a `status` that matches with any of the provided + * status values. + */ + public ListPayoutsRequest withStatus(JsonNullable> status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + /** * The ID of the merchant account to use for this request. */ @@ -148,13 +461,23 @@ public boolean equals(java.lang.Object o) { return Utils.enhancedDeepEquals(this.cursor, other.cursor) && Utils.enhancedDeepEquals(this.limit, other.limit) && + Utils.enhancedDeepEquals(this.createdAtLte, other.createdAtLte) && + Utils.enhancedDeepEquals(this.createdAtGte, other.createdAtGte) && + Utils.enhancedDeepEquals(this.updatedAtLte, other.updatedAtLte) && + Utils.enhancedDeepEquals(this.updatedAtGte, other.updatedAtGte) && + Utils.enhancedDeepEquals(this.externalIdentifier, other.externalIdentifier) && + Utils.enhancedDeepEquals(this.paymentServicePayoutId, other.paymentServicePayoutId) && + Utils.enhancedDeepEquals(this.status, other.status) && Utils.enhancedDeepEquals(this.merchantAccountId, other.merchantAccountId); } @Override public int hashCode() { return Utils.enhancedHash( - cursor, limit, merchantAccountId); + cursor, limit, createdAtLte, + createdAtGte, updatedAtLte, updatedAtGte, + externalIdentifier, paymentServicePayoutId, status, + merchantAccountId); } @Override @@ -162,6 +485,13 @@ public String toString() { return Utils.toString(ListPayoutsRequest.class, "cursor", cursor, "limit", limit, + "createdAtLte", createdAtLte, + "createdAtGte", createdAtGte, + "updatedAtLte", updatedAtLte, + "updatedAtGte", updatedAtGte, + "externalIdentifier", externalIdentifier, + "paymentServicePayoutId", paymentServicePayoutId, + "status", status, "merchantAccountId", merchantAccountId); } @@ -172,6 +502,20 @@ public final static class Builder { private Optional limit; + private JsonNullable createdAtLte = JsonNullable.undefined(); + + private JsonNullable createdAtGte = JsonNullable.undefined(); + + private JsonNullable updatedAtLte = JsonNullable.undefined(); + + private JsonNullable updatedAtGte = JsonNullable.undefined(); + + private JsonNullable externalIdentifier = JsonNullable.undefined(); + + private JsonNullable paymentServicePayoutId = JsonNullable.undefined(); + + private JsonNullable> status = JsonNullable.undefined(); + private JsonNullable merchantAccountId = JsonNullable.undefined(); private Builder() { @@ -217,6 +561,169 @@ public Builder limit(Optional limit) { } + /** + * Filters the results to only payouts created before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public Builder createdAtLte(OffsetDateTime createdAtLte) { + Utils.checkNotNull(createdAtLte, "createdAtLte"); + this.createdAtLte = JsonNullable.of(createdAtLte); + return this; + } + + /** + * Filters the results to only payouts created before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public Builder createdAtLte(JsonNullable createdAtLte) { + Utils.checkNotNull(createdAtLte, "createdAtLte"); + this.createdAtLte = createdAtLte; + return this; + } + + + /** + * Filters the results to only payouts created after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public Builder createdAtGte(OffsetDateTime createdAtGte) { + Utils.checkNotNull(createdAtGte, "createdAtGte"); + this.createdAtGte = JsonNullable.of(createdAtGte); + return this; + } + + /** + * Filters the results to only payouts created after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public Builder createdAtGte(JsonNullable createdAtGte) { + Utils.checkNotNull(createdAtGte, "createdAtGte"); + this.createdAtGte = createdAtGte; + return this; + } + + + /** + * Filters the results to only payouts updated before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public Builder updatedAtLte(OffsetDateTime updatedAtLte) { + Utils.checkNotNull(updatedAtLte, "updatedAtLte"); + this.updatedAtLte = JsonNullable.of(updatedAtLte); + return this; + } + + /** + * Filters the results to only payouts updated before this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public Builder updatedAtLte(JsonNullable updatedAtLte) { + Utils.checkNotNull(updatedAtLte, "updatedAtLte"); + this.updatedAtLte = updatedAtLte; + return this; + } + + + /** + * Filters the results to only payouts updated after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public Builder updatedAtGte(OffsetDateTime updatedAtGte) { + Utils.checkNotNull(updatedAtGte, "updatedAtGte"); + this.updatedAtGte = JsonNullable.of(updatedAtGte); + return this; + } + + /** + * Filters the results to only payouts updated after this ISO date-time string. The time zone must be + * included. Ensure that the date-time string is URL encoded, e.g. + * + *

`2022-01-01T12:00:00+08:00` must be encoded as `2022-01-01T12%3A00%3A00%2B08%3A00`. + */ + public Builder updatedAtGte(JsonNullable updatedAtGte) { + Utils.checkNotNull(updatedAtGte, "updatedAtGte"); + this.updatedAtGte = updatedAtGte; + return this; + } + + + /** + * Filters the results to only the payouts that have an `external_identifier` that exactly matches this + * value. + */ + public Builder externalIdentifier(String externalIdentifier) { + Utils.checkNotNull(externalIdentifier, "externalIdentifier"); + this.externalIdentifier = JsonNullable.of(externalIdentifier); + return this; + } + + /** + * Filters the results to only the payouts that have an `external_identifier` that exactly matches this + * value. + */ + public Builder externalIdentifier(JsonNullable externalIdentifier) { + Utils.checkNotNull(externalIdentifier, "externalIdentifier"); + this.externalIdentifier = externalIdentifier; + return this; + } + + + /** + * Filters the results to only the payouts that have a `payment_service_payout_id` that exactly matches + * this value. + */ + public Builder paymentServicePayoutId(String paymentServicePayoutId) { + Utils.checkNotNull(paymentServicePayoutId, "paymentServicePayoutId"); + this.paymentServicePayoutId = JsonNullable.of(paymentServicePayoutId); + return this; + } + + /** + * Filters the results to only the payouts that have a `payment_service_payout_id` that exactly matches + * this value. + */ + public Builder paymentServicePayoutId(JsonNullable paymentServicePayoutId) { + Utils.checkNotNull(paymentServicePayoutId, "paymentServicePayoutId"); + this.paymentServicePayoutId = paymentServicePayoutId; + return this; + } + + + /** + * Filters the results to only the payouts that have a `status` that matches with any of the provided + * status values. + */ + public Builder status(List status) { + Utils.checkNotNull(status, "status"); + this.status = JsonNullable.of(status); + return this; + } + + /** + * Filters the results to only the payouts that have a `status` that matches with any of the provided + * status values. + */ + public Builder status(JsonNullable> status) { + Utils.checkNotNull(status, "status"); + this.status = status; + return this; + } + + /** * The ID of the merchant account to use for this request. */ @@ -241,7 +748,10 @@ public ListPayoutsRequest build() { } return new ListPayoutsRequest( - cursor, limit, merchantAccountId); + cursor, limit, createdAtLte, + createdAtGte, updatedAtLte, updatedAtGte, + externalIdentifier, paymentServicePayoutId, status, + merchantAccountId); } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsRequestBuilder.java index d4691741..4038ffaf 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsRequestBuilder.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/ListPayoutsRequestBuilder.java @@ -8,11 +8,9 @@ import static com.gr4vy.sdk.utils.Utils.transform; import static com.gr4vy.sdk.utils.Utils.toStream; -import com.fasterxml.jackson.core.type.TypeReference; import com.gr4vy.sdk.SDKConfiguration; import com.gr4vy.sdk.operations.ListPayouts; import com.gr4vy.sdk.utils.Headers; -import com.gr4vy.sdk.utils.LazySingletonValue; import com.gr4vy.sdk.utils.Options; import com.gr4vy.sdk.utils.RetryConfig; import com.gr4vy.sdk.utils.Utils; @@ -20,22 +18,15 @@ import com.gr4vy.sdk.utils.pagination.Paginator; import java.io.InputStream; import java.lang.Iterable; -import java.lang.Long; import java.lang.String; import java.net.http.HttpResponse; import java.util.Iterator; import java.util.Optional; import java.util.stream.Stream; -import org.openapitools.jackson.nullable.JsonNullable; public class ListPayoutsRequestBuilder { - private JsonNullable cursor = JsonNullable.undefined(); - private Optional limit = Utils.readDefaultOrConstValue( - "limit", - "20", - new TypeReference>() {}); - private JsonNullable merchantAccountId = JsonNullable.undefined(); + private ListPayoutsRequest request; private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; private final Headers _headers = new Headers(); @@ -44,39 +35,9 @@ public ListPayoutsRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; } - public ListPayoutsRequestBuilder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } - - public ListPayoutsRequestBuilder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - public ListPayoutsRequestBuilder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.of(limit); - return this; - } - - public ListPayoutsRequestBuilder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = limit; - return this; - } - - public ListPayoutsRequestBuilder merchantAccountId(String merchantAccountId) { - Utils.checkNotNull(merchantAccountId, "merchantAccountId"); - this.merchantAccountId = JsonNullable.of(merchantAccountId); - return this; - } - - public ListPayoutsRequestBuilder merchantAccountId(JsonNullable merchantAccountId) { - Utils.checkNotNull(merchantAccountId, "merchantAccountId"); - this.merchantAccountId = merchantAccountId; + public ListPayoutsRequestBuilder request(ListPayoutsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; return this; } @@ -92,19 +53,6 @@ public ListPayoutsRequestBuilder retryConfig(Optional retryConfig) return this; } - - private ListPayoutsRequest buildRequest() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - - ListPayoutsRequest request = new ListPayoutsRequest(cursor, - limit, - merchantAccountId); - - return request; - } - public ListPayoutsResponse call() { Optional options = Optional.of(Options.builder() .retryConfig(retryConfig) @@ -112,7 +60,6 @@ public ListPayoutsResponse call() { RequestOperation operation = new ListPayouts.Sync(sdkConfiguration, options, _headers); - ListPayoutsRequest request = buildRequest(); return operation.handleResponse(operation.doRequest(request)); } @@ -137,7 +84,6 @@ public Iterable callAsIterable() { RequestOperation operation = new ListPayouts.Sync(sdkConfiguration, options, _headers); - ListPayoutsRequest request = buildRequest(); Iterator> iterator = new Paginator<>( request, new CursorTracker<>("$.next_cursor", String.class), @@ -157,10 +103,4 @@ public Stream callAsStream() { return toStream(callAsIterable()); } - - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = - new LazySingletonValue<>( - "limit", - "20", - new TypeReference>() {}); } diff --git a/src/main/java/com/gr4vy/sdk/models/operations/async/ListPayoutsRequestBuilder.java b/src/main/java/com/gr4vy/sdk/models/operations/async/ListPayoutsRequestBuilder.java index 4a945edf..661bf2cc 100644 --- a/src/main/java/com/gr4vy/sdk/models/operations/async/ListPayoutsRequestBuilder.java +++ b/src/main/java/com/gr4vy/sdk/models/operations/async/ListPayoutsRequestBuilder.java @@ -6,36 +6,27 @@ import static com.gr4vy.sdk.operations.Operations.AsyncRequestOperation; import static com.gr4vy.sdk.utils.reactive.ReactiveUtils.mapAsync; -import com.fasterxml.jackson.core.type.TypeReference; import com.gr4vy.sdk.SDKConfiguration; import com.gr4vy.sdk.models.operations.ListPayoutsRequest; import com.gr4vy.sdk.operations.ListPayouts; import com.gr4vy.sdk.utils.Blob; import com.gr4vy.sdk.utils.Headers; -import com.gr4vy.sdk.utils.LazySingletonValue; import com.gr4vy.sdk.utils.Options; import com.gr4vy.sdk.utils.RetryConfig; import com.gr4vy.sdk.utils.Utils; import com.gr4vy.sdk.utils.pagination.AsyncPaginator; import com.gr4vy.sdk.utils.pagination.CursorTracker; -import java.lang.Long; import java.lang.String; import java.net.http.HttpResponse; import java.util.Optional; import java.util.concurrent.CompletableFuture; import java.util.concurrent.Flow; -import org.openapitools.jackson.nullable.JsonNullable; import org.reactivestreams.FlowAdapters; import org.reactivestreams.Publisher; public class ListPayoutsRequestBuilder { - private JsonNullable cursor = JsonNullable.undefined(); - private Optional limit = Utils.readDefaultOrConstValue( - "limit", - "20", - new TypeReference>() {}); - private JsonNullable merchantAccountId = JsonNullable.undefined(); + private ListPayoutsRequest request; private Optional retryConfig = Optional.empty(); private final SDKConfiguration sdkConfiguration; private final Headers _headers = new Headers(); @@ -44,39 +35,9 @@ public ListPayoutsRequestBuilder(SDKConfiguration sdkConfiguration) { this.sdkConfiguration = sdkConfiguration; } - public ListPayoutsRequestBuilder cursor(String cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = JsonNullable.of(cursor); - return this; - } - - public ListPayoutsRequestBuilder cursor(JsonNullable cursor) { - Utils.checkNotNull(cursor, "cursor"); - this.cursor = cursor; - return this; - } - - public ListPayoutsRequestBuilder limit(long limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = Optional.of(limit); - return this; - } - - public ListPayoutsRequestBuilder limit(Optional limit) { - Utils.checkNotNull(limit, "limit"); - this.limit = limit; - return this; - } - - public ListPayoutsRequestBuilder merchantAccountId(String merchantAccountId) { - Utils.checkNotNull(merchantAccountId, "merchantAccountId"); - this.merchantAccountId = JsonNullable.of(merchantAccountId); - return this; - } - - public ListPayoutsRequestBuilder merchantAccountId(JsonNullable merchantAccountId) { - Utils.checkNotNull(merchantAccountId, "merchantAccountId"); - this.merchantAccountId = merchantAccountId; + public ListPayoutsRequestBuilder request(ListPayoutsRequest request) { + Utils.checkNotNull(request, "request"); + this.request = request; return this; } @@ -92,19 +53,6 @@ public ListPayoutsRequestBuilder retryConfig(Optional retryConfig) return this; } - - private ListPayoutsRequest buildRequest() { - if (limit == null) { - limit = _SINGLETON_VALUE_Limit.value(); - } - - ListPayoutsRequest request = new ListPayoutsRequest(cursor, - limit, - merchantAccountId); - - return request; - } - public CompletableFuture call() { Optional options = Optional.of(Options.builder() .retryConfig(retryConfig) @@ -114,7 +62,6 @@ public CompletableFuture call() { = new ListPayouts.Async( sdkConfiguration, options, sdkConfiguration.retryScheduler(), _headers); - ListPayoutsRequest request = buildRequest(); return operation.doRequest(request) .thenCompose(operation::handleResponse); @@ -135,7 +82,7 @@ public CompletableFuture call() { * @return A Publisher that emits pages asynchronously */ public Publisher callAsPublisher() { - ListPayoutsRequest request = this.buildRequest(); + ListPayoutsRequest request = this.request; Optional options = Optional.of(Options.builder() .retryConfig(retryConfig) .build()); @@ -159,10 +106,4 @@ public Publisher callAsPublisher() { return FlowAdapters.toPublisher(flowPublisher); } - - private static final LazySingletonValue> _SINGLETON_VALUE_Limit = - new LazySingletonValue<>( - "limit", - "20", - new TypeReference>() {}); }