From 83bb09ad14bd1984675c58f7543e767c914bc1c8 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 25 Aug 2026 06:27:37 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-java-sdk: 4.9.1 --- .fern/metadata.json | 6 +- .fern/replay.lock | 10 + .fernignore | 3 + .gitattributes | 1 + README.md | 8 +- reference.md | 376 ++- .../java/com/whop/api/AsyncWhopApiClient.java | 8 + src/main/java/com/whop/api/WhopApiClient.java | 8 + .../java/com/whop/api/core/ClientOptions.java | 2 +- .../adgroups/AsyncRawAdGroupsClient.java | 7 + .../resources/adgroups/RawAdGroupsClient.java | 7 + ...SearchTargetingOptionsAdGroupsRequest.java | 78 +- ...dGroupsRequestSpecialAdCategoriesItem.java | 110 + .../CreateApiKeysRequestApiVersionDate.java | 11 + .../UpdateApiKeysRequestApiVersionDate.java | 11 + .../resources/apps/AsyncRawAppsClient.java | 4 + .../api/resources/apps/RawAppsClient.java | 4 + .../apps/requests/ListAppsRequest.java | 32 + .../AsyncCheckoutSessionsClient.java | 57 + .../AsyncRawCheckoutSessionsClient.java | 141 + .../CheckoutSessionsClient.java | 55 + .../RawCheckoutSessionsClient.java | 118 + .../CreateCheckoutSessionsRequest.java | 798 +++++ ...reateCheckoutSessionsRequestItemsItem.java | 174 ++ .../CreateCheckoutSessionsRequestMode.java | 86 + .../disputes/AsyncDisputesClient.java | 4 +- .../disputes/AsyncRawDisputesClient.java | 4 +- .../resources/disputes/DisputesClient.java | 4 +- .../resources/disputes/RawDisputesClient.java | 4 +- .../requests/CreateExportsRequest.java | 8 +- .../types/CreateExportsRequestResource.java | 30 +- .../types/ListExportsRequestResource.java | 30 +- .../api/resources/files/AsyncFilesClient.java | 32 +- .../resources/files/AsyncRawFilesClient.java | 156 +- .../whop/api/resources/files/FilesClient.java | 32 +- .../api/resources/files/RawFilesClient.java | 127 +- .../files/requests/CompleteFilesRequest.java | 194 ++ .../files/requests/CreateFilesRequest.java | 145 +- ...ompleteFilesRequestMultipartPartsItem.java | 164 + .../types/CreateFilesRequestVisibility.java | 85 + .../files/types/CreateFilesResponse.java | 647 ---- ...FinancialActivityRequestLineTypesItem.java | 639 ++-- .../requests/UpdateInvoicesRequest.java | 4 +- .../types/CreateInvoicesRequestProduct.java | 10 +- .../types/CreateInvoicesRequestProductId.java | 10 +- ...InvoicesRequestProductIdLineItemsItem.java | 8 +- ...teInvoicesRequestProductLineItemsItem.java | 8 +- .../UpdateInvoicesRequestLineItemsItem.java | 8 +- ...ialReportResponseRowsItemLineCategory.java | 24 + ...onseSupportedPayoutMethodDeliveryType.java | 36 +- ...ItemSupportedPayoutMethodDeliveryType.java | 36 +- ...onseSupportedPayoutMethodDeliveryType.java | 36 +- ...edMethodsResponseDataItemDeliveryType.java | 51 +- ...thodSupportedPayoutMethodDeliveryType.java | 36 +- ...thodSupportedPayoutMethodDeliveryType.java | 38 +- ...DataSupportedPayoutMethodDeliveryType.java | 36 +- ...thodSupportedPayoutMethodDeliveryType.java | 38 +- ...thodSupportedPayoutMethodDeliveryType.java | 38 +- ...thodSupportedPayoutMethodDeliveryType.java | 38 +- ...thodSupportedPayoutMethodDeliveryType.java | 37 +- .../api/resources/plans/AsyncPlansClient.java | 18 +- .../resources/plans/AsyncRawPlansClient.java | 24 +- .../whop/api/resources/plans/PlansClient.java | 18 +- .../api/resources/plans/RawPlansClient.java | 23 +- .../plans/requests/ListPlansRequest.java | 408 +-- .../products/AsyncProductsClient.java | 26 +- .../products/AsyncRawProductsClient.java | 63 +- .../resources/products/ProductsClient.java | 26 +- .../resources/products/RawProductsClient.java | 62 +- .../requests/ListProductsRequest.java | 510 ++-- .../ListProductsRequestPlanTypesItem.java | 86 + src/main/java/com/whop/api/types/Account.java | 288 ++ src/main/java/com/whop/api/types/AdGroup.java | 8 +- .../api/types/AdGroupGeoLocationsBody.java | 4 +- .../AdGroupGeoLocationsBodyZipsItemKey.java | 8 +- .../whop/api/types/ApiKeyApiVersionDate.java | 11 + src/main/java/com/whop/api/types/App.java | 45 + .../whop/api/types/AppElementsUsedItem.java | 440 +++ src/main/java/com/whop/api/types/Bounty.java | 130 +- ...r.java => BountyActiveLivestreamFeed.java} | 144 +- .../com/whop/api/types/CheckoutSession.java | 2701 +++++++++++++++++ .../CheckoutSessionAuthenticateAction.java | 128 + .../CheckoutSessionAwaitClaimAction.java | 163 + .../CheckoutSessionAwaitClaimActionState.java | 86 + .../api/types/CheckoutSessionBranding.java | 659 ++++ .../CheckoutSessionBrandingBorderStyle.java | 97 + .../CheckoutSessionBrandingFontFamily.java | 97 + .../api/types/CheckoutSessionBreakdown.java | 387 +++ .../CheckoutSessionBreakdownAdjustment.java | 364 +++ ...koutSessionBreakdownAdjustmentApplied.java | 86 + ...heckoutSessionBreakdownAdjustmentKind.java | 97 + ...ckoutSessionBreakdownAdjustmentStatus.java | 75 + .../CheckoutSessionBreakdownCurrency.java | 966 ++++++ .../CheckoutSessionBreakdownDisplay.java | 165 + ...eckoutSessionBreakdownDisplayHeadline.java | 499 +++ ...utSessionBreakdownDisplayHeadlineKind.java | 97 + .../CheckoutSessionBreakdownDisplayRow.java | 407 +++ ...ckoutSessionBreakdownDisplayRowDetail.java | 533 ++++ ...ssionBreakdownDisplayRowDetailApplied.java | 86 + ...heckoutSessionBreakdownDisplayRowKind.java | 317 ++ ...ckoutSessionBreakdownDisplayRowStatus.java | 75 + ...eckoutSessionBreakdownDisplaySections.java | 222 ++ .../types/CheckoutSessionBreakdownLine.java | 273 ++ .../CheckoutSessionBreakdownLineKind.java | 75 + .../CheckoutSessionBreakdownUpcoming.java | 283 ++ ...tSessionBreakdownUpcomingInstallments.java | 376 +++ ...eckoutSessionBreakdownUpcomingOneTime.java | 197 ++ ...koutSessionBreakdownUpcomingRecurring.java | 328 ++ .../types/CheckoutSessionBuyerIdentity.java | 86 + .../CheckoutSessionBuyerIdentityMethod.java | 119 + .../types/CheckoutSessionCompleteAction.java | 199 ++ .../CheckoutSessionCompleteActionKind.java | 86 + .../types/CheckoutSessionConfirmError.java | 163 + .../CheckoutSessionConfirmErrorCode.java | 394 +++ .../api/types/CheckoutSessionCtaLabel.java | 127 + .../api/types/CheckoutSessionCustomField.java | 382 +++ .../CheckoutSessionCustomFieldFieldType.java | 75 + ...> CheckoutSessionCustomFieldResponse.java} | 104 +- .../whop/api/types/CheckoutSessionEntry.java | 163 + .../api/types/CheckoutSessionEntryStatus.java | 107 + .../whop/api/types/CheckoutSessionItem.java | 494 +++ .../whop/api/types/CheckoutSessionMode.java | 83 + .../api/types/CheckoutSessionNextAction.java | 514 ++++ .../api/types/CheckoutSessionPayment.java | 163 + .../types/CheckoutSessionPaymentStatus.java | 107 + .../whop/api/types/CheckoutSessionPromo.java | 383 +++ .../types/CheckoutSessionPromoCurrency.java | 965 ++++++ .../types/CheckoutSessionPromoDuration.java | 96 + .../types/CheckoutSessionPromoPromoType.java | 86 + .../whop/api/types/CheckoutSessionQuote.java | 441 +++ .../types/CheckoutSessionRedirectAction.java | 163 + .../api/types/CheckoutSessionRequirement.java | 189 ++ .../types/CheckoutSessionRequirementType.java | 128 + .../whop/api/types/CheckoutSessionSeller.java | 382 +++ .../api/types/CheckoutSessionSellerTerms.java | 416 +++ .../types/CheckoutSessionShippingAddress.java | 294 ++ .../whop/api/types/CheckoutSessionStatus.java | 94 + .../api/types/CheckoutSessionTaxBehavior.java | 86 + .../whop/api/types/CheckoutSessionTaxId.java | 163 + .../api/types/CheckoutSessionTaxIdType.java | 1196 ++++++++ .../types/CheckoutSessionThreeDsLevel.java | 86 + .../api/types/CheckoutSessionTransfer.java | 276 ++ ...outSessionUpgradeAuthenticationAction.java | 278 ++ ...gradeAuthenticationActionSignInIntent.java | 75 + .../CheckoutSessionVerifyPhoneAction.java | 128 + .../CheckoutSessionWaitForPaymentAction.java | 163 + .../api/types/DisputeEvidenceDocument.java | 601 +++- .../DisputeEvidenceDocumentUploadStatus.java | 108 + .../DisputeEvidenceDocumentVisibility.java | 86 + .../com/whop/api/types/ExportResource.java | 28 +- src/main/java/com/whop/api/types/File.java | 518 +++- .../com/whop/api/types/FileMultipartUrl.java | 162 + .../com/whop/api/types/FileUploadStatus.java | 103 + .../com/whop/api/types/ForumExperience.java | 47 +- .../api/types/ForumListItemExperience.java | 48 +- .../whop/api/types/InvoiceLineItemsItem.java | 8 +- .../types/InvoiceListItemLineItemsItem.java | 8 +- .../com/whop/api/types/LedgerActivity.java | 72 + .../api/types/LedgerActivityLineType.java | 608 ++-- .../whop/api/types/LedgerActivityPayment.java | 563 ++++ .../types/LedgerActivityPaymentObject.java | 74 + .../whop/api/types/LedgerActivitySource.java | 288 ++ src/main/java/com/whop/api/types/Product.java | 82 +- .../com/whop/api/types/ProductListItem.java | 218 +- .../com/whop/api/types/ProductPublicPlan.java | 547 ++++ .../api/types/ProductPublicPlanPlanType.java | 84 + .../types/ProductPublicPlanVisibility.java | 106 + .../java/com/whop/api/types/Transfer.java | 130 - .../whop/api/types/TransferDestination.java | 221 -- .../api/types/TransferDestinationCompany.java | 196 -- .../com/whop/api/types/TransferOrigin.java | 221 -- .../whop/api/types/TransferOriginUser.java | 236 -- 172 files changed, 28365 insertions(+), 3545 deletions(-) create mode 100644 .fern/replay.lock create mode 100644 .gitattributes create mode 100644 src/main/java/com/whop/api/resources/adgroups/types/SearchTargetingOptionsAdGroupsRequestSpecialAdCategoriesItem.java create mode 100644 src/main/java/com/whop/api/resources/checkoutsessions/AsyncCheckoutSessionsClient.java create mode 100644 src/main/java/com/whop/api/resources/checkoutsessions/AsyncRawCheckoutSessionsClient.java create mode 100644 src/main/java/com/whop/api/resources/checkoutsessions/CheckoutSessionsClient.java create mode 100644 src/main/java/com/whop/api/resources/checkoutsessions/RawCheckoutSessionsClient.java create mode 100644 src/main/java/com/whop/api/resources/checkoutsessions/requests/CreateCheckoutSessionsRequest.java create mode 100644 src/main/java/com/whop/api/resources/checkoutsessions/types/CreateCheckoutSessionsRequestItemsItem.java create mode 100644 src/main/java/com/whop/api/resources/checkoutsessions/types/CreateCheckoutSessionsRequestMode.java create mode 100644 src/main/java/com/whop/api/resources/files/requests/CompleteFilesRequest.java create mode 100644 src/main/java/com/whop/api/resources/files/types/CompleteFilesRequestMultipartPartsItem.java create mode 100644 src/main/java/com/whop/api/resources/files/types/CreateFilesRequestVisibility.java delete mode 100644 src/main/java/com/whop/api/resources/files/types/CreateFilesResponse.java create mode 100644 src/main/java/com/whop/api/resources/products/types/ListProductsRequestPlanTypesItem.java create mode 100644 src/main/java/com/whop/api/types/AppElementsUsedItem.java rename src/main/java/com/whop/api/types/{TransferDestinationUser.java => BountyActiveLivestreamFeed.java} (51%) create mode 100644 src/main/java/com/whop/api/types/CheckoutSession.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionAuthenticateAction.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionAwaitClaimAction.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionAwaitClaimActionState.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBranding.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBrandingBorderStyle.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBrandingFontFamily.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdown.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustment.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentApplied.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentKind.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentStatus.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownCurrency.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplay.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayHeadline.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayHeadlineKind.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRow.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowDetail.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowDetailApplied.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowKind.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowStatus.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplaySections.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownLine.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownLineKind.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcoming.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingInstallments.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingOneTime.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingRecurring.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBuyerIdentity.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionBuyerIdentityMethod.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionCompleteAction.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionCompleteActionKind.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionConfirmError.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionConfirmErrorCode.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionCtaLabel.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionCustomField.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionCustomFieldFieldType.java rename src/main/java/com/whop/api/types/{TransferOriginCompany.java => CheckoutSessionCustomFieldResponse.java} (52%) create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionEntry.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionEntryStatus.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionItem.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionMode.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionNextAction.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionPayment.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionPaymentStatus.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionPromo.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionPromoCurrency.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionPromoDuration.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionPromoPromoType.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionQuote.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionRedirectAction.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionRequirement.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionRequirementType.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionSeller.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionSellerTerms.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionShippingAddress.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionStatus.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionTaxBehavior.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionTaxId.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionTaxIdType.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionThreeDsLevel.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionTransfer.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionUpgradeAuthenticationAction.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionUpgradeAuthenticationActionSignInIntent.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionVerifyPhoneAction.java create mode 100644 src/main/java/com/whop/api/types/CheckoutSessionWaitForPaymentAction.java create mode 100644 src/main/java/com/whop/api/types/DisputeEvidenceDocumentUploadStatus.java create mode 100644 src/main/java/com/whop/api/types/DisputeEvidenceDocumentVisibility.java create mode 100644 src/main/java/com/whop/api/types/FileMultipartUrl.java create mode 100644 src/main/java/com/whop/api/types/FileUploadStatus.java create mode 100644 src/main/java/com/whop/api/types/LedgerActivityPayment.java create mode 100644 src/main/java/com/whop/api/types/LedgerActivityPaymentObject.java create mode 100644 src/main/java/com/whop/api/types/ProductPublicPlan.java create mode 100644 src/main/java/com/whop/api/types/ProductPublicPlanPlanType.java create mode 100644 src/main/java/com/whop/api/types/ProductPublicPlanVisibility.java delete mode 100644 src/main/java/com/whop/api/types/Transfer.java delete mode 100644 src/main/java/com/whop/api/types/TransferDestination.java delete mode 100644 src/main/java/com/whop/api/types/TransferDestinationCompany.java delete mode 100644 src/main/java/com/whop/api/types/TransferOrigin.java delete mode 100644 src/main/java/com/whop/api/types/TransferOriginUser.java diff --git a/.fern/metadata.json b/.fern/metadata.json index 8e4096f6..d754afe9 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -7,10 +7,10 @@ "group": "com.whop.api", "artifact": "whop-java" }, - "originGitCommit": "a26a97d2d8ee29f78819a299712fb3b4086d634e", + "originGitCommit": "348265b135f70060c1ce43c50e4627c092de91e0", "originGitCommitIsDirty": false, "invokedBy": "ci", - "requestedVersion": "1.0.11", + "requestedVersion": "1.0.13", "ciProvider": "unknown", - "sdkVersion": "1.0.11" + "sdkVersion": "1.0.13" } \ No newline at end of file diff --git a/.fern/replay.lock b/.fern/replay.lock new file mode 100644 index 00000000..eb81c445 --- /dev/null +++ b/.fern/replay.lock @@ -0,0 +1,10 @@ +# DO NOT EDIT MANUALLY - Managed by Fern Replay +version: "1.0" +generations: + - commit_sha: 16ad88382c9b9ec024bfc077d46509a0e6d8a725 + tree_hash: 70cb276f7af4c9b4bcacf8010170ede9f3fc2826 + timestamp: 2026-08-25T06:27:34.649Z + cli_version: unknown + generator_versions: {} +current_generation: 16ad88382c9b9ec024bfc077d46509a0e6d8a725 +patches: [] diff --git a/.fernignore b/.fernignore index 084a8ebb..b8eb8bf0 100644 --- a/.fernignore +++ b/.fernignore @@ -1 +1,4 @@ # Specify files that shouldn't be modified by Fern +.fern/replay.lock +.fern/replay.yml +.gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..74928d6a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.fern/replay.lock linguist-generated=true diff --git a/README.md b/README.md index ec958128..6c67287a 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,12 @@ [![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2Fwhopio%2Fwhopsdk-java) -The Whop Java library provides convenient access to the Whop APIs from Java. +The Whop SDK gives you typed access to the Whop API. Pass your API key to the client explicitly — the SDK reads no environment variables, so a client built without a key sends unauthenticated requests and the API answers 401. + ## Table of Contents +- [Documentation](#documentation) - [Reference](#reference) - [Usage](#usage) - [Environments](#environments) @@ -19,6 +21,10 @@ The Whop Java library provides convenient access to the Whop APIs from Java. - [Access Raw Response Data](#access-raw-response-data) - [Contributing](#contributing) +## Documentation + +API reference documentation is available [here](https://docs.whop.com/api-reference). + ## Reference A full reference for this library is available [here](https://github.com/whopio/whopsdk-java/blob/HEAD/./reference.md). diff --git a/reference.md b/reference.md index ba3eb38c..bf9277ec 100644 --- a/reference.md +++ b/reference.md @@ -2675,6 +2675,14 @@ client.adGroups().searchTargetingOptions( **limit:** `Optional` — Maximum number of results per requested type. + + + +
+
+ +**specialAdCategories:** `Optional` — The campaign's declared special ad categories. Under `housing`, `employment`, or `financial_products` the ad platform allows interests only, drawn from a short approved list, so results are narrowed to what such a campaign can launch with and other kinds return nothing. Blank `query` browses that approved list instead of the usual fixed lists. +
@@ -6112,6 +6120,14 @@ client.apps().list(
+**recommended:** `Optional` — Only return apps Whop recommends (or, with `false`, only those it does not). The community blueprints gallery is the recommended slice of the public website list. + +
+
+ +
+
+ **query:** `Optional` — A search string matched against app names.
@@ -10026,6 +10042,169 @@ client.checkoutConfigurations().delete(
+ + + + +## Checkout Sessions +
client.checkoutSessions.create(request) -> CheckoutSession +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Opens a checkout session. No credentials required. Pass exactly one of `items`, `checkout_configuration`, or `link`. The response includes `client_secret` once; later calls authenticate with it. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.checkoutSessions().create( + CreateCheckoutSessionsRequest + .builder() + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**affiliateCode:** `Optional` — The affiliate this checkout is attributed to. Write-once — set it here or never. + +
+
+ +
+
+ +**attribution:** `Optional>` — String-to-string acquisition context. Recognized keys: `utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`, `tracking_link_id`, `funnel_id`, `source`, `country`; anything else is dropped. + +
+
+ +
+
+ +**checkoutConfiguration:** `Optional` — A seller's checkout configuration (`ch_…`) to open this checkout from. Its plan, mode, affiliate code, metadata, redirect URL, 3DS level and payment method configuration seed the session; anything you also send explicitly wins. + +
+
+ +
+
+ +**items:** `Optional>` — What the buyer is purchasing. Exactly one entry today — more are refused until multi-item checkout ships; the array shape is the forward contract. Alongside a `checkout_configuration` or `link` it may only name that mount's own plan, where it sets quantity. + +
+
+ +
+
+ +**link:** `Optional` — Any checkout link the seller has shared, resolved for you: a plan ID, a checkout configuration ID, a vanity short link (send `page_route` with it), a membership transfer code, or a checkout link the seller handed out earlier. A link that is not a checkout link is refused with a coded message rather than a bare not-found. + +
+
+ +
+
+ +**metadata:** `Optional>>` — Free-form string-to-string map, at most 40 keys. Whop never interprets it. + +
+
+ +
+
+ +**mode:** `Optional` — Defaults to the checkout configuration's mode, then `payment`. `setup` sessions are not yet available and are refused. + +
+
+ +
+
+ +**origin:** `Optional` — Where this checkout is being opened from — the scheme and host of your page, with no path (`https://shop.example.com`). Ignored when the request carries a browser `Origin` header, which is used instead. Recorded against the session as acquisition context. + +
+
+ +
+
+ +**pageRoute:** `Optional` — The product route a vanity `link` belongs to — the `pageRoute` in the seller's shared URL. + +
+
+ +
+
+ +**password:** `Optional` — The password for a password-protected plan. Right, and the gate is cleared for the session's whole life; wrong or omitted, and the session still opens — it publishes a `custom_password` requirement, the answer arrives through update, and confirm refuses until it is right. + +
+
+ +
+
+ +**promoCode:** `Optional` — A promo code to apply to the quote. + +
+
+ +
+
+ +**returnUrl:** `Optional` — Where the buyer lands after an off-site payment step. Absolute https URL without credentials. + +
+
+ +
+
+ +**topUpMembership:** `Optional` — An existing membership (`mem_…`) this checkout pays against instead of creating a new one — the buyer pays the plan's price again onto something they already own. Ownership is checked at confirm, against the buyer who confirms: a membership they do not own is refused as not found. Cannot accompany a membership transfer link. + +
+
+ +
+
+ +**trackingLinkIdsByAccount:** `Optional>>` — First-party tracking-link candidates keyed by account ID. Ignored outside Whop's hosted checkout; an explicit `attribution.tracking_link_id` wins. + +
+
+
+
+ +
@@ -13718,7 +13897,7 @@ client.disputes().updateEvidenceDispute(
-Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Send the files as multipart file parts to upload and attach in one call, or reference files already stored by `id`/`direct_upload_id`. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. +Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Upload files through `POST /files` and reference them by `id`, or send the files as multipart file parts to upload and attach in one call. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected.
@@ -16293,7 +16472,7 @@ client.exports().create(
-**filters:** `Optional>` — Resource-specific filters. For native REST resources (`payouts`, `transfers`, `memberships`) these are the resource's own list query params; for dashboard tables they mirror the dashboard table filters. +**filters:** `Optional>` — Resource-specific filters. For native REST resources (`payouts`, `transfers`, `products`) these are the resource's own list query params; for dashboard tables they mirror the dashboard table filters.
@@ -16643,7 +16822,7 @@ client.feeMarkups().delete( ## Files -
client.files.create(request) -> CreateFilesResponse +
client.files.create(request) -> File
@@ -16655,7 +16834,7 @@ client.feeMarkups().delete(
-Create a new file record and receive a presigned URL for uploading content to S3. +Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to `upload_url` (single-part), or to each of `multipart_upload_urls` and then call Complete File Multipart Upload. Once the bytes land the file becomes `ready`, and its ID can be attached wherever a file is accepted — account legal documents, dispute evidence documents.
@@ -16673,7 +16852,7 @@ Create a new file record and receive a presigned URL for uploading content to S3 client.files().create( CreateFilesRequest .builder() - .filename("filename") + .filename("terms.pdf") .build() ); ``` @@ -16690,7 +16869,7 @@ client.files().create(
-**filename:** `String` — The name of the file including its extension (e.g., "photo.png" or "document.pdf"). +**byteSize:** `Optional` — The file's size in bytes. Required when `multipart` is `true`. Multipart uploads support at most 10,000 parts of 5MB each (about 50 GB).
@@ -16698,7 +16877,23 @@ client.files().create(
-**visibility:** `Optional` — Controls whether the file is publicly accessible via CDN or requires authentication. Defaults to private. +**filename:** `String` — The name of the file including its extension, e.g. `terms.pdf`. + +
+
+ +
+
+ +**multipart:** `Optional` — Upload the file in 5MB parts. Required for files larger than 5GB; useful above ~100MB. The file must be larger than 5MB. + +
+
+ +
+
+ +**visibility:** `Optional` — `public` files are served via an unsigned CDN URL — use for assets anyone may see. `private` files are served via a signed, expiring URL — use for sensitive documents. Defaults to `private`.
@@ -16722,7 +16917,7 @@ client.files().create(
-Retrieves the details of an existing file. +Retrieves a file you uploaded — poll it after uploading the bytes to see `upload_status` become `ready`. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource.
@@ -16738,7 +16933,7 @@ Retrieves the details of an existing file. ```java client.files().retrieve( - "file_xxxxxxxxxxxxx", + "id", RetrieveFilesRequest .builder() .build() @@ -16757,7 +16952,92 @@ client.files().retrieve(
-**id:** `String` — The unique identifier of the file to retrieve. +**id:** `String` — The unique identifier of the file, prefixed `file_`. + +
+
+ +
+ + + + +
+ +
client.files.complete(id, request) -> File +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Assembles the parts of a multipart upload after every part has been PUT to its presigned URL. Pass the `multipart_upload_id` from Create File and each part's `ETag` response header. +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```java +client.files().complete( + "id", + CompleteFilesRequest + .builder() + .multipartUploadId("upload-id") + .multipartParts( + Arrays.asList( + CompleteFilesRequestMultipartPartsItem + .builder() + .etag("etag-1") + .partNumber(1) + .build() + ) + ) + .build() +); +``` +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**id:** `String` — The unique identifier of the file, prefixed `file_`. + +
+
+ +
+
+ +**multipartParts:** `List` — Every uploaded part, in order. + +
+
+ +
+
+ +**multipartUploadId:** `String` — The ID of the multipart upload, returned by Create File.
@@ -18576,7 +18856,7 @@ client.invoices().update(
-**lineItems:** `Optional>` — Line items that break down the invoice total. +**lineItems:** `Optional>` — Line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge. Pass an empty list to remove the breakdown.
@@ -24080,7 +24360,7 @@ client.permissions().list(
-Returns a paginated list of plans belonging to an account, with optional filtering by visibility, type, release method, and product. +Returns a paginated list of plans. Omit `account_id` and pass `product_ids` to list a product's public buyable plans.
@@ -24098,7 +24378,6 @@ Returns a paginated list of plans belonging to an account, with optional filteri client.plans().list( ListPlansRequest .builder() - .accountId("account_id") .releaseMethods( Arrays.asList("buy_now") ) @@ -24127,7 +24406,7 @@ client.plans().list(
-**accountId:** `String` — The unique identifier of the account to list plans for. +**accountId:** `Optional` — The unique identifier of the account to list plans for. Required unless `product_ids` is provided for a public product-plan read.
@@ -24175,7 +24454,7 @@ client.plans().list(
-**productIds:** `Optional` — Filter to only plans belonging to these product identifiers. +**productIds:** `Optional` — Filter to only plans belonging to these product identifiers. When `account_id` is omitted, this is required and the response is publicly readable: only visible, non-invoice plans are returned.
@@ -24973,7 +25252,7 @@ client.plans().calculateTax(
-Returns a paginated list of products belonging to an account. +Returns a paginated list of products. Omit `account_id` to search the public marketplace.
@@ -24991,7 +25270,6 @@ Returns a paginated list of products belonging to an account. client.products().list( ListProductsRequest .builder() - .accountId("account_id") .visibilities( Arrays.asList("visible") ) @@ -25014,7 +25292,31 @@ client.products().list(
-**accountId:** `String` — The unique identifier of the account to list products for. +**accountId:** `Optional` — The unique identifier of the account to list products for. Omit to search the public marketplace. + +
+
+ +
+
+ +**query:** `Optional` — Ranked search against product title and headline. Omit to browse by recency. + +
+
+ +
+
+ +**marketplaceCategoryRoute:** `Optional` — Only return marketplace products assigned to this category route, such as `trading`. + +
+
+ +
+
+ +**planTypes:** `Optional` — Filter to products with a buyable plan of these billing models, such as `one_time` or `renewal`.
@@ -25022,7 +25324,23 @@ client.products().list(
-**visibilities:** `Optional` — Filter to only products matching these visibility states. +**priceMinimum:** `Optional` — Only return products whose advertised buyable plan has a displayed price of at least this amount. Recurring plans use renewal price. + +
+
+ +
+
+ +**priceMaximum:** `Optional` — Only return products whose advertised buyable plan has a displayed price of at most this amount. Recurring plans use renewal price. + +
+
+ +
+
+ +**visibilities:** `Optional` — Filter to only products matching these visibility states. Ignored on the public marketplace list, which only returns visible products.
@@ -25054,7 +25372,7 @@ client.products().list(
-**order:** `Optional` — The field to sort results by. Defaults to created_at. +**order:** `Optional` — The field to sort results by. Account lists default to `created_at`. Marketplace lists default to `discoverable_at` and accept `created_at` or `discoverable_at`. Cannot be combined with `query`.
@@ -25088,6 +25406,22 @@ client.products().list( **before:** `Optional` — A cursor; returns products before this position. + +
+ +
+
+ +**createdAfter:** `Optional` — Only return products created after this ISO 8601 timestamp. + +
+
+ +
+
+ +**createdBefore:** `Optional` — Only return products created before this ISO 8601 timestamp. +
@@ -25313,7 +25647,7 @@ client.products().create(
-Retrieves the details of an existing product. This endpoint is publicly accessible. +Retrieves a product. Public — no credentials.
diff --git a/src/main/java/com/whop/api/AsyncWhopApiClient.java b/src/main/java/com/whop/api/AsyncWhopApiClient.java index 67b012c0..289f7f1d 100644 --- a/src/main/java/com/whop/api/AsyncWhopApiClient.java +++ b/src/main/java/com/whop/api/AsyncWhopApiClient.java @@ -25,6 +25,7 @@ import com.whop.api.resources.cardtransactions.AsyncCardTransactionsClient; import com.whop.api.resources.chatchannels.AsyncChatChannelsClient; import com.whop.api.resources.checkoutconfigurations.AsyncCheckoutConfigurationsClient; +import com.whop.api.resources.checkoutsessions.AsyncCheckoutSessionsClient; import com.whop.api.resources.companies.AsyncCompaniesClient; import com.whop.api.resources.companytokentransactions.AsyncCompanyTokenTransactionsClient; import com.whop.api.resources.coursechapters.AsyncCourseChaptersClient; @@ -131,6 +132,8 @@ public class AsyncWhopApiClient { protected final Supplier checkoutConfigurationsClient; + protected final Supplier checkoutSessionsClient; + protected final Supplier companiesClient; protected final Supplier companyTokenTransactionsClient; @@ -276,6 +279,7 @@ public AsyncWhopApiClient(ClientOptions clientOptions) { this.chatChannelsClient = Suppliers.memoize(() -> new AsyncChatChannelsClient(clientOptions)); this.checkoutConfigurationsClient = Suppliers.memoize(() -> new AsyncCheckoutConfigurationsClient(clientOptions)); + this.checkoutSessionsClient = Suppliers.memoize(() -> new AsyncCheckoutSessionsClient(clientOptions)); this.companiesClient = Suppliers.memoize(() -> new AsyncCompaniesClient(clientOptions)); this.companyTokenTransactionsClient = Suppliers.memoize(() -> new AsyncCompanyTokenTransactionsClient(clientOptions)); @@ -421,6 +425,10 @@ public AsyncCheckoutConfigurationsClient checkoutConfigurations() { return this.checkoutConfigurationsClient.get(); } + public AsyncCheckoutSessionsClient checkoutSessions() { + return this.checkoutSessionsClient.get(); + } + public AsyncCompaniesClient companies() { return this.companiesClient.get(); } diff --git a/src/main/java/com/whop/api/WhopApiClient.java b/src/main/java/com/whop/api/WhopApiClient.java index 0fc02eea..5f92b80a 100644 --- a/src/main/java/com/whop/api/WhopApiClient.java +++ b/src/main/java/com/whop/api/WhopApiClient.java @@ -25,6 +25,7 @@ import com.whop.api.resources.cardtransactions.CardTransactionsClient; import com.whop.api.resources.chatchannels.ChatChannelsClient; import com.whop.api.resources.checkoutconfigurations.CheckoutConfigurationsClient; +import com.whop.api.resources.checkoutsessions.CheckoutSessionsClient; import com.whop.api.resources.companies.CompaniesClient; import com.whop.api.resources.companytokentransactions.CompanyTokenTransactionsClient; import com.whop.api.resources.coursechapters.CourseChaptersClient; @@ -131,6 +132,8 @@ public class WhopApiClient { protected final Supplier checkoutConfigurationsClient; + protected final Supplier checkoutSessionsClient; + protected final Supplier companiesClient; protected final Supplier companyTokenTransactionsClient; @@ -275,6 +278,7 @@ public WhopApiClient(ClientOptions clientOptions) { this.cardsClient = Suppliers.memoize(() -> new CardsClient(clientOptions)); this.chatChannelsClient = Suppliers.memoize(() -> new ChatChannelsClient(clientOptions)); this.checkoutConfigurationsClient = Suppliers.memoize(() -> new CheckoutConfigurationsClient(clientOptions)); + this.checkoutSessionsClient = Suppliers.memoize(() -> new CheckoutSessionsClient(clientOptions)); this.companiesClient = Suppliers.memoize(() -> new CompaniesClient(clientOptions)); this.companyTokenTransactionsClient = Suppliers.memoize(() -> new CompanyTokenTransactionsClient(clientOptions)); @@ -420,6 +424,10 @@ public CheckoutConfigurationsClient checkoutConfigurations() { return this.checkoutConfigurationsClient.get(); } + public CheckoutSessionsClient checkoutSessions() { + return this.checkoutSessionsClient.get(); + } + public CompaniesClient companies() { return this.companiesClient.get(); } diff --git a/src/main/java/com/whop/api/core/ClientOptions.java b/src/main/java/com/whop/api/core/ClientOptions.java index a5105edf..af59b5ea 100644 --- a/src/main/java/com/whop/api/core/ClientOptions.java +++ b/src/main/java/com/whop/api/core/ClientOptions.java @@ -40,7 +40,7 @@ private ClientOptions( { put("X-Fern-Language", "JAVA"); put("X-Fern-SDK-Name", "com.whop.fern:api-sdk"); - put("X-Fern-SDK-Version", "1.0.11"); + put("X-Fern-SDK-Version", "1.0.13"); } }); this.headerSuppliers = headerSuppliers; diff --git a/src/main/java/com/whop/api/resources/adgroups/AsyncRawAdGroupsClient.java b/src/main/java/com/whop/api/resources/adgroups/AsyncRawAdGroupsClient.java index a42e9f24..6d289347 100644 --- a/src/main/java/com/whop/api/resources/adgroups/AsyncRawAdGroupsClient.java +++ b/src/main/java/com/whop/api/resources/adgroups/AsyncRawAdGroupsClient.java @@ -432,6 +432,13 @@ public CompletableFuture { httpUrl.addQueryParameter(_key, _value); diff --git a/src/main/java/com/whop/api/resources/adgroups/RawAdGroupsClient.java b/src/main/java/com/whop/api/resources/adgroups/RawAdGroupsClient.java index 1e6ead3f..6a9cd865 100644 --- a/src/main/java/com/whop/api/resources/adgroups/RawAdGroupsClient.java +++ b/src/main/java/com/whop/api/resources/adgroups/RawAdGroupsClient.java @@ -369,6 +369,13 @@ public WhopApiHttpResponse searchTargeti QueryStringMapper.addQueryParameter( httpUrl, "location_types", request.getLocationTypes().get(), true); } + if (request.getSpecialAdCategories().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "special_ad_categories", + request.getSpecialAdCategories().get(), + true); + } if (requestOptions != null) { requestOptions.getQueryParameters().forEach((_key, _value) -> { httpUrl.addQueryParameter(_key, _value); diff --git a/src/main/java/com/whop/api/resources/adgroups/requests/SearchTargetingOptionsAdGroupsRequest.java b/src/main/java/com/whop/api/resources/adgroups/requests/SearchTargetingOptionsAdGroupsRequest.java index bec8b077..6e26c3c0 100644 --- a/src/main/java/com/whop/api/resources/adgroups/requests/SearchTargetingOptionsAdGroupsRequest.java +++ b/src/main/java/com/whop/api/resources/adgroups/requests/SearchTargetingOptionsAdGroupsRequest.java @@ -14,6 +14,7 @@ import com.whop.api.core.ObjectMappers; import com.whop.api.resources.adgroups.types.SearchTargetingOptionsAdGroupsRequestLocationTypesItem; import com.whop.api.resources.adgroups.types.SearchTargetingOptionsAdGroupsRequestPlatform; +import com.whop.api.resources.adgroups.types.SearchTargetingOptionsAdGroupsRequestSpecialAdCategoriesItem; import com.whop.api.resources.adgroups.types.SearchTargetingOptionsAdGroupsRequestTypesItem; import java.util.Collections; import java.util.HashMap; @@ -30,6 +31,8 @@ public final class SearchTargetingOptionsAdGroupsRequest { private final Optional> locationTypes; + private final Optional> specialAdCategories; + private final Optional accountId; private final SearchTargetingOptionsAdGroupsRequestPlatform platform; @@ -45,6 +48,7 @@ public final class SearchTargetingOptionsAdGroupsRequest { private SearchTargetingOptionsAdGroupsRequest( Optional> types, Optional> locationTypes, + Optional> specialAdCategories, Optional accountId, SearchTargetingOptionsAdGroupsRequestPlatform platform, Optional query, @@ -53,6 +57,7 @@ private SearchTargetingOptionsAdGroupsRequest( Map additionalProperties) { this.types = types; this.locationTypes = locationTypes; + this.specialAdCategories = specialAdCategories; this.accountId = accountId; this.platform = platform; this.query = query; @@ -77,6 +82,14 @@ public Optional> ge return locationTypes; } + /** + * @return The campaign's declared special ad categories. Under housing, employment, or financial_products the ad platform allows interests only, drawn from a short approved list, so results are narrowed to what such a campaign can launch with and other kinds return nothing. Blank query browses that approved list instead of the usual fixed lists. + */ + @JsonProperty("special_ad_categories") + public Optional> getSpecialAdCategories() { + return specialAdCategories; + } + /** * @return Account to search on behalf of. Defaults to the authenticated account. */ @@ -132,6 +145,7 @@ public Map getAdditionalProperties() { private boolean equalTo(SearchTargetingOptionsAdGroupsRequest other) { return types.equals(other.types) && locationTypes.equals(other.locationTypes) + && specialAdCategories.equals(other.specialAdCategories) && accountId.equals(other.accountId) && platform.equals(other.platform) && query.equals(other.query) @@ -142,7 +156,14 @@ private boolean equalTo(SearchTargetingOptionsAdGroupsRequest other) { @java.lang.Override public int hashCode() { return Objects.hash( - this.types, this.locationTypes, this.accountId, this.platform, this.query, this.country, this.limit); + this.types, + this.locationTypes, + this.specialAdCategories, + this.accountId, + this.platform, + this.query, + this.country, + this.limit); } @java.lang.Override @@ -188,6 +209,18 @@ public interface _FinalStage { _FinalStage locationTypes(SearchTargetingOptionsAdGroupsRequestLocationTypesItem locationTypes); + /** + *

The campaign's declared special ad categories. Under housing, employment, or financial_products the ad platform allows interests only, drawn from a short approved list, so results are narrowed to what such a campaign can launch with and other kinds return nothing. Blank query browses that approved list instead of the usual fixed lists.

+ */ + _FinalStage specialAdCategories( + Optional> specialAdCategories); + + _FinalStage specialAdCategories( + List specialAdCategories); + + _FinalStage specialAdCategories( + SearchTargetingOptionsAdGroupsRequestSpecialAdCategoriesItem specialAdCategories); + /** *

Account to search on behalf of. Defaults to the authenticated account.

*/ @@ -229,6 +262,9 @@ public static final class Builder implements PlatformStage, _FinalStage { private Optional accountId = Optional.empty(); + private Optional> specialAdCategories = + Optional.empty(); + private Optional> locationTypes = Optional.empty(); private Optional> types = Optional.empty(); @@ -242,6 +278,7 @@ private Builder() {} public Builder from(SearchTargetingOptionsAdGroupsRequest other) { types(other.getTypes()); locationTypes(other.getLocationTypes()); + specialAdCategories(other.getSpecialAdCategories()); accountId(other.getAccountId()); platform(other.getPlatform()); query(other.getQuery()); @@ -342,6 +379,35 @@ public _FinalStage accountId(Optional accountId) { return this; } + @java.lang.Override + public _FinalStage specialAdCategories( + SearchTargetingOptionsAdGroupsRequestSpecialAdCategoriesItem specialAdCategories) { + this.specialAdCategories = Optional.of(Collections.singletonList(specialAdCategories)); + return this; + } + + /** + *

The campaign's declared special ad categories. Under housing, employment, or financial_products the ad platform allows interests only, drawn from a short approved list, so results are narrowed to what such a campaign can launch with and other kinds return nothing. Blank query browses that approved list instead of the usual fixed lists.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage specialAdCategories( + List specialAdCategories) { + this.specialAdCategories = Optional.ofNullable(specialAdCategories); + return this; + } + + /** + *

The campaign's declared special ad categories. Under housing, employment, or financial_products the ad platform allows interests only, drawn from a short approved list, so results are narrowed to what such a campaign can launch with and other kinds return nothing. Blank query browses that approved list instead of the usual fixed lists.

+ */ + @java.lang.Override + @JsonSetter(value = "special_ad_categories", nulls = Nulls.SKIP) + public _FinalStage specialAdCategories( + Optional> specialAdCategories) { + this.specialAdCategories = specialAdCategories; + return this; + } + @java.lang.Override public _FinalStage locationTypes(SearchTargetingOptionsAdGroupsRequestLocationTypesItem locationTypes) { this.locationTypes = Optional.of(Collections.singletonList(locationTypes)); @@ -398,7 +464,15 @@ public _FinalStage types(Optional T visit(Visitor visitor) { + switch (value) { + case EMPLOYMENT: + return visitor.visitEmployment(); + case HOUSING: + return visitor.visitHousing(); + case POLITICS: + return visitor.visitPolitics(); + case FINANCIAL_PRODUCTS: + return visitor.visitFinancialProducts(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static SearchTargetingOptionsAdGroupsRequestSpecialAdCategoriesItem valueOf(String value) { + switch (value) { + case "employment": + return EMPLOYMENT; + case "housing": + return HOUSING; + case "politics": + return POLITICS; + case "financial_products": + return FINANCIAL_PRODUCTS; + default: + return new SearchTargetingOptionsAdGroupsRequestSpecialAdCategoriesItem(Value.UNKNOWN, value); + } + } + + public enum Value { + HOUSING, + + EMPLOYMENT, + + FINANCIAL_PRODUCTS, + + POLITICS, + + UNKNOWN + } + + public interface Visitor { + T visitHousing(); + + T visitEmployment(); + + T visitFinancialProducts(); + + T visitPolitics(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/resources/apikeys/types/CreateApiKeysRequestApiVersionDate.java b/src/main/java/com/whop/api/resources/apikeys/types/CreateApiKeysRequestApiVersionDate.java index 7fb864c7..e9ab0549 100644 --- a/src/main/java/com/whop/api/resources/apikeys/types/CreateApiKeysRequestApiVersionDate.java +++ b/src/main/java/com/whop/api/resources/apikeys/types/CreateApiKeysRequestApiVersionDate.java @@ -31,6 +31,9 @@ public final class CreateApiKeysRequestApiVersionDate { public static final CreateApiKeysRequestApiVersionDate TWO_THOUSAND_TWENTY_SIX0620 = new CreateApiKeysRequestApiVersionDate(Value.TWO_THOUSAND_TWENTY_SIX0620, "2026-06-20"); + public static final CreateApiKeysRequestApiVersionDate TWO_THOUSAND_TWENTY_SIX08211 = + new CreateApiKeysRequestApiVersionDate(Value.TWO_THOUSAND_TWENTY_SIX08211, "2026-08-21-1"); + public static final CreateApiKeysRequestApiVersionDate TWO_THOUSAND_TWENTY_FIVE0101 = new CreateApiKeysRequestApiVersionDate(Value.TWO_THOUSAND_TWENTY_FIVE0101, "2025-01-01"); @@ -131,6 +134,8 @@ public T visit(Visitor visitor) { return visitor.visitTwoThousandTwentySix0803(); case TWO_THOUSAND_TWENTY_SIX0620: return visitor.visitTwoThousandTwentySix0620(); + case TWO_THOUSAND_TWENTY_SIX08211: + return visitor.visitTwoThousandTwentySix08211(); case TWO_THOUSAND_TWENTY_FIVE0101: return visitor.visitTwoThousandTwentyFive0101(); case TWO_THOUSAND_TWENTY_SIX07081: @@ -190,6 +195,8 @@ public static CreateApiKeysRequestApiVersionDate valueOf(String value) { return TWO_THOUSAND_TWENTY_SIX0803; case "2026-06-20": return TWO_THOUSAND_TWENTY_SIX0620; + case "2026-08-21-1": + return TWO_THOUSAND_TWENTY_SIX08211; case "2025-01-01": return TWO_THOUSAND_TWENTY_FIVE0101; case "2026-07-08-1": @@ -280,6 +287,8 @@ public enum Value { TWO_THOUSAND_TWENTY_SIX0821, + TWO_THOUSAND_TWENTY_SIX08211, + UNKNOWN } @@ -334,6 +343,8 @@ public interface Visitor { T visitTwoThousandTwentySix0821(); + T visitTwoThousandTwentySix08211(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/whop/api/resources/apikeys/types/UpdateApiKeysRequestApiVersionDate.java b/src/main/java/com/whop/api/resources/apikeys/types/UpdateApiKeysRequestApiVersionDate.java index 2066db32..64104063 100644 --- a/src/main/java/com/whop/api/resources/apikeys/types/UpdateApiKeysRequestApiVersionDate.java +++ b/src/main/java/com/whop/api/resources/apikeys/types/UpdateApiKeysRequestApiVersionDate.java @@ -31,6 +31,9 @@ public final class UpdateApiKeysRequestApiVersionDate { public static final UpdateApiKeysRequestApiVersionDate TWO_THOUSAND_TWENTY_SIX0620 = new UpdateApiKeysRequestApiVersionDate(Value.TWO_THOUSAND_TWENTY_SIX0620, "2026-06-20"); + public static final UpdateApiKeysRequestApiVersionDate TWO_THOUSAND_TWENTY_SIX08211 = + new UpdateApiKeysRequestApiVersionDate(Value.TWO_THOUSAND_TWENTY_SIX08211, "2026-08-21-1"); + public static final UpdateApiKeysRequestApiVersionDate TWO_THOUSAND_TWENTY_FIVE0101 = new UpdateApiKeysRequestApiVersionDate(Value.TWO_THOUSAND_TWENTY_FIVE0101, "2025-01-01"); @@ -131,6 +134,8 @@ public T visit(Visitor visitor) { return visitor.visitTwoThousandTwentySix0803(); case TWO_THOUSAND_TWENTY_SIX0620: return visitor.visitTwoThousandTwentySix0620(); + case TWO_THOUSAND_TWENTY_SIX08211: + return visitor.visitTwoThousandTwentySix08211(); case TWO_THOUSAND_TWENTY_FIVE0101: return visitor.visitTwoThousandTwentyFive0101(); case TWO_THOUSAND_TWENTY_SIX07081: @@ -190,6 +195,8 @@ public static UpdateApiKeysRequestApiVersionDate valueOf(String value) { return TWO_THOUSAND_TWENTY_SIX0803; case "2026-06-20": return TWO_THOUSAND_TWENTY_SIX0620; + case "2026-08-21-1": + return TWO_THOUSAND_TWENTY_SIX08211; case "2025-01-01": return TWO_THOUSAND_TWENTY_FIVE0101; case "2026-07-08-1": @@ -280,6 +287,8 @@ public enum Value { TWO_THOUSAND_TWENTY_SIX0821, + TWO_THOUSAND_TWENTY_SIX08211, + UNKNOWN } @@ -334,6 +343,8 @@ public interface Visitor { T visitTwoThousandTwentySix0821(); + T visitTwoThousandTwentySix08211(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/whop/api/resources/apps/AsyncRawAppsClient.java b/src/main/java/com/whop/api/resources/apps/AsyncRawAppsClient.java index cfb4ef91..6bea938c 100644 --- a/src/main/java/com/whop/api/resources/apps/AsyncRawAppsClient.java +++ b/src/main/java/com/whop/api/resources/apps/AsyncRawAppsClient.java @@ -106,6 +106,10 @@ public CompletableFuture>> l QueryStringMapper.addQueryParameter( httpUrl, "verified_apps_only", request.getVerifiedAppsOnly().get(), false); } + if (request.getRecommended().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "recommended", request.getRecommended().get(), false); + } if (request.getQuery().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "query", request.getQuery().get(), false); diff --git a/src/main/java/com/whop/api/resources/apps/RawAppsClient.java b/src/main/java/com/whop/api/resources/apps/RawAppsClient.java index ab35280d..4fa835e6 100644 --- a/src/main/java/com/whop/api/resources/apps/RawAppsClient.java +++ b/src/main/java/com/whop/api/resources/apps/RawAppsClient.java @@ -101,6 +101,10 @@ public WhopApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "verified_apps_only", request.getVerifiedAppsOnly().get(), false); } + if (request.getRecommended().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "recommended", request.getRecommended().get(), false); + } if (request.getQuery().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "query", request.getQuery().get(), false); diff --git a/src/main/java/com/whop/api/resources/apps/requests/ListAppsRequest.java b/src/main/java/com/whop/api/resources/apps/requests/ListAppsRequest.java index d0332397..9ca44b5c 100644 --- a/src/main/java/com/whop/api/resources/apps/requests/ListAppsRequest.java +++ b/src/main/java/com/whop/api/resources/apps/requests/ListAppsRequest.java @@ -32,6 +32,8 @@ public final class ListAppsRequest { private final Optional verifiedAppsOnly; + private final Optional recommended; + private final Optional query; private final Optional order; @@ -53,6 +55,7 @@ private ListAppsRequest( Optional appType, Optional viewType, Optional verifiedAppsOnly, + Optional recommended, Optional query, Optional order, Optional direction, @@ -65,6 +68,7 @@ private ListAppsRequest( this.appType = appType; this.viewType = viewType; this.verifiedAppsOnly = verifiedAppsOnly; + this.recommended = recommended; this.query = query; this.order = order; this.direction = direction; @@ -107,6 +111,14 @@ public Optional getVerifiedAppsOnly() { return verifiedAppsOnly; } + /** + * @return Only return apps Whop recommends (or, with false, only those it does not). The community blueprints gallery is the recommended slice of the public website list. + */ + @JsonProperty("recommended") + public Optional getRecommended() { + return recommended; + } + /** * @return A search string matched against app names. */ @@ -179,6 +191,7 @@ private boolean equalTo(ListAppsRequest other) { && appType.equals(other.appType) && viewType.equals(other.viewType) && verifiedAppsOnly.equals(other.verifiedAppsOnly) + && recommended.equals(other.recommended) && query.equals(other.query) && order.equals(other.order) && direction.equals(other.direction) @@ -195,6 +208,7 @@ public int hashCode() { this.appType, this.viewType, this.verifiedAppsOnly, + this.recommended, this.query, this.order, this.direction, @@ -223,6 +237,8 @@ public static final class Builder { private Optional verifiedAppsOnly = Optional.empty(); + private Optional recommended = Optional.empty(); + private Optional query = Optional.empty(); private Optional order = Optional.empty(); @@ -247,6 +263,7 @@ public Builder from(ListAppsRequest other) { appType(other.getAppType()); viewType(other.getViewType()); verifiedAppsOnly(other.getVerifiedAppsOnly()); + recommended(other.getRecommended()); query(other.getQuery()); order(other.getOrder()); direction(other.getDirection()); @@ -313,6 +330,20 @@ public Builder verifiedAppsOnly(Boolean verifiedAppsOnly) { return this; } + /** + *

Only return apps Whop recommends (or, with false, only those it does not). The community blueprints gallery is the recommended slice of the public website list.

+ */ + @JsonSetter(value = "recommended", nulls = Nulls.SKIP) + public Builder recommended(Optional recommended) { + this.recommended = recommended; + return this; + } + + public Builder recommended(Boolean recommended) { + this.recommended = Optional.ofNullable(recommended); + return this; + } + /** *

A search string matched against app names.

*/ @@ -417,6 +448,7 @@ public ListAppsRequest build() { appType, viewType, verifiedAppsOnly, + recommended, query, order, direction, diff --git a/src/main/java/com/whop/api/resources/checkoutsessions/AsyncCheckoutSessionsClient.java b/src/main/java/com/whop/api/resources/checkoutsessions/AsyncCheckoutSessionsClient.java new file mode 100644 index 00000000..6a6c2f79 --- /dev/null +++ b/src/main/java/com/whop/api/resources/checkoutsessions/AsyncCheckoutSessionsClient.java @@ -0,0 +1,57 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.checkoutsessions; + +import com.whop.api.core.ClientOptions; +import com.whop.api.core.RequestOptions; +import com.whop.api.resources.checkoutsessions.requests.CreateCheckoutSessionsRequest; +import com.whop.api.types.CheckoutSession; +import java.util.concurrent.CompletableFuture; + +public class AsyncCheckoutSessionsClient { + protected final ClientOptions clientOptions; + + private final AsyncRawCheckoutSessionsClient rawClient; + + public AsyncCheckoutSessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new AsyncRawCheckoutSessionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public AsyncRawCheckoutSessionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CompletableFuture create() { + return this.rawClient.create().thenApply(response -> response.body()); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CompletableFuture create(RequestOptions requestOptions) { + return this.rawClient.create(requestOptions).thenApply(response -> response.body()); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CompletableFuture create(CreateCheckoutSessionsRequest request) { + return this.rawClient.create(request).thenApply(response -> response.body()); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CompletableFuture create( + CreateCheckoutSessionsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); + } +} diff --git a/src/main/java/com/whop/api/resources/checkoutsessions/AsyncRawCheckoutSessionsClient.java b/src/main/java/com/whop/api/resources/checkoutsessions/AsyncRawCheckoutSessionsClient.java new file mode 100644 index 00000000..b2ea1954 --- /dev/null +++ b/src/main/java/com/whop/api/resources/checkoutsessions/AsyncRawCheckoutSessionsClient.java @@ -0,0 +1,141 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.checkoutsessions; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.whop.api.core.ClientOptions; +import com.whop.api.core.MediaTypes; +import com.whop.api.core.ObjectMappers; +import com.whop.api.core.RequestOptions; +import com.whop.api.core.WhopApiApiException; +import com.whop.api.core.WhopApiException; +import com.whop.api.core.WhopApiHttpResponse; +import com.whop.api.errors.BadRequestError; +import com.whop.api.errors.ConflictError; +import com.whop.api.errors.NotFoundError; +import com.whop.api.resources.checkoutsessions.requests.CreateCheckoutSessionsRequest; +import com.whop.api.types.CheckoutSession; +import com.whop.api.types.V1ErrorResponse; +import java.io.IOException; +import java.util.concurrent.CompletableFuture; +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.jetbrains.annotations.NotNull; + +public class AsyncRawCheckoutSessionsClient { + protected final ClientOptions clientOptions; + + public AsyncRawCheckoutSessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CompletableFuture> create() { + return create(CreateCheckoutSessionsRequest.builder().build()); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CompletableFuture> create(RequestOptions requestOptions) { + return create(CreateCheckoutSessionsRequest.builder().build(), requestOptions); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CompletableFuture> create(CreateCheckoutSessionsRequest request) { + return create(request, null); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CompletableFuture> create( + CreateCheckoutSessionsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("checkout_sessions"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new WhopApiException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new WhopApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CheckoutSession.class), + response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 404: + future.completeExceptionally(new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + response)); + return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, V1ErrorResponse.class), + response)); + return; + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new WhopApiApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new WhopApiException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new WhopApiException("Network error executing HTTP request", e)); + } + }); + return future; + } +} diff --git a/src/main/java/com/whop/api/resources/checkoutsessions/CheckoutSessionsClient.java b/src/main/java/com/whop/api/resources/checkoutsessions/CheckoutSessionsClient.java new file mode 100644 index 00000000..c4811947 --- /dev/null +++ b/src/main/java/com/whop/api/resources/checkoutsessions/CheckoutSessionsClient.java @@ -0,0 +1,55 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.checkoutsessions; + +import com.whop.api.core.ClientOptions; +import com.whop.api.core.RequestOptions; +import com.whop.api.resources.checkoutsessions.requests.CreateCheckoutSessionsRequest; +import com.whop.api.types.CheckoutSession; + +public class CheckoutSessionsClient { + protected final ClientOptions clientOptions; + + private final RawCheckoutSessionsClient rawClient; + + public CheckoutSessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + this.rawClient = new RawCheckoutSessionsClient(clientOptions); + } + + /** + * Get responses with HTTP metadata like headers + */ + public RawCheckoutSessionsClient withRawResponse() { + return this.rawClient; + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CheckoutSession create() { + return this.rawClient.create().body(); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CheckoutSession create(RequestOptions requestOptions) { + return this.rawClient.create(requestOptions).body(); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CheckoutSession create(CreateCheckoutSessionsRequest request) { + return this.rawClient.create(request).body(); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public CheckoutSession create(CreateCheckoutSessionsRequest request, RequestOptions requestOptions) { + return this.rawClient.create(request, requestOptions).body(); + } +} diff --git a/src/main/java/com/whop/api/resources/checkoutsessions/RawCheckoutSessionsClient.java b/src/main/java/com/whop/api/resources/checkoutsessions/RawCheckoutSessionsClient.java new file mode 100644 index 00000000..6d7d31b7 --- /dev/null +++ b/src/main/java/com/whop/api/resources/checkoutsessions/RawCheckoutSessionsClient.java @@ -0,0 +1,118 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.checkoutsessions; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.whop.api.core.ClientOptions; +import com.whop.api.core.MediaTypes; +import com.whop.api.core.ObjectMappers; +import com.whop.api.core.RequestOptions; +import com.whop.api.core.WhopApiApiException; +import com.whop.api.core.WhopApiException; +import com.whop.api.core.WhopApiHttpResponse; +import com.whop.api.errors.BadRequestError; +import com.whop.api.errors.ConflictError; +import com.whop.api.errors.NotFoundError; +import com.whop.api.resources.checkoutsessions.requests.CreateCheckoutSessionsRequest; +import com.whop.api.types.CheckoutSession; +import com.whop.api.types.V1ErrorResponse; +import java.io.IOException; +import okhttp3.Headers; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; + +public class RawCheckoutSessionsClient { + protected final ClientOptions clientOptions; + + public RawCheckoutSessionsClient(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public WhopApiHttpResponse create() { + return create(CreateCheckoutSessionsRequest.builder().build()); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public WhopApiHttpResponse create(RequestOptions requestOptions) { + return create(CreateCheckoutSessionsRequest.builder().build(), requestOptions); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public WhopApiHttpResponse create(CreateCheckoutSessionsRequest request) { + return create(request, null); + } + + /** + * Opens a checkout session. No credentials required. Pass exactly one of items, checkout_configuration, or link. The response includes client_secret once; later calls authenticate with it. + */ + public WhopApiHttpResponse create( + CreateCheckoutSessionsRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("checkout_sessions"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new WhopApiException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new WhopApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CheckoutSession.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 404: + throw new NotFoundError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, V1ErrorResponse.class), + response); + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new WhopApiApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new WhopApiException("Network error executing HTTP request", e); + } + } +} diff --git a/src/main/java/com/whop/api/resources/checkoutsessions/requests/CreateCheckoutSessionsRequest.java b/src/main/java/com/whop/api/resources/checkoutsessions/requests/CreateCheckoutSessionsRequest.java new file mode 100644 index 00000000..37178398 --- /dev/null +++ b/src/main/java/com/whop/api/resources/checkoutsessions/requests/CreateCheckoutSessionsRequest.java @@ -0,0 +1,798 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.checkoutsessions.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import com.whop.api.resources.checkoutsessions.types.CreateCheckoutSessionsRequestItemsItem; +import com.whop.api.resources.checkoutsessions.types.CreateCheckoutSessionsRequestMode; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateCheckoutSessionsRequest.Builder.class) +public final class CreateCheckoutSessionsRequest { + private final Optional affiliateCode; + + private final Optional> attribution; + + private final Optional checkoutConfiguration; + + private final Optional> items; + + private final Optional link; + + private final Optional>> metadata; + + private final Optional mode; + + private final Optional origin; + + private final Optional pageRoute; + + private final Optional password; + + private final Optional promoCode; + + private final Optional returnUrl; + + private final Optional topUpMembership; + + private final Optional>> trackingLinkIdsByAccount; + + private final Map additionalProperties; + + private CreateCheckoutSessionsRequest( + Optional affiliateCode, + Optional> attribution, + Optional checkoutConfiguration, + Optional> items, + Optional link, + Optional>> metadata, + Optional mode, + Optional origin, + Optional pageRoute, + Optional password, + Optional promoCode, + Optional returnUrl, + Optional topUpMembership, + Optional>> trackingLinkIdsByAccount, + Map additionalProperties) { + this.affiliateCode = affiliateCode; + this.attribution = attribution; + this.checkoutConfiguration = checkoutConfiguration; + this.items = items; + this.link = link; + this.metadata = metadata; + this.mode = mode; + this.origin = origin; + this.pageRoute = pageRoute; + this.password = password; + this.promoCode = promoCode; + this.returnUrl = returnUrl; + this.topUpMembership = topUpMembership; + this.trackingLinkIdsByAccount = trackingLinkIdsByAccount; + this.additionalProperties = additionalProperties; + } + + /** + * @return The affiliate this checkout is attributed to. Write-once — set it here or never. + */ + @JsonIgnore + public Optional getAffiliateCode() { + if (affiliateCode == null) { + return Optional.empty(); + } + return affiliateCode; + } + + /** + * @return String-to-string acquisition context. Recognized keys: utm_source, utm_medium, utm_campaign, utm_term, utm_content, tracking_link_id, funnel_id, source, country; anything else is dropped. + */ + @JsonIgnore + public Optional> getAttribution() { + if (attribution == null) { + return Optional.empty(); + } + return attribution; + } + + /** + * @return A seller's checkout configuration (ch_…) to open this checkout from. Its plan, mode, affiliate code, metadata, redirect URL, 3DS level and payment method configuration seed the session; anything you also send explicitly wins. + */ + @JsonIgnore + public Optional getCheckoutConfiguration() { + if (checkoutConfiguration == null) { + return Optional.empty(); + } + return checkoutConfiguration; + } + + /** + * @return What the buyer is purchasing. Exactly one entry today — more are refused until multi-item checkout ships; the array shape is the forward contract. Alongside a checkout_configuration or link it may only name that mount's own plan, where it sets quantity. + */ + @JsonProperty("items") + public Optional> getItems() { + return items; + } + + /** + * @return Any checkout link the seller has shared, resolved for you: a plan ID, a checkout configuration ID, a vanity short link (send page_route with it), a membership transfer code, or a checkout link the seller handed out earlier. A link that is not a checkout link is refused with a coded message rather than a bare not-found. + */ + @JsonIgnore + public Optional getLink() { + if (link == null) { + return Optional.empty(); + } + return link; + } + + /** + * @return Free-form string-to-string map, at most 40 keys. Whop never interprets it. + */ + @JsonIgnore + public Optional>> getMetadata() { + if (metadata == null) { + return Optional.empty(); + } + return metadata; + } + + /** + * @return Defaults to the checkout configuration's mode, then payment. setup sessions are not yet available and are refused. + */ + @JsonIgnore + public Optional getMode() { + if (mode == null) { + return Optional.empty(); + } + return mode; + } + + /** + * @return Where this checkout is being opened from — the scheme and host of your page, with no path (https://shop.example.com). Ignored when the request carries a browser Origin header, which is used instead. Recorded against the session as acquisition context. + */ + @JsonIgnore + public Optional getOrigin() { + if (origin == null) { + return Optional.empty(); + } + return origin; + } + + /** + * @return The product route a vanity link belongs to — the pageRoute in the seller's shared URL. + */ + @JsonIgnore + public Optional getPageRoute() { + if (pageRoute == null) { + return Optional.empty(); + } + return pageRoute; + } + + /** + * @return The password for a password-protected plan. Right, and the gate is cleared for the session's whole life; wrong or omitted, and the session still opens — it publishes a custom_password requirement, the answer arrives through update, and confirm refuses until it is right. + */ + @JsonIgnore + public Optional getPassword() { + if (password == null) { + return Optional.empty(); + } + return password; + } + + /** + * @return A promo code to apply to the quote. + */ + @JsonIgnore + public Optional getPromoCode() { + if (promoCode == null) { + return Optional.empty(); + } + return promoCode; + } + + /** + * @return Where the buyer lands after an off-site payment step. Absolute https URL without credentials. + */ + @JsonIgnore + public Optional getReturnUrl() { + if (returnUrl == null) { + return Optional.empty(); + } + return returnUrl; + } + + /** + * @return An existing membership (mem_…) this checkout pays against instead of creating a new one — the buyer pays the plan's price again onto something they already own. Ownership is checked at confirm, against the buyer who confirms: a membership they do not own is refused as not found. Cannot accompany a membership transfer link. + */ + @JsonIgnore + public Optional getTopUpMembership() { + if (topUpMembership == null) { + return Optional.empty(); + } + return topUpMembership; + } + + /** + * @return First-party tracking-link candidates keyed by account ID. Ignored outside Whop's hosted checkout; an explicit attribution.tracking_link_id wins. + */ + @JsonIgnore + public Optional>> getTrackingLinkIdsByAccount() { + if (trackingLinkIdsByAccount == null) { + return Optional.empty(); + } + return trackingLinkIdsByAccount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("affiliate_code") + private Optional _getAffiliateCode() { + return affiliateCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("attribution") + private Optional> _getAttribution() { + return attribution; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("checkout_configuration") + private Optional _getCheckoutConfiguration() { + return checkoutConfiguration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("link") + private Optional _getLink() { + return link; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("metadata") + private Optional>> _getMetadata() { + return metadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("mode") + private Optional _getMode() { + return mode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("origin") + private Optional _getOrigin() { + return origin; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("page_route") + private Optional _getPageRoute() { + return pageRoute; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("password") + private Optional _getPassword() { + return password; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("promo_code") + private Optional _getPromoCode() { + return promoCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("return_url") + private Optional _getReturnUrl() { + return returnUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("top_up_membership") + private Optional _getTopUpMembership() { + return topUpMembership; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tracking_link_ids_by_account") + private Optional>> _getTrackingLinkIdsByAccount() { + return trackingLinkIdsByAccount; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateCheckoutSessionsRequest && equalTo((CreateCheckoutSessionsRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateCheckoutSessionsRequest other) { + return affiliateCode.equals(other.affiliateCode) + && attribution.equals(other.attribution) + && checkoutConfiguration.equals(other.checkoutConfiguration) + && items.equals(other.items) + && link.equals(other.link) + && metadata.equals(other.metadata) + && mode.equals(other.mode) + && origin.equals(other.origin) + && pageRoute.equals(other.pageRoute) + && password.equals(other.password) + && promoCode.equals(other.promoCode) + && returnUrl.equals(other.returnUrl) + && topUpMembership.equals(other.topUpMembership) + && trackingLinkIdsByAccount.equals(other.trackingLinkIdsByAccount); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.affiliateCode, + this.attribution, + this.checkoutConfiguration, + this.items, + this.link, + this.metadata, + this.mode, + this.origin, + this.pageRoute, + this.password, + this.promoCode, + this.returnUrl, + this.topUpMembership, + this.trackingLinkIdsByAccount); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional affiliateCode = Optional.empty(); + + private Optional> attribution = Optional.empty(); + + private Optional checkoutConfiguration = Optional.empty(); + + private Optional> items = Optional.empty(); + + private Optional link = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional mode = Optional.empty(); + + private Optional origin = Optional.empty(); + + private Optional pageRoute = Optional.empty(); + + private Optional password = Optional.empty(); + + private Optional promoCode = Optional.empty(); + + private Optional returnUrl = Optional.empty(); + + private Optional topUpMembership = Optional.empty(); + + private Optional>> trackingLinkIdsByAccount = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CreateCheckoutSessionsRequest other) { + affiliateCode(other.getAffiliateCode()); + attribution(other.getAttribution()); + checkoutConfiguration(other.getCheckoutConfiguration()); + items(other.getItems()); + link(other.getLink()); + metadata(other.getMetadata()); + mode(other.getMode()); + origin(other.getOrigin()); + pageRoute(other.getPageRoute()); + password(other.getPassword()); + promoCode(other.getPromoCode()); + returnUrl(other.getReturnUrl()); + topUpMembership(other.getTopUpMembership()); + trackingLinkIdsByAccount(other.getTrackingLinkIdsByAccount()); + return this; + } + + /** + *

The affiliate this checkout is attributed to. Write-once — set it here or never.

+ */ + @JsonSetter(value = "affiliate_code", nulls = Nulls.SKIP) + public Builder affiliateCode(Optional affiliateCode) { + this.affiliateCode = affiliateCode; + return this; + } + + public Builder affiliateCode(String affiliateCode) { + this.affiliateCode = Optional.ofNullable(affiliateCode); + return this; + } + + public Builder affiliateCode(Nullable affiliateCode) { + if (affiliateCode.isNull()) { + this.affiliateCode = null; + } else if (affiliateCode.isEmpty()) { + this.affiliateCode = Optional.empty(); + } else { + this.affiliateCode = Optional.of(affiliateCode.get()); + } + return this; + } + + /** + *

String-to-string acquisition context. Recognized keys: utm_source, utm_medium, utm_campaign, utm_term, utm_content, tracking_link_id, funnel_id, source, country; anything else is dropped.

+ */ + @JsonSetter(value = "attribution", nulls = Nulls.SKIP) + public Builder attribution(Optional> attribution) { + this.attribution = attribution; + return this; + } + + public Builder attribution(Map attribution) { + this.attribution = Optional.ofNullable(attribution); + return this; + } + + public Builder attribution(Nullable> attribution) { + if (attribution.isNull()) { + this.attribution = null; + } else if (attribution.isEmpty()) { + this.attribution = Optional.empty(); + } else { + this.attribution = Optional.of(attribution.get()); + } + return this; + } + + /** + *

A seller's checkout configuration (ch_…) to open this checkout from. Its plan, mode, affiliate code, metadata, redirect URL, 3DS level and payment method configuration seed the session; anything you also send explicitly wins.

+ */ + @JsonSetter(value = "checkout_configuration", nulls = Nulls.SKIP) + public Builder checkoutConfiguration(Optional checkoutConfiguration) { + this.checkoutConfiguration = checkoutConfiguration; + return this; + } + + public Builder checkoutConfiguration(String checkoutConfiguration) { + this.checkoutConfiguration = Optional.ofNullable(checkoutConfiguration); + return this; + } + + public Builder checkoutConfiguration(Nullable checkoutConfiguration) { + if (checkoutConfiguration.isNull()) { + this.checkoutConfiguration = null; + } else if (checkoutConfiguration.isEmpty()) { + this.checkoutConfiguration = Optional.empty(); + } else { + this.checkoutConfiguration = Optional.of(checkoutConfiguration.get()); + } + return this; + } + + /** + *

What the buyer is purchasing. Exactly one entry today — more are refused until multi-item checkout ships; the array shape is the forward contract. Alongside a checkout_configuration or link it may only name that mount's own plan, where it sets quantity.

+ */ + @JsonSetter(value = "items", nulls = Nulls.SKIP) + public Builder items(Optional> items) { + this.items = items; + return this; + } + + public Builder items(List items) { + this.items = Optional.ofNullable(items); + return this; + } + + /** + *

Any checkout link the seller has shared, resolved for you: a plan ID, a checkout configuration ID, a vanity short link (send page_route with it), a membership transfer code, or a checkout link the seller handed out earlier. A link that is not a checkout link is refused with a coded message rather than a bare not-found.

+ */ + @JsonSetter(value = "link", nulls = Nulls.SKIP) + public Builder link(Optional link) { + this.link = link; + return this; + } + + public Builder link(String link) { + this.link = Optional.ofNullable(link); + return this; + } + + public Builder link(Nullable link) { + if (link.isNull()) { + this.link = null; + } else if (link.isEmpty()) { + this.link = Optional.empty(); + } else { + this.link = Optional.of(link.get()); + } + return this; + } + + /** + *

Free-form string-to-string map, at most 40 keys. Whop never interprets it.

+ */ + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public Builder metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + public Builder metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + public Builder metadata(Nullable>> metadata) { + if (metadata.isNull()) { + this.metadata = null; + } else if (metadata.isEmpty()) { + this.metadata = Optional.empty(); + } else { + this.metadata = Optional.of(metadata.get()); + } + return this; + } + + /** + *

Defaults to the checkout configuration's mode, then payment. setup sessions are not yet available and are refused.

+ */ + @JsonSetter(value = "mode", nulls = Nulls.SKIP) + public Builder mode(Optional mode) { + this.mode = mode; + return this; + } + + public Builder mode(CreateCheckoutSessionsRequestMode mode) { + this.mode = Optional.ofNullable(mode); + return this; + } + + public Builder mode(Nullable mode) { + if (mode.isNull()) { + this.mode = null; + } else if (mode.isEmpty()) { + this.mode = Optional.empty(); + } else { + this.mode = Optional.of(mode.get()); + } + return this; + } + + /** + *

Where this checkout is being opened from — the scheme and host of your page, with no path (https://shop.example.com). Ignored when the request carries a browser Origin header, which is used instead. Recorded against the session as acquisition context.

+ */ + @JsonSetter(value = "origin", nulls = Nulls.SKIP) + public Builder origin(Optional origin) { + this.origin = origin; + return this; + } + + public Builder origin(String origin) { + this.origin = Optional.ofNullable(origin); + return this; + } + + public Builder origin(Nullable origin) { + if (origin.isNull()) { + this.origin = null; + } else if (origin.isEmpty()) { + this.origin = Optional.empty(); + } else { + this.origin = Optional.of(origin.get()); + } + return this; + } + + /** + *

The product route a vanity link belongs to — the pageRoute in the seller's shared URL.

+ */ + @JsonSetter(value = "page_route", nulls = Nulls.SKIP) + public Builder pageRoute(Optional pageRoute) { + this.pageRoute = pageRoute; + return this; + } + + public Builder pageRoute(String pageRoute) { + this.pageRoute = Optional.ofNullable(pageRoute); + return this; + } + + public Builder pageRoute(Nullable pageRoute) { + if (pageRoute.isNull()) { + this.pageRoute = null; + } else if (pageRoute.isEmpty()) { + this.pageRoute = Optional.empty(); + } else { + this.pageRoute = Optional.of(pageRoute.get()); + } + return this; + } + + /** + *

The password for a password-protected plan. Right, and the gate is cleared for the session's whole life; wrong or omitted, and the session still opens — it publishes a custom_password requirement, the answer arrives through update, and confirm refuses until it is right.

+ */ + @JsonSetter(value = "password", nulls = Nulls.SKIP) + public Builder password(Optional password) { + this.password = password; + return this; + } + + public Builder password(String password) { + this.password = Optional.ofNullable(password); + return this; + } + + public Builder password(Nullable password) { + if (password.isNull()) { + this.password = null; + } else if (password.isEmpty()) { + this.password = Optional.empty(); + } else { + this.password = Optional.of(password.get()); + } + return this; + } + + /** + *

A promo code to apply to the quote.

+ */ + @JsonSetter(value = "promo_code", nulls = Nulls.SKIP) + public Builder promoCode(Optional promoCode) { + this.promoCode = promoCode; + return this; + } + + public Builder promoCode(String promoCode) { + this.promoCode = Optional.ofNullable(promoCode); + return this; + } + + public Builder promoCode(Nullable promoCode) { + if (promoCode.isNull()) { + this.promoCode = null; + } else if (promoCode.isEmpty()) { + this.promoCode = Optional.empty(); + } else { + this.promoCode = Optional.of(promoCode.get()); + } + return this; + } + + /** + *

Where the buyer lands after an off-site payment step. Absolute https URL without credentials.

+ */ + @JsonSetter(value = "return_url", nulls = Nulls.SKIP) + public Builder returnUrl(Optional returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + public Builder returnUrl(String returnUrl) { + this.returnUrl = Optional.ofNullable(returnUrl); + return this; + } + + public Builder returnUrl(Nullable returnUrl) { + if (returnUrl.isNull()) { + this.returnUrl = null; + } else if (returnUrl.isEmpty()) { + this.returnUrl = Optional.empty(); + } else { + this.returnUrl = Optional.of(returnUrl.get()); + } + return this; + } + + /** + *

An existing membership (mem_…) this checkout pays against instead of creating a new one — the buyer pays the plan's price again onto something they already own. Ownership is checked at confirm, against the buyer who confirms: a membership they do not own is refused as not found. Cannot accompany a membership transfer link.

+ */ + @JsonSetter(value = "top_up_membership", nulls = Nulls.SKIP) + public Builder topUpMembership(Optional topUpMembership) { + this.topUpMembership = topUpMembership; + return this; + } + + public Builder topUpMembership(String topUpMembership) { + this.topUpMembership = Optional.ofNullable(topUpMembership); + return this; + } + + public Builder topUpMembership(Nullable topUpMembership) { + if (topUpMembership.isNull()) { + this.topUpMembership = null; + } else if (topUpMembership.isEmpty()) { + this.topUpMembership = Optional.empty(); + } else { + this.topUpMembership = Optional.of(topUpMembership.get()); + } + return this; + } + + /** + *

First-party tracking-link candidates keyed by account ID. Ignored outside Whop's hosted checkout; an explicit attribution.tracking_link_id wins.

+ */ + @JsonSetter(value = "tracking_link_ids_by_account", nulls = Nulls.SKIP) + public Builder trackingLinkIdsByAccount(Optional>> trackingLinkIdsByAccount) { + this.trackingLinkIdsByAccount = trackingLinkIdsByAccount; + return this; + } + + public Builder trackingLinkIdsByAccount(Map> trackingLinkIdsByAccount) { + this.trackingLinkIdsByAccount = Optional.ofNullable(trackingLinkIdsByAccount); + return this; + } + + public Builder trackingLinkIdsByAccount(Nullable>> trackingLinkIdsByAccount) { + if (trackingLinkIdsByAccount.isNull()) { + this.trackingLinkIdsByAccount = null; + } else if (trackingLinkIdsByAccount.isEmpty()) { + this.trackingLinkIdsByAccount = Optional.empty(); + } else { + this.trackingLinkIdsByAccount = Optional.of(trackingLinkIdsByAccount.get()); + } + return this; + } + + public CreateCheckoutSessionsRequest build() { + return new CreateCheckoutSessionsRequest( + affiliateCode, + attribution, + checkoutConfiguration, + items, + link, + metadata, + mode, + origin, + pageRoute, + password, + promoCode, + returnUrl, + topUpMembership, + trackingLinkIdsByAccount, + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/resources/checkoutsessions/types/CreateCheckoutSessionsRequestItemsItem.java b/src/main/java/com/whop/api/resources/checkoutsessions/types/CreateCheckoutSessionsRequestItemsItem.java new file mode 100644 index 00000000..17ce8a15 --- /dev/null +++ b/src/main/java/com/whop/api/resources/checkoutsessions/types/CreateCheckoutSessionsRequestItemsItem.java @@ -0,0 +1,174 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.checkoutsessions.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CreateCheckoutSessionsRequestItemsItem.Builder.class) +public final class CreateCheckoutSessionsRequestItemsItem { + private final String plan; + + private final Optional quantity; + + private final Map additionalProperties; + + private CreateCheckoutSessionsRequestItemsItem( + String plan, Optional quantity, Map additionalProperties) { + this.plan = plan; + this.quantity = quantity; + this.additionalProperties = additionalProperties; + } + + /** + * @return The plan being purchased (plan_…). The plan is the price. + */ + @JsonProperty("plan") + public String getPlan() { + return plan; + } + + /** + * @return How many of the plan. Defaults to 1. + */ + @JsonProperty("quantity") + public Optional getQuantity() { + return quantity; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CreateCheckoutSessionsRequestItemsItem + && equalTo((CreateCheckoutSessionsRequestItemsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CreateCheckoutSessionsRequestItemsItem other) { + return plan.equals(other.plan) && quantity.equals(other.quantity); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.plan, this.quantity); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PlanStage builder() { + return new Builder(); + } + + public interface PlanStage { + /** + *

The plan being purchased (plan_…). The plan is the price.

+ */ + _FinalStage plan(@NotNull String plan); + + Builder from(CreateCheckoutSessionsRequestItemsItem other); + } + + public interface _FinalStage { + CreateCheckoutSessionsRequestItemsItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

How many of the plan. Defaults to 1.

+ */ + _FinalStage quantity(Optional quantity); + + _FinalStage quantity(Integer quantity); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PlanStage, _FinalStage { + private String plan; + + private Optional quantity = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CreateCheckoutSessionsRequestItemsItem other) { + plan(other.getPlan()); + quantity(other.getQuantity()); + return this; + } + + /** + *

The plan being purchased (plan_…). The plan is the price.

+ *

The plan being purchased (plan_…). The plan is the price.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("plan") + public _FinalStage plan(@NotNull String plan) { + this.plan = Objects.requireNonNull(plan, "plan must not be null"); + return this; + } + + /** + *

How many of the plan. Defaults to 1.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage quantity(Integer quantity) { + this.quantity = Optional.ofNullable(quantity); + return this; + } + + /** + *

How many of the plan. Defaults to 1.

+ */ + @java.lang.Override + @JsonSetter(value = "quantity", nulls = Nulls.SKIP) + public _FinalStage quantity(Optional quantity) { + this.quantity = quantity; + return this; + } + + @java.lang.Override + public CreateCheckoutSessionsRequestItemsItem build() { + return new CreateCheckoutSessionsRequestItemsItem(plan, quantity, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/resources/checkoutsessions/types/CreateCheckoutSessionsRequestMode.java b/src/main/java/com/whop/api/resources/checkoutsessions/types/CreateCheckoutSessionsRequestMode.java new file mode 100644 index 00000000..e2059f62 --- /dev/null +++ b/src/main/java/com/whop/api/resources/checkoutsessions/types/CreateCheckoutSessionsRequestMode.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.checkoutsessions.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreateCheckoutSessionsRequestMode { + public static final CreateCheckoutSessionsRequestMode SETUP = + new CreateCheckoutSessionsRequestMode(Value.SETUP, "setup"); + + public static final CreateCheckoutSessionsRequestMode PAYMENT = + new CreateCheckoutSessionsRequestMode(Value.PAYMENT, "payment"); + + private final Value value; + + private final String string; + + CreateCheckoutSessionsRequestMode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreateCheckoutSessionsRequestMode + && this.string.equals(((CreateCheckoutSessionsRequestMode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SETUP: + return visitor.visitSetup(); + case PAYMENT: + return visitor.visitPayment(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreateCheckoutSessionsRequestMode valueOf(String value) { + switch (value) { + case "setup": + return SETUP; + case "payment": + return PAYMENT; + default: + return new CreateCheckoutSessionsRequestMode(Value.UNKNOWN, value); + } + } + + public enum Value { + PAYMENT, + + SETUP, + + UNKNOWN + } + + public interface Visitor { + T visitPayment(); + + T visitSetup(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/resources/disputes/AsyncDisputesClient.java b/src/main/java/com/whop/api/resources/disputes/AsyncDisputesClient.java index 662e0be9..51bab334 100644 --- a/src/main/java/com/whop/api/resources/disputes/AsyncDisputesClient.java +++ b/src/main/java/com/whop/api/resources/disputes/AsyncDisputesClient.java @@ -325,14 +325,14 @@ public CompletableFuture updateEvidenceDispute( } /** - * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Send the files as multipart file parts to upload and attach in one call, or reference files already stored by id/direct_upload_id. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. + * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Upload files through POST /files and reference them by id, or send the files as multipart file parts to upload and attach in one call. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. */ public CompletableFuture uploadEvidence(String id, UploadEvidenceDisputesRequest request) { return this.rawClient.uploadEvidence(id, request).thenApply(response -> response.body()); } /** - * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Send the files as multipart file parts to upload and attach in one call, or reference files already stored by id/direct_upload_id. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. + * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Upload files through POST /files and reference them by id, or send the files as multipart file parts to upload and attach in one call. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. */ public CompletableFuture uploadEvidence( String id, UploadEvidenceDisputesRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/com/whop/api/resources/disputes/AsyncRawDisputesClient.java b/src/main/java/com/whop/api/resources/disputes/AsyncRawDisputesClient.java index b3836d39..c5eb3ee5 100644 --- a/src/main/java/com/whop/api/resources/disputes/AsyncRawDisputesClient.java +++ b/src/main/java/com/whop/api/resources/disputes/AsyncRawDisputesClient.java @@ -946,7 +946,7 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Send the files as multipart file parts to upload and attach in one call, or reference files already stored by id/direct_upload_id. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. + * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Upload files through POST /files and reference them by id, or send the files as multipart file parts to upload and attach in one call. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. */ public CompletableFuture> uploadEvidence( String id, UploadEvidenceDisputesRequest request) { @@ -954,7 +954,7 @@ public CompletableFuture> uploadEvidence( } /** - * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Send the files as multipart file parts to upload and attach in one call, or reference files already stored by id/direct_upload_id. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. + * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Upload files through POST /files and reference them by id, or send the files as multipart file parts to upload and attach in one call. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. */ public CompletableFuture> uploadEvidence( String id, UploadEvidenceDisputesRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/com/whop/api/resources/disputes/DisputesClient.java b/src/main/java/com/whop/api/resources/disputes/DisputesClient.java index 68b49f30..943cacf7 100644 --- a/src/main/java/com/whop/api/resources/disputes/DisputesClient.java +++ b/src/main/java/com/whop/api/resources/disputes/DisputesClient.java @@ -321,14 +321,14 @@ public Dispute updateEvidenceDispute( } /** - * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Send the files as multipart file parts to upload and attach in one call, or reference files already stored by id/direct_upload_id. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. + * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Upload files through POST /files and reference them by id, or send the files as multipart file parts to upload and attach in one call. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. */ public Dispute uploadEvidence(String id, UploadEvidenceDisputesRequest request) { return this.rawClient.uploadEvidence(id, request).body(); } /** - * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Send the files as multipart file parts to upload and attach in one call, or reference files already stored by id/direct_upload_id. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. + * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Upload files through POST /files and reference them by id, or send the files as multipart file parts to upload and attach in one call. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. */ public Dispute uploadEvidence(String id, UploadEvidenceDisputesRequest request, RequestOptions requestOptions) { return this.rawClient.uploadEvidence(id, request, requestOptions).body(); diff --git a/src/main/java/com/whop/api/resources/disputes/RawDisputesClient.java b/src/main/java/com/whop/api/resources/disputes/RawDisputesClient.java index 62331d95..42bedab9 100644 --- a/src/main/java/com/whop/api/resources/disputes/RawDisputesClient.java +++ b/src/main/java/com/whop/api/resources/disputes/RawDisputesClient.java @@ -784,14 +784,14 @@ public WhopApiHttpResponse updateEvidenceDispute( } /** - * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Send the files as multipart file parts to upload and attach in one call, or reference files already stored by id/direct_upload_id. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. + * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Upload files through POST /files and reference them by id, or send the files as multipart file parts to upload and attach in one call. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. */ public WhopApiHttpResponse uploadEvidence(String id, UploadEvidenceDisputesRequest request) { return uploadEvidence(id, request, null); } /** - * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Send the files as multipart file parts to upload and attach in one call, or reference files already stored by id/direct_upload_id. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. + * Replaces the full set of uploaded evidence documents on a dispute, beyond the four fixed evidence slots. Upload files through POST /files and reference them by id, or send the files as multipart file parts to upload and attach in one call. Send every document the packet should carry — up to 10, 10MB each and 25MB in total; an empty list removes them all. Accepted content types: application/pdf, application/json, image/jpeg, image/png, image/webp — any other type is rejected. */ public WhopApiHttpResponse uploadEvidence( String id, UploadEvidenceDisputesRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/com/whop/api/resources/exports/requests/CreateExportsRequest.java b/src/main/java/com/whop/api/resources/exports/requests/CreateExportsRequest.java index 5fce2577..d4232970 100644 --- a/src/main/java/com/whop/api/resources/exports/requests/CreateExportsRequest.java +++ b/src/main/java/com/whop/api/resources/exports/requests/CreateExportsRequest.java @@ -67,7 +67,7 @@ public Optional> getColumns() { } /** - * @return Resource-specific filters. For native REST resources (payouts, transfers, memberships) these are the resource's own list query params; for dashboard tables they mirror the dashboard table filters. + * @return Resource-specific filters. For native REST resources (payouts, transfers, products) these are the resource's own list query params; for dashboard tables they mirror the dashboard table filters. */ @JsonProperty("filters") public Optional> getFilters() { @@ -154,7 +154,7 @@ public interface _FinalStage { _FinalStage columns(List columns); /** - *

Resource-specific filters. For native REST resources (payouts, transfers, memberships) these are the resource's own list query params; for dashboard tables they mirror the dashboard table filters.

+ *

Resource-specific filters. For native REST resources (payouts, transfers, products) these are the resource's own list query params; for dashboard tables they mirror the dashboard table filters.

*/ _FinalStage filters(Optional> filters); @@ -228,7 +228,7 @@ public _FinalStage timezone(Optional timezone) { } /** - *

Resource-specific filters. For native REST resources (payouts, transfers, memberships) these are the resource's own list query params; for dashboard tables they mirror the dashboard table filters.

+ *

Resource-specific filters. For native REST resources (payouts, transfers, products) these are the resource's own list query params; for dashboard tables they mirror the dashboard table filters.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -238,7 +238,7 @@ public _FinalStage filters(Map filters) { } /** - *

Resource-specific filters. For native REST resources (payouts, transfers, memberships) these are the resource's own list query params; for dashboard tables they mirror the dashboard table filters.

+ *

Resource-specific filters. For native REST resources (payouts, transfers, products) these are the resource's own list query params; for dashboard tables they mirror the dashboard table filters.

*/ @java.lang.Override @JsonSetter(value = "filters", nulls = Nulls.SKIP) diff --git a/src/main/java/com/whop/api/resources/exports/types/CreateExportsRequestResource.java b/src/main/java/com/whop/api/resources/exports/types/CreateExportsRequestResource.java index 18b1aff4..24e37983 100644 --- a/src/main/java/com/whop/api/resources/exports/types/CreateExportsRequestResource.java +++ b/src/main/java/com/whop/api/resources/exports/types/CreateExportsRequestResource.java @@ -53,12 +53,12 @@ public final class CreateExportsRequestResource { public static final CreateExportsRequestResource ENTRIES = new CreateExportsRequestResource(Value.ENTRIES, "entries"); - public static final CreateExportsRequestResource MEMBERSHIPS = - new CreateExportsRequestResource(Value.MEMBERSHIPS, "memberships"); - public static final CreateExportsRequestResource TRANSFERS = new CreateExportsRequestResource(Value.TRANSFERS, "transfers"); + public static final CreateExportsRequestResource MEMBERSHIPS = + new CreateExportsRequestResource(Value.MEMBERSHIPS, "memberships"); + public static final CreateExportsRequestResource CHILD_COMPANIES = new CreateExportsRequestResource(Value.CHILD_COMPANIES, "child_companies"); @@ -174,10 +174,10 @@ public T visit(Visitor visitor) { return visitor.visitShipments(); case ENTRIES: return visitor.visitEntries(); - case MEMBERSHIPS: - return visitor.visitMemberships(); case TRANSFERS: return visitor.visitTransfers(); + case MEMBERSHIPS: + return visitor.visitMemberships(); case CHILD_COMPANIES: return visitor.visitChildCompanies(); case CHECKOUT_CONFIGURATIONS: @@ -255,10 +255,10 @@ public static CreateExportsRequestResource valueOf(String value) { return SHIPMENTS; case "entries": return ENTRIES; - case "memberships": - return MEMBERSHIPS; case "transfers": return TRANSFERS; + case "memberships": + return MEMBERSHIPS; case "child_companies": return CHILD_COMPANIES; case "checkout_configurations": @@ -325,10 +325,6 @@ public enum Value { FINANCIAL_ACTIVITY, - MEMBERS, - - MEMBERSHIPS, - PAYOUT_METHODS, PAYOUTS, @@ -351,10 +347,14 @@ public enum Value { WEBHOOKS, + MEMBERS, + RECEIPTS, UNCLAIMED_MEMBERSHIPS, + MEMBERSHIPS, + TRACKING_LINKS, PROMO_CODES, @@ -401,10 +401,6 @@ public interface Visitor { T visitFinancialActivity(); - T visitMembers(); - - T visitMemberships(); - T visitPayoutMethods(); T visitPayouts(); @@ -427,10 +423,14 @@ public interface Visitor { T visitWebhooks(); + T visitMembers(); + T visitReceipts(); T visitUnclaimedMemberships(); + T visitMemberships(); + T visitTrackingLinks(); T visitPromoCodes(); diff --git a/src/main/java/com/whop/api/resources/exports/types/ListExportsRequestResource.java b/src/main/java/com/whop/api/resources/exports/types/ListExportsRequestResource.java index a724c845..80ed15dd 100644 --- a/src/main/java/com/whop/api/resources/exports/types/ListExportsRequestResource.java +++ b/src/main/java/com/whop/api/resources/exports/types/ListExportsRequestResource.java @@ -53,12 +53,12 @@ public final class ListExportsRequestResource { public static final ListExportsRequestResource ENTRIES = new ListExportsRequestResource(Value.ENTRIES, "entries"); - public static final ListExportsRequestResource MEMBERSHIPS = - new ListExportsRequestResource(Value.MEMBERSHIPS, "memberships"); - public static final ListExportsRequestResource TRANSFERS = new ListExportsRequestResource(Value.TRANSFERS, "transfers"); + public static final ListExportsRequestResource MEMBERSHIPS = + new ListExportsRequestResource(Value.MEMBERSHIPS, "memberships"); + public static final ListExportsRequestResource CHILD_COMPANIES = new ListExportsRequestResource(Value.CHILD_COMPANIES, "child_companies"); @@ -179,10 +179,10 @@ public T visit(Visitor visitor) { return visitor.visitShipments(); case ENTRIES: return visitor.visitEntries(); - case MEMBERSHIPS: - return visitor.visitMemberships(); case TRANSFERS: return visitor.visitTransfers(); + case MEMBERSHIPS: + return visitor.visitMemberships(); case CHILD_COMPANIES: return visitor.visitChildCompanies(); case WITHDRAWAL_LINES: @@ -264,10 +264,10 @@ public static ListExportsRequestResource valueOf(String value) { return SHIPMENTS; case "entries": return ENTRIES; - case "memberships": - return MEMBERSHIPS; case "transfers": return TRANSFERS; + case "memberships": + return MEMBERSHIPS; case "child_companies": return CHILD_COMPANIES; case "withdrawal_lines": @@ -336,10 +336,6 @@ public enum Value { FINANCIAL_ACTIVITY, - MEMBERS, - - MEMBERSHIPS, - PAYOUT_METHODS, PAYOUTS, @@ -362,10 +358,14 @@ public enum Value { WEBHOOKS, + MEMBERS, + RECEIPTS, UNCLAIMED_MEMBERSHIPS, + MEMBERSHIPS, + TRACKING_LINKS, PROMO_CODES, @@ -416,10 +416,6 @@ public interface Visitor { T visitFinancialActivity(); - T visitMembers(); - - T visitMemberships(); - T visitPayoutMethods(); T visitPayouts(); @@ -442,10 +438,14 @@ public interface Visitor { T visitWebhooks(); + T visitMembers(); + T visitReceipts(); T visitUnclaimedMemberships(); + T visitMemberships(); + T visitTrackingLinks(); T visitPromoCodes(); diff --git a/src/main/java/com/whop/api/resources/files/AsyncFilesClient.java b/src/main/java/com/whop/api/resources/files/AsyncFilesClient.java index fc5a1e0b..4e99d907 100644 --- a/src/main/java/com/whop/api/resources/files/AsyncFilesClient.java +++ b/src/main/java/com/whop/api/resources/files/AsyncFilesClient.java @@ -5,9 +5,9 @@ import com.whop.api.core.ClientOptions; import com.whop.api.core.RequestOptions; +import com.whop.api.resources.files.requests.CompleteFilesRequest; import com.whop.api.resources.files.requests.CreateFilesRequest; import com.whop.api.resources.files.requests.RetrieveFilesRequest; -import com.whop.api.resources.files.types.CreateFilesResponse; import com.whop.api.types.File; import java.util.concurrent.CompletableFuture; @@ -29,44 +29,58 @@ public AsyncRawFilesClient withRawResponse() { } /** - * Create a new file record and receive a presigned URL for uploading content to S3. + * Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to upload_url (single-part), or to each of multipart_upload_urls and then call Complete File Multipart Upload. Once the bytes land the file becomes ready, and its ID can be attached wherever a file is accepted — account legal documents, dispute evidence documents. */ - public CompletableFuture create(CreateFilesRequest request) { + public CompletableFuture create(CreateFilesRequest request) { return this.rawClient.create(request).thenApply(response -> response.body()); } /** - * Create a new file record and receive a presigned URL for uploading content to S3. + * Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to upload_url (single-part), or to each of multipart_upload_urls and then call Complete File Multipart Upload. Once the bytes land the file becomes ready, and its ID can be attached wherever a file is accepted — account legal documents, dispute evidence documents. */ - public CompletableFuture create(CreateFilesRequest request, RequestOptions requestOptions) { + public CompletableFuture create(CreateFilesRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).thenApply(response -> response.body()); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public CompletableFuture retrieve(String id) { return this.rawClient.retrieve(id).thenApply(response -> response.body()); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public CompletableFuture retrieve(String id, RequestOptions requestOptions) { return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public CompletableFuture retrieve(String id, RetrieveFilesRequest request) { return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public CompletableFuture retrieve(String id, RetrieveFilesRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(id, request, requestOptions).thenApply(response -> response.body()); } + + /** + * Assembles the parts of a multipart upload after every part has been PUT to its presigned URL. Pass the multipart_upload_id from Create File and each part's ETag response header. + */ + public CompletableFuture complete(String id, CompleteFilesRequest request) { + return this.rawClient.complete(id, request).thenApply(response -> response.body()); + } + + /** + * Assembles the parts of a multipart upload after every part has been PUT to its presigned URL. Pass the multipart_upload_id from Create File and each part's ETag response header. + */ + public CompletableFuture complete(String id, CompleteFilesRequest request, RequestOptions requestOptions) { + return this.rawClient.complete(id, request, requestOptions).thenApply(response -> response.body()); + } } diff --git a/src/main/java/com/whop/api/resources/files/AsyncRawFilesClient.java b/src/main/java/com/whop/api/resources/files/AsyncRawFilesClient.java index c5b07afa..86895b72 100644 --- a/src/main/java/com/whop/api/resources/files/AsyncRawFilesClient.java +++ b/src/main/java/com/whop/api/resources/files/AsyncRawFilesClient.java @@ -12,16 +12,14 @@ import com.whop.api.core.WhopApiException; import com.whop.api.core.WhopApiHttpResponse; import com.whop.api.errors.BadRequestError; -import com.whop.api.errors.ForbiddenError; -import com.whop.api.errors.InternalServerError; +import com.whop.api.errors.ConflictError; import com.whop.api.errors.NotFoundError; -import com.whop.api.errors.TooManyRequestsError; import com.whop.api.errors.UnauthorizedError; -import com.whop.api.errors.UnprocessableEntityError; +import com.whop.api.resources.files.requests.CompleteFilesRequest; import com.whop.api.resources.files.requests.CreateFilesRequest; import com.whop.api.resources.files.requests.RetrieveFilesRequest; -import com.whop.api.resources.files.types.CreateFilesResponse; import com.whop.api.types.File; +import com.whop.api.types.V1ErrorResponse; import java.io.IOException; import java.util.concurrent.CompletableFuture; import okhttp3.Call; @@ -43,16 +41,16 @@ public AsyncRawFilesClient(ClientOptions clientOptions) { } /** - * Create a new file record and receive a presigned URL for uploading content to S3. + * Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to upload_url (single-part), or to each of multipart_upload_urls and then call Complete File Multipart Upload. Once the bytes land the file becomes ready, and its ID can be attached wherever a file is accepted — account legal documents, dispute evidence documents. */ - public CompletableFuture> create(CreateFilesRequest request) { + public CompletableFuture> create(CreateFilesRequest request) { return create(request, null); } /** - * Create a new file record and receive a presigned URL for uploading content to S3. + * Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to upload_url (single-part), or to each of multipart_upload_urls and then call Complete File Multipart Upload. Once the bytes land the file becomes ready, and its ID can be attached wherever a file is accepted — account legal documents, dispute evidence documents. */ - public CompletableFuture> create( + public CompletableFuture> create( CreateFilesRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() @@ -80,7 +78,7 @@ public CompletableFuture> create( if (requestOptions != null && requestOptions.getTimeout().isPresent()) { client = clientOptions.httpClientWithTimeout(requestOptions); } - CompletableFuture> future = new CompletableFuture<>(); + CompletableFuture> future = new CompletableFuture<>(); client.newCall(okhttpRequest).enqueue(new Callback() { @Override public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { @@ -88,8 +86,7 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { future.complete(new WhopApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateFilesResponse.class), - response)); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, File.class), response)); return; } try { @@ -104,29 +101,9 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; - case 403: - future.completeExceptionally(new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 404: - future.completeExceptionally(new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 422: - future.completeExceptionally(new UnprocessableEntityError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 429: - future.completeExceptionally(new TooManyRequestsError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; - case 500: - future.completeExceptionally(new InternalServerError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, V1ErrorResponse.class), response)); return; } @@ -151,28 +128,28 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public CompletableFuture> retrieve(String id) { return retrieve(id, RetrieveFilesRequest.builder().build()); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { return retrieve(id, RetrieveFilesRequest.builder().build(), requestOptions); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public CompletableFuture> retrieve(String id, RetrieveFilesRequest request) { return retrieve(id, request, null); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public CompletableFuture> retrieve( String id, RetrieveFilesRequest request, RequestOptions requestOptions) { @@ -208,41 +185,110 @@ public void onResponse(@NotNull Call call, @NotNull Response response) throws IO } try { switch (response.code()) { - case 400: - future.completeExceptionally(new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; case 401: future.completeExceptionally(new UnauthorizedError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; - case 403: - future.completeExceptionally(new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), - response)); - return; case 404: future.completeExceptionally(new NotFoundError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; - case 422: - future.completeExceptionally(new UnprocessableEntityError( + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + future.completeExceptionally(new WhopApiApiException( + "Error with status code " + response.code(), response.code(), errorBody, response)); + return; + } catch (IOException e) { + future.completeExceptionally(new WhopApiException("Network error executing HTTP request", e)); + } + } + + @Override + public void onFailure(@NotNull Call call, @NotNull IOException e) { + future.completeExceptionally(new WhopApiException("Network error executing HTTP request", e)); + } + }); + return future; + } + + /** + * Assembles the parts of a multipart upload after every part has been PUT to its presigned URL. Pass the multipart_upload_id from Create File and each part's ETag response header. + */ + public CompletableFuture> complete(String id, CompleteFilesRequest request) { + return complete(id, request, null); + } + + /** + * Assembles the parts of a multipart upload after every part has been PUT to its presigned URL. Pass the multipart_upload_id from Create File and each part's ETag response header. + */ + public CompletableFuture> complete( + String id, CompleteFilesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("files") + .addPathSegment(id) + .addPathSegments("complete"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new WhopApiException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + CompletableFuture> future = new CompletableFuture<>(); + client.newCall(okhttpRequest).enqueue(new Callback() { + @Override + public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException { + try (ResponseBody responseBody = response.body()) { + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + future.complete(new WhopApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, File.class), response)); + return; + } + try { + switch (response.code()) { + case 400: + future.completeExceptionally(new BadRequestError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; - case 429: - future.completeExceptionally(new TooManyRequestsError( + case 401: + future.completeExceptionally(new UnauthorizedError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; - case 500: - future.completeExceptionally(new InternalServerError( + case 404: + future.completeExceptionally(new NotFoundError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response)); return; + case 409: + future.completeExceptionally(new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, V1ErrorResponse.class), + response)); + return; } } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error diff --git a/src/main/java/com/whop/api/resources/files/FilesClient.java b/src/main/java/com/whop/api/resources/files/FilesClient.java index b6e6ca08..8d07d746 100644 --- a/src/main/java/com/whop/api/resources/files/FilesClient.java +++ b/src/main/java/com/whop/api/resources/files/FilesClient.java @@ -5,9 +5,9 @@ import com.whop.api.core.ClientOptions; import com.whop.api.core.RequestOptions; +import com.whop.api.resources.files.requests.CompleteFilesRequest; import com.whop.api.resources.files.requests.CreateFilesRequest; import com.whop.api.resources.files.requests.RetrieveFilesRequest; -import com.whop.api.resources.files.types.CreateFilesResponse; import com.whop.api.types.File; public class FilesClient { @@ -28,44 +28,58 @@ public RawFilesClient withRawResponse() { } /** - * Create a new file record and receive a presigned URL for uploading content to S3. + * Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to upload_url (single-part), or to each of multipart_upload_urls and then call Complete File Multipart Upload. Once the bytes land the file becomes ready, and its ID can be attached wherever a file is accepted — account legal documents, dispute evidence documents. */ - public CreateFilesResponse create(CreateFilesRequest request) { + public File create(CreateFilesRequest request) { return this.rawClient.create(request).body(); } /** - * Create a new file record and receive a presigned URL for uploading content to S3. + * Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to upload_url (single-part), or to each of multipart_upload_urls and then call Complete File Multipart Upload. Once the bytes land the file becomes ready, and its ID can be attached wherever a file is accepted — account legal documents, dispute evidence documents. */ - public CreateFilesResponse create(CreateFilesRequest request, RequestOptions requestOptions) { + public File create(CreateFilesRequest request, RequestOptions requestOptions) { return this.rawClient.create(request, requestOptions).body(); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public File retrieve(String id) { return this.rawClient.retrieve(id).body(); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public File retrieve(String id, RequestOptions requestOptions) { return this.rawClient.retrieve(id, requestOptions).body(); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public File retrieve(String id, RetrieveFilesRequest request) { return this.rawClient.retrieve(id, request).body(); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public File retrieve(String id, RetrieveFilesRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(id, request, requestOptions).body(); } + + /** + * Assembles the parts of a multipart upload after every part has been PUT to its presigned URL. Pass the multipart_upload_id from Create File and each part's ETag response header. + */ + public File complete(String id, CompleteFilesRequest request) { + return this.rawClient.complete(id, request).body(); + } + + /** + * Assembles the parts of a multipart upload after every part has been PUT to its presigned URL. Pass the multipart_upload_id from Create File and each part's ETag response header. + */ + public File complete(String id, CompleteFilesRequest request, RequestOptions requestOptions) { + return this.rawClient.complete(id, request, requestOptions).body(); + } } diff --git a/src/main/java/com/whop/api/resources/files/RawFilesClient.java b/src/main/java/com/whop/api/resources/files/RawFilesClient.java index 5b3f69f5..5c164281 100644 --- a/src/main/java/com/whop/api/resources/files/RawFilesClient.java +++ b/src/main/java/com/whop/api/resources/files/RawFilesClient.java @@ -12,16 +12,14 @@ import com.whop.api.core.WhopApiException; import com.whop.api.core.WhopApiHttpResponse; import com.whop.api.errors.BadRequestError; -import com.whop.api.errors.ForbiddenError; -import com.whop.api.errors.InternalServerError; +import com.whop.api.errors.ConflictError; import com.whop.api.errors.NotFoundError; -import com.whop.api.errors.TooManyRequestsError; import com.whop.api.errors.UnauthorizedError; -import com.whop.api.errors.UnprocessableEntityError; +import com.whop.api.resources.files.requests.CompleteFilesRequest; import com.whop.api.resources.files.requests.CreateFilesRequest; import com.whop.api.resources.files.requests.RetrieveFilesRequest; -import com.whop.api.resources.files.types.CreateFilesResponse; import com.whop.api.types.File; +import com.whop.api.types.V1ErrorResponse; import java.io.IOException; import okhttp3.Headers; import okhttp3.HttpUrl; @@ -39,16 +37,16 @@ public RawFilesClient(ClientOptions clientOptions) { } /** - * Create a new file record and receive a presigned URL for uploading content to S3. + * Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to upload_url (single-part), or to each of multipart_upload_urls and then call Complete File Multipart Upload. Once the bytes land the file becomes ready, and its ID can be attached wherever a file is accepted — account legal documents, dispute evidence documents. */ - public WhopApiHttpResponse create(CreateFilesRequest request) { + public WhopApiHttpResponse create(CreateFilesRequest request) { return create(request, null); } /** - * Create a new file record and receive a presigned URL for uploading content to S3. + * Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to upload_url (single-part), or to each of multipart_upload_urls and then call Complete File Multipart Upload. Once the bytes land the file becomes ready, and its ID can be attached wherever a file is accepted — account legal documents, dispute evidence documents. */ - public WhopApiHttpResponse create(CreateFilesRequest request, RequestOptions requestOptions) { + public WhopApiHttpResponse create(CreateFilesRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("files"); @@ -80,7 +78,7 @@ public WhopApiHttpResponse create(CreateFilesRequest reques String responseBodyString = responseBody != null ? responseBody.string() : "{}"; if (response.isSuccessful()) { return new WhopApiHttpResponse<>( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, CreateFilesResponse.class), response); + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, File.class), response); } try { switch (response.code()) { @@ -90,21 +88,10 @@ public WhopApiHttpResponse create(CreateFilesRequest reques case 401: throw new UnauthorizedError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 403: - throw new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 404: - throw new NotFoundError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 422: - throw new UnprocessableEntityError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 429: - throw new TooManyRequestsError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 500: - throw new InternalServerError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, V1ErrorResponse.class), + response); } } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error @@ -118,28 +105,28 @@ public WhopApiHttpResponse create(CreateFilesRequest reques } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public WhopApiHttpResponse retrieve(String id) { return retrieve(id, RetrieveFilesRequest.builder().build()); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public WhopApiHttpResponse retrieve(String id, RequestOptions requestOptions) { return retrieve(id, RetrieveFilesRequest.builder().build(), requestOptions); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public WhopApiHttpResponse retrieve(String id, RetrieveFilesRequest request) { return retrieve(id, request, null); } /** - * Retrieves the details of an existing file. + * Retrieves a file you uploaded — poll it after uploading the bytes to see upload_status become ready. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. */ public WhopApiHttpResponse retrieve(String id, RetrieveFilesRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) @@ -170,27 +157,85 @@ public WhopApiHttpResponse retrieve(String id, RetrieveFilesRequest reques } try { switch (response.code()) { - case 400: - throw new BadRequestError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); case 401: throw new UnauthorizedError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 403: - throw new ForbiddenError( - ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); case 404: throw new NotFoundError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 422: - throw new UnprocessableEntityError( + } + } catch (JsonProcessingException ignored) { + // unable to map error response, throwing generic error + } + Object errorBody = ObjectMappers.parseErrorBody(responseBodyString); + throw new WhopApiApiException( + "Error with status code " + response.code(), response.code(), errorBody, response); + } catch (IOException e) { + throw new WhopApiException("Network error executing HTTP request", e); + } + } + + /** + * Assembles the parts of a multipart upload after every part has been PUT to its presigned URL. Pass the multipart_upload_id from Create File and each part's ETag response header. + */ + public WhopApiHttpResponse complete(String id, CompleteFilesRequest request) { + return complete(id, request, null); + } + + /** + * Assembles the parts of a multipart upload after every part has been PUT to its presigned URL. Pass the multipart_upload_id from Create File and each part's ETag response header. + */ + public WhopApiHttpResponse complete(String id, CompleteFilesRequest request, RequestOptions requestOptions) { + HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) + .newBuilder() + .addPathSegments("files") + .addPathSegment(id) + .addPathSegments("complete"); + if (requestOptions != null) { + requestOptions.getQueryParameters().forEach((_key, _value) -> { + httpUrl.addQueryParameter(_key, _value); + }); + } + RequestBody body; + try { + body = RequestBody.create( + ObjectMappers.JSON_MAPPER.writeValueAsBytes(request), MediaTypes.APPLICATION_JSON); + } catch (JsonProcessingException e) { + throw new WhopApiException("Failed to serialize request", e); + } + Request okhttpRequest = new Request.Builder() + .url(httpUrl.build()) + .method("POST", body) + .headers(Headers.of(clientOptions.headers(requestOptions))) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + OkHttpClient client = clientOptions.httpClient(); + if (requestOptions != null && requestOptions.getTimeout().isPresent()) { + client = clientOptions.httpClientWithTimeout(requestOptions); + } + try (Response response = client.newCall(okhttpRequest).execute()) { + ResponseBody responseBody = response.body(); + String responseBodyString = responseBody != null ? responseBody.string() : "{}"; + if (response.isSuccessful()) { + return new WhopApiHttpResponse<>( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, File.class), response); + } + try { + switch (response.code()) { + case 400: + throw new BadRequestError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 429: - throw new TooManyRequestsError( + case 401: + throw new UnauthorizedError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); - case 500: - throw new InternalServerError( + case 404: + throw new NotFoundError( ObjectMappers.JSON_MAPPER.readValue(responseBodyString, Object.class), response); + case 409: + throw new ConflictError( + ObjectMappers.JSON_MAPPER.readValue(responseBodyString, V1ErrorResponse.class), + response); } } catch (JsonProcessingException ignored) { // unable to map error response, throwing generic error diff --git a/src/main/java/com/whop/api/resources/files/requests/CompleteFilesRequest.java b/src/main/java/com/whop/api/resources/files/requests/CompleteFilesRequest.java new file mode 100644 index 00000000..c11e1268 --- /dev/null +++ b/src/main/java/com/whop/api/resources/files/requests/CompleteFilesRequest.java @@ -0,0 +1,194 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.files.requests; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import com.whop.api.resources.files.types.CompleteFilesRequestMultipartPartsItem; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CompleteFilesRequest.Builder.class) +public final class CompleteFilesRequest { + private final List multipartParts; + + private final String multipartUploadId; + + private final Map additionalProperties; + + private CompleteFilesRequest( + List multipartParts, + String multipartUploadId, + Map additionalProperties) { + this.multipartParts = multipartParts; + this.multipartUploadId = multipartUploadId; + this.additionalProperties = additionalProperties; + } + + /** + * @return Every uploaded part, in order. + */ + @JsonProperty("multipart_parts") + public List getMultipartParts() { + return multipartParts; + } + + /** + * @return The ID of the multipart upload, returned by Create File. + */ + @JsonProperty("multipart_upload_id") + public String getMultipartUploadId() { + return multipartUploadId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompleteFilesRequest && equalTo((CompleteFilesRequest) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CompleteFilesRequest other) { + return multipartParts.equals(other.multipartParts) && multipartUploadId.equals(other.multipartUploadId); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.multipartParts, this.multipartUploadId); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static MultipartUploadIdStage builder() { + return new Builder(); + } + + public interface MultipartUploadIdStage { + /** + *

The ID of the multipart upload, returned by Create File.

+ */ + _FinalStage multipartUploadId(@NotNull String multipartUploadId); + + Builder from(CompleteFilesRequest other); + } + + public interface _FinalStage { + CompleteFilesRequest build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Every uploaded part, in order.

+ */ + _FinalStage multipartParts(List multipartParts); + + _FinalStage addMultipartParts(CompleteFilesRequestMultipartPartsItem multipartParts); + + _FinalStage addAllMultipartParts(List multipartParts); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements MultipartUploadIdStage, _FinalStage { + private String multipartUploadId; + + private List multipartParts = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CompleteFilesRequest other) { + multipartParts(other.getMultipartParts()); + multipartUploadId(other.getMultipartUploadId()); + return this; + } + + /** + *

The ID of the multipart upload, returned by Create File.

+ *

The ID of the multipart upload, returned by Create File.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("multipart_upload_id") + public _FinalStage multipartUploadId(@NotNull String multipartUploadId) { + this.multipartUploadId = Objects.requireNonNull(multipartUploadId, "multipartUploadId must not be null"); + return this; + } + + /** + *

Every uploaded part, in order.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllMultipartParts(List multipartParts) { + if (multipartParts != null) { + this.multipartParts.addAll(multipartParts); + } + return this; + } + + /** + *

Every uploaded part, in order.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addMultipartParts(CompleteFilesRequestMultipartPartsItem multipartParts) { + this.multipartParts.add(multipartParts); + return this; + } + + /** + *

Every uploaded part, in order.

+ */ + @java.lang.Override + @JsonSetter(value = "multipart_parts", nulls = Nulls.SKIP) + public _FinalStage multipartParts(List multipartParts) { + this.multipartParts.clear(); + if (multipartParts != null) { + this.multipartParts.addAll(multipartParts); + } + return this; + } + + @java.lang.Override + public CompleteFilesRequest build() { + return new CompleteFilesRequest(multipartParts, multipartUploadId, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/resources/files/requests/CreateFilesRequest.java b/src/main/java/com/whop/api/resources/files/requests/CreateFilesRequest.java index 9d26cf10..ad772b27 100644 --- a/src/main/java/com/whop/api/resources/files/requests/CreateFilesRequest.java +++ b/src/main/java/com/whop/api/resources/files/requests/CreateFilesRequest.java @@ -5,17 +5,14 @@ import com.fasterxml.jackson.annotation.JsonAnyGetter; import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonSetter; import com.fasterxml.jackson.annotation.Nulls; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.whop.api.core.Nullable; -import com.whop.api.core.NullableNonemptyFilter; import com.whop.api.core.ObjectMappers; -import com.whop.api.types.FileVisibility; +import com.whop.api.resources.files.types.CreateFilesRequestVisibility; import java.util.HashMap; import java.util.Map; import java.util.Objects; @@ -25,21 +22,39 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = CreateFilesRequest.Builder.class) public final class CreateFilesRequest { + private final Optional byteSize; + private final String filename; - private final Optional visibility; + private final Optional multipart; + + private final Optional visibility; private final Map additionalProperties; private CreateFilesRequest( - String filename, Optional visibility, Map additionalProperties) { + Optional byteSize, + String filename, + Optional multipart, + Optional visibility, + Map additionalProperties) { + this.byteSize = byteSize; this.filename = filename; + this.multipart = multipart; this.visibility = visibility; this.additionalProperties = additionalProperties; } /** - * @return The name of the file including its extension (e.g., "photo.png" or "document.pdf"). + * @return The file's size in bytes. Required when multipart is true. Multipart uploads support at most 10,000 parts of 5MB each (about 50 GB). + */ + @JsonProperty("byte_size") + public Optional getByteSize() { + return byteSize; + } + + /** + * @return The name of the file including its extension, e.g. terms.pdf. */ @JsonProperty("filename") public String getFilename() { @@ -47,19 +62,18 @@ public String getFilename() { } /** - * @return Controls whether the file is publicly accessible via CDN or requires authentication. Defaults to private. + * @return Upload the file in 5MB parts. Required for files larger than 5GB; useful above ~100MB. The file must be larger than 5MB. */ - @JsonIgnore - public Optional getVisibility() { - if (visibility == null) { - return Optional.empty(); - } - return visibility; + @JsonProperty("multipart") + public Optional getMultipart() { + return multipart; } - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + /** + * @return public files are served via an unsigned CDN URL — use for assets anyone may see. private files are served via a signed, expiring URL — use for sensitive documents. Defaults to private. + */ @JsonProperty("visibility") - private Optional _getVisibility() { + public Optional getVisibility() { return visibility; } @@ -75,12 +89,15 @@ public Map getAdditionalProperties() { } private boolean equalTo(CreateFilesRequest other) { - return filename.equals(other.filename) && visibility.equals(other.visibility); + return byteSize.equals(other.byteSize) + && filename.equals(other.filename) + && multipart.equals(other.multipart) + && visibility.equals(other.visibility); } @java.lang.Override public int hashCode() { - return Objects.hash(this.filename, this.visibility); + return Objects.hash(this.byteSize, this.filename, this.multipart, this.visibility); } @java.lang.Override @@ -94,7 +111,7 @@ public static FilenameStage builder() { public interface FilenameStage { /** - *

The name of the file including its extension (e.g., "photo.png" or "document.pdf").

+ *

The name of the file including its extension, e.g. terms.pdf.

*/ _FinalStage filename(@NotNull String filename); @@ -109,20 +126,36 @@ public interface _FinalStage { _FinalStage additionalProperties(Map additionalProperties); /** - *

Controls whether the file is publicly accessible via CDN or requires authentication. Defaults to private.

+ *

The file's size in bytes. Required when multipart is true. Multipart uploads support at most 10,000 parts of 5MB each (about 50 GB).

+ */ + _FinalStage byteSize(Optional byteSize); + + _FinalStage byteSize(Integer byteSize); + + /** + *

Upload the file in 5MB parts. Required for files larger than 5GB; useful above ~100MB. The file must be larger than 5MB.

*/ - _FinalStage visibility(Optional visibility); + _FinalStage multipart(Optional multipart); - _FinalStage visibility(FileVisibility visibility); + _FinalStage multipart(Boolean multipart); + + /** + *

public files are served via an unsigned CDN URL — use for assets anyone may see. private files are served via a signed, expiring URL — use for sensitive documents. Defaults to private.

+ */ + _FinalStage visibility(Optional visibility); - _FinalStage visibility(Nullable visibility); + _FinalStage visibility(CreateFilesRequestVisibility visibility); } @JsonIgnoreProperties(ignoreUnknown = true) public static final class Builder implements FilenameStage, _FinalStage { private String filename; - private Optional visibility = Optional.empty(); + private Optional visibility = Optional.empty(); + + private Optional multipart = Optional.empty(); + + private Optional byteSize = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -131,14 +164,16 @@ private Builder() {} @java.lang.Override public Builder from(CreateFilesRequest other) { + byteSize(other.getByteSize()); filename(other.getFilename()); + multipart(other.getMultipart()); visibility(other.getVisibility()); return this; } /** - *

The name of the file including its extension (e.g., "photo.png" or "document.pdf").

- *

The name of the file including its extension (e.g., "photo.png" or "document.pdf").

+ *

The name of the file including its extension, e.g. terms.pdf.

+ *

The name of the file including its extension, e.g. terms.pdf.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -149,44 +184,68 @@ public _FinalStage filename(@NotNull String filename) { } /** - *

Controls whether the file is publicly accessible via CDN or requires authentication. Defaults to private.

+ *

public files are served via an unsigned CDN URL — use for assets anyone may see. private files are served via a signed, expiring URL — use for sensitive documents. Defaults to private.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage visibility(CreateFilesRequestVisibility visibility) { + this.visibility = Optional.ofNullable(visibility); + return this; + } + + /** + *

public files are served via an unsigned CDN URL — use for assets anyone may see. private files are served via a signed, expiring URL — use for sensitive documents. Defaults to private.

+ */ + @java.lang.Override + @JsonSetter(value = "visibility", nulls = Nulls.SKIP) + public _FinalStage visibility(Optional visibility) { + this.visibility = visibility; + return this; + } + + /** + *

Upload the file in 5MB parts. Required for files larger than 5GB; useful above ~100MB. The file must be larger than 5MB.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage visibility(Nullable visibility) { - if (visibility.isNull()) { - this.visibility = null; - } else if (visibility.isEmpty()) { - this.visibility = Optional.empty(); - } else { - this.visibility = Optional.of(visibility.get()); - } + public _FinalStage multipart(Boolean multipart) { + this.multipart = Optional.ofNullable(multipart); return this; } /** - *

Controls whether the file is publicly accessible via CDN or requires authentication. Defaults to private.

+ *

Upload the file in 5MB parts. Required for files larger than 5GB; useful above ~100MB. The file must be larger than 5MB.

+ */ + @java.lang.Override + @JsonSetter(value = "multipart", nulls = Nulls.SKIP) + public _FinalStage multipart(Optional multipart) { + this.multipart = multipart; + return this; + } + + /** + *

The file's size in bytes. Required when multipart is true. Multipart uploads support at most 10,000 parts of 5MB each (about 50 GB).

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage visibility(FileVisibility visibility) { - this.visibility = Optional.ofNullable(visibility); + public _FinalStage byteSize(Integer byteSize) { + this.byteSize = Optional.ofNullable(byteSize); return this; } /** - *

Controls whether the file is publicly accessible via CDN or requires authentication. Defaults to private.

+ *

The file's size in bytes. Required when multipart is true. Multipart uploads support at most 10,000 parts of 5MB each (about 50 GB).

*/ @java.lang.Override - @JsonSetter(value = "visibility", nulls = Nulls.SKIP) - public _FinalStage visibility(Optional visibility) { - this.visibility = visibility; + @JsonSetter(value = "byte_size", nulls = Nulls.SKIP) + public _FinalStage byteSize(Optional byteSize) { + this.byteSize = byteSize; return this; } @java.lang.Override public CreateFilesRequest build() { - return new CreateFilesRequest(filename, visibility, additionalProperties); + return new CreateFilesRequest(byteSize, filename, multipart, visibility, additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/whop/api/resources/files/types/CompleteFilesRequestMultipartPartsItem.java b/src/main/java/com/whop/api/resources/files/types/CompleteFilesRequestMultipartPartsItem.java new file mode 100644 index 00000000..f93b9e37 --- /dev/null +++ b/src/main/java/com/whop/api/resources/files/types/CompleteFilesRequestMultipartPartsItem.java @@ -0,0 +1,164 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CompleteFilesRequestMultipartPartsItem.Builder.class) +public final class CompleteFilesRequestMultipartPartsItem { + private final String etag; + + private final int partNumber; + + private final Map additionalProperties; + + private CompleteFilesRequestMultipartPartsItem( + String etag, int partNumber, Map additionalProperties) { + this.etag = etag; + this.partNumber = partNumber; + this.additionalProperties = additionalProperties; + } + + /** + * @return The ETag response header from the part's upload. + */ + @JsonProperty("etag") + public String getEtag() { + return etag; + } + + /** + * @return The 1-based index of the part. + */ + @JsonProperty("part_number") + public int getPartNumber() { + return partNumber; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompleteFilesRequestMultipartPartsItem + && equalTo((CompleteFilesRequestMultipartPartsItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CompleteFilesRequestMultipartPartsItem other) { + return etag.equals(other.etag) && partNumber == other.partNumber; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.etag, this.partNumber); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static EtagStage builder() { + return new Builder(); + } + + public interface EtagStage { + /** + *

The ETag response header from the part's upload.

+ */ + PartNumberStage etag(@NotNull String etag); + + Builder from(CompleteFilesRequestMultipartPartsItem other); + } + + public interface PartNumberStage { + /** + *

The 1-based index of the part.

+ */ + _FinalStage partNumber(int partNumber); + } + + public interface _FinalStage { + CompleteFilesRequestMultipartPartsItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements EtagStage, PartNumberStage, _FinalStage { + private String etag; + + private int partNumber; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CompleteFilesRequestMultipartPartsItem other) { + etag(other.getEtag()); + partNumber(other.getPartNumber()); + return this; + } + + /** + *

The ETag response header from the part's upload.

+ *

The ETag response header from the part's upload.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("etag") + public PartNumberStage etag(@NotNull String etag) { + this.etag = Objects.requireNonNull(etag, "etag must not be null"); + return this; + } + + /** + *

The 1-based index of the part.

+ *

The 1-based index of the part.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("part_number") + public _FinalStage partNumber(int partNumber) { + this.partNumber = partNumber; + return this; + } + + @java.lang.Override + public CompleteFilesRequestMultipartPartsItem build() { + return new CompleteFilesRequestMultipartPartsItem(etag, partNumber, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/resources/files/types/CreateFilesRequestVisibility.java b/src/main/java/com/whop/api/resources/files/types/CreateFilesRequestVisibility.java new file mode 100644 index 00000000..f431b28e --- /dev/null +++ b/src/main/java/com/whop/api/resources/files/types/CreateFilesRequestVisibility.java @@ -0,0 +1,85 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.files.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CreateFilesRequestVisibility { + public static final CreateFilesRequestVisibility PRIVATE = + new CreateFilesRequestVisibility(Value.PRIVATE, "private"); + + public static final CreateFilesRequestVisibility PUBLIC = new CreateFilesRequestVisibility(Value.PUBLIC, "public"); + + private final Value value; + + private final String string; + + CreateFilesRequestVisibility(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CreateFilesRequestVisibility + && this.string.equals(((CreateFilesRequestVisibility) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PRIVATE: + return visitor.visitPrivate(); + case PUBLIC: + return visitor.visitPublic(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CreateFilesRequestVisibility valueOf(String value) { + switch (value) { + case "private": + return PRIVATE; + case "public": + return PUBLIC; + default: + return new CreateFilesRequestVisibility(Value.UNKNOWN, value); + } + } + + public enum Value { + PUBLIC, + + PRIVATE, + + UNKNOWN + } + + public interface Visitor { + T visitPublic(); + + T visitPrivate(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/resources/files/types/CreateFilesResponse.java b/src/main/java/com/whop/api/resources/files/types/CreateFilesResponse.java deleted file mode 100644 index 54301990..00000000 --- a/src/main/java/com/whop/api/resources/files/types/CreateFilesResponse.java +++ /dev/null @@ -1,647 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.whop.api.resources.files.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.whop.api.core.Nullable; -import com.whop.api.core.NullableNonemptyFilter; -import com.whop.api.core.ObjectMappers; -import com.whop.api.types.FileVisibility; -import com.whop.api.types.UploadStatuses; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = CreateFilesResponse.Builder.class) -public final class CreateFilesResponse { - private final Optional contentType; - - private final Optional filename; - - private final String id; - - private final Optional size; - - private final Optional> uploadHeaders; - - private final UploadStatuses uploadStatus; - - private final Optional uploadUrl; - - private final Optional url; - - private final FileVisibility visibility; - - private final Map additionalProperties; - - private CreateFilesResponse( - Optional contentType, - Optional filename, - String id, - Optional size, - Optional> uploadHeaders, - UploadStatuses uploadStatus, - Optional uploadUrl, - Optional url, - FileVisibility visibility, - Map additionalProperties) { - this.contentType = contentType; - this.filename = filename; - this.id = id; - this.size = size; - this.uploadHeaders = uploadHeaders; - this.uploadStatus = uploadStatus; - this.uploadUrl = uploadUrl; - this.url = url; - this.visibility = visibility; - this.additionalProperties = additionalProperties; - } - - /** - * @return The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). - */ - @JsonIgnore - public Optional getContentType() { - if (contentType == null) { - return Optional.empty(); - } - return contentType; - } - - /** - * @return The original filename of the uploaded file, including its file extension. - */ - @JsonIgnore - public Optional getFilename() { - if (filename == null) { - return Optional.empty(); - } - return filename; - } - - /** - * @return The unique identifier for the file. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * @return The file size in bytes. Null if the file has not finished uploading. - */ - @JsonIgnore - public Optional getSize() { - if (size == null) { - return Optional.empty(); - } - return size; - } - - /** - * @return Headers to include in the upload request. Only present in the response from the create mutation. - */ - @JsonIgnore - public Optional> getUploadHeaders() { - if (uploadHeaders == null) { - return Optional.empty(); - } - return uploadHeaders; - } - - /** - * @return The current upload status of the file (e.g., pending, ready). - */ - @JsonProperty("upload_status") - public UploadStatuses getUploadStatus() { - return uploadStatus; - } - - /** - * @return The presigned URL to upload the file contents to. Only present in the response from the create mutation. - */ - @JsonIgnore - public Optional getUploadUrl() { - if (uploadUrl == null) { - return Optional.empty(); - } - return uploadUrl; - } - - /** - * @return The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading. - */ - @JsonIgnore - public Optional getUrl() { - if (url == null) { - return Optional.empty(); - } - return url; - } - - /** - * @return Whether the file is publicly accessible or requires authentication. - */ - @JsonProperty("visibility") - public FileVisibility getVisibility() { - return visibility; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("content_type") - private Optional _getContentType() { - return contentType; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("filename") - private Optional _getFilename() { - return filename; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("size") - private Optional _getSize() { - return size; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("upload_headers") - private Optional> _getUploadHeaders() { - return uploadHeaders; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("upload_url") - private Optional _getUploadUrl() { - return uploadUrl; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("url") - private Optional _getUrl() { - return url; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CreateFilesResponse && equalTo((CreateFilesResponse) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(CreateFilesResponse other) { - return contentType.equals(other.contentType) - && filename.equals(other.filename) - && id.equals(other.id) - && size.equals(other.size) - && uploadHeaders.equals(other.uploadHeaders) - && uploadStatus.equals(other.uploadStatus) - && uploadUrl.equals(other.uploadUrl) - && url.equals(other.url) - && visibility.equals(other.visibility); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash( - this.contentType, - this.filename, - this.id, - this.size, - this.uploadHeaders, - this.uploadStatus, - this.uploadUrl, - this.url, - this.visibility); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - /** - *

The unique identifier for the file.

- */ - UploadStatusStage id(@NotNull String id); - - Builder from(CreateFilesResponse other); - } - - public interface UploadStatusStage { - /** - *

The current upload status of the file (e.g., pending, ready).

- */ - VisibilityStage uploadStatus(@NotNull UploadStatuses uploadStatus); - } - - public interface VisibilityStage { - /** - *

Whether the file is publicly accessible or requires authentication.

- */ - _FinalStage visibility(@NotNull FileVisibility visibility); - } - - public interface _FinalStage { - CreateFilesResponse build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - /** - *

The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).

- */ - _FinalStage contentType(Optional contentType); - - _FinalStage contentType(String contentType); - - _FinalStage contentType(Nullable contentType); - - /** - *

The original filename of the uploaded file, including its file extension.

- */ - _FinalStage filename(Optional filename); - - _FinalStage filename(String filename); - - _FinalStage filename(Nullable filename); - - /** - *

The file size in bytes. Null if the file has not finished uploading.

- */ - _FinalStage size(Optional size); - - _FinalStage size(String size); - - _FinalStage size(Nullable size); - - /** - *

Headers to include in the upload request. Only present in the response from the create mutation.

- */ - _FinalStage uploadHeaders(Optional> uploadHeaders); - - _FinalStage uploadHeaders(Map uploadHeaders); - - _FinalStage uploadHeaders(Nullable> uploadHeaders); - - /** - *

The presigned URL to upload the file contents to. Only present in the response from the create mutation.

- */ - _FinalStage uploadUrl(Optional uploadUrl); - - _FinalStage uploadUrl(String uploadUrl); - - _FinalStage uploadUrl(Nullable uploadUrl); - - /** - *

The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading.

- */ - _FinalStage url(Optional url); - - _FinalStage url(String url); - - _FinalStage url(Nullable url); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, UploadStatusStage, VisibilityStage, _FinalStage { - private String id; - - private UploadStatuses uploadStatus; - - private FileVisibility visibility; - - private Optional url = Optional.empty(); - - private Optional uploadUrl = Optional.empty(); - - private Optional> uploadHeaders = Optional.empty(); - - private Optional size = Optional.empty(); - - private Optional filename = Optional.empty(); - - private Optional contentType = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(CreateFilesResponse other) { - contentType(other.getContentType()); - filename(other.getFilename()); - id(other.getId()); - size(other.getSize()); - uploadHeaders(other.getUploadHeaders()); - uploadStatus(other.getUploadStatus()); - uploadUrl(other.getUploadUrl()); - url(other.getUrl()); - visibility(other.getVisibility()); - return this; - } - - /** - *

The unique identifier for the file.

- *

The unique identifier for the file.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("id") - public UploadStatusStage id(@NotNull String id) { - this.id = Objects.requireNonNull(id, "id must not be null"); - return this; - } - - /** - *

The current upload status of the file (e.g., pending, ready).

- *

The current upload status of the file (e.g., pending, ready).

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("upload_status") - public VisibilityStage uploadStatus(@NotNull UploadStatuses uploadStatus) { - this.uploadStatus = Objects.requireNonNull(uploadStatus, "uploadStatus must not be null"); - return this; - } - - /** - *

Whether the file is publicly accessible or requires authentication.

- *

Whether the file is publicly accessible or requires authentication.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("visibility") - public _FinalStage visibility(@NotNull FileVisibility visibility) { - this.visibility = Objects.requireNonNull(visibility, "visibility must not be null"); - return this; - } - - /** - *

The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage url(Nullable url) { - if (url.isNull()) { - this.url = null; - } else if (url.isEmpty()) { - this.url = Optional.empty(); - } else { - this.url = Optional.of(url.get()); - } - return this; - } - - /** - *

The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage url(String url) { - this.url = Optional.ofNullable(url); - return this; - } - - /** - *

The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading.

- */ - @java.lang.Override - @JsonSetter(value = "url", nulls = Nulls.SKIP) - public _FinalStage url(Optional url) { - this.url = url; - return this; - } - - /** - *

The presigned URL to upload the file contents to. Only present in the response from the create mutation.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage uploadUrl(Nullable uploadUrl) { - if (uploadUrl.isNull()) { - this.uploadUrl = null; - } else if (uploadUrl.isEmpty()) { - this.uploadUrl = Optional.empty(); - } else { - this.uploadUrl = Optional.of(uploadUrl.get()); - } - return this; - } - - /** - *

The presigned URL to upload the file contents to. Only present in the response from the create mutation.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage uploadUrl(String uploadUrl) { - this.uploadUrl = Optional.ofNullable(uploadUrl); - return this; - } - - /** - *

The presigned URL to upload the file contents to. Only present in the response from the create mutation.

- */ - @java.lang.Override - @JsonSetter(value = "upload_url", nulls = Nulls.SKIP) - public _FinalStage uploadUrl(Optional uploadUrl) { - this.uploadUrl = uploadUrl; - return this; - } - - /** - *

Headers to include in the upload request. Only present in the response from the create mutation.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage uploadHeaders(Nullable> uploadHeaders) { - if (uploadHeaders.isNull()) { - this.uploadHeaders = null; - } else if (uploadHeaders.isEmpty()) { - this.uploadHeaders = Optional.empty(); - } else { - this.uploadHeaders = Optional.of(uploadHeaders.get()); - } - return this; - } - - /** - *

Headers to include in the upload request. Only present in the response from the create mutation.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage uploadHeaders(Map uploadHeaders) { - this.uploadHeaders = Optional.ofNullable(uploadHeaders); - return this; - } - - /** - *

Headers to include in the upload request. Only present in the response from the create mutation.

- */ - @java.lang.Override - @JsonSetter(value = "upload_headers", nulls = Nulls.SKIP) - public _FinalStage uploadHeaders(Optional> uploadHeaders) { - this.uploadHeaders = uploadHeaders; - return this; - } - - /** - *

The file size in bytes. Null if the file has not finished uploading.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage size(Nullable size) { - if (size.isNull()) { - this.size = null; - } else if (size.isEmpty()) { - this.size = Optional.empty(); - } else { - this.size = Optional.of(size.get()); - } - return this; - } - - /** - *

The file size in bytes. Null if the file has not finished uploading.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage size(String size) { - this.size = Optional.ofNullable(size); - return this; - } - - /** - *

The file size in bytes. Null if the file has not finished uploading.

- */ - @java.lang.Override - @JsonSetter(value = "size", nulls = Nulls.SKIP) - public _FinalStage size(Optional size) { - this.size = size; - return this; - } - - /** - *

The original filename of the uploaded file, including its file extension.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage filename(Nullable filename) { - if (filename.isNull()) { - this.filename = null; - } else if (filename.isEmpty()) { - this.filename = Optional.empty(); - } else { - this.filename = Optional.of(filename.get()); - } - return this; - } - - /** - *

The original filename of the uploaded file, including its file extension.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage filename(String filename) { - this.filename = Optional.ofNullable(filename); - return this; - } - - /** - *

The original filename of the uploaded file, including its file extension.

- */ - @java.lang.Override - @JsonSetter(value = "filename", nulls = Nulls.SKIP) - public _FinalStage filename(Optional filename) { - this.filename = filename; - return this; - } - - /** - *

The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage contentType(Nullable contentType) { - if (contentType.isNull()) { - this.contentType = null; - } else if (contentType.isEmpty()) { - this.contentType = Optional.empty(); - } else { - this.contentType = Optional.of(contentType.get()); - } - return this; - } - - /** - *

The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage contentType(String contentType) { - this.contentType = Optional.ofNullable(contentType); - return this; - } - - /** - *

The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).

- */ - @java.lang.Override - @JsonSetter(value = "content_type", nulls = Nulls.SKIP) - public _FinalStage contentType(Optional contentType) { - this.contentType = contentType; - return this; - } - - @java.lang.Override - public CreateFilesResponse build() { - return new CreateFilesResponse( - contentType, - filename, - id, - size, - uploadHeaders, - uploadStatus, - uploadUrl, - url, - visibility, - additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/whop/api/resources/financialactivity/types/ListFinancialActivityRequestLineTypesItem.java b/src/main/java/com/whop/api/resources/financialactivity/types/ListFinancialActivityRequestLineTypesItem.java index 63096148..fc446c65 100644 --- a/src/main/java/com/whop/api/resources/financialactivity/types/ListFinancialActivityRequestLineTypesItem.java +++ b/src/main/java/com/whop/api/resources/financialactivity/types/ListFinancialActivityRequestLineTypesItem.java @@ -30,6 +30,147 @@ public final class ListFinancialActivityRequestLineTypesItem { public static final ListFinancialActivityRequestLineTypesItem RESOLUTION_CENTER_REFUND = new ListFinancialActivityRequestLineTypesItem(Value.RESOLUTION_CENTER_REFUND, "resolution_center_refund"); + public static final ListFinancialActivityRequestLineTypesItem THREE_DS_FIXED_FEE = + new ListFinancialActivityRequestLineTypesItem(Value.THREE_DS_FIXED_FEE, "three_ds_fixed_fee"); + + public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REVSHARE_REFUND = + new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REVSHARE_REFUND, "payment_revshare_refund"); + + public static final ListFinancialActivityRequestLineTypesItem AIRDROP_LINK_RETURNED = + new ListFinancialActivityRequestLineTypesItem(Value.AIRDROP_LINK_RETURNED, "airdrop_link_returned"); + + public static final ListFinancialActivityRequestLineTypesItem PAYOUT_FEE = + new ListFinancialActivityRequestLineTypesItem(Value.PAYOUT_FEE, "payout_fee"); + + public static final ListFinancialActivityRequestLineTypesItem INSTALLMENT_DEFAULT = + new ListFinancialActivityRequestLineTypesItem(Value.INSTALLMENT_DEFAULT, "installment_default"); + + public static final ListFinancialActivityRequestLineTypesItem PLATFORM_BALANCE_PAYMENT = + new ListFinancialActivityRequestLineTypesItem(Value.PLATFORM_BALANCE_PAYMENT, "platform_balance_payment"); + + public static final ListFinancialActivityRequestLineTypesItem AD_PUBLISHER_PAYOUT_RECEIVED = + new ListFinancialActivityRequestLineTypesItem( + Value.AD_PUBLISHER_PAYOUT_RECEIVED, "ad_publisher_payout_received"); + + public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REFERRAL_REVERSAL = + new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REFERRAL_REVERSAL, "payment_referral_reversal"); + + public static final ListFinancialActivityRequestLineTypesItem LEGACY_CRYPTO_PAYMENT = + new ListFinancialActivityRequestLineTypesItem(Value.LEGACY_CRYPTO_PAYMENT, "legacy_crypto_payment"); + + public static final ListFinancialActivityRequestLineTypesItem PLATFORM_BALANCE_TRANSFER_INCOMING = + new ListFinancialActivityRequestLineTypesItem( + Value.PLATFORM_BALANCE_TRANSFER_INCOMING, "platform_balance_transfer_incoming"); + + public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REFERRAL = + new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REFERRAL, "payment_referral"); + + public static final ListFinancialActivityRequestLineTypesItem TOPUP_REVERSAL = + new ListFinancialActivityRequestLineTypesItem(Value.TOPUP_REVERSAL, "topup_reversal"); + + public static final ListFinancialActivityRequestLineTypesItem WITHDRAWAL_CLAWBACK_REVERSAL = + new ListFinancialActivityRequestLineTypesItem( + Value.WITHDRAWAL_CLAWBACK_REVERSAL, "withdrawal_clawback_reversal"); + + public static final ListFinancialActivityRequestLineTypesItem CARD_SPEND_AUTHORIZATION = + new ListFinancialActivityRequestLineTypesItem(Value.CARD_SPEND_AUTHORIZATION, "card_spend_authorization"); + + public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REVSHARE_PAYOUT = + new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REVSHARE_PAYOUT, "payment_revshare_payout"); + + public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REFUND_REVERSAL = + new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REFUND_REVERSAL, "payment_refund_reversal"); + + public static final ListFinancialActivityRequestLineTypesItem FRAUD_PREVENTION_FEE = + new ListFinancialActivityRequestLineTypesItem(Value.FRAUD_PREVENTION_FEE, "fraud_prevention_fee"); + + public static final ListFinancialActivityRequestLineTypesItem PLATFORM_BALANCE_TRANSFER_OUTGOING = + new ListFinancialActivityRequestLineTypesItem( + Value.PLATFORM_BALANCE_TRANSFER_OUTGOING, "platform_balance_transfer_outgoing"); + + public static final ListFinancialActivityRequestLineTypesItem MISC_REVERSAL = + new ListFinancialActivityRequestLineTypesItem(Value.MISC_REVERSAL, "misc_reversal"); + + public static final ListFinancialActivityRequestLineTypesItem AIRDROP_LINK_REDEEMED = + new ListFinancialActivityRequestLineTypesItem(Value.AIRDROP_LINK_REDEEMED, "airdrop_link_redeemed"); + + public static final ListFinancialActivityRequestLineTypesItem ONCHAIN_SWAP_TARGET = + new ListFinancialActivityRequestLineTypesItem(Value.ONCHAIN_SWAP_TARGET, "onchain_swap_target"); + + public static final ListFinancialActivityRequestLineTypesItem AD_CAMPAIGN_BUDGET = + new ListFinancialActivityRequestLineTypesItem(Value.AD_CAMPAIGN_BUDGET, "ad_campaign_budget"); + + public static final ListFinancialActivityRequestLineTypesItem AFFILIATE_FEE = + new ListFinancialActivityRequestLineTypesItem(Value.AFFILIATE_FEE, "affiliate_fee"); + + public static final ListFinancialActivityRequestLineTypesItem CARD_SPEND_AUTHORIZATION_VOID = + new ListFinancialActivityRequestLineTypesItem( + Value.CARD_SPEND_AUTHORIZATION_VOID, "card_spend_authorization_void"); + + public static final ListFinancialActivityRequestLineTypesItem PAYMENT_GROSS_REVERSAL = + new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_GROSS_REVERSAL, "payment_gross_reversal"); + + public static final ListFinancialActivityRequestLineTypesItem LEGACY_PAYMENT_REFUND = + new ListFinancialActivityRequestLineTypesItem(Value.LEGACY_PAYMENT_REFUND, "legacy_payment_refund"); + + public static final ListFinancialActivityRequestLineTypesItem INTERNAL_WITHDRAWAL = + new ListFinancialActivityRequestLineTypesItem(Value.INTERNAL_WITHDRAWAL, "internal_withdrawal"); + + public static final ListFinancialActivityRequestLineTypesItem BANK_TRANSFER = + new ListFinancialActivityRequestLineTypesItem(Value.BANK_TRANSFER, "bank_transfer"); + + public static final ListFinancialActivityRequestLineTypesItem REFERRAL_BONUS = + new ListFinancialActivityRequestLineTypesItem(Value.REFERRAL_BONUS, "referral_bonus"); + + public static final ListFinancialActivityRequestLineTypesItem INTERNAL_BALANCE_TRANSFER_OUTGOING = + new ListFinancialActivityRequestLineTypesItem( + Value.INTERNAL_BALANCE_TRANSFER_OUTGOING, "internal_balance_transfer_outgoing"); + + public static final ListFinancialActivityRequestLineTypesItem BALANCE_RESERVATION_REVERSAL = + new ListFinancialActivityRequestLineTypesItem( + Value.BALANCE_RESERVATION_REVERSAL, "balance_reservation_reversal"); + + public static final ListFinancialActivityRequestLineTypesItem WITHDRAWAL_CLAWBACK = + new ListFinancialActivityRequestLineTypesItem(Value.WITHDRAWAL_CLAWBACK, "withdrawal_clawback"); + + public static final ListFinancialActivityRequestLineTypesItem REVSHARE_PERCENTAGE_FEE = + new ListFinancialActivityRequestLineTypesItem(Value.REVSHARE_PERCENTAGE_FEE, "revshare_percentage_fee"); + + public static final ListFinancialActivityRequestLineTypesItem AIRDROP_REVERSAL = + new ListFinancialActivityRequestLineTypesItem(Value.AIRDROP_REVERSAL, "airdrop_reversal"); + + public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REFUND = + new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REFUND, "payment_refund"); + + public static final ListFinancialActivityRequestLineTypesItem AIRDROP_LINK_CREATED = + new ListFinancialActivityRequestLineTypesItem(Value.AIRDROP_LINK_CREATED, "airdrop_link_created"); + + public static final ListFinancialActivityRequestLineTypesItem COMPANY_REFERRAL = + new ListFinancialActivityRequestLineTypesItem(Value.COMPANY_REFERRAL, "company_referral"); + + public static final ListFinancialActivityRequestLineTypesItem ORCHESTRATION_PERCENTAGE_FEE = + new ListFinancialActivityRequestLineTypesItem( + Value.ORCHESTRATION_PERCENTAGE_FEE, "orchestration_percentage_fee"); + + public static final ListFinancialActivityRequestLineTypesItem CARD_SPEND_REFUND = + new ListFinancialActivityRequestLineTypesItem(Value.CARD_SPEND_REFUND, "card_spend_refund"); + + public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REVSHARE_REVERSAL = + new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REVSHARE_REVERSAL, "payment_revshare_reversal"); + + public static final ListFinancialActivityRequestLineTypesItem MISC_REFUND = + new ListFinancialActivityRequestLineTypesItem(Value.MISC_REFUND, "misc_refund"); + + public static final ListFinancialActivityRequestLineTypesItem ONCHAIN_WALLET_TRANSFER_INCOMING = + new ListFinancialActivityRequestLineTypesItem( + Value.ONCHAIN_WALLET_TRANSFER_INCOMING, "onchain_wallet_transfer_incoming"); + + public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REVSHARE = + new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REVSHARE, "payment_revshare"); + + public static final ListFinancialActivityRequestLineTypesItem PAYMENT_DISPUTE_FEE = + new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_DISPUTE_FEE, "payment_dispute_fee"); + public static final ListFinancialActivityRequestLineTypesItem AD_PUBLISHER_PAYOUT = new ListFinancialActivityRequestLineTypesItem(Value.AD_PUBLISHER_PAYOUT, "ad_publisher_payout"); @@ -47,29 +188,17 @@ public final class ListFinancialActivityRequestLineTypesItem { new ListFinancialActivityRequestLineTypesItem( Value.PAYMENT_PROCESSING_PERCENTAGE_FEE, "payment_processing_percentage_fee"); - public static final ListFinancialActivityRequestLineTypesItem THREE_DS_FIXED_FEE = - new ListFinancialActivityRequestLineTypesItem(Value.THREE_DS_FIXED_FEE, "three_ds_fixed_fee"); - - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REVSHARE_REFUND = - new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REVSHARE_REFUND, "payment_revshare_refund"); - public static final ListFinancialActivityRequestLineTypesItem DISPUTE_ALERT_FEE = new ListFinancialActivityRequestLineTypesItem(Value.DISPUTE_ALERT_FEE, "dispute_alert_fee"); public static final ListFinancialActivityRequestLineTypesItem APPLICATION_FEE = new ListFinancialActivityRequestLineTypesItem(Value.APPLICATION_FEE, "application_fee"); - public static final ListFinancialActivityRequestLineTypesItem AIRDROP_LINK_RETURNED = - new ListFinancialActivityRequestLineTypesItem(Value.AIRDROP_LINK_RETURNED, "airdrop_link_returned"); - public static final ListFinancialActivityRequestLineTypesItem WITHDRAWAL = new ListFinancialActivityRequestLineTypesItem(Value.WITHDRAWAL, "withdrawal"); - public static final ListFinancialActivityRequestLineTypesItem PAYOUT_FEE = - new ListFinancialActivityRequestLineTypesItem(Value.PAYOUT_FEE, "payout_fee"); - - public static final ListFinancialActivityRequestLineTypesItem INSTALLMENT_DEFAULT = - new ListFinancialActivityRequestLineTypesItem(Value.INSTALLMENT_DEFAULT, "installment_default"); + public static final ListFinancialActivityRequestLineTypesItem BALANCE_RESERVATION = + new ListFinancialActivityRequestLineTypesItem(Value.BALANCE_RESERVATION, "balance_reservation"); public static final ListFinancialActivityRequestLineTypesItem ONCHAIN_WALLET_TRANSFER_OUTGOING = new ListFinancialActivityRequestLineTypesItem( @@ -81,41 +210,18 @@ public final class ListFinancialActivityRequestLineTypesItem { public static final ListFinancialActivityRequestLineTypesItem APPLICATION_FEE_PAYOUT = new ListFinancialActivityRequestLineTypesItem(Value.APPLICATION_FEE_PAYOUT, "application_fee_payout"); - public static final ListFinancialActivityRequestLineTypesItem PLATFORM_BALANCE_PAYMENT = - new ListFinancialActivityRequestLineTypesItem(Value.PLATFORM_BALANCE_PAYMENT, "platform_balance_payment"); - public static final ListFinancialActivityRequestLineTypesItem LEGACY_PAYMENT = new ListFinancialActivityRequestLineTypesItem(Value.LEGACY_PAYMENT, "legacy_payment"); - public static final ListFinancialActivityRequestLineTypesItem AD_PUBLISHER_PAYOUT_RECEIVED = - new ListFinancialActivityRequestLineTypesItem( - Value.AD_PUBLISHER_PAYOUT_RECEIVED, "ad_publisher_payout_received"); - - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REFERRAL_REVERSAL = - new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REFERRAL_REVERSAL, "payment_referral_reversal"); - - public static final ListFinancialActivityRequestLineTypesItem LEGACY_CRYPTO_PAYMENT = - new ListFinancialActivityRequestLineTypesItem(Value.LEGACY_CRYPTO_PAYMENT, "legacy_crypto_payment"); - public static final ListFinancialActivityRequestLineTypesItem AD_BUDGET_RELEASE = new ListFinancialActivityRequestLineTypesItem(Value.AD_BUDGET_RELEASE, "ad_budget_release"); public static final ListFinancialActivityRequestLineTypesItem AD_SPEND_CHARGE = new ListFinancialActivityRequestLineTypesItem(Value.AD_SPEND_CHARGE, "ad_spend_charge"); - public static final ListFinancialActivityRequestLineTypesItem PLATFORM_BALANCE_TRANSFER_INCOMING = - new ListFinancialActivityRequestLineTypesItem( - Value.PLATFORM_BALANCE_TRANSFER_INCOMING, "platform_balance_transfer_incoming"); - - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REFERRAL = - new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REFERRAL, "payment_referral"); - public static final ListFinancialActivityRequestLineTypesItem PROMO_REVERSAL = new ListFinancialActivityRequestLineTypesItem(Value.PROMO_REVERSAL, "promo_reversal"); - public static final ListFinancialActivityRequestLineTypesItem TOPUP_REVERSAL = - new ListFinancialActivityRequestLineTypesItem(Value.TOPUP_REVERSAL, "topup_reversal"); - public static final ListFinancialActivityRequestLineTypesItem PLATFORM_AFFILIATE_PAYMENT_REVERSAL = new ListFinancialActivityRequestLineTypesItem( Value.PLATFORM_AFFILIATE_PAYMENT_REVERSAL, "platform_affiliate_payment_reversal"); @@ -123,13 +229,6 @@ public final class ListFinancialActivityRequestLineTypesItem { public static final ListFinancialActivityRequestLineTypesItem AIRDROP = new ListFinancialActivityRequestLineTypesItem(Value.AIRDROP, "airdrop"); - public static final ListFinancialActivityRequestLineTypesItem WITHDRAWAL_CLAWBACK_REVERSAL = - new ListFinancialActivityRequestLineTypesItem( - Value.WITHDRAWAL_CLAWBACK_REVERSAL, "withdrawal_clawback_reversal"); - - public static final ListFinancialActivityRequestLineTypesItem CARD_SPEND_AUTHORIZATION = - new ListFinancialActivityRequestLineTypesItem(Value.CARD_SPEND_AUTHORIZATION, "card_spend_authorization"); - public static final ListFinancialActivityRequestLineTypesItem LICENSE_SALE_REVENUE = new ListFinancialActivityRequestLineTypesItem(Value.LICENSE_SALE_REVENUE, "license_sale_revenue"); @@ -139,16 +238,10 @@ public final class ListFinancialActivityRequestLineTypesItem { public static final ListFinancialActivityRequestLineTypesItem HIGH_RISK_MERCHANT_FEE = new ListFinancialActivityRequestLineTypesItem(Value.HIGH_RISK_MERCHANT_FEE, "high_risk_merchant_fee"); - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REVSHARE_PAYOUT = - new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REVSHARE_PAYOUT, "payment_revshare_payout"); - public static final ListFinancialActivityRequestLineTypesItem INTERNAL_BALANCE_TRANSFER_INCOMING = new ListFinancialActivityRequestLineTypesItem( Value.INTERNAL_BALANCE_TRANSFER_INCOMING, "internal_balance_transfer_incoming"); - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REFUND_REVERSAL = - new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REFUND_REVERSAL, "payment_refund_reversal"); - public static final ListFinancialActivityRequestLineTypesItem ONCHAIN_DEPOSIT = new ListFinancialActivityRequestLineTypesItem(Value.ONCHAIN_DEPOSIT, "onchain_deposit"); @@ -156,9 +249,6 @@ public final class ListFinancialActivityRequestLineTypesItem { new ListFinancialActivityRequestLineTypesItem( Value.WITHDRAWAL_RECLASSIFICATION, "withdrawal_reclassification"); - public static final ListFinancialActivityRequestLineTypesItem FRAUD_PREVENTION_FEE = - new ListFinancialActivityRequestLineTypesItem(Value.FRAUD_PREVENTION_FEE, "fraud_prevention_fee"); - public static final ListFinancialActivityRequestLineTypesItem STRIPE_DOMESTIC_PROCESSING_FEE = new ListFinancialActivityRequestLineTypesItem( Value.STRIPE_DOMESTIC_PROCESSING_FEE, "stripe_domestic_processing_fee"); @@ -166,22 +256,6 @@ public final class ListFinancialActivityRequestLineTypesItem { public static final ListFinancialActivityRequestLineTypesItem MISC_PURCHASE = new ListFinancialActivityRequestLineTypesItem(Value.MISC_PURCHASE, "misc_purchase"); - public static final ListFinancialActivityRequestLineTypesItem PLATFORM_BALANCE_TRANSFER_OUTGOING = - new ListFinancialActivityRequestLineTypesItem( - Value.PLATFORM_BALANCE_TRANSFER_OUTGOING, "platform_balance_transfer_outgoing"); - - public static final ListFinancialActivityRequestLineTypesItem MISC_REVERSAL = - new ListFinancialActivityRequestLineTypesItem(Value.MISC_REVERSAL, "misc_reversal"); - - public static final ListFinancialActivityRequestLineTypesItem AIRDROP_LINK_REDEEMED = - new ListFinancialActivityRequestLineTypesItem(Value.AIRDROP_LINK_REDEEMED, "airdrop_link_redeemed"); - - public static final ListFinancialActivityRequestLineTypesItem ONCHAIN_SWAP_TARGET = - new ListFinancialActivityRequestLineTypesItem(Value.ONCHAIN_SWAP_TARGET, "onchain_swap_target"); - - public static final ListFinancialActivityRequestLineTypesItem AD_CAMPAIGN_BUDGET = - new ListFinancialActivityRequestLineTypesItem(Value.AD_CAMPAIGN_BUDGET, "ad_campaign_budget"); - public static final ListFinancialActivityRequestLineTypesItem SOFTWARE_RENTAL_TRANSACTION = new ListFinancialActivityRequestLineTypesItem( Value.SOFTWARE_RENTAL_TRANSACTION, "software_rental_transaction"); @@ -193,66 +267,28 @@ public final class ListFinancialActivityRequestLineTypesItem { public static final ListFinancialActivityRequestLineTypesItem FEES = new ListFinancialActivityRequestLineTypesItem(Value.FEES, "fees"); - public static final ListFinancialActivityRequestLineTypesItem AFFILIATE_FEE = - new ListFinancialActivityRequestLineTypesItem(Value.AFFILIATE_FEE, "affiliate_fee"); - - public static final ListFinancialActivityRequestLineTypesItem CARD_SPEND_AUTHORIZATION_VOID = - new ListFinancialActivityRequestLineTypesItem( - Value.CARD_SPEND_AUTHORIZATION_VOID, "card_spend_authorization_void"); - - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_GROSS_REVERSAL = - new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_GROSS_REVERSAL, "payment_gross_reversal"); - - public static final ListFinancialActivityRequestLineTypesItem LEGACY_PAYMENT_REFUND = - new ListFinancialActivityRequestLineTypesItem(Value.LEGACY_PAYMENT_REFUND, "legacy_payment_refund"); - public static final ListFinancialActivityRequestLineTypesItem PASSTHROUGH_GMV = new ListFinancialActivityRequestLineTypesItem(Value.PASSTHROUGH_GMV, "passthrough_gmv"); public static final ListFinancialActivityRequestLineTypesItem DISPUTE_HOLD_ADJUSTMENT = new ListFinancialActivityRequestLineTypesItem(Value.DISPUTE_HOLD_ADJUSTMENT, "dispute_hold_adjustment"); - public static final ListFinancialActivityRequestLineTypesItem INTERNAL_WITHDRAWAL = - new ListFinancialActivityRequestLineTypesItem(Value.INTERNAL_WITHDRAWAL, "internal_withdrawal"); - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_GROSS = new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_GROSS, "payment_gross"); - public static final ListFinancialActivityRequestLineTypesItem BANK_TRANSFER = - new ListFinancialActivityRequestLineTypesItem(Value.BANK_TRANSFER, "bank_transfer"); - - public static final ListFinancialActivityRequestLineTypesItem REFERRAL_BONUS = - new ListFinancialActivityRequestLineTypesItem(Value.REFERRAL_BONUS, "referral_bonus"); - - public static final ListFinancialActivityRequestLineTypesItem INTERNAL_BALANCE_TRANSFER_OUTGOING = - new ListFinancialActivityRequestLineTypesItem( - Value.INTERNAL_BALANCE_TRANSFER_OUTGOING, "internal_balance_transfer_outgoing"); - public static final ListFinancialActivityRequestLineTypesItem SALES_TAX_REMITTANCE_REVERSAL = new ListFinancialActivityRequestLineTypesItem( Value.SALES_TAX_REMITTANCE_REVERSAL, "sales_tax_remittance_reversal"); - public static final ListFinancialActivityRequestLineTypesItem WITHDRAWAL_CLAWBACK = - new ListFinancialActivityRequestLineTypesItem(Value.WITHDRAWAL_CLAWBACK, "withdrawal_clawback"); - public static final ListFinancialActivityRequestLineTypesItem LICENSE_SALE_COMMISSION = new ListFinancialActivityRequestLineTypesItem(Value.LICENSE_SALE_COMMISSION, "license_sale_commission"); - public static final ListFinancialActivityRequestLineTypesItem REVSHARE_PERCENTAGE_FEE = - new ListFinancialActivityRequestLineTypesItem(Value.REVSHARE_PERCENTAGE_FEE, "revshare_percentage_fee"); - public static final ListFinancialActivityRequestLineTypesItem SALES_TAX_FEE = new ListFinancialActivityRequestLineTypesItem(Value.SALES_TAX_FEE, "sales_tax_fee"); public static final ListFinancialActivityRequestLineTypesItem WITHDRAWAL_REVERSAL = new ListFinancialActivityRequestLineTypesItem(Value.WITHDRAWAL_REVERSAL, "withdrawal_reversal"); - public static final ListFinancialActivityRequestLineTypesItem AIRDROP_REVERSAL = - new ListFinancialActivityRequestLineTypesItem(Value.AIRDROP_REVERSAL, "airdrop_reversal"); - - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REFUND = - new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REFUND, "payment_refund"); - public static final ListFinancialActivityRequestLineTypesItem CROSS_BORDER_PERCENTAGE_FEE = new ListFinancialActivityRequestLineTypesItem( Value.CROSS_BORDER_PERCENTAGE_FEE, "cross_border_percentage_fee"); @@ -260,9 +296,6 @@ public final class ListFinancialActivityRequestLineTypesItem { public static final ListFinancialActivityRequestLineTypesItem TOPUP_FEE = new ListFinancialActivityRequestLineTypesItem(Value.TOPUP_FEE, "topup_fee"); - public static final ListFinancialActivityRequestLineTypesItem AIRDROP_LINK_CREATED = - new ListFinancialActivityRequestLineTypesItem(Value.AIRDROP_LINK_CREATED, "airdrop_link_created"); - public static final ListFinancialActivityRequestLineTypesItem FX_PERCENTAGE_FEE = new ListFinancialActivityRequestLineTypesItem(Value.FX_PERCENTAGE_FEE, "fx_percentage_fee"); @@ -270,19 +303,6 @@ public final class ListFinancialActivityRequestLineTypesItem { new ListFinancialActivityRequestLineTypesItem( Value.CURRENCY_CONVERSION_OUTGOING, "currency_conversion_outgoing"); - public static final ListFinancialActivityRequestLineTypesItem COMPANY_REFERRAL = - new ListFinancialActivityRequestLineTypesItem(Value.COMPANY_REFERRAL, "company_referral"); - - public static final ListFinancialActivityRequestLineTypesItem ORCHESTRATION_PERCENTAGE_FEE = - new ListFinancialActivityRequestLineTypesItem( - Value.ORCHESTRATION_PERCENTAGE_FEE, "orchestration_percentage_fee"); - - public static final ListFinancialActivityRequestLineTypesItem CARD_SPEND_REFUND = - new ListFinancialActivityRequestLineTypesItem(Value.CARD_SPEND_REFUND, "card_spend_refund"); - - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REVSHARE_REVERSAL = - new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REVSHARE_REVERSAL, "payment_revshare_reversal"); - public static final ListFinancialActivityRequestLineTypesItem PLATFORM_AFFILIATE_PAYMENT = new ListFinancialActivityRequestLineTypesItem( Value.PLATFORM_AFFILIATE_PAYMENT, "platform_affiliate_payment"); @@ -290,9 +310,6 @@ public final class ListFinancialActivityRequestLineTypesItem { public static final ListFinancialActivityRequestLineTypesItem SALES_TAX_REMITTANCE = new ListFinancialActivityRequestLineTypesItem(Value.SALES_TAX_REMITTANCE, "sales_tax_remittance"); - public static final ListFinancialActivityRequestLineTypesItem MISC_REFUND = - new ListFinancialActivityRequestLineTypesItem(Value.MISC_REFUND, "misc_refund"); - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_PROCESSING_FIXED_FEE = new ListFinancialActivityRequestLineTypesItem( Value.PAYMENT_PROCESSING_FIXED_FEE, "payment_processing_fixed_fee"); @@ -310,16 +327,6 @@ public final class ListFinancialActivityRequestLineTypesItem { public static final ListFinancialActivityRequestLineTypesItem WHOP_PROCESSING_FEE = new ListFinancialActivityRequestLineTypesItem(Value.WHOP_PROCESSING_FEE, "whop_processing_fee"); - public static final ListFinancialActivityRequestLineTypesItem ONCHAIN_WALLET_TRANSFER_INCOMING = - new ListFinancialActivityRequestLineTypesItem( - Value.ONCHAIN_WALLET_TRANSFER_INCOMING, "onchain_wallet_transfer_incoming"); - - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_REVSHARE = - new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_REVSHARE, "payment_revshare"); - - public static final ListFinancialActivityRequestLineTypesItem PAYMENT_DISPUTE_FEE = - new ListFinancialActivityRequestLineTypesItem(Value.PAYMENT_DISPUTE_FEE, "payment_dispute_fee"); - private final Value value; private final String string; @@ -367,6 +374,94 @@ public T visit(Visitor visitor) { return visitor.visitPlatformCoveredDispute(); case RESOLUTION_CENTER_REFUND: return visitor.visitResolutionCenterRefund(); + case THREE_DS_FIXED_FEE: + return visitor.visitThreeDsFixedFee(); + case PAYMENT_REVSHARE_REFUND: + return visitor.visitPaymentRevshareRefund(); + case AIRDROP_LINK_RETURNED: + return visitor.visitAirdropLinkReturned(); + case PAYOUT_FEE: + return visitor.visitPayoutFee(); + case INSTALLMENT_DEFAULT: + return visitor.visitInstallmentDefault(); + case PLATFORM_BALANCE_PAYMENT: + return visitor.visitPlatformBalancePayment(); + case AD_PUBLISHER_PAYOUT_RECEIVED: + return visitor.visitAdPublisherPayoutReceived(); + case PAYMENT_REFERRAL_REVERSAL: + return visitor.visitPaymentReferralReversal(); + case LEGACY_CRYPTO_PAYMENT: + return visitor.visitLegacyCryptoPayment(); + case PLATFORM_BALANCE_TRANSFER_INCOMING: + return visitor.visitPlatformBalanceTransferIncoming(); + case PAYMENT_REFERRAL: + return visitor.visitPaymentReferral(); + case TOPUP_REVERSAL: + return visitor.visitTopupReversal(); + case WITHDRAWAL_CLAWBACK_REVERSAL: + return visitor.visitWithdrawalClawbackReversal(); + case CARD_SPEND_AUTHORIZATION: + return visitor.visitCardSpendAuthorization(); + case PAYMENT_REVSHARE_PAYOUT: + return visitor.visitPaymentRevsharePayout(); + case PAYMENT_REFUND_REVERSAL: + return visitor.visitPaymentRefundReversal(); + case FRAUD_PREVENTION_FEE: + return visitor.visitFraudPreventionFee(); + case PLATFORM_BALANCE_TRANSFER_OUTGOING: + return visitor.visitPlatformBalanceTransferOutgoing(); + case MISC_REVERSAL: + return visitor.visitMiscReversal(); + case AIRDROP_LINK_REDEEMED: + return visitor.visitAirdropLinkRedeemed(); + case ONCHAIN_SWAP_TARGET: + return visitor.visitOnchainSwapTarget(); + case AD_CAMPAIGN_BUDGET: + return visitor.visitAdCampaignBudget(); + case AFFILIATE_FEE: + return visitor.visitAffiliateFee(); + case CARD_SPEND_AUTHORIZATION_VOID: + return visitor.visitCardSpendAuthorizationVoid(); + case PAYMENT_GROSS_REVERSAL: + return visitor.visitPaymentGrossReversal(); + case LEGACY_PAYMENT_REFUND: + return visitor.visitLegacyPaymentRefund(); + case INTERNAL_WITHDRAWAL: + return visitor.visitInternalWithdrawal(); + case BANK_TRANSFER: + return visitor.visitBankTransfer(); + case REFERRAL_BONUS: + return visitor.visitReferralBonus(); + case INTERNAL_BALANCE_TRANSFER_OUTGOING: + return visitor.visitInternalBalanceTransferOutgoing(); + case BALANCE_RESERVATION_REVERSAL: + return visitor.visitBalanceReservationReversal(); + case WITHDRAWAL_CLAWBACK: + return visitor.visitWithdrawalClawback(); + case REVSHARE_PERCENTAGE_FEE: + return visitor.visitRevsharePercentageFee(); + case AIRDROP_REVERSAL: + return visitor.visitAirdropReversal(); + case PAYMENT_REFUND: + return visitor.visitPaymentRefund(); + case AIRDROP_LINK_CREATED: + return visitor.visitAirdropLinkCreated(); + case COMPANY_REFERRAL: + return visitor.visitCompanyReferral(); + case ORCHESTRATION_PERCENTAGE_FEE: + return visitor.visitOrchestrationPercentageFee(); + case CARD_SPEND_REFUND: + return visitor.visitCardSpendRefund(); + case PAYMENT_REVSHARE_REVERSAL: + return visitor.visitPaymentRevshareReversal(); + case MISC_REFUND: + return visitor.visitMiscRefund(); + case ONCHAIN_WALLET_TRANSFER_INCOMING: + return visitor.visitOnchainWalletTransferIncoming(); + case PAYMENT_REVSHARE: + return visitor.visitPaymentRevshare(); + case PAYMENT_DISPUTE_FEE: + return visitor.visitPaymentDisputeFee(); case AD_PUBLISHER_PAYOUT: return visitor.visitAdPublisherPayout(); case BILLING_PERCENTAGE_FEE: @@ -377,158 +472,80 @@ public T visit(Visitor visitor) { return visitor.visitPaymentDisputeAdjustment(); case PAYMENT_PROCESSING_PERCENTAGE_FEE: return visitor.visitPaymentProcessingPercentageFee(); - case THREE_DS_FIXED_FEE: - return visitor.visitThreeDsFixedFee(); - case PAYMENT_REVSHARE_REFUND: - return visitor.visitPaymentRevshareRefund(); case DISPUTE_ALERT_FEE: return visitor.visitDisputeAlertFee(); case APPLICATION_FEE: return visitor.visitApplicationFee(); - case AIRDROP_LINK_RETURNED: - return visitor.visitAirdropLinkReturned(); case WITHDRAWAL: return visitor.visitWithdrawal(); - case PAYOUT_FEE: - return visitor.visitPayoutFee(); - case INSTALLMENT_DEFAULT: - return visitor.visitInstallmentDefault(); + case BALANCE_RESERVATION: + return visitor.visitBalanceReservation(); case ONCHAIN_WALLET_TRANSFER_OUTGOING: return visitor.visitOnchainWalletTransferOutgoing(); case LICENSE_SALE: return visitor.visitLicenseSale(); case APPLICATION_FEE_PAYOUT: return visitor.visitApplicationFeePayout(); - case PLATFORM_BALANCE_PAYMENT: - return visitor.visitPlatformBalancePayment(); case LEGACY_PAYMENT: return visitor.visitLegacyPayment(); - case AD_PUBLISHER_PAYOUT_RECEIVED: - return visitor.visitAdPublisherPayoutReceived(); - case PAYMENT_REFERRAL_REVERSAL: - return visitor.visitPaymentReferralReversal(); - case LEGACY_CRYPTO_PAYMENT: - return visitor.visitLegacyCryptoPayment(); case AD_BUDGET_RELEASE: return visitor.visitAdBudgetRelease(); case AD_SPEND_CHARGE: return visitor.visitAdSpendCharge(); - case PLATFORM_BALANCE_TRANSFER_INCOMING: - return visitor.visitPlatformBalanceTransferIncoming(); - case PAYMENT_REFERRAL: - return visitor.visitPaymentReferral(); case PROMO_REVERSAL: return visitor.visitPromoReversal(); - case TOPUP_REVERSAL: - return visitor.visitTopupReversal(); case PLATFORM_AFFILIATE_PAYMENT_REVERSAL: return visitor.visitPlatformAffiliatePaymentReversal(); case AIRDROP: return visitor.visitAirdrop(); - case WITHDRAWAL_CLAWBACK_REVERSAL: - return visitor.visitWithdrawalClawbackReversal(); - case CARD_SPEND_AUTHORIZATION: - return visitor.visitCardSpendAuthorization(); case LICENSE_SALE_REVENUE: return visitor.visitLicenseSaleRevenue(); case TOPUP: return visitor.visitTopup(); case HIGH_RISK_MERCHANT_FEE: return visitor.visitHighRiskMerchantFee(); - case PAYMENT_REVSHARE_PAYOUT: - return visitor.visitPaymentRevsharePayout(); case INTERNAL_BALANCE_TRANSFER_INCOMING: return visitor.visitInternalBalanceTransferIncoming(); - case PAYMENT_REFUND_REVERSAL: - return visitor.visitPaymentRefundReversal(); case ONCHAIN_DEPOSIT: return visitor.visitOnchainDeposit(); case WITHDRAWAL_RECLASSIFICATION: return visitor.visitWithdrawalReclassification(); - case FRAUD_PREVENTION_FEE: - return visitor.visitFraudPreventionFee(); case STRIPE_DOMESTIC_PROCESSING_FEE: return visitor.visitStripeDomesticProcessingFee(); case MISC_PURCHASE: return visitor.visitMiscPurchase(); - case PLATFORM_BALANCE_TRANSFER_OUTGOING: - return visitor.visitPlatformBalanceTransferOutgoing(); - case MISC_REVERSAL: - return visitor.visitMiscReversal(); - case AIRDROP_LINK_REDEEMED: - return visitor.visitAirdropLinkRedeemed(); - case ONCHAIN_SWAP_TARGET: - return visitor.visitOnchainSwapTarget(); - case AD_CAMPAIGN_BUDGET: - return visitor.visitAdCampaignBudget(); case SOFTWARE_RENTAL_TRANSACTION: return visitor.visitSoftwareRentalTransaction(); case CURRENCY_CONVERSION_INCOMING: return visitor.visitCurrencyConversionIncoming(); case FEES: return visitor.visitFees(); - case AFFILIATE_FEE: - return visitor.visitAffiliateFee(); - case CARD_SPEND_AUTHORIZATION_VOID: - return visitor.visitCardSpendAuthorizationVoid(); - case PAYMENT_GROSS_REVERSAL: - return visitor.visitPaymentGrossReversal(); - case LEGACY_PAYMENT_REFUND: - return visitor.visitLegacyPaymentRefund(); case PASSTHROUGH_GMV: return visitor.visitPassthroughGmv(); case DISPUTE_HOLD_ADJUSTMENT: return visitor.visitDisputeHoldAdjustment(); - case INTERNAL_WITHDRAWAL: - return visitor.visitInternalWithdrawal(); case PAYMENT_GROSS: return visitor.visitPaymentGross(); - case BANK_TRANSFER: - return visitor.visitBankTransfer(); - case REFERRAL_BONUS: - return visitor.visitReferralBonus(); - case INTERNAL_BALANCE_TRANSFER_OUTGOING: - return visitor.visitInternalBalanceTransferOutgoing(); case SALES_TAX_REMITTANCE_REVERSAL: return visitor.visitSalesTaxRemittanceReversal(); - case WITHDRAWAL_CLAWBACK: - return visitor.visitWithdrawalClawback(); case LICENSE_SALE_COMMISSION: return visitor.visitLicenseSaleCommission(); - case REVSHARE_PERCENTAGE_FEE: - return visitor.visitRevsharePercentageFee(); case SALES_TAX_FEE: return visitor.visitSalesTaxFee(); case WITHDRAWAL_REVERSAL: return visitor.visitWithdrawalReversal(); - case AIRDROP_REVERSAL: - return visitor.visitAirdropReversal(); - case PAYMENT_REFUND: - return visitor.visitPaymentRefund(); case CROSS_BORDER_PERCENTAGE_FEE: return visitor.visitCrossBorderPercentageFee(); case TOPUP_FEE: return visitor.visitTopupFee(); - case AIRDROP_LINK_CREATED: - return visitor.visitAirdropLinkCreated(); case FX_PERCENTAGE_FEE: return visitor.visitFxPercentageFee(); case CURRENCY_CONVERSION_OUTGOING: return visitor.visitCurrencyConversionOutgoing(); - case COMPANY_REFERRAL: - return visitor.visitCompanyReferral(); - case ORCHESTRATION_PERCENTAGE_FEE: - return visitor.visitOrchestrationPercentageFee(); - case CARD_SPEND_REFUND: - return visitor.visitCardSpendRefund(); - case PAYMENT_REVSHARE_REVERSAL: - return visitor.visitPaymentRevshareReversal(); case PLATFORM_AFFILIATE_PAYMENT: return visitor.visitPlatformAffiliatePayment(); case SALES_TAX_REMITTANCE: return visitor.visitSalesTaxRemittance(); - case MISC_REFUND: - return visitor.visitMiscRefund(); case PAYMENT_PROCESSING_FIXED_FEE: return visitor.visitPaymentProcessingFixedFee(); case INTERNAL_WITHDRAWAL_REVERSAL: @@ -539,12 +556,6 @@ public T visit(Visitor visitor) { return visitor.visitBuyerFee(); case WHOP_PROCESSING_FEE: return visitor.visitWhopProcessingFee(); - case ONCHAIN_WALLET_TRANSFER_INCOMING: - return visitor.visitOnchainWalletTransferIncoming(); - case PAYMENT_REVSHARE: - return visitor.visitPaymentRevshare(); - case PAYMENT_DISPUTE_FEE: - return visitor.visitPaymentDisputeFee(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -568,90 +579,40 @@ public static ListFinancialActivityRequestLineTypesItem valueOf(String value) { return PLATFORM_COVERED_DISPUTE; case "resolution_center_refund": return RESOLUTION_CENTER_REFUND; - case "ad_publisher_payout": - return AD_PUBLISHER_PAYOUT; - case "billing_percentage_fee": - return BILLING_PERCENTAGE_FEE; - case "payment_dispute": - return PAYMENT_DISPUTE; - case "payment_dispute_adjustment": - return PAYMENT_DISPUTE_ADJUSTMENT; - case "payment_processing_percentage_fee": - return PAYMENT_PROCESSING_PERCENTAGE_FEE; case "three_ds_fixed_fee": return THREE_DS_FIXED_FEE; case "payment_revshare_refund": return PAYMENT_REVSHARE_REFUND; - case "dispute_alert_fee": - return DISPUTE_ALERT_FEE; - case "application_fee": - return APPLICATION_FEE; case "airdrop_link_returned": return AIRDROP_LINK_RETURNED; - case "withdrawal": - return WITHDRAWAL; case "payout_fee": return PAYOUT_FEE; case "installment_default": return INSTALLMENT_DEFAULT; - case "onchain_wallet_transfer_outgoing": - return ONCHAIN_WALLET_TRANSFER_OUTGOING; - case "license_sale": - return LICENSE_SALE; - case "application_fee_payout": - return APPLICATION_FEE_PAYOUT; case "platform_balance_payment": return PLATFORM_BALANCE_PAYMENT; - case "legacy_payment": - return LEGACY_PAYMENT; case "ad_publisher_payout_received": return AD_PUBLISHER_PAYOUT_RECEIVED; case "payment_referral_reversal": return PAYMENT_REFERRAL_REVERSAL; case "legacy_crypto_payment": return LEGACY_CRYPTO_PAYMENT; - case "ad_budget_release": - return AD_BUDGET_RELEASE; - case "ad_spend_charge": - return AD_SPEND_CHARGE; case "platform_balance_transfer_incoming": return PLATFORM_BALANCE_TRANSFER_INCOMING; case "payment_referral": return PAYMENT_REFERRAL; - case "promo_reversal": - return PROMO_REVERSAL; case "topup_reversal": return TOPUP_REVERSAL; - case "platform_affiliate_payment_reversal": - return PLATFORM_AFFILIATE_PAYMENT_REVERSAL; - case "airdrop": - return AIRDROP; case "withdrawal_clawback_reversal": return WITHDRAWAL_CLAWBACK_REVERSAL; case "card_spend_authorization": return CARD_SPEND_AUTHORIZATION; - case "license_sale_revenue": - return LICENSE_SALE_REVENUE; - case "topup": - return TOPUP; - case "high_risk_merchant_fee": - return HIGH_RISK_MERCHANT_FEE; case "payment_revshare_payout": return PAYMENT_REVSHARE_PAYOUT; - case "internal_balance_transfer_incoming": - return INTERNAL_BALANCE_TRANSFER_INCOMING; case "payment_refund_reversal": return PAYMENT_REFUND_REVERSAL; - case "onchain_deposit": - return ONCHAIN_DEPOSIT; - case "withdrawal_reclassification": - return WITHDRAWAL_RECLASSIFICATION; case "fraud_prevention_fee": return FRAUD_PREVENTION_FEE; - case "stripe_domestic_processing_fee": - return STRIPE_DOMESTIC_PROCESSING_FEE; - case "misc_purchase": - return MISC_PURCHASE; case "platform_balance_transfer_outgoing": return PLATFORM_BALANCE_TRANSFER_OUTGOING; case "misc_reversal": @@ -662,12 +623,6 @@ public static ListFinancialActivityRequestLineTypesItem valueOf(String value) { return ONCHAIN_SWAP_TARGET; case "ad_campaign_budget": return AD_CAMPAIGN_BUDGET; - case "software_rental_transaction": - return SOFTWARE_RENTAL_TRANSACTION; - case "currency_conversion_incoming": - return CURRENCY_CONVERSION_INCOMING; - case "fees": - return FEES; case "affiliate_fee": return AFFILIATE_FEE; case "card_spend_authorization_void": @@ -676,46 +631,26 @@ public static ListFinancialActivityRequestLineTypesItem valueOf(String value) { return PAYMENT_GROSS_REVERSAL; case "legacy_payment_refund": return LEGACY_PAYMENT_REFUND; - case "passthrough_gmv": - return PASSTHROUGH_GMV; - case "dispute_hold_adjustment": - return DISPUTE_HOLD_ADJUSTMENT; case "internal_withdrawal": return INTERNAL_WITHDRAWAL; - case "payment_gross": - return PAYMENT_GROSS; case "bank_transfer": return BANK_TRANSFER; case "referral_bonus": return REFERRAL_BONUS; case "internal_balance_transfer_outgoing": return INTERNAL_BALANCE_TRANSFER_OUTGOING; - case "sales_tax_remittance_reversal": - return SALES_TAX_REMITTANCE_REVERSAL; + case "balance_reservation_reversal": + return BALANCE_RESERVATION_REVERSAL; case "withdrawal_clawback": return WITHDRAWAL_CLAWBACK; - case "license_sale_commission": - return LICENSE_SALE_COMMISSION; case "revshare_percentage_fee": return REVSHARE_PERCENTAGE_FEE; - case "sales_tax_fee": - return SALES_TAX_FEE; - case "withdrawal_reversal": - return WITHDRAWAL_REVERSAL; case "airdrop_reversal": return AIRDROP_REVERSAL; case "payment_refund": return PAYMENT_REFUND; - case "cross_border_percentage_fee": - return CROSS_BORDER_PERCENTAGE_FEE; - case "topup_fee": - return TOPUP_FEE; case "airdrop_link_created": return AIRDROP_LINK_CREATED; - case "fx_percentage_fee": - return FX_PERCENTAGE_FEE; - case "currency_conversion_outgoing": - return CURRENCY_CONVERSION_OUTGOING; case "company_referral": return COMPANY_REFERRAL; case "orchestration_percentage_fee": @@ -724,12 +659,98 @@ public static ListFinancialActivityRequestLineTypesItem valueOf(String value) { return CARD_SPEND_REFUND; case "payment_revshare_reversal": return PAYMENT_REVSHARE_REVERSAL; + case "misc_refund": + return MISC_REFUND; + case "onchain_wallet_transfer_incoming": + return ONCHAIN_WALLET_TRANSFER_INCOMING; + case "payment_revshare": + return PAYMENT_REVSHARE; + case "payment_dispute_fee": + return PAYMENT_DISPUTE_FEE; + case "ad_publisher_payout": + return AD_PUBLISHER_PAYOUT; + case "billing_percentage_fee": + return BILLING_PERCENTAGE_FEE; + case "payment_dispute": + return PAYMENT_DISPUTE; + case "payment_dispute_adjustment": + return PAYMENT_DISPUTE_ADJUSTMENT; + case "payment_processing_percentage_fee": + return PAYMENT_PROCESSING_PERCENTAGE_FEE; + case "dispute_alert_fee": + return DISPUTE_ALERT_FEE; + case "application_fee": + return APPLICATION_FEE; + case "withdrawal": + return WITHDRAWAL; + case "balance_reservation": + return BALANCE_RESERVATION; + case "onchain_wallet_transfer_outgoing": + return ONCHAIN_WALLET_TRANSFER_OUTGOING; + case "license_sale": + return LICENSE_SALE; + case "application_fee_payout": + return APPLICATION_FEE_PAYOUT; + case "legacy_payment": + return LEGACY_PAYMENT; + case "ad_budget_release": + return AD_BUDGET_RELEASE; + case "ad_spend_charge": + return AD_SPEND_CHARGE; + case "promo_reversal": + return PROMO_REVERSAL; + case "platform_affiliate_payment_reversal": + return PLATFORM_AFFILIATE_PAYMENT_REVERSAL; + case "airdrop": + return AIRDROP; + case "license_sale_revenue": + return LICENSE_SALE_REVENUE; + case "topup": + return TOPUP; + case "high_risk_merchant_fee": + return HIGH_RISK_MERCHANT_FEE; + case "internal_balance_transfer_incoming": + return INTERNAL_BALANCE_TRANSFER_INCOMING; + case "onchain_deposit": + return ONCHAIN_DEPOSIT; + case "withdrawal_reclassification": + return WITHDRAWAL_RECLASSIFICATION; + case "stripe_domestic_processing_fee": + return STRIPE_DOMESTIC_PROCESSING_FEE; + case "misc_purchase": + return MISC_PURCHASE; + case "software_rental_transaction": + return SOFTWARE_RENTAL_TRANSACTION; + case "currency_conversion_incoming": + return CURRENCY_CONVERSION_INCOMING; + case "fees": + return FEES; + case "passthrough_gmv": + return PASSTHROUGH_GMV; + case "dispute_hold_adjustment": + return DISPUTE_HOLD_ADJUSTMENT; + case "payment_gross": + return PAYMENT_GROSS; + case "sales_tax_remittance_reversal": + return SALES_TAX_REMITTANCE_REVERSAL; + case "license_sale_commission": + return LICENSE_SALE_COMMISSION; + case "sales_tax_fee": + return SALES_TAX_FEE; + case "withdrawal_reversal": + return WITHDRAWAL_REVERSAL; + case "cross_border_percentage_fee": + return CROSS_BORDER_PERCENTAGE_FEE; + case "topup_fee": + return TOPUP_FEE; + case "fx_percentage_fee": + return FX_PERCENTAGE_FEE; + case "currency_conversion_outgoing": + return CURRENCY_CONVERSION_OUTGOING; case "platform_affiliate_payment": return PLATFORM_AFFILIATE_PAYMENT; case "sales_tax_remittance": return SALES_TAX_REMITTANCE; - case "misc_refund": - return MISC_REFUND; case "payment_processing_fixed_fee": return PAYMENT_PROCESSING_FIXED_FEE; case "internal_withdrawal_reversal": @@ -740,12 +761,6 @@ public static ListFinancialActivityRequestLineTypesItem valueOf(String value) { return BUYER_FEE; case "whop_processing_fee": return WHOP_PROCESSING_FEE; - case "onchain_wallet_transfer_incoming": - return ONCHAIN_WALLET_TRANSFER_INCOMING; - case "payment_revshare": - return PAYMENT_REVSHARE; - case "payment_dispute_fee": - return PAYMENT_DISPUTE_FEE; default: return new ListFinancialActivityRequestLineTypesItem(Value.UNKNOWN, value); } @@ -778,6 +793,10 @@ public enum Value { APPLICATION_FEE_PAYOUT, + BALANCE_RESERVATION, + + BALANCE_RESERVATION_REVERSAL, + BANK_TRANSFER, BILLING_PERCENTAGE_FEE, @@ -974,6 +993,10 @@ public interface Visitor { T visitApplicationFeePayout(); + T visitBalanceReservation(); + + T visitBalanceReservationReversal(); + T visitBankTransfer(); T visitBillingPercentageFee(); diff --git a/src/main/java/com/whop/api/resources/invoices/requests/UpdateInvoicesRequest.java b/src/main/java/com/whop/api/resources/invoices/requests/UpdateInvoicesRequest.java index 29332abc..b9b69285 100644 --- a/src/main/java/com/whop/api/resources/invoices/requests/UpdateInvoicesRequest.java +++ b/src/main/java/com/whop/api/resources/invoices/requests/UpdateInvoicesRequest.java @@ -170,7 +170,7 @@ public Optional getEmailAddress() { } /** - * @return Line items that break down the invoice total. + * @return Line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge. Pass an empty list to remove the breakdown. */ @JsonIgnore public Optional> getLineItems() { @@ -615,7 +615,7 @@ public Builder emailAddress(Nullable emailAddress) { } /** - *

Line items that break down the invoice total.

+ *

Line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge. Pass an empty list to remove the breakdown.

*/ @JsonSetter(value = "line_items", nulls = Nulls.SKIP) public Builder lineItems(Optional> lineItems) { diff --git a/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProduct.java b/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProduct.java index c15bbde2..e9645e2e 100644 --- a/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProduct.java +++ b/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProduct.java @@ -185,7 +185,7 @@ public Optional getEmailAddress() { } /** - * @return Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. + * @return Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge. */ @JsonIgnore public Optional> getLineItems() { @@ -509,7 +509,7 @@ public interface _FinalStage { _FinalStage emailAddress(Nullable emailAddress); /** - *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price.

+ *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge.

*/ _FinalStage lineItems(Optional> lineItems); @@ -901,7 +901,7 @@ public _FinalStage mailingAddressId(Optional mailingAddressId) { } /** - *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price.

+ *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -917,7 +917,7 @@ public _FinalStage lineItems(NullableOptional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price.

+ *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -927,7 +927,7 @@ public _FinalStage lineItems(List lin } /** - *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price.

+ *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge.

*/ @java.lang.Override @JsonSetter(value = "line_items", nulls = Nulls.SKIP) diff --git a/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductId.java b/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductId.java index b785f990..15617918 100644 --- a/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductId.java +++ b/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductId.java @@ -185,7 +185,7 @@ public Optional getEmailAddress() { } /** - * @return Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. + * @return Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge. */ @JsonIgnore public Optional> getLineItems() { @@ -509,7 +509,7 @@ public interface _FinalStage { _FinalStage emailAddress(Nullable emailAddress); /** - *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price.

+ *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge.

*/ _FinalStage lineItems(Optional> lineItems); @@ -901,7 +901,7 @@ public _FinalStage mailingAddressId(Optional mailingAddressId) { } /** - *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price.

+ *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -917,7 +917,7 @@ public _FinalStage lineItems(NullableOptional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price.

+ *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -927,7 +927,7 @@ public _FinalStage lineItems(List l } /** - *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price.

+ *

Optional line items that break down the invoice total. When provided, the sum of (quantity * unit_price) for all items must equal the plan price. Individual items may be negative to represent a credit, as long as the sum is not negative and clears the currency's minimum charge.

*/ @java.lang.Override @JsonSetter(value = "line_items", nulls = Nulls.SKIP) diff --git a/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductIdLineItemsItem.java b/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductIdLineItemsItem.java index 48fa2676..e8d1350e 100644 --- a/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductIdLineItemsItem.java +++ b/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductIdLineItemsItem.java @@ -60,7 +60,7 @@ public Optional getQuantity() { } /** - * @return The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43 + * @return The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount. */ @JsonProperty("unit_price") public double getUnitPrice() { @@ -114,7 +114,7 @@ public interface LabelStage { public interface UnitPriceStage { /** - *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43

+ *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount.

*/ _FinalStage unitPrice(double unitPrice); } @@ -170,8 +170,8 @@ public UnitPriceStage label(@NotNull String label) { } /** - *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43

- *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43

+ *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount.

+ *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override diff --git a/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductLineItemsItem.java b/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductLineItemsItem.java index 23bf2766..c6513932 100644 --- a/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductLineItemsItem.java +++ b/src/main/java/com/whop/api/resources/invoices/types/CreateInvoicesRequestProductLineItemsItem.java @@ -60,7 +60,7 @@ public Optional getQuantity() { } /** - * @return The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43 + * @return The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount. */ @JsonProperty("unit_price") public double getUnitPrice() { @@ -114,7 +114,7 @@ public interface LabelStage { public interface UnitPriceStage { /** - *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43

+ *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount.

*/ _FinalStage unitPrice(double unitPrice); } @@ -170,8 +170,8 @@ public UnitPriceStage label(@NotNull String label) { } /** - *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43

- *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43

+ *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount.

+ *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override diff --git a/src/main/java/com/whop/api/resources/invoices/types/UpdateInvoicesRequestLineItemsItem.java b/src/main/java/com/whop/api/resources/invoices/types/UpdateInvoicesRequestLineItemsItem.java index 8795836d..2a8f6833 100644 --- a/src/main/java/com/whop/api/resources/invoices/types/UpdateInvoicesRequestLineItemsItem.java +++ b/src/main/java/com/whop/api/resources/invoices/types/UpdateInvoicesRequestLineItemsItem.java @@ -60,7 +60,7 @@ public Optional getQuantity() { } /** - * @return The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43 + * @return The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount. */ @JsonProperty("unit_price") public double getUnitPrice() { @@ -114,7 +114,7 @@ public interface LabelStage { public interface UnitPriceStage { /** - *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43

+ *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount.

*/ _FinalStage unitPrice(double unitPrice); } @@ -170,8 +170,8 @@ public UnitPriceStage label(@NotNull String label) { } /** - *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43

- *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43

+ *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount.

+ *

The unit price for this line item. Provided as a number in the specified currency. Eg: 10.43 for $10.43. Negative values represent a credit or deduction, as long as the line items still total a chargeable amount.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override diff --git a/src/main/java/com/whop/api/resources/ledgers/types/GetFinancialReportResponseRowsItemLineCategory.java b/src/main/java/com/whop/api/resources/ledgers/types/GetFinancialReportResponseRowsItemLineCategory.java index c7b7af15..d0113880 100644 --- a/src/main/java/com/whop/api/resources/ledgers/types/GetFinancialReportResponseRowsItemLineCategory.java +++ b/src/main/java/com/whop/api/resources/ledgers/types/GetFinancialReportResponseRowsItemLineCategory.java @@ -303,6 +303,10 @@ public final class GetFinancialReportResponseRowsItemLineCategory { new GetFinancialReportResponseRowsItemLineCategory( Value.CARD_SPEND_AUTHORIZATION_HOLD, "card_spend_authorization_hold"); + public static final GetFinancialReportResponseRowsItemLineCategory ACCELERATED_SETTLEMENT_FEE = + new GetFinancialReportResponseRowsItemLineCategory( + Value.ACCELERATED_SETTLEMENT_FEE, "accelerated_settlement_fee"); + public static final GetFinancialReportResponseRowsItemLineCategory PAYMENT_UNRECONCILED_CLEARING = new GetFinancialReportResponseRowsItemLineCategory( Value.PAYMENT_UNRECONCILED_CLEARING, "payment_unreconciled_clearing"); @@ -805,6 +809,10 @@ public final class GetFinancialReportResponseRowsItemLineCategory { public static final GetFinancialReportResponseRowsItemLineCategory CRYPTO = new GetFinancialReportResponseRowsItemLineCategory(Value.CRYPTO, "crypto"); + public static final GetFinancialReportResponseRowsItemLineCategory PSP_ACCELERATED_SETTLEMENT_FEE = + new GetFinancialReportResponseRowsItemLineCategory( + Value.PSP_ACCELERATED_SETTLEMENT_FEE, "psp_accelerated_settlement_fee"); + public static final GetFinancialReportResponseRowsItemLineCategory DISPUTE_UNRECONCILED_REVERSAL = new GetFinancialReportResponseRowsItemLineCategory( Value.DISPUTE_UNRECONCILED_REVERSAL, "dispute_unreconciled_reversal"); @@ -1169,6 +1177,8 @@ public T visit(Visitor visitor) { return visitor.visitPlatformEarningSettlement(); case CARD_SPEND_AUTHORIZATION_HOLD: return visitor.visitCardSpendAuthorizationHold(); + case ACCELERATED_SETTLEMENT_FEE: + return visitor.visitAcceleratedSettlementFee(); case PAYMENT_UNRECONCILED_CLEARING: return visitor.visitPaymentUnreconciledClearing(); case ONCHAIN_WALLET_TRANSFER_OUTGOING: @@ -1461,6 +1471,8 @@ public T visit(Visitor visitor) { return visitor.visitAdBudgetRelease(); case CRYPTO: return visitor.visitCrypto(); + case PSP_ACCELERATED_SETTLEMENT_FEE: + return visitor.visitPspAcceleratedSettlementFee(); case DISPUTE_UNRECONCILED_REVERSAL: return visitor.visitDisputeUnreconciledReversal(); case PLATFORM_AFFILIATE_PAYMENT_REVERSAL: @@ -1732,6 +1744,8 @@ public static GetFinancialReportResponseRowsItemLineCategory valueOf(String valu return PLATFORM_EARNING_SETTLEMENT; case "card_spend_authorization_hold": return CARD_SPEND_AUTHORIZATION_HOLD; + case "accelerated_settlement_fee": + return ACCELERATED_SETTLEMENT_FEE; case "payment_unreconciled_clearing": return PAYMENT_UNRECONCILED_CLEARING; case "onchain_wallet_transfer_outgoing": @@ -2024,6 +2038,8 @@ public static GetFinancialReportResponseRowsItemLineCategory valueOf(String valu return AD_BUDGET_RELEASE; case "crypto": return CRYPTO; + case "psp_accelerated_settlement_fee": + return PSP_ACCELERATED_SETTLEMENT_FEE; case "dispute_unreconciled_reversal": return DISPUTE_UNRECONCILED_REVERSAL; case "platform_affiliate_payment_reversal": @@ -2122,6 +2138,8 @@ public static GetFinancialReportResponseRowsItemLineCategory valueOf(String valu } public enum Value { + ACCELERATED_SETTLEMENT_FEE, + ACCOUNT_SETTLEMENT, AD_BALANCE_FUNDING_RECEIPT, @@ -2452,6 +2470,8 @@ public enum Value { PROMO_REVERSAL, + PSP_ACCELERATED_SETTLEMENT_FEE, + PSP_ACCOUNT_UPDATER_FEE, PSP_ADJUSTED_PROCESSING_FEE, @@ -2680,6 +2700,8 @@ public enum Value { } public interface Visitor { + T visitAcceleratedSettlementFee(); + T visitAccountSettlement(); T visitAdBalanceFundingReceipt(); @@ -3010,6 +3032,8 @@ public interface Visitor { T visitPromoReversal(); + T visitPspAcceleratedSettlementFee(); + T visitPspAccountUpdaterFee(); T visitPspAdjustedProcessingFee(); diff --git a/src/main/java/com/whop/api/resources/payouts/methods/types/CreateMethodsResponseSupportedPayoutMethodDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/methods/types/CreateMethodsResponseSupportedPayoutMethodDeliveryType.java index e0ef5ae9..3c8f4c7d 100644 --- a/src/main/java/com/whop/api/resources/payouts/methods/types/CreateMethodsResponseSupportedPayoutMethodDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/methods/types/CreateMethodsResponseSupportedPayoutMethodDeliveryType.java @@ -7,12 +7,15 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class CreateMethodsResponseSupportedPayoutMethodDeliveryType { - public static final CreateMethodsResponseSupportedPayoutMethodDeliveryType PAPER_CHECK = - new CreateMethodsResponseSupportedPayoutMethodDeliveryType(Value.PAPER_CHECK, "paper_check"); - public static final CreateMethodsResponseSupportedPayoutMethodDeliveryType CRYPTOCURRENCY = new CreateMethodsResponseSupportedPayoutMethodDeliveryType(Value.CRYPTOCURRENCY, "cryptocurrency"); + public static final CreateMethodsResponseSupportedPayoutMethodDeliveryType CHECK = + new CreateMethodsResponseSupportedPayoutMethodDeliveryType(Value.CHECK, "check"); + + public static final CreateMethodsResponseSupportedPayoutMethodDeliveryType CARD = + new CreateMethodsResponseSupportedPayoutMethodDeliveryType(Value.CARD, "card"); + public static final CreateMethodsResponseSupportedPayoutMethodDeliveryType UNKNOWN = new CreateMethodsResponseSupportedPayoutMethodDeliveryType(Value.UNKNOWN, "unknown"); @@ -22,9 +25,6 @@ public final class CreateMethodsResponseSupportedPayoutMethodDeliveryType { public static final CreateMethodsResponseSupportedPayoutMethodDeliveryType BANK_DEPOSIT = new CreateMethodsResponseSupportedPayoutMethodDeliveryType(Value.BANK_DEPOSIT, "bank_deposit"); - public static final CreateMethodsResponseSupportedPayoutMethodDeliveryType MASSPAY_CARD = - new CreateMethodsResponseSupportedPayoutMethodDeliveryType(Value.MASSPAY_CARD, "masspay_card"); - public static final CreateMethodsResponseSupportedPayoutMethodDeliveryType MOBILE_WALLET = new CreateMethodsResponseSupportedPayoutMethodDeliveryType(Value.MOBILE_WALLET, "mobile_wallet"); @@ -67,18 +67,18 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case UNKNOWN: return visitor.visitUnknown(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: @@ -94,18 +94,18 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static CreateMethodsResponseSupportedPayoutMethodDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; + case "check": + return CHECK; + case "card": + return CARD; case "unknown": return UNKNOWN; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -126,9 +126,9 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, @@ -148,9 +148,9 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); diff --git a/src/main/java/com/whop/api/resources/payouts/methods/types/ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/methods/types/ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType.java index c4febf2e..1208a700 100644 --- a/src/main/java/com/whop/api/resources/payouts/methods/types/ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/methods/types/ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType.java @@ -7,12 +7,15 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType { - public static final ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType PAPER_CHECK = - new ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType(Value.PAPER_CHECK, "paper_check"); - public static final ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType CRYPTOCURRENCY = new ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType(Value.CRYPTOCURRENCY, "cryptocurrency"); + public static final ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType CHECK = + new ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType(Value.CHECK, "check"); + + public static final ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType CARD = + new ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType(Value.CARD, "card"); + public static final ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType UNKNOWN = new ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType(Value.UNKNOWN, "unknown"); @@ -22,9 +25,6 @@ public final class ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType public static final ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType BANK_DEPOSIT = new ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType(Value.BANK_DEPOSIT, "bank_deposit"); - public static final ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType MASSPAY_CARD = - new ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType(Value.MASSPAY_CARD, "masspay_card"); - public static final ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType MOBILE_WALLET = new ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType(Value.MOBILE_WALLET, "mobile_wallet"); @@ -68,18 +68,18 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case UNKNOWN: return visitor.visitUnknown(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: @@ -95,18 +95,18 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static ListMethodsResponseDataItemSupportedPayoutMethodDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; + case "check": + return CHECK; + case "card": + return CARD; case "unknown": return UNKNOWN; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -127,9 +127,9 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, @@ -149,9 +149,9 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); diff --git a/src/main/java/com/whop/api/resources/payouts/methods/types/UpdateMethodsResponseSupportedPayoutMethodDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/methods/types/UpdateMethodsResponseSupportedPayoutMethodDeliveryType.java index 408c620a..ac287d59 100644 --- a/src/main/java/com/whop/api/resources/payouts/methods/types/UpdateMethodsResponseSupportedPayoutMethodDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/methods/types/UpdateMethodsResponseSupportedPayoutMethodDeliveryType.java @@ -7,12 +7,15 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class UpdateMethodsResponseSupportedPayoutMethodDeliveryType { - public static final UpdateMethodsResponseSupportedPayoutMethodDeliveryType PAPER_CHECK = - new UpdateMethodsResponseSupportedPayoutMethodDeliveryType(Value.PAPER_CHECK, "paper_check"); - public static final UpdateMethodsResponseSupportedPayoutMethodDeliveryType CRYPTOCURRENCY = new UpdateMethodsResponseSupportedPayoutMethodDeliveryType(Value.CRYPTOCURRENCY, "cryptocurrency"); + public static final UpdateMethodsResponseSupportedPayoutMethodDeliveryType CHECK = + new UpdateMethodsResponseSupportedPayoutMethodDeliveryType(Value.CHECK, "check"); + + public static final UpdateMethodsResponseSupportedPayoutMethodDeliveryType CARD = + new UpdateMethodsResponseSupportedPayoutMethodDeliveryType(Value.CARD, "card"); + public static final UpdateMethodsResponseSupportedPayoutMethodDeliveryType UNKNOWN = new UpdateMethodsResponseSupportedPayoutMethodDeliveryType(Value.UNKNOWN, "unknown"); @@ -22,9 +25,6 @@ public final class UpdateMethodsResponseSupportedPayoutMethodDeliveryType { public static final UpdateMethodsResponseSupportedPayoutMethodDeliveryType BANK_DEPOSIT = new UpdateMethodsResponseSupportedPayoutMethodDeliveryType(Value.BANK_DEPOSIT, "bank_deposit"); - public static final UpdateMethodsResponseSupportedPayoutMethodDeliveryType MASSPAY_CARD = - new UpdateMethodsResponseSupportedPayoutMethodDeliveryType(Value.MASSPAY_CARD, "masspay_card"); - public static final UpdateMethodsResponseSupportedPayoutMethodDeliveryType MOBILE_WALLET = new UpdateMethodsResponseSupportedPayoutMethodDeliveryType(Value.MOBILE_WALLET, "mobile_wallet"); @@ -67,18 +67,18 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case UNKNOWN: return visitor.visitUnknown(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: @@ -94,18 +94,18 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static UpdateMethodsResponseSupportedPayoutMethodDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; + case "check": + return CHECK; + case "card": + return CARD; case "unknown": return UNKNOWN; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -126,9 +126,9 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, @@ -148,9 +148,9 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); diff --git a/src/main/java/com/whop/api/resources/payouts/supportedmethods/types/ListSupportedMethodsResponseDataItemDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/supportedmethods/types/ListSupportedMethodsResponseDataItemDeliveryType.java index 28e6c4c8..a933594e 100644 --- a/src/main/java/com/whop/api/resources/payouts/supportedmethods/types/ListSupportedMethodsResponseDataItemDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/supportedmethods/types/ListSupportedMethodsResponseDataItemDeliveryType.java @@ -7,14 +7,14 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class ListSupportedMethodsResponseDataItemDeliveryType { - public static final ListSupportedMethodsResponseDataItemDeliveryType PAPER_CHECK = - new ListSupportedMethodsResponseDataItemDeliveryType(Value.PAPER_CHECK, "paper_check"); - public static final ListSupportedMethodsResponseDataItemDeliveryType CRYPTOCURRENCY = new ListSupportedMethodsResponseDataItemDeliveryType(Value.CRYPTOCURRENCY, "cryptocurrency"); - public static final ListSupportedMethodsResponseDataItemDeliveryType UNKNOWN = - new ListSupportedMethodsResponseDataItemDeliveryType(Value.UNKNOWN, "unknown"); + public static final ListSupportedMethodsResponseDataItemDeliveryType CHECK = + new ListSupportedMethodsResponseDataItemDeliveryType(Value.CHECK, "check"); + + public static final ListSupportedMethodsResponseDataItemDeliveryType CARD = + new ListSupportedMethodsResponseDataItemDeliveryType(Value.CARD, "card"); public static final ListSupportedMethodsResponseDataItemDeliveryType HOME_DELIVERY = new ListSupportedMethodsResponseDataItemDeliveryType(Value.HOME_DELIVERY, "home_delivery"); @@ -22,9 +22,6 @@ public final class ListSupportedMethodsResponseDataItemDeliveryType { public static final ListSupportedMethodsResponseDataItemDeliveryType BANK_DEPOSIT = new ListSupportedMethodsResponseDataItemDeliveryType(Value.BANK_DEPOSIT, "bank_deposit"); - public static final ListSupportedMethodsResponseDataItemDeliveryType MASSPAY_CARD = - new ListSupportedMethodsResponseDataItemDeliveryType(Value.MASSPAY_CARD, "masspay_card"); - public static final ListSupportedMethodsResponseDataItemDeliveryType MOBILE_WALLET = new ListSupportedMethodsResponseDataItemDeliveryType(Value.MOBILE_WALLET, "mobile_wallet"); @@ -67,25 +64,23 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); - case UNKNOWN: - return visitor.visitUnknown(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: return visitor.visitCashPickup(); case BILL: return visitor.visitBill(); - case _UNKNOWN: + case UNKNOWN: default: return visitor.visitUnknown(string); } @@ -94,18 +89,16 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static ListSupportedMethodsResponseDataItemDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; - case "unknown": - return UNKNOWN; + case "check": + return CHECK; + case "card": + return CARD; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -113,7 +106,7 @@ public static ListSupportedMethodsResponseDataItemDeliveryType valueOf(String va case "bill": return BILL; default: - return new ListSupportedMethodsResponseDataItemDeliveryType(Value._UNKNOWN, value); + return new ListSupportedMethodsResponseDataItemDeliveryType(Value.UNKNOWN, value); } } @@ -126,17 +119,15 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, CRYPTOCURRENCY, - UNKNOWN, - - _UNKNOWN + UNKNOWN } public interface Visitor { @@ -148,16 +139,14 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); T visitCryptocurrency(); - T visitUnknown(); - T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/whop/api/resources/payouts/types/CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/types/CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType.java index 4f84b97b..1b53ec4b 100644 --- a/src/main/java/com/whop/api/resources/payouts/types/CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/types/CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType.java @@ -7,13 +7,16 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType { - public static final CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType PAPER_CHECK = - new CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType(Value.PAPER_CHECK, "paper_check"); - public static final CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType CRYPTOCURRENCY = new CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType( Value.CRYPTOCURRENCY, "cryptocurrency"); + public static final CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType CHECK = + new CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType(Value.CHECK, "check"); + + public static final CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType CARD = + new CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType(Value.CARD, "card"); + public static final CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType UNKNOWN = new CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType(Value.UNKNOWN, "unknown"); @@ -24,9 +27,6 @@ public final class CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliver public static final CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType BANK_DEPOSIT = new CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType(Value.BANK_DEPOSIT, "bank_deposit"); - public static final CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType MASSPAY_CARD = - new CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType(Value.MASSPAY_CARD, "masspay_card"); - public static final CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType MOBILE_WALLET = new CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType( Value.MOBILE_WALLET, "mobile_wallet"); @@ -71,18 +71,18 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case UNKNOWN: return visitor.visitUnknown(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: @@ -98,18 +98,18 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static CreatePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; + case "check": + return CHECK; + case "card": + return CARD; case "unknown": return UNKNOWN; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -130,9 +130,9 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, @@ -152,9 +152,9 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); diff --git a/src/main/java/com/whop/api/resources/payouts/types/ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/types/ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType.java index 317fbbe8..698ea42c 100644 --- a/src/main/java/com/whop/api/resources/payouts/types/ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/types/ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType.java @@ -7,14 +7,16 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType { - public static final ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType PAPER_CHECK = - new ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType( - Value.PAPER_CHECK, "paper_check"); - public static final ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType CRYPTOCURRENCY = new ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType( Value.CRYPTOCURRENCY, "cryptocurrency"); + public static final ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType CHECK = + new ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType(Value.CHECK, "check"); + + public static final ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType CARD = + new ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType(Value.CARD, "card"); + public static final ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType UNKNOWN = new ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType(Value.UNKNOWN, "unknown"); @@ -26,10 +28,6 @@ public final class ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodD new ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType( Value.BANK_DEPOSIT, "bank_deposit"); - public static final ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType MASSPAY_CARD = - new ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType( - Value.MASSPAY_CARD, "masspay_card"); - public static final ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType MOBILE_WALLET = new ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType( Value.MOBILE_WALLET, "mobile_wallet"); @@ -76,18 +74,18 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case UNKNOWN: return visitor.visitUnknown(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: @@ -103,18 +101,18 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static ListPayoutsResponseDataItemPayoutMethodSupportedPayoutMethodDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; + case "check": + return CHECK; + case "card": + return CARD; case "unknown": return UNKNOWN; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -136,9 +134,9 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, @@ -158,9 +156,9 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); diff --git a/src/main/java/com/whop/api/resources/payouts/types/PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/types/PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType.java index 1f7dddce..3555fd60 100644 --- a/src/main/java/com/whop/api/resources/payouts/types/PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/types/PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType.java @@ -7,13 +7,16 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType { - public static final PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType PAPER_CHECK = - new PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType(Value.PAPER_CHECK, "paper_check"); - public static final PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType CRYPTOCURRENCY = new PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType( Value.CRYPTOCURRENCY, "cryptocurrency"); + public static final PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType CHECK = + new PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType(Value.CHECK, "check"); + + public static final PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType CARD = + new PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType(Value.CARD, "card"); + public static final PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType UNKNOWN = new PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType(Value.UNKNOWN, "unknown"); @@ -24,9 +27,6 @@ public final class PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDelive public static final PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType BANK_DEPOSIT = new PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType(Value.BANK_DEPOSIT, "bank_deposit"); - public static final PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType MASSPAY_CARD = - new PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType(Value.MASSPAY_CARD, "masspay_card"); - public static final PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType MOBILE_WALLET = new PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType( Value.MOBILE_WALLET, "mobile_wallet"); @@ -71,18 +71,18 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case UNKNOWN: return visitor.visitUnknown(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: @@ -98,18 +98,18 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static PostPayoutMethodCreatedPayloadDataSupportedPayoutMethodDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; + case "check": + return CHECK; + case "card": + return CARD; case "unknown": return UNKNOWN; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -130,9 +130,9 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, @@ -152,9 +152,9 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); diff --git a/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java index 040de307..f53daf43 100644 --- a/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java @@ -7,14 +7,16 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType { - public static final PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType PAPER_CHECK = - new PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( - Value.PAPER_CHECK, "paper_check"); - public static final PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType CRYPTOCURRENCY = new PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( Value.CRYPTOCURRENCY, "cryptocurrency"); + public static final PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType CHECK = + new PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType(Value.CHECK, "check"); + + public static final PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType CARD = + new PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType(Value.CARD, "card"); + public static final PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType UNKNOWN = new PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType(Value.UNKNOWN, "unknown"); @@ -26,10 +28,6 @@ public final class PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMe new PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( Value.BANK_DEPOSIT, "bank_deposit"); - public static final PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType MASSPAY_CARD = - new PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( - Value.MASSPAY_CARD, "masspay_card"); - public static final PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType MOBILE_WALLET = new PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( Value.MOBILE_WALLET, "mobile_wallet"); @@ -76,18 +74,18 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case UNKNOWN: return visitor.visitUnknown(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: @@ -103,18 +101,18 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static PostWithdrawalCreatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; + case "check": + return CHECK; + case "card": + return CARD; case "unknown": return UNKNOWN; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -136,9 +134,9 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, @@ -158,9 +156,9 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); diff --git a/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java index db073b7a..306f4b08 100644 --- a/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java @@ -7,14 +7,16 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType { - public static final PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType PAPER_CHECK = - new PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( - Value.PAPER_CHECK, "paper_check"); - public static final PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType CRYPTOCURRENCY = new PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( Value.CRYPTOCURRENCY, "cryptocurrency"); + public static final PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType CHECK = + new PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType(Value.CHECK, "check"); + + public static final PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType CARD = + new PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType(Value.CARD, "card"); + public static final PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType UNKNOWN = new PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( Value.UNKNOWN, "unknown"); @@ -27,10 +29,6 @@ public final class PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutM new PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( Value.BANK_DEPOSIT, "bank_deposit"); - public static final PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType MASSPAY_CARD = - new PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( - Value.MASSPAY_CARD, "masspay_card"); - public static final PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType MOBILE_WALLET = new PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( Value.MOBILE_WALLET, "mobile_wallet"); @@ -77,18 +75,18 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case UNKNOWN: return visitor.visitUnknown(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: @@ -104,18 +102,18 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static PostWithdrawalReversedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; + case "check": + return CHECK; + case "card": + return CARD; case "unknown": return UNKNOWN; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -137,9 +135,9 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, @@ -159,9 +157,9 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); diff --git a/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java index 1d682355..540b1a7c 100644 --- a/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/types/PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType.java @@ -7,14 +7,16 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType { - public static final PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType PAPER_CHECK = - new PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( - Value.PAPER_CHECK, "paper_check"); - public static final PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType CRYPTOCURRENCY = new PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( Value.CRYPTOCURRENCY, "cryptocurrency"); + public static final PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType CHECK = + new PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType(Value.CHECK, "check"); + + public static final PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType CARD = + new PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType(Value.CARD, "card"); + public static final PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType UNKNOWN = new PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType(Value.UNKNOWN, "unknown"); @@ -26,10 +28,6 @@ public final class PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMe new PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( Value.BANK_DEPOSIT, "bank_deposit"); - public static final PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType MASSPAY_CARD = - new PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( - Value.MASSPAY_CARD, "masspay_card"); - public static final PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType MOBILE_WALLET = new PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType( Value.MOBILE_WALLET, "mobile_wallet"); @@ -76,18 +74,18 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case UNKNOWN: return visitor.visitUnknown(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: @@ -103,18 +101,18 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static PostWithdrawalUpdatedPayloadDataPayoutMethodSupportedPayoutMethodDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; + case "check": + return CHECK; + case "card": + return CARD; case "unknown": return UNKNOWN; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -136,9 +134,9 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, @@ -158,9 +156,9 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); diff --git a/src/main/java/com/whop/api/resources/payouts/types/RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType.java b/src/main/java/com/whop/api/resources/payouts/types/RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType.java index e689ebd2..74fa8280 100644 --- a/src/main/java/com/whop/api/resources/payouts/types/RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType.java +++ b/src/main/java/com/whop/api/resources/payouts/types/RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType.java @@ -7,13 +7,16 @@ import com.fasterxml.jackson.annotation.JsonValue; public final class RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType { - public static final RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType PAPER_CHECK = - new RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType(Value.PAPER_CHECK, "paper_check"); - public static final RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType CRYPTOCURRENCY = new RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType( Value.CRYPTOCURRENCY, "cryptocurrency"); + public static final RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType CHECK = + new RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType(Value.CHECK, "check"); + + public static final RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType CARD = + new RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType(Value.CARD, "card"); + public static final RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType UNKNOWN = new RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType(Value.UNKNOWN, "unknown"); @@ -25,10 +28,6 @@ public final class RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliv new RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType( Value.BANK_DEPOSIT, "bank_deposit"); - public static final RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType MASSPAY_CARD = - new RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType( - Value.MASSPAY_CARD, "masspay_card"); - public static final RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType MOBILE_WALLET = new RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType( Value.MOBILE_WALLET, "mobile_wallet"); @@ -73,18 +72,18 @@ public int hashCode() { public T visit(Visitor visitor) { switch (value) { - case PAPER_CHECK: - return visitor.visitPaperCheck(); case CRYPTOCURRENCY: return visitor.visitCryptocurrency(); + case CHECK: + return visitor.visitCheck(); + case CARD: + return visitor.visitCard(); case UNKNOWN: return visitor.visitUnknown(); case HOME_DELIVERY: return visitor.visitHomeDelivery(); case BANK_DEPOSIT: return visitor.visitBankDeposit(); - case MASSPAY_CARD: - return visitor.visitMasspayCard(); case MOBILE_WALLET: return visitor.visitMobileWallet(); case CASH_PICKUP: @@ -100,18 +99,18 @@ public T visit(Visitor visitor) { @JsonCreator(mode = JsonCreator.Mode.DELEGATING) public static RetrievePayoutsResponsePayoutMethodSupportedPayoutMethodDeliveryType valueOf(String value) { switch (value) { - case "paper_check": - return PAPER_CHECK; case "cryptocurrency": return CRYPTOCURRENCY; + case "check": + return CHECK; + case "card": + return CARD; case "unknown": return UNKNOWN; case "home_delivery": return HOME_DELIVERY; case "bank_deposit": return BANK_DEPOSIT; - case "masspay_card": - return MASSPAY_CARD; case "mobile_wallet": return MOBILE_WALLET; case "cash_pickup": @@ -132,9 +131,9 @@ public enum Value { MOBILE_WALLET, - MASSPAY_CARD, + CARD, - PAPER_CHECK, + CHECK, BILL, @@ -154,9 +153,9 @@ public interface Visitor { T visitMobileWallet(); - T visitMasspayCard(); + T visitCard(); - T visitPaperCheck(); + T visitCheck(); T visitBill(); diff --git a/src/main/java/com/whop/api/resources/plans/AsyncPlansClient.java b/src/main/java/com/whop/api/resources/plans/AsyncPlansClient.java index cbba0192..f5605e0c 100644 --- a/src/main/java/com/whop/api/resources/plans/AsyncPlansClient.java +++ b/src/main/java/com/whop/api/resources/plans/AsyncPlansClient.java @@ -36,14 +36,28 @@ public AsyncRawPlansClient withRawResponse() { } /** - * Returns a paginated list of plans belonging to an account, with optional filtering by visibility, type, release method, and product. + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. */ public CompletableFuture> list(ListPlansRequest request) { return this.rawClient.list(request).thenApply(response -> response.body()); } /** - * Returns a paginated list of plans belonging to an account, with optional filtering by visibility, type, release method, and product. + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. */ public CompletableFuture> list( ListPlansRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/com/whop/api/resources/plans/AsyncRawPlansClient.java b/src/main/java/com/whop/api/resources/plans/AsyncRawPlansClient.java index 15533eaa..49a365c5 100644 --- a/src/main/java/com/whop/api/resources/plans/AsyncRawPlansClient.java +++ b/src/main/java/com/whop/api/resources/plans/AsyncRawPlansClient.java @@ -54,21 +54,39 @@ public AsyncRawPlansClient(ClientOptions clientOptions) { } /** - * Returns a paginated list of plans belonging to an account, with optional filtering by visibility, type, release method, and product. + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. + */ + public CompletableFuture>> list() { + return list(ListPlansRequest.builder().build()); + } + + /** + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. + */ + public CompletableFuture>> list( + RequestOptions requestOptions) { + return list(ListPlansRequest.builder().build(), requestOptions); + } + + /** + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. */ public CompletableFuture>> list(ListPlansRequest request) { return list(request, null); } /** - * Returns a paginated list of plans belonging to an account, with optional filtering by visibility, type, release method, and product. + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. */ public CompletableFuture>> list( ListPlansRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("plans"); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } if (request.getDirection().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "direction", request.getDirection().get(), false); diff --git a/src/main/java/com/whop/api/resources/plans/PlansClient.java b/src/main/java/com/whop/api/resources/plans/PlansClient.java index 14bc96d0..8cd8f66b 100644 --- a/src/main/java/com/whop/api/resources/plans/PlansClient.java +++ b/src/main/java/com/whop/api/resources/plans/PlansClient.java @@ -35,14 +35,28 @@ public RawPlansClient withRawResponse() { } /** - * Returns a paginated list of plans belonging to an account, with optional filtering by visibility, type, release method, and product. + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. + */ + public SyncPagingIterable list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. */ public SyncPagingIterable list(ListPlansRequest request) { return this.rawClient.list(request).body(); } /** - * Returns a paginated list of plans belonging to an account, with optional filtering by visibility, type, release method, and product. + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. */ public SyncPagingIterable list(ListPlansRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); diff --git a/src/main/java/com/whop/api/resources/plans/RawPlansClient.java b/src/main/java/com/whop/api/resources/plans/RawPlansClient.java index ca03de75..f855376f 100644 --- a/src/main/java/com/whop/api/resources/plans/RawPlansClient.java +++ b/src/main/java/com/whop/api/resources/plans/RawPlansClient.java @@ -49,21 +49,38 @@ public RawPlansClient(ClientOptions clientOptions) { } /** - * Returns a paginated list of plans belonging to an account, with optional filtering by visibility, type, release method, and product. + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. + */ + public WhopApiHttpResponse> list() { + return list(ListPlansRequest.builder().build()); + } + + /** + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. + */ + public WhopApiHttpResponse> list(RequestOptions requestOptions) { + return list(ListPlansRequest.builder().build(), requestOptions); + } + + /** + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. */ public WhopApiHttpResponse> list(ListPlansRequest request) { return list(request, null); } /** - * Returns a paginated list of plans belonging to an account, with optional filtering by visibility, type, release method, and product. + * Returns a paginated list of plans. Omit account_id and pass product_ids to list a product's public buyable plans. */ public WhopApiHttpResponse> list( ListPlansRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("plans"); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } if (request.getDirection().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "direction", request.getDirection().get(), false); diff --git a/src/main/java/com/whop/api/resources/plans/requests/ListPlansRequest.java b/src/main/java/com/whop/api/resources/plans/requests/ListPlansRequest.java index 219cbadc..d1c92ed4 100644 --- a/src/main/java/com/whop/api/resources/plans/requests/ListPlansRequest.java +++ b/src/main/java/com/whop/api/resources/plans/requests/ListPlansRequest.java @@ -20,7 +20,6 @@ import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListPlansRequest.Builder.class) @@ -33,7 +32,7 @@ public final class ListPlansRequest { private final Optional> productIds; - private final String accountId; + private final Optional accountId; private final Optional direction; @@ -58,7 +57,7 @@ private ListPlansRequest( Optional> visibilities, Optional> planTypes, Optional> productIds, - String accountId, + Optional accountId, Optional direction, Optional order, Optional createdBefore, @@ -109,7 +108,7 @@ public Optional> getPlanTypes() { } /** - * @return Filter to only plans belonging to these product identifiers. + * @return Filter to only plans belonging to these product identifiers. When account_id is omitted, this is required and the response is publicly readable: only visible, non-invoice plans are returned. */ @JsonProperty("product_ids") public Optional> getProductIds() { @@ -117,10 +116,10 @@ public Optional> getProductIds() { } /** - * @return The unique identifier of the account to list plans for. + * @return The unique identifier of the account to list plans for. Required unless product_ids is provided for a public product-plan read. */ @JsonProperty("account_id") - public String getAccountId() { + public Optional getAccountId() { return accountId; } @@ -238,153 +237,43 @@ public String toString() { return ObjectMappers.stringify(this); } - public static AccountIdStage builder() { + public static Builder builder() { return new Builder(); } - public interface AccountIdStage { - /** - *

The unique identifier of the account to list plans for.

- */ - _FinalStage accountId(@NotNull String accountId); - - Builder from(ListPlansRequest other); - } - - public interface _FinalStage { - ListPlansRequest build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - /** - *

Filter to only plans matching these release methods.

- */ - _FinalStage releaseMethods(Optional> releaseMethods); - - _FinalStage releaseMethods(List releaseMethods); - - _FinalStage releaseMethods(String releaseMethods); - - /** - *

Filter to only plans matching these visibility states.

- */ - _FinalStage visibilities(Optional> visibilities); - - _FinalStage visibilities(List visibilities); - - _FinalStage visibilities(String visibilities); - - /** - *

Filter to only plans matching these billing types.

- */ - _FinalStage planTypes(Optional> planTypes); - - _FinalStage planTypes(List planTypes); - - _FinalStage planTypes(String planTypes); - - /** - *

Filter to only plans belonging to these product identifiers.

- */ - _FinalStage productIds(Optional> productIds); - - _FinalStage productIds(List productIds); - - _FinalStage productIds(String productIds); - - /** - *

The sort direction for results. Defaults to descending.

- */ - _FinalStage direction(Optional direction); - - _FinalStage direction(ListPlansRequestDirection direction); - - /** - *

The field to sort results by. Defaults to created_at.

- */ - _FinalStage order(Optional order); - - _FinalStage order(ListPlansRequestOrder order); - - /** - *

Only return plans created before this timestamp.

- */ - _FinalStage createdBefore(Optional createdBefore); - - _FinalStage createdBefore(String createdBefore); - - /** - *

Only return plans created after this timestamp.

- */ - _FinalStage createdAfter(Optional createdAfter); - - _FinalStage createdAfter(String createdAfter); - - /** - *

The number of plans to return (default and max 100).

- */ - _FinalStage first(Optional first); - - _FinalStage first(Integer first); - - /** - *

A cursor; returns plans after this position.

- */ - _FinalStage after(Optional after); - - _FinalStage after(String after); - - /** - *

The number of plans to return from the end of the range.

- */ - _FinalStage last(Optional last); - - _FinalStage last(Integer last); - - /** - *

A cursor; returns plans before this position.

- */ - _FinalStage before(Optional before); - - _FinalStage before(String before); - } - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccountIdStage, _FinalStage { - private String accountId; - - private Optional before = Optional.empty(); + public static final class Builder { + private Optional> releaseMethods = Optional.empty(); - private Optional last = Optional.empty(); + private Optional> visibilities = Optional.empty(); - private Optional after = Optional.empty(); + private Optional> planTypes = Optional.empty(); - private Optional first = Optional.empty(); + private Optional> productIds = Optional.empty(); - private Optional createdAfter = Optional.empty(); + private Optional accountId = Optional.empty(); - private Optional createdBefore = Optional.empty(); + private Optional direction = Optional.empty(); private Optional order = Optional.empty(); - private Optional direction = Optional.empty(); + private Optional createdBefore = Optional.empty(); - private Optional> productIds = Optional.empty(); + private Optional createdAfter = Optional.empty(); - private Optional> planTypes = Optional.empty(); + private Optional first = Optional.empty(); - private Optional> visibilities = Optional.empty(); + private Optional after = Optional.empty(); - private Optional> releaseMethods = Optional.empty(); + private Optional last = Optional.empty(); + + private Optional before = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(ListPlansRequest other) { releaseMethods(other.getReleaseMethods()); visibilities(other.getVisibilities()); @@ -403,282 +292,207 @@ public Builder from(ListPlansRequest other) { } /** - *

The unique identifier of the account to list plans for.

- *

The unique identifier of the account to list plans for.

- * @return Reference to {@code this} so that method calls can be chained together. + *

Filter to only plans matching these release methods.

*/ - @java.lang.Override - @JsonSetter("account_id") - public _FinalStage accountId(@NotNull String accountId) { - this.accountId = Objects.requireNonNull(accountId, "accountId must not be null"); + @JsonSetter(value = "release_methods", nulls = Nulls.SKIP) + public Builder releaseMethods(Optional> releaseMethods) { + this.releaseMethods = releaseMethods; return this; } - /** - *

A cursor; returns plans before this position.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage before(String before) { - this.before = Optional.ofNullable(before); + public Builder releaseMethods(List releaseMethods) { + this.releaseMethods = Optional.ofNullable(releaseMethods); return this; } - /** - *

A cursor; returns plans before this position.

- */ - @java.lang.Override - @JsonSetter(value = "before", nulls = Nulls.SKIP) - public _FinalStage before(Optional before) { - this.before = before; + public Builder releaseMethods(String releaseMethods) { + this.releaseMethods = Optional.of(Collections.singletonList(releaseMethods)); return this; } /** - *

The number of plans to return from the end of the range.

- * @return Reference to {@code this} so that method calls can be chained together. + *

Filter to only plans matching these visibility states.

*/ - @java.lang.Override - public _FinalStage last(Integer last) { - this.last = Optional.ofNullable(last); + @JsonSetter(value = "visibilities", nulls = Nulls.SKIP) + public Builder visibilities(Optional> visibilities) { + this.visibilities = visibilities; return this; } - /** - *

The number of plans to return from the end of the range.

- */ - @java.lang.Override - @JsonSetter(value = "last", nulls = Nulls.SKIP) - public _FinalStage last(Optional last) { - this.last = last; + public Builder visibilities(List visibilities) { + this.visibilities = Optional.ofNullable(visibilities); return this; } - /** - *

A cursor; returns plans after this position.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage after(String after) { - this.after = Optional.ofNullable(after); + public Builder visibilities(String visibilities) { + this.visibilities = Optional.of(Collections.singletonList(visibilities)); return this; } /** - *

A cursor; returns plans after this position.

+ *

Filter to only plans matching these billing types.

*/ - @java.lang.Override - @JsonSetter(value = "after", nulls = Nulls.SKIP) - public _FinalStage after(Optional after) { - this.after = after; + @JsonSetter(value = "plan_types", nulls = Nulls.SKIP) + public Builder planTypes(Optional> planTypes) { + this.planTypes = planTypes; return this; } - /** - *

The number of plans to return (default and max 100).

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage first(Integer first) { - this.first = Optional.ofNullable(first); + public Builder planTypes(List planTypes) { + this.planTypes = Optional.ofNullable(planTypes); return this; } - /** - *

The number of plans to return (default and max 100).

- */ - @java.lang.Override - @JsonSetter(value = "first", nulls = Nulls.SKIP) - public _FinalStage first(Optional first) { - this.first = first; + public Builder planTypes(String planTypes) { + this.planTypes = Optional.of(Collections.singletonList(planTypes)); return this; } /** - *

Only return plans created after this timestamp.

- * @return Reference to {@code this} so that method calls can be chained together. + *

Filter to only plans belonging to these product identifiers. When account_id is omitted, this is required and the response is publicly readable: only visible, non-invoice plans are returned.

*/ - @java.lang.Override - public _FinalStage createdAfter(String createdAfter) { - this.createdAfter = Optional.ofNullable(createdAfter); + @JsonSetter(value = "product_ids", nulls = Nulls.SKIP) + public Builder productIds(Optional> productIds) { + this.productIds = productIds; return this; } - /** - *

Only return plans created after this timestamp.

- */ - @java.lang.Override - @JsonSetter(value = "created_after", nulls = Nulls.SKIP) - public _FinalStage createdAfter(Optional createdAfter) { - this.createdAfter = createdAfter; + public Builder productIds(List productIds) { + this.productIds = Optional.ofNullable(productIds); return this; } - /** - *

Only return plans created before this timestamp.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage createdBefore(String createdBefore) { - this.createdBefore = Optional.ofNullable(createdBefore); + public Builder productIds(String productIds) { + this.productIds = Optional.of(Collections.singletonList(productIds)); return this; } /** - *

Only return plans created before this timestamp.

+ *

The unique identifier of the account to list plans for. Required unless product_ids is provided for a public product-plan read.

*/ - @java.lang.Override - @JsonSetter(value = "created_before", nulls = Nulls.SKIP) - public _FinalStage createdBefore(Optional createdBefore) { - this.createdBefore = createdBefore; + @JsonSetter(value = "account_id", nulls = Nulls.SKIP) + public Builder accountId(Optional accountId) { + this.accountId = accountId; return this; } - /** - *

The field to sort results by. Defaults to created_at.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage order(ListPlansRequestOrder order) { - this.order = Optional.ofNullable(order); + public Builder accountId(String accountId) { + this.accountId = Optional.ofNullable(accountId); return this; } /** - *

The field to sort results by. Defaults to created_at.

+ *

The sort direction for results. Defaults to descending.

*/ - @java.lang.Override - @JsonSetter(value = "order", nulls = Nulls.SKIP) - public _FinalStage order(Optional order) { - this.order = order; + @JsonSetter(value = "direction", nulls = Nulls.SKIP) + public Builder direction(Optional direction) { + this.direction = direction; return this; } - /** - *

The sort direction for results. Defaults to descending.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage direction(ListPlansRequestDirection direction) { + public Builder direction(ListPlansRequestDirection direction) { this.direction = Optional.ofNullable(direction); return this; } /** - *

The sort direction for results. Defaults to descending.

+ *

The field to sort results by. Defaults to created_at.

*/ - @java.lang.Override - @JsonSetter(value = "direction", nulls = Nulls.SKIP) - public _FinalStage direction(Optional direction) { - this.direction = direction; + @JsonSetter(value = "order", nulls = Nulls.SKIP) + public Builder order(Optional order) { + this.order = order; return this; } - @java.lang.Override - public _FinalStage productIds(String productIds) { - this.productIds = Optional.of(Collections.singletonList(productIds)); + public Builder order(ListPlansRequestOrder order) { + this.order = Optional.ofNullable(order); return this; } /** - *

Filter to only plans belonging to these product identifiers.

- * @return Reference to {@code this} so that method calls can be chained together. + *

Only return plans created before this timestamp.

*/ - @java.lang.Override - public _FinalStage productIds(List productIds) { - this.productIds = Optional.ofNullable(productIds); + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; return this; } - /** - *

Filter to only plans belonging to these product identifiers.

- */ - @java.lang.Override - @JsonSetter(value = "product_ids", nulls = Nulls.SKIP) - public _FinalStage productIds(Optional> productIds) { - this.productIds = productIds; + public Builder createdBefore(String createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); return this; } - @java.lang.Override - public _FinalStage planTypes(String planTypes) { - this.planTypes = Optional.of(Collections.singletonList(planTypes)); + /** + *

Only return plans created after this timestamp.

+ */ + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; return this; } - /** - *

Filter to only plans matching these billing types.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage planTypes(List planTypes) { - this.planTypes = Optional.ofNullable(planTypes); + public Builder createdAfter(String createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); return this; } /** - *

Filter to only plans matching these billing types.

+ *

The number of plans to return (default and max 100).

*/ - @java.lang.Override - @JsonSetter(value = "plan_types", nulls = Nulls.SKIP) - public _FinalStage planTypes(Optional> planTypes) { - this.planTypes = planTypes; + @JsonSetter(value = "first", nulls = Nulls.SKIP) + public Builder first(Optional first) { + this.first = first; return this; } - @java.lang.Override - public _FinalStage visibilities(String visibilities) { - this.visibilities = Optional.of(Collections.singletonList(visibilities)); + public Builder first(Integer first) { + this.first = Optional.ofNullable(first); return this; } /** - *

Filter to only plans matching these visibility states.

- * @return Reference to {@code this} so that method calls can be chained together. + *

A cursor; returns plans after this position.

*/ - @java.lang.Override - public _FinalStage visibilities(List visibilities) { - this.visibilities = Optional.ofNullable(visibilities); + @JsonSetter(value = "after", nulls = Nulls.SKIP) + public Builder after(Optional after) { + this.after = after; + return this; + } + + public Builder after(String after) { + this.after = Optional.ofNullable(after); return this; } /** - *

Filter to only plans matching these visibility states.

+ *

The number of plans to return from the end of the range.

*/ - @java.lang.Override - @JsonSetter(value = "visibilities", nulls = Nulls.SKIP) - public _FinalStage visibilities(Optional> visibilities) { - this.visibilities = visibilities; + @JsonSetter(value = "last", nulls = Nulls.SKIP) + public Builder last(Optional last) { + this.last = last; return this; } - @java.lang.Override - public _FinalStage releaseMethods(String releaseMethods) { - this.releaseMethods = Optional.of(Collections.singletonList(releaseMethods)); + public Builder last(Integer last) { + this.last = Optional.ofNullable(last); return this; } /** - *

Filter to only plans matching these release methods.

- * @return Reference to {@code this} so that method calls can be chained together. + *

A cursor; returns plans before this position.

*/ - @java.lang.Override - public _FinalStage releaseMethods(List releaseMethods) { - this.releaseMethods = Optional.ofNullable(releaseMethods); + @JsonSetter(value = "before", nulls = Nulls.SKIP) + public Builder before(Optional before) { + this.before = before; return this; } - /** - *

Filter to only plans matching these release methods.

- */ - @java.lang.Override - @JsonSetter(value = "release_methods", nulls = Nulls.SKIP) - public _FinalStage releaseMethods(Optional> releaseMethods) { - this.releaseMethods = releaseMethods; + public Builder before(String before) { + this.before = Optional.ofNullable(before); return this; } - @java.lang.Override public ListPlansRequest build() { return new ListPlansRequest( releaseMethods, @@ -697,13 +511,11 @@ public ListPlansRequest build() { additionalProperties); } - @java.lang.Override public Builder additionalProperty(String key, Object value) { this.additionalProperties.put(key, value); return this; } - @java.lang.Override public Builder additionalProperties(Map additionalProperties) { this.additionalProperties.putAll(additionalProperties); return this; diff --git a/src/main/java/com/whop/api/resources/products/AsyncProductsClient.java b/src/main/java/com/whop/api/resources/products/AsyncProductsClient.java index c0194cc9..3918d409 100644 --- a/src/main/java/com/whop/api/resources/products/AsyncProductsClient.java +++ b/src/main/java/com/whop/api/resources/products/AsyncProductsClient.java @@ -36,14 +36,28 @@ public AsyncRawProductsClient withRawResponse() { } /** - * Returns a paginated list of products belonging to an account. + * Returns a paginated list of products. Omit account_id to search the public marketplace. + */ + public CompletableFuture> list() { + return this.rawClient.list().thenApply(response -> response.body()); + } + + /** + * Returns a paginated list of products. Omit account_id to search the public marketplace. + */ + public CompletableFuture> list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).thenApply(response -> response.body()); + } + + /** + * Returns a paginated list of products. Omit account_id to search the public marketplace. */ public CompletableFuture> list(ListProductsRequest request) { return this.rawClient.list(request).thenApply(response -> response.body()); } /** - * Returns a paginated list of products belonging to an account. + * Returns a paginated list of products. Omit account_id to search the public marketplace. */ public CompletableFuture> list( ListProductsRequest request, RequestOptions requestOptions) { @@ -65,28 +79,28 @@ public CompletableFuture create(CreateProductsRequest request, RequestO } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public CompletableFuture retrieve(String id) { return this.rawClient.retrieve(id).thenApply(response -> response.body()); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public CompletableFuture retrieve(String id, RequestOptions requestOptions) { return this.rawClient.retrieve(id, requestOptions).thenApply(response -> response.body()); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public CompletableFuture retrieve(String id, RetrieveProductsRequest request) { return this.rawClient.retrieve(id, request).thenApply(response -> response.body()); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public CompletableFuture retrieve( String id, RetrieveProductsRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/com/whop/api/resources/products/AsyncRawProductsClient.java b/src/main/java/com/whop/api/resources/products/AsyncRawProductsClient.java index 95bcb2a8..5c6173e1 100644 --- a/src/main/java/com/whop/api/resources/products/AsyncRawProductsClient.java +++ b/src/main/java/com/whop/api/resources/products/AsyncRawProductsClient.java @@ -53,7 +53,22 @@ public AsyncRawProductsClient(ClientOptions clientOptions) { } /** - * Returns a paginated list of products belonging to an account. + * Returns a paginated list of products. Omit account_id to search the public marketplace. + */ + public CompletableFuture>> list() { + return list(ListProductsRequest.builder().build()); + } + + /** + * Returns a paginated list of products. Omit account_id to search the public marketplace. + */ + public CompletableFuture>> list( + RequestOptions requestOptions) { + return list(ListProductsRequest.builder().build(), requestOptions); + } + + /** + * Returns a paginated list of products. Omit account_id to search the public marketplace. */ public CompletableFuture>> list( ListProductsRequest request) { @@ -61,14 +76,36 @@ public CompletableFuture } /** - * Returns a paginated list of products belonging to an account. + * Returns a paginated list of products. Omit account_id to search the public marketplace. */ public CompletableFuture>> list( ListProductsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("products"); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getQuery().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "query", request.getQuery().get(), false); + } + if (request.getMarketplaceCategoryRoute().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "marketplace_category_route", + request.getMarketplaceCategoryRoute().get(), + false); + } + if (request.getPriceMinimum().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "price_minimum", request.getPriceMinimum().get(), false); + } + if (request.getPriceMaximum().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "price_maximum", request.getPriceMaximum().get(), false); + } if (request.getDirection().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "direction", request.getDirection().get(), false); @@ -93,6 +130,18 @@ public CompletableFuture QueryStringMapper.addQueryParameter( httpUrl, "before", request.getBefore().get(), false); } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getPlanTypes().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "plan_types", request.getPlanTypes().get(), true); + } if (request.getVisibilities().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "visibilities", request.getVisibilities().get(), true); @@ -266,28 +315,28 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) { } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public CompletableFuture> retrieve(String id) { return retrieve(id, RetrieveProductsRequest.builder().build()); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public CompletableFuture> retrieve(String id, RequestOptions requestOptions) { return retrieve(id, RetrieveProductsRequest.builder().build(), requestOptions); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public CompletableFuture> retrieve(String id, RetrieveProductsRequest request) { return retrieve(id, request, null); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public CompletableFuture> retrieve( String id, RetrieveProductsRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/com/whop/api/resources/products/ProductsClient.java b/src/main/java/com/whop/api/resources/products/ProductsClient.java index c16f2d25..e3c3b995 100644 --- a/src/main/java/com/whop/api/resources/products/ProductsClient.java +++ b/src/main/java/com/whop/api/resources/products/ProductsClient.java @@ -35,14 +35,28 @@ public RawProductsClient withRawResponse() { } /** - * Returns a paginated list of products belonging to an account. + * Returns a paginated list of products. Omit account_id to search the public marketplace. + */ + public SyncPagingIterable list() { + return this.rawClient.list().body(); + } + + /** + * Returns a paginated list of products. Omit account_id to search the public marketplace. + */ + public SyncPagingIterable list(RequestOptions requestOptions) { + return this.rawClient.list(requestOptions).body(); + } + + /** + * Returns a paginated list of products. Omit account_id to search the public marketplace. */ public SyncPagingIterable list(ListProductsRequest request) { return this.rawClient.list(request).body(); } /** - * Returns a paginated list of products belonging to an account. + * Returns a paginated list of products. Omit account_id to search the public marketplace. */ public SyncPagingIterable list(ListProductsRequest request, RequestOptions requestOptions) { return this.rawClient.list(request, requestOptions).body(); @@ -63,28 +77,28 @@ public Product create(CreateProductsRequest request, RequestOptions requestOptio } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public Product retrieve(String id) { return this.rawClient.retrieve(id).body(); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public Product retrieve(String id, RequestOptions requestOptions) { return this.rawClient.retrieve(id, requestOptions).body(); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public Product retrieve(String id, RetrieveProductsRequest request) { return this.rawClient.retrieve(id, request).body(); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public Product retrieve(String id, RetrieveProductsRequest request, RequestOptions requestOptions) { return this.rawClient.retrieve(id, request, requestOptions).body(); diff --git a/src/main/java/com/whop/api/resources/products/RawProductsClient.java b/src/main/java/com/whop/api/resources/products/RawProductsClient.java index d87222fa..56c78f52 100644 --- a/src/main/java/com/whop/api/resources/products/RawProductsClient.java +++ b/src/main/java/com/whop/api/resources/products/RawProductsClient.java @@ -48,21 +48,57 @@ public RawProductsClient(ClientOptions clientOptions) { } /** - * Returns a paginated list of products belonging to an account. + * Returns a paginated list of products. Omit account_id to search the public marketplace. + */ + public WhopApiHttpResponse> list() { + return list(ListProductsRequest.builder().build()); + } + + /** + * Returns a paginated list of products. Omit account_id to search the public marketplace. + */ + public WhopApiHttpResponse> list(RequestOptions requestOptions) { + return list(ListProductsRequest.builder().build(), requestOptions); + } + + /** + * Returns a paginated list of products. Omit account_id to search the public marketplace. */ public WhopApiHttpResponse> list(ListProductsRequest request) { return list(request, null); } /** - * Returns a paginated list of products belonging to an account. + * Returns a paginated list of products. Omit account_id to search the public marketplace. */ public WhopApiHttpResponse> list( ListProductsRequest request, RequestOptions requestOptions) { HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl()) .newBuilder() .addPathSegments("products"); - QueryStringMapper.addQueryParameter(httpUrl, "account_id", request.getAccountId(), false); + if (request.getAccountId().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "account_id", request.getAccountId().get(), false); + } + if (request.getQuery().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "query", request.getQuery().get(), false); + } + if (request.getMarketplaceCategoryRoute().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, + "marketplace_category_route", + request.getMarketplaceCategoryRoute().get(), + false); + } + if (request.getPriceMinimum().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "price_minimum", request.getPriceMinimum().get(), false); + } + if (request.getPriceMaximum().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "price_maximum", request.getPriceMaximum().get(), false); + } if (request.getDirection().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "direction", request.getDirection().get(), false); @@ -87,6 +123,18 @@ public WhopApiHttpResponse> list( QueryStringMapper.addQueryParameter( httpUrl, "before", request.getBefore().get(), false); } + if (request.getCreatedAfter().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_after", request.getCreatedAfter().get(), false); + } + if (request.getCreatedBefore().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "created_before", request.getCreatedBefore().get(), false); + } + if (request.getPlanTypes().isPresent()) { + QueryStringMapper.addQueryParameter( + httpUrl, "plan_types", request.getPlanTypes().get(), true); + } if (request.getVisibilities().isPresent()) { QueryStringMapper.addQueryParameter( httpUrl, "visibilities", request.getVisibilities().get(), true); @@ -218,28 +266,28 @@ public WhopApiHttpResponse create(CreateProductsRequest request, Reques } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public WhopApiHttpResponse retrieve(String id) { return retrieve(id, RetrieveProductsRequest.builder().build()); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public WhopApiHttpResponse retrieve(String id, RequestOptions requestOptions) { return retrieve(id, RetrieveProductsRequest.builder().build(), requestOptions); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public WhopApiHttpResponse retrieve(String id, RetrieveProductsRequest request) { return retrieve(id, request, null); } /** - * Retrieves the details of an existing product. This endpoint is publicly accessible. + * Retrieves a product. Public — no credentials. */ public WhopApiHttpResponse retrieve( String id, RetrieveProductsRequest request, RequestOptions requestOptions) { diff --git a/src/main/java/com/whop/api/resources/products/requests/ListProductsRequest.java b/src/main/java/com/whop/api/resources/products/requests/ListProductsRequest.java index 40d62319..3080e952 100644 --- a/src/main/java/com/whop/api/resources/products/requests/ListProductsRequest.java +++ b/src/main/java/com/whop/api/resources/products/requests/ListProductsRequest.java @@ -13,24 +13,34 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.whop.api.core.ObjectMappers; import com.whop.api.resources.products.types.ListProductsRequestDirection; +import com.whop.api.resources.products.types.ListProductsRequestPlanTypesItem; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; -import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ListProductsRequest.Builder.class) public final class ListProductsRequest { + private final Optional> planTypes; + private final Optional> visibilities; private final Optional> accessPassTypes; private final Optional> labels; - private final String accountId; + private final Optional accountId; + + private final Optional query; + + private final Optional marketplaceCategoryRoute; + + private final Optional priceMinimum; + + private final Optional priceMaximum; private final Optional direction; @@ -44,35 +54,61 @@ public final class ListProductsRequest { private final Optional before; + private final Optional createdAfter; + + private final Optional createdBefore; + private final Map additionalProperties; private ListProductsRequest( + Optional> planTypes, Optional> visibilities, Optional> accessPassTypes, Optional> labels, - String accountId, + Optional accountId, + Optional query, + Optional marketplaceCategoryRoute, + Optional priceMinimum, + Optional priceMaximum, Optional direction, Optional order, Optional first, Optional after, Optional last, Optional before, + Optional createdAfter, + Optional createdBefore, Map additionalProperties) { + this.planTypes = planTypes; this.visibilities = visibilities; this.accessPassTypes = accessPassTypes; this.labels = labels; this.accountId = accountId; + this.query = query; + this.marketplaceCategoryRoute = marketplaceCategoryRoute; + this.priceMinimum = priceMinimum; + this.priceMaximum = priceMaximum; this.direction = direction; this.order = order; this.first = first; this.after = after; this.last = last; this.before = before; + this.createdAfter = createdAfter; + this.createdBefore = createdBefore; this.additionalProperties = additionalProperties; } /** - * @return Filter to only products matching these visibility states. + * @return Filter to products with a buyable plan of these billing models, such as one_time or renewal. + */ + @JsonProperty("plan_types") + public Optional> getPlanTypes() { + return planTypes; + } + + /** + * @return Filter to only products matching these visibility states. Ignored on the public marketplace list, which only returns visible products. */ @JsonProperty("visibilities") public Optional> getVisibilities() { @@ -96,13 +132,45 @@ public Optional> getLabels() { } /** - * @return The unique identifier of the account to list products for. + * @return The unique identifier of the account to list products for. Omit to search the public marketplace. */ @JsonProperty("account_id") - public String getAccountId() { + public Optional getAccountId() { return accountId; } + /** + * @return Ranked search against product title and headline. Omit to browse by recency. + */ + @JsonProperty("query") + public Optional getQuery() { + return query; + } + + /** + * @return Only return marketplace products assigned to this category route, such as trading. + */ + @JsonProperty("marketplace_category_route") + public Optional getMarketplaceCategoryRoute() { + return marketplaceCategoryRoute; + } + + /** + * @return Only return products whose advertised buyable plan has a displayed price of at least this amount. Recurring plans use renewal price. + */ + @JsonProperty("price_minimum") + public Optional getPriceMinimum() { + return priceMinimum; + } + + /** + * @return Only return products whose advertised buyable plan has a displayed price of at most this amount. Recurring plans use renewal price. + */ + @JsonProperty("price_maximum") + public Optional getPriceMaximum() { + return priceMaximum; + } + /** * @return The sort direction for results. Defaults to descending. */ @@ -112,7 +180,7 @@ public Optional getDirection() { } /** - * @return The field to sort results by. Defaults to created_at. + * @return The field to sort results by. Account lists default to created_at. Marketplace lists default to discoverable_at and accept created_at or discoverable_at. Cannot be combined with query. */ @JsonProperty("order") public Optional getOrder() { @@ -151,6 +219,22 @@ public Optional getBefore() { return before; } + /** + * @return Only return products created after this ISO 8601 timestamp. + */ + @JsonProperty("created_after") + public Optional getCreatedAfter() { + return createdAfter; + } + + /** + * @return Only return products created before this ISO 8601 timestamp. + */ + @JsonProperty("created_before") + public Optional getCreatedBefore() { + return createdBefore; + } + @java.lang.Override public boolean equals(Object other) { if (this == other) return true; @@ -163,31 +247,45 @@ public Map getAdditionalProperties() { } private boolean equalTo(ListProductsRequest other) { - return visibilities.equals(other.visibilities) + return planTypes.equals(other.planTypes) + && visibilities.equals(other.visibilities) && accessPassTypes.equals(other.accessPassTypes) && labels.equals(other.labels) && accountId.equals(other.accountId) + && query.equals(other.query) + && marketplaceCategoryRoute.equals(other.marketplaceCategoryRoute) + && priceMinimum.equals(other.priceMinimum) + && priceMaximum.equals(other.priceMaximum) && direction.equals(other.direction) && order.equals(other.order) && first.equals(other.first) && after.equals(other.after) && last.equals(other.last) - && before.equals(other.before); + && before.equals(other.before) + && createdAfter.equals(other.createdAfter) + && createdBefore.equals(other.createdBefore); } @java.lang.Override public int hashCode() { return Objects.hash( + this.planTypes, this.visibilities, this.accessPassTypes, this.labels, this.accountId, + this.query, + this.marketplaceCategoryRoute, + this.priceMinimum, + this.priceMaximum, this.direction, this.order, this.first, this.after, this.last, - this.before); + this.before, + this.createdAfter, + this.createdBefore); } @java.lang.Override @@ -195,371 +293,357 @@ public String toString() { return ObjectMappers.stringify(this); } - public static AccountIdStage builder() { + public static Builder builder() { return new Builder(); } - public interface AccountIdStage { - /** - *

The unique identifier of the account to list products for.

- */ - _FinalStage accountId(@NotNull String accountId); - - Builder from(ListProductsRequest other); - } - - public interface _FinalStage { - ListProductsRequest build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - /** - *

Filter to only products matching these visibility states.

- */ - _FinalStage visibilities(Optional> visibilities); - - _FinalStage visibilities(List visibilities); - - _FinalStage visibilities(String visibilities); - - /** - *

Filter to only products matching these types.

- */ - _FinalStage accessPassTypes(Optional> accessPassTypes); - - _FinalStage accessPassTypes(List accessPassTypes); - - _FinalStage accessPassTypes(String accessPassTypes); - - /** - *

Filter to only products carrying all of these labels. Labels are matched lowercased.

- */ - _FinalStage labels(Optional> labels); - - _FinalStage labels(List labels); - - _FinalStage labels(String labels); - - /** - *

The sort direction for results. Defaults to descending.

- */ - _FinalStage direction(Optional direction); - - _FinalStage direction(ListProductsRequestDirection direction); - - /** - *

The field to sort results by. Defaults to created_at.

- */ - _FinalStage order(Optional order); - - _FinalStage order(String order); - - /** - *

The number of products to return (default and max 100).

- */ - _FinalStage first(Optional first); + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional> planTypes = Optional.empty(); - _FinalStage first(Integer first); + private Optional> visibilities = Optional.empty(); - /** - *

A cursor; returns products after this position.

- */ - _FinalStage after(Optional after); + private Optional> accessPassTypes = Optional.empty(); - _FinalStage after(String after); + private Optional> labels = Optional.empty(); - /** - *

The number of products to return from the end of the range.

- */ - _FinalStage last(Optional last); + private Optional accountId = Optional.empty(); - _FinalStage last(Integer last); + private Optional query = Optional.empty(); - /** - *

A cursor; returns products before this position.

- */ - _FinalStage before(Optional before); + private Optional marketplaceCategoryRoute = Optional.empty(); - _FinalStage before(String before); - } + private Optional priceMinimum = Optional.empty(); - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements AccountIdStage, _FinalStage { - private String accountId; + private Optional priceMaximum = Optional.empty(); - private Optional before = Optional.empty(); - - private Optional last = Optional.empty(); + private Optional direction = Optional.empty(); - private Optional after = Optional.empty(); + private Optional order = Optional.empty(); private Optional first = Optional.empty(); - private Optional order = Optional.empty(); + private Optional after = Optional.empty(); - private Optional direction = Optional.empty(); + private Optional last = Optional.empty(); - private Optional> labels = Optional.empty(); + private Optional before = Optional.empty(); - private Optional> accessPassTypes = Optional.empty(); + private Optional createdAfter = Optional.empty(); - private Optional> visibilities = Optional.empty(); + private Optional createdBefore = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); private Builder() {} - @java.lang.Override public Builder from(ListProductsRequest other) { + planTypes(other.getPlanTypes()); visibilities(other.getVisibilities()); accessPassTypes(other.getAccessPassTypes()); labels(other.getLabels()); accountId(other.getAccountId()); + query(other.getQuery()); + marketplaceCategoryRoute(other.getMarketplaceCategoryRoute()); + priceMinimum(other.getPriceMinimum()); + priceMaximum(other.getPriceMaximum()); direction(other.getDirection()); order(other.getOrder()); first(other.getFirst()); after(other.getAfter()); last(other.getLast()); before(other.getBefore()); + createdAfter(other.getCreatedAfter()); + createdBefore(other.getCreatedBefore()); return this; } /** - *

The unique identifier of the account to list products for.

- *

The unique identifier of the account to list products for.

- * @return Reference to {@code this} so that method calls can be chained together. + *

Filter to products with a buyable plan of these billing models, such as one_time or renewal.

*/ - @java.lang.Override - @JsonSetter("account_id") - public _FinalStage accountId(@NotNull String accountId) { - this.accountId = Objects.requireNonNull(accountId, "accountId must not be null"); + @JsonSetter(value = "plan_types", nulls = Nulls.SKIP) + public Builder planTypes(Optional> planTypes) { + this.planTypes = planTypes; return this; } - /** - *

A cursor; returns products before this position.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage before(String before) { - this.before = Optional.ofNullable(before); + public Builder planTypes(List planTypes) { + this.planTypes = Optional.ofNullable(planTypes); return this; } - /** - *

A cursor; returns products before this position.

- */ - @java.lang.Override - @JsonSetter(value = "before", nulls = Nulls.SKIP) - public _FinalStage before(Optional before) { - this.before = before; + public Builder planTypes(ListProductsRequestPlanTypesItem planTypes) { + this.planTypes = Optional.of(Collections.singletonList(planTypes)); return this; } /** - *

The number of products to return from the end of the range.

- * @return Reference to {@code this} so that method calls can be chained together. + *

Filter to only products matching these visibility states. Ignored on the public marketplace list, which only returns visible products.

*/ - @java.lang.Override - public _FinalStage last(Integer last) { - this.last = Optional.ofNullable(last); + @JsonSetter(value = "visibilities", nulls = Nulls.SKIP) + public Builder visibilities(Optional> visibilities) { + this.visibilities = visibilities; + return this; + } + + public Builder visibilities(List visibilities) { + this.visibilities = Optional.ofNullable(visibilities); + return this; + } + + public Builder visibilities(String visibilities) { + this.visibilities = Optional.of(Collections.singletonList(visibilities)); return this; } /** - *

The number of products to return from the end of the range.

+ *

Filter to only products matching these types.

*/ - @java.lang.Override - @JsonSetter(value = "last", nulls = Nulls.SKIP) - public _FinalStage last(Optional last) { - this.last = last; + @JsonSetter(value = "access_pass_types", nulls = Nulls.SKIP) + public Builder accessPassTypes(Optional> accessPassTypes) { + this.accessPassTypes = accessPassTypes; + return this; + } + + public Builder accessPassTypes(List accessPassTypes) { + this.accessPassTypes = Optional.ofNullable(accessPassTypes); + return this; + } + + public Builder accessPassTypes(String accessPassTypes) { + this.accessPassTypes = Optional.of(Collections.singletonList(accessPassTypes)); return this; } /** - *

A cursor; returns products after this position.

- * @return Reference to {@code this} so that method calls can be chained together. + *

Filter to only products carrying all of these labels. Labels are matched lowercased.

*/ - @java.lang.Override - public _FinalStage after(String after) { - this.after = Optional.ofNullable(after); + @JsonSetter(value = "labels", nulls = Nulls.SKIP) + public Builder labels(Optional> labels) { + this.labels = labels; + return this; + } + + public Builder labels(List labels) { + this.labels = Optional.ofNullable(labels); + return this; + } + + public Builder labels(String labels) { + this.labels = Optional.of(Collections.singletonList(labels)); return this; } /** - *

A cursor; returns products after this position.

+ *

The unique identifier of the account to list products for. Omit to search the public marketplace.

*/ - @java.lang.Override - @JsonSetter(value = "after", nulls = Nulls.SKIP) - public _FinalStage after(Optional after) { - this.after = after; + @JsonSetter(value = "account_id", nulls = Nulls.SKIP) + public Builder accountId(Optional accountId) { + this.accountId = accountId; + return this; + } + + public Builder accountId(String accountId) { + this.accountId = Optional.ofNullable(accountId); return this; } /** - *

The number of products to return (default and max 100).

- * @return Reference to {@code this} so that method calls can be chained together. + *

Ranked search against product title and headline. Omit to browse by recency.

*/ - @java.lang.Override - public _FinalStage first(Integer first) { - this.first = Optional.ofNullable(first); + @JsonSetter(value = "query", nulls = Nulls.SKIP) + public Builder query(Optional query) { + this.query = query; + return this; + } + + public Builder query(String query) { + this.query = Optional.ofNullable(query); return this; } /** - *

The number of products to return (default and max 100).

+ *

Only return marketplace products assigned to this category route, such as trading.

*/ - @java.lang.Override - @JsonSetter(value = "first", nulls = Nulls.SKIP) - public _FinalStage first(Optional first) { - this.first = first; + @JsonSetter(value = "marketplace_category_route", nulls = Nulls.SKIP) + public Builder marketplaceCategoryRoute(Optional marketplaceCategoryRoute) { + this.marketplaceCategoryRoute = marketplaceCategoryRoute; + return this; + } + + public Builder marketplaceCategoryRoute(String marketplaceCategoryRoute) { + this.marketplaceCategoryRoute = Optional.ofNullable(marketplaceCategoryRoute); return this; } /** - *

The field to sort results by. Defaults to created_at.

- * @return Reference to {@code this} so that method calls can be chained together. + *

Only return products whose advertised buyable plan has a displayed price of at least this amount. Recurring plans use renewal price.

*/ - @java.lang.Override - public _FinalStage order(String order) { - this.order = Optional.ofNullable(order); + @JsonSetter(value = "price_minimum", nulls = Nulls.SKIP) + public Builder priceMinimum(Optional priceMinimum) { + this.priceMinimum = priceMinimum; + return this; + } + + public Builder priceMinimum(Double priceMinimum) { + this.priceMinimum = Optional.ofNullable(priceMinimum); return this; } /** - *

The field to sort results by. Defaults to created_at.

+ *

Only return products whose advertised buyable plan has a displayed price of at most this amount. Recurring plans use renewal price.

*/ - @java.lang.Override - @JsonSetter(value = "order", nulls = Nulls.SKIP) - public _FinalStage order(Optional order) { - this.order = order; + @JsonSetter(value = "price_maximum", nulls = Nulls.SKIP) + public Builder priceMaximum(Optional priceMaximum) { + this.priceMaximum = priceMaximum; + return this; + } + + public Builder priceMaximum(Double priceMaximum) { + this.priceMaximum = Optional.ofNullable(priceMaximum); return this; } /** *

The sort direction for results. Defaults to descending.

- * @return Reference to {@code this} so that method calls can be chained together. */ - @java.lang.Override - public _FinalStage direction(ListProductsRequestDirection direction) { + @JsonSetter(value = "direction", nulls = Nulls.SKIP) + public Builder direction(Optional direction) { + this.direction = direction; + return this; + } + + public Builder direction(ListProductsRequestDirection direction) { this.direction = Optional.ofNullable(direction); return this; } /** - *

The sort direction for results. Defaults to descending.

+ *

The field to sort results by. Account lists default to created_at. Marketplace lists default to discoverable_at and accept created_at or discoverable_at. Cannot be combined with query.

*/ - @java.lang.Override - @JsonSetter(value = "direction", nulls = Nulls.SKIP) - public _FinalStage direction(Optional direction) { - this.direction = direction; + @JsonSetter(value = "order", nulls = Nulls.SKIP) + public Builder order(Optional order) { + this.order = order; return this; } - @java.lang.Override - public _FinalStage labels(String labels) { - this.labels = Optional.of(Collections.singletonList(labels)); + public Builder order(String order) { + this.order = Optional.ofNullable(order); return this; } /** - *

Filter to only products carrying all of these labels. Labels are matched lowercased.

- * @return Reference to {@code this} so that method calls can be chained together. + *

The number of products to return (default and max 100).

*/ - @java.lang.Override - public _FinalStage labels(List labels) { - this.labels = Optional.ofNullable(labels); + @JsonSetter(value = "first", nulls = Nulls.SKIP) + public Builder first(Optional first) { + this.first = first; + return this; + } + + public Builder first(Integer first) { + this.first = Optional.ofNullable(first); return this; } /** - *

Filter to only products carrying all of these labels. Labels are matched lowercased.

+ *

A cursor; returns products after this position.

*/ - @java.lang.Override - @JsonSetter(value = "labels", nulls = Nulls.SKIP) - public _FinalStage labels(Optional> labels) { - this.labels = labels; + @JsonSetter(value = "after", nulls = Nulls.SKIP) + public Builder after(Optional after) { + this.after = after; return this; } - @java.lang.Override - public _FinalStage accessPassTypes(String accessPassTypes) { - this.accessPassTypes = Optional.of(Collections.singletonList(accessPassTypes)); + public Builder after(String after) { + this.after = Optional.ofNullable(after); return this; } /** - *

Filter to only products matching these types.

- * @return Reference to {@code this} so that method calls can be chained together. + *

The number of products to return from the end of the range.

*/ - @java.lang.Override - public _FinalStage accessPassTypes(List accessPassTypes) { - this.accessPassTypes = Optional.ofNullable(accessPassTypes); + @JsonSetter(value = "last", nulls = Nulls.SKIP) + public Builder last(Optional last) { + this.last = last; + return this; + } + + public Builder last(Integer last) { + this.last = Optional.ofNullable(last); return this; } /** - *

Filter to only products matching these types.

+ *

A cursor; returns products before this position.

*/ - @java.lang.Override - @JsonSetter(value = "access_pass_types", nulls = Nulls.SKIP) - public _FinalStage accessPassTypes(Optional> accessPassTypes) { - this.accessPassTypes = accessPassTypes; + @JsonSetter(value = "before", nulls = Nulls.SKIP) + public Builder before(Optional before) { + this.before = before; return this; } - @java.lang.Override - public _FinalStage visibilities(String visibilities) { - this.visibilities = Optional.of(Collections.singletonList(visibilities)); + public Builder before(String before) { + this.before = Optional.ofNullable(before); return this; } /** - *

Filter to only products matching these visibility states.

- * @return Reference to {@code this} so that method calls can be chained together. + *

Only return products created after this ISO 8601 timestamp.

*/ - @java.lang.Override - public _FinalStage visibilities(List visibilities) { - this.visibilities = Optional.ofNullable(visibilities); + @JsonSetter(value = "created_after", nulls = Nulls.SKIP) + public Builder createdAfter(Optional createdAfter) { + this.createdAfter = createdAfter; + return this; + } + + public Builder createdAfter(String createdAfter) { + this.createdAfter = Optional.ofNullable(createdAfter); return this; } /** - *

Filter to only products matching these visibility states.

+ *

Only return products created before this ISO 8601 timestamp.

*/ - @java.lang.Override - @JsonSetter(value = "visibilities", nulls = Nulls.SKIP) - public _FinalStage visibilities(Optional> visibilities) { - this.visibilities = visibilities; + @JsonSetter(value = "created_before", nulls = Nulls.SKIP) + public Builder createdBefore(Optional createdBefore) { + this.createdBefore = createdBefore; + return this; + } + + public Builder createdBefore(String createdBefore) { + this.createdBefore = Optional.ofNullable(createdBefore); return this; } - @java.lang.Override public ListProductsRequest build() { return new ListProductsRequest( + planTypes, visibilities, accessPassTypes, labels, accountId, + query, + marketplaceCategoryRoute, + priceMinimum, + priceMaximum, direction, order, first, after, last, before, + createdAfter, + createdBefore, additionalProperties); } - @java.lang.Override public Builder additionalProperty(String key, Object value) { this.additionalProperties.put(key, value); return this; } - @java.lang.Override public Builder additionalProperties(Map additionalProperties) { this.additionalProperties.putAll(additionalProperties); return this; diff --git a/src/main/java/com/whop/api/resources/products/types/ListProductsRequestPlanTypesItem.java b/src/main/java/com/whop/api/resources/products/types/ListProductsRequestPlanTypesItem.java new file mode 100644 index 00000000..6e248805 --- /dev/null +++ b/src/main/java/com/whop/api/resources/products/types/ListProductsRequestPlanTypesItem.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.resources.products.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ListProductsRequestPlanTypesItem { + public static final ListProductsRequestPlanTypesItem RENEWAL = + new ListProductsRequestPlanTypesItem(Value.RENEWAL, "renewal"); + + public static final ListProductsRequestPlanTypesItem ONE_TIME = + new ListProductsRequestPlanTypesItem(Value.ONE_TIME, "one_time"); + + private final Value value; + + private final String string; + + ListProductsRequestPlanTypesItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ListProductsRequestPlanTypesItem + && this.string.equals(((ListProductsRequestPlanTypesItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RENEWAL: + return visitor.visitRenewal(); + case ONE_TIME: + return visitor.visitOneTime(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ListProductsRequestPlanTypesItem valueOf(String value) { + switch (value) { + case "renewal": + return RENEWAL; + case "one_time": + return ONE_TIME; + default: + return new ListProductsRequestPlanTypesItem(Value.UNKNOWN, value); + } + } + + public enum Value { + RENEWAL, + + ONE_TIME, + + UNKNOWN + } + + public interface Visitor { + T visitRenewal(); + + T visitOneTime(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/Account.java b/src/main/java/com/whop/api/types/Account.java index 12da4ed2..8af25317 100644 --- a/src/main/java/com/whop/api/types/Account.java +++ b/src/main/java/com/whop/api/types/Account.java @@ -55,6 +55,8 @@ public final class Account { private final Optional email; + private final Optional eula; + private final List homePreferences; private final String id; @@ -85,6 +87,8 @@ public final class Account { private final Optional paymentControls; + private final Optional privacyPolicy; + private final Optional> productTaxCode; private final Optional> recommendedActions; @@ -93,6 +97,8 @@ public final class Account { private final Optional> requiredActions; + private final Optional returnPolicy; + private final String route; private final boolean sendCustomerEmails; @@ -123,6 +129,8 @@ public final class Account { private final Optional taxType; + private final Optional termsOfService; + private final Optional threeDsLevel; private final String title; @@ -156,6 +164,7 @@ private Account( String createdAt, Optional description, Optional email, + Optional eula, List homePreferences, String id, Optional industryGroup, @@ -171,10 +180,12 @@ private Account( UserSummary owner, Optional parentAccount, Optional paymentControls, + Optional privacyPolicy, Optional> productTaxCode, Optional> recommendedActions, boolean require2Fa, Optional> requiredActions, + Optional returnPolicy, String route, boolean sendCustomerEmails, boolean showJoinedWhops, @@ -190,6 +201,7 @@ private Account( List taxIdentifiers, Optional taxRemittedBy, Optional taxType, + Optional termsOfService, Optional threeDsLevel, String title, Optional totalEarnedUsd, @@ -213,6 +225,7 @@ private Account( this.createdAt = createdAt; this.description = description; this.email = email; + this.eula = eula; this.homePreferences = homePreferences; this.id = id; this.industryGroup = industryGroup; @@ -228,10 +241,12 @@ private Account( this.owner = owner; this.parentAccount = parentAccount; this.paymentControls = paymentControls; + this.privacyPolicy = privacyPolicy; this.productTaxCode = productTaxCode; this.recommendedActions = recommendedActions; this.require2Fa = require2Fa; this.requiredActions = requiredActions; + this.returnPolicy = returnPolicy; this.route = route; this.sendCustomerEmails = sendCustomerEmails; this.showJoinedWhops = showJoinedWhops; @@ -247,6 +262,7 @@ private Account( this.taxIdentifiers = taxIdentifiers; this.taxRemittedBy = taxRemittedBy; this.taxType = taxType; + this.termsOfService = termsOfService; this.threeDsLevel = threeDsLevel; this.title = title; this.totalEarnedUsd = totalEarnedUsd; @@ -394,6 +410,17 @@ public Optional getEmail() { return email; } + /** + * @return The account's end-user license agreement document, or null if they have not published one. + */ + @JsonIgnore + public Optional getEula() { + if (eula == null) { + return Optional.empty(); + } + return eula; + } + @JsonProperty("home_preferences") public List getHomePreferences() { return homePreferences; @@ -544,6 +571,17 @@ public Optional getPaymentControls() { return paymentControls; } + /** + * @return The account's privacy policy document, or null if they have not published one. + */ + @JsonIgnore + public Optional getPrivacyPolicy() { + if (privacyPolicy == null) { + return Optional.empty(); + } + return privacyPolicy; + } + /** * @return Tax classification code applied by default to the account's products, with id, name, and product_type. null when no default is set. */ @@ -582,6 +620,17 @@ public Optional> getRequiredActions() { return requiredActions; } + /** + * @return The account's return policy document, or null if they have not published one. + */ + @JsonIgnore + public Optional getReturnPolicy() { + if (returnPolicy == null) { + return Optional.empty(); + } + return returnPolicy; + } + /** * @return Account public route identifier. */ @@ -708,6 +757,17 @@ public Optional getTaxType() { return taxType; } + /** + * @return The account's terms of service document, or null if they have not published one. + */ + @JsonIgnore + public Optional getTermsOfService() { + if (termsOfService == null) { + return Optional.empty(); + } + return termsOfService; + } + /** * @return Account-level 3D Secure behavior. mandate_challenge requires cardholder verification on supported card payments; null uses the standard checkout flow. */ @@ -841,6 +901,12 @@ private Optional _getEmail() { return email; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("eula") + private Optional _getEula() { + return eula; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("industry_group") private Optional _getIndustryGroup() { @@ -907,6 +973,12 @@ private Optional _getPaymentControls() { return paymentControls; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("privacy_policy") + private Optional _getPrivacyPolicy() { + return privacyPolicy; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("product_tax_code") private Optional> _getProductTaxCode() { @@ -925,6 +997,12 @@ private Optional> _getRequiredActions() { return requiredActions; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("return_policy") + private Optional _getReturnPolicy() { + return returnPolicy; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("status") private Optional _getStatus() { @@ -955,6 +1033,12 @@ private Optional _getTaxType() { return taxType; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("terms_of_service") + private Optional _getTermsOfService() { + return termsOfService; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("three_ds_level") private Optional _getThreeDsLevel() { @@ -1011,6 +1095,7 @@ private boolean equalTo(Account other) { && createdAt.equals(other.createdAt) && description.equals(other.description) && email.equals(other.email) + && eula.equals(other.eula) && homePreferences.equals(other.homePreferences) && id.equals(other.id) && industryGroup.equals(other.industryGroup) @@ -1026,10 +1111,12 @@ private boolean equalTo(Account other) { && owner.equals(other.owner) && parentAccount.equals(other.parentAccount) && paymentControls.equals(other.paymentControls) + && privacyPolicy.equals(other.privacyPolicy) && productTaxCode.equals(other.productTaxCode) && recommendedActions.equals(other.recommendedActions) && require2Fa == other.require2Fa && requiredActions.equals(other.requiredActions) + && returnPolicy.equals(other.returnPolicy) && route.equals(other.route) && sendCustomerEmails == other.sendCustomerEmails && showJoinedWhops == other.showJoinedWhops @@ -1045,6 +1132,7 @@ private boolean equalTo(Account other) { && taxIdentifiers.equals(other.taxIdentifiers) && taxRemittedBy.equals(other.taxRemittedBy) && taxType.equals(other.taxType) + && termsOfService.equals(other.termsOfService) && threeDsLevel.equals(other.threeDsLevel) && title.equals(other.title) && totalEarnedUsd.equals(other.totalEarnedUsd) @@ -1072,6 +1160,7 @@ public int hashCode() { this.createdAt, this.description, this.email, + this.eula, this.homePreferences, this.id, this.industryGroup, @@ -1087,10 +1176,12 @@ public int hashCode() { this.owner, this.parentAccount, this.paymentControls, + this.privacyPolicy, this.productTaxCode, this.recommendedActions, this.require2Fa, this.requiredActions, + this.returnPolicy, this.route, this.sendCustomerEmails, this.showJoinedWhops, @@ -1106,6 +1197,7 @@ public int hashCode() { this.taxIdentifiers, this.taxRemittedBy, this.taxType, + this.termsOfService, this.threeDsLevel, this.title, this.totalEarnedUsd, @@ -1333,6 +1425,15 @@ public interface _FinalStage { _FinalStage email(Nullable email); + /** + *

The account's end-user license agreement document, or null if they have not published one.

+ */ + _FinalStage eula(Optional eula); + + _FinalStage eula(File eula); + + _FinalStage eula(Nullable eula); + _FinalStage homePreferences(List homePreferences); _FinalStage addHomePreferences(AccountHomePreferencesItem homePreferences); @@ -1447,6 +1548,15 @@ public interface _FinalStage { _FinalStage paymentControls(Nullable paymentControls); + /** + *

The account's privacy policy document, or null if they have not published one.

+ */ + _FinalStage privacyPolicy(Optional privacyPolicy); + + _FinalStage privacyPolicy(File privacyPolicy); + + _FinalStage privacyPolicy(Nullable privacyPolicy); + /** *

Tax classification code applied by default to the account's products, with id, name, and product_type. null when no default is set.

*/ @@ -1471,6 +1581,15 @@ public interface _FinalStage { _FinalStage requiredActions(Nullable> requiredActions); + /** + *

The account's return policy document, or null if they have not published one.

+ */ + _FinalStage returnPolicy(Optional returnPolicy); + + _FinalStage returnPolicy(File returnPolicy); + + _FinalStage returnPolicy(Nullable returnPolicy); + _FinalStage socialLinks(List socialLinks); _FinalStage addSocialLinks(AccountSocialLink socialLinks); @@ -1534,6 +1653,15 @@ public interface _FinalStage { _FinalStage taxType(Nullable taxType); + /** + *

The account's terms of service document, or null if they have not published one.

+ */ + _FinalStage termsOfService(Optional termsOfService); + + _FinalStage termsOfService(File termsOfService); + + _FinalStage termsOfService(Nullable termsOfService); + /** *

Account-level 3D Secure behavior. mandate_challenge requires cardholder verification on supported card payments; null uses the standard checkout flow.

*/ @@ -1652,6 +1780,8 @@ public static final class Builder private Optional threeDsLevel = Optional.empty(); + private Optional termsOfService = Optional.empty(); + private Optional taxType = Optional.empty(); private Optional taxRemittedBy = Optional.empty(); @@ -1668,12 +1798,16 @@ public static final class Builder private List socialLinks = new ArrayList<>(); + private Optional returnPolicy = Optional.empty(); + private Optional> requiredActions = Optional.empty(); private Optional> recommendedActions = Optional.empty(); private Optional> productTaxCode = Optional.empty(); + private Optional privacyPolicy = Optional.empty(); + private Optional paymentControls = Optional.empty(); private Optional parentAccount = Optional.empty(); @@ -1700,6 +1834,8 @@ public static final class Builder private List homePreferences = new ArrayList<>(); + private Optional eula = Optional.empty(); + private Optional email = Optional.empty(); private Optional description = Optional.empty(); @@ -1741,6 +1877,7 @@ public Builder from(Account other) { createdAt(other.getCreatedAt()); description(other.getDescription()); email(other.getEmail()); + eula(other.getEula()); homePreferences(other.getHomePreferences()); id(other.getId()); industryGroup(other.getIndustryGroup()); @@ -1756,10 +1893,12 @@ public Builder from(Account other) { owner(other.getOwner()); parentAccount(other.getParentAccount()); paymentControls(other.getPaymentControls()); + privacyPolicy(other.getPrivacyPolicy()); productTaxCode(other.getProductTaxCode()); recommendedActions(other.getRecommendedActions()); require2Fa(other.getRequire2Fa()); requiredActions(other.getRequiredActions()); + returnPolicy(other.getReturnPolicy()); route(other.getRoute()); sendCustomerEmails(other.getSendCustomerEmails()); showJoinedWhops(other.getShowJoinedWhops()); @@ -1775,6 +1914,7 @@ public Builder from(Account other) { taxIdentifiers(other.getTaxIdentifiers()); taxRemittedBy(other.getTaxRemittedBy()); taxType(other.getTaxType()); + termsOfService(other.getTermsOfService()); threeDsLevel(other.getThreeDsLevel()); title(other.getTitle()); totalEarnedUsd(other.getTotalEarnedUsd()); @@ -2193,6 +2333,42 @@ public _FinalStage threeDsLevel(Optional threeDsLevel) { return this; } + /** + *

The account's terms of service document, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage termsOfService(Nullable termsOfService) { + if (termsOfService.isNull()) { + this.termsOfService = null; + } else if (termsOfService.isEmpty()) { + this.termsOfService = Optional.empty(); + } else { + this.termsOfService = Optional.of(termsOfService.get()); + } + return this; + } + + /** + *

The account's terms of service document, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage termsOfService(File termsOfService) { + this.termsOfService = Optional.ofNullable(termsOfService); + return this; + } + + /** + *

The account's terms of service document, or null if they have not published one.

+ */ + @java.lang.Override + @JsonSetter(value = "terms_of_service", nulls = Nulls.SKIP) + public _FinalStage termsOfService(Optional termsOfService) { + this.termsOfService = termsOfService; + return this; + } + /** *

How tax is applied to the account's prices: inclusive (tax included in the listed price) or exclusive (tax added on top). Defaults to exclusive when unset; null only when the account has no payment connection.

* @return Reference to {@code this} so that method calls can be chained together. @@ -2445,6 +2621,42 @@ public _FinalStage socialLinks(List socialLinks) { return this; } + /** + *

The account's return policy document, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage returnPolicy(Nullable returnPolicy) { + if (returnPolicy.isNull()) { + this.returnPolicy = null; + } else if (returnPolicy.isEmpty()) { + this.returnPolicy = Optional.empty(); + } else { + this.returnPolicy = Optional.of(returnPolicy.get()); + } + return this; + } + + /** + *

The account's return policy document, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage returnPolicy(File returnPolicy) { + this.returnPolicy = Optional.ofNullable(returnPolicy); + return this; + } + + /** + *

The account's return policy document, or null if they have not published one.

+ */ + @java.lang.Override + @JsonSetter(value = "return_policy", nulls = Nulls.SKIP) + public _FinalStage returnPolicy(Optional returnPolicy) { + this.returnPolicy = returnPolicy; + return this; + } + @java.lang.Override public _FinalStage requiredActions(Nullable> requiredActions) { if (requiredActions.isNull()) { @@ -2542,6 +2754,42 @@ public _FinalStage productTaxCode(Optional> productTaxCode) return this; } + /** + *

The account's privacy policy document, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage privacyPolicy(Nullable privacyPolicy) { + if (privacyPolicy.isNull()) { + this.privacyPolicy = null; + } else if (privacyPolicy.isEmpty()) { + this.privacyPolicy = Optional.empty(); + } else { + this.privacyPolicy = Optional.of(privacyPolicy.get()); + } + return this; + } + + /** + *

The account's privacy policy document, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage privacyPolicy(File privacyPolicy) { + this.privacyPolicy = Optional.ofNullable(privacyPolicy); + return this; + } + + /** + *

The account's privacy policy document, or null if they have not published one.

+ */ + @java.lang.Override + @JsonSetter(value = "privacy_policy", nulls = Nulls.SKIP) + public _FinalStage privacyPolicy(Optional privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + /** *

Payment health controls currently applied to the account. Computed only on retrieve and me for callers with company:balance:read scope; null otherwise.

* @return Reference to {@code this} so that method calls can be chained together. @@ -2997,6 +3245,42 @@ public _FinalStage homePreferences(List homePreferen return this; } + /** + *

The account's end-user license agreement document, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage eula(Nullable eula) { + if (eula.isNull()) { + this.eula = null; + } else if (eula.isEmpty()) { + this.eula = Optional.empty(); + } else { + this.eula = Optional.of(eula.get()); + } + return this; + } + + /** + *

The account's end-user license agreement document, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage eula(File eula) { + this.eula = Optional.ofNullable(eula); + return this; + } + + /** + *

The account's end-user license agreement document, or null if they have not published one.

+ */ + @java.lang.Override + @JsonSetter(value = "eula", nulls = Nulls.SKIP) + public _FinalStage eula(Optional eula) { + this.eula = eula; + return this; + } + /** *

Account owner email address.

* @return Reference to {@code this} so that method calls can be chained together. @@ -3362,6 +3646,7 @@ public Account build() { createdAt, description, email, + eula, homePreferences, id, industryGroup, @@ -3377,10 +3662,12 @@ public Account build() { owner, parentAccount, paymentControls, + privacyPolicy, productTaxCode, recommendedActions, require2Fa, requiredActions, + returnPolicy, route, sendCustomerEmails, showJoinedWhops, @@ -3396,6 +3683,7 @@ public Account build() { taxIdentifiers, taxRemittedBy, taxType, + termsOfService, threeDsLevel, title, totalEarnedUsd, diff --git a/src/main/java/com/whop/api/types/AdGroup.java b/src/main/java/com/whop/api/types/AdGroup.java index e2881bab..4b5f0989 100644 --- a/src/main/java/com/whop/api/types/AdGroup.java +++ b/src/main/java/com/whop/api/types/AdGroup.java @@ -640,7 +640,7 @@ public Optional getDesiredCostPerResult() { } /** - * @return Interest, behavior, and demographic targeting, using categories from the ad platform's targeting taxonomy. Entries across interests, behaviors, and demographics are OR'd together (anyone matching any entry is reached), matching Ads Manager's detailed-targeting box. Can't be combined with automatic audience targeting, and unavailable to campaigns with special_ad_categories. + * @return Interest, behavior, and demographic targeting, using categories from the ad platform's targeting taxonomy. Entries across interests, behaviors, and demographics are OR'd together (anyone matching any entry is reached), matching Ads Manager's detailed-targeting box. Can't be combined with automatic audience targeting. Special ad category campaigns are limited to approved interests. */ @JsonProperty("detailed_targeting") public AdGroupDetailedTargeting getDetailedTargeting() { @@ -1423,7 +1423,7 @@ public interface DemographicsStage { public interface DetailedTargetingStage { /** - *

Interest, behavior, and demographic targeting, using categories from the ad platform's targeting taxonomy. Entries across interests, behaviors, and demographics are OR'd together (anyone matching any entry is reached), matching Ads Manager's detailed-targeting box. Can't be combined with automatic audience targeting, and unavailable to campaigns with special_ad_categories.

+ *

Interest, behavior, and demographic targeting, using categories from the ad platform's targeting taxonomy. Entries across interests, behaviors, and demographics are OR'd together (anyone matching any entry is reached), matching Ads Manager's detailed-targeting box. Can't be combined with automatic audience targeting. Special ad category campaigns are limited to approved interests.

*/ DevicesStage detailedTargeting(@NotNull AdGroupDetailedTargeting detailedTargeting); } @@ -2331,8 +2331,8 @@ public DetailedTargetingStage demographics(@NotNull AdGroupDemographics demograp } /** - *

Interest, behavior, and demographic targeting, using categories from the ad platform's targeting taxonomy. Entries across interests, behaviors, and demographics are OR'd together (anyone matching any entry is reached), matching Ads Manager's detailed-targeting box. Can't be combined with automatic audience targeting, and unavailable to campaigns with special_ad_categories.

- *

Interest, behavior, and demographic targeting, using categories from the ad platform's targeting taxonomy. Entries across interests, behaviors, and demographics are OR'd together (anyone matching any entry is reached), matching Ads Manager's detailed-targeting box. Can't be combined with automatic audience targeting, and unavailable to campaigns with special_ad_categories.

+ *

Interest, behavior, and demographic targeting, using categories from the ad platform's targeting taxonomy. Entries across interests, behaviors, and demographics are OR'd together (anyone matching any entry is reached), matching Ads Manager's detailed-targeting box. Can't be combined with automatic audience targeting. Special ad category campaigns are limited to approved interests.

+ *

Interest, behavior, and demographic targeting, using categories from the ad platform's targeting taxonomy. Entries across interests, behaviors, and demographics are OR'd together (anyone matching any entry is reached), matching Ads Manager's detailed-targeting box. Can't be combined with automatic audience targeting. Special ad category campaigns are limited to approved interests.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override diff --git a/src/main/java/com/whop/api/types/AdGroupGeoLocationsBody.java b/src/main/java/com/whop/api/types/AdGroupGeoLocationsBody.java index 8098cda0..1c9409ce 100644 --- a/src/main/java/com/whop/api/types/AdGroupGeoLocationsBody.java +++ b/src/main/java/com/whop/api/types/AdGroupGeoLocationsBody.java @@ -93,7 +93,7 @@ public Optional> getRegions() { } /** - * @return ZIP and postal codes, as bare strings or objects with a key. + * @return ZIP and postal codes, keyed by the ad platform's location taxonomy. Meta keys these COUNTRY:CODE, as US:78756 — a bare code is ambiguous, because the same one exists in several countries. TikTok takes the bare code. */ @JsonProperty("zips") public Optional> getZips() { @@ -235,7 +235,7 @@ public Builder regions(List regions) { } /** - *

ZIP and postal codes, as bare strings or objects with a key.

+ *

ZIP and postal codes, keyed by the ad platform's location taxonomy. Meta keys these COUNTRY:CODE, as US:78756 — a bare code is ambiguous, because the same one exists in several countries. TikTok takes the bare code.

*/ @JsonSetter(value = "zips", nulls = Nulls.SKIP) public Builder zips(Optional> zips) { diff --git a/src/main/java/com/whop/api/types/AdGroupGeoLocationsBodyZipsItemKey.java b/src/main/java/com/whop/api/types/AdGroupGeoLocationsBodyZipsItemKey.java index b08f4b94..ac57b863 100644 --- a/src/main/java/com/whop/api/types/AdGroupGeoLocationsBodyZipsItemKey.java +++ b/src/main/java/com/whop/api/types/AdGroupGeoLocationsBodyZipsItemKey.java @@ -29,7 +29,7 @@ private AdGroupGeoLocationsBodyZipsItemKey(String key, Map addit } /** - * @return The ZIP or postal code. + * @return The ad platform's key for the ZIP or postal code. */ @JsonProperty("key") public String getKey() { @@ -68,7 +68,7 @@ public static KeyStage builder() { public interface KeyStage { /** - *

The ZIP or postal code.

+ *

The ad platform's key for the ZIP or postal code.

*/ _FinalStage key(@NotNull String key); @@ -99,8 +99,8 @@ public Builder from(AdGroupGeoLocationsBodyZipsItemKey other) { } /** - *

The ZIP or postal code.

- *

The ZIP or postal code.

+ *

The ad platform's key for the ZIP or postal code.

+ *

The ad platform's key for the ZIP or postal code.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override diff --git a/src/main/java/com/whop/api/types/ApiKeyApiVersionDate.java b/src/main/java/com/whop/api/types/ApiKeyApiVersionDate.java index 72afdeee..a3f5ce5c 100644 --- a/src/main/java/com/whop/api/types/ApiKeyApiVersionDate.java +++ b/src/main/java/com/whop/api/types/ApiKeyApiVersionDate.java @@ -31,6 +31,9 @@ public final class ApiKeyApiVersionDate { public static final ApiKeyApiVersionDate TWO_THOUSAND_TWENTY_SIX0620 = new ApiKeyApiVersionDate(Value.TWO_THOUSAND_TWENTY_SIX0620, "2026-06-20"); + public static final ApiKeyApiVersionDate TWO_THOUSAND_TWENTY_SIX08211 = + new ApiKeyApiVersionDate(Value.TWO_THOUSAND_TWENTY_SIX08211, "2026-08-21-1"); + public static final ApiKeyApiVersionDate TWO_THOUSAND_TWENTY_FIVE0101 = new ApiKeyApiVersionDate(Value.TWO_THOUSAND_TWENTY_FIVE0101, "2025-01-01"); @@ -130,6 +133,8 @@ public T visit(Visitor visitor) { return visitor.visitTwoThousandTwentySix0803(); case TWO_THOUSAND_TWENTY_SIX0620: return visitor.visitTwoThousandTwentySix0620(); + case TWO_THOUSAND_TWENTY_SIX08211: + return visitor.visitTwoThousandTwentySix08211(); case TWO_THOUSAND_TWENTY_FIVE0101: return visitor.visitTwoThousandTwentyFive0101(); case TWO_THOUSAND_TWENTY_SIX07081: @@ -189,6 +194,8 @@ public static ApiKeyApiVersionDate valueOf(String value) { return TWO_THOUSAND_TWENTY_SIX0803; case "2026-06-20": return TWO_THOUSAND_TWENTY_SIX0620; + case "2026-08-21-1": + return TWO_THOUSAND_TWENTY_SIX08211; case "2025-01-01": return TWO_THOUSAND_TWENTY_FIVE0101; case "2026-07-08-1": @@ -279,6 +286,8 @@ public enum Value { TWO_THOUSAND_TWENTY_SIX0821, + TWO_THOUSAND_TWENTY_SIX08211, + UNKNOWN } @@ -333,6 +342,8 @@ public interface Visitor { T visitTwoThousandTwentySix0821(); + T visitTwoThousandTwentySix08211(); + T visitUnknown(String unknownType); } } diff --git a/src/main/java/com/whop/api/types/App.java b/src/main/java/com/whop/api/types/App.java index 6b949a37..38f6855f 100644 --- a/src/main/java/com/whop/api/types/App.java +++ b/src/main/java/com/whop/api/types/App.java @@ -56,6 +56,8 @@ public final class App { private final String domainId; + private final List elementsUsed; + private final Optional experiencePath; private final Optional hostedUrl; @@ -116,6 +118,7 @@ private App( Optional description, Optional discoverPath, String domainId, + List elementsUsed, Optional experiencePath, Optional hostedUrl, AppIcon icon, @@ -153,6 +156,7 @@ private App( this.description = description; this.discoverPath = discoverPath; this.domainId = domainId; + this.elementsUsed = elementsUsed; this.experiencePath = experiencePath; this.hostedUrl = hostedUrl; this.icon = icon; @@ -321,6 +325,11 @@ public String getDomainId() { return domainId; } + @JsonProperty("elements_used") + public List getElementsUsed() { + return elementsUsed; + } + /** * @return URL path for the member-facing hub view, or null when not configured. */ @@ -669,6 +678,7 @@ private boolean equalTo(App other) { && description.equals(other.description) && discoverPath.equals(other.discoverPath) && domainId.equals(other.domainId) + && elementsUsed.equals(other.elementsUsed) && experiencePath.equals(other.experiencePath) && hostedUrl.equals(other.hostedUrl) && icon.equals(other.icon) @@ -710,6 +720,7 @@ public int hashCode() { this.description, this.discoverPath, this.domainId, + this.elementsUsed, this.experiencePath, this.hostedUrl, this.icon, @@ -915,6 +926,12 @@ public interface _FinalStage { _FinalStage discoverPath(Nullable discoverPath); + _FinalStage elementsUsed(List elementsUsed); + + _FinalStage addElementsUsed(AppElementsUsedItem elementsUsed); + + _FinalStage addAllElementsUsed(List elementsUsed); + /** *

URL path for the member-facing hub view, or null when not configured.

*/ @@ -1108,6 +1125,8 @@ public static final class Builder private Optional experiencePath = Optional.empty(); + private List elementsUsed = new ArrayList<>(); + private Optional discoverPath = Optional.empty(); private Optional description = Optional.empty(); @@ -1150,6 +1169,7 @@ public Builder from(App other) { description(other.getDescription()); discoverPath(other.getDiscoverPath()); domainId(other.getDomainId()); + elementsUsed(other.getElementsUsed()); experiencePath(other.getExperiencePath()); hostedUrl(other.getHostedUrl()); icon(other.getIcon()); @@ -1810,6 +1830,30 @@ public _FinalStage experiencePath(Optional experiencePath) { return this; } + @java.lang.Override + public _FinalStage addAllElementsUsed(List elementsUsed) { + if (elementsUsed != null) { + this.elementsUsed.addAll(elementsUsed); + } + return this; + } + + @java.lang.Override + public _FinalStage addElementsUsed(AppElementsUsedItem elementsUsed) { + this.elementsUsed.add(elementsUsed); + return this; + } + + @java.lang.Override + @JsonSetter(value = "elements_used", nulls = Nulls.SKIP) + public _FinalStage elementsUsed(List elementsUsed) { + this.elementsUsed.clear(); + if (elementsUsed != null) { + this.elementsUsed.addAll(elementsUsed); + } + return this; + } + /** *

URL path for the discover view, or null when not configured.

* @return Reference to {@code this} so that method calls can be chained together. @@ -2176,6 +2220,7 @@ public App build() { description, discoverPath, domainId, + elementsUsed, experiencePath, hostedUrl, icon, diff --git a/src/main/java/com/whop/api/types/AppElementsUsedItem.java b/src/main/java/com/whop/api/types/AppElementsUsedItem.java new file mode 100644 index 00000000..2bbaf858 --- /dev/null +++ b/src/main/java/com/whop/api/types/AppElementsUsedItem.java @@ -0,0 +1,440 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class AppElementsUsedItem { + public static final AppElementsUsedItem ADS_CAMPAIGN_CREATOR = + new AppElementsUsedItem(Value.ADS_CAMPAIGN_CREATOR, "ads.campaign-creator"); + + public static final AppElementsUsedItem ADS_REPORTING = + new AppElementsUsedItem(Value.ADS_REPORTING, "ads.reporting"); + + public static final AppElementsUsedItem WALLET_WITHDRAW = + new AppElementsUsedItem(Value.WALLET_WITHDRAW, "wallet.withdraw"); + + public static final AppElementsUsedItem PAYMENTS_BRANDING = + new AppElementsUsedItem(Value.PAYMENTS_BRANDING, "payments.branding"); + + public static final AppElementsUsedItem PAYMENTS_CARD = + new AppElementsUsedItem(Value.PAYMENTS_CARD, "payments.card"); + + public static final AppElementsUsedItem WALLET_SEND = new AppElementsUsedItem(Value.WALLET_SEND, "wallet.send"); + + public static final AppElementsUsedItem CHECKOUT_CHECKOUT = + new AppElementsUsedItem(Value.CHECKOUT_CHECKOUT, "checkout.checkout"); + + public static final AppElementsUsedItem PAYMENTS_CARD_FIELDS_CARD_CVC = + new AppElementsUsedItem(Value.PAYMENTS_CARD_FIELDS_CARD_CVC, "payments.cardFields.cardCvc"); + + public static final AppElementsUsedItem ADS_BILLING_SETUP = + new AppElementsUsedItem(Value.ADS_BILLING_SETUP, "ads.billing-setup"); + + public static final AppElementsUsedItem WALLET_BALANCES_LIST = + new AppElementsUsedItem(Value.WALLET_BALANCES_LIST, "wallet.balances.list"); + + public static final AppElementsUsedItem WALLET_CARDS = new AppElementsUsedItem(Value.WALLET_CARDS, "wallet.cards"); + + public static final AppElementsUsedItem PAYMENTS_PAYMENT = + new AppElementsUsedItem(Value.PAYMENTS_PAYMENT, "payments.payment"); + + public static final AppElementsUsedItem WEBSITES_PIXEL_SETUP = + new AppElementsUsedItem(Value.WEBSITES_PIXEL_SETUP, "websites.pixel-setup"); + + public static final AppElementsUsedItem WALLET_ACTIVITY = + new AppElementsUsedItem(Value.WALLET_ACTIVITY, "wallet.activity"); + + public static final AppElementsUsedItem WALLET_BALANCES_BALANCE = + new AppElementsUsedItem(Value.WALLET_BALANCES_BALANCE, "wallet.balances.balance"); + + public static final AppElementsUsedItem ADS_REPORTING_TABLE = + new AppElementsUsedItem(Value.ADS_REPORTING_TABLE, "ads.reporting.table"); + + public static final AppElementsUsedItem PAYMENTS_CARD_FIELDS_CARD_EXPIRY = + new AppElementsUsedItem(Value.PAYMENTS_CARD_FIELDS_CARD_EXPIRY, "payments.cardFields.cardExpiry"); + + public static final AppElementsUsedItem PAYMENTS_ADDRESS = + new AppElementsUsedItem(Value.PAYMENTS_ADDRESS, "payments.address"); + + public static final AppElementsUsedItem WEBSITES = new AppElementsUsedItem(Value.WEBSITES, "websites"); + + public static final AppElementsUsedItem PAYMENTS_EMAIL = + new AppElementsUsedItem(Value.PAYMENTS_EMAIL, "payments.email"); + + public static final AppElementsUsedItem TRACKING = new AppElementsUsedItem(Value.TRACKING, "tracking"); + + public static final AppElementsUsedItem WALLET = new AppElementsUsedItem(Value.WALLET, "wallet"); + + public static final AppElementsUsedItem TRACKING_EVENTS = + new AppElementsUsedItem(Value.TRACKING_EVENTS, "tracking.events"); + + public static final AppElementsUsedItem WALLET_DEPOSIT = + new AppElementsUsedItem(Value.WALLET_DEPOSIT, "wallet.deposit"); + + public static final AppElementsUsedItem WEBSITES_WEBSITES = + new AppElementsUsedItem(Value.WEBSITES_WEBSITES, "websites.websites"); + + public static final AppElementsUsedItem ADS_REPORTING_CHART = + new AppElementsUsedItem(Value.ADS_REPORTING_CHART, "ads.reporting.chart"); + + public static final AppElementsUsedItem CHECKOUT = new AppElementsUsedItem(Value.CHECKOUT, "checkout"); + + public static final AppElementsUsedItem PAYMENTS_CARD_FIELDS = + new AppElementsUsedItem(Value.PAYMENTS_CARD_FIELDS, "payments.cardFields"); + + public static final AppElementsUsedItem PAYMENTS_CARD_FIELDS_CARD_NUMBER = + new AppElementsUsedItem(Value.PAYMENTS_CARD_FIELDS_CARD_NUMBER, "payments.cardFields.cardNumber"); + + public static final AppElementsUsedItem PAYMENTS_TAX_ID = + new AppElementsUsedItem(Value.PAYMENTS_TAX_ID, "payments.taxId"); + + public static final AppElementsUsedItem TRACKING_PEOPLE = + new AppElementsUsedItem(Value.TRACKING_PEOPLE, "tracking.people"); + + public static final AppElementsUsedItem PAYMENTS = new AppElementsUsedItem(Value.PAYMENTS, "payments"); + + public static final AppElementsUsedItem WALLET_BALANCES = + new AppElementsUsedItem(Value.WALLET_BALANCES, "wallet.balances"); + + public static final AppElementsUsedItem CHECKOUT_EXPRESS_CHECKOUT = + new AppElementsUsedItem(Value.CHECKOUT_EXPRESS_CHECKOUT, "checkout.expressCheckout"); + + public static final AppElementsUsedItem ADS = new AppElementsUsedItem(Value.ADS, "ads"); + + private final Value value; + + private final String string; + + AppElementsUsedItem(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof AppElementsUsedItem && this.string.equals(((AppElementsUsedItem) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ADS_CAMPAIGN_CREATOR: + return visitor.visitAdsCampaignCreator(); + case ADS_REPORTING: + return visitor.visitAdsReporting(); + case WALLET_WITHDRAW: + return visitor.visitWalletWithdraw(); + case PAYMENTS_BRANDING: + return visitor.visitPaymentsBranding(); + case PAYMENTS_CARD: + return visitor.visitPaymentsCard(); + case WALLET_SEND: + return visitor.visitWalletSend(); + case CHECKOUT_CHECKOUT: + return visitor.visitCheckoutCheckout(); + case PAYMENTS_CARD_FIELDS_CARD_CVC: + return visitor.visitPaymentsCardFieldsCardCvc(); + case ADS_BILLING_SETUP: + return visitor.visitAdsBillingSetup(); + case WALLET_BALANCES_LIST: + return visitor.visitWalletBalancesList(); + case WALLET_CARDS: + return visitor.visitWalletCards(); + case PAYMENTS_PAYMENT: + return visitor.visitPaymentsPayment(); + case WEBSITES_PIXEL_SETUP: + return visitor.visitWebsitesPixelSetup(); + case WALLET_ACTIVITY: + return visitor.visitWalletActivity(); + case WALLET_BALANCES_BALANCE: + return visitor.visitWalletBalancesBalance(); + case ADS_REPORTING_TABLE: + return visitor.visitAdsReportingTable(); + case PAYMENTS_CARD_FIELDS_CARD_EXPIRY: + return visitor.visitPaymentsCardFieldsCardExpiry(); + case PAYMENTS_ADDRESS: + return visitor.visitPaymentsAddress(); + case WEBSITES: + return visitor.visitWebsites(); + case PAYMENTS_EMAIL: + return visitor.visitPaymentsEmail(); + case TRACKING: + return visitor.visitTracking(); + case WALLET: + return visitor.visitWallet(); + case TRACKING_EVENTS: + return visitor.visitTrackingEvents(); + case WALLET_DEPOSIT: + return visitor.visitWalletDeposit(); + case WEBSITES_WEBSITES: + return visitor.visitWebsitesWebsites(); + case ADS_REPORTING_CHART: + return visitor.visitAdsReportingChart(); + case CHECKOUT: + return visitor.visitCheckout(); + case PAYMENTS_CARD_FIELDS: + return visitor.visitPaymentsCardFields(); + case PAYMENTS_CARD_FIELDS_CARD_NUMBER: + return visitor.visitPaymentsCardFieldsCardNumber(); + case PAYMENTS_TAX_ID: + return visitor.visitPaymentsTaxId(); + case TRACKING_PEOPLE: + return visitor.visitTrackingPeople(); + case PAYMENTS: + return visitor.visitPayments(); + case WALLET_BALANCES: + return visitor.visitWalletBalances(); + case CHECKOUT_EXPRESS_CHECKOUT: + return visitor.visitCheckoutExpressCheckout(); + case ADS: + return visitor.visitAds(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static AppElementsUsedItem valueOf(String value) { + switch (value) { + case "ads.campaign-creator": + return ADS_CAMPAIGN_CREATOR; + case "ads.reporting": + return ADS_REPORTING; + case "wallet.withdraw": + return WALLET_WITHDRAW; + case "payments.branding": + return PAYMENTS_BRANDING; + case "payments.card": + return PAYMENTS_CARD; + case "wallet.send": + return WALLET_SEND; + case "checkout.checkout": + return CHECKOUT_CHECKOUT; + case "payments.cardFields.cardCvc": + return PAYMENTS_CARD_FIELDS_CARD_CVC; + case "ads.billing-setup": + return ADS_BILLING_SETUP; + case "wallet.balances.list": + return WALLET_BALANCES_LIST; + case "wallet.cards": + return WALLET_CARDS; + case "payments.payment": + return PAYMENTS_PAYMENT; + case "websites.pixel-setup": + return WEBSITES_PIXEL_SETUP; + case "wallet.activity": + return WALLET_ACTIVITY; + case "wallet.balances.balance": + return WALLET_BALANCES_BALANCE; + case "ads.reporting.table": + return ADS_REPORTING_TABLE; + case "payments.cardFields.cardExpiry": + return PAYMENTS_CARD_FIELDS_CARD_EXPIRY; + case "payments.address": + return PAYMENTS_ADDRESS; + case "websites": + return WEBSITES; + case "payments.email": + return PAYMENTS_EMAIL; + case "tracking": + return TRACKING; + case "wallet": + return WALLET; + case "tracking.events": + return TRACKING_EVENTS; + case "wallet.deposit": + return WALLET_DEPOSIT; + case "websites.websites": + return WEBSITES_WEBSITES; + case "ads.reporting.chart": + return ADS_REPORTING_CHART; + case "checkout": + return CHECKOUT; + case "payments.cardFields": + return PAYMENTS_CARD_FIELDS; + case "payments.cardFields.cardNumber": + return PAYMENTS_CARD_FIELDS_CARD_NUMBER; + case "payments.taxId": + return PAYMENTS_TAX_ID; + case "tracking.people": + return TRACKING_PEOPLE; + case "payments": + return PAYMENTS; + case "wallet.balances": + return WALLET_BALANCES; + case "checkout.expressCheckout": + return CHECKOUT_EXPRESS_CHECKOUT; + case "ads": + return ADS; + default: + return new AppElementsUsedItem(Value.UNKNOWN, value); + } + } + + public enum Value { + ADS, + + ADS_BILLING_SETUP, + + ADS_CAMPAIGN_CREATOR, + + ADS_REPORTING, + + ADS_REPORTING_CHART, + + ADS_REPORTING_TABLE, + + CHECKOUT, + + CHECKOUT_CHECKOUT, + + CHECKOUT_EXPRESS_CHECKOUT, + + PAYMENTS, + + PAYMENTS_ADDRESS, + + PAYMENTS_BRANDING, + + PAYMENTS_CARD, + + PAYMENTS_CARD_FIELDS, + + PAYMENTS_CARD_FIELDS_CARD_CVC, + + PAYMENTS_CARD_FIELDS_CARD_EXPIRY, + + PAYMENTS_CARD_FIELDS_CARD_NUMBER, + + PAYMENTS_EMAIL, + + PAYMENTS_PAYMENT, + + PAYMENTS_TAX_ID, + + TRACKING, + + TRACKING_EVENTS, + + TRACKING_PEOPLE, + + WALLET, + + WALLET_ACTIVITY, + + WALLET_BALANCES, + + WALLET_BALANCES_BALANCE, + + WALLET_BALANCES_LIST, + + WALLET_CARDS, + + WALLET_DEPOSIT, + + WALLET_SEND, + + WALLET_WITHDRAW, + + WEBSITES, + + WEBSITES_PIXEL_SETUP, + + WEBSITES_WEBSITES, + + UNKNOWN + } + + public interface Visitor { + T visitAds(); + + T visitAdsBillingSetup(); + + T visitAdsCampaignCreator(); + + T visitAdsReporting(); + + T visitAdsReportingChart(); + + T visitAdsReportingTable(); + + T visitCheckout(); + + T visitCheckoutCheckout(); + + T visitCheckoutExpressCheckout(); + + T visitPayments(); + + T visitPaymentsAddress(); + + T visitPaymentsBranding(); + + T visitPaymentsCard(); + + T visitPaymentsCardFields(); + + T visitPaymentsCardFieldsCardCvc(); + + T visitPaymentsCardFieldsCardExpiry(); + + T visitPaymentsCardFieldsCardNumber(); + + T visitPaymentsEmail(); + + T visitPaymentsPayment(); + + T visitPaymentsTaxId(); + + T visitTracking(); + + T visitTrackingEvents(); + + T visitTrackingPeople(); + + T visitWallet(); + + T visitWalletActivity(); + + T visitWalletBalances(); + + T visitWalletBalancesBalance(); + + T visitWalletBalancesList(); + + T visitWalletCards(); + + T visitWalletDeposit(); + + T visitWalletSend(); + + T visitWalletWithdraw(); + + T visitWebsites(); + + T visitWebsitesPixelSetup(); + + T visitWebsitesWebsites(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/Bounty.java b/src/main/java/com/whop/api/types/Bounty.java index 990de271..1264e469 100644 --- a/src/main/java/com/whop/api/types/Bounty.java +++ b/src/main/java/com/whop/api/types/Bounty.java @@ -34,10 +34,14 @@ public final class Bounty { private final int acceptedSubmissionsPerUserLimit; + private final List activeProofLivestreamFeeds; + private final double affiliateShareAmount; private final List allowedCountryCodes; + private final int awaitingReviewSubmissionsCount; + private final double budgetAmount; private final Optional businessGoalType; @@ -50,6 +54,8 @@ public final class Bounty { private final BountyCurrency currency; + private final int deniedSubmissionsCount; + private final String description; private final Optional discussionExperienceId; @@ -99,14 +105,17 @@ private Bounty( int acceptedSubmissionsCount, int acceptedSubmissionsLimit, int acceptedSubmissionsPerUserLimit, + List activeProofLivestreamFeeds, double affiliateShareAmount, List allowedCountryCodes, + int awaitingReviewSubmissionsCount, double budgetAmount, Optional businessGoalType, Optional cancelRequestedAt, Optional captureSpec, String createdAt, BountyCurrency currency, + int deniedSubmissionsCount, String description, Optional discussionExperienceId, Optional discussionFeedId, @@ -133,14 +142,17 @@ private Bounty( this.acceptedSubmissionsCount = acceptedSubmissionsCount; this.acceptedSubmissionsLimit = acceptedSubmissionsLimit; this.acceptedSubmissionsPerUserLimit = acceptedSubmissionsPerUserLimit; + this.activeProofLivestreamFeeds = activeProofLivestreamFeeds; this.affiliateShareAmount = affiliateShareAmount; this.allowedCountryCodes = allowedCountryCodes; + this.awaitingReviewSubmissionsCount = awaitingReviewSubmissionsCount; this.budgetAmount = budgetAmount; this.businessGoalType = businessGoalType; this.cancelRequestedAt = cancelRequestedAt; this.captureSpec = captureSpec; this.createdAt = createdAt; this.currency = currency; + this.deniedSubmissionsCount = deniedSubmissionsCount; this.description = description; this.discussionExperienceId = discussionExperienceId; this.discussionFeedId = discussionFeedId; @@ -194,6 +206,11 @@ public int getAcceptedSubmissionsPerUserLimit() { return acceptedSubmissionsPerUserLimit; } + @JsonProperty("active_proof_livestream_feeds") + public List getActiveProofLivestreamFeeds() { + return activeProofLivestreamFeeds; + } + /** * @return What a referrer earns per accepted submission when the worker arrived through their affiliate link, in whole currency units, at the standard platform fee rate. Taken out of the worker's post-fee reward rather than added on top. 0 when the bounty pays no affiliate share, including bounties tied to no account, which cannot record a referral. */ @@ -207,6 +224,14 @@ public List getAllowedCountryCodes() { return allowedCountryCodes; } + /** + * @return Submissions delivered and waiting on review. A subset of unresolved_submissions_count, which also counts attempts still in progress. + */ + @JsonProperty("awaiting_review_submissions_count") + public int getAwaitingReviewSubmissionsCount() { + return awaitingReviewSubmissionsCount; + } + /** * @return Total gross budget committed to the bounty: gross_reward_amount times accepted_submissions_limit. */ @@ -264,6 +289,14 @@ public BountyCurrency getCurrency() { return currency; } + /** + * @return Submissions reviewed and turned down. + */ + @JsonProperty("denied_submissions_count") + public int getDeniedSubmissionsCount() { + return deniedSubmissionsCount; + } + /** * @return Full task instructions shown to workers. */ @@ -547,14 +580,17 @@ private boolean equalTo(Bounty other) { && acceptedSubmissionsCount == other.acceptedSubmissionsCount && acceptedSubmissionsLimit == other.acceptedSubmissionsLimit && acceptedSubmissionsPerUserLimit == other.acceptedSubmissionsPerUserLimit + && activeProofLivestreamFeeds.equals(other.activeProofLivestreamFeeds) && affiliateShareAmount == other.affiliateShareAmount && allowedCountryCodes.equals(other.allowedCountryCodes) + && awaitingReviewSubmissionsCount == other.awaitingReviewSubmissionsCount && budgetAmount == other.budgetAmount && businessGoalType.equals(other.businessGoalType) && cancelRequestedAt.equals(other.cancelRequestedAt) && captureSpec.equals(other.captureSpec) && createdAt.equals(other.createdAt) && currency.equals(other.currency) + && deniedSubmissionsCount == other.deniedSubmissionsCount && description.equals(other.description) && discussionExperienceId.equals(other.discussionExperienceId) && discussionFeedId.equals(other.discussionFeedId) @@ -585,14 +621,17 @@ public int hashCode() { this.acceptedSubmissionsCount, this.acceptedSubmissionsLimit, this.acceptedSubmissionsPerUserLimit, + this.activeProofLivestreamFeeds, this.affiliateShareAmount, this.allowedCountryCodes, + this.awaitingReviewSubmissionsCount, this.budgetAmount, this.businessGoalType, this.cancelRequestedAt, this.captureSpec, this.createdAt, this.currency, + this.deniedSubmissionsCount, this.description, this.discussionExperienceId, this.discussionFeedId, @@ -652,7 +691,14 @@ public interface AffiliateShareAmountStage { /** *

What a referrer earns per accepted submission when the worker arrived through their affiliate link, in whole currency units, at the standard platform fee rate. Taken out of the worker's post-fee reward rather than added on top. 0 when the bounty pays no affiliate share, including bounties tied to no account, which cannot record a referral.

*/ - BudgetAmountStage affiliateShareAmount(double affiliateShareAmount); + AwaitingReviewSubmissionsCountStage affiliateShareAmount(double affiliateShareAmount); + } + + public interface AwaitingReviewSubmissionsCountStage { + /** + *

Submissions delivered and waiting on review. A subset of unresolved_submissions_count, which also counts attempts still in progress.

+ */ + BudgetAmountStage awaitingReviewSubmissionsCount(int awaitingReviewSubmissionsCount); } public interface BudgetAmountStage { @@ -673,7 +719,14 @@ public interface CurrencyStage { /** *

Currency for all amounts on the bounty, as a lowercase ISO 4217 code.

*/ - DescriptionStage currency(@NotNull BountyCurrency currency); + DeniedSubmissionsCountStage currency(@NotNull BountyCurrency currency); + } + + public interface DeniedSubmissionsCountStage { + /** + *

Submissions reviewed and turned down.

+ */ + DescriptionStage deniedSubmissionsCount(int deniedSubmissionsCount); } public interface DescriptionStage { @@ -773,6 +826,12 @@ public interface _FinalStage { _FinalStage addAllAcceptedDeliverableTypes(List acceptedDeliverableTypes); + _FinalStage activeProofLivestreamFeeds(List activeProofLivestreamFeeds); + + _FinalStage addActiveProofLivestreamFeeds(BountyActiveLivestreamFeed activeProofLivestreamFeeds); + + _FinalStage addAllActiveProofLivestreamFeeds(List activeProofLivestreamFeeds); + _FinalStage allowedCountryCodes(List allowedCountryCodes); _FinalStage addAllowedCountryCodes(String allowedCountryCodes); @@ -894,9 +953,11 @@ public static final class Builder AcceptedSubmissionsLimitStage, AcceptedSubmissionsPerUserLimitStage, AffiliateShareAmountStage, + AwaitingReviewSubmissionsCountStage, BudgetAmountStage, CreatedAtStage, CurrencyStage, + DeniedSubmissionsCountStage, DescriptionStage, GrossPaidOutAmountStage, GrossRewardAmountStage, @@ -918,12 +979,16 @@ public static final class Builder private double affiliateShareAmount; + private int awaitingReviewSubmissionsCount; + private double budgetAmount; private String createdAt; private BountyCurrency currency; + private int deniedSubmissionsCount; + private String description; private double grossPaidOutAmount; @@ -974,6 +1039,8 @@ public static final class Builder private List allowedCountryCodes = new ArrayList<>(); + private List activeProofLivestreamFeeds = new ArrayList<>(); + private List acceptedDeliverableTypes = new ArrayList<>(); @JsonAnySetter @@ -987,14 +1054,17 @@ public Builder from(Bounty other) { acceptedSubmissionsCount(other.getAcceptedSubmissionsCount()); acceptedSubmissionsLimit(other.getAcceptedSubmissionsLimit()); acceptedSubmissionsPerUserLimit(other.getAcceptedSubmissionsPerUserLimit()); + activeProofLivestreamFeeds(other.getActiveProofLivestreamFeeds()); affiliateShareAmount(other.getAffiliateShareAmount()); allowedCountryCodes(other.getAllowedCountryCodes()); + awaitingReviewSubmissionsCount(other.getAwaitingReviewSubmissionsCount()); budgetAmount(other.getBudgetAmount()); businessGoalType(other.getBusinessGoalType()); cancelRequestedAt(other.getCancelRequestedAt()); captureSpec(other.getCaptureSpec()); createdAt(other.getCreatedAt()); currency(other.getCurrency()); + deniedSubmissionsCount(other.getDeniedSubmissionsCount()); description(other.getDescription()); discussionExperienceId(other.getDiscussionExperienceId()); discussionFeedId(other.getDiscussionFeedId()); @@ -1062,11 +1132,23 @@ public AffiliateShareAmountStage acceptedSubmissionsPerUserLimit(int acceptedSub */ @java.lang.Override @JsonSetter("affiliate_share_amount") - public BudgetAmountStage affiliateShareAmount(double affiliateShareAmount) { + public AwaitingReviewSubmissionsCountStage affiliateShareAmount(double affiliateShareAmount) { this.affiliateShareAmount = affiliateShareAmount; return this; } + /** + *

Submissions delivered and waiting on review. A subset of unresolved_submissions_count, which also counts attempts still in progress.

+ *

Submissions delivered and waiting on review. A subset of unresolved_submissions_count, which also counts attempts still in progress.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("awaiting_review_submissions_count") + public BudgetAmountStage awaitingReviewSubmissionsCount(int awaitingReviewSubmissionsCount) { + this.awaitingReviewSubmissionsCount = awaitingReviewSubmissionsCount; + return this; + } + /** *

Total gross budget committed to the bounty: gross_reward_amount times accepted_submissions_limit.

*

Total gross budget committed to the bounty: gross_reward_amount times accepted_submissions_limit.

@@ -1098,11 +1180,23 @@ public CurrencyStage createdAt(@NotNull String createdAt) { */ @java.lang.Override @JsonSetter("currency") - public DescriptionStage currency(@NotNull BountyCurrency currency) { + public DeniedSubmissionsCountStage currency(@NotNull BountyCurrency currency) { this.currency = Objects.requireNonNull(currency, "currency must not be null"); return this; } + /** + *

Submissions reviewed and turned down.

+ *

Submissions reviewed and turned down.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("denied_submissions_count") + public DescriptionStage deniedSubmissionsCount(int deniedSubmissionsCount) { + this.deniedSubmissionsCount = deniedSubmissionsCount; + return this; + } + /** *

Full task instructions shown to workers.

*

Full task instructions shown to workers.

@@ -1703,6 +1797,31 @@ public _FinalStage allowedCountryCodes(List allowedCountryCodes) { return this; } + @java.lang.Override + public _FinalStage addAllActiveProofLivestreamFeeds( + List activeProofLivestreamFeeds) { + if (activeProofLivestreamFeeds != null) { + this.activeProofLivestreamFeeds.addAll(activeProofLivestreamFeeds); + } + return this; + } + + @java.lang.Override + public _FinalStage addActiveProofLivestreamFeeds(BountyActiveLivestreamFeed activeProofLivestreamFeeds) { + this.activeProofLivestreamFeeds.add(activeProofLivestreamFeeds); + return this; + } + + @java.lang.Override + @JsonSetter(value = "active_proof_livestream_feeds", nulls = Nulls.SKIP) + public _FinalStage activeProofLivestreamFeeds(List activeProofLivestreamFeeds) { + this.activeProofLivestreamFeeds.clear(); + if (activeProofLivestreamFeeds != null) { + this.activeProofLivestreamFeeds.addAll(activeProofLivestreamFeeds); + } + return this; + } + @java.lang.Override public _FinalStage addAllAcceptedDeliverableTypes( List acceptedDeliverableTypes) { @@ -1735,14 +1854,17 @@ public Bounty build() { acceptedSubmissionsCount, acceptedSubmissionsLimit, acceptedSubmissionsPerUserLimit, + activeProofLivestreamFeeds, affiliateShareAmount, allowedCountryCodes, + awaitingReviewSubmissionsCount, budgetAmount, businessGoalType, cancelRequestedAt, captureSpec, createdAt, currency, + deniedSubmissionsCount, description, discussionExperienceId, discussionFeedId, diff --git a/src/main/java/com/whop/api/types/TransferDestinationUser.java b/src/main/java/com/whop/api/types/BountyActiveLivestreamFeed.java similarity index 51% rename from src/main/java/com/whop/api/types/TransferDestinationUser.java rename to src/main/java/com/whop/api/types/BountyActiveLivestreamFeed.java index 5aebdca4..f433a844 100644 --- a/src/main/java/com/whop/api/types/TransferDestinationUser.java +++ b/src/main/java/com/whop/api/types/BountyActiveLivestreamFeed.java @@ -22,61 +22,61 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TransferDestinationUser.Builder.class) -public final class TransferDestinationUser { - private final String id; +@JsonDeserialize(builder = BountyActiveLivestreamFeed.Builder.class) +public final class BountyActiveLivestreamFeed { + private final Optional host; - private final Optional name; + private final String id; - private final String username; + private final String title; private final Map additionalProperties; - private TransferDestinationUser( - String id, Optional name, String username, Map additionalProperties) { + private BountyActiveLivestreamFeed( + Optional host, String id, String title, Map additionalProperties) { + this.host = host; this.id = id; - this.name = name; - this.username = username; + this.title = title; this.additionalProperties = additionalProperties; } /** - * @return The unique identifier for the user. + * @return User hosting the proof livestream — the worker streaming their attempt. null if the host account no longer exists. */ - @JsonProperty("id") - public String getId() { - return id; + @JsonIgnore + public Optional getHost() { + if (host == null) { + return Optional.empty(); + } + return host; } /** - * @return The user's display name shown on their public profile. + * @return Livestream feed ID. */ - @JsonIgnore - public Optional getName() { - if (name == null) { - return Optional.empty(); - } - return name; + @JsonProperty("id") + public String getId() { + return id; } /** - * @return The user's unique username shown on their public profile. + * @return Display title for the proof livestream. */ - @JsonProperty("username") - public String getUsername() { - return username; + @JsonProperty("title") + public String getTitle() { + return title; } @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("name") - private Optional _getName() { - return name; + @JsonProperty("host") + private Optional _getHost() { + return host; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof TransferDestinationUser && equalTo((TransferDestinationUser) other); + return other instanceof BountyActiveLivestreamFeed && equalTo((BountyActiveLivestreamFeed) other); } @JsonAnyGetter @@ -84,13 +84,13 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(TransferDestinationUser other) { - return id.equals(other.id) && name.equals(other.name) && username.equals(other.username); + private boolean equalTo(BountyActiveLivestreamFeed other) { + return host.equals(other.host) && id.equals(other.id) && title.equals(other.title); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.name, this.username); + return Objects.hash(this.host, this.id, this.title); } @java.lang.Override @@ -104,44 +104,44 @@ public static IdStage builder() { public interface IdStage { /** - *

The unique identifier for the user.

+ *

Livestream feed ID.

*/ - UsernameStage id(@NotNull String id); + TitleStage id(@NotNull String id); - Builder from(TransferDestinationUser other); + Builder from(BountyActiveLivestreamFeed other); } - public interface UsernameStage { + public interface TitleStage { /** - *

The user's unique username shown on their public profile.

+ *

Display title for the proof livestream.

*/ - _FinalStage username(@NotNull String username); + _FinalStage title(@NotNull String title); } public interface _FinalStage { - TransferDestinationUser build(); + BountyActiveLivestreamFeed build(); _FinalStage additionalProperty(String key, Object value); _FinalStage additionalProperties(Map additionalProperties); /** - *

The user's display name shown on their public profile.

+ *

User hosting the proof livestream — the worker streaming their attempt. null if the host account no longer exists.

*/ - _FinalStage name(Optional name); + _FinalStage host(Optional host); - _FinalStage name(String name); + _FinalStage host(UserSummary host); - _FinalStage name(Nullable name); + _FinalStage host(Nullable host); } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, UsernameStage, _FinalStage { + public static final class Builder implements IdStage, TitleStage, _FinalStage { private String id; - private String username; + private String title; - private Optional name = Optional.empty(); + private Optional host = Optional.empty(); @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -149,76 +149,76 @@ public static final class Builder implements IdStage, UsernameStage, _FinalStage private Builder() {} @java.lang.Override - public Builder from(TransferDestinationUser other) { + public Builder from(BountyActiveLivestreamFeed other) { + host(other.getHost()); id(other.getId()); - name(other.getName()); - username(other.getUsername()); + title(other.getTitle()); return this; } /** - *

The unique identifier for the user.

- *

The unique identifier for the user.

+ *

Livestream feed ID.

+ *

Livestream feed ID.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") - public UsernameStage id(@NotNull String id) { + public TitleStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** - *

The user's unique username shown on their public profile.

- *

The user's unique username shown on their public profile.

+ *

Display title for the proof livestream.

+ *

Display title for the proof livestream.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - @JsonSetter("username") - public _FinalStage username(@NotNull String username) { - this.username = Objects.requireNonNull(username, "username must not be null"); + @JsonSetter("title") + public _FinalStage title(@NotNull String title) { + this.title = Objects.requireNonNull(title, "title must not be null"); return this; } /** - *

The user's display name shown on their public profile.

+ *

User hosting the proof livestream — the worker streaming their attempt. null if the host account no longer exists.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage name(Nullable name) { - if (name.isNull()) { - this.name = null; - } else if (name.isEmpty()) { - this.name = Optional.empty(); + public _FinalStage host(Nullable host) { + if (host.isNull()) { + this.host = null; + } else if (host.isEmpty()) { + this.host = Optional.empty(); } else { - this.name = Optional.of(name.get()); + this.host = Optional.of(host.get()); } return this; } /** - *

The user's display name shown on their public profile.

+ *

User hosting the proof livestream — the worker streaming their attempt. null if the host account no longer exists.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage name(String name) { - this.name = Optional.ofNullable(name); + public _FinalStage host(UserSummary host) { + this.host = Optional.ofNullable(host); return this; } /** - *

The user's display name shown on their public profile.

+ *

User hosting the proof livestream — the worker streaming their attempt. null if the host account no longer exists.

*/ @java.lang.Override - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public _FinalStage name(Optional name) { - this.name = name; + @JsonSetter(value = "host", nulls = Nulls.SKIP) + public _FinalStage host(Optional host) { + this.host = host; return this; } @java.lang.Override - public TransferDestinationUser build() { - return new TransferDestinationUser(id, name, username, additionalProperties); + public BountyActiveLivestreamFeed build() { + return new BountyActiveLivestreamFeed(host, id, title, additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/whop/api/types/CheckoutSession.java b/src/main/java/com/whop/api/types/CheckoutSession.java new file mode 100644 index 00000000..935433b5 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSession.java @@ -0,0 +1,2701 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSession.Builder.class) +public final class CheckoutSession { + private final Optional affiliateCode; + + private final List availableCurrencies; + + private final Optional branding; + + private final Optional buyerEmail; + + private final Optional buyerId; + + private final Optional buyerIdentity; + + private final Optional buyerIdentityAt; + + private final Optional buyerIdentityMethod; + + private final Optional checkoutConfiguration; + + private final Optional clientSecret; + + private final boolean collectTaxId; + + private final String createdAt; + + private final CheckoutSessionCtaLabel ctaLabel; + + private final List customFieldResponses; + + private final String displayCurrency; + + private final Optional entry; + + private final String expiresAt; + + private final String id; + + private final Optional invoiceDueAt; + + private final List items; + + private final Optional lastConfirmError; + + private final Optional>> metadata; + + private final CheckoutSessionMode mode; + + private final Optional nextAction; + + private final String object; + + private final Optional payment; + + private final Optional paymentMethodConfiguration; + + private final boolean paymentMethodRequired; + + private final Optional phoneNumber; + + private final Optional promo; + + private final Optional promoCode; + + private final CheckoutSessionQuote quote; + + private final Optional redirectUrl; + + private final List requirements; + + private final Optional returnUrl; + + private final CheckoutSessionSeller seller; + + private final Optional shippingAddress; + + private final boolean showPromoCodeInput; + + private final CheckoutSessionStatus status; + + private final Optional taxBehavior; + + private final Optional taxId; + + private final Optional threeDsLevel; + + private final Optional topUpMembership; + + private final Optional transfer; + + private final Map additionalProperties; + + private CheckoutSession( + Optional affiliateCode, + List availableCurrencies, + Optional branding, + Optional buyerEmail, + Optional buyerId, + Optional buyerIdentity, + Optional buyerIdentityAt, + Optional buyerIdentityMethod, + Optional checkoutConfiguration, + Optional clientSecret, + boolean collectTaxId, + String createdAt, + CheckoutSessionCtaLabel ctaLabel, + List customFieldResponses, + String displayCurrency, + Optional entry, + String expiresAt, + String id, + Optional invoiceDueAt, + List items, + Optional lastConfirmError, + Optional>> metadata, + CheckoutSessionMode mode, + Optional nextAction, + String object, + Optional payment, + Optional paymentMethodConfiguration, + boolean paymentMethodRequired, + Optional phoneNumber, + Optional promo, + Optional promoCode, + CheckoutSessionQuote quote, + Optional redirectUrl, + List requirements, + Optional returnUrl, + CheckoutSessionSeller seller, + Optional shippingAddress, + boolean showPromoCodeInput, + CheckoutSessionStatus status, + Optional taxBehavior, + Optional taxId, + Optional threeDsLevel, + Optional topUpMembership, + Optional transfer, + Map additionalProperties) { + this.affiliateCode = affiliateCode; + this.availableCurrencies = availableCurrencies; + this.branding = branding; + this.buyerEmail = buyerEmail; + this.buyerId = buyerId; + this.buyerIdentity = buyerIdentity; + this.buyerIdentityAt = buyerIdentityAt; + this.buyerIdentityMethod = buyerIdentityMethod; + this.checkoutConfiguration = checkoutConfiguration; + this.clientSecret = clientSecret; + this.collectTaxId = collectTaxId; + this.createdAt = createdAt; + this.ctaLabel = ctaLabel; + this.customFieldResponses = customFieldResponses; + this.displayCurrency = displayCurrency; + this.entry = entry; + this.expiresAt = expiresAt; + this.id = id; + this.invoiceDueAt = invoiceDueAt; + this.items = items; + this.lastConfirmError = lastConfirmError; + this.metadata = metadata; + this.mode = mode; + this.nextAction = nextAction; + this.object = object; + this.payment = payment; + this.paymentMethodConfiguration = paymentMethodConfiguration; + this.paymentMethodRequired = paymentMethodRequired; + this.phoneNumber = phoneNumber; + this.promo = promo; + this.promoCode = promoCode; + this.quote = quote; + this.redirectUrl = redirectUrl; + this.requirements = requirements; + this.returnUrl = returnUrl; + this.seller = seller; + this.shippingAddress = shippingAddress; + this.showPromoCodeInput = showPromoCodeInput; + this.status = status; + this.taxBehavior = taxBehavior; + this.taxId = taxId; + this.threeDsLevel = threeDsLevel; + this.topUpMembership = topUpMembership; + this.transfer = transfer; + this.additionalProperties = additionalProperties; + } + + /** + * @return The affiliate this checkout is attributed to, or null. Set at create only. + */ + @JsonIgnore + public Optional getAffiliateCode() { + if (affiliateCode == null) { + return Optional.empty(); + } + return affiliateCode; + } + + @JsonProperty("available_currencies") + public List getAvailableCurrencies() { + return availableCurrencies; + } + + /** + * @return The seller's checkout appearance, resolved configuration first, then plan, then account. null when nobody set any. + */ + @JsonIgnore + public Optional getBranding() { + if (branding == null) { + return Optional.empty(); + } + return branding; + } + + /** + * @return The buyer's email, once one has been resolved for this checkout — null until then. Read-only, and read it together with buyer_identity: an address alone does not mean the person holds it. + */ + @JsonIgnore + public Optional getBuyerEmail() { + if (buyerEmail == null) { + return Optional.empty(); + } + return buyerEmail; + } + + /** + * @return The buyer's user account (user_…), once one has been resolved for this checkout — null until then. Read-only, and read it together with buyer_identity: attributed names the account the purchase is for and proves nothing about who is at the keyboard. + */ + @JsonIgnore + public Optional getBuyerId() { + if (buyerId == null) { + return Optional.empty(); + } + return buyerId; + } + + /** + * @return How well this checkout knows its buyer, or null before one is resolved. attributed means an account was matched from what the buyer typed — it says who the purchase is for and nothing about who is at the keyboard. authenticated means the person proved they hold that account during this checkout. Only authenticated may be handed anything that acts as the buyer, and the value only strengthens. + */ + @JsonIgnore + public Optional getBuyerIdentity() { + if (buyerIdentity == null) { + return Optional.empty(); + } + return buyerIdentity; + } + + /** + * @return When the buyer's identity was last established or strengthened, as an ISO 8601 timestamp. null before a buyer is resolved. + */ + @JsonIgnore + public Optional getBuyerIdentityAt() { + if (buyerIdentityAt == null) { + return Optional.empty(); + } + return buyerIdentityAt; + } + + /** + * @return How the buyer's identity was established — the mechanism behind buyer_identity, so a checkout stays explicable long after it completed. null before a buyer is resolved. New mechanisms are added over time. + */ + @JsonIgnore + public Optional getBuyerIdentityMethod() { + if (buyerIdentityMethod == null) { + return Optional.empty(); + } + return buyerIdentityMethod; + } + + /** + * @return The seller's checkout configuration this session was mounted from (ch_…), or null when it was opened directly from a plan. Its presets seeded this session at create. + */ + @JsonIgnore + public Optional getCheckoutConfiguration() { + if (checkoutConfiguration == null) { + return Optional.empty(); + } + return checkoutConfiguration; + } + + /** + * @return The session's one credential — returned by create, and echoed on a session read authenticated with it (or with the checkout's own resume cookie, which holds the same value). Every other call authenticates with it; treat it like a password for this checkout. + */ + @JsonProperty("client_secret") + public Optional getClientSecret() { + return clientSecret; + } + + /** + * @return Whether this seller offers tax ID entry on checkout (their VAT ID setting). When false, hide the input — a stored tax_id still applies either way. + */ + @JsonProperty("collect_tax_id") + public boolean getCollectTaxId() { + return collectTaxId; + } + + /** + * @return When the session was created, as an ISO 8601 timestamp. + */ + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + /** + * @return The verb for the button that confirms this checkout, so every surface names the act the same way: pay, subscribe, start_trial, join_waitlist, or continue when nothing is charged today (a free checkout, setup mode saving a payment method, or a transfer that charges nothing). Render your own wording for each value — this is a key, never display text — and fall back to a generic label on a value you do not recognize. + */ + @JsonProperty("cta_label") + public CheckoutSessionCtaLabel getCtaLabel() { + return ctaLabel; + } + + @JsonProperty("custom_field_responses") + public List getCustomFieldResponses() { + return customFieldResponses; + } + + /** + * @return The currency this checkout is priced AND charged in, lowercase. Seeded at create from where the buyer is; update it to one of available_currencies to price and charge in that currency instead. + */ + @JsonProperty("display_currency") + public String getDisplayCurrency() { + return displayCurrency; + } + + /** + * @return The waitlist entry the confirm created, or null. Only a waitlist plan produces one: joining charges nothing — the payment method is saved and the seller charges it if they accept the entry — so a completed waitlist session carries an entry and a null payment. Read it with its status: succeeded means the join stands; failed (the card save died — the buyer is not on the waitlist) is transient, reopening the session on the next read with the failure on last_confirm_error. + */ + @JsonIgnore + public Optional getEntry() { + if (entry == null) { + return Optional.empty(); + } + return entry; + } + + /** + * @return When the session expires, as an ISO 8601 timestamp. An expired session cannot be updated or confirmed — start a new one. + */ + @JsonProperty("expires_at") + public String getExpiresAt() { + return expiresAt; + } + + /** + * @return Checkout session ID, prefixed chs_. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return When this checkout's invoice is due, as an ISO 8601 timestamp — null for everything that is not an invoice checkout, and for an invoice without a due date. Present when the plan collects a seller-issued invoice; a surface should state the date, and a date in the past reads as overdue. + */ + @JsonIgnore + public Optional getInvoiceDueAt() { + if (invoiceDueAt == null) { + return Optional.empty(); + } + return invoiceDueAt; + } + + @JsonProperty("items") + public List getItems() { + return items; + } + + /** + * @return Why the most recent confirm attempt did not complete, or null. Only terminal refusals land here — anything the buyer can resolve is a next_action instead. The session stays open; fix what the code names and confirm again. + */ + @JsonIgnore + public Optional getLastConfirmError() { + if (lastConfirmError == null) { + return Optional.empty(); + } + return lastConfirmError; + } + + /** + * @return Free-form string-to-string map set at create. Whop never interprets it. + */ + @JsonIgnore + public Optional>> getMetadata() { + if (metadata == null) { + return Optional.empty(); + } + return metadata; + } + + /** + * @return payment charges the items at confirm; setup saves a payment method for later use. + */ + @JsonProperty("mode") + public CheckoutSessionMode getMode() { + return mode; + } + + /** + * @return The one thing to do now, or null when there is nothing. Do it, re-read the session, and repeat until it is null. A completed session with no next_action has nothing left to do — whether the checkout WENT THROUGH is the result's own status (payment.status, or entry.status for a waitlist join): a charge that decisively dies REOPENS the session on the next read, with the failure on last_confirm_error — so a failed result is a transient reading, never a resting state, and nothing about it may be presented as a success. type picks the shape, and each type carries only its own fields: switch on type and the payload it needs is there; a type you do not recognize is safe to skip when it is not blocking. blocking says whether the flow may move past it — read it rather than inferring it from the type. Before the charge, blocking means the buyer cannot pay until it is done. complete is the attempt's own unfinished ceremony — a 3D Secure challenge, a bank redirect — and one executor serves it whatever its kind: hand its client_secret to the payments element's handleNextAction. After it, wait_for_payment is blocking because the money is still moving and everything past that point would tell the buyer their order landed — hold, wait poll_after_seconds, and read again. The post-completion actions (upgrade_authentication, redirect, await_claim) are advisory: the purchase stands either way. After completion the action can also depend on WHO is reading: a signed-in buyer may be handed the redirect where an anonymous read of the same session gets await_claim — told to check their email to claim the purchase, or that the checkout finished on another device — and a read from outside whop.com's own pages (an embedded element) may be handed a redirect whose destination is whop.com's checkout-finish page instead of the seller's: execute it like any other redirect, and treat the URL as the credential it carries. This is an instruction, never the gate: confirm re-checks everything for itself, so a client that skips a blocking action is refused all the same. upgrade_authentication carries its own recipe (email, sign_in_intent); when its session_intent_id is non-null, the reader's own mid-checkout sign-in already proved the first factor and the recipe collapses to its last step — call that session intent's upgrade endpoint directly (the credential the sign-in installed authorizes it) and collect only what the login still owes. + */ + @JsonIgnore + public Optional getNextAction() { + if (nextAction == null) { + return Optional.empty(); + } + return nextAction; + } + + /** + * @return Always checkout_session. + */ + @JsonProperty("object") + public String getObject() { + return object; + } + + /** + * @return The payment the confirm created, or null while none exists. Read it with its status: a completed session's payment can still be requires_action (a step remains) or processing (accepted, settling). failed is a transient reading — a charge that decisively dies reopens the session on the next read, unbinding the dead payment and recording the failure on last_confirm_error. Anything the charge still needs comes through next_action, which is also where the payment's own credential lives. + */ + @JsonIgnore + public Optional getPayment() { + if (payment == null) { + return Optional.empty(); + } + return payment; + } + + /** + * @return The configuration governing this session, resolved through every layer — the checkout configuration it was mounted from, the plan's, and the account's. Apply it over the payment method types catalogue for the offerable set. null means nothing is configured at any layer: platform defaults apply. + */ + @JsonIgnore + public Optional getPaymentMethodConfiguration() { + if (paymentMethodConfiguration == null) { + return Optional.empty(); + } + return paymentMethodConfiguration; + } + + /** + * @return Whether confirm needs a confirmation_token. false when no charge will ever take money — a free plan, a transfer of a non-renewing plan, or an applied promo code that makes every charge free, now and forever: collect no payment method there and confirm without a token. Live like every session fact: applying or removing a code can flip it, so mount your payment surface off this field, never off a zero total — a checkout that charges nothing today but something later (a trial, a first-charge-only code) stays true. + */ + @JsonProperty("payment_method_required") + public boolean getPaymentMethodRequired() { + return paymentMethodRequired; + } + + /** + * @return The buyer's phone number, or null. Collected when the session publishes a phone_number requirement (the seller collects numbers), set through update, and recorded against the order. Buyer-typed and unverified — sellers who VERIFY numbers get the verify_phone next action instead, which writes to the buyer's account. + */ + @JsonIgnore + public Optional getPhoneNumber() { + if (phoneNumber == null) { + return Optional.empty(); + } + return phoneNumber; + } + + /** + * @return What the applied code takes off and which charges it covers, or null when no code applies. promo_code is the writable field; this is its resolved semantics — the duration says which future charges the breakdown's upcoming amounts have the discount in. + */ + @JsonIgnore + public Optional getPromo() { + if (promo == null) { + return Optional.empty(); + } + return promo; + } + + /** + * @return The promo code applied to the quote, or null. Set it via update; the discount shows up in the quote. + */ + @JsonIgnore + public Optional getPromoCode() { + if (promoCode == null) { + return Optional.empty(); + } + return promoCode; + } + + /** + * @return The current price of the items, computed by the server on every read. Confirm charges this number while it is fresh. + */ + @JsonProperty("quote") + public CheckoutSessionQuote getQuote() { + return quote; + } + + /** + * @return Where the SELLER sends the buyer after a completed purchase, when the checkout configuration this session was mounted from sets one. Always an absolute HTTP or HTTPS URL — anything else serializes as null. Distinct from return_url, which is the payment provider's return leg. + */ + @JsonIgnore + public Optional getRedirectUrl() { + if (redirectUrl == null) { + return Optional.empty(); + } + return redirectUrl; + } + + @JsonProperty("requirements") + public List getRequirements() { + return requirements; + } + + /** + * @return Where the buyer lands after an off-site payment step. Must be an absolute https URL without credentials (http is allowed for localhost). + */ + @JsonIgnore + public Optional getReturnUrl() { + if (returnUrl == null) { + return Optional.empty(); + } + return returnUrl; + } + + /** + * @return The seller this checkout purchases from. + */ + @JsonProperty("seller") + public CheckoutSessionSeller getSeller() { + return seller; + } + + /** + * @return Where physical goods ship, or null. Only the keys the buyer supplied are present. + */ + @JsonIgnore + public Optional getShippingAddress() { + if (shippingAddress == null) { + return Optional.empty(); + } + return shippingAddress; + } + + /** + * @return Whether to offer promo code entry on this checkout: false on a membership transfer, a checkout with nothing due, or a one-off purchase — no code can apply — and when the seller disabled codes for it, or none exists to enter. A code already on the session still discounts either way. + */ + @JsonProperty("show_promo_code_input") + public boolean getShowPromoCodeInput() { + return showPromoCodeInput; + } + + /** + * @return open until a confirm succeeds (completed) or the session ages out (expired). Only an open session can be updated or confirmed. A completed session whose charge later decisively dies returns to open with the failure on last_confirm_error — the same session takes the retry. + */ + @JsonProperty("status") + public CheckoutSessionStatus getStatus() { + return status; + } + + /** + * @return Whether this checkout collects tax, and how its price reads when it does. null means no tax is collected here — skip calculate_tax entirely and ask for no more address than the payment method itself needs. exclusive means tax is ADDED to the quote, inclusive that the quote already contains it. Present before any address is known, so a surface can decide what to collect up front; the value is what this checkout expects to price with, and calculate_tax answers with the authoritative one once a location is known (tax behaviour varies by country). + */ + @JsonIgnore + public Optional getTaxBehavior() { + if (taxBehavior == null) { + return Optional.empty(); + } + return taxBehavior; + } + + /** + * @return The buyer's tax registration for a business purchase, or null. Set it via update (null clears it); a stored registration re-prices the quote's tax row — a valid EU B2B id reverse-charges EU VAT — and confirm charges tax under the same registration, so the shown total and the taken one agree. + */ + @JsonIgnore + public Optional getTaxId() { + if (taxId == null) { + return Optional.empty(); + } + return taxId; + } + + /** + * @return The 3D Secure behavior the checkout configuration asks for, or null to use the plan's or the account's default. + */ + @JsonIgnore + public Optional getThreeDsLevel() { + if (threeDsLevel == null) { + return Optional.empty(); + } + return threeDsLevel; + } + + /** + * @return The membership this checkout tops up (mem_…), or null for an ordinary purchase. Set at create only. Confirming charges the plan's price against that existing membership instead of creating a new one — no stock is taken, and for an expiring plan the paid time stacks onto what is left. The buyer must own it: confirm resolves it against the resolved buyer's own memberships and refuses anything else as not found. + */ + @JsonIgnore + public Optional getTopUpMembership() { + if (topUpMembership == null) { + return Optional.empty(); + } + return topUpMembership; + } + + /** + * @return The membership transfer this checkout performs, or null for an ordinary purchase. Present when the session was mounted from a transfer link: confirming moves the linked membership to this buyer instead of creating a fresh purchase, the quote prices zero due today, and for a renewing plan the collected payment method takes over the origin's future renewals. + */ + @JsonIgnore + public Optional getTransfer() { + if (transfer == null) { + return Optional.empty(); + } + return transfer; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("affiliate_code") + private Optional _getAffiliateCode() { + return affiliateCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("branding") + private Optional _getBranding() { + return branding; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("buyer_email") + private Optional _getBuyerEmail() { + return buyerEmail; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("buyer_id") + private Optional _getBuyerId() { + return buyerId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("buyer_identity") + private Optional _getBuyerIdentity() { + return buyerIdentity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("buyer_identity_at") + private Optional _getBuyerIdentityAt() { + return buyerIdentityAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("buyer_identity_method") + private Optional _getBuyerIdentityMethod() { + return buyerIdentityMethod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("checkout_configuration") + private Optional _getCheckoutConfiguration() { + return checkoutConfiguration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("entry") + private Optional _getEntry() { + return entry; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("invoice_due_at") + private Optional _getInvoiceDueAt() { + return invoiceDueAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("last_confirm_error") + private Optional _getLastConfirmError() { + return lastConfirmError; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("metadata") + private Optional>> _getMetadata() { + return metadata; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("next_action") + private Optional _getNextAction() { + return nextAction; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment") + private Optional _getPayment() { + return payment; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_method_configuration") + private Optional _getPaymentMethodConfiguration() { + return paymentMethodConfiguration; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("phone_number") + private Optional _getPhoneNumber() { + return phoneNumber; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("promo") + private Optional _getPromo() { + return promo; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("promo_code") + private Optional _getPromoCode() { + return promoCode; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("redirect_url") + private Optional _getRedirectUrl() { + return redirectUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("return_url") + private Optional _getReturnUrl() { + return returnUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("shipping_address") + private Optional _getShippingAddress() { + return shippingAddress; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_behavior") + private Optional _getTaxBehavior() { + return taxBehavior; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("tax_id") + private Optional _getTaxId() { + return taxId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("three_ds_level") + private Optional _getThreeDsLevel() { + return threeDsLevel; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("top_up_membership") + private Optional _getTopUpMembership() { + return topUpMembership; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("transfer") + private Optional _getTransfer() { + return transfer; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSession && equalTo((CheckoutSession) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSession other) { + return affiliateCode.equals(other.affiliateCode) + && availableCurrencies.equals(other.availableCurrencies) + && branding.equals(other.branding) + && buyerEmail.equals(other.buyerEmail) + && buyerId.equals(other.buyerId) + && buyerIdentity.equals(other.buyerIdentity) + && buyerIdentityAt.equals(other.buyerIdentityAt) + && buyerIdentityMethod.equals(other.buyerIdentityMethod) + && checkoutConfiguration.equals(other.checkoutConfiguration) + && clientSecret.equals(other.clientSecret) + && collectTaxId == other.collectTaxId + && createdAt.equals(other.createdAt) + && ctaLabel.equals(other.ctaLabel) + && customFieldResponses.equals(other.customFieldResponses) + && displayCurrency.equals(other.displayCurrency) + && entry.equals(other.entry) + && expiresAt.equals(other.expiresAt) + && id.equals(other.id) + && invoiceDueAt.equals(other.invoiceDueAt) + && items.equals(other.items) + && lastConfirmError.equals(other.lastConfirmError) + && metadata.equals(other.metadata) + && mode.equals(other.mode) + && nextAction.equals(other.nextAction) + && object.equals(other.object) + && payment.equals(other.payment) + && paymentMethodConfiguration.equals(other.paymentMethodConfiguration) + && paymentMethodRequired == other.paymentMethodRequired + && phoneNumber.equals(other.phoneNumber) + && promo.equals(other.promo) + && promoCode.equals(other.promoCode) + && quote.equals(other.quote) + && redirectUrl.equals(other.redirectUrl) + && requirements.equals(other.requirements) + && returnUrl.equals(other.returnUrl) + && seller.equals(other.seller) + && shippingAddress.equals(other.shippingAddress) + && showPromoCodeInput == other.showPromoCodeInput + && status.equals(other.status) + && taxBehavior.equals(other.taxBehavior) + && taxId.equals(other.taxId) + && threeDsLevel.equals(other.threeDsLevel) + && topUpMembership.equals(other.topUpMembership) + && transfer.equals(other.transfer); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.affiliateCode, + this.availableCurrencies, + this.branding, + this.buyerEmail, + this.buyerId, + this.buyerIdentity, + this.buyerIdentityAt, + this.buyerIdentityMethod, + this.checkoutConfiguration, + this.clientSecret, + this.collectTaxId, + this.createdAt, + this.ctaLabel, + this.customFieldResponses, + this.displayCurrency, + this.entry, + this.expiresAt, + this.id, + this.invoiceDueAt, + this.items, + this.lastConfirmError, + this.metadata, + this.mode, + this.nextAction, + this.object, + this.payment, + this.paymentMethodConfiguration, + this.paymentMethodRequired, + this.phoneNumber, + this.promo, + this.promoCode, + this.quote, + this.redirectUrl, + this.requirements, + this.returnUrl, + this.seller, + this.shippingAddress, + this.showPromoCodeInput, + this.status, + this.taxBehavior, + this.taxId, + this.threeDsLevel, + this.topUpMembership, + this.transfer); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CollectTaxIdStage builder() { + return new Builder(); + } + + public interface CollectTaxIdStage { + /** + *

Whether this seller offers tax ID entry on checkout (their VAT ID setting). When false, hide the input — a stored tax_id still applies either way.

+ */ + CreatedAtStage collectTaxId(boolean collectTaxId); + + Builder from(CheckoutSession other); + } + + public interface CreatedAtStage { + /** + *

When the session was created, as an ISO 8601 timestamp.

+ */ + CtaLabelStage createdAt(@NotNull String createdAt); + } + + public interface CtaLabelStage { + /** + *

The verb for the button that confirms this checkout, so every surface names the act the same way: pay, subscribe, start_trial, join_waitlist, or continue when nothing is charged today (a free checkout, setup mode saving a payment method, or a transfer that charges nothing). Render your own wording for each value — this is a key, never display text — and fall back to a generic label on a value you do not recognize.

+ */ + DisplayCurrencyStage ctaLabel(@NotNull CheckoutSessionCtaLabel ctaLabel); + } + + public interface DisplayCurrencyStage { + /** + *

The currency this checkout is priced AND charged in, lowercase. Seeded at create from where the buyer is; update it to one of available_currencies to price and charge in that currency instead.

+ */ + ExpiresAtStage displayCurrency(@NotNull String displayCurrency); + } + + public interface ExpiresAtStage { + /** + *

When the session expires, as an ISO 8601 timestamp. An expired session cannot be updated or confirmed — start a new one.

+ */ + IdStage expiresAt(@NotNull String expiresAt); + } + + public interface IdStage { + /** + *

Checkout session ID, prefixed chs_.

+ */ + ModeStage id(@NotNull String id); + } + + public interface ModeStage { + /** + *

payment charges the items at confirm; setup saves a payment method for later use.

+ */ + ObjectStage mode(@NotNull CheckoutSessionMode mode); + } + + public interface ObjectStage { + /** + *

Always checkout_session.

+ */ + PaymentMethodRequiredStage object(@NotNull String object); + } + + public interface PaymentMethodRequiredStage { + /** + *

Whether confirm needs a confirmation_token. false when no charge will ever take money — a free plan, a transfer of a non-renewing plan, or an applied promo code that makes every charge free, now and forever: collect no payment method there and confirm without a token. Live like every session fact: applying or removing a code can flip it, so mount your payment surface off this field, never off a zero total — a checkout that charges nothing today but something later (a trial, a first-charge-only code) stays true.

+ */ + QuoteStage paymentMethodRequired(boolean paymentMethodRequired); + } + + public interface QuoteStage { + /** + *

The current price of the items, computed by the server on every read. Confirm charges this number while it is fresh.

+ */ + SellerStage quote(@NotNull CheckoutSessionQuote quote); + } + + public interface SellerStage { + /** + *

The seller this checkout purchases from.

+ */ + ShowPromoCodeInputStage seller(@NotNull CheckoutSessionSeller seller); + } + + public interface ShowPromoCodeInputStage { + /** + *

Whether to offer promo code entry on this checkout: false on a membership transfer, a checkout with nothing due, or a one-off purchase — no code can apply — and when the seller disabled codes for it, or none exists to enter. A code already on the session still discounts either way.

+ */ + StatusStage showPromoCodeInput(boolean showPromoCodeInput); + } + + public interface StatusStage { + /** + *

open until a confirm succeeds (completed) or the session ages out (expired). Only an open session can be updated or confirmed. A completed session whose charge later decisively dies returns to open with the failure on last_confirm_error — the same session takes the retry.

+ */ + _FinalStage status(@NotNull CheckoutSessionStatus status); + } + + public interface _FinalStage { + CheckoutSession build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The affiliate this checkout is attributed to, or null. Set at create only.

+ */ + _FinalStage affiliateCode(Optional affiliateCode); + + _FinalStage affiliateCode(String affiliateCode); + + _FinalStage affiliateCode(Nullable affiliateCode); + + _FinalStage availableCurrencies(List availableCurrencies); + + _FinalStage addAvailableCurrencies(String availableCurrencies); + + _FinalStage addAllAvailableCurrencies(List availableCurrencies); + + /** + *

The seller's checkout appearance, resolved configuration first, then plan, then account. null when nobody set any.

+ */ + _FinalStage branding(Optional branding); + + _FinalStage branding(CheckoutSessionBranding branding); + + _FinalStage branding(Nullable branding); + + /** + *

The buyer's email, once one has been resolved for this checkout — null until then. Read-only, and read it together with buyer_identity: an address alone does not mean the person holds it.

+ */ + _FinalStage buyerEmail(Optional buyerEmail); + + _FinalStage buyerEmail(String buyerEmail); + + _FinalStage buyerEmail(Nullable buyerEmail); + + /** + *

The buyer's user account (user_…), once one has been resolved for this checkout — null until then. Read-only, and read it together with buyer_identity: attributed names the account the purchase is for and proves nothing about who is at the keyboard.

+ */ + _FinalStage buyerId(Optional buyerId); + + _FinalStage buyerId(String buyerId); + + _FinalStage buyerId(Nullable buyerId); + + /** + *

How well this checkout knows its buyer, or null before one is resolved. attributed means an account was matched from what the buyer typed — it says who the purchase is for and nothing about who is at the keyboard. authenticated means the person proved they hold that account during this checkout. Only authenticated may be handed anything that acts as the buyer, and the value only strengthens.

+ */ + _FinalStage buyerIdentity(Optional buyerIdentity); + + _FinalStage buyerIdentity(CheckoutSessionBuyerIdentity buyerIdentity); + + _FinalStage buyerIdentity(Nullable buyerIdentity); + + /** + *

When the buyer's identity was last established or strengthened, as an ISO 8601 timestamp. null before a buyer is resolved.

+ */ + _FinalStage buyerIdentityAt(Optional buyerIdentityAt); + + _FinalStage buyerIdentityAt(String buyerIdentityAt); + + _FinalStage buyerIdentityAt(Nullable buyerIdentityAt); + + /** + *

How the buyer's identity was established — the mechanism behind buyer_identity, so a checkout stays explicable long after it completed. null before a buyer is resolved. New mechanisms are added over time.

+ */ + _FinalStage buyerIdentityMethod(Optional buyerIdentityMethod); + + _FinalStage buyerIdentityMethod(CheckoutSessionBuyerIdentityMethod buyerIdentityMethod); + + _FinalStage buyerIdentityMethod(Nullable buyerIdentityMethod); + + /** + *

The seller's checkout configuration this session was mounted from (ch_…), or null when it was opened directly from a plan. Its presets seeded this session at create.

+ */ + _FinalStage checkoutConfiguration(Optional checkoutConfiguration); + + _FinalStage checkoutConfiguration(String checkoutConfiguration); + + _FinalStage checkoutConfiguration(Nullable checkoutConfiguration); + + /** + *

The session's one credential — returned by create, and echoed on a session read authenticated with it (or with the checkout's own resume cookie, which holds the same value). Every other call authenticates with it; treat it like a password for this checkout.

+ */ + _FinalStage clientSecret(Optional clientSecret); + + _FinalStage clientSecret(String clientSecret); + + _FinalStage customFieldResponses(List customFieldResponses); + + _FinalStage addCustomFieldResponses(CheckoutSessionCustomFieldResponse customFieldResponses); + + _FinalStage addAllCustomFieldResponses(List customFieldResponses); + + /** + *

The waitlist entry the confirm created, or null. Only a waitlist plan produces one: joining charges nothing — the payment method is saved and the seller charges it if they accept the entry — so a completed waitlist session carries an entry and a null payment. Read it with its status: succeeded means the join stands; failed (the card save died — the buyer is not on the waitlist) is transient, reopening the session on the next read with the failure on last_confirm_error.

+ */ + _FinalStage entry(Optional entry); + + _FinalStage entry(CheckoutSessionEntry entry); + + _FinalStage entry(Nullable entry); + + /** + *

When this checkout's invoice is due, as an ISO 8601 timestamp — null for everything that is not an invoice checkout, and for an invoice without a due date. Present when the plan collects a seller-issued invoice; a surface should state the date, and a date in the past reads as overdue.

+ */ + _FinalStage invoiceDueAt(Optional invoiceDueAt); + + _FinalStage invoiceDueAt(String invoiceDueAt); + + _FinalStage invoiceDueAt(Nullable invoiceDueAt); + + _FinalStage items(List items); + + _FinalStage addItems(CheckoutSessionItem items); + + _FinalStage addAllItems(List items); + + /** + *

Why the most recent confirm attempt did not complete, or null. Only terminal refusals land here — anything the buyer can resolve is a next_action instead. The session stays open; fix what the code names and confirm again.

+ */ + _FinalStage lastConfirmError(Optional lastConfirmError); + + _FinalStage lastConfirmError(CheckoutSessionConfirmError lastConfirmError); + + _FinalStage lastConfirmError(Nullable lastConfirmError); + + /** + *

Free-form string-to-string map set at create. Whop never interprets it.

+ */ + _FinalStage metadata(Optional>> metadata); + + _FinalStage metadata(Map> metadata); + + _FinalStage metadata(Nullable>> metadata); + + /** + *

The one thing to do now, or null when there is nothing. Do it, re-read the session, and repeat until it is null. A completed session with no next_action has nothing left to do — whether the checkout WENT THROUGH is the result's own status (payment.status, or entry.status for a waitlist join): a charge that decisively dies REOPENS the session on the next read, with the failure on last_confirm_error — so a failed result is a transient reading, never a resting state, and nothing about it may be presented as a success. type picks the shape, and each type carries only its own fields: switch on type and the payload it needs is there; a type you do not recognize is safe to skip when it is not blocking. blocking says whether the flow may move past it — read it rather than inferring it from the type. Before the charge, blocking means the buyer cannot pay until it is done. complete is the attempt's own unfinished ceremony — a 3D Secure challenge, a bank redirect — and one executor serves it whatever its kind: hand its client_secret to the payments element's handleNextAction. After it, wait_for_payment is blocking because the money is still moving and everything past that point would tell the buyer their order landed — hold, wait poll_after_seconds, and read again. The post-completion actions (upgrade_authentication, redirect, await_claim) are advisory: the purchase stands either way. After completion the action can also depend on WHO is reading: a signed-in buyer may be handed the redirect where an anonymous read of the same session gets await_claim — told to check their email to claim the purchase, or that the checkout finished on another device — and a read from outside whop.com's own pages (an embedded element) may be handed a redirect whose destination is whop.com's checkout-finish page instead of the seller's: execute it like any other redirect, and treat the URL as the credential it carries. This is an instruction, never the gate: confirm re-checks everything for itself, so a client that skips a blocking action is refused all the same. upgrade_authentication carries its own recipe (email, sign_in_intent); when its session_intent_id is non-null, the reader's own mid-checkout sign-in already proved the first factor and the recipe collapses to its last step — call that session intent's upgrade endpoint directly (the credential the sign-in installed authorizes it) and collect only what the login still owes.

+ */ + _FinalStage nextAction(Optional nextAction); + + _FinalStage nextAction(CheckoutSessionNextAction nextAction); + + _FinalStage nextAction(Nullable nextAction); + + /** + *

The payment the confirm created, or null while none exists. Read it with its status: a completed session's payment can still be requires_action (a step remains) or processing (accepted, settling). failed is a transient reading — a charge that decisively dies reopens the session on the next read, unbinding the dead payment and recording the failure on last_confirm_error. Anything the charge still needs comes through next_action, which is also where the payment's own credential lives.

+ */ + _FinalStage payment(Optional payment); + + _FinalStage payment(CheckoutSessionPayment payment); + + _FinalStage payment(Nullable payment); + + /** + *

The configuration governing this session, resolved through every layer — the checkout configuration it was mounted from, the plan's, and the account's. Apply it over the payment method types catalogue for the offerable set. null means nothing is configured at any layer: platform defaults apply.

+ */ + _FinalStage paymentMethodConfiguration( + Optional paymentMethodConfiguration); + + _FinalStage paymentMethodConfiguration(CheckoutSessionPaymentMethodConfiguration paymentMethodConfiguration); + + _FinalStage paymentMethodConfiguration( + Nullable paymentMethodConfiguration); + + /** + *

The buyer's phone number, or null. Collected when the session publishes a phone_number requirement (the seller collects numbers), set through update, and recorded against the order. Buyer-typed and unverified — sellers who VERIFY numbers get the verify_phone next action instead, which writes to the buyer's account.

+ */ + _FinalStage phoneNumber(Optional phoneNumber); + + _FinalStage phoneNumber(String phoneNumber); + + _FinalStage phoneNumber(Nullable phoneNumber); + + /** + *

What the applied code takes off and which charges it covers, or null when no code applies. promo_code is the writable field; this is its resolved semantics — the duration says which future charges the breakdown's upcoming amounts have the discount in.

+ */ + _FinalStage promo(Optional promo); + + _FinalStage promo(CheckoutSessionPromo promo); + + _FinalStage promo(Nullable promo); + + /** + *

The promo code applied to the quote, or null. Set it via update; the discount shows up in the quote.

+ */ + _FinalStage promoCode(Optional promoCode); + + _FinalStage promoCode(String promoCode); + + _FinalStage promoCode(Nullable promoCode); + + /** + *

Where the SELLER sends the buyer after a completed purchase, when the checkout configuration this session was mounted from sets one. Always an absolute HTTP or HTTPS URL — anything else serializes as null. Distinct from return_url, which is the payment provider's return leg.

+ */ + _FinalStage redirectUrl(Optional redirectUrl); + + _FinalStage redirectUrl(String redirectUrl); + + _FinalStage redirectUrl(Nullable redirectUrl); + + _FinalStage requirements(List requirements); + + _FinalStage addRequirements(CheckoutSessionRequirement requirements); + + _FinalStage addAllRequirements(List requirements); + + /** + *

Where the buyer lands after an off-site payment step. Must be an absolute https URL without credentials (http is allowed for localhost).

+ */ + _FinalStage returnUrl(Optional returnUrl); + + _FinalStage returnUrl(String returnUrl); + + _FinalStage returnUrl(Nullable returnUrl); + + /** + *

Where physical goods ship, or null. Only the keys the buyer supplied are present.

+ */ + _FinalStage shippingAddress(Optional shippingAddress); + + _FinalStage shippingAddress(CheckoutSessionShippingAddress shippingAddress); + + _FinalStage shippingAddress(Nullable shippingAddress); + + /** + *

Whether this checkout collects tax, and how its price reads when it does. null means no tax is collected here — skip calculate_tax entirely and ask for no more address than the payment method itself needs. exclusive means tax is ADDED to the quote, inclusive that the quote already contains it. Present before any address is known, so a surface can decide what to collect up front; the value is what this checkout expects to price with, and calculate_tax answers with the authoritative one once a location is known (tax behaviour varies by country).

+ */ + _FinalStage taxBehavior(Optional taxBehavior); + + _FinalStage taxBehavior(CheckoutSessionTaxBehavior taxBehavior); + + _FinalStage taxBehavior(Nullable taxBehavior); + + /** + *

The buyer's tax registration for a business purchase, or null. Set it via update (null clears it); a stored registration re-prices the quote's tax row — a valid EU B2B id reverse-charges EU VAT — and confirm charges tax under the same registration, so the shown total and the taken one agree.

+ */ + _FinalStage taxId(Optional taxId); + + _FinalStage taxId(CheckoutSessionTaxId taxId); + + _FinalStage taxId(Nullable taxId); + + /** + *

The 3D Secure behavior the checkout configuration asks for, or null to use the plan's or the account's default.

+ */ + _FinalStage threeDsLevel(Optional threeDsLevel); + + _FinalStage threeDsLevel(CheckoutSessionThreeDsLevel threeDsLevel); + + _FinalStage threeDsLevel(Nullable threeDsLevel); + + /** + *

The membership this checkout tops up (mem_…), or null for an ordinary purchase. Set at create only. Confirming charges the plan's price against that existing membership instead of creating a new one — no stock is taken, and for an expiring plan the paid time stacks onto what is left. The buyer must own it: confirm resolves it against the resolved buyer's own memberships and refuses anything else as not found.

+ */ + _FinalStage topUpMembership(Optional topUpMembership); + + _FinalStage topUpMembership(String topUpMembership); + + _FinalStage topUpMembership(Nullable topUpMembership); + + /** + *

The membership transfer this checkout performs, or null for an ordinary purchase. Present when the session was mounted from a transfer link: confirming moves the linked membership to this buyer instead of creating a fresh purchase, the quote prices zero due today, and for a renewing plan the collected payment method takes over the origin's future renewals.

+ */ + _FinalStage transfer(Optional transfer); + + _FinalStage transfer(CheckoutSessionTransfer transfer); + + _FinalStage transfer(Nullable transfer); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements CollectTaxIdStage, + CreatedAtStage, + CtaLabelStage, + DisplayCurrencyStage, + ExpiresAtStage, + IdStage, + ModeStage, + ObjectStage, + PaymentMethodRequiredStage, + QuoteStage, + SellerStage, + ShowPromoCodeInputStage, + StatusStage, + _FinalStage { + private boolean collectTaxId; + + private String createdAt; + + private CheckoutSessionCtaLabel ctaLabel; + + private String displayCurrency; + + private String expiresAt; + + private String id; + + private CheckoutSessionMode mode; + + private String object; + + private boolean paymentMethodRequired; + + private CheckoutSessionQuote quote; + + private CheckoutSessionSeller seller; + + private boolean showPromoCodeInput; + + private CheckoutSessionStatus status; + + private Optional transfer = Optional.empty(); + + private Optional topUpMembership = Optional.empty(); + + private Optional threeDsLevel = Optional.empty(); + + private Optional taxId = Optional.empty(); + + private Optional taxBehavior = Optional.empty(); + + private Optional shippingAddress = Optional.empty(); + + private Optional returnUrl = Optional.empty(); + + private List requirements = new ArrayList<>(); + + private Optional redirectUrl = Optional.empty(); + + private Optional promoCode = Optional.empty(); + + private Optional promo = Optional.empty(); + + private Optional phoneNumber = Optional.empty(); + + private Optional paymentMethodConfiguration = Optional.empty(); + + private Optional payment = Optional.empty(); + + private Optional nextAction = Optional.empty(); + + private Optional>> metadata = Optional.empty(); + + private Optional lastConfirmError = Optional.empty(); + + private List items = new ArrayList<>(); + + private Optional invoiceDueAt = Optional.empty(); + + private Optional entry = Optional.empty(); + + private List customFieldResponses = new ArrayList<>(); + + private Optional clientSecret = Optional.empty(); + + private Optional checkoutConfiguration = Optional.empty(); + + private Optional buyerIdentityMethod = Optional.empty(); + + private Optional buyerIdentityAt = Optional.empty(); + + private Optional buyerIdentity = Optional.empty(); + + private Optional buyerId = Optional.empty(); + + private Optional buyerEmail = Optional.empty(); + + private Optional branding = Optional.empty(); + + private List availableCurrencies = new ArrayList<>(); + + private Optional affiliateCode = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSession other) { + affiliateCode(other.getAffiliateCode()); + availableCurrencies(other.getAvailableCurrencies()); + branding(other.getBranding()); + buyerEmail(other.getBuyerEmail()); + buyerId(other.getBuyerId()); + buyerIdentity(other.getBuyerIdentity()); + buyerIdentityAt(other.getBuyerIdentityAt()); + buyerIdentityMethod(other.getBuyerIdentityMethod()); + checkoutConfiguration(other.getCheckoutConfiguration()); + clientSecret(other.getClientSecret()); + collectTaxId(other.getCollectTaxId()); + createdAt(other.getCreatedAt()); + ctaLabel(other.getCtaLabel()); + customFieldResponses(other.getCustomFieldResponses()); + displayCurrency(other.getDisplayCurrency()); + entry(other.getEntry()); + expiresAt(other.getExpiresAt()); + id(other.getId()); + invoiceDueAt(other.getInvoiceDueAt()); + items(other.getItems()); + lastConfirmError(other.getLastConfirmError()); + metadata(other.getMetadata()); + mode(other.getMode()); + nextAction(other.getNextAction()); + object(other.getObject()); + payment(other.getPayment()); + paymentMethodConfiguration(other.getPaymentMethodConfiguration()); + paymentMethodRequired(other.getPaymentMethodRequired()); + phoneNumber(other.getPhoneNumber()); + promo(other.getPromo()); + promoCode(other.getPromoCode()); + quote(other.getQuote()); + redirectUrl(other.getRedirectUrl()); + requirements(other.getRequirements()); + returnUrl(other.getReturnUrl()); + seller(other.getSeller()); + shippingAddress(other.getShippingAddress()); + showPromoCodeInput(other.getShowPromoCodeInput()); + status(other.getStatus()); + taxBehavior(other.getTaxBehavior()); + taxId(other.getTaxId()); + threeDsLevel(other.getThreeDsLevel()); + topUpMembership(other.getTopUpMembership()); + transfer(other.getTransfer()); + return this; + } + + /** + *

Whether this seller offers tax ID entry on checkout (their VAT ID setting). When false, hide the input — a stored tax_id still applies either way.

+ *

Whether this seller offers tax ID entry on checkout (their VAT ID setting). When false, hide the input — a stored tax_id still applies either way.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("collect_tax_id") + public CreatedAtStage collectTaxId(boolean collectTaxId) { + this.collectTaxId = collectTaxId; + return this; + } + + /** + *

When the session was created, as an ISO 8601 timestamp.

+ *

When the session was created, as an ISO 8601 timestamp.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public CtaLabelStage createdAt(@NotNull String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The verb for the button that confirms this checkout, so every surface names the act the same way: pay, subscribe, start_trial, join_waitlist, or continue when nothing is charged today (a free checkout, setup mode saving a payment method, or a transfer that charges nothing). Render your own wording for each value — this is a key, never display text — and fall back to a generic label on a value you do not recognize.

+ *

The verb for the button that confirms this checkout, so every surface names the act the same way: pay, subscribe, start_trial, join_waitlist, or continue when nothing is charged today (a free checkout, setup mode saving a payment method, or a transfer that charges nothing). Render your own wording for each value — this is a key, never display text — and fall back to a generic label on a value you do not recognize.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("cta_label") + public DisplayCurrencyStage ctaLabel(@NotNull CheckoutSessionCtaLabel ctaLabel) { + this.ctaLabel = Objects.requireNonNull(ctaLabel, "ctaLabel must not be null"); + return this; + } + + /** + *

The currency this checkout is priced AND charged in, lowercase. Seeded at create from where the buyer is; update it to one of available_currencies to price and charge in that currency instead.

+ *

The currency this checkout is priced AND charged in, lowercase. Seeded at create from where the buyer is; update it to one of available_currencies to price and charge in that currency instead.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("display_currency") + public ExpiresAtStage displayCurrency(@NotNull String displayCurrency) { + this.displayCurrency = Objects.requireNonNull(displayCurrency, "displayCurrency must not be null"); + return this; + } + + /** + *

When the session expires, as an ISO 8601 timestamp. An expired session cannot be updated or confirmed — start a new one.

+ *

When the session expires, as an ISO 8601 timestamp. An expired session cannot be updated or confirmed — start a new one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("expires_at") + public IdStage expiresAt(@NotNull String expiresAt) { + this.expiresAt = Objects.requireNonNull(expiresAt, "expiresAt must not be null"); + return this; + } + + /** + *

Checkout session ID, prefixed chs_.

+ *

Checkout session ID, prefixed chs_.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public ModeStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

payment charges the items at confirm; setup saves a payment method for later use.

+ *

payment charges the items at confirm; setup saves a payment method for later use.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("mode") + public ObjectStage mode(@NotNull CheckoutSessionMode mode) { + this.mode = Objects.requireNonNull(mode, "mode must not be null"); + return this; + } + + /** + *

Always checkout_session.

+ *

Always checkout_session.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("object") + public PaymentMethodRequiredStage object(@NotNull String object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + /** + *

Whether confirm needs a confirmation_token. false when no charge will ever take money — a free plan, a transfer of a non-renewing plan, or an applied promo code that makes every charge free, now and forever: collect no payment method there and confirm without a token. Live like every session fact: applying or removing a code can flip it, so mount your payment surface off this field, never off a zero total — a checkout that charges nothing today but something later (a trial, a first-charge-only code) stays true.

+ *

Whether confirm needs a confirmation_token. false when no charge will ever take money — a free plan, a transfer of a non-renewing plan, or an applied promo code that makes every charge free, now and forever: collect no payment method there and confirm without a token. Live like every session fact: applying or removing a code can flip it, so mount your payment surface off this field, never off a zero total — a checkout that charges nothing today but something later (a trial, a first-charge-only code) stays true.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("payment_method_required") + public QuoteStage paymentMethodRequired(boolean paymentMethodRequired) { + this.paymentMethodRequired = paymentMethodRequired; + return this; + } + + /** + *

The current price of the items, computed by the server on every read. Confirm charges this number while it is fresh.

+ *

The current price of the items, computed by the server on every read. Confirm charges this number while it is fresh.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("quote") + public SellerStage quote(@NotNull CheckoutSessionQuote quote) { + this.quote = Objects.requireNonNull(quote, "quote must not be null"); + return this; + } + + /** + *

The seller this checkout purchases from.

+ *

The seller this checkout purchases from.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("seller") + public ShowPromoCodeInputStage seller(@NotNull CheckoutSessionSeller seller) { + this.seller = Objects.requireNonNull(seller, "seller must not be null"); + return this; + } + + /** + *

Whether to offer promo code entry on this checkout: false on a membership transfer, a checkout with nothing due, or a one-off purchase — no code can apply — and when the seller disabled codes for it, or none exists to enter. A code already on the session still discounts either way.

+ *

Whether to offer promo code entry on this checkout: false on a membership transfer, a checkout with nothing due, or a one-off purchase — no code can apply — and when the seller disabled codes for it, or none exists to enter. A code already on the session still discounts either way.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("show_promo_code_input") + public StatusStage showPromoCodeInput(boolean showPromoCodeInput) { + this.showPromoCodeInput = showPromoCodeInput; + return this; + } + + /** + *

open until a confirm succeeds (completed) or the session ages out (expired). Only an open session can be updated or confirmed. A completed session whose charge later decisively dies returns to open with the failure on last_confirm_error — the same session takes the retry.

+ *

open until a confirm succeeds (completed) or the session ages out (expired). Only an open session can be updated or confirmed. A completed session whose charge later decisively dies returns to open with the failure on last_confirm_error — the same session takes the retry.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public _FinalStage status(@NotNull CheckoutSessionStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + /** + *

The membership transfer this checkout performs, or null for an ordinary purchase. Present when the session was mounted from a transfer link: confirming moves the linked membership to this buyer instead of creating a fresh purchase, the quote prices zero due today, and for a renewing plan the collected payment method takes over the origin's future renewals.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage transfer(Nullable transfer) { + if (transfer.isNull()) { + this.transfer = null; + } else if (transfer.isEmpty()) { + this.transfer = Optional.empty(); + } else { + this.transfer = Optional.of(transfer.get()); + } + return this; + } + + /** + *

The membership transfer this checkout performs, or null for an ordinary purchase. Present when the session was mounted from a transfer link: confirming moves the linked membership to this buyer instead of creating a fresh purchase, the quote prices zero due today, and for a renewing plan the collected payment method takes over the origin's future renewals.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage transfer(CheckoutSessionTransfer transfer) { + this.transfer = Optional.ofNullable(transfer); + return this; + } + + /** + *

The membership transfer this checkout performs, or null for an ordinary purchase. Present when the session was mounted from a transfer link: confirming moves the linked membership to this buyer instead of creating a fresh purchase, the quote prices zero due today, and for a renewing plan the collected payment method takes over the origin's future renewals.

+ */ + @java.lang.Override + @JsonSetter(value = "transfer", nulls = Nulls.SKIP) + public _FinalStage transfer(Optional transfer) { + this.transfer = transfer; + return this; + } + + /** + *

The membership this checkout tops up (mem_…), or null for an ordinary purchase. Set at create only. Confirming charges the plan's price against that existing membership instead of creating a new one — no stock is taken, and for an expiring plan the paid time stacks onto what is left. The buyer must own it: confirm resolves it against the resolved buyer's own memberships and refuses anything else as not found.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage topUpMembership(Nullable topUpMembership) { + if (topUpMembership.isNull()) { + this.topUpMembership = null; + } else if (topUpMembership.isEmpty()) { + this.topUpMembership = Optional.empty(); + } else { + this.topUpMembership = Optional.of(topUpMembership.get()); + } + return this; + } + + /** + *

The membership this checkout tops up (mem_…), or null for an ordinary purchase. Set at create only. Confirming charges the plan's price against that existing membership instead of creating a new one — no stock is taken, and for an expiring plan the paid time stacks onto what is left. The buyer must own it: confirm resolves it against the resolved buyer's own memberships and refuses anything else as not found.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage topUpMembership(String topUpMembership) { + this.topUpMembership = Optional.ofNullable(topUpMembership); + return this; + } + + /** + *

The membership this checkout tops up (mem_…), or null for an ordinary purchase. Set at create only. Confirming charges the plan's price against that existing membership instead of creating a new one — no stock is taken, and for an expiring plan the paid time stacks onto what is left. The buyer must own it: confirm resolves it against the resolved buyer's own memberships and refuses anything else as not found.

+ */ + @java.lang.Override + @JsonSetter(value = "top_up_membership", nulls = Nulls.SKIP) + public _FinalStage topUpMembership(Optional topUpMembership) { + this.topUpMembership = topUpMembership; + return this; + } + + /** + *

The 3D Secure behavior the checkout configuration asks for, or null to use the plan's or the account's default.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage threeDsLevel(Nullable threeDsLevel) { + if (threeDsLevel.isNull()) { + this.threeDsLevel = null; + } else if (threeDsLevel.isEmpty()) { + this.threeDsLevel = Optional.empty(); + } else { + this.threeDsLevel = Optional.of(threeDsLevel.get()); + } + return this; + } + + /** + *

The 3D Secure behavior the checkout configuration asks for, or null to use the plan's or the account's default.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage threeDsLevel(CheckoutSessionThreeDsLevel threeDsLevel) { + this.threeDsLevel = Optional.ofNullable(threeDsLevel); + return this; + } + + /** + *

The 3D Secure behavior the checkout configuration asks for, or null to use the plan's or the account's default.

+ */ + @java.lang.Override + @JsonSetter(value = "three_ds_level", nulls = Nulls.SKIP) + public _FinalStage threeDsLevel(Optional threeDsLevel) { + this.threeDsLevel = threeDsLevel; + return this; + } + + /** + *

The buyer's tax registration for a business purchase, or null. Set it via update (null clears it); a stored registration re-prices the quote's tax row — a valid EU B2B id reverse-charges EU VAT — and confirm charges tax under the same registration, so the shown total and the taken one agree.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage taxId(Nullable taxId) { + if (taxId.isNull()) { + this.taxId = null; + } else if (taxId.isEmpty()) { + this.taxId = Optional.empty(); + } else { + this.taxId = Optional.of(taxId.get()); + } + return this; + } + + /** + *

The buyer's tax registration for a business purchase, or null. Set it via update (null clears it); a stored registration re-prices the quote's tax row — a valid EU B2B id reverse-charges EU VAT — and confirm charges tax under the same registration, so the shown total and the taken one agree.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage taxId(CheckoutSessionTaxId taxId) { + this.taxId = Optional.ofNullable(taxId); + return this; + } + + /** + *

The buyer's tax registration for a business purchase, or null. Set it via update (null clears it); a stored registration re-prices the quote's tax row — a valid EU B2B id reverse-charges EU VAT — and confirm charges tax under the same registration, so the shown total and the taken one agree.

+ */ + @java.lang.Override + @JsonSetter(value = "tax_id", nulls = Nulls.SKIP) + public _FinalStage taxId(Optional taxId) { + this.taxId = taxId; + return this; + } + + /** + *

Whether this checkout collects tax, and how its price reads when it does. null means no tax is collected here — skip calculate_tax entirely and ask for no more address than the payment method itself needs. exclusive means tax is ADDED to the quote, inclusive that the quote already contains it. Present before any address is known, so a surface can decide what to collect up front; the value is what this checkout expects to price with, and calculate_tax answers with the authoritative one once a location is known (tax behaviour varies by country).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage taxBehavior(Nullable taxBehavior) { + if (taxBehavior.isNull()) { + this.taxBehavior = null; + } else if (taxBehavior.isEmpty()) { + this.taxBehavior = Optional.empty(); + } else { + this.taxBehavior = Optional.of(taxBehavior.get()); + } + return this; + } + + /** + *

Whether this checkout collects tax, and how its price reads when it does. null means no tax is collected here — skip calculate_tax entirely and ask for no more address than the payment method itself needs. exclusive means tax is ADDED to the quote, inclusive that the quote already contains it. Present before any address is known, so a surface can decide what to collect up front; the value is what this checkout expects to price with, and calculate_tax answers with the authoritative one once a location is known (tax behaviour varies by country).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage taxBehavior(CheckoutSessionTaxBehavior taxBehavior) { + this.taxBehavior = Optional.ofNullable(taxBehavior); + return this; + } + + /** + *

Whether this checkout collects tax, and how its price reads when it does. null means no tax is collected here — skip calculate_tax entirely and ask for no more address than the payment method itself needs. exclusive means tax is ADDED to the quote, inclusive that the quote already contains it. Present before any address is known, so a surface can decide what to collect up front; the value is what this checkout expects to price with, and calculate_tax answers with the authoritative one once a location is known (tax behaviour varies by country).

+ */ + @java.lang.Override + @JsonSetter(value = "tax_behavior", nulls = Nulls.SKIP) + public _FinalStage taxBehavior(Optional taxBehavior) { + this.taxBehavior = taxBehavior; + return this; + } + + /** + *

Where physical goods ship, or null. Only the keys the buyer supplied are present.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage shippingAddress(Nullable shippingAddress) { + if (shippingAddress.isNull()) { + this.shippingAddress = null; + } else if (shippingAddress.isEmpty()) { + this.shippingAddress = Optional.empty(); + } else { + this.shippingAddress = Optional.of(shippingAddress.get()); + } + return this; + } + + /** + *

Where physical goods ship, or null. Only the keys the buyer supplied are present.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage shippingAddress(CheckoutSessionShippingAddress shippingAddress) { + this.shippingAddress = Optional.ofNullable(shippingAddress); + return this; + } + + /** + *

Where physical goods ship, or null. Only the keys the buyer supplied are present.

+ */ + @java.lang.Override + @JsonSetter(value = "shipping_address", nulls = Nulls.SKIP) + public _FinalStage shippingAddress(Optional shippingAddress) { + this.shippingAddress = shippingAddress; + return this; + } + + /** + *

Where the buyer lands after an off-site payment step. Must be an absolute https URL without credentials (http is allowed for localhost).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage returnUrl(Nullable returnUrl) { + if (returnUrl.isNull()) { + this.returnUrl = null; + } else if (returnUrl.isEmpty()) { + this.returnUrl = Optional.empty(); + } else { + this.returnUrl = Optional.of(returnUrl.get()); + } + return this; + } + + /** + *

Where the buyer lands after an off-site payment step. Must be an absolute https URL without credentials (http is allowed for localhost).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage returnUrl(String returnUrl) { + this.returnUrl = Optional.ofNullable(returnUrl); + return this; + } + + /** + *

Where the buyer lands after an off-site payment step. Must be an absolute https URL without credentials (http is allowed for localhost).

+ */ + @java.lang.Override + @JsonSetter(value = "return_url", nulls = Nulls.SKIP) + public _FinalStage returnUrl(Optional returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + @java.lang.Override + public _FinalStage addAllRequirements(List requirements) { + if (requirements != null) { + this.requirements.addAll(requirements); + } + return this; + } + + @java.lang.Override + public _FinalStage addRequirements(CheckoutSessionRequirement requirements) { + this.requirements.add(requirements); + return this; + } + + @java.lang.Override + @JsonSetter(value = "requirements", nulls = Nulls.SKIP) + public _FinalStage requirements(List requirements) { + this.requirements.clear(); + if (requirements != null) { + this.requirements.addAll(requirements); + } + return this; + } + + /** + *

Where the SELLER sends the buyer after a completed purchase, when the checkout configuration this session was mounted from sets one. Always an absolute HTTP or HTTPS URL — anything else serializes as null. Distinct from return_url, which is the payment provider's return leg.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage redirectUrl(Nullable redirectUrl) { + if (redirectUrl.isNull()) { + this.redirectUrl = null; + } else if (redirectUrl.isEmpty()) { + this.redirectUrl = Optional.empty(); + } else { + this.redirectUrl = Optional.of(redirectUrl.get()); + } + return this; + } + + /** + *

Where the SELLER sends the buyer after a completed purchase, when the checkout configuration this session was mounted from sets one. Always an absolute HTTP or HTTPS URL — anything else serializes as null. Distinct from return_url, which is the payment provider's return leg.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage redirectUrl(String redirectUrl) { + this.redirectUrl = Optional.ofNullable(redirectUrl); + return this; + } + + /** + *

Where the SELLER sends the buyer after a completed purchase, when the checkout configuration this session was mounted from sets one. Always an absolute HTTP or HTTPS URL — anything else serializes as null. Distinct from return_url, which is the payment provider's return leg.

+ */ + @java.lang.Override + @JsonSetter(value = "redirect_url", nulls = Nulls.SKIP) + public _FinalStage redirectUrl(Optional redirectUrl) { + this.redirectUrl = redirectUrl; + return this; + } + + /** + *

The promo code applied to the quote, or null. Set it via update; the discount shows up in the quote.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage promoCode(Nullable promoCode) { + if (promoCode.isNull()) { + this.promoCode = null; + } else if (promoCode.isEmpty()) { + this.promoCode = Optional.empty(); + } else { + this.promoCode = Optional.of(promoCode.get()); + } + return this; + } + + /** + *

The promo code applied to the quote, or null. Set it via update; the discount shows up in the quote.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage promoCode(String promoCode) { + this.promoCode = Optional.ofNullable(promoCode); + return this; + } + + /** + *

The promo code applied to the quote, or null. Set it via update; the discount shows up in the quote.

+ */ + @java.lang.Override + @JsonSetter(value = "promo_code", nulls = Nulls.SKIP) + public _FinalStage promoCode(Optional promoCode) { + this.promoCode = promoCode; + return this; + } + + /** + *

What the applied code takes off and which charges it covers, or null when no code applies. promo_code is the writable field; this is its resolved semantics — the duration says which future charges the breakdown's upcoming amounts have the discount in.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage promo(Nullable promo) { + if (promo.isNull()) { + this.promo = null; + } else if (promo.isEmpty()) { + this.promo = Optional.empty(); + } else { + this.promo = Optional.of(promo.get()); + } + return this; + } + + /** + *

What the applied code takes off and which charges it covers, or null when no code applies. promo_code is the writable field; this is its resolved semantics — the duration says which future charges the breakdown's upcoming amounts have the discount in.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage promo(CheckoutSessionPromo promo) { + this.promo = Optional.ofNullable(promo); + return this; + } + + /** + *

What the applied code takes off and which charges it covers, or null when no code applies. promo_code is the writable field; this is its resolved semantics — the duration says which future charges the breakdown's upcoming amounts have the discount in.

+ */ + @java.lang.Override + @JsonSetter(value = "promo", nulls = Nulls.SKIP) + public _FinalStage promo(Optional promo) { + this.promo = promo; + return this; + } + + /** + *

The buyer's phone number, or null. Collected when the session publishes a phone_number requirement (the seller collects numbers), set through update, and recorded against the order. Buyer-typed and unverified — sellers who VERIFY numbers get the verify_phone next action instead, which writes to the buyer's account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(Nullable phoneNumber) { + if (phoneNumber.isNull()) { + this.phoneNumber = null; + } else if (phoneNumber.isEmpty()) { + this.phoneNumber = Optional.empty(); + } else { + this.phoneNumber = Optional.of(phoneNumber.get()); + } + return this; + } + + /** + *

The buyer's phone number, or null. Collected when the session publishes a phone_number requirement (the seller collects numbers), set through update, and recorded against the order. Buyer-typed and unverified — sellers who VERIFY numbers get the verify_phone next action instead, which writes to the buyer's account.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage phoneNumber(String phoneNumber) { + this.phoneNumber = Optional.ofNullable(phoneNumber); + return this; + } + + /** + *

The buyer's phone number, or null. Collected when the session publishes a phone_number requirement (the seller collects numbers), set through update, and recorded against the order. Buyer-typed and unverified — sellers who VERIFY numbers get the verify_phone next action instead, which writes to the buyer's account.

+ */ + @java.lang.Override + @JsonSetter(value = "phone_number", nulls = Nulls.SKIP) + public _FinalStage phoneNumber(Optional phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + *

The configuration governing this session, resolved through every layer — the checkout configuration it was mounted from, the plan's, and the account's. Apply it over the payment method types catalogue for the offerable set. null means nothing is configured at any layer: platform defaults apply.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentMethodConfiguration( + Nullable paymentMethodConfiguration) { + if (paymentMethodConfiguration.isNull()) { + this.paymentMethodConfiguration = null; + } else if (paymentMethodConfiguration.isEmpty()) { + this.paymentMethodConfiguration = Optional.empty(); + } else { + this.paymentMethodConfiguration = Optional.of(paymentMethodConfiguration.get()); + } + return this; + } + + /** + *

The configuration governing this session, resolved through every layer — the checkout configuration it was mounted from, the plan's, and the account's. Apply it over the payment method types catalogue for the offerable set. null means nothing is configured at any layer: platform defaults apply.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentMethodConfiguration( + CheckoutSessionPaymentMethodConfiguration paymentMethodConfiguration) { + this.paymentMethodConfiguration = Optional.ofNullable(paymentMethodConfiguration); + return this; + } + + /** + *

The configuration governing this session, resolved through every layer — the checkout configuration it was mounted from, the plan's, and the account's. Apply it over the payment method types catalogue for the offerable set. null means nothing is configured at any layer: platform defaults apply.

+ */ + @java.lang.Override + @JsonSetter(value = "payment_method_configuration", nulls = Nulls.SKIP) + public _FinalStage paymentMethodConfiguration( + Optional paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } + + /** + *

The payment the confirm created, or null while none exists. Read it with its status: a completed session's payment can still be requires_action (a step remains) or processing (accepted, settling). failed is a transient reading — a charge that decisively dies reopens the session on the next read, unbinding the dead payment and recording the failure on last_confirm_error. Anything the charge still needs comes through next_action, which is also where the payment's own credential lives.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage payment(Nullable payment) { + if (payment.isNull()) { + this.payment = null; + } else if (payment.isEmpty()) { + this.payment = Optional.empty(); + } else { + this.payment = Optional.of(payment.get()); + } + return this; + } + + /** + *

The payment the confirm created, or null while none exists. Read it with its status: a completed session's payment can still be requires_action (a step remains) or processing (accepted, settling). failed is a transient reading — a charge that decisively dies reopens the session on the next read, unbinding the dead payment and recording the failure on last_confirm_error. Anything the charge still needs comes through next_action, which is also where the payment's own credential lives.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage payment(CheckoutSessionPayment payment) { + this.payment = Optional.ofNullable(payment); + return this; + } + + /** + *

The payment the confirm created, or null while none exists. Read it with its status: a completed session's payment can still be requires_action (a step remains) or processing (accepted, settling). failed is a transient reading — a charge that decisively dies reopens the session on the next read, unbinding the dead payment and recording the failure on last_confirm_error. Anything the charge still needs comes through next_action, which is also where the payment's own credential lives.

+ */ + @java.lang.Override + @JsonSetter(value = "payment", nulls = Nulls.SKIP) + public _FinalStage payment(Optional payment) { + this.payment = payment; + return this; + } + + /** + *

The one thing to do now, or null when there is nothing. Do it, re-read the session, and repeat until it is null. A completed session with no next_action has nothing left to do — whether the checkout WENT THROUGH is the result's own status (payment.status, or entry.status for a waitlist join): a charge that decisively dies REOPENS the session on the next read, with the failure on last_confirm_error — so a failed result is a transient reading, never a resting state, and nothing about it may be presented as a success. type picks the shape, and each type carries only its own fields: switch on type and the payload it needs is there; a type you do not recognize is safe to skip when it is not blocking. blocking says whether the flow may move past it — read it rather than inferring it from the type. Before the charge, blocking means the buyer cannot pay until it is done. complete is the attempt's own unfinished ceremony — a 3D Secure challenge, a bank redirect — and one executor serves it whatever its kind: hand its client_secret to the payments element's handleNextAction. After it, wait_for_payment is blocking because the money is still moving and everything past that point would tell the buyer their order landed — hold, wait poll_after_seconds, and read again. The post-completion actions (upgrade_authentication, redirect, await_claim) are advisory: the purchase stands either way. After completion the action can also depend on WHO is reading: a signed-in buyer may be handed the redirect where an anonymous read of the same session gets await_claim — told to check their email to claim the purchase, or that the checkout finished on another device — and a read from outside whop.com's own pages (an embedded element) may be handed a redirect whose destination is whop.com's checkout-finish page instead of the seller's: execute it like any other redirect, and treat the URL as the credential it carries. This is an instruction, never the gate: confirm re-checks everything for itself, so a client that skips a blocking action is refused all the same. upgrade_authentication carries its own recipe (email, sign_in_intent); when its session_intent_id is non-null, the reader's own mid-checkout sign-in already proved the first factor and the recipe collapses to its last step — call that session intent's upgrade endpoint directly (the credential the sign-in installed authorizes it) and collect only what the login still owes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage nextAction(Nullable nextAction) { + if (nextAction.isNull()) { + this.nextAction = null; + } else if (nextAction.isEmpty()) { + this.nextAction = Optional.empty(); + } else { + this.nextAction = Optional.of(nextAction.get()); + } + return this; + } + + /** + *

The one thing to do now, or null when there is nothing. Do it, re-read the session, and repeat until it is null. A completed session with no next_action has nothing left to do — whether the checkout WENT THROUGH is the result's own status (payment.status, or entry.status for a waitlist join): a charge that decisively dies REOPENS the session on the next read, with the failure on last_confirm_error — so a failed result is a transient reading, never a resting state, and nothing about it may be presented as a success. type picks the shape, and each type carries only its own fields: switch on type and the payload it needs is there; a type you do not recognize is safe to skip when it is not blocking. blocking says whether the flow may move past it — read it rather than inferring it from the type. Before the charge, blocking means the buyer cannot pay until it is done. complete is the attempt's own unfinished ceremony — a 3D Secure challenge, a bank redirect — and one executor serves it whatever its kind: hand its client_secret to the payments element's handleNextAction. After it, wait_for_payment is blocking because the money is still moving and everything past that point would tell the buyer their order landed — hold, wait poll_after_seconds, and read again. The post-completion actions (upgrade_authentication, redirect, await_claim) are advisory: the purchase stands either way. After completion the action can also depend on WHO is reading: a signed-in buyer may be handed the redirect where an anonymous read of the same session gets await_claim — told to check their email to claim the purchase, or that the checkout finished on another device — and a read from outside whop.com's own pages (an embedded element) may be handed a redirect whose destination is whop.com's checkout-finish page instead of the seller's: execute it like any other redirect, and treat the URL as the credential it carries. This is an instruction, never the gate: confirm re-checks everything for itself, so a client that skips a blocking action is refused all the same. upgrade_authentication carries its own recipe (email, sign_in_intent); when its session_intent_id is non-null, the reader's own mid-checkout sign-in already proved the first factor and the recipe collapses to its last step — call that session intent's upgrade endpoint directly (the credential the sign-in installed authorizes it) and collect only what the login still owes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage nextAction(CheckoutSessionNextAction nextAction) { + this.nextAction = Optional.ofNullable(nextAction); + return this; + } + + /** + *

The one thing to do now, or null when there is nothing. Do it, re-read the session, and repeat until it is null. A completed session with no next_action has nothing left to do — whether the checkout WENT THROUGH is the result's own status (payment.status, or entry.status for a waitlist join): a charge that decisively dies REOPENS the session on the next read, with the failure on last_confirm_error — so a failed result is a transient reading, never a resting state, and nothing about it may be presented as a success. type picks the shape, and each type carries only its own fields: switch on type and the payload it needs is there; a type you do not recognize is safe to skip when it is not blocking. blocking says whether the flow may move past it — read it rather than inferring it from the type. Before the charge, blocking means the buyer cannot pay until it is done. complete is the attempt's own unfinished ceremony — a 3D Secure challenge, a bank redirect — and one executor serves it whatever its kind: hand its client_secret to the payments element's handleNextAction. After it, wait_for_payment is blocking because the money is still moving and everything past that point would tell the buyer their order landed — hold, wait poll_after_seconds, and read again. The post-completion actions (upgrade_authentication, redirect, await_claim) are advisory: the purchase stands either way. After completion the action can also depend on WHO is reading: a signed-in buyer may be handed the redirect where an anonymous read of the same session gets await_claim — told to check their email to claim the purchase, or that the checkout finished on another device — and a read from outside whop.com's own pages (an embedded element) may be handed a redirect whose destination is whop.com's checkout-finish page instead of the seller's: execute it like any other redirect, and treat the URL as the credential it carries. This is an instruction, never the gate: confirm re-checks everything for itself, so a client that skips a blocking action is refused all the same. upgrade_authentication carries its own recipe (email, sign_in_intent); when its session_intent_id is non-null, the reader's own mid-checkout sign-in already proved the first factor and the recipe collapses to its last step — call that session intent's upgrade endpoint directly (the credential the sign-in installed authorizes it) and collect only what the login still owes.

+ */ + @java.lang.Override + @JsonSetter(value = "next_action", nulls = Nulls.SKIP) + public _FinalStage nextAction(Optional nextAction) { + this.nextAction = nextAction; + return this; + } + + /** + *

Free-form string-to-string map set at create. Whop never interprets it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage metadata(Nullable>> metadata) { + if (metadata.isNull()) { + this.metadata = null; + } else if (metadata.isEmpty()) { + this.metadata = Optional.empty(); + } else { + this.metadata = Optional.of(metadata.get()); + } + return this; + } + + /** + *

Free-form string-to-string map set at create. Whop never interprets it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage metadata(Map> metadata) { + this.metadata = Optional.ofNullable(metadata); + return this; + } + + /** + *

Free-form string-to-string map set at create. Whop never interprets it.

+ */ + @java.lang.Override + @JsonSetter(value = "metadata", nulls = Nulls.SKIP) + public _FinalStage metadata(Optional>> metadata) { + this.metadata = metadata; + return this; + } + + /** + *

Why the most recent confirm attempt did not complete, or null. Only terminal refusals land here — anything the buyer can resolve is a next_action instead. The session stays open; fix what the code names and confirm again.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage lastConfirmError(Nullable lastConfirmError) { + if (lastConfirmError.isNull()) { + this.lastConfirmError = null; + } else if (lastConfirmError.isEmpty()) { + this.lastConfirmError = Optional.empty(); + } else { + this.lastConfirmError = Optional.of(lastConfirmError.get()); + } + return this; + } + + /** + *

Why the most recent confirm attempt did not complete, or null. Only terminal refusals land here — anything the buyer can resolve is a next_action instead. The session stays open; fix what the code names and confirm again.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage lastConfirmError(CheckoutSessionConfirmError lastConfirmError) { + this.lastConfirmError = Optional.ofNullable(lastConfirmError); + return this; + } + + /** + *

Why the most recent confirm attempt did not complete, or null. Only terminal refusals land here — anything the buyer can resolve is a next_action instead. The session stays open; fix what the code names and confirm again.

+ */ + @java.lang.Override + @JsonSetter(value = "last_confirm_error", nulls = Nulls.SKIP) + public _FinalStage lastConfirmError(Optional lastConfirmError) { + this.lastConfirmError = lastConfirmError; + return this; + } + + @java.lang.Override + public _FinalStage addAllItems(List items) { + if (items != null) { + this.items.addAll(items); + } + return this; + } + + @java.lang.Override + public _FinalStage addItems(CheckoutSessionItem items) { + this.items.add(items); + return this; + } + + @java.lang.Override + @JsonSetter(value = "items", nulls = Nulls.SKIP) + public _FinalStage items(List items) { + this.items.clear(); + if (items != null) { + this.items.addAll(items); + } + return this; + } + + /** + *

When this checkout's invoice is due, as an ISO 8601 timestamp — null for everything that is not an invoice checkout, and for an invoice without a due date. Present when the plan collects a seller-issued invoice; a surface should state the date, and a date in the past reads as overdue.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage invoiceDueAt(Nullable invoiceDueAt) { + if (invoiceDueAt.isNull()) { + this.invoiceDueAt = null; + } else if (invoiceDueAt.isEmpty()) { + this.invoiceDueAt = Optional.empty(); + } else { + this.invoiceDueAt = Optional.of(invoiceDueAt.get()); + } + return this; + } + + /** + *

When this checkout's invoice is due, as an ISO 8601 timestamp — null for everything that is not an invoice checkout, and for an invoice without a due date. Present when the plan collects a seller-issued invoice; a surface should state the date, and a date in the past reads as overdue.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage invoiceDueAt(String invoiceDueAt) { + this.invoiceDueAt = Optional.ofNullable(invoiceDueAt); + return this; + } + + /** + *

When this checkout's invoice is due, as an ISO 8601 timestamp — null for everything that is not an invoice checkout, and for an invoice without a due date. Present when the plan collects a seller-issued invoice; a surface should state the date, and a date in the past reads as overdue.

+ */ + @java.lang.Override + @JsonSetter(value = "invoice_due_at", nulls = Nulls.SKIP) + public _FinalStage invoiceDueAt(Optional invoiceDueAt) { + this.invoiceDueAt = invoiceDueAt; + return this; + } + + /** + *

The waitlist entry the confirm created, or null. Only a waitlist plan produces one: joining charges nothing — the payment method is saved and the seller charges it if they accept the entry — so a completed waitlist session carries an entry and a null payment. Read it with its status: succeeded means the join stands; failed (the card save died — the buyer is not on the waitlist) is transient, reopening the session on the next read with the failure on last_confirm_error.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage entry(Nullable entry) { + if (entry.isNull()) { + this.entry = null; + } else if (entry.isEmpty()) { + this.entry = Optional.empty(); + } else { + this.entry = Optional.of(entry.get()); + } + return this; + } + + /** + *

The waitlist entry the confirm created, or null. Only a waitlist plan produces one: joining charges nothing — the payment method is saved and the seller charges it if they accept the entry — so a completed waitlist session carries an entry and a null payment. Read it with its status: succeeded means the join stands; failed (the card save died — the buyer is not on the waitlist) is transient, reopening the session on the next read with the failure on last_confirm_error.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage entry(CheckoutSessionEntry entry) { + this.entry = Optional.ofNullable(entry); + return this; + } + + /** + *

The waitlist entry the confirm created, or null. Only a waitlist plan produces one: joining charges nothing — the payment method is saved and the seller charges it if they accept the entry — so a completed waitlist session carries an entry and a null payment. Read it with its status: succeeded means the join stands; failed (the card save died — the buyer is not on the waitlist) is transient, reopening the session on the next read with the failure on last_confirm_error.

+ */ + @java.lang.Override + @JsonSetter(value = "entry", nulls = Nulls.SKIP) + public _FinalStage entry(Optional entry) { + this.entry = entry; + return this; + } + + @java.lang.Override + public _FinalStage addAllCustomFieldResponses(List customFieldResponses) { + if (customFieldResponses != null) { + this.customFieldResponses.addAll(customFieldResponses); + } + return this; + } + + @java.lang.Override + public _FinalStage addCustomFieldResponses(CheckoutSessionCustomFieldResponse customFieldResponses) { + this.customFieldResponses.add(customFieldResponses); + return this; + } + + @java.lang.Override + @JsonSetter(value = "custom_field_responses", nulls = Nulls.SKIP) + public _FinalStage customFieldResponses(List customFieldResponses) { + this.customFieldResponses.clear(); + if (customFieldResponses != null) { + this.customFieldResponses.addAll(customFieldResponses); + } + return this; + } + + /** + *

The session's one credential — returned by create, and echoed on a session read authenticated with it (or with the checkout's own resume cookie, which holds the same value). Every other call authenticates with it; treat it like a password for this checkout.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage clientSecret(String clientSecret) { + this.clientSecret = Optional.ofNullable(clientSecret); + return this; + } + + /** + *

The session's one credential — returned by create, and echoed on a session read authenticated with it (or with the checkout's own resume cookie, which holds the same value). Every other call authenticates with it; treat it like a password for this checkout.

+ */ + @java.lang.Override + @JsonSetter(value = "client_secret", nulls = Nulls.SKIP) + public _FinalStage clientSecret(Optional clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + *

The seller's checkout configuration this session was mounted from (ch_…), or null when it was opened directly from a plan. Its presets seeded this session at create.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage checkoutConfiguration(Nullable checkoutConfiguration) { + if (checkoutConfiguration.isNull()) { + this.checkoutConfiguration = null; + } else if (checkoutConfiguration.isEmpty()) { + this.checkoutConfiguration = Optional.empty(); + } else { + this.checkoutConfiguration = Optional.of(checkoutConfiguration.get()); + } + return this; + } + + /** + *

The seller's checkout configuration this session was mounted from (ch_…), or null when it was opened directly from a plan. Its presets seeded this session at create.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage checkoutConfiguration(String checkoutConfiguration) { + this.checkoutConfiguration = Optional.ofNullable(checkoutConfiguration); + return this; + } + + /** + *

The seller's checkout configuration this session was mounted from (ch_…), or null when it was opened directly from a plan. Its presets seeded this session at create.

+ */ + @java.lang.Override + @JsonSetter(value = "checkout_configuration", nulls = Nulls.SKIP) + public _FinalStage checkoutConfiguration(Optional checkoutConfiguration) { + this.checkoutConfiguration = checkoutConfiguration; + return this; + } + + /** + *

How the buyer's identity was established — the mechanism behind buyer_identity, so a checkout stays explicable long after it completed. null before a buyer is resolved. New mechanisms are added over time.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage buyerIdentityMethod(Nullable buyerIdentityMethod) { + if (buyerIdentityMethod.isNull()) { + this.buyerIdentityMethod = null; + } else if (buyerIdentityMethod.isEmpty()) { + this.buyerIdentityMethod = Optional.empty(); + } else { + this.buyerIdentityMethod = Optional.of(buyerIdentityMethod.get()); + } + return this; + } + + /** + *

How the buyer's identity was established — the mechanism behind buyer_identity, so a checkout stays explicable long after it completed. null before a buyer is resolved. New mechanisms are added over time.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage buyerIdentityMethod(CheckoutSessionBuyerIdentityMethod buyerIdentityMethod) { + this.buyerIdentityMethod = Optional.ofNullable(buyerIdentityMethod); + return this; + } + + /** + *

How the buyer's identity was established — the mechanism behind buyer_identity, so a checkout stays explicable long after it completed. null before a buyer is resolved. New mechanisms are added over time.

+ */ + @java.lang.Override + @JsonSetter(value = "buyer_identity_method", nulls = Nulls.SKIP) + public _FinalStage buyerIdentityMethod(Optional buyerIdentityMethod) { + this.buyerIdentityMethod = buyerIdentityMethod; + return this; + } + + /** + *

When the buyer's identity was last established or strengthened, as an ISO 8601 timestamp. null before a buyer is resolved.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage buyerIdentityAt(Nullable buyerIdentityAt) { + if (buyerIdentityAt.isNull()) { + this.buyerIdentityAt = null; + } else if (buyerIdentityAt.isEmpty()) { + this.buyerIdentityAt = Optional.empty(); + } else { + this.buyerIdentityAt = Optional.of(buyerIdentityAt.get()); + } + return this; + } + + /** + *

When the buyer's identity was last established or strengthened, as an ISO 8601 timestamp. null before a buyer is resolved.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage buyerIdentityAt(String buyerIdentityAt) { + this.buyerIdentityAt = Optional.ofNullable(buyerIdentityAt); + return this; + } + + /** + *

When the buyer's identity was last established or strengthened, as an ISO 8601 timestamp. null before a buyer is resolved.

+ */ + @java.lang.Override + @JsonSetter(value = "buyer_identity_at", nulls = Nulls.SKIP) + public _FinalStage buyerIdentityAt(Optional buyerIdentityAt) { + this.buyerIdentityAt = buyerIdentityAt; + return this; + } + + /** + *

How well this checkout knows its buyer, or null before one is resolved. attributed means an account was matched from what the buyer typed — it says who the purchase is for and nothing about who is at the keyboard. authenticated means the person proved they hold that account during this checkout. Only authenticated may be handed anything that acts as the buyer, and the value only strengthens.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage buyerIdentity(Nullable buyerIdentity) { + if (buyerIdentity.isNull()) { + this.buyerIdentity = null; + } else if (buyerIdentity.isEmpty()) { + this.buyerIdentity = Optional.empty(); + } else { + this.buyerIdentity = Optional.of(buyerIdentity.get()); + } + return this; + } + + /** + *

How well this checkout knows its buyer, or null before one is resolved. attributed means an account was matched from what the buyer typed — it says who the purchase is for and nothing about who is at the keyboard. authenticated means the person proved they hold that account during this checkout. Only authenticated may be handed anything that acts as the buyer, and the value only strengthens.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage buyerIdentity(CheckoutSessionBuyerIdentity buyerIdentity) { + this.buyerIdentity = Optional.ofNullable(buyerIdentity); + return this; + } + + /** + *

How well this checkout knows its buyer, or null before one is resolved. attributed means an account was matched from what the buyer typed — it says who the purchase is for and nothing about who is at the keyboard. authenticated means the person proved they hold that account during this checkout. Only authenticated may be handed anything that acts as the buyer, and the value only strengthens.

+ */ + @java.lang.Override + @JsonSetter(value = "buyer_identity", nulls = Nulls.SKIP) + public _FinalStage buyerIdentity(Optional buyerIdentity) { + this.buyerIdentity = buyerIdentity; + return this; + } + + /** + *

The buyer's user account (user_…), once one has been resolved for this checkout — null until then. Read-only, and read it together with buyer_identity: attributed names the account the purchase is for and proves nothing about who is at the keyboard.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage buyerId(Nullable buyerId) { + if (buyerId.isNull()) { + this.buyerId = null; + } else if (buyerId.isEmpty()) { + this.buyerId = Optional.empty(); + } else { + this.buyerId = Optional.of(buyerId.get()); + } + return this; + } + + /** + *

The buyer's user account (user_…), once one has been resolved for this checkout — null until then. Read-only, and read it together with buyer_identity: attributed names the account the purchase is for and proves nothing about who is at the keyboard.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage buyerId(String buyerId) { + this.buyerId = Optional.ofNullable(buyerId); + return this; + } + + /** + *

The buyer's user account (user_…), once one has been resolved for this checkout — null until then. Read-only, and read it together with buyer_identity: attributed names the account the purchase is for and proves nothing about who is at the keyboard.

+ */ + @java.lang.Override + @JsonSetter(value = "buyer_id", nulls = Nulls.SKIP) + public _FinalStage buyerId(Optional buyerId) { + this.buyerId = buyerId; + return this; + } + + /** + *

The buyer's email, once one has been resolved for this checkout — null until then. Read-only, and read it together with buyer_identity: an address alone does not mean the person holds it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage buyerEmail(Nullable buyerEmail) { + if (buyerEmail.isNull()) { + this.buyerEmail = null; + } else if (buyerEmail.isEmpty()) { + this.buyerEmail = Optional.empty(); + } else { + this.buyerEmail = Optional.of(buyerEmail.get()); + } + return this; + } + + /** + *

The buyer's email, once one has been resolved for this checkout — null until then. Read-only, and read it together with buyer_identity: an address alone does not mean the person holds it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage buyerEmail(String buyerEmail) { + this.buyerEmail = Optional.ofNullable(buyerEmail); + return this; + } + + /** + *

The buyer's email, once one has been resolved for this checkout — null until then. Read-only, and read it together with buyer_identity: an address alone does not mean the person holds it.

+ */ + @java.lang.Override + @JsonSetter(value = "buyer_email", nulls = Nulls.SKIP) + public _FinalStage buyerEmail(Optional buyerEmail) { + this.buyerEmail = buyerEmail; + return this; + } + + /** + *

The seller's checkout appearance, resolved configuration first, then plan, then account. null when nobody set any.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage branding(Nullable branding) { + if (branding.isNull()) { + this.branding = null; + } else if (branding.isEmpty()) { + this.branding = Optional.empty(); + } else { + this.branding = Optional.of(branding.get()); + } + return this; + } + + /** + *

The seller's checkout appearance, resolved configuration first, then plan, then account. null when nobody set any.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage branding(CheckoutSessionBranding branding) { + this.branding = Optional.ofNullable(branding); + return this; + } + + /** + *

The seller's checkout appearance, resolved configuration first, then plan, then account. null when nobody set any.

+ */ + @java.lang.Override + @JsonSetter(value = "branding", nulls = Nulls.SKIP) + public _FinalStage branding(Optional branding) { + this.branding = branding; + return this; + } + + @java.lang.Override + public _FinalStage addAllAvailableCurrencies(List availableCurrencies) { + if (availableCurrencies != null) { + this.availableCurrencies.addAll(availableCurrencies); + } + return this; + } + + @java.lang.Override + public _FinalStage addAvailableCurrencies(String availableCurrencies) { + this.availableCurrencies.add(availableCurrencies); + return this; + } + + @java.lang.Override + @JsonSetter(value = "available_currencies", nulls = Nulls.SKIP) + public _FinalStage availableCurrencies(List availableCurrencies) { + this.availableCurrencies.clear(); + if (availableCurrencies != null) { + this.availableCurrencies.addAll(availableCurrencies); + } + return this; + } + + /** + *

The affiliate this checkout is attributed to, or null. Set at create only.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage affiliateCode(Nullable affiliateCode) { + if (affiliateCode.isNull()) { + this.affiliateCode = null; + } else if (affiliateCode.isEmpty()) { + this.affiliateCode = Optional.empty(); + } else { + this.affiliateCode = Optional.of(affiliateCode.get()); + } + return this; + } + + /** + *

The affiliate this checkout is attributed to, or null. Set at create only.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage affiliateCode(String affiliateCode) { + this.affiliateCode = Optional.ofNullable(affiliateCode); + return this; + } + + /** + *

The affiliate this checkout is attributed to, or null. Set at create only.

+ */ + @java.lang.Override + @JsonSetter(value = "affiliate_code", nulls = Nulls.SKIP) + public _FinalStage affiliateCode(Optional affiliateCode) { + this.affiliateCode = affiliateCode; + return this; + } + + @java.lang.Override + public CheckoutSession build() { + return new CheckoutSession( + affiliateCode, + availableCurrencies, + branding, + buyerEmail, + buyerId, + buyerIdentity, + buyerIdentityAt, + buyerIdentityMethod, + checkoutConfiguration, + clientSecret, + collectTaxId, + createdAt, + ctaLabel, + customFieldResponses, + displayCurrency, + entry, + expiresAt, + id, + invoiceDueAt, + items, + lastConfirmError, + metadata, + mode, + nextAction, + object, + payment, + paymentMethodConfiguration, + paymentMethodRequired, + phoneNumber, + promo, + promoCode, + quote, + redirectUrl, + requirements, + returnUrl, + seller, + shippingAddress, + showPromoCodeInput, + status, + taxBehavior, + taxId, + threeDsLevel, + topUpMembership, + transfer, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionAuthenticateAction.java b/src/main/java/com/whop/api/types/CheckoutSessionAuthenticateAction.java new file mode 100644 index 00000000..be284022 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionAuthenticateAction.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionAuthenticateAction.Builder.class) +public final class CheckoutSessionAuthenticateAction { + private final boolean blocking; + + private final Map additionalProperties; + + private CheckoutSessionAuthenticateAction(boolean blocking, Map additionalProperties) { + this.blocking = blocking; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab. + */ + @JsonProperty("blocking") + public boolean getBlocking() { + return blocking; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionAuthenticateAction && equalTo((CheckoutSessionAuthenticateAction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionAuthenticateAction other) { + return blocking == other.blocking; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.blocking); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BlockingStage builder() { + return new Builder(); + } + + public interface BlockingStage { + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ */ + _FinalStage blocking(boolean blocking); + + Builder from(CheckoutSessionAuthenticateAction other); + } + + public interface _FinalStage { + CheckoutSessionAuthenticateAction build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BlockingStage, _FinalStage { + private boolean blocking; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionAuthenticateAction other) { + blocking(other.getBlocking()); + return this; + } + + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("blocking") + public _FinalStage blocking(boolean blocking) { + this.blocking = blocking; + return this; + } + + @java.lang.Override + public CheckoutSessionAuthenticateAction build() { + return new CheckoutSessionAuthenticateAction(blocking, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionAwaitClaimAction.java b/src/main/java/com/whop/api/types/CheckoutSessionAwaitClaimAction.java new file mode 100644 index 00000000..639c6ce4 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionAwaitClaimAction.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionAwaitClaimAction.Builder.class) +public final class CheckoutSessionAwaitClaimAction { + private final boolean blocking; + + private final CheckoutSessionAwaitClaimActionState state; + + private final Map additionalProperties; + + private CheckoutSessionAwaitClaimAction( + boolean blocking, CheckoutSessionAwaitClaimActionState state, Map additionalProperties) { + this.blocking = blocking; + this.state = state; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab. + */ + @JsonProperty("blocking") + public boolean getBlocking() { + return blocking; + } + + /** + * @return check_email — the claim is not recorded yet: tell the buyer to check their email to claim their purchase. handed_off — the claim is recorded and the checkout finished on another device: this reader keeps seeing it, which is correct — the session never unlocks across devices. + */ + @JsonProperty("state") + public CheckoutSessionAwaitClaimActionState getState() { + return state; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionAwaitClaimAction && equalTo((CheckoutSessionAwaitClaimAction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionAwaitClaimAction other) { + return blocking == other.blocking && state.equals(other.state); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.blocking, this.state); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BlockingStage builder() { + return new Builder(); + } + + public interface BlockingStage { + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ */ + StateStage blocking(boolean blocking); + + Builder from(CheckoutSessionAwaitClaimAction other); + } + + public interface StateStage { + /** + *

check_email — the claim is not recorded yet: tell the buyer to check their email to claim their purchase. handed_off — the claim is recorded and the checkout finished on another device: this reader keeps seeing it, which is correct — the session never unlocks across devices.

+ */ + _FinalStage state(@NotNull CheckoutSessionAwaitClaimActionState state); + } + + public interface _FinalStage { + CheckoutSessionAwaitClaimAction build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BlockingStage, StateStage, _FinalStage { + private boolean blocking; + + private CheckoutSessionAwaitClaimActionState state; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionAwaitClaimAction other) { + blocking(other.getBlocking()); + state(other.getState()); + return this; + } + + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("blocking") + public StateStage blocking(boolean blocking) { + this.blocking = blocking; + return this; + } + + /** + *

check_email — the claim is not recorded yet: tell the buyer to check their email to claim their purchase. handed_off — the claim is recorded and the checkout finished on another device: this reader keeps seeing it, which is correct — the session never unlocks across devices.

+ *

check_email — the claim is not recorded yet: tell the buyer to check their email to claim their purchase. handed_off — the claim is recorded and the checkout finished on another device: this reader keeps seeing it, which is correct — the session never unlocks across devices.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("state") + public _FinalStage state(@NotNull CheckoutSessionAwaitClaimActionState state) { + this.state = Objects.requireNonNull(state, "state must not be null"); + return this; + } + + @java.lang.Override + public CheckoutSessionAwaitClaimAction build() { + return new CheckoutSessionAwaitClaimAction(blocking, state, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionAwaitClaimActionState.java b/src/main/java/com/whop/api/types/CheckoutSessionAwaitClaimActionState.java new file mode 100644 index 00000000..5f8979c4 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionAwaitClaimActionState.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionAwaitClaimActionState { + public static final CheckoutSessionAwaitClaimActionState HANDED_OFF = + new CheckoutSessionAwaitClaimActionState(Value.HANDED_OFF, "handed_off"); + + public static final CheckoutSessionAwaitClaimActionState CHECK_EMAIL = + new CheckoutSessionAwaitClaimActionState(Value.CHECK_EMAIL, "check_email"); + + private final Value value; + + private final String string; + + CheckoutSessionAwaitClaimActionState(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionAwaitClaimActionState + && this.string.equals(((CheckoutSessionAwaitClaimActionState) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case HANDED_OFF: + return visitor.visitHandedOff(); + case CHECK_EMAIL: + return visitor.visitCheckEmail(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionAwaitClaimActionState valueOf(String value) { + switch (value) { + case "handed_off": + return HANDED_OFF; + case "check_email": + return CHECK_EMAIL; + default: + return new CheckoutSessionAwaitClaimActionState(Value.UNKNOWN, value); + } + } + + public enum Value { + CHECK_EMAIL, + + HANDED_OFF, + + UNKNOWN + } + + public interface Visitor { + T visitCheckEmail(); + + T visitHandedOff(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBranding.java b/src/main/java/com/whop/api/types/CheckoutSessionBranding.java new file mode 100644 index 00000000..9c34ec90 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBranding.java @@ -0,0 +1,659 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBranding.Builder.class) +public final class CheckoutSessionBranding { + private final Optional backgroundColor; + + private final Optional backgroundTextColor; + + private final Optional borderStyle; + + private final Optional buttonColor; + + private final Optional buttonRadius; + + private final Optional buttonTextColor; + + private final Optional containerRadius; + + private final Optional fontFamily; + + private final Optional fontUrl; + + private final Optional inputRadius; + + private final Optional resolvedFontFamily; + + private final Map additionalProperties; + + private CheckoutSessionBranding( + Optional backgroundColor, + Optional backgroundTextColor, + Optional borderStyle, + Optional buttonColor, + Optional buttonRadius, + Optional buttonTextColor, + Optional containerRadius, + Optional fontFamily, + Optional fontUrl, + Optional inputRadius, + Optional resolvedFontFamily, + Map additionalProperties) { + this.backgroundColor = backgroundColor; + this.backgroundTextColor = backgroundTextColor; + this.borderStyle = borderStyle; + this.buttonColor = buttonColor; + this.buttonRadius = buttonRadius; + this.buttonTextColor = buttonTextColor; + this.containerRadius = containerRadius; + this.fontFamily = fontFamily; + this.fontUrl = fontUrl; + this.inputRadius = inputRadius; + this.resolvedFontFamily = resolvedFontFamily; + this.additionalProperties = additionalProperties; + } + + /** + * @return Page background, as a #rrggbb hex color. + */ + @JsonIgnore + public Optional getBackgroundColor() { + if (backgroundColor == null) { + return Optional.empty(); + } + return backgroundColor; + } + + /** + * @return black or white, whichever reads against the background. + */ + @JsonIgnore + public Optional getBackgroundTextColor() { + if (backgroundTextColor == null) { + return Optional.empty(); + } + return backgroundTextColor; + } + + /** + * @return The corner style the seller chose. + */ + @JsonIgnore + public Optional getBorderStyle() { + if (borderStyle == null) { + return Optional.empty(); + } + return borderStyle; + } + + /** + * @return Pay button fill, as a #rrggbb hex color. + */ + @JsonIgnore + public Optional getButtonColor() { + if (buttonColor == null) { + return Optional.empty(); + } + return buttonColor; + } + + /** + * @return The CSS border-radius for buttons at that border style. + */ + @JsonIgnore + public Optional getButtonRadius() { + if (buttonRadius == null) { + return Optional.empty(); + } + return buttonRadius; + } + + /** + * @return black or white, whichever reads against the button. + */ + @JsonIgnore + public Optional getButtonTextColor() { + if (buttonTextColor == null) { + return Optional.empty(); + } + return buttonTextColor; + } + + /** + * @return The CSS border-radius for containers at that border style. + */ + @JsonIgnore + public Optional getContainerRadius() { + if (containerRadius == null) { + return Optional.empty(); + } + return containerRadius; + } + + /** + * @return The font the seller chose. + */ + @JsonIgnore + public Optional getFontFamily() { + if (fontFamily == null) { + return Optional.empty(); + } + return fontFamily; + } + + /** + * @return The stylesheet to load for that font, or null for the system font. + */ + @JsonIgnore + public Optional getFontUrl() { + if (fontUrl == null) { + return Optional.empty(); + } + return fontUrl; + } + + /** + * @return The CSS border-radius for inputs at that border style. + */ + @JsonIgnore + public Optional getInputRadius() { + if (inputRadius == null) { + return Optional.empty(); + } + return inputRadius; + } + + /** + * @return The CSS font-family value for that font, or null for the system font. + */ + @JsonIgnore + public Optional getResolvedFontFamily() { + if (resolvedFontFamily == null) { + return Optional.empty(); + } + return resolvedFontFamily; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("background_color") + private Optional _getBackgroundColor() { + return backgroundColor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("background_text_color") + private Optional _getBackgroundTextColor() { + return backgroundTextColor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("border_style") + private Optional _getBorderStyle() { + return borderStyle; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("button_color") + private Optional _getButtonColor() { + return buttonColor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("button_radius") + private Optional _getButtonRadius() { + return buttonRadius; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("button_text_color") + private Optional _getButtonTextColor() { + return buttonTextColor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("container_radius") + private Optional _getContainerRadius() { + return containerRadius; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("font_family") + private Optional _getFontFamily() { + return fontFamily; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("font_url") + private Optional _getFontUrl() { + return fontUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("input_radius") + private Optional _getInputRadius() { + return inputRadius; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("resolved_font_family") + private Optional _getResolvedFontFamily() { + return resolvedFontFamily; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBranding && equalTo((CheckoutSessionBranding) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBranding other) { + return backgroundColor.equals(other.backgroundColor) + && backgroundTextColor.equals(other.backgroundTextColor) + && borderStyle.equals(other.borderStyle) + && buttonColor.equals(other.buttonColor) + && buttonRadius.equals(other.buttonRadius) + && buttonTextColor.equals(other.buttonTextColor) + && containerRadius.equals(other.containerRadius) + && fontFamily.equals(other.fontFamily) + && fontUrl.equals(other.fontUrl) + && inputRadius.equals(other.inputRadius) + && resolvedFontFamily.equals(other.resolvedFontFamily); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.backgroundColor, + this.backgroundTextColor, + this.borderStyle, + this.buttonColor, + this.buttonRadius, + this.buttonTextColor, + this.containerRadius, + this.fontFamily, + this.fontUrl, + this.inputRadius, + this.resolvedFontFamily); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional backgroundColor = Optional.empty(); + + private Optional backgroundTextColor = Optional.empty(); + + private Optional borderStyle = Optional.empty(); + + private Optional buttonColor = Optional.empty(); + + private Optional buttonRadius = Optional.empty(); + + private Optional buttonTextColor = Optional.empty(); + + private Optional containerRadius = Optional.empty(); + + private Optional fontFamily = Optional.empty(); + + private Optional fontUrl = Optional.empty(); + + private Optional inputRadius = Optional.empty(); + + private Optional resolvedFontFamily = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CheckoutSessionBranding other) { + backgroundColor(other.getBackgroundColor()); + backgroundTextColor(other.getBackgroundTextColor()); + borderStyle(other.getBorderStyle()); + buttonColor(other.getButtonColor()); + buttonRadius(other.getButtonRadius()); + buttonTextColor(other.getButtonTextColor()); + containerRadius(other.getContainerRadius()); + fontFamily(other.getFontFamily()); + fontUrl(other.getFontUrl()); + inputRadius(other.getInputRadius()); + resolvedFontFamily(other.getResolvedFontFamily()); + return this; + } + + /** + *

Page background, as a #rrggbb hex color.

+ */ + @JsonSetter(value = "background_color", nulls = Nulls.SKIP) + public Builder backgroundColor(Optional backgroundColor) { + this.backgroundColor = backgroundColor; + return this; + } + + public Builder backgroundColor(String backgroundColor) { + this.backgroundColor = Optional.ofNullable(backgroundColor); + return this; + } + + public Builder backgroundColor(Nullable backgroundColor) { + if (backgroundColor.isNull()) { + this.backgroundColor = null; + } else if (backgroundColor.isEmpty()) { + this.backgroundColor = Optional.empty(); + } else { + this.backgroundColor = Optional.of(backgroundColor.get()); + } + return this; + } + + /** + *

black or white, whichever reads against the background.

+ */ + @JsonSetter(value = "background_text_color", nulls = Nulls.SKIP) + public Builder backgroundTextColor(Optional backgroundTextColor) { + this.backgroundTextColor = backgroundTextColor; + return this; + } + + public Builder backgroundTextColor(String backgroundTextColor) { + this.backgroundTextColor = Optional.ofNullable(backgroundTextColor); + return this; + } + + public Builder backgroundTextColor(Nullable backgroundTextColor) { + if (backgroundTextColor.isNull()) { + this.backgroundTextColor = null; + } else if (backgroundTextColor.isEmpty()) { + this.backgroundTextColor = Optional.empty(); + } else { + this.backgroundTextColor = Optional.of(backgroundTextColor.get()); + } + return this; + } + + /** + *

The corner style the seller chose.

+ */ + @JsonSetter(value = "border_style", nulls = Nulls.SKIP) + public Builder borderStyle(Optional borderStyle) { + this.borderStyle = borderStyle; + return this; + } + + public Builder borderStyle(CheckoutSessionBrandingBorderStyle borderStyle) { + this.borderStyle = Optional.ofNullable(borderStyle); + return this; + } + + public Builder borderStyle(Nullable borderStyle) { + if (borderStyle.isNull()) { + this.borderStyle = null; + } else if (borderStyle.isEmpty()) { + this.borderStyle = Optional.empty(); + } else { + this.borderStyle = Optional.of(borderStyle.get()); + } + return this; + } + + /** + *

Pay button fill, as a #rrggbb hex color.

+ */ + @JsonSetter(value = "button_color", nulls = Nulls.SKIP) + public Builder buttonColor(Optional buttonColor) { + this.buttonColor = buttonColor; + return this; + } + + public Builder buttonColor(String buttonColor) { + this.buttonColor = Optional.ofNullable(buttonColor); + return this; + } + + public Builder buttonColor(Nullable buttonColor) { + if (buttonColor.isNull()) { + this.buttonColor = null; + } else if (buttonColor.isEmpty()) { + this.buttonColor = Optional.empty(); + } else { + this.buttonColor = Optional.of(buttonColor.get()); + } + return this; + } + + /** + *

The CSS border-radius for buttons at that border style.

+ */ + @JsonSetter(value = "button_radius", nulls = Nulls.SKIP) + public Builder buttonRadius(Optional buttonRadius) { + this.buttonRadius = buttonRadius; + return this; + } + + public Builder buttonRadius(String buttonRadius) { + this.buttonRadius = Optional.ofNullable(buttonRadius); + return this; + } + + public Builder buttonRadius(Nullable buttonRadius) { + if (buttonRadius.isNull()) { + this.buttonRadius = null; + } else if (buttonRadius.isEmpty()) { + this.buttonRadius = Optional.empty(); + } else { + this.buttonRadius = Optional.of(buttonRadius.get()); + } + return this; + } + + /** + *

black or white, whichever reads against the button.

+ */ + @JsonSetter(value = "button_text_color", nulls = Nulls.SKIP) + public Builder buttonTextColor(Optional buttonTextColor) { + this.buttonTextColor = buttonTextColor; + return this; + } + + public Builder buttonTextColor(String buttonTextColor) { + this.buttonTextColor = Optional.ofNullable(buttonTextColor); + return this; + } + + public Builder buttonTextColor(Nullable buttonTextColor) { + if (buttonTextColor.isNull()) { + this.buttonTextColor = null; + } else if (buttonTextColor.isEmpty()) { + this.buttonTextColor = Optional.empty(); + } else { + this.buttonTextColor = Optional.of(buttonTextColor.get()); + } + return this; + } + + /** + *

The CSS border-radius for containers at that border style.

+ */ + @JsonSetter(value = "container_radius", nulls = Nulls.SKIP) + public Builder containerRadius(Optional containerRadius) { + this.containerRadius = containerRadius; + return this; + } + + public Builder containerRadius(String containerRadius) { + this.containerRadius = Optional.ofNullable(containerRadius); + return this; + } + + public Builder containerRadius(Nullable containerRadius) { + if (containerRadius.isNull()) { + this.containerRadius = null; + } else if (containerRadius.isEmpty()) { + this.containerRadius = Optional.empty(); + } else { + this.containerRadius = Optional.of(containerRadius.get()); + } + return this; + } + + /** + *

The font the seller chose.

+ */ + @JsonSetter(value = "font_family", nulls = Nulls.SKIP) + public Builder fontFamily(Optional fontFamily) { + this.fontFamily = fontFamily; + return this; + } + + public Builder fontFamily(CheckoutSessionBrandingFontFamily fontFamily) { + this.fontFamily = Optional.ofNullable(fontFamily); + return this; + } + + public Builder fontFamily(Nullable fontFamily) { + if (fontFamily.isNull()) { + this.fontFamily = null; + } else if (fontFamily.isEmpty()) { + this.fontFamily = Optional.empty(); + } else { + this.fontFamily = Optional.of(fontFamily.get()); + } + return this; + } + + /** + *

The stylesheet to load for that font, or null for the system font.

+ */ + @JsonSetter(value = "font_url", nulls = Nulls.SKIP) + public Builder fontUrl(Optional fontUrl) { + this.fontUrl = fontUrl; + return this; + } + + public Builder fontUrl(String fontUrl) { + this.fontUrl = Optional.ofNullable(fontUrl); + return this; + } + + public Builder fontUrl(Nullable fontUrl) { + if (fontUrl.isNull()) { + this.fontUrl = null; + } else if (fontUrl.isEmpty()) { + this.fontUrl = Optional.empty(); + } else { + this.fontUrl = Optional.of(fontUrl.get()); + } + return this; + } + + /** + *

The CSS border-radius for inputs at that border style.

+ */ + @JsonSetter(value = "input_radius", nulls = Nulls.SKIP) + public Builder inputRadius(Optional inputRadius) { + this.inputRadius = inputRadius; + return this; + } + + public Builder inputRadius(String inputRadius) { + this.inputRadius = Optional.ofNullable(inputRadius); + return this; + } + + public Builder inputRadius(Nullable inputRadius) { + if (inputRadius.isNull()) { + this.inputRadius = null; + } else if (inputRadius.isEmpty()) { + this.inputRadius = Optional.empty(); + } else { + this.inputRadius = Optional.of(inputRadius.get()); + } + return this; + } + + /** + *

The CSS font-family value for that font, or null for the system font.

+ */ + @JsonSetter(value = "resolved_font_family", nulls = Nulls.SKIP) + public Builder resolvedFontFamily(Optional resolvedFontFamily) { + this.resolvedFontFamily = resolvedFontFamily; + return this; + } + + public Builder resolvedFontFamily(String resolvedFontFamily) { + this.resolvedFontFamily = Optional.ofNullable(resolvedFontFamily); + return this; + } + + public Builder resolvedFontFamily(Nullable resolvedFontFamily) { + if (resolvedFontFamily.isNull()) { + this.resolvedFontFamily = null; + } else if (resolvedFontFamily.isEmpty()) { + this.resolvedFontFamily = Optional.empty(); + } else { + this.resolvedFontFamily = Optional.of(resolvedFontFamily.get()); + } + return this; + } + + public CheckoutSessionBranding build() { + return new CheckoutSessionBranding( + backgroundColor, + backgroundTextColor, + borderStyle, + buttonColor, + buttonRadius, + buttonTextColor, + containerRadius, + fontFamily, + fontUrl, + inputRadius, + resolvedFontFamily, + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBrandingBorderStyle.java b/src/main/java/com/whop/api/types/CheckoutSessionBrandingBorderStyle.java new file mode 100644 index 00000000..56f2bc62 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBrandingBorderStyle.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBrandingBorderStyle { + public static final CheckoutSessionBrandingBorderStyle RECTANGULAR = + new CheckoutSessionBrandingBorderStyle(Value.RECTANGULAR, "rectangular"); + + public static final CheckoutSessionBrandingBorderStyle ROUNDED = + new CheckoutSessionBrandingBorderStyle(Value.ROUNDED, "rounded"); + + public static final CheckoutSessionBrandingBorderStyle PILL = + new CheckoutSessionBrandingBorderStyle(Value.PILL, "pill"); + + private final Value value; + + private final String string; + + CheckoutSessionBrandingBorderStyle(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBrandingBorderStyle + && this.string.equals(((CheckoutSessionBrandingBorderStyle) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RECTANGULAR: + return visitor.visitRectangular(); + case ROUNDED: + return visitor.visitRounded(); + case PILL: + return visitor.visitPill(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBrandingBorderStyle valueOf(String value) { + switch (value) { + case "rectangular": + return RECTANGULAR; + case "rounded": + return ROUNDED; + case "pill": + return PILL; + default: + return new CheckoutSessionBrandingBorderStyle(Value.UNKNOWN, value); + } + } + + public enum Value { + ROUNDED, + + PILL, + + RECTANGULAR, + + UNKNOWN + } + + public interface Visitor { + T visitRounded(); + + T visitPill(); + + T visitRectangular(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBrandingFontFamily.java b/src/main/java/com/whop/api/types/CheckoutSessionBrandingFontFamily.java new file mode 100644 index 00000000..7d06c409 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBrandingFontFamily.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBrandingFontFamily { + public static final CheckoutSessionBrandingFontFamily ROBOTO = + new CheckoutSessionBrandingFontFamily(Value.ROBOTO, "roboto"); + + public static final CheckoutSessionBrandingFontFamily OPEN_SANS = + new CheckoutSessionBrandingFontFamily(Value.OPEN_SANS, "open_sans"); + + public static final CheckoutSessionBrandingFontFamily SYSTEM = + new CheckoutSessionBrandingFontFamily(Value.SYSTEM, "system"); + + private final Value value; + + private final String string; + + CheckoutSessionBrandingFontFamily(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBrandingFontFamily + && this.string.equals(((CheckoutSessionBrandingFontFamily) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ROBOTO: + return visitor.visitRoboto(); + case OPEN_SANS: + return visitor.visitOpenSans(); + case SYSTEM: + return visitor.visitSystem(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBrandingFontFamily valueOf(String value) { + switch (value) { + case "roboto": + return ROBOTO; + case "open_sans": + return OPEN_SANS; + case "system": + return SYSTEM; + default: + return new CheckoutSessionBrandingFontFamily(Value.UNKNOWN, value); + } + } + + public enum Value { + SYSTEM, + + ROBOTO, + + OPEN_SANS, + + UNKNOWN + } + + public interface Visitor { + T visitSystem(); + + T visitRoboto(); + + T visitOpenSans(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdown.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdown.java new file mode 100644 index 00000000..64c7211a --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdown.java @@ -0,0 +1,387 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdown.Builder.class) +public final class CheckoutSessionBreakdown { + private final List adjustments; + + private final CheckoutSessionBreakdownCurrency currency; + + private final CheckoutSessionBreakdownDisplay display; + + private final List lines; + + private final Money subtotal; + + private final Money total; + + private final List upcoming; + + private final Map additionalProperties; + + private CheckoutSessionBreakdown( + List adjustments, + CheckoutSessionBreakdownCurrency currency, + CheckoutSessionBreakdownDisplay display, + List lines, + Money subtotal, + Money total, + List upcoming, + Map additionalProperties) { + this.adjustments = adjustments; + this.currency = currency; + this.display = display; + this.lines = lines; + this.subtotal = subtotal; + this.total = total; + this.upcoming = upcoming; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("adjustments") + public List getAdjustments() { + return adjustments; + } + + /** + * @return ISO currency every figure below is in, lowercase. Every amount here is a Money object, never a bare number — see subtotal. + */ + @JsonProperty("currency") + public CheckoutSessionBreakdownCurrency getCurrency() { + return currency; + } + + /** + * @return WHAT TO RENDER — the summary's headline and itemized sections, decided server-side from the same computation as the figures above so the two cannot disagree. Render this rather than re-deriving rows from the figures; the figures stay authoritative for arithmetic. + */ + @JsonProperty("display") + public CheckoutSessionBreakdownDisplay getDisplay() { + return display; + } + + @JsonProperty("lines") + public List getLines() { + return lines; + } + + /** + * @return The lines summed, before any adjustment. + */ + @JsonProperty("subtotal") + public Money getSubtotal() { + return subtotal; + } + + /** + * @return What confirm charges: the subtotal plus every RESOLVED added adjustment. A pending adjustment is deliberately NOT in it, so the number is never inflated by a figure the buyer cannot yet see itemized — with exclusive tax it therefore grows once tax resolves, and with inclusive tax it does not move at all. Once the session is completed it is what WAS charged: the fee and tax on the order's own receipt, and nothing is pending. + */ + @JsonProperty("total") + public Money getTotal() { + return total; + } + + /** + * @return WHEN the rest is owed — empty for a purchase that is settled today. type picks the shape and each variant carries only its own fields. An order can carry several at once (a split-pay plan alongside a subscription upsell), which is why it is a list. + */ + @JsonProperty("upcoming") + public List getUpcoming() { + return upcoming; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdown && equalTo((CheckoutSessionBreakdown) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdown other) { + return adjustments.equals(other.adjustments) + && currency.equals(other.currency) + && display.equals(other.display) + && lines.equals(other.lines) + && subtotal.equals(other.subtotal) + && total.equals(other.total) + && upcoming.equals(other.upcoming); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.adjustments, this.currency, this.display, this.lines, this.subtotal, this.total, this.upcoming); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CurrencyStage builder() { + return new Builder(); + } + + public interface CurrencyStage { + /** + *

ISO currency every figure below is in, lowercase. Every amount here is a Money object, never a bare number — see subtotal.

+ */ + DisplayStage currency(@NotNull CheckoutSessionBreakdownCurrency currency); + + Builder from(CheckoutSessionBreakdown other); + } + + public interface DisplayStage { + /** + *

WHAT TO RENDER — the summary's headline and itemized sections, decided server-side from the same computation as the figures above so the two cannot disagree. Render this rather than re-deriving rows from the figures; the figures stay authoritative for arithmetic.

+ */ + SubtotalStage display(@NotNull CheckoutSessionBreakdownDisplay display); + } + + public interface SubtotalStage { + /** + *

The lines summed, before any adjustment.

+ */ + TotalStage subtotal(@NotNull Money subtotal); + } + + public interface TotalStage { + /** + *

What confirm charges: the subtotal plus every RESOLVED added adjustment. A pending adjustment is deliberately NOT in it, so the number is never inflated by a figure the buyer cannot yet see itemized — with exclusive tax it therefore grows once tax resolves, and with inclusive tax it does not move at all. Once the session is completed it is what WAS charged: the fee and tax on the order's own receipt, and nothing is pending.

+ */ + _FinalStage total(@NotNull Money total); + } + + public interface _FinalStage { + CheckoutSessionBreakdown build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage adjustments(List adjustments); + + _FinalStage addAdjustments(CheckoutSessionBreakdownAdjustment adjustments); + + _FinalStage addAllAdjustments(List adjustments); + + _FinalStage lines(List lines); + + _FinalStage addLines(CheckoutSessionBreakdownLine lines); + + _FinalStage addAllLines(List lines); + + /** + *

WHEN the rest is owed — empty for a purchase that is settled today. type picks the shape and each variant carries only its own fields. An order can carry several at once (a split-pay plan alongside a subscription upsell), which is why it is a list.

+ */ + _FinalStage upcoming(List upcoming); + + _FinalStage addUpcoming(CheckoutSessionBreakdownUpcoming upcoming); + + _FinalStage addAllUpcoming(List upcoming); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CurrencyStage, DisplayStage, SubtotalStage, TotalStage, _FinalStage { + private CheckoutSessionBreakdownCurrency currency; + + private CheckoutSessionBreakdownDisplay display; + + private Money subtotal; + + private Money total; + + private List upcoming = new ArrayList<>(); + + private List lines = new ArrayList<>(); + + private List adjustments = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionBreakdown other) { + adjustments(other.getAdjustments()); + currency(other.getCurrency()); + display(other.getDisplay()); + lines(other.getLines()); + subtotal(other.getSubtotal()); + total(other.getTotal()); + upcoming(other.getUpcoming()); + return this; + } + + /** + *

ISO currency every figure below is in, lowercase. Every amount here is a Money object, never a bare number — see subtotal.

+ *

ISO currency every figure below is in, lowercase. Every amount here is a Money object, never a bare number — see subtotal.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("currency") + public DisplayStage currency(@NotNull CheckoutSessionBreakdownCurrency currency) { + this.currency = Objects.requireNonNull(currency, "currency must not be null"); + return this; + } + + /** + *

WHAT TO RENDER — the summary's headline and itemized sections, decided server-side from the same computation as the figures above so the two cannot disagree. Render this rather than re-deriving rows from the figures; the figures stay authoritative for arithmetic.

+ *

WHAT TO RENDER — the summary's headline and itemized sections, decided server-side from the same computation as the figures above so the two cannot disagree. Render this rather than re-deriving rows from the figures; the figures stay authoritative for arithmetic.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("display") + public SubtotalStage display(@NotNull CheckoutSessionBreakdownDisplay display) { + this.display = Objects.requireNonNull(display, "display must not be null"); + return this; + } + + /** + *

The lines summed, before any adjustment.

+ *

The lines summed, before any adjustment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("subtotal") + public TotalStage subtotal(@NotNull Money subtotal) { + this.subtotal = Objects.requireNonNull(subtotal, "subtotal must not be null"); + return this; + } + + /** + *

What confirm charges: the subtotal plus every RESOLVED added adjustment. A pending adjustment is deliberately NOT in it, so the number is never inflated by a figure the buyer cannot yet see itemized — with exclusive tax it therefore grows once tax resolves, and with inclusive tax it does not move at all. Once the session is completed it is what WAS charged: the fee and tax on the order's own receipt, and nothing is pending.

+ *

What confirm charges: the subtotal plus every RESOLVED added adjustment. A pending adjustment is deliberately NOT in it, so the number is never inflated by a figure the buyer cannot yet see itemized — with exclusive tax it therefore grows once tax resolves, and with inclusive tax it does not move at all. Once the session is completed it is what WAS charged: the fee and tax on the order's own receipt, and nothing is pending.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("total") + public _FinalStage total(@NotNull Money total) { + this.total = Objects.requireNonNull(total, "total must not be null"); + return this; + } + + /** + *

WHEN the rest is owed — empty for a purchase that is settled today. type picks the shape and each variant carries only its own fields. An order can carry several at once (a split-pay plan alongside a subscription upsell), which is why it is a list.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addAllUpcoming(List upcoming) { + if (upcoming != null) { + this.upcoming.addAll(upcoming); + } + return this; + } + + /** + *

WHEN the rest is owed — empty for a purchase that is settled today. type picks the shape and each variant carries only its own fields. An order can carry several at once (a split-pay plan alongside a subscription upsell), which is why it is a list.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage addUpcoming(CheckoutSessionBreakdownUpcoming upcoming) { + this.upcoming.add(upcoming); + return this; + } + + /** + *

WHEN the rest is owed — empty for a purchase that is settled today. type picks the shape and each variant carries only its own fields. An order can carry several at once (a split-pay plan alongside a subscription upsell), which is why it is a list.

+ */ + @java.lang.Override + @JsonSetter(value = "upcoming", nulls = Nulls.SKIP) + public _FinalStage upcoming(List upcoming) { + this.upcoming.clear(); + if (upcoming != null) { + this.upcoming.addAll(upcoming); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllLines(List lines) { + if (lines != null) { + this.lines.addAll(lines); + } + return this; + } + + @java.lang.Override + public _FinalStage addLines(CheckoutSessionBreakdownLine lines) { + this.lines.add(lines); + return this; + } + + @java.lang.Override + @JsonSetter(value = "lines", nulls = Nulls.SKIP) + public _FinalStage lines(List lines) { + this.lines.clear(); + if (lines != null) { + this.lines.addAll(lines); + } + return this; + } + + @java.lang.Override + public _FinalStage addAllAdjustments(List adjustments) { + if (adjustments != null) { + this.adjustments.addAll(adjustments); + } + return this; + } + + @java.lang.Override + public _FinalStage addAdjustments(CheckoutSessionBreakdownAdjustment adjustments) { + this.adjustments.add(adjustments); + return this; + } + + @java.lang.Override + @JsonSetter(value = "adjustments", nulls = Nulls.SKIP) + public _FinalStage adjustments(List adjustments) { + this.adjustments.clear(); + if (adjustments != null) { + this.adjustments.addAll(adjustments); + } + return this; + } + + @java.lang.Override + public CheckoutSessionBreakdown build() { + return new CheckoutSessionBreakdown( + adjustments, currency, display, lines, subtotal, total, upcoming, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustment.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustment.java new file mode 100644 index 00000000..f46c2662 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustment.java @@ -0,0 +1,364 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdownAdjustment.Builder.class) +public final class CheckoutSessionBreakdownAdjustment { + private final Optional amount; + + private final CheckoutSessionBreakdownAdjustmentApplied applied; + + private final CheckoutSessionBreakdownAdjustmentKind kind; + + private final String label; + + private final Optional rate; + + private final Optional status; + + private final Map additionalProperties; + + private CheckoutSessionBreakdownAdjustment( + Optional amount, + CheckoutSessionBreakdownAdjustmentApplied applied, + CheckoutSessionBreakdownAdjustmentKind kind, + String label, + Optional rate, + Optional status, + Map additionalProperties) { + this.amount = amount; + this.applied = applied; + this.kind = kind; + this.label = label; + this.rate = rate; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return What this adjustment does to the total — negative for a discount. null only while status is pending. + */ + @JsonIgnore + public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } + return amount; + } + + /** + * @return added counts toward the total; included is already inside the lines and is shown for disclosure only (inclusive-tax markets). + */ + @JsonProperty("applied") + public CheckoutSessionBreakdownAdjustmentApplied getApplied() { + return applied; + } + + /** + * @return What changes the price: the promo's discount, the buyer_fee the charge adds, or tax. + */ + @JsonProperty("kind") + public CheckoutSessionBreakdownAdjustmentKind getKind() { + return kind; + } + + /** + * @return What to show the buyer for this row. + */ + @JsonProperty("label") + public String getLabel() { + return label; + } + + /** + * @return The tax row's effective rate as a decimal fraction ("0.0725" is 7.25%) — the tax as a share of the base it was priced on, stated so a surface can label the row with the percentage. Present only on a resolved tax adjustment from calculate_breakdown or calculate_tax; absent on other kinds, on a pending row, and on a completed session's settled row. + */ + @JsonProperty("rate") + public Optional getRate() { + return rate; + } + + /** + * @return Present only on an adjustment with no figure yet — render its row in a loading state and expect calculate_breakdown to resolve it. An adjustment that does not apply is absent from the list entirely, never a zero row. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownAdjustment + && equalTo((CheckoutSessionBreakdownAdjustment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdownAdjustment other) { + return amount.equals(other.amount) + && applied.equals(other.applied) + && kind.equals(other.kind) + && label.equals(other.label) + && rate.equals(other.rate) + && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.amount, this.applied, this.kind, this.label, this.rate, this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AppliedStage builder() { + return new Builder(); + } + + public interface AppliedStage { + /** + *

added counts toward the total; included is already inside the lines and is shown for disclosure only (inclusive-tax markets).

+ */ + KindStage applied(@NotNull CheckoutSessionBreakdownAdjustmentApplied applied); + + Builder from(CheckoutSessionBreakdownAdjustment other); + } + + public interface KindStage { + /** + *

What changes the price: the promo's discount, the buyer_fee the charge adds, or tax.

+ */ + LabelStage kind(@NotNull CheckoutSessionBreakdownAdjustmentKind kind); + } + + public interface LabelStage { + /** + *

What to show the buyer for this row.

+ */ + _FinalStage label(@NotNull String label); + } + + public interface _FinalStage { + CheckoutSessionBreakdownAdjustment build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

What this adjustment does to the total — negative for a discount. null only while status is pending.

+ */ + _FinalStage amount(Optional amount); + + _FinalStage amount(Money amount); + + _FinalStage amount(Nullable amount); + + /** + *

The tax row's effective rate as a decimal fraction ("0.0725" is 7.25%) — the tax as a share of the base it was priced on, stated so a surface can label the row with the percentage. Present only on a resolved tax adjustment from calculate_breakdown or calculate_tax; absent on other kinds, on a pending row, and on a completed session's settled row.

+ */ + _FinalStage rate(Optional rate); + + _FinalStage rate(String rate); + + /** + *

Present only on an adjustment with no figure yet — render its row in a loading state and expect calculate_breakdown to resolve it. An adjustment that does not apply is absent from the list entirely, never a zero row.

+ */ + _FinalStage status(Optional status); + + _FinalStage status(CheckoutSessionBreakdownAdjustmentStatus status); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AppliedStage, KindStage, LabelStage, _FinalStage { + private CheckoutSessionBreakdownAdjustmentApplied applied; + + private CheckoutSessionBreakdownAdjustmentKind kind; + + private String label; + + private Optional status = Optional.empty(); + + private Optional rate = Optional.empty(); + + private Optional amount = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionBreakdownAdjustment other) { + amount(other.getAmount()); + applied(other.getApplied()); + kind(other.getKind()); + label(other.getLabel()); + rate(other.getRate()); + status(other.getStatus()); + return this; + } + + /** + *

added counts toward the total; included is already inside the lines and is shown for disclosure only (inclusive-tax markets).

+ *

added counts toward the total; included is already inside the lines and is shown for disclosure only (inclusive-tax markets).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("applied") + public KindStage applied(@NotNull CheckoutSessionBreakdownAdjustmentApplied applied) { + this.applied = Objects.requireNonNull(applied, "applied must not be null"); + return this; + } + + /** + *

What changes the price: the promo's discount, the buyer_fee the charge adds, or tax.

+ *

What changes the price: the promo's discount, the buyer_fee the charge adds, or tax.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kind") + public LabelStage kind(@NotNull CheckoutSessionBreakdownAdjustmentKind kind) { + this.kind = Objects.requireNonNull(kind, "kind must not be null"); + return this; + } + + /** + *

What to show the buyer for this row.

+ *

What to show the buyer for this row.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("label") + public _FinalStage label(@NotNull String label) { + this.label = Objects.requireNonNull(label, "label must not be null"); + return this; + } + + /** + *

Present only on an adjustment with no figure yet — render its row in a loading state and expect calculate_breakdown to resolve it. An adjustment that does not apply is absent from the list entirely, never a zero row.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(CheckoutSessionBreakdownAdjustmentStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

Present only on an adjustment with no figure yet — render its row in a loading state and expect calculate_breakdown to resolve it. An adjustment that does not apply is absent from the list entirely, never a zero row.

+ */ + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + /** + *

The tax row's effective rate as a decimal fraction ("0.0725" is 7.25%) — the tax as a share of the base it was priced on, stated so a surface can label the row with the percentage. Present only on a resolved tax adjustment from calculate_breakdown or calculate_tax; absent on other kinds, on a pending row, and on a completed session's settled row.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage rate(String rate) { + this.rate = Optional.ofNullable(rate); + return this; + } + + /** + *

The tax row's effective rate as a decimal fraction ("0.0725" is 7.25%) — the tax as a share of the base it was priced on, stated so a surface can label the row with the percentage. Present only on a resolved tax adjustment from calculate_breakdown or calculate_tax; absent on other kinds, on a pending row, and on a completed session's settled row.

+ */ + @java.lang.Override + @JsonSetter(value = "rate", nulls = Nulls.SKIP) + public _FinalStage rate(Optional rate) { + this.rate = rate; + return this; + } + + /** + *

What this adjustment does to the total — negative for a discount. null only while status is pending.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + + /** + *

What this adjustment does to the total — negative for a discount. null only while status is pending.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage amount(Money amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + *

What this adjustment does to the total — negative for a discount. null only while status is pending.

+ */ + @java.lang.Override + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public _FinalStage amount(Optional amount) { + this.amount = amount; + return this; + } + + @java.lang.Override + public CheckoutSessionBreakdownAdjustment build() { + return new CheckoutSessionBreakdownAdjustment( + amount, applied, kind, label, rate, status, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentApplied.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentApplied.java new file mode 100644 index 00000000..7fd4728e --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentApplied.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBreakdownAdjustmentApplied { + public static final CheckoutSessionBreakdownAdjustmentApplied INCLUDED = + new CheckoutSessionBreakdownAdjustmentApplied(Value.INCLUDED, "included"); + + public static final CheckoutSessionBreakdownAdjustmentApplied ADDED = + new CheckoutSessionBreakdownAdjustmentApplied(Value.ADDED, "added"); + + private final Value value; + + private final String string; + + CheckoutSessionBreakdownAdjustmentApplied(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBreakdownAdjustmentApplied + && this.string.equals(((CheckoutSessionBreakdownAdjustmentApplied) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case INCLUDED: + return visitor.visitIncluded(); + case ADDED: + return visitor.visitAdded(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBreakdownAdjustmentApplied valueOf(String value) { + switch (value) { + case "included": + return INCLUDED; + case "added": + return ADDED; + default: + return new CheckoutSessionBreakdownAdjustmentApplied(Value.UNKNOWN, value); + } + } + + public enum Value { + ADDED, + + INCLUDED, + + UNKNOWN + } + + public interface Visitor { + T visitAdded(); + + T visitIncluded(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentKind.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentKind.java new file mode 100644 index 00000000..fb699c25 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentKind.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBreakdownAdjustmentKind { + public static final CheckoutSessionBreakdownAdjustmentKind DISCOUNT = + new CheckoutSessionBreakdownAdjustmentKind(Value.DISCOUNT, "discount"); + + public static final CheckoutSessionBreakdownAdjustmentKind BUYER_FEE = + new CheckoutSessionBreakdownAdjustmentKind(Value.BUYER_FEE, "buyer_fee"); + + public static final CheckoutSessionBreakdownAdjustmentKind TAX = + new CheckoutSessionBreakdownAdjustmentKind(Value.TAX, "tax"); + + private final Value value; + + private final String string; + + CheckoutSessionBreakdownAdjustmentKind(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBreakdownAdjustmentKind + && this.string.equals(((CheckoutSessionBreakdownAdjustmentKind) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DISCOUNT: + return visitor.visitDiscount(); + case BUYER_FEE: + return visitor.visitBuyerFee(); + case TAX: + return visitor.visitTax(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBreakdownAdjustmentKind valueOf(String value) { + switch (value) { + case "discount": + return DISCOUNT; + case "buyer_fee": + return BUYER_FEE; + case "tax": + return TAX; + default: + return new CheckoutSessionBreakdownAdjustmentKind(Value.UNKNOWN, value); + } + } + + public enum Value { + DISCOUNT, + + BUYER_FEE, + + TAX, + + UNKNOWN + } + + public interface Visitor { + T visitDiscount(); + + T visitBuyerFee(); + + T visitTax(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentStatus.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentStatus.java new file mode 100644 index 00000000..f97f8fb8 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownAdjustmentStatus.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBreakdownAdjustmentStatus { + public static final CheckoutSessionBreakdownAdjustmentStatus PENDING = + new CheckoutSessionBreakdownAdjustmentStatus(Value.PENDING, "pending"); + + private final Value value; + + private final String string; + + CheckoutSessionBreakdownAdjustmentStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBreakdownAdjustmentStatus + && this.string.equals(((CheckoutSessionBreakdownAdjustmentStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PENDING: + return visitor.visitPending(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBreakdownAdjustmentStatus valueOf(String value) { + switch (value) { + case "pending": + return PENDING; + default: + return new CheckoutSessionBreakdownAdjustmentStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownCurrency.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownCurrency.java new file mode 100644 index 00000000..9c16c9fe --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownCurrency.java @@ -0,0 +1,966 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBreakdownCurrency { + public static final CheckoutSessionBreakdownCurrency CRC = new CheckoutSessionBreakdownCurrency(Value.CRC, "crc"); + + public static final CheckoutSessionBreakdownCurrency OMR = new CheckoutSessionBreakdownCurrency(Value.OMR, "omr"); + + public static final CheckoutSessionBreakdownCurrency RUB = new CheckoutSessionBreakdownCurrency(Value.RUB, "rub"); + + public static final CheckoutSessionBreakdownCurrency BGN = new CheckoutSessionBreakdownCurrency(Value.BGN, "bgn"); + + public static final CheckoutSessionBreakdownCurrency SAR = new CheckoutSessionBreakdownCurrency(Value.SAR, "sar"); + + public static final CheckoutSessionBreakdownCurrency UYU = new CheckoutSessionBreakdownCurrency(Value.UYU, "uyu"); + + public static final CheckoutSessionBreakdownCurrency TZS = new CheckoutSessionBreakdownCurrency(Value.TZS, "tzs"); + + public static final CheckoutSessionBreakdownCurrency XCD = new CheckoutSessionBreakdownCurrency(Value.XCD, "xcd"); + + public static final CheckoutSessionBreakdownCurrency GTQ = new CheckoutSessionBreakdownCurrency(Value.GTQ, "gtq"); + + public static final CheckoutSessionBreakdownCurrency CHF = new CheckoutSessionBreakdownCurrency(Value.CHF, "chf"); + + public static final CheckoutSessionBreakdownCurrency RON = new CheckoutSessionBreakdownCurrency(Value.RON, "ron"); + + public static final CheckoutSessionBreakdownCurrency PHP = new CheckoutSessionBreakdownCurrency(Value.PHP, "php"); + + public static final CheckoutSessionBreakdownCurrency KES = new CheckoutSessionBreakdownCurrency(Value.KES, "kes"); + + public static final CheckoutSessionBreakdownCurrency XAU = new CheckoutSessionBreakdownCurrency(Value.XAU, "xau"); + + public static final CheckoutSessionBreakdownCurrency BSD = new CheckoutSessionBreakdownCurrency(Value.BSD, "bsd"); + + public static final CheckoutSessionBreakdownCurrency INR = new CheckoutSessionBreakdownCurrency(Value.INR, "inr"); + + public static final CheckoutSessionBreakdownCurrency HKD = new CheckoutSessionBreakdownCurrency(Value.HKD, "hkd"); + + public static final CheckoutSessionBreakdownCurrency JOD = new CheckoutSessionBreakdownCurrency(Value.JOD, "jod"); + + public static final CheckoutSessionBreakdownCurrency MKD = new CheckoutSessionBreakdownCurrency(Value.MKD, "mkd"); + + public static final CheckoutSessionBreakdownCurrency CLP = new CheckoutSessionBreakdownCurrency(Value.CLP, "clp"); + + public static final CheckoutSessionBreakdownCurrency NZD = new CheckoutSessionBreakdownCurrency(Value.NZD, "nzd"); + + public static final CheckoutSessionBreakdownCurrency IDR = new CheckoutSessionBreakdownCurrency(Value.IDR, "idr"); + + public static final CheckoutSessionBreakdownCurrency MOP = new CheckoutSessionBreakdownCurrency(Value.MOP, "mop"); + + public static final CheckoutSessionBreakdownCurrency HUF = new CheckoutSessionBreakdownCurrency(Value.HUF, "huf"); + + public static final CheckoutSessionBreakdownCurrency MAD = new CheckoutSessionBreakdownCurrency(Value.MAD, "mad"); + + public static final CheckoutSessionBreakdownCurrency KHR = new CheckoutSessionBreakdownCurrency(Value.KHR, "khr"); + + public static final CheckoutSessionBreakdownCurrency NGN = new CheckoutSessionBreakdownCurrency(Value.NGN, "ngn"); + + public static final CheckoutSessionBreakdownCurrency THB = new CheckoutSessionBreakdownCurrency(Value.THB, "thb"); + + public static final CheckoutSessionBreakdownCurrency DZD = new CheckoutSessionBreakdownCurrency(Value.DZD, "dzd"); + + public static final CheckoutSessionBreakdownCurrency ARS = new CheckoutSessionBreakdownCurrency(Value.ARS, "ars"); + + public static final CheckoutSessionBreakdownCurrency CAD = new CheckoutSessionBreakdownCurrency(Value.CAD, "cad"); + + public static final CheckoutSessionBreakdownCurrency MYR = new CheckoutSessionBreakdownCurrency(Value.MYR, "myr"); + + public static final CheckoutSessionBreakdownCurrency KRW = new CheckoutSessionBreakdownCurrency(Value.KRW, "krw"); + + public static final CheckoutSessionBreakdownCurrency KZT = new CheckoutSessionBreakdownCurrency(Value.KZT, "kzt"); + + public static final CheckoutSessionBreakdownCurrency ETH = new CheckoutSessionBreakdownCurrency(Value.ETH, "eth"); + + public static final CheckoutSessionBreakdownCurrency COP = new CheckoutSessionBreakdownCurrency(Value.COP, "cop"); + + public static final CheckoutSessionBreakdownCurrency JMD = new CheckoutSessionBreakdownCurrency(Value.JMD, "jmd"); + + public static final CheckoutSessionBreakdownCurrency NAD = new CheckoutSessionBreakdownCurrency(Value.NAD, "nad"); + + public static final CheckoutSessionBreakdownCurrency GYD = new CheckoutSessionBreakdownCurrency(Value.GYD, "gyd"); + + public static final CheckoutSessionBreakdownCurrency KWD = new CheckoutSessionBreakdownCurrency(Value.KWD, "kwd"); + + public static final CheckoutSessionBreakdownCurrency DOP = new CheckoutSessionBreakdownCurrency(Value.DOP, "dop"); + + public static final CheckoutSessionBreakdownCurrency BTC = new CheckoutSessionBreakdownCurrency(Value.BTC, "btc"); + + public static final CheckoutSessionBreakdownCurrency AMD = new CheckoutSessionBreakdownCurrency(Value.AMD, "amd"); + + public static final CheckoutSessionBreakdownCurrency LKR = new CheckoutSessionBreakdownCurrency(Value.LKR, "lkr"); + + public static final CheckoutSessionBreakdownCurrency ALL = new CheckoutSessionBreakdownCurrency(Value.ALL, "all"); + + public static final CheckoutSessionBreakdownCurrency USDT = + new CheckoutSessionBreakdownCurrency(Value.USDT, "usdt"); + + public static final CheckoutSessionBreakdownCurrency TND = new CheckoutSessionBreakdownCurrency(Value.TND, "tnd"); + + public static final CheckoutSessionBreakdownCurrency MUR = new CheckoutSessionBreakdownCurrency(Value.MUR, "mur"); + + public static final CheckoutSessionBreakdownCurrency PEN = new CheckoutSessionBreakdownCurrency(Value.PEN, "pen"); + + public static final CheckoutSessionBreakdownCurrency USD = new CheckoutSessionBreakdownCurrency(Value.USD, "usd"); + + public static final CheckoutSessionBreakdownCurrency APE = new CheckoutSessionBreakdownCurrency(Value.APE, "ape"); + + public static final CheckoutSessionBreakdownCurrency BHD = new CheckoutSessionBreakdownCurrency(Value.BHD, "bhd"); + + public static final CheckoutSessionBreakdownCurrency XOF = new CheckoutSessionBreakdownCurrency(Value.XOF, "xof"); + + public static final CheckoutSessionBreakdownCurrency RWF = new CheckoutSessionBreakdownCurrency(Value.RWF, "rwf"); + + public static final CheckoutSessionBreakdownCurrency GBP = new CheckoutSessionBreakdownCurrency(Value.GBP, "gbp"); + + public static final CheckoutSessionBreakdownCurrency VND = new CheckoutSessionBreakdownCurrency(Value.VND, "vnd"); + + public static final CheckoutSessionBreakdownCurrency MNT = new CheckoutSessionBreakdownCurrency(Value.MNT, "mnt"); + + public static final CheckoutSessionBreakdownCurrency ETB = new CheckoutSessionBreakdownCurrency(Value.ETB, "etb"); + + public static final CheckoutSessionBreakdownCurrency TTD = new CheckoutSessionBreakdownCurrency(Value.TTD, "ttd"); + + public static final CheckoutSessionBreakdownCurrency EUR = new CheckoutSessionBreakdownCurrency(Value.EUR, "eur"); + + public static final CheckoutSessionBreakdownCurrency BRL = new CheckoutSessionBreakdownCurrency(Value.BRL, "brl"); + + public static final CheckoutSessionBreakdownCurrency SEK = new CheckoutSessionBreakdownCurrency(Value.SEK, "sek"); + + public static final CheckoutSessionBreakdownCurrency RSD = new CheckoutSessionBreakdownCurrency(Value.RSD, "rsd"); + + public static final CheckoutSessionBreakdownCurrency UZS = new CheckoutSessionBreakdownCurrency(Value.UZS, "uzs"); + + public static final CheckoutSessionBreakdownCurrency TWD = new CheckoutSessionBreakdownCurrency(Value.TWD, "twd"); + + public static final CheckoutSessionBreakdownCurrency NOK = new CheckoutSessionBreakdownCurrency(Value.NOK, "nok"); + + public static final CheckoutSessionBreakdownCurrency WHOP_USD = + new CheckoutSessionBreakdownCurrency(Value.WHOP_USD, "whop_usd"); + + public static final CheckoutSessionBreakdownCurrency PYG = new CheckoutSessionBreakdownCurrency(Value.PYG, "pyg"); + + public static final CheckoutSessionBreakdownCurrency TRY = new CheckoutSessionBreakdownCurrency(Value.TRY, "try"); + + public static final CheckoutSessionBreakdownCurrency ZAR = new CheckoutSessionBreakdownCurrency(Value.ZAR, "zar"); + + public static final CheckoutSessionBreakdownCurrency PKR = new CheckoutSessionBreakdownCurrency(Value.PKR, "pkr"); + + public static final CheckoutSessionBreakdownCurrency CNY = new CheckoutSessionBreakdownCurrency(Value.CNY, "cny"); + + public static final CheckoutSessionBreakdownCurrency CZK = new CheckoutSessionBreakdownCurrency(Value.CZK, "czk"); + + public static final CheckoutSessionBreakdownCurrency ILS = new CheckoutSessionBreakdownCurrency(Value.ILS, "ils"); + + public static final CheckoutSessionBreakdownCurrency MGA = new CheckoutSessionBreakdownCurrency(Value.MGA, "mga"); + + public static final CheckoutSessionBreakdownCurrency AED = new CheckoutSessionBreakdownCurrency(Value.AED, "aed"); + + public static final CheckoutSessionBreakdownCurrency GHS = new CheckoutSessionBreakdownCurrency(Value.GHS, "ghs"); + + public static final CheckoutSessionBreakdownCurrency BAM = new CheckoutSessionBreakdownCurrency(Value.BAM, "bam"); + + public static final CheckoutSessionBreakdownCurrency JPY = new CheckoutSessionBreakdownCurrency(Value.JPY, "jpy"); + + public static final CheckoutSessionBreakdownCurrency PLN = new CheckoutSessionBreakdownCurrency(Value.PLN, "pln"); + + public static final CheckoutSessionBreakdownCurrency BOB = new CheckoutSessionBreakdownCurrency(Value.BOB, "bob"); + + public static final CheckoutSessionBreakdownCurrency QAR = new CheckoutSessionBreakdownCurrency(Value.QAR, "qar"); + + public static final CheckoutSessionBreakdownCurrency EGP = new CheckoutSessionBreakdownCurrency(Value.EGP, "egp"); + + public static final CheckoutSessionBreakdownCurrency AWG = new CheckoutSessionBreakdownCurrency(Value.AWG, "awg"); + + public static final CheckoutSessionBreakdownCurrency DKK = new CheckoutSessionBreakdownCurrency(Value.DKK, "dkk"); + + public static final CheckoutSessionBreakdownCurrency MDL = new CheckoutSessionBreakdownCurrency(Value.MDL, "mdl"); + + public static final CheckoutSessionBreakdownCurrency MXN = new CheckoutSessionBreakdownCurrency(Value.MXN, "mxn"); + + public static final CheckoutSessionBreakdownCurrency SGD = new CheckoutSessionBreakdownCurrency(Value.SGD, "sgd"); + + public static final CheckoutSessionBreakdownCurrency AUD = new CheckoutSessionBreakdownCurrency(Value.AUD, "aud"); + + public static final CheckoutSessionBreakdownCurrency GMD = new CheckoutSessionBreakdownCurrency(Value.GMD, "gmd"); + + private final Value value; + + private final String string; + + CheckoutSessionBreakdownCurrency(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBreakdownCurrency + && this.string.equals(((CheckoutSessionBreakdownCurrency) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CRC: + return visitor.visitCrc(); + case OMR: + return visitor.visitOmr(); + case RUB: + return visitor.visitRub(); + case BGN: + return visitor.visitBgn(); + case SAR: + return visitor.visitSar(); + case UYU: + return visitor.visitUyu(); + case TZS: + return visitor.visitTzs(); + case XCD: + return visitor.visitXcd(); + case GTQ: + return visitor.visitGtq(); + case CHF: + return visitor.visitChf(); + case RON: + return visitor.visitRon(); + case PHP: + return visitor.visitPhp(); + case KES: + return visitor.visitKes(); + case XAU: + return visitor.visitXau(); + case BSD: + return visitor.visitBsd(); + case INR: + return visitor.visitInr(); + case HKD: + return visitor.visitHkd(); + case JOD: + return visitor.visitJod(); + case MKD: + return visitor.visitMkd(); + case CLP: + return visitor.visitClp(); + case NZD: + return visitor.visitNzd(); + case IDR: + return visitor.visitIdr(); + case MOP: + return visitor.visitMop(); + case HUF: + return visitor.visitHuf(); + case MAD: + return visitor.visitMad(); + case KHR: + return visitor.visitKhr(); + case NGN: + return visitor.visitNgn(); + case THB: + return visitor.visitThb(); + case DZD: + return visitor.visitDzd(); + case ARS: + return visitor.visitArs(); + case CAD: + return visitor.visitCad(); + case MYR: + return visitor.visitMyr(); + case KRW: + return visitor.visitKrw(); + case KZT: + return visitor.visitKzt(); + case ETH: + return visitor.visitEth(); + case COP: + return visitor.visitCop(); + case JMD: + return visitor.visitJmd(); + case NAD: + return visitor.visitNad(); + case GYD: + return visitor.visitGyd(); + case KWD: + return visitor.visitKwd(); + case DOP: + return visitor.visitDop(); + case BTC: + return visitor.visitBtc(); + case AMD: + return visitor.visitAmd(); + case LKR: + return visitor.visitLkr(); + case ALL: + return visitor.visitAll(); + case USDT: + return visitor.visitUsdt(); + case TND: + return visitor.visitTnd(); + case MUR: + return visitor.visitMur(); + case PEN: + return visitor.visitPen(); + case USD: + return visitor.visitUsd(); + case APE: + return visitor.visitApe(); + case BHD: + return visitor.visitBhd(); + case XOF: + return visitor.visitXof(); + case RWF: + return visitor.visitRwf(); + case GBP: + return visitor.visitGbp(); + case VND: + return visitor.visitVnd(); + case MNT: + return visitor.visitMnt(); + case ETB: + return visitor.visitEtb(); + case TTD: + return visitor.visitTtd(); + case EUR: + return visitor.visitEur(); + case BRL: + return visitor.visitBrl(); + case SEK: + return visitor.visitSek(); + case RSD: + return visitor.visitRsd(); + case UZS: + return visitor.visitUzs(); + case TWD: + return visitor.visitTwd(); + case NOK: + return visitor.visitNok(); + case WHOP_USD: + return visitor.visitWhopUsd(); + case PYG: + return visitor.visitPyg(); + case TRY: + return visitor.visitTry(); + case ZAR: + return visitor.visitZar(); + case PKR: + return visitor.visitPkr(); + case CNY: + return visitor.visitCny(); + case CZK: + return visitor.visitCzk(); + case ILS: + return visitor.visitIls(); + case MGA: + return visitor.visitMga(); + case AED: + return visitor.visitAed(); + case GHS: + return visitor.visitGhs(); + case BAM: + return visitor.visitBam(); + case JPY: + return visitor.visitJpy(); + case PLN: + return visitor.visitPln(); + case BOB: + return visitor.visitBob(); + case QAR: + return visitor.visitQar(); + case EGP: + return visitor.visitEgp(); + case AWG: + return visitor.visitAwg(); + case DKK: + return visitor.visitDkk(); + case MDL: + return visitor.visitMdl(); + case MXN: + return visitor.visitMxn(); + case SGD: + return visitor.visitSgd(); + case AUD: + return visitor.visitAud(); + case GMD: + return visitor.visitGmd(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBreakdownCurrency valueOf(String value) { + switch (value) { + case "crc": + return CRC; + case "omr": + return OMR; + case "rub": + return RUB; + case "bgn": + return BGN; + case "sar": + return SAR; + case "uyu": + return UYU; + case "tzs": + return TZS; + case "xcd": + return XCD; + case "gtq": + return GTQ; + case "chf": + return CHF; + case "ron": + return RON; + case "php": + return PHP; + case "kes": + return KES; + case "xau": + return XAU; + case "bsd": + return BSD; + case "inr": + return INR; + case "hkd": + return HKD; + case "jod": + return JOD; + case "mkd": + return MKD; + case "clp": + return CLP; + case "nzd": + return NZD; + case "idr": + return IDR; + case "mop": + return MOP; + case "huf": + return HUF; + case "mad": + return MAD; + case "khr": + return KHR; + case "ngn": + return NGN; + case "thb": + return THB; + case "dzd": + return DZD; + case "ars": + return ARS; + case "cad": + return CAD; + case "myr": + return MYR; + case "krw": + return KRW; + case "kzt": + return KZT; + case "eth": + return ETH; + case "cop": + return COP; + case "jmd": + return JMD; + case "nad": + return NAD; + case "gyd": + return GYD; + case "kwd": + return KWD; + case "dop": + return DOP; + case "btc": + return BTC; + case "amd": + return AMD; + case "lkr": + return LKR; + case "all": + return ALL; + case "usdt": + return USDT; + case "tnd": + return TND; + case "mur": + return MUR; + case "pen": + return PEN; + case "usd": + return USD; + case "ape": + return APE; + case "bhd": + return BHD; + case "xof": + return XOF; + case "rwf": + return RWF; + case "gbp": + return GBP; + case "vnd": + return VND; + case "mnt": + return MNT; + case "etb": + return ETB; + case "ttd": + return TTD; + case "eur": + return EUR; + case "brl": + return BRL; + case "sek": + return SEK; + case "rsd": + return RSD; + case "uzs": + return UZS; + case "twd": + return TWD; + case "nok": + return NOK; + case "whop_usd": + return WHOP_USD; + case "pyg": + return PYG; + case "try": + return TRY; + case "zar": + return ZAR; + case "pkr": + return PKR; + case "cny": + return CNY; + case "czk": + return CZK; + case "ils": + return ILS; + case "mga": + return MGA; + case "aed": + return AED; + case "ghs": + return GHS; + case "bam": + return BAM; + case "jpy": + return JPY; + case "pln": + return PLN; + case "bob": + return BOB; + case "qar": + return QAR; + case "egp": + return EGP; + case "awg": + return AWG; + case "dkk": + return DKK; + case "mdl": + return MDL; + case "mxn": + return MXN; + case "sgd": + return SGD; + case "aud": + return AUD; + case "gmd": + return GMD; + default: + return new CheckoutSessionBreakdownCurrency(Value.UNKNOWN, value); + } + } + + public enum Value { + USD, + + SGD, + + INR, + + AUD, + + BRL, + + CAD, + + DKK, + + EUR, + + NOK, + + GBP, + + SEK, + + CHF, + + HKD, + + HUF, + + JPY, + + MXN, + + MYR, + + PLN, + + CZK, + + NZD, + + AED, + + ETH, + + APE, + + COP, + + RON, + + THB, + + BGN, + + IDR, + + DOP, + + PHP, + + TRY, + + KRW, + + TWD, + + VND, + + PKR, + + CLP, + + UYU, + + ARS, + + ZAR, + + DZD, + + TND, + + MAD, + + KES, + + KWD, + + JOD, + + ALL, + + XCD, + + AMD, + + BSD, + + BHD, + + BOB, + + BAM, + + KHR, + + CRC, + + XOF, + + EGP, + + ETB, + + GMD, + + GHS, + + GTQ, + + GYD, + + ILS, + + JMD, + + MOP, + + MGA, + + MUR, + + MDL, + + MNT, + + NAD, + + NGN, + + MKD, + + OMR, + + PYG, + + PEN, + + QAR, + + RWF, + + SAR, + + RSD, + + LKR, + + TZS, + + TTD, + + UZS, + + RUB, + + BTC, + + CNY, + + USDT, + + KZT, + + AWG, + + WHOP_USD, + + XAU, + + UNKNOWN + } + + public interface Visitor { + T visitUsd(); + + T visitSgd(); + + T visitInr(); + + T visitAud(); + + T visitBrl(); + + T visitCad(); + + T visitDkk(); + + T visitEur(); + + T visitNok(); + + T visitGbp(); + + T visitSek(); + + T visitChf(); + + T visitHkd(); + + T visitHuf(); + + T visitJpy(); + + T visitMxn(); + + T visitMyr(); + + T visitPln(); + + T visitCzk(); + + T visitNzd(); + + T visitAed(); + + T visitEth(); + + T visitApe(); + + T visitCop(); + + T visitRon(); + + T visitThb(); + + T visitBgn(); + + T visitIdr(); + + T visitDop(); + + T visitPhp(); + + T visitTry(); + + T visitKrw(); + + T visitTwd(); + + T visitVnd(); + + T visitPkr(); + + T visitClp(); + + T visitUyu(); + + T visitArs(); + + T visitZar(); + + T visitDzd(); + + T visitTnd(); + + T visitMad(); + + T visitKes(); + + T visitKwd(); + + T visitJod(); + + T visitAll(); + + T visitXcd(); + + T visitAmd(); + + T visitBsd(); + + T visitBhd(); + + T visitBob(); + + T visitBam(); + + T visitKhr(); + + T visitCrc(); + + T visitXof(); + + T visitEgp(); + + T visitEtb(); + + T visitGmd(); + + T visitGhs(); + + T visitGtq(); + + T visitGyd(); + + T visitIls(); + + T visitJmd(); + + T visitMop(); + + T visitMga(); + + T visitMur(); + + T visitMdl(); + + T visitMnt(); + + T visitNad(); + + T visitNgn(); + + T visitMkd(); + + T visitOmr(); + + T visitPyg(); + + T visitPen(); + + T visitQar(); + + T visitRwf(); + + T visitSar(); + + T visitRsd(); + + T visitLkr(); + + T visitTzs(); + + T visitTtd(); + + T visitUzs(); + + T visitRub(); + + T visitBtc(); + + T visitCny(); + + T visitUsdt(); + + T visitKzt(); + + T visitAwg(); + + T visitWhopUsd(); + + T visitXau(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplay.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplay.java new file mode 100644 index 00000000..6a687f52 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplay.java @@ -0,0 +1,165 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdownDisplay.Builder.class) +public final class CheckoutSessionBreakdownDisplay { + private final CheckoutSessionBreakdownDisplayHeadline headline; + + private final CheckoutSessionBreakdownDisplaySections sections; + + private final Map additionalProperties; + + private CheckoutSessionBreakdownDisplay( + CheckoutSessionBreakdownDisplayHeadline headline, + CheckoutSessionBreakdownDisplaySections sections, + Map additionalProperties) { + this.headline = headline; + this.sections = sections; + this.additionalProperties = additionalProperties; + } + + /** + * @return The hero: the figure (or trial length, or the word "Free") and the one-line context under it. + */ + @JsonProperty("headline") + public CheckoutSessionBreakdownDisplayHeadline getHeadline() { + return headline; + } + + /** + * @return The itemized sections below — line items, charges, totals, and the collapsible fee breakdown. All empty on a free checkout. + */ + @JsonProperty("sections") + public CheckoutSessionBreakdownDisplaySections getSections() { + return sections; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownDisplay && equalTo((CheckoutSessionBreakdownDisplay) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdownDisplay other) { + return headline.equals(other.headline) && sections.equals(other.sections); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.headline, this.sections); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static HeadlineStage builder() { + return new Builder(); + } + + public interface HeadlineStage { + /** + *

The hero: the figure (or trial length, or the word "Free") and the one-line context under it.

+ */ + SectionsStage headline(@NotNull CheckoutSessionBreakdownDisplayHeadline headline); + + Builder from(CheckoutSessionBreakdownDisplay other); + } + + public interface SectionsStage { + /** + *

The itemized sections below — line items, charges, totals, and the collapsible fee breakdown. All empty on a free checkout.

+ */ + _FinalStage sections(@NotNull CheckoutSessionBreakdownDisplaySections sections); + } + + public interface _FinalStage { + CheckoutSessionBreakdownDisplay build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements HeadlineStage, SectionsStage, _FinalStage { + private CheckoutSessionBreakdownDisplayHeadline headline; + + private CheckoutSessionBreakdownDisplaySections sections; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionBreakdownDisplay other) { + headline(other.getHeadline()); + sections(other.getSections()); + return this; + } + + /** + *

The hero: the figure (or trial length, or the word "Free") and the one-line context under it.

+ *

The hero: the figure (or trial length, or the word "Free") and the one-line context under it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("headline") + public SectionsStage headline(@NotNull CheckoutSessionBreakdownDisplayHeadline headline) { + this.headline = Objects.requireNonNull(headline, "headline must not be null"); + return this; + } + + /** + *

The itemized sections below — line items, charges, totals, and the collapsible fee breakdown. All empty on a free checkout.

+ *

The itemized sections below — line items, charges, totals, and the collapsible fee breakdown. All empty on a free checkout.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("sections") + public _FinalStage sections(@NotNull CheckoutSessionBreakdownDisplaySections sections) { + this.sections = Objects.requireNonNull(sections, "sections must not be null"); + return this; + } + + @java.lang.Override + public CheckoutSessionBreakdownDisplay build() { + return new CheckoutSessionBreakdownDisplay(headline, sections, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayHeadline.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayHeadline.java new file mode 100644 index 00000000..e4491022 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayHeadline.java @@ -0,0 +1,499 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdownDisplayHeadline.Builder.class) +public final class CheckoutSessionBreakdownDisplayHeadline { + private final Optional amount; + + private final List context; + + private final Optional freeUntil; + + private final CheckoutSessionBreakdownDisplayHeadlineKind kind; + + private final Optional originalAmount; + + private final String text; + + private final Optional trialDays; + + private final Map additionalProperties; + + private CheckoutSessionBreakdownDisplayHeadline( + Optional amount, + List context, + Optional freeUntil, + CheckoutSessionBreakdownDisplayHeadlineKind kind, + Optional originalAmount, + String text, + Optional trialDays, + Map additionalProperties) { + this.amount = amount; + this.context = context; + this.freeUntil = freeUntil; + this.kind = kind; + this.originalAmount = originalAmount; + this.text = text; + this.trialDays = trialDays; + this.additionalProperties = additionalProperties; + } + + /** + * @return The figure to headline when kind is amount — already posture-correct. null on the other kinds. + */ + @JsonIgnore + public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } + return amount; + } + + @JsonProperty("context") + public List getContext() { + return context; + } + + /** + * @return When kind is free on a renewing membership transfer: the instant the transferred paid period ends and the takeover starts billing, as an ISO 8601 timestamp — word the headline "Free until …". null everywhere else. + */ + @JsonIgnore + public Optional getFreeUntil() { + if (freeUntil == null) { + return Optional.empty(); + } + return freeUntil; + } + + /** + * @return The headline's face: amount headlines the figure in amount; trial headlines the free-trial length off trial_days; free headlines the word — the served free signal or a membership transfer collecting nothing today (a renewing transfer states when its free stretch ends in free_until), never derived from zero prices (a promo covering the whole first charge is not a free plan). + */ + @JsonProperty("kind") + public CheckoutSessionBreakdownDisplayHeadlineKind getKind() { + return kind; + } + + /** + * @return The pre-promo figure to strike through beside amount, or null when no discount moved today's charge. + */ + @JsonIgnore + public Optional getOriginalAmount() { + if (originalAmount == null) { + return Optional.empty(); + } + return originalAmount; + } + + /** + * @return The headline in English — the fallback for a kind the surface cannot name. A surface that knows the kind renders its own wording from amount/trial_days/free_until. + */ + @JsonProperty("text") + public String getText() { + return text; + } + + /** + * @return The free-trial length when kind is trial, in days. null on the other kinds. + */ + @JsonIgnore + public Optional getTrialDays() { + if (trialDays == null) { + return Optional.empty(); + } + return trialDays; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("free_until") + private Optional _getFreeUntil() { + return freeUntil; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("original_amount") + private Optional _getOriginalAmount() { + return originalAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("trial_days") + private Optional _getTrialDays() { + return trialDays; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownDisplayHeadline + && equalTo((CheckoutSessionBreakdownDisplayHeadline) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdownDisplayHeadline other) { + return amount.equals(other.amount) + && context.equals(other.context) + && freeUntil.equals(other.freeUntil) + && kind.equals(other.kind) + && originalAmount.equals(other.originalAmount) + && text.equals(other.text) + && trialDays.equals(other.trialDays); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.amount, this.context, this.freeUntil, this.kind, this.originalAmount, this.text, this.trialDays); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KindStage builder() { + return new Builder(); + } + + public interface KindStage { + /** + *

The headline's face: amount headlines the figure in amount; trial headlines the free-trial length off trial_days; free headlines the word — the served free signal or a membership transfer collecting nothing today (a renewing transfer states when its free stretch ends in free_until), never derived from zero prices (a promo covering the whole first charge is not a free plan).

+ */ + TextStage kind(@NotNull CheckoutSessionBreakdownDisplayHeadlineKind kind); + + Builder from(CheckoutSessionBreakdownDisplayHeadline other); + } + + public interface TextStage { + /** + *

The headline in English — the fallback for a kind the surface cannot name. A surface that knows the kind renders its own wording from amount/trial_days/free_until.

+ */ + _FinalStage text(@NotNull String text); + } + + public interface _FinalStage { + CheckoutSessionBreakdownDisplayHeadline build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The figure to headline when kind is amount — already posture-correct. null on the other kinds.

+ */ + _FinalStage amount(Optional amount); + + _FinalStage amount(Money amount); + + _FinalStage amount(Nullable amount); + + _FinalStage context(List context); + + _FinalStage addContext(CheckoutSessionBreakdownDisplayRow context); + + _FinalStage addAllContext(List context); + + /** + *

When kind is free on a renewing membership transfer: the instant the transferred paid period ends and the takeover starts billing, as an ISO 8601 timestamp — word the headline "Free until …". null everywhere else.

+ */ + _FinalStage freeUntil(Optional freeUntil); + + _FinalStage freeUntil(String freeUntil); + + _FinalStage freeUntil(Nullable freeUntil); + + /** + *

The pre-promo figure to strike through beside amount, or null when no discount moved today's charge.

+ */ + _FinalStage originalAmount(Optional originalAmount); + + _FinalStage originalAmount(Money originalAmount); + + _FinalStage originalAmount(Nullable originalAmount); + + /** + *

The free-trial length when kind is trial, in days. null on the other kinds.

+ */ + _FinalStage trialDays(Optional trialDays); + + _FinalStage trialDays(Integer trialDays); + + _FinalStage trialDays(Nullable trialDays); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KindStage, TextStage, _FinalStage { + private CheckoutSessionBreakdownDisplayHeadlineKind kind; + + private String text; + + private Optional trialDays = Optional.empty(); + + private Optional originalAmount = Optional.empty(); + + private Optional freeUntil = Optional.empty(); + + private List context = new ArrayList<>(); + + private Optional amount = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionBreakdownDisplayHeadline other) { + amount(other.getAmount()); + context(other.getContext()); + freeUntil(other.getFreeUntil()); + kind(other.getKind()); + originalAmount(other.getOriginalAmount()); + text(other.getText()); + trialDays(other.getTrialDays()); + return this; + } + + /** + *

The headline's face: amount headlines the figure in amount; trial headlines the free-trial length off trial_days; free headlines the word — the served free signal or a membership transfer collecting nothing today (a renewing transfer states when its free stretch ends in free_until), never derived from zero prices (a promo covering the whole first charge is not a free plan).

+ *

The headline's face: amount headlines the figure in amount; trial headlines the free-trial length off trial_days; free headlines the word — the served free signal or a membership transfer collecting nothing today (a renewing transfer states when its free stretch ends in free_until), never derived from zero prices (a promo covering the whole first charge is not a free plan).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kind") + public TextStage kind(@NotNull CheckoutSessionBreakdownDisplayHeadlineKind kind) { + this.kind = Objects.requireNonNull(kind, "kind must not be null"); + return this; + } + + /** + *

The headline in English — the fallback for a kind the surface cannot name. A surface that knows the kind renders its own wording from amount/trial_days/free_until.

+ *

The headline in English — the fallback for a kind the surface cannot name. A surface that knows the kind renders its own wording from amount/trial_days/free_until.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("text") + public _FinalStage text(@NotNull String text) { + this.text = Objects.requireNonNull(text, "text must not be null"); + return this; + } + + /** + *

The free-trial length when kind is trial, in days. null on the other kinds.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage trialDays(Nullable trialDays) { + if (trialDays.isNull()) { + this.trialDays = null; + } else if (trialDays.isEmpty()) { + this.trialDays = Optional.empty(); + } else { + this.trialDays = Optional.of(trialDays.get()); + } + return this; + } + + /** + *

The free-trial length when kind is trial, in days. null on the other kinds.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage trialDays(Integer trialDays) { + this.trialDays = Optional.ofNullable(trialDays); + return this; + } + + /** + *

The free-trial length when kind is trial, in days. null on the other kinds.

+ */ + @java.lang.Override + @JsonSetter(value = "trial_days", nulls = Nulls.SKIP) + public _FinalStage trialDays(Optional trialDays) { + this.trialDays = trialDays; + return this; + } + + /** + *

The pre-promo figure to strike through beside amount, or null when no discount moved today's charge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage originalAmount(Nullable originalAmount) { + if (originalAmount.isNull()) { + this.originalAmount = null; + } else if (originalAmount.isEmpty()) { + this.originalAmount = Optional.empty(); + } else { + this.originalAmount = Optional.of(originalAmount.get()); + } + return this; + } + + /** + *

The pre-promo figure to strike through beside amount, or null when no discount moved today's charge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage originalAmount(Money originalAmount) { + this.originalAmount = Optional.ofNullable(originalAmount); + return this; + } + + /** + *

The pre-promo figure to strike through beside amount, or null when no discount moved today's charge.

+ */ + @java.lang.Override + @JsonSetter(value = "original_amount", nulls = Nulls.SKIP) + public _FinalStage originalAmount(Optional originalAmount) { + this.originalAmount = originalAmount; + return this; + } + + /** + *

When kind is free on a renewing membership transfer: the instant the transferred paid period ends and the takeover starts billing, as an ISO 8601 timestamp — word the headline "Free until …". null everywhere else.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage freeUntil(Nullable freeUntil) { + if (freeUntil.isNull()) { + this.freeUntil = null; + } else if (freeUntil.isEmpty()) { + this.freeUntil = Optional.empty(); + } else { + this.freeUntil = Optional.of(freeUntil.get()); + } + return this; + } + + /** + *

When kind is free on a renewing membership transfer: the instant the transferred paid period ends and the takeover starts billing, as an ISO 8601 timestamp — word the headline "Free until …". null everywhere else.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage freeUntil(String freeUntil) { + this.freeUntil = Optional.ofNullable(freeUntil); + return this; + } + + /** + *

When kind is free on a renewing membership transfer: the instant the transferred paid period ends and the takeover starts billing, as an ISO 8601 timestamp — word the headline "Free until …". null everywhere else.

+ */ + @java.lang.Override + @JsonSetter(value = "free_until", nulls = Nulls.SKIP) + public _FinalStage freeUntil(Optional freeUntil) { + this.freeUntil = freeUntil; + return this; + } + + @java.lang.Override + public _FinalStage addAllContext(List context) { + if (context != null) { + this.context.addAll(context); + } + return this; + } + + @java.lang.Override + public _FinalStage addContext(CheckoutSessionBreakdownDisplayRow context) { + this.context.add(context); + return this; + } + + @java.lang.Override + @JsonSetter(value = "context", nulls = Nulls.SKIP) + public _FinalStage context(List context) { + this.context.clear(); + if (context != null) { + this.context.addAll(context); + } + return this; + } + + /** + *

The figure to headline when kind is amount — already posture-correct. null on the other kinds.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + + /** + *

The figure to headline when kind is amount — already posture-correct. null on the other kinds.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage amount(Money amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + *

The figure to headline when kind is amount — already posture-correct. null on the other kinds.

+ */ + @java.lang.Override + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public _FinalStage amount(Optional amount) { + this.amount = amount; + return this; + } + + @java.lang.Override + public CheckoutSessionBreakdownDisplayHeadline build() { + return new CheckoutSessionBreakdownDisplayHeadline( + amount, context, freeUntil, kind, originalAmount, text, trialDays, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayHeadlineKind.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayHeadlineKind.java new file mode 100644 index 00000000..c2a92286 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayHeadlineKind.java @@ -0,0 +1,97 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBreakdownDisplayHeadlineKind { + public static final CheckoutSessionBreakdownDisplayHeadlineKind AMOUNT = + new CheckoutSessionBreakdownDisplayHeadlineKind(Value.AMOUNT, "amount"); + + public static final CheckoutSessionBreakdownDisplayHeadlineKind TRIAL = + new CheckoutSessionBreakdownDisplayHeadlineKind(Value.TRIAL, "trial"); + + public static final CheckoutSessionBreakdownDisplayHeadlineKind FREE = + new CheckoutSessionBreakdownDisplayHeadlineKind(Value.FREE, "free"); + + private final Value value; + + private final String string; + + CheckoutSessionBreakdownDisplayHeadlineKind(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBreakdownDisplayHeadlineKind + && this.string.equals(((CheckoutSessionBreakdownDisplayHeadlineKind) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AMOUNT: + return visitor.visitAmount(); + case TRIAL: + return visitor.visitTrial(); + case FREE: + return visitor.visitFree(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBreakdownDisplayHeadlineKind valueOf(String value) { + switch (value) { + case "amount": + return AMOUNT; + case "trial": + return TRIAL; + case "free": + return FREE; + default: + return new CheckoutSessionBreakdownDisplayHeadlineKind(Value.UNKNOWN, value); + } + } + + public enum Value { + AMOUNT, + + TRIAL, + + FREE, + + UNKNOWN + } + + public interface Visitor { + T visitAmount(); + + T visitTrial(); + + T visitFree(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRow.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRow.java new file mode 100644 index 00000000..7ba15517 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRow.java @@ -0,0 +1,407 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdownDisplayRow.Builder.class) +public final class CheckoutSessionBreakdownDisplayRow { + private final Optional amount; + + private final Optional detail; + + private final CheckoutSessionBreakdownDisplayRowKind kind; + + private final Optional label; + + private final Optional status; + + private final Optional text; + + private final Map additionalProperties; + + private CheckoutSessionBreakdownDisplayRow( + Optional amount, + Optional detail, + CheckoutSessionBreakdownDisplayRowKind kind, + Optional label, + Optional status, + Optional text, + Map additionalProperties) { + this.amount = amount; + this.detail = detail; + this.kind = kind; + this.label = label; + this.status = status; + this.text = text; + this.additionalProperties = additionalProperties; + } + + /** + * @return The row's figure as a Money object, when it has one — what a surface formats in the buyer's locale. + */ + @JsonIgnore + public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } + return amount; + } + + /** + * @return The typed parameters this row's wording is built from — the localization rail. Absent when the kind needs none. + */ + @JsonIgnore + public Optional getDetail() { + if (detail == null) { + return Optional.empty(); + } + return detail; + } + + /** + * @return Which row this is. Render a kind you know from detail in your own wording; render one you do not from label and text verbatim — never drop it. + */ + @JsonProperty("kind") + public CheckoutSessionBreakdownDisplayRowKind getKind() { + return kind; + } + + /** + * @return The row's left side in English — the fallback for a kind the surface cannot name. Absent on a row that is a single line rather than a label/value pair (the headline's context). + */ + @JsonProperty("label") + public Optional getLabel() { + return label; + } + + /** + * @return Present only on a row whose figure is still being calculated — render it in a loading state and expect calculate_breakdown to resolve it. + */ + @JsonProperty("status") + public Optional getStatus() { + return status; + } + + /** + * @return The row's value (or its whole line) in English — the fallback for a kind the surface cannot name. Absent while status is pending. + */ + @JsonProperty("text") + public Optional getText() { + return text; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("detail") + private Optional _getDetail() { + return detail; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownDisplayRow + && equalTo((CheckoutSessionBreakdownDisplayRow) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdownDisplayRow other) { + return amount.equals(other.amount) + && detail.equals(other.detail) + && kind.equals(other.kind) + && label.equals(other.label) + && status.equals(other.status) + && text.equals(other.text); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.amount, this.detail, this.kind, this.label, this.status, this.text); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static KindStage builder() { + return new Builder(); + } + + public interface KindStage { + /** + *

Which row this is. Render a kind you know from detail in your own wording; render one you do not from label and text verbatim — never drop it.

+ */ + _FinalStage kind(@NotNull CheckoutSessionBreakdownDisplayRowKind kind); + + Builder from(CheckoutSessionBreakdownDisplayRow other); + } + + public interface _FinalStage { + CheckoutSessionBreakdownDisplayRow build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The row's figure as a Money object, when it has one — what a surface formats in the buyer's locale.

+ */ + _FinalStage amount(Optional amount); + + _FinalStage amount(Money amount); + + _FinalStage amount(Nullable amount); + + /** + *

The typed parameters this row's wording is built from — the localization rail. Absent when the kind needs none.

+ */ + _FinalStage detail(Optional detail); + + _FinalStage detail(CheckoutSessionBreakdownDisplayRowDetail detail); + + _FinalStage detail(Nullable detail); + + /** + *

The row's left side in English — the fallback for a kind the surface cannot name. Absent on a row that is a single line rather than a label/value pair (the headline's context).

+ */ + _FinalStage label(Optional label); + + _FinalStage label(String label); + + /** + *

Present only on a row whose figure is still being calculated — render it in a loading state and expect calculate_breakdown to resolve it.

+ */ + _FinalStage status(Optional status); + + _FinalStage status(CheckoutSessionBreakdownDisplayRowStatus status); + + /** + *

The row's value (or its whole line) in English — the fallback for a kind the surface cannot name. Absent while status is pending.

+ */ + _FinalStage text(Optional text); + + _FinalStage text(String text); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements KindStage, _FinalStage { + private CheckoutSessionBreakdownDisplayRowKind kind; + + private Optional text = Optional.empty(); + + private Optional status = Optional.empty(); + + private Optional label = Optional.empty(); + + private Optional detail = Optional.empty(); + + private Optional amount = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionBreakdownDisplayRow other) { + amount(other.getAmount()); + detail(other.getDetail()); + kind(other.getKind()); + label(other.getLabel()); + status(other.getStatus()); + text(other.getText()); + return this; + } + + /** + *

Which row this is. Render a kind you know from detail in your own wording; render one you do not from label and text verbatim — never drop it.

+ *

Which row this is. Render a kind you know from detail in your own wording; render one you do not from label and text verbatim — never drop it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kind") + public _FinalStage kind(@NotNull CheckoutSessionBreakdownDisplayRowKind kind) { + this.kind = Objects.requireNonNull(kind, "kind must not be null"); + return this; + } + + /** + *

The row's value (or its whole line) in English — the fallback for a kind the surface cannot name. Absent while status is pending.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage text(String text) { + this.text = Optional.ofNullable(text); + return this; + } + + /** + *

The row's value (or its whole line) in English — the fallback for a kind the surface cannot name. Absent while status is pending.

+ */ + @java.lang.Override + @JsonSetter(value = "text", nulls = Nulls.SKIP) + public _FinalStage text(Optional text) { + this.text = text; + return this; + } + + /** + *

Present only on a row whose figure is still being calculated — render it in a loading state and expect calculate_breakdown to resolve it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage status(CheckoutSessionBreakdownDisplayRowStatus status) { + this.status = Optional.ofNullable(status); + return this; + } + + /** + *

Present only on a row whose figure is still being calculated — render it in a loading state and expect calculate_breakdown to resolve it.

+ */ + @java.lang.Override + @JsonSetter(value = "status", nulls = Nulls.SKIP) + public _FinalStage status(Optional status) { + this.status = status; + return this; + } + + /** + *

The row's left side in English — the fallback for a kind the surface cannot name. Absent on a row that is a single line rather than a label/value pair (the headline's context).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage label(String label) { + this.label = Optional.ofNullable(label); + return this; + } + + /** + *

The row's left side in English — the fallback for a kind the surface cannot name. Absent on a row that is a single line rather than a label/value pair (the headline's context).

+ */ + @java.lang.Override + @JsonSetter(value = "label", nulls = Nulls.SKIP) + public _FinalStage label(Optional label) { + this.label = label; + return this; + } + + /** + *

The typed parameters this row's wording is built from — the localization rail. Absent when the kind needs none.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage detail(Nullable detail) { + if (detail.isNull()) { + this.detail = null; + } else if (detail.isEmpty()) { + this.detail = Optional.empty(); + } else { + this.detail = Optional.of(detail.get()); + } + return this; + } + + /** + *

The typed parameters this row's wording is built from — the localization rail. Absent when the kind needs none.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage detail(CheckoutSessionBreakdownDisplayRowDetail detail) { + this.detail = Optional.ofNullable(detail); + return this; + } + + /** + *

The typed parameters this row's wording is built from — the localization rail. Absent when the kind needs none.

+ */ + @java.lang.Override + @JsonSetter(value = "detail", nulls = Nulls.SKIP) + public _FinalStage detail(Optional detail) { + this.detail = detail; + return this; + } + + /** + *

The row's figure as a Money object, when it has one — what a surface formats in the buyer's locale.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + + /** + *

The row's figure as a Money object, when it has one — what a surface formats in the buyer's locale.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage amount(Money amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + *

The row's figure as a Money object, when it has one — what a surface formats in the buyer's locale.

+ */ + @java.lang.Override + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public _FinalStage amount(Optional amount) { + this.amount = amount; + return this; + } + + @java.lang.Override + public CheckoutSessionBreakdownDisplayRow build() { + return new CheckoutSessionBreakdownDisplayRow( + amount, detail, kind, label, status, text, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowDetail.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowDetail.java new file mode 100644 index 00000000..a9ee74c7 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowDetail.java @@ -0,0 +1,533 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdownDisplayRowDetail.Builder.class) +public final class CheckoutSessionBreakdownDisplayRowDetail { + private final Optional accessDays; + + private final Optional accessUntil; + + private final Optional applied; + + private final Optional chargeAt; + + private final Optional code; + + private final Optional initialFee; + + private final Optional intervalDays; + + private final Optional invoice; + + private final Optional paidTrial; + + private final Optional rate; + + private final Optional remainingPayments; + + private final Optional totalPayments; + + private final Optional trialDays; + + private final Optional withoutTax; + + private final Map additionalProperties; + + private CheckoutSessionBreakdownDisplayRowDetail( + Optional accessDays, + Optional accessUntil, + Optional applied, + Optional chargeAt, + Optional code, + Optional initialFee, + Optional intervalDays, + Optional invoice, + Optional paidTrial, + Optional rate, + Optional remainingPayments, + Optional totalPayments, + Optional trialDays, + Optional withoutTax, + Map additionalProperties) { + this.accessDays = accessDays; + this.accessUntil = accessUntil; + this.applied = applied; + this.chargeAt = chargeAt; + this.code = code; + this.initialFee = initialFee; + this.intervalDays = intervalDays; + this.invoice = invoice; + this.paidTrial = paidTrial; + this.rate = rate; + this.remainingPayments = remainingPayments; + this.totalPayments = totalPayments; + this.trialDays = trialDays; + this.withoutTax = withoutTax; + this.additionalProperties = additionalProperties; + } + + /** + * @return How many days of access a one-time purchase grants, when it expires. + */ + @JsonProperty("access_days") + public Optional getAccessDays() { + return accessDays; + } + + /** + * @return When a transferred membership's access ends, as an ISO 8601 timestamp — the recipient gets the origin's REMAINING time, never a fresh grant of the plan's window. + */ + @JsonProperty("access_until") + public Optional getAccessUntil() { + return accessUntil; + } + + /** + * @return The tax row's application: added counts toward the total; included is already inside the prices and is disclosed, never added. + */ + @JsonProperty("applied") + public Optional getApplied() { + return applied; + } + + /** + * @return The instant this row's charge lands, as an ISO 8601 timestamp — format it in the buyer's locale rather than deriving a date client-side. + */ + @JsonProperty("charge_at") + public Optional getChargeAt() { + return chargeAt; + } + + /** + * @return The promo code (uppercased) whose coverage this row states — "Then your first month is free with FREETODAY". + */ + @JsonProperty("code") + public Optional getCode() { + return code; + } + + /** + * @return The one-off fee inside today's due_today charge — name it ("Due today — includes a one-time $50.00 fee") so the figure does not read as the recurring rate. + */ + @JsonProperty("initial_fee") + public Optional getInitialFee() { + return initialFee; + } + + /** + * @return Days between recurring charges, for wording the billing period (30 is monthly, 365 yearly). + */ + @JsonProperty("interval_days") + public Optional getIntervalDays() { + return intervalDays; + } + + /** + * @return Present (and true) when this one-time payment collects a seller-issued invoice — word it as a bill ("Invoice — one-time payment.") beside the session's own due date, never as a storefront purchase. + */ + @JsonProperty("invoice") + public Optional getInvoice() { + return invoice; + } + + /** + * @return Present (and true) when the trial this row follows charges a fee today — the wording drops the word "trial" for the neutral "after N days", exactly as the legacy checkout worded a paid trial. + */ + @JsonProperty("paid_trial") + public Optional getPaidTrial() { + return paidTrial; + } + + /** + * @return The tax row's effective rate as a decimal fraction ("0.0725" is 7.25%), when the calculation stated one. + */ + @JsonProperty("rate") + public Optional getRate() { + return rate; + } + + /** + * @return How many payments are still AHEAD at this row's amount — today's paying receipt already consumed one of the plan's total, exactly as billing counts receipts. Word it as the future stream ("for 3 more payments"), never as the plan's total. + */ + @JsonProperty("remaining_payments") + public Optional getRemainingPayments() { + return remainingPayments; + } + + /** + * @return An installment plan's PLAN-WIDE payment count, today's paying charge included — word it as the plan's total ("for a total of 4 payments"). Mutually exclusive with remaining_payments: a row states whichever count it means. + */ + @JsonProperty("total_payments") + public Optional getTotalPayments() { + return totalPayments; + } + + /** + * @return The free-trial length this row speaks about, in days. + */ + @JsonProperty("trial_days") + public Optional getTrialDays() { + return trialDays; + } + + /** + * @return Present (and true) when this row's amount is stated before tax and the wording must say so — the checkout adds exclusive tax the future charge will carry on top. + */ + @JsonProperty("without_tax") + public Optional getWithoutTax() { + return withoutTax; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownDisplayRowDetail + && equalTo((CheckoutSessionBreakdownDisplayRowDetail) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdownDisplayRowDetail other) { + return accessDays.equals(other.accessDays) + && accessUntil.equals(other.accessUntil) + && applied.equals(other.applied) + && chargeAt.equals(other.chargeAt) + && code.equals(other.code) + && initialFee.equals(other.initialFee) + && intervalDays.equals(other.intervalDays) + && invoice.equals(other.invoice) + && paidTrial.equals(other.paidTrial) + && rate.equals(other.rate) + && remainingPayments.equals(other.remainingPayments) + && totalPayments.equals(other.totalPayments) + && trialDays.equals(other.trialDays) + && withoutTax.equals(other.withoutTax); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.accessDays, + this.accessUntil, + this.applied, + this.chargeAt, + this.code, + this.initialFee, + this.intervalDays, + this.invoice, + this.paidTrial, + this.rate, + this.remainingPayments, + this.totalPayments, + this.trialDays, + this.withoutTax); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional accessDays = Optional.empty(); + + private Optional accessUntil = Optional.empty(); + + private Optional applied = Optional.empty(); + + private Optional chargeAt = Optional.empty(); + + private Optional code = Optional.empty(); + + private Optional initialFee = Optional.empty(); + + private Optional intervalDays = Optional.empty(); + + private Optional invoice = Optional.empty(); + + private Optional paidTrial = Optional.empty(); + + private Optional rate = Optional.empty(); + + private Optional remainingPayments = Optional.empty(); + + private Optional totalPayments = Optional.empty(); + + private Optional trialDays = Optional.empty(); + + private Optional withoutTax = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CheckoutSessionBreakdownDisplayRowDetail other) { + accessDays(other.getAccessDays()); + accessUntil(other.getAccessUntil()); + applied(other.getApplied()); + chargeAt(other.getChargeAt()); + code(other.getCode()); + initialFee(other.getInitialFee()); + intervalDays(other.getIntervalDays()); + invoice(other.getInvoice()); + paidTrial(other.getPaidTrial()); + rate(other.getRate()); + remainingPayments(other.getRemainingPayments()); + totalPayments(other.getTotalPayments()); + trialDays(other.getTrialDays()); + withoutTax(other.getWithoutTax()); + return this; + } + + /** + *

How many days of access a one-time purchase grants, when it expires.

+ */ + @JsonSetter(value = "access_days", nulls = Nulls.SKIP) + public Builder accessDays(Optional accessDays) { + this.accessDays = accessDays; + return this; + } + + public Builder accessDays(Integer accessDays) { + this.accessDays = Optional.ofNullable(accessDays); + return this; + } + + /** + *

When a transferred membership's access ends, as an ISO 8601 timestamp — the recipient gets the origin's REMAINING time, never a fresh grant of the plan's window.

+ */ + @JsonSetter(value = "access_until", nulls = Nulls.SKIP) + public Builder accessUntil(Optional accessUntil) { + this.accessUntil = accessUntil; + return this; + } + + public Builder accessUntil(String accessUntil) { + this.accessUntil = Optional.ofNullable(accessUntil); + return this; + } + + /** + *

The tax row's application: added counts toward the total; included is already inside the prices and is disclosed, never added.

+ */ + @JsonSetter(value = "applied", nulls = Nulls.SKIP) + public Builder applied(Optional applied) { + this.applied = applied; + return this; + } + + public Builder applied(CheckoutSessionBreakdownDisplayRowDetailApplied applied) { + this.applied = Optional.ofNullable(applied); + return this; + } + + /** + *

The instant this row's charge lands, as an ISO 8601 timestamp — format it in the buyer's locale rather than deriving a date client-side.

+ */ + @JsonSetter(value = "charge_at", nulls = Nulls.SKIP) + public Builder chargeAt(Optional chargeAt) { + this.chargeAt = chargeAt; + return this; + } + + public Builder chargeAt(String chargeAt) { + this.chargeAt = Optional.ofNullable(chargeAt); + return this; + } + + /** + *

The promo code (uppercased) whose coverage this row states — "Then your first month is free with FREETODAY".

+ */ + @JsonSetter(value = "code", nulls = Nulls.SKIP) + public Builder code(Optional code) { + this.code = code; + return this; + } + + public Builder code(String code) { + this.code = Optional.ofNullable(code); + return this; + } + + /** + *

The one-off fee inside today's due_today charge — name it ("Due today — includes a one-time $50.00 fee") so the figure does not read as the recurring rate.

+ */ + @JsonSetter(value = "initial_fee", nulls = Nulls.SKIP) + public Builder initialFee(Optional initialFee) { + this.initialFee = initialFee; + return this; + } + + public Builder initialFee(Money initialFee) { + this.initialFee = Optional.ofNullable(initialFee); + return this; + } + + /** + *

Days between recurring charges, for wording the billing period (30 is monthly, 365 yearly).

+ */ + @JsonSetter(value = "interval_days", nulls = Nulls.SKIP) + public Builder intervalDays(Optional intervalDays) { + this.intervalDays = intervalDays; + return this; + } + + public Builder intervalDays(Integer intervalDays) { + this.intervalDays = Optional.ofNullable(intervalDays); + return this; + } + + /** + *

Present (and true) when this one-time payment collects a seller-issued invoice — word it as a bill ("Invoice — one-time payment.") beside the session's own due date, never as a storefront purchase.

+ */ + @JsonSetter(value = "invoice", nulls = Nulls.SKIP) + public Builder invoice(Optional invoice) { + this.invoice = invoice; + return this; + } + + public Builder invoice(Boolean invoice) { + this.invoice = Optional.ofNullable(invoice); + return this; + } + + /** + *

Present (and true) when the trial this row follows charges a fee today — the wording drops the word "trial" for the neutral "after N days", exactly as the legacy checkout worded a paid trial.

+ */ + @JsonSetter(value = "paid_trial", nulls = Nulls.SKIP) + public Builder paidTrial(Optional paidTrial) { + this.paidTrial = paidTrial; + return this; + } + + public Builder paidTrial(Boolean paidTrial) { + this.paidTrial = Optional.ofNullable(paidTrial); + return this; + } + + /** + *

The tax row's effective rate as a decimal fraction ("0.0725" is 7.25%), when the calculation stated one.

+ */ + @JsonSetter(value = "rate", nulls = Nulls.SKIP) + public Builder rate(Optional rate) { + this.rate = rate; + return this; + } + + public Builder rate(String rate) { + this.rate = Optional.ofNullable(rate); + return this; + } + + /** + *

How many payments are still AHEAD at this row's amount — today's paying receipt already consumed one of the plan's total, exactly as billing counts receipts. Word it as the future stream ("for 3 more payments"), never as the plan's total.

+ */ + @JsonSetter(value = "remaining_payments", nulls = Nulls.SKIP) + public Builder remainingPayments(Optional remainingPayments) { + this.remainingPayments = remainingPayments; + return this; + } + + public Builder remainingPayments(Integer remainingPayments) { + this.remainingPayments = Optional.ofNullable(remainingPayments); + return this; + } + + /** + *

An installment plan's PLAN-WIDE payment count, today's paying charge included — word it as the plan's total ("for a total of 4 payments"). Mutually exclusive with remaining_payments: a row states whichever count it means.

+ */ + @JsonSetter(value = "total_payments", nulls = Nulls.SKIP) + public Builder totalPayments(Optional totalPayments) { + this.totalPayments = totalPayments; + return this; + } + + public Builder totalPayments(Integer totalPayments) { + this.totalPayments = Optional.ofNullable(totalPayments); + return this; + } + + /** + *

The free-trial length this row speaks about, in days.

+ */ + @JsonSetter(value = "trial_days", nulls = Nulls.SKIP) + public Builder trialDays(Optional trialDays) { + this.trialDays = trialDays; + return this; + } + + public Builder trialDays(Integer trialDays) { + this.trialDays = Optional.ofNullable(trialDays); + return this; + } + + /** + *

Present (and true) when this row's amount is stated before tax and the wording must say so — the checkout adds exclusive tax the future charge will carry on top.

+ */ + @JsonSetter(value = "without_tax", nulls = Nulls.SKIP) + public Builder withoutTax(Optional withoutTax) { + this.withoutTax = withoutTax; + return this; + } + + public Builder withoutTax(Boolean withoutTax) { + this.withoutTax = Optional.ofNullable(withoutTax); + return this; + } + + public CheckoutSessionBreakdownDisplayRowDetail build() { + return new CheckoutSessionBreakdownDisplayRowDetail( + accessDays, + accessUntil, + applied, + chargeAt, + code, + initialFee, + intervalDays, + invoice, + paidTrial, + rate, + remainingPayments, + totalPayments, + trialDays, + withoutTax, + additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowDetailApplied.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowDetailApplied.java new file mode 100644 index 00000000..f95375e2 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowDetailApplied.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBreakdownDisplayRowDetailApplied { + public static final CheckoutSessionBreakdownDisplayRowDetailApplied INCLUDED = + new CheckoutSessionBreakdownDisplayRowDetailApplied(Value.INCLUDED, "included"); + + public static final CheckoutSessionBreakdownDisplayRowDetailApplied ADDED = + new CheckoutSessionBreakdownDisplayRowDetailApplied(Value.ADDED, "added"); + + private final Value value; + + private final String string; + + CheckoutSessionBreakdownDisplayRowDetailApplied(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBreakdownDisplayRowDetailApplied + && this.string.equals(((CheckoutSessionBreakdownDisplayRowDetailApplied) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case INCLUDED: + return visitor.visitIncluded(); + case ADDED: + return visitor.visitAdded(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBreakdownDisplayRowDetailApplied valueOf(String value) { + switch (value) { + case "included": + return INCLUDED; + case "added": + return ADDED; + default: + return new CheckoutSessionBreakdownDisplayRowDetailApplied(Value.UNKNOWN, value); + } + } + + public enum Value { + ADDED, + + INCLUDED, + + UNKNOWN + } + + public interface Visitor { + T visitAdded(); + + T visitIncluded(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowKind.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowKind.java new file mode 100644 index 00000000..c258a648 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowKind.java @@ -0,0 +1,317 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBreakdownDisplayRowKind { + public static final CheckoutSessionBreakdownDisplayRowKind DUE_TODAY = + new CheckoutSessionBreakdownDisplayRowKind(Value.DUE_TODAY, "due_today"); + + public static final CheckoutSessionBreakdownDisplayRowKind WAITLIST_NOTICE = + new CheckoutSessionBreakdownDisplayRowKind(Value.WAITLIST_NOTICE, "waitlist_notice"); + + public static final CheckoutSessionBreakdownDisplayRowKind TAX_TODAY = + new CheckoutSessionBreakdownDisplayRowKind(Value.TAX_TODAY, "tax_today"); + + public static final CheckoutSessionBreakdownDisplayRowKind SERVICE_FEE = + new CheckoutSessionBreakdownDisplayRowKind(Value.SERVICE_FEE, "service_fee"); + + public static final CheckoutSessionBreakdownDisplayRowKind ONE_TIME_PAYMENT = + new CheckoutSessionBreakdownDisplayRowKind(Value.ONE_TIME_PAYMENT, "one_time_payment"); + + public static final CheckoutSessionBreakdownDisplayRowKind THEN_AFTER_TRIAL = + new CheckoutSessionBreakdownDisplayRowKind(Value.THEN_AFTER_TRIAL, "then_after_trial"); + + public static final CheckoutSessionBreakdownDisplayRowKind ACCESS_UNTIL = + new CheckoutSessionBreakdownDisplayRowKind(Value.ACCESS_UNTIL, "access_until"); + + public static final CheckoutSessionBreakdownDisplayRowKind POST_PROMO = + new CheckoutSessionBreakdownDisplayRowKind(Value.POST_PROMO, "post_promo"); + + public static final CheckoutSessionBreakdownDisplayRowKind FREE_FOREVER = + new CheckoutSessionBreakdownDisplayRowKind(Value.FREE_FOREVER, "free_forever"); + + public static final CheckoutSessionBreakdownDisplayRowKind ITEM_SUBTOTAL = + new CheckoutSessionBreakdownDisplayRowKind(Value.ITEM_SUBTOTAL, "item_subtotal"); + + public static final CheckoutSessionBreakdownDisplayRowKind TOTAL_IF_ACCEPTED = + new CheckoutSessionBreakdownDisplayRowKind(Value.TOTAL_IF_ACCEPTED, "total_if_accepted"); + + public static final CheckoutSessionBreakdownDisplayRowKind PERIOD = + new CheckoutSessionBreakdownDisplayRowKind(Value.PERIOD, "period"); + + public static final CheckoutSessionBreakdownDisplayRowKind PROMO_FREE_PERIOD = + new CheckoutSessionBreakdownDisplayRowKind(Value.PROMO_FREE_PERIOD, "promo_free_period"); + + public static final CheckoutSessionBreakdownDisplayRowKind TOTAL_AFTER_TRIAL = + new CheckoutSessionBreakdownDisplayRowKind(Value.TOTAL_AFTER_TRIAL, "total_after_trial"); + + public static final CheckoutSessionBreakdownDisplayRowKind TAX_INCLUDED = + new CheckoutSessionBreakdownDisplayRowKind(Value.TAX_INCLUDED, "tax_included"); + + public static final CheckoutSessionBreakdownDisplayRowKind INITIAL_FEE = + new CheckoutSessionBreakdownDisplayRowKind(Value.INITIAL_FEE, "initial_fee"); + + public static final CheckoutSessionBreakdownDisplayRowKind THEN_STARTING = + new CheckoutSessionBreakdownDisplayRowKind(Value.THEN_STARTING, "then_starting"); + + public static final CheckoutSessionBreakdownDisplayRowKind TOTAL_DUE_STARTING = + new CheckoutSessionBreakdownDisplayRowKind(Value.TOTAL_DUE_STARTING, "total_due_starting"); + + public static final CheckoutSessionBreakdownDisplayRowKind WAITLIST_TRIAL_NOTICE = + new CheckoutSessionBreakdownDisplayRowKind(Value.WAITLIST_TRIAL_NOTICE, "waitlist_trial_notice"); + + public static final CheckoutSessionBreakdownDisplayRowKind RENEWAL_FEE = + new CheckoutSessionBreakdownDisplayRowKind(Value.RENEWAL_FEE, "renewal_fee"); + + public static final CheckoutSessionBreakdownDisplayRowKind ACCESS_WINDOW = + new CheckoutSessionBreakdownDisplayRowKind(Value.ACCESS_WINDOW, "access_window"); + + public static final CheckoutSessionBreakdownDisplayRowKind TOTAL_DUE_TODAY = + new CheckoutSessionBreakdownDisplayRowKind(Value.TOTAL_DUE_TODAY, "total_due_today"); + + public static final CheckoutSessionBreakdownDisplayRowKind TRIAL_WINDOW = + new CheckoutSessionBreakdownDisplayRowKind(Value.TRIAL_WINDOW, "trial_window"); + + private final Value value; + + private final String string; + + CheckoutSessionBreakdownDisplayRowKind(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBreakdownDisplayRowKind + && this.string.equals(((CheckoutSessionBreakdownDisplayRowKind) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case DUE_TODAY: + return visitor.visitDueToday(); + case WAITLIST_NOTICE: + return visitor.visitWaitlistNotice(); + case TAX_TODAY: + return visitor.visitTaxToday(); + case SERVICE_FEE: + return visitor.visitServiceFee(); + case ONE_TIME_PAYMENT: + return visitor.visitOneTimePayment(); + case THEN_AFTER_TRIAL: + return visitor.visitThenAfterTrial(); + case ACCESS_UNTIL: + return visitor.visitAccessUntil(); + case POST_PROMO: + return visitor.visitPostPromo(); + case FREE_FOREVER: + return visitor.visitFreeForever(); + case ITEM_SUBTOTAL: + return visitor.visitItemSubtotal(); + case TOTAL_IF_ACCEPTED: + return visitor.visitTotalIfAccepted(); + case PERIOD: + return visitor.visitPeriod(); + case PROMO_FREE_PERIOD: + return visitor.visitPromoFreePeriod(); + case TOTAL_AFTER_TRIAL: + return visitor.visitTotalAfterTrial(); + case TAX_INCLUDED: + return visitor.visitTaxIncluded(); + case INITIAL_FEE: + return visitor.visitInitialFee(); + case THEN_STARTING: + return visitor.visitThenStarting(); + case TOTAL_DUE_STARTING: + return visitor.visitTotalDueStarting(); + case WAITLIST_TRIAL_NOTICE: + return visitor.visitWaitlistTrialNotice(); + case RENEWAL_FEE: + return visitor.visitRenewalFee(); + case ACCESS_WINDOW: + return visitor.visitAccessWindow(); + case TOTAL_DUE_TODAY: + return visitor.visitTotalDueToday(); + case TRIAL_WINDOW: + return visitor.visitTrialWindow(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBreakdownDisplayRowKind valueOf(String value) { + switch (value) { + case "due_today": + return DUE_TODAY; + case "waitlist_notice": + return WAITLIST_NOTICE; + case "tax_today": + return TAX_TODAY; + case "service_fee": + return SERVICE_FEE; + case "one_time_payment": + return ONE_TIME_PAYMENT; + case "then_after_trial": + return THEN_AFTER_TRIAL; + case "access_until": + return ACCESS_UNTIL; + case "post_promo": + return POST_PROMO; + case "free_forever": + return FREE_FOREVER; + case "item_subtotal": + return ITEM_SUBTOTAL; + case "total_if_accepted": + return TOTAL_IF_ACCEPTED; + case "period": + return PERIOD; + case "promo_free_period": + return PROMO_FREE_PERIOD; + case "total_after_trial": + return TOTAL_AFTER_TRIAL; + case "tax_included": + return TAX_INCLUDED; + case "initial_fee": + return INITIAL_FEE; + case "then_starting": + return THEN_STARTING; + case "total_due_starting": + return TOTAL_DUE_STARTING; + case "waitlist_trial_notice": + return WAITLIST_TRIAL_NOTICE; + case "renewal_fee": + return RENEWAL_FEE; + case "access_window": + return ACCESS_WINDOW; + case "total_due_today": + return TOTAL_DUE_TODAY; + case "trial_window": + return TRIAL_WINDOW; + default: + return new CheckoutSessionBreakdownDisplayRowKind(Value.UNKNOWN, value); + } + } + + public enum Value { + THEN_STARTING, + + THEN_AFTER_TRIAL, + + DUE_TODAY, + + PERIOD, + + ONE_TIME_PAYMENT, + + ACCESS_WINDOW, + + ACCESS_UNTIL, + + TRIAL_WINDOW, + + WAITLIST_NOTICE, + + WAITLIST_TRIAL_NOTICE, + + FREE_FOREVER, + + TAX_INCLUDED, + + PROMO_FREE_PERIOD, + + INITIAL_FEE, + + RENEWAL_FEE, + + TAX_TODAY, + + TOTAL_DUE_TODAY, + + TOTAL_IF_ACCEPTED, + + TOTAL_DUE_STARTING, + + TOTAL_AFTER_TRIAL, + + POST_PROMO, + + ITEM_SUBTOTAL, + + SERVICE_FEE, + + UNKNOWN + } + + public interface Visitor { + T visitThenStarting(); + + T visitThenAfterTrial(); + + T visitDueToday(); + + T visitPeriod(); + + T visitOneTimePayment(); + + T visitAccessWindow(); + + T visitAccessUntil(); + + T visitTrialWindow(); + + T visitWaitlistNotice(); + + T visitWaitlistTrialNotice(); + + T visitFreeForever(); + + T visitTaxIncluded(); + + T visitPromoFreePeriod(); + + T visitInitialFee(); + + T visitRenewalFee(); + + T visitTaxToday(); + + T visitTotalDueToday(); + + T visitTotalIfAccepted(); + + T visitTotalDueStarting(); + + T visitTotalAfterTrial(); + + T visitPostPromo(); + + T visitItemSubtotal(); + + T visitServiceFee(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowStatus.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowStatus.java new file mode 100644 index 00000000..e578e57d --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplayRowStatus.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBreakdownDisplayRowStatus { + public static final CheckoutSessionBreakdownDisplayRowStatus PENDING = + new CheckoutSessionBreakdownDisplayRowStatus(Value.PENDING, "pending"); + + private final Value value; + + private final String string; + + CheckoutSessionBreakdownDisplayRowStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBreakdownDisplayRowStatus + && this.string.equals(((CheckoutSessionBreakdownDisplayRowStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PENDING: + return visitor.visitPending(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBreakdownDisplayRowStatus valueOf(String value) { + switch (value) { + case "pending": + return PENDING; + default: + return new CheckoutSessionBreakdownDisplayRowStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplaySections.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplaySections.java new file mode 100644 index 00000000..91635db3 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownDisplaySections.java @@ -0,0 +1,222 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdownDisplaySections.Builder.class) +public final class CheckoutSessionBreakdownDisplaySections { + private final List charges; + + private final List feeBreakdown; + + private final List lineItems; + + private final List totals; + + private final Map additionalProperties; + + private CheckoutSessionBreakdownDisplaySections( + List charges, + List feeBreakdown, + List lineItems, + List totals, + Map additionalProperties) { + this.charges = charges; + this.feeBreakdown = feeBreakdown; + this.lineItems = lineItems; + this.totals = totals; + this.additionalProperties = additionalProperties; + } + + @JsonProperty("charges") + public List getCharges() { + return charges; + } + + @JsonProperty("fee_breakdown") + public List getFeeBreakdown() { + return feeBreakdown; + } + + @JsonProperty("line_items") + public List getLineItems() { + return lineItems; + } + + @JsonProperty("totals") + public List getTotals() { + return totals; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownDisplaySections + && equalTo((CheckoutSessionBreakdownDisplaySections) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdownDisplaySections other) { + return charges.equals(other.charges) + && feeBreakdown.equals(other.feeBreakdown) + && lineItems.equals(other.lineItems) + && totals.equals(other.totals); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.charges, this.feeBreakdown, this.lineItems, this.totals); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private List charges = new ArrayList<>(); + + private List feeBreakdown = new ArrayList<>(); + + private List lineItems = new ArrayList<>(); + + private List totals = new ArrayList<>(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CheckoutSessionBreakdownDisplaySections other) { + charges(other.getCharges()); + feeBreakdown(other.getFeeBreakdown()); + lineItems(other.getLineItems()); + totals(other.getTotals()); + return this; + } + + @JsonSetter(value = "charges", nulls = Nulls.SKIP) + public Builder charges(List charges) { + this.charges.clear(); + if (charges != null) { + this.charges.addAll(charges); + } + return this; + } + + public Builder addCharges(CheckoutSessionBreakdownDisplayRow charges) { + this.charges.add(charges); + return this; + } + + public Builder addAllCharges(List charges) { + if (charges != null) { + this.charges.addAll(charges); + } + return this; + } + + @JsonSetter(value = "fee_breakdown", nulls = Nulls.SKIP) + public Builder feeBreakdown(List feeBreakdown) { + this.feeBreakdown.clear(); + if (feeBreakdown != null) { + this.feeBreakdown.addAll(feeBreakdown); + } + return this; + } + + public Builder addFeeBreakdown(CheckoutSessionBreakdownDisplayRow feeBreakdown) { + this.feeBreakdown.add(feeBreakdown); + return this; + } + + public Builder addAllFeeBreakdown(List feeBreakdown) { + if (feeBreakdown != null) { + this.feeBreakdown.addAll(feeBreakdown); + } + return this; + } + + @JsonSetter(value = "line_items", nulls = Nulls.SKIP) + public Builder lineItems(List lineItems) { + this.lineItems.clear(); + if (lineItems != null) { + this.lineItems.addAll(lineItems); + } + return this; + } + + public Builder addLineItems(CheckoutSessionBreakdownDisplayRow lineItems) { + this.lineItems.add(lineItems); + return this; + } + + public Builder addAllLineItems(List lineItems) { + if (lineItems != null) { + this.lineItems.addAll(lineItems); + } + return this; + } + + @JsonSetter(value = "totals", nulls = Nulls.SKIP) + public Builder totals(List totals) { + this.totals.clear(); + if (totals != null) { + this.totals.addAll(totals); + } + return this; + } + + public Builder addTotals(CheckoutSessionBreakdownDisplayRow totals) { + this.totals.add(totals); + return this; + } + + public Builder addAllTotals(List totals) { + if (totals != null) { + this.totals.addAll(totals); + } + return this; + } + + public CheckoutSessionBreakdownDisplaySections build() { + return new CheckoutSessionBreakdownDisplaySections( + charges, feeBreakdown, lineItems, totals, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownLine.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownLine.java new file mode 100644 index 00000000..7f8697fc --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownLine.java @@ -0,0 +1,273 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdownLine.Builder.class) +public final class CheckoutSessionBreakdownLine { + private final Money amount; + + private final String description; + + private final CheckoutSessionBreakdownLineKind kind; + + private final int quantity; + + private final Money unitAmount; + + private final Map additionalProperties; + + private CheckoutSessionBreakdownLine( + Money amount, + String description, + CheckoutSessionBreakdownLineKind kind, + int quantity, + Money unitAmount, + Map additionalProperties) { + this.amount = amount; + this.description = description; + this.kind = kind; + this.quantity = quantity; + this.unitAmount = unitAmount; + this.additionalProperties = additionalProperties; + } + + /** + * @return The line's own total — unit_amount × quantity, before any adjustment. + */ + @JsonProperty("amount") + public Money getAmount() { + return amount; + } + + /** + * @return What to show the buyer for this line. + */ + @JsonProperty("description") + public String getDescription() { + return description; + } + + /** + * @return What this line is — plan today. New kinds arrive as checkout learns to sell more than one thing at once. + */ + @JsonProperty("kind") + public CheckoutSessionBreakdownLineKind getKind() { + return kind; + } + + /** + * @return How many. + */ + @JsonProperty("quantity") + public int getQuantity() { + return quantity; + } + + /** + * @return Price of one, before any adjustment. + */ + @JsonProperty("unit_amount") + public Money getUnitAmount() { + return unitAmount; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownLine && equalTo((CheckoutSessionBreakdownLine) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdownLine other) { + return amount.equals(other.amount) + && description.equals(other.description) + && kind.equals(other.kind) + && quantity == other.quantity + && unitAmount.equals(other.unitAmount); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.amount, this.description, this.kind, this.quantity, this.unitAmount); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AmountStage builder() { + return new Builder(); + } + + public interface AmountStage { + /** + *

The line's own total — unit_amount × quantity, before any adjustment.

+ */ + DescriptionStage amount(@NotNull Money amount); + + Builder from(CheckoutSessionBreakdownLine other); + } + + public interface DescriptionStage { + /** + *

What to show the buyer for this line.

+ */ + KindStage description(@NotNull String description); + } + + public interface KindStage { + /** + *

What this line is — plan today. New kinds arrive as checkout learns to sell more than one thing at once.

+ */ + QuantityStage kind(@NotNull CheckoutSessionBreakdownLineKind kind); + } + + public interface QuantityStage { + /** + *

How many.

+ */ + UnitAmountStage quantity(int quantity); + } + + public interface UnitAmountStage { + /** + *

Price of one, before any adjustment.

+ */ + _FinalStage unitAmount(@NotNull Money unitAmount); + } + + public interface _FinalStage { + CheckoutSessionBreakdownLine build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AmountStage, DescriptionStage, KindStage, QuantityStage, UnitAmountStage, _FinalStage { + private Money amount; + + private String description; + + private CheckoutSessionBreakdownLineKind kind; + + private int quantity; + + private Money unitAmount; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionBreakdownLine other) { + amount(other.getAmount()); + description(other.getDescription()); + kind(other.getKind()); + quantity(other.getQuantity()); + unitAmount(other.getUnitAmount()); + return this; + } + + /** + *

The line's own total — unit_amount × quantity, before any adjustment.

+ *

The line's own total — unit_amount × quantity, before any adjustment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("amount") + public DescriptionStage amount(@NotNull Money amount) { + this.amount = Objects.requireNonNull(amount, "amount must not be null"); + return this; + } + + /** + *

What to show the buyer for this line.

+ *

What to show the buyer for this line.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("description") + public KindStage description(@NotNull String description) { + this.description = Objects.requireNonNull(description, "description must not be null"); + return this; + } + + /** + *

What this line is — plan today. New kinds arrive as checkout learns to sell more than one thing at once.

+ *

What this line is — plan today. New kinds arrive as checkout learns to sell more than one thing at once.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kind") + public QuantityStage kind(@NotNull CheckoutSessionBreakdownLineKind kind) { + this.kind = Objects.requireNonNull(kind, "kind must not be null"); + return this; + } + + /** + *

How many.

+ *

How many.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("quantity") + public UnitAmountStage quantity(int quantity) { + this.quantity = quantity; + return this; + } + + /** + *

Price of one, before any adjustment.

+ *

Price of one, before any adjustment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("unit_amount") + public _FinalStage unitAmount(@NotNull Money unitAmount) { + this.unitAmount = Objects.requireNonNull(unitAmount, "unitAmount must not be null"); + return this; + } + + @java.lang.Override + public CheckoutSessionBreakdownLine build() { + return new CheckoutSessionBreakdownLine( + amount, description, kind, quantity, unitAmount, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownLineKind.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownLineKind.java new file mode 100644 index 00000000..1ec03b05 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownLineKind.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBreakdownLineKind { + public static final CheckoutSessionBreakdownLineKind PLAN = + new CheckoutSessionBreakdownLineKind(Value.PLAN, "plan"); + + private final Value value; + + private final String string; + + CheckoutSessionBreakdownLineKind(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBreakdownLineKind + && this.string.equals(((CheckoutSessionBreakdownLineKind) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PLAN: + return visitor.visitPlan(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBreakdownLineKind valueOf(String value) { + switch (value) { + case "plan": + return PLAN; + default: + return new CheckoutSessionBreakdownLineKind(Value.UNKNOWN, value); + } + } + + public enum Value { + PLAN, + + UNKNOWN + } + + public interface Visitor { + T visitPlan(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcoming.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcoming.java new file mode 100644 index 00000000..78ae763b --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcoming.java @@ -0,0 +1,283 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class CheckoutSessionBreakdownUpcoming { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private CheckoutSessionBreakdownUpcoming(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static CheckoutSessionBreakdownUpcoming installments(CheckoutSessionBreakdownUpcomingInstallments value) { + return new CheckoutSessionBreakdownUpcoming(new InstallmentsValue(value)); + } + + public static CheckoutSessionBreakdownUpcoming oneTime(CheckoutSessionBreakdownUpcomingOneTime value) { + return new CheckoutSessionBreakdownUpcoming(new OneTimeValue(value)); + } + + public static CheckoutSessionBreakdownUpcoming recurring(CheckoutSessionBreakdownUpcomingRecurring value) { + return new CheckoutSessionBreakdownUpcoming(new RecurringValue(value)); + } + + public boolean isInstallments() { + return value instanceof InstallmentsValue; + } + + public boolean isOneTime() { + return value instanceof OneTimeValue; + } + + public boolean isRecurring() { + return value instanceof RecurringValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getInstallments() { + if (isInstallments()) { + return Optional.of(((InstallmentsValue) value).value); + } + return Optional.empty(); + } + + public Optional getOneTime() { + if (isOneTime()) { + return Optional.of(((OneTimeValue) value).value); + } + return Optional.empty(); + } + + public Optional getRecurring() { + if (isRecurring()) { + return Optional.of(((RecurringValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownUpcoming + && value.equals(((CheckoutSessionBreakdownUpcoming) other).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return value.toString(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitInstallments(CheckoutSessionBreakdownUpcomingInstallments installments); + + T visitOneTime(CheckoutSessionBreakdownUpcomingOneTime oneTime); + + T visitRecurring(CheckoutSessionBreakdownUpcomingRecurring recurring); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(InstallmentsValue.class), + @JsonSubTypes.Type(OneTimeValue.class), + @JsonSubTypes.Type(RecurringValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("installments") + @JsonIgnoreProperties("type") + private static final class InstallmentsValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private CheckoutSessionBreakdownUpcomingInstallments value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private InstallmentsValue() {} + + private InstallmentsValue(CheckoutSessionBreakdownUpcomingInstallments value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitInstallments(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof InstallmentsValue && equalTo((InstallmentsValue) other); + } + + private boolean equalTo(InstallmentsValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionBreakdownUpcoming{" + "value: " + value + "}"; + } + } + + @JsonTypeName("one_time") + @JsonIgnoreProperties("type") + private static final class OneTimeValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private CheckoutSessionBreakdownUpcomingOneTime value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private OneTimeValue() {} + + private OneTimeValue(CheckoutSessionBreakdownUpcomingOneTime value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitOneTime(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof OneTimeValue && equalTo((OneTimeValue) other); + } + + private boolean equalTo(OneTimeValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionBreakdownUpcoming{" + "value: " + value + "}"; + } + } + + @JsonTypeName("recurring") + @JsonIgnoreProperties("type") + private static final class RecurringValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private CheckoutSessionBreakdownUpcomingRecurring value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RecurringValue() {} + + private RecurringValue(CheckoutSessionBreakdownUpcomingRecurring value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRecurring(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RecurringValue && equalTo((RecurringValue) other); + } + + private boolean equalTo(RecurringValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionBreakdownUpcoming{" + "value: " + value + "}"; + } + } + + @JsonIgnoreProperties("type") + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionBreakdownUpcoming{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingInstallments.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingInstallments.java new file mode 100644 index 00000000..333ccde8 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingInstallments.java @@ -0,0 +1,376 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdownUpcomingInstallments.Builder.class) +public final class CheckoutSessionBreakdownUpcomingInstallments { + private final Money amount; + + private final String chargeAt; + + private final String description; + + private final int intervalDays; + + private final Optional postPromoAmount; + + private final int remaining; + + private final Optional trialDays; + + private final Map additionalProperties; + + private CheckoutSessionBreakdownUpcomingInstallments( + Money amount, + String chargeAt, + String description, + int intervalDays, + Optional postPromoAmount, + int remaining, + Optional trialDays, + Map additionalProperties) { + this.amount = amount; + this.chargeAt = chargeAt; + this.description = description; + this.intervalDays = intervalDays; + this.postPromoAmount = postPromoAmount; + this.remaining = remaining; + this.trialDays = trialDays; + this.additionalProperties = additionalProperties; + } + + /** + * @return What the NEXT installment takes, priced as its receipt will be: the cycle for the quantity, the buyer service fee it carries, and the promo applied only when its duration still covers that charge. Stated before tax. + */ + @JsonProperty("amount") + public Money getAmount() { + return amount; + } + + /** + * @return When the next installment is charged, as an ISO 8601 timestamp. + */ + @JsonProperty("charge_at") + public String getChargeAt() { + return chargeAt; + } + + /** + * @return What to show the buyer for this future charge. + */ + @JsonProperty("description") + public String getDescription() { + return description; + } + + /** + * @return Days between installments. + */ + @JsonProperty("interval_days") + public int getIntervalDays() { + return intervalDays; + } + + /** + * @return What each installment takes once the applied promo stops covering them — the plan's own installment price, stated like amount (quantity, buyer fee, before tax). Present only when amount is discounted by a promo that expires before the remaining installments do; absent when no promo discounts the next installment, and for a forever code. + */ + @JsonProperty("post_promo_amount") + public Optional getPostPromoAmount() { + return postPromoAmount; + } + + /** + * @return How many of the plan's payments are LEFT after today. Only a charge that takes money consumes one — today's does when something is due now, while a free trial or a transfer leaves every payment ahead. + */ + @JsonProperty("remaining") + public int getRemaining() { + return remaining; + } + + /** + * @return Free-trial days before the first installment. Absent when the plan starts billing with this purchase. + */ + @JsonProperty("trial_days") + public Optional getTrialDays() { + return trialDays; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownUpcomingInstallments + && equalTo((CheckoutSessionBreakdownUpcomingInstallments) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdownUpcomingInstallments other) { + return amount.equals(other.amount) + && chargeAt.equals(other.chargeAt) + && description.equals(other.description) + && intervalDays == other.intervalDays + && postPromoAmount.equals(other.postPromoAmount) + && remaining == other.remaining + && trialDays.equals(other.trialDays); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.amount, + this.chargeAt, + this.description, + this.intervalDays, + this.postPromoAmount, + this.remaining, + this.trialDays); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AmountStage builder() { + return new Builder(); + } + + public interface AmountStage { + /** + *

What the NEXT installment takes, priced as its receipt will be: the cycle for the quantity, the buyer service fee it carries, and the promo applied only when its duration still covers that charge. Stated before tax.

+ */ + ChargeAtStage amount(@NotNull Money amount); + + Builder from(CheckoutSessionBreakdownUpcomingInstallments other); + } + + public interface ChargeAtStage { + /** + *

When the next installment is charged, as an ISO 8601 timestamp.

+ */ + DescriptionStage chargeAt(@NotNull String chargeAt); + } + + public interface DescriptionStage { + /** + *

What to show the buyer for this future charge.

+ */ + IntervalDaysStage description(@NotNull String description); + } + + public interface IntervalDaysStage { + /** + *

Days between installments.

+ */ + RemainingStage intervalDays(int intervalDays); + } + + public interface RemainingStage { + /** + *

How many of the plan's payments are LEFT after today. Only a charge that takes money consumes one — today's does when something is due now, while a free trial or a transfer leaves every payment ahead.

+ */ + _FinalStage remaining(int remaining); + } + + public interface _FinalStage { + CheckoutSessionBreakdownUpcomingInstallments build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

What each installment takes once the applied promo stops covering them — the plan's own installment price, stated like amount (quantity, buyer fee, before tax). Present only when amount is discounted by a promo that expires before the remaining installments do; absent when no promo discounts the next installment, and for a forever code.

+ */ + _FinalStage postPromoAmount(Optional postPromoAmount); + + _FinalStage postPromoAmount(Money postPromoAmount); + + /** + *

Free-trial days before the first installment. Absent when the plan starts billing with this purchase.

+ */ + _FinalStage trialDays(Optional trialDays); + + _FinalStage trialDays(Integer trialDays); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AmountStage, ChargeAtStage, DescriptionStage, IntervalDaysStage, RemainingStage, _FinalStage { + private Money amount; + + private String chargeAt; + + private String description; + + private int intervalDays; + + private int remaining; + + private Optional trialDays = Optional.empty(); + + private Optional postPromoAmount = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionBreakdownUpcomingInstallments other) { + amount(other.getAmount()); + chargeAt(other.getChargeAt()); + description(other.getDescription()); + intervalDays(other.getIntervalDays()); + postPromoAmount(other.getPostPromoAmount()); + remaining(other.getRemaining()); + trialDays(other.getTrialDays()); + return this; + } + + /** + *

What the NEXT installment takes, priced as its receipt will be: the cycle for the quantity, the buyer service fee it carries, and the promo applied only when its duration still covers that charge. Stated before tax.

+ *

What the NEXT installment takes, priced as its receipt will be: the cycle for the quantity, the buyer service fee it carries, and the promo applied only when its duration still covers that charge. Stated before tax.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("amount") + public ChargeAtStage amount(@NotNull Money amount) { + this.amount = Objects.requireNonNull(amount, "amount must not be null"); + return this; + } + + /** + *

When the next installment is charged, as an ISO 8601 timestamp.

+ *

When the next installment is charged, as an ISO 8601 timestamp.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("charge_at") + public DescriptionStage chargeAt(@NotNull String chargeAt) { + this.chargeAt = Objects.requireNonNull(chargeAt, "chargeAt must not be null"); + return this; + } + + /** + *

What to show the buyer for this future charge.

+ *

What to show the buyer for this future charge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("description") + public IntervalDaysStage description(@NotNull String description) { + this.description = Objects.requireNonNull(description, "description must not be null"); + return this; + } + + /** + *

Days between installments.

+ *

Days between installments.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("interval_days") + public RemainingStage intervalDays(int intervalDays) { + this.intervalDays = intervalDays; + return this; + } + + /** + *

How many of the plan's payments are LEFT after today. Only a charge that takes money consumes one — today's does when something is due now, while a free trial or a transfer leaves every payment ahead.

+ *

How many of the plan's payments are LEFT after today. Only a charge that takes money consumes one — today's does when something is due now, while a free trial or a transfer leaves every payment ahead.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("remaining") + public _FinalStage remaining(int remaining) { + this.remaining = remaining; + return this; + } + + /** + *

Free-trial days before the first installment. Absent when the plan starts billing with this purchase.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage trialDays(Integer trialDays) { + this.trialDays = Optional.ofNullable(trialDays); + return this; + } + + /** + *

Free-trial days before the first installment. Absent when the plan starts billing with this purchase.

+ */ + @java.lang.Override + @JsonSetter(value = "trial_days", nulls = Nulls.SKIP) + public _FinalStage trialDays(Optional trialDays) { + this.trialDays = trialDays; + return this; + } + + /** + *

What each installment takes once the applied promo stops covering them — the plan's own installment price, stated like amount (quantity, buyer fee, before tax). Present only when amount is discounted by a promo that expires before the remaining installments do; absent when no promo discounts the next installment, and for a forever code.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage postPromoAmount(Money postPromoAmount) { + this.postPromoAmount = Optional.ofNullable(postPromoAmount); + return this; + } + + /** + *

What each installment takes once the applied promo stops covering them — the plan's own installment price, stated like amount (quantity, buyer fee, before tax). Present only when amount is discounted by a promo that expires before the remaining installments do; absent when no promo discounts the next installment, and for a forever code.

+ */ + @java.lang.Override + @JsonSetter(value = "post_promo_amount", nulls = Nulls.SKIP) + public _FinalStage postPromoAmount(Optional postPromoAmount) { + this.postPromoAmount = postPromoAmount; + return this; + } + + @java.lang.Override + public CheckoutSessionBreakdownUpcomingInstallments build() { + return new CheckoutSessionBreakdownUpcomingInstallments( + amount, + chargeAt, + description, + intervalDays, + postPromoAmount, + remaining, + trialDays, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingOneTime.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingOneTime.java new file mode 100644 index 00000000..9304ef7f --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingOneTime.java @@ -0,0 +1,197 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdownUpcomingOneTime.Builder.class) +public final class CheckoutSessionBreakdownUpcomingOneTime { + private final Money amount; + + private final String chargeAt; + + private final String description; + + private final Map additionalProperties; + + private CheckoutSessionBreakdownUpcomingOneTime( + Money amount, String chargeAt, String description, Map additionalProperties) { + this.amount = amount; + this.chargeAt = chargeAt; + this.description = description; + this.additionalProperties = additionalProperties; + } + + /** + * @return What the charge takes. + */ + @JsonProperty("amount") + public Money getAmount() { + return amount; + } + + /** + * @return When it is charged, as an ISO 8601 timestamp. + */ + @JsonProperty("charge_at") + public String getChargeAt() { + return chargeAt; + } + + /** + * @return What to show the buyer for this future charge. + */ + @JsonProperty("description") + public String getDescription() { + return description; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownUpcomingOneTime + && equalTo((CheckoutSessionBreakdownUpcomingOneTime) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdownUpcomingOneTime other) { + return amount.equals(other.amount) && chargeAt.equals(other.chargeAt) && description.equals(other.description); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.amount, this.chargeAt, this.description); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AmountStage builder() { + return new Builder(); + } + + public interface AmountStage { + /** + *

What the charge takes.

+ */ + ChargeAtStage amount(@NotNull Money amount); + + Builder from(CheckoutSessionBreakdownUpcomingOneTime other); + } + + public interface ChargeAtStage { + /** + *

When it is charged, as an ISO 8601 timestamp.

+ */ + DescriptionStage chargeAt(@NotNull String chargeAt); + } + + public interface DescriptionStage { + /** + *

What to show the buyer for this future charge.

+ */ + _FinalStage description(@NotNull String description); + } + + public interface _FinalStage { + CheckoutSessionBreakdownUpcomingOneTime build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AmountStage, ChargeAtStage, DescriptionStage, _FinalStage { + private Money amount; + + private String chargeAt; + + private String description; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionBreakdownUpcomingOneTime other) { + amount(other.getAmount()); + chargeAt(other.getChargeAt()); + description(other.getDescription()); + return this; + } + + /** + *

What the charge takes.

+ *

What the charge takes.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("amount") + public ChargeAtStage amount(@NotNull Money amount) { + this.amount = Objects.requireNonNull(amount, "amount must not be null"); + return this; + } + + /** + *

When it is charged, as an ISO 8601 timestamp.

+ *

When it is charged, as an ISO 8601 timestamp.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("charge_at") + public DescriptionStage chargeAt(@NotNull String chargeAt) { + this.chargeAt = Objects.requireNonNull(chargeAt, "chargeAt must not be null"); + return this; + } + + /** + *

What to show the buyer for this future charge.

+ *

What to show the buyer for this future charge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("description") + public _FinalStage description(@NotNull String description) { + this.description = Objects.requireNonNull(description, "description must not be null"); + return this; + } + + @java.lang.Override + public CheckoutSessionBreakdownUpcomingOneTime build() { + return new CheckoutSessionBreakdownUpcomingOneTime(amount, chargeAt, description, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingRecurring.java b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingRecurring.java new file mode 100644 index 00000000..adab4058 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBreakdownUpcomingRecurring.java @@ -0,0 +1,328 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionBreakdownUpcomingRecurring.Builder.class) +public final class CheckoutSessionBreakdownUpcomingRecurring { + private final Money amount; + + private final String chargeAt; + + private final String description; + + private final int intervalDays; + + private final Optional postPromoAmount; + + private final Optional trialDays; + + private final Map additionalProperties; + + private CheckoutSessionBreakdownUpcomingRecurring( + Money amount, + String chargeAt, + String description, + int intervalDays, + Optional postPromoAmount, + Optional trialDays, + Map additionalProperties) { + this.amount = amount; + this.chargeAt = chargeAt; + this.description = description; + this.intervalDays = intervalDays; + this.postPromoAmount = postPromoAmount; + this.trialDays = trialDays; + this.additionalProperties = additionalProperties; + } + + /** + * @return What the NEXT charge takes, priced as its receipt will be: the renewal for the quantity, the buyer service fee it carries, and the promo applied only when its duration still covers that charge — a forever code discounts every cycle, a once or repeating one only the paying charges it has left. Stated before tax. + */ + @JsonProperty("amount") + public Money getAmount() { + return amount; + } + + /** + * @return When the NEXT charge happens — a trial's end, a transfer's inherited period end, or the next cycle — as an ISO 8601 timestamp. + */ + @JsonProperty("charge_at") + public String getChargeAt() { + return chargeAt; + } + + /** + * @return What to show the buyer for this future charge. + */ + @JsonProperty("description") + public String getDescription() { + return description; + } + + /** + * @return Days between charges. + */ + @JsonProperty("interval_days") + public int getIntervalDays() { + return intervalDays; + } + + /** + * @return What each charge takes once the applied promo stops covering renewals — the steady price the subscription returns to, priced like amount (quantity, buyer fee, before tax). Present only when amount is discounted by a promo that expires (a once code covering the first real charge, or a repeating window the schedule outlives — promo.duration says which). Absent when no promo discounts the next charge, and for a forever code, whose discount never ends. + */ + @JsonProperty("post_promo_amount") + public Optional getPostPromoAmount() { + return postPromoAmount; + } + + /** + * @return Free-trial days before the first charge. Absent when billing starts with this purchase — and on a membership transfer, which inherits the origin's clock and never re-trials. + */ + @JsonProperty("trial_days") + public Optional getTrialDays() { + return trialDays; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionBreakdownUpcomingRecurring + && equalTo((CheckoutSessionBreakdownUpcomingRecurring) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionBreakdownUpcomingRecurring other) { + return amount.equals(other.amount) + && chargeAt.equals(other.chargeAt) + && description.equals(other.description) + && intervalDays == other.intervalDays + && postPromoAmount.equals(other.postPromoAmount) + && trialDays.equals(other.trialDays); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.amount, this.chargeAt, this.description, this.intervalDays, this.postPromoAmount, this.trialDays); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AmountStage builder() { + return new Builder(); + } + + public interface AmountStage { + /** + *

What the NEXT charge takes, priced as its receipt will be: the renewal for the quantity, the buyer service fee it carries, and the promo applied only when its duration still covers that charge — a forever code discounts every cycle, a once or repeating one only the paying charges it has left. Stated before tax.

+ */ + ChargeAtStage amount(@NotNull Money amount); + + Builder from(CheckoutSessionBreakdownUpcomingRecurring other); + } + + public interface ChargeAtStage { + /** + *

When the NEXT charge happens — a trial's end, a transfer's inherited period end, or the next cycle — as an ISO 8601 timestamp.

+ */ + DescriptionStage chargeAt(@NotNull String chargeAt); + } + + public interface DescriptionStage { + /** + *

What to show the buyer for this future charge.

+ */ + IntervalDaysStage description(@NotNull String description); + } + + public interface IntervalDaysStage { + /** + *

Days between charges.

+ */ + _FinalStage intervalDays(int intervalDays); + } + + public interface _FinalStage { + CheckoutSessionBreakdownUpcomingRecurring build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

What each charge takes once the applied promo stops covering renewals — the steady price the subscription returns to, priced like amount (quantity, buyer fee, before tax). Present only when amount is discounted by a promo that expires (a once code covering the first real charge, or a repeating window the schedule outlives — promo.duration says which). Absent when no promo discounts the next charge, and for a forever code, whose discount never ends.

+ */ + _FinalStage postPromoAmount(Optional postPromoAmount); + + _FinalStage postPromoAmount(Money postPromoAmount); + + /** + *

Free-trial days before the first charge. Absent when billing starts with this purchase — and on a membership transfer, which inherits the origin's clock and never re-trials.

+ */ + _FinalStage trialDays(Optional trialDays); + + _FinalStage trialDays(Integer trialDays); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements AmountStage, ChargeAtStage, DescriptionStage, IntervalDaysStage, _FinalStage { + private Money amount; + + private String chargeAt; + + private String description; + + private int intervalDays; + + private Optional trialDays = Optional.empty(); + + private Optional postPromoAmount = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionBreakdownUpcomingRecurring other) { + amount(other.getAmount()); + chargeAt(other.getChargeAt()); + description(other.getDescription()); + intervalDays(other.getIntervalDays()); + postPromoAmount(other.getPostPromoAmount()); + trialDays(other.getTrialDays()); + return this; + } + + /** + *

What the NEXT charge takes, priced as its receipt will be: the renewal for the quantity, the buyer service fee it carries, and the promo applied only when its duration still covers that charge — a forever code discounts every cycle, a once or repeating one only the paying charges it has left. Stated before tax.

+ *

What the NEXT charge takes, priced as its receipt will be: the renewal for the quantity, the buyer service fee it carries, and the promo applied only when its duration still covers that charge — a forever code discounts every cycle, a once or repeating one only the paying charges it has left. Stated before tax.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("amount") + public ChargeAtStage amount(@NotNull Money amount) { + this.amount = Objects.requireNonNull(amount, "amount must not be null"); + return this; + } + + /** + *

When the NEXT charge happens — a trial's end, a transfer's inherited period end, or the next cycle — as an ISO 8601 timestamp.

+ *

When the NEXT charge happens — a trial's end, a transfer's inherited period end, or the next cycle — as an ISO 8601 timestamp.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("charge_at") + public DescriptionStage chargeAt(@NotNull String chargeAt) { + this.chargeAt = Objects.requireNonNull(chargeAt, "chargeAt must not be null"); + return this; + } + + /** + *

What to show the buyer for this future charge.

+ *

What to show the buyer for this future charge.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("description") + public IntervalDaysStage description(@NotNull String description) { + this.description = Objects.requireNonNull(description, "description must not be null"); + return this; + } + + /** + *

Days between charges.

+ *

Days between charges.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("interval_days") + public _FinalStage intervalDays(int intervalDays) { + this.intervalDays = intervalDays; + return this; + } + + /** + *

Free-trial days before the first charge. Absent when billing starts with this purchase — and on a membership transfer, which inherits the origin's clock and never re-trials.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage trialDays(Integer trialDays) { + this.trialDays = Optional.ofNullable(trialDays); + return this; + } + + /** + *

Free-trial days before the first charge. Absent when billing starts with this purchase — and on a membership transfer, which inherits the origin's clock and never re-trials.

+ */ + @java.lang.Override + @JsonSetter(value = "trial_days", nulls = Nulls.SKIP) + public _FinalStage trialDays(Optional trialDays) { + this.trialDays = trialDays; + return this; + } + + /** + *

What each charge takes once the applied promo stops covering renewals — the steady price the subscription returns to, priced like amount (quantity, buyer fee, before tax). Present only when amount is discounted by a promo that expires (a once code covering the first real charge, or a repeating window the schedule outlives — promo.duration says which). Absent when no promo discounts the next charge, and for a forever code, whose discount never ends.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage postPromoAmount(Money postPromoAmount) { + this.postPromoAmount = Optional.ofNullable(postPromoAmount); + return this; + } + + /** + *

What each charge takes once the applied promo stops covering renewals — the steady price the subscription returns to, priced like amount (quantity, buyer fee, before tax). Present only when amount is discounted by a promo that expires (a once code covering the first real charge, or a repeating window the schedule outlives — promo.duration says which). Absent when no promo discounts the next charge, and for a forever code, whose discount never ends.

+ */ + @java.lang.Override + @JsonSetter(value = "post_promo_amount", nulls = Nulls.SKIP) + public _FinalStage postPromoAmount(Optional postPromoAmount) { + this.postPromoAmount = postPromoAmount; + return this; + } + + @java.lang.Override + public CheckoutSessionBreakdownUpcomingRecurring build() { + return new CheckoutSessionBreakdownUpcomingRecurring( + amount, chargeAt, description, intervalDays, postPromoAmount, trialDays, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBuyerIdentity.java b/src/main/java/com/whop/api/types/CheckoutSessionBuyerIdentity.java new file mode 100644 index 00000000..7f59c6e2 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBuyerIdentity.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBuyerIdentity { + public static final CheckoutSessionBuyerIdentity AUTHENTICATED = + new CheckoutSessionBuyerIdentity(Value.AUTHENTICATED, "authenticated"); + + public static final CheckoutSessionBuyerIdentity ATTRIBUTED = + new CheckoutSessionBuyerIdentity(Value.ATTRIBUTED, "attributed"); + + private final Value value; + + private final String string; + + CheckoutSessionBuyerIdentity(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBuyerIdentity + && this.string.equals(((CheckoutSessionBuyerIdentity) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case AUTHENTICATED: + return visitor.visitAuthenticated(); + case ATTRIBUTED: + return visitor.visitAttributed(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBuyerIdentity valueOf(String value) { + switch (value) { + case "authenticated": + return AUTHENTICATED; + case "attributed": + return ATTRIBUTED; + default: + return new CheckoutSessionBuyerIdentity(Value.UNKNOWN, value); + } + } + + public enum Value { + ATTRIBUTED, + + AUTHENTICATED, + + UNKNOWN + } + + public interface Visitor { + T visitAttributed(); + + T visitAuthenticated(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionBuyerIdentityMethod.java b/src/main/java/com/whop/api/types/CheckoutSessionBuyerIdentityMethod.java new file mode 100644 index 00000000..3b066846 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionBuyerIdentityMethod.java @@ -0,0 +1,119 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionBuyerIdentityMethod { + public static final CheckoutSessionBuyerIdentityMethod CONFIRMATION_TOKEN_EMAIL = + new CheckoutSessionBuyerIdentityMethod(Value.CONFIRMATION_TOKEN_EMAIL, "confirmation_token_email"); + + public static final CheckoutSessionBuyerIdentityMethod BUYER_EMAIL = + new CheckoutSessionBuyerIdentityMethod(Value.BUYER_EMAIL, "buyer_email"); + + public static final CheckoutSessionBuyerIdentityMethod POST_PURCHASE_CLAIM = + new CheckoutSessionBuyerIdentityMethod(Value.POST_PURCHASE_CLAIM, "post_purchase_claim"); + + public static final CheckoutSessionBuyerIdentityMethod SESSION_INTENT = + new CheckoutSessionBuyerIdentityMethod(Value.SESSION_INTENT, "session_intent"); + + public static final CheckoutSessionBuyerIdentityMethod SAVED_PAYMENT_METHOD = + new CheckoutSessionBuyerIdentityMethod(Value.SAVED_PAYMENT_METHOD, "saved_payment_method"); + + private final Value value; + + private final String string; + + CheckoutSessionBuyerIdentityMethod(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionBuyerIdentityMethod + && this.string.equals(((CheckoutSessionBuyerIdentityMethod) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CONFIRMATION_TOKEN_EMAIL: + return visitor.visitConfirmationTokenEmail(); + case BUYER_EMAIL: + return visitor.visitBuyerEmail(); + case POST_PURCHASE_CLAIM: + return visitor.visitPostPurchaseClaim(); + case SESSION_INTENT: + return visitor.visitSessionIntent(); + case SAVED_PAYMENT_METHOD: + return visitor.visitSavedPaymentMethod(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionBuyerIdentityMethod valueOf(String value) { + switch (value) { + case "confirmation_token_email": + return CONFIRMATION_TOKEN_EMAIL; + case "buyer_email": + return BUYER_EMAIL; + case "post_purchase_claim": + return POST_PURCHASE_CLAIM; + case "session_intent": + return SESSION_INTENT; + case "saved_payment_method": + return SAVED_PAYMENT_METHOD; + default: + return new CheckoutSessionBuyerIdentityMethod(Value.UNKNOWN, value); + } + } + + public enum Value { + CONFIRMATION_TOKEN_EMAIL, + + BUYER_EMAIL, + + SAVED_PAYMENT_METHOD, + + SESSION_INTENT, + + POST_PURCHASE_CLAIM, + + UNKNOWN + } + + public interface Visitor { + T visitConfirmationTokenEmail(); + + T visitBuyerEmail(); + + T visitSavedPaymentMethod(); + + T visitSessionIntent(); + + T visitPostPurchaseClaim(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionCompleteAction.java b/src/main/java/com/whop/api/types/CheckoutSessionCompleteAction.java new file mode 100644 index 00000000..202f2832 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionCompleteAction.java @@ -0,0 +1,199 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionCompleteAction.Builder.class) +public final class CheckoutSessionCompleteAction { + private final boolean blocking; + + private final String clientSecret; + + private final CheckoutSessionCompleteActionKind kind; + + private final Map additionalProperties; + + private CheckoutSessionCompleteAction( + boolean blocking, + String clientSecret, + CheckoutSessionCompleteActionKind kind, + Map additionalProperties) { + this.blocking = blocking; + this.clientSecret = clientSecret; + this.kind = kind; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab. + */ + @JsonProperty("blocking") + public boolean getBlocking() { + return blocking; + } + + /** + * @return The ATTEMPT's own credential — the payment's or the setup's, never the session's. Hand it to the payments element to finish the remaining ceremony. + */ + @JsonProperty("client_secret") + public String getClientSecret() { + return clientSecret; + } + + /** + * @return What the ceremony finishes: payment for a charge with a step left, setup for a payment method still being saved — a paid waitlist vaults the card without charging it. Informational: the executor is the same either way, so run the secret regardless of a kind you do not recognize. + */ + @JsonProperty("kind") + public CheckoutSessionCompleteActionKind getKind() { + return kind; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionCompleteAction && equalTo((CheckoutSessionCompleteAction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionCompleteAction other) { + return blocking == other.blocking && clientSecret.equals(other.clientSecret) && kind.equals(other.kind); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.blocking, this.clientSecret, this.kind); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BlockingStage builder() { + return new Builder(); + } + + public interface BlockingStage { + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ */ + ClientSecretStage blocking(boolean blocking); + + Builder from(CheckoutSessionCompleteAction other); + } + + public interface ClientSecretStage { + /** + *

The ATTEMPT's own credential — the payment's or the setup's, never the session's. Hand it to the payments element to finish the remaining ceremony.

+ */ + KindStage clientSecret(@NotNull String clientSecret); + } + + public interface KindStage { + /** + *

What the ceremony finishes: payment for a charge with a step left, setup for a payment method still being saved — a paid waitlist vaults the card without charging it. Informational: the executor is the same either way, so run the secret regardless of a kind you do not recognize.

+ */ + _FinalStage kind(@NotNull CheckoutSessionCompleteActionKind kind); + } + + public interface _FinalStage { + CheckoutSessionCompleteAction build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BlockingStage, ClientSecretStage, KindStage, _FinalStage { + private boolean blocking; + + private String clientSecret; + + private CheckoutSessionCompleteActionKind kind; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionCompleteAction other) { + blocking(other.getBlocking()); + clientSecret(other.getClientSecret()); + kind(other.getKind()); + return this; + } + + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("blocking") + public ClientSecretStage blocking(boolean blocking) { + this.blocking = blocking; + return this; + } + + /** + *

The ATTEMPT's own credential — the payment's or the setup's, never the session's. Hand it to the payments element to finish the remaining ceremony.

+ *

The ATTEMPT's own credential — the payment's or the setup's, never the session's. Hand it to the payments element to finish the remaining ceremony.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("client_secret") + public KindStage clientSecret(@NotNull String clientSecret) { + this.clientSecret = Objects.requireNonNull(clientSecret, "clientSecret must not be null"); + return this; + } + + /** + *

What the ceremony finishes: payment for a charge with a step left, setup for a payment method still being saved — a paid waitlist vaults the card without charging it. Informational: the executor is the same either way, so run the secret regardless of a kind you do not recognize.

+ *

What the ceremony finishes: payment for a charge with a step left, setup for a payment method still being saved — a paid waitlist vaults the card without charging it. Informational: the executor is the same either way, so run the secret regardless of a kind you do not recognize.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("kind") + public _FinalStage kind(@NotNull CheckoutSessionCompleteActionKind kind) { + this.kind = Objects.requireNonNull(kind, "kind must not be null"); + return this; + } + + @java.lang.Override + public CheckoutSessionCompleteAction build() { + return new CheckoutSessionCompleteAction(blocking, clientSecret, kind, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionCompleteActionKind.java b/src/main/java/com/whop/api/types/CheckoutSessionCompleteActionKind.java new file mode 100644 index 00000000..6a8aea95 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionCompleteActionKind.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionCompleteActionKind { + public static final CheckoutSessionCompleteActionKind SETUP = + new CheckoutSessionCompleteActionKind(Value.SETUP, "setup"); + + public static final CheckoutSessionCompleteActionKind PAYMENT = + new CheckoutSessionCompleteActionKind(Value.PAYMENT, "payment"); + + private final Value value; + + private final String string; + + CheckoutSessionCompleteActionKind(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionCompleteActionKind + && this.string.equals(((CheckoutSessionCompleteActionKind) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SETUP: + return visitor.visitSetup(); + case PAYMENT: + return visitor.visitPayment(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionCompleteActionKind valueOf(String value) { + switch (value) { + case "setup": + return SETUP; + case "payment": + return PAYMENT; + default: + return new CheckoutSessionCompleteActionKind(Value.UNKNOWN, value); + } + } + + public enum Value { + PAYMENT, + + SETUP, + + UNKNOWN + } + + public interface Visitor { + T visitPayment(); + + T visitSetup(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionConfirmError.java b/src/main/java/com/whop/api/types/CheckoutSessionConfirmError.java new file mode 100644 index 00000000..36803b61 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionConfirmError.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionConfirmError.Builder.class) +public final class CheckoutSessionConfirmError { + private final CheckoutSessionConfirmErrorCode code; + + private final String message; + + private final Map additionalProperties; + + private CheckoutSessionConfirmError( + CheckoutSessionConfirmErrorCode code, String message, Map additionalProperties) { + this.code = code; + this.message = message; + this.additionalProperties = additionalProperties; + } + + /** + * @return What stopped the confirm. The session: session_expired, session_completed, confirm_in_progress, attestation_required. The price: quote_expired (already refreshed), quote_changed (the stored quote is not what this confirm would charge — the buyer who resolved at confirm prices differently, e.g. a returning buyer skipped past the plan's free trial; the session is already re-quoted, so re-read it, show the new total, and confirm again), rate_expired (the exchange rate behind a local-currency price aged out — re-read the session for a fresh one). The payment method: token_invalid, payment_method_unsupported, payment_method_unavailable (a saved method the token names no longer exists in the buyer's wallet — collect a fresh one). What is being sold, and whether it may still be sold: seller_unavailable, promo_invalid, shipping_address_required, custom_field_invalid (a required question is unanswered, or an answer names a question this product does not ask), plan_archived, product_archived, out_of_stock, purchases_disabled, blocked_country, custom_password (the plan's purchase password is unanswered — update the session's password and confirm again), waitlist_unavailable (this waitlist cannot be joined as asked — the message says why). The buyer: user_suspended, user_banned_from_whop, email_required, free_plan_already_owned, waitlist_entry_pending, waitlist_already_member, and buyer_ineligible — an account-state refusal read by someone who never proved they hold that account, so which state stays undisclosed. The payment itself: payment_failed. And engine_unavailable for a session whose mode this checkout cannot charge yet. Every one of these is terminal for this attempt as it stands — a refusal the buyer can resolve by doing something arrives as next_action instead. + */ + @JsonProperty("code") + public CheckoutSessionConfirmErrorCode getCode() { + return code; + } + + /** + * @return A human-readable explanation of the failure, safe to show the buyer. + */ + @JsonProperty("message") + public String getMessage() { + return message; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionConfirmError && equalTo((CheckoutSessionConfirmError) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionConfirmError other) { + return code.equals(other.code) && message.equals(other.message); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.code, this.message); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CodeStage builder() { + return new Builder(); + } + + public interface CodeStage { + /** + *

What stopped the confirm. The session: session_expired, session_completed, confirm_in_progress, attestation_required. The price: quote_expired (already refreshed), quote_changed (the stored quote is not what this confirm would charge — the buyer who resolved at confirm prices differently, e.g. a returning buyer skipped past the plan's free trial; the session is already re-quoted, so re-read it, show the new total, and confirm again), rate_expired (the exchange rate behind a local-currency price aged out — re-read the session for a fresh one). The payment method: token_invalid, payment_method_unsupported, payment_method_unavailable (a saved method the token names no longer exists in the buyer's wallet — collect a fresh one). What is being sold, and whether it may still be sold: seller_unavailable, promo_invalid, shipping_address_required, custom_field_invalid (a required question is unanswered, or an answer names a question this product does not ask), plan_archived, product_archived, out_of_stock, purchases_disabled, blocked_country, custom_password (the plan's purchase password is unanswered — update the session's password and confirm again), waitlist_unavailable (this waitlist cannot be joined as asked — the message says why). The buyer: user_suspended, user_banned_from_whop, email_required, free_plan_already_owned, waitlist_entry_pending, waitlist_already_member, and buyer_ineligible — an account-state refusal read by someone who never proved they hold that account, so which state stays undisclosed. The payment itself: payment_failed. And engine_unavailable for a session whose mode this checkout cannot charge yet. Every one of these is terminal for this attempt as it stands — a refusal the buyer can resolve by doing something arrives as next_action instead.

+ */ + MessageStage code(@NotNull CheckoutSessionConfirmErrorCode code); + + Builder from(CheckoutSessionConfirmError other); + } + + public interface MessageStage { + /** + *

A human-readable explanation of the failure, safe to show the buyer.

+ */ + _FinalStage message(@NotNull String message); + } + + public interface _FinalStage { + CheckoutSessionConfirmError build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CodeStage, MessageStage, _FinalStage { + private CheckoutSessionConfirmErrorCode code; + + private String message; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionConfirmError other) { + code(other.getCode()); + message(other.getMessage()); + return this; + } + + /** + *

What stopped the confirm. The session: session_expired, session_completed, confirm_in_progress, attestation_required. The price: quote_expired (already refreshed), quote_changed (the stored quote is not what this confirm would charge — the buyer who resolved at confirm prices differently, e.g. a returning buyer skipped past the plan's free trial; the session is already re-quoted, so re-read it, show the new total, and confirm again), rate_expired (the exchange rate behind a local-currency price aged out — re-read the session for a fresh one). The payment method: token_invalid, payment_method_unsupported, payment_method_unavailable (a saved method the token names no longer exists in the buyer's wallet — collect a fresh one). What is being sold, and whether it may still be sold: seller_unavailable, promo_invalid, shipping_address_required, custom_field_invalid (a required question is unanswered, or an answer names a question this product does not ask), plan_archived, product_archived, out_of_stock, purchases_disabled, blocked_country, custom_password (the plan's purchase password is unanswered — update the session's password and confirm again), waitlist_unavailable (this waitlist cannot be joined as asked — the message says why). The buyer: user_suspended, user_banned_from_whop, email_required, free_plan_already_owned, waitlist_entry_pending, waitlist_already_member, and buyer_ineligible — an account-state refusal read by someone who never proved they hold that account, so which state stays undisclosed. The payment itself: payment_failed. And engine_unavailable for a session whose mode this checkout cannot charge yet. Every one of these is terminal for this attempt as it stands — a refusal the buyer can resolve by doing something arrives as next_action instead.

+ *

What stopped the confirm. The session: session_expired, session_completed, confirm_in_progress, attestation_required. The price: quote_expired (already refreshed), quote_changed (the stored quote is not what this confirm would charge — the buyer who resolved at confirm prices differently, e.g. a returning buyer skipped past the plan's free trial; the session is already re-quoted, so re-read it, show the new total, and confirm again), rate_expired (the exchange rate behind a local-currency price aged out — re-read the session for a fresh one). The payment method: token_invalid, payment_method_unsupported, payment_method_unavailable (a saved method the token names no longer exists in the buyer's wallet — collect a fresh one). What is being sold, and whether it may still be sold: seller_unavailable, promo_invalid, shipping_address_required, custom_field_invalid (a required question is unanswered, or an answer names a question this product does not ask), plan_archived, product_archived, out_of_stock, purchases_disabled, blocked_country, custom_password (the plan's purchase password is unanswered — update the session's password and confirm again), waitlist_unavailable (this waitlist cannot be joined as asked — the message says why). The buyer: user_suspended, user_banned_from_whop, email_required, free_plan_already_owned, waitlist_entry_pending, waitlist_already_member, and buyer_ineligible — an account-state refusal read by someone who never proved they hold that account, so which state stays undisclosed. The payment itself: payment_failed. And engine_unavailable for a session whose mode this checkout cannot charge yet. Every one of these is terminal for this attempt as it stands — a refusal the buyer can resolve by doing something arrives as next_action instead.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("code") + public MessageStage code(@NotNull CheckoutSessionConfirmErrorCode code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + /** + *

A human-readable explanation of the failure, safe to show the buyer.

+ *

A human-readable explanation of the failure, safe to show the buyer.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("message") + public _FinalStage message(@NotNull String message) { + this.message = Objects.requireNonNull(message, "message must not be null"); + return this; + } + + @java.lang.Override + public CheckoutSessionConfirmError build() { + return new CheckoutSessionConfirmError(code, message, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionConfirmErrorCode.java b/src/main/java/com/whop/api/types/CheckoutSessionConfirmErrorCode.java new file mode 100644 index 00000000..f64e2322 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionConfirmErrorCode.java @@ -0,0 +1,394 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionConfirmErrorCode { + public static final CheckoutSessionConfirmErrorCode BLOCKED_COUNTRY = + new CheckoutSessionConfirmErrorCode(Value.BLOCKED_COUNTRY, "blocked_country"); + + public static final CheckoutSessionConfirmErrorCode PAYMENT_METHOD_UNSUPPORTED = + new CheckoutSessionConfirmErrorCode(Value.PAYMENT_METHOD_UNSUPPORTED, "payment_method_unsupported"); + + public static final CheckoutSessionConfirmErrorCode WAITLIST_ALREADY_MEMBER = + new CheckoutSessionConfirmErrorCode(Value.WAITLIST_ALREADY_MEMBER, "waitlist_already_member"); + + public static final CheckoutSessionConfirmErrorCode SESSION_COMPLETED = + new CheckoutSessionConfirmErrorCode(Value.SESSION_COMPLETED, "session_completed"); + + public static final CheckoutSessionConfirmErrorCode ATTESTATION_REQUIRED = + new CheckoutSessionConfirmErrorCode(Value.ATTESTATION_REQUIRED, "attestation_required"); + + public static final CheckoutSessionConfirmErrorCode USER_SUSPENDED = + new CheckoutSessionConfirmErrorCode(Value.USER_SUSPENDED, "user_suspended"); + + public static final CheckoutSessionConfirmErrorCode PRODUCT_ARCHIVED = + new CheckoutSessionConfirmErrorCode(Value.PRODUCT_ARCHIVED, "product_archived"); + + public static final CheckoutSessionConfirmErrorCode ENGINE_UNAVAILABLE = + new CheckoutSessionConfirmErrorCode(Value.ENGINE_UNAVAILABLE, "engine_unavailable"); + + public static final CheckoutSessionConfirmErrorCode PLAN_ARCHIVED = + new CheckoutSessionConfirmErrorCode(Value.PLAN_ARCHIVED, "plan_archived"); + + public static final CheckoutSessionConfirmErrorCode QUOTE_EXPIRED = + new CheckoutSessionConfirmErrorCode(Value.QUOTE_EXPIRED, "quote_expired"); + + public static final CheckoutSessionConfirmErrorCode USER_BANNED_FROM_WHOP = + new CheckoutSessionConfirmErrorCode(Value.USER_BANNED_FROM_WHOP, "user_banned_from_whop"); + + public static final CheckoutSessionConfirmErrorCode WAITLIST_ENTRY_PENDING = + new CheckoutSessionConfirmErrorCode(Value.WAITLIST_ENTRY_PENDING, "waitlist_entry_pending"); + + public static final CheckoutSessionConfirmErrorCode RATE_EXPIRED = + new CheckoutSessionConfirmErrorCode(Value.RATE_EXPIRED, "rate_expired"); + + public static final CheckoutSessionConfirmErrorCode EMAIL_REQUIRED = + new CheckoutSessionConfirmErrorCode(Value.EMAIL_REQUIRED, "email_required"); + + public static final CheckoutSessionConfirmErrorCode QUOTE_CHANGED = + new CheckoutSessionConfirmErrorCode(Value.QUOTE_CHANGED, "quote_changed"); + + public static final CheckoutSessionConfirmErrorCode BUYER_INELIGIBLE = + new CheckoutSessionConfirmErrorCode(Value.BUYER_INELIGIBLE, "buyer_ineligible"); + + public static final CheckoutSessionConfirmErrorCode CONFIRM_IN_PROGRESS = + new CheckoutSessionConfirmErrorCode(Value.CONFIRM_IN_PROGRESS, "confirm_in_progress"); + + public static final CheckoutSessionConfirmErrorCode CUSTOM_FIELD_INVALID = + new CheckoutSessionConfirmErrorCode(Value.CUSTOM_FIELD_INVALID, "custom_field_invalid"); + + public static final CheckoutSessionConfirmErrorCode FREE_PLAN_ALREADY_OWNED = + new CheckoutSessionConfirmErrorCode(Value.FREE_PLAN_ALREADY_OWNED, "free_plan_already_owned"); + + public static final CheckoutSessionConfirmErrorCode PAYMENT_FAILED = + new CheckoutSessionConfirmErrorCode(Value.PAYMENT_FAILED, "payment_failed"); + + public static final CheckoutSessionConfirmErrorCode TOKEN_INVALID = + new CheckoutSessionConfirmErrorCode(Value.TOKEN_INVALID, "token_invalid"); + + public static final CheckoutSessionConfirmErrorCode PROMO_INVALID = + new CheckoutSessionConfirmErrorCode(Value.PROMO_INVALID, "promo_invalid"); + + public static final CheckoutSessionConfirmErrorCode CUSTOM_PASSWORD = + new CheckoutSessionConfirmErrorCode(Value.CUSTOM_PASSWORD, "custom_password"); + + public static final CheckoutSessionConfirmErrorCode PURCHASES_DISABLED = + new CheckoutSessionConfirmErrorCode(Value.PURCHASES_DISABLED, "purchases_disabled"); + + public static final CheckoutSessionConfirmErrorCode SHIPPING_ADDRESS_REQUIRED = + new CheckoutSessionConfirmErrorCode(Value.SHIPPING_ADDRESS_REQUIRED, "shipping_address_required"); + + public static final CheckoutSessionConfirmErrorCode PAYMENT_METHOD_UNAVAILABLE = + new CheckoutSessionConfirmErrorCode(Value.PAYMENT_METHOD_UNAVAILABLE, "payment_method_unavailable"); + + public static final CheckoutSessionConfirmErrorCode WAITLIST_UNAVAILABLE = + new CheckoutSessionConfirmErrorCode(Value.WAITLIST_UNAVAILABLE, "waitlist_unavailable"); + + public static final CheckoutSessionConfirmErrorCode SELLER_UNAVAILABLE = + new CheckoutSessionConfirmErrorCode(Value.SELLER_UNAVAILABLE, "seller_unavailable"); + + public static final CheckoutSessionConfirmErrorCode OUT_OF_STOCK = + new CheckoutSessionConfirmErrorCode(Value.OUT_OF_STOCK, "out_of_stock"); + + public static final CheckoutSessionConfirmErrorCode SESSION_EXPIRED = + new CheckoutSessionConfirmErrorCode(Value.SESSION_EXPIRED, "session_expired"); + + private final Value value; + + private final String string; + + CheckoutSessionConfirmErrorCode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionConfirmErrorCode + && this.string.equals(((CheckoutSessionConfirmErrorCode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case BLOCKED_COUNTRY: + return visitor.visitBlockedCountry(); + case PAYMENT_METHOD_UNSUPPORTED: + return visitor.visitPaymentMethodUnsupported(); + case WAITLIST_ALREADY_MEMBER: + return visitor.visitWaitlistAlreadyMember(); + case SESSION_COMPLETED: + return visitor.visitSessionCompleted(); + case ATTESTATION_REQUIRED: + return visitor.visitAttestationRequired(); + case USER_SUSPENDED: + return visitor.visitUserSuspended(); + case PRODUCT_ARCHIVED: + return visitor.visitProductArchived(); + case ENGINE_UNAVAILABLE: + return visitor.visitEngineUnavailable(); + case PLAN_ARCHIVED: + return visitor.visitPlanArchived(); + case QUOTE_EXPIRED: + return visitor.visitQuoteExpired(); + case USER_BANNED_FROM_WHOP: + return visitor.visitUserBannedFromWhop(); + case WAITLIST_ENTRY_PENDING: + return visitor.visitWaitlistEntryPending(); + case RATE_EXPIRED: + return visitor.visitRateExpired(); + case EMAIL_REQUIRED: + return visitor.visitEmailRequired(); + case QUOTE_CHANGED: + return visitor.visitQuoteChanged(); + case BUYER_INELIGIBLE: + return visitor.visitBuyerIneligible(); + case CONFIRM_IN_PROGRESS: + return visitor.visitConfirmInProgress(); + case CUSTOM_FIELD_INVALID: + return visitor.visitCustomFieldInvalid(); + case FREE_PLAN_ALREADY_OWNED: + return visitor.visitFreePlanAlreadyOwned(); + case PAYMENT_FAILED: + return visitor.visitPaymentFailed(); + case TOKEN_INVALID: + return visitor.visitTokenInvalid(); + case PROMO_INVALID: + return visitor.visitPromoInvalid(); + case CUSTOM_PASSWORD: + return visitor.visitCustomPassword(); + case PURCHASES_DISABLED: + return visitor.visitPurchasesDisabled(); + case SHIPPING_ADDRESS_REQUIRED: + return visitor.visitShippingAddressRequired(); + case PAYMENT_METHOD_UNAVAILABLE: + return visitor.visitPaymentMethodUnavailable(); + case WAITLIST_UNAVAILABLE: + return visitor.visitWaitlistUnavailable(); + case SELLER_UNAVAILABLE: + return visitor.visitSellerUnavailable(); + case OUT_OF_STOCK: + return visitor.visitOutOfStock(); + case SESSION_EXPIRED: + return visitor.visitSessionExpired(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionConfirmErrorCode valueOf(String value) { + switch (value) { + case "blocked_country": + return BLOCKED_COUNTRY; + case "payment_method_unsupported": + return PAYMENT_METHOD_UNSUPPORTED; + case "waitlist_already_member": + return WAITLIST_ALREADY_MEMBER; + case "session_completed": + return SESSION_COMPLETED; + case "attestation_required": + return ATTESTATION_REQUIRED; + case "user_suspended": + return USER_SUSPENDED; + case "product_archived": + return PRODUCT_ARCHIVED; + case "engine_unavailable": + return ENGINE_UNAVAILABLE; + case "plan_archived": + return PLAN_ARCHIVED; + case "quote_expired": + return QUOTE_EXPIRED; + case "user_banned_from_whop": + return USER_BANNED_FROM_WHOP; + case "waitlist_entry_pending": + return WAITLIST_ENTRY_PENDING; + case "rate_expired": + return RATE_EXPIRED; + case "email_required": + return EMAIL_REQUIRED; + case "quote_changed": + return QUOTE_CHANGED; + case "buyer_ineligible": + return BUYER_INELIGIBLE; + case "confirm_in_progress": + return CONFIRM_IN_PROGRESS; + case "custom_field_invalid": + return CUSTOM_FIELD_INVALID; + case "free_plan_already_owned": + return FREE_PLAN_ALREADY_OWNED; + case "payment_failed": + return PAYMENT_FAILED; + case "token_invalid": + return TOKEN_INVALID; + case "promo_invalid": + return PROMO_INVALID; + case "custom_password": + return CUSTOM_PASSWORD; + case "purchases_disabled": + return PURCHASES_DISABLED; + case "shipping_address_required": + return SHIPPING_ADDRESS_REQUIRED; + case "payment_method_unavailable": + return PAYMENT_METHOD_UNAVAILABLE; + case "waitlist_unavailable": + return WAITLIST_UNAVAILABLE; + case "seller_unavailable": + return SELLER_UNAVAILABLE; + case "out_of_stock": + return OUT_OF_STOCK; + case "session_expired": + return SESSION_EXPIRED; + default: + return new CheckoutSessionConfirmErrorCode(Value.UNKNOWN, value); + } + } + + public enum Value { + SESSION_EXPIRED, + + SESSION_COMPLETED, + + ATTESTATION_REQUIRED, + + QUOTE_EXPIRED, + + QUOTE_CHANGED, + + RATE_EXPIRED, + + TOKEN_INVALID, + + CONFIRM_IN_PROGRESS, + + ENGINE_UNAVAILABLE, + + SELLER_UNAVAILABLE, + + PROMO_INVALID, + + PAYMENT_METHOD_UNSUPPORTED, + + PAYMENT_METHOD_UNAVAILABLE, + + SHIPPING_ADDRESS_REQUIRED, + + CUSTOM_FIELD_INVALID, + + PAYMENT_FAILED, + + WAITLIST_UNAVAILABLE, + + PURCHASES_DISABLED, + + PLAN_ARCHIVED, + + PRODUCT_ARCHIVED, + + OUT_OF_STOCK, + + CUSTOM_PASSWORD, + + BLOCKED_COUNTRY, + + USER_SUSPENDED, + + USER_BANNED_FROM_WHOP, + + EMAIL_REQUIRED, + + FREE_PLAN_ALREADY_OWNED, + + WAITLIST_ENTRY_PENDING, + + WAITLIST_ALREADY_MEMBER, + + BUYER_INELIGIBLE, + + UNKNOWN + } + + public interface Visitor { + T visitSessionExpired(); + + T visitSessionCompleted(); + + T visitAttestationRequired(); + + T visitQuoteExpired(); + + T visitQuoteChanged(); + + T visitRateExpired(); + + T visitTokenInvalid(); + + T visitConfirmInProgress(); + + T visitEngineUnavailable(); + + T visitSellerUnavailable(); + + T visitPromoInvalid(); + + T visitPaymentMethodUnsupported(); + + T visitPaymentMethodUnavailable(); + + T visitShippingAddressRequired(); + + T visitCustomFieldInvalid(); + + T visitPaymentFailed(); + + T visitWaitlistUnavailable(); + + T visitPurchasesDisabled(); + + T visitPlanArchived(); + + T visitProductArchived(); + + T visitOutOfStock(); + + T visitCustomPassword(); + + T visitBlockedCountry(); + + T visitUserSuspended(); + + T visitUserBannedFromWhop(); + + T visitEmailRequired(); + + T visitFreePlanAlreadyOwned(); + + T visitWaitlistEntryPending(); + + T visitWaitlistAlreadyMember(); + + T visitBuyerIneligible(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionCtaLabel.java b/src/main/java/com/whop/api/types/CheckoutSessionCtaLabel.java new file mode 100644 index 00000000..b753a3b1 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionCtaLabel.java @@ -0,0 +1,127 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionCtaLabel { + public static final CheckoutSessionCtaLabel ACCEPT_TRANSFER = + new CheckoutSessionCtaLabel(Value.ACCEPT_TRANSFER, "accept_transfer"); + + public static final CheckoutSessionCtaLabel PAY = new CheckoutSessionCtaLabel(Value.PAY, "pay"); + + public static final CheckoutSessionCtaLabel CONTINUE = new CheckoutSessionCtaLabel(Value.CONTINUE, "continue"); + + public static final CheckoutSessionCtaLabel SUBSCRIBE = new CheckoutSessionCtaLabel(Value.SUBSCRIBE, "subscribe"); + + public static final CheckoutSessionCtaLabel START_TRIAL = + new CheckoutSessionCtaLabel(Value.START_TRIAL, "start_trial"); + + public static final CheckoutSessionCtaLabel JOIN_WAITLIST = + new CheckoutSessionCtaLabel(Value.JOIN_WAITLIST, "join_waitlist"); + + private final Value value; + + private final String string; + + CheckoutSessionCtaLabel(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionCtaLabel + && this.string.equals(((CheckoutSessionCtaLabel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case ACCEPT_TRANSFER: + return visitor.visitAcceptTransfer(); + case PAY: + return visitor.visitPay(); + case CONTINUE: + return visitor.visitContinue(); + case SUBSCRIBE: + return visitor.visitSubscribe(); + case START_TRIAL: + return visitor.visitStartTrial(); + case JOIN_WAITLIST: + return visitor.visitJoinWaitlist(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionCtaLabel valueOf(String value) { + switch (value) { + case "accept_transfer": + return ACCEPT_TRANSFER; + case "pay": + return PAY; + case "continue": + return CONTINUE; + case "subscribe": + return SUBSCRIBE; + case "start_trial": + return START_TRIAL; + case "join_waitlist": + return JOIN_WAITLIST; + default: + return new CheckoutSessionCtaLabel(Value.UNKNOWN, value); + } + } + + public enum Value { + ACCEPT_TRANSFER, + + PAY, + + CONTINUE, + + START_TRIAL, + + SUBSCRIBE, + + JOIN_WAITLIST, + + UNKNOWN + } + + public interface Visitor { + T visitAcceptTransfer(); + + T visitPay(); + + T visitContinue(); + + T visitStartTrial(); + + T visitSubscribe(); + + T visitJoinWaitlist(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionCustomField.java b/src/main/java/com/whop/api/types/CheckoutSessionCustomField.java new file mode 100644 index 00000000..3879f623 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionCustomField.java @@ -0,0 +1,382 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionCustomField.Builder.class) +public final class CheckoutSessionCustomField { + private final Optional description; + + private final CheckoutSessionCustomFieldFieldType fieldType; + + private final String id; + + private final String name; + + private final Optional placeholder; + + private final boolean required; + + private final Map additionalProperties; + + private CheckoutSessionCustomField( + Optional description, + CheckoutSessionCustomFieldFieldType fieldType, + String id, + String name, + Optional placeholder, + boolean required, + Map additionalProperties) { + this.description = description; + this.fieldType = fieldType; + this.id = id; + this.name = name; + this.placeholder = placeholder; + this.required = required; + this.additionalProperties = additionalProperties; + } + + /** + * @return The seller's longer explanation of the question, or null. + */ + @JsonIgnore + public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } + return description; + } + + /** + * @return What kind of input to render. text today. + */ + @JsonProperty("field_type") + public CheckoutSessionCustomFieldFieldType getFieldType() { + return fieldType; + } + + /** + * @return The question's ID, prefixed field_. Echo it as the id of the matching custom_field_responses entry. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return The question as the seller wrote it — the field's label. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return Placeholder text for the input, or null. + */ + @JsonIgnore + public Optional getPlaceholder() { + if (placeholder == null) { + return Optional.empty(); + } + return placeholder; + } + + /** + * @return Whether confirm refuses without an answer. An unanswered required question is refused with custom_field_invalid. + */ + @JsonProperty("required") + public boolean getRequired() { + return required; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("placeholder") + private Optional _getPlaceholder() { + return placeholder; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionCustomField && equalTo((CheckoutSessionCustomField) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionCustomField other) { + return description.equals(other.description) + && fieldType.equals(other.fieldType) + && id.equals(other.id) + && name.equals(other.name) + && placeholder.equals(other.placeholder) + && required == other.required; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.description, this.fieldType, this.id, this.name, this.placeholder, this.required); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static FieldTypeStage builder() { + return new Builder(); + } + + public interface FieldTypeStage { + /** + *

What kind of input to render. text today.

+ */ + IdStage fieldType(@NotNull CheckoutSessionCustomFieldFieldType fieldType); + + Builder from(CheckoutSessionCustomField other); + } + + public interface IdStage { + /** + *

The question's ID, prefixed field_. Echo it as the id of the matching custom_field_responses entry.

+ */ + NameStage id(@NotNull String id); + } + + public interface NameStage { + /** + *

The question as the seller wrote it — the field's label.

+ */ + RequiredStage name(@NotNull String name); + } + + public interface RequiredStage { + /** + *

Whether confirm refuses without an answer. An unanswered required question is refused with custom_field_invalid.

+ */ + _FinalStage required(boolean required); + } + + public interface _FinalStage { + CheckoutSessionCustomField build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The seller's longer explanation of the question, or null.

+ */ + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage description(Nullable description); + + /** + *

Placeholder text for the input, or null.

+ */ + _FinalStage placeholder(Optional placeholder); + + _FinalStage placeholder(String placeholder); + + _FinalStage placeholder(Nullable placeholder); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements FieldTypeStage, IdStage, NameStage, RequiredStage, _FinalStage { + private CheckoutSessionCustomFieldFieldType fieldType; + + private String id; + + private String name; + + private boolean required; + + private Optional placeholder = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionCustomField other) { + description(other.getDescription()); + fieldType(other.getFieldType()); + id(other.getId()); + name(other.getName()); + placeholder(other.getPlaceholder()); + required(other.getRequired()); + return this; + } + + /** + *

What kind of input to render. text today.

+ *

What kind of input to render. text today.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("field_type") + public IdStage fieldType(@NotNull CheckoutSessionCustomFieldFieldType fieldType) { + this.fieldType = Objects.requireNonNull(fieldType, "fieldType must not be null"); + return this; + } + + /** + *

The question's ID, prefixed field_. Echo it as the id of the matching custom_field_responses entry.

+ *

The question's ID, prefixed field_. Echo it as the id of the matching custom_field_responses entry.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public NameStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

The question as the seller wrote it — the field's label.

+ *

The question as the seller wrote it — the field's label.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public RequiredStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

Whether confirm refuses without an answer. An unanswered required question is refused with custom_field_invalid.

+ *

Whether confirm refuses without an answer. An unanswered required question is refused with custom_field_invalid.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("required") + public _FinalStage required(boolean required) { + this.required = required; + return this; + } + + /** + *

Placeholder text for the input, or null.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage placeholder(Nullable placeholder) { + if (placeholder.isNull()) { + this.placeholder = null; + } else if (placeholder.isEmpty()) { + this.placeholder = Optional.empty(); + } else { + this.placeholder = Optional.of(placeholder.get()); + } + return this; + } + + /** + *

Placeholder text for the input, or null.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage placeholder(String placeholder) { + this.placeholder = Optional.ofNullable(placeholder); + return this; + } + + /** + *

Placeholder text for the input, or null.

+ */ + @java.lang.Override + @JsonSetter(value = "placeholder", nulls = Nulls.SKIP) + public _FinalStage placeholder(Optional placeholder) { + this.placeholder = placeholder; + return this; + } + + /** + *

The seller's longer explanation of the question, or null.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + + /** + *

The seller's longer explanation of the question, or null.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

The seller's longer explanation of the question, or null.

+ */ + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public CheckoutSessionCustomField build() { + return new CheckoutSessionCustomField( + description, fieldType, id, name, placeholder, required, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionCustomFieldFieldType.java b/src/main/java/com/whop/api/types/CheckoutSessionCustomFieldFieldType.java new file mode 100644 index 00000000..fdd2154d --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionCustomFieldFieldType.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionCustomFieldFieldType { + public static final CheckoutSessionCustomFieldFieldType TEXT = + new CheckoutSessionCustomFieldFieldType(Value.TEXT, "text"); + + private final Value value; + + private final String string; + + CheckoutSessionCustomFieldFieldType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionCustomFieldFieldType + && this.string.equals(((CheckoutSessionCustomFieldFieldType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TEXT: + return visitor.visitText(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionCustomFieldFieldType valueOf(String value) { + switch (value) { + case "text": + return TEXT; + default: + return new CheckoutSessionCustomFieldFieldType(Value.UNKNOWN, value); + } + } + + public enum Value { + TEXT, + + UNKNOWN + } + + public interface Visitor { + T visitText(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/TransferOriginCompany.java b/src/main/java/com/whop/api/types/CheckoutSessionCustomFieldResponse.java similarity index 52% rename from src/main/java/com/whop/api/types/TransferOriginCompany.java rename to src/main/java/com/whop/api/types/CheckoutSessionCustomFieldResponse.java index 76bf0345..eaa5dd60 100644 --- a/src/main/java/com/whop/api/types/TransferOriginCompany.java +++ b/src/main/java/com/whop/api/types/CheckoutSessionCustomFieldResponse.java @@ -17,25 +17,22 @@ import org.jetbrains.annotations.NotNull; @JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TransferOriginCompany.Builder.class) -public final class TransferOriginCompany { +@JsonDeserialize(builder = CheckoutSessionCustomFieldResponse.Builder.class) +public final class CheckoutSessionCustomFieldResponse { private final String id; - private final String route; - - private final String title; + private final String value; private final Map additionalProperties; - private TransferOriginCompany(String id, String route, String title, Map additionalProperties) { + private CheckoutSessionCustomFieldResponse(String id, String value, Map additionalProperties) { this.id = id; - this.route = route; - this.title = title; + this.value = value; this.additionalProperties = additionalProperties; } /** - * @return The unique identifier for the company. + * @return The plan custom field this answers, prefixed field_ — the id of the matching entry published by the custom_fields requirement. */ @JsonProperty("id") public String getId() { @@ -43,25 +40,18 @@ public String getId() { } /** - * @return The URL slug for the company's store page. - */ - @JsonProperty("route") - public String getRoute() { - return route; - } - - /** - * @return The display name of the company shown to customers. + * @return The buyer's answer, as typed. */ - @JsonProperty("title") - public String getTitle() { - return title; + @JsonProperty("value") + public String getValue() { + return value; } @java.lang.Override public boolean equals(Object other) { if (this == other) return true; - return other instanceof TransferOriginCompany && equalTo((TransferOriginCompany) other); + return other instanceof CheckoutSessionCustomFieldResponse + && equalTo((CheckoutSessionCustomFieldResponse) other); } @JsonAnyGetter @@ -69,13 +59,13 @@ public Map getAdditionalProperties() { return this.additionalProperties; } - private boolean equalTo(TransferOriginCompany other) { - return id.equals(other.id) && route.equals(other.route) && title.equals(other.title); + private boolean equalTo(CheckoutSessionCustomFieldResponse other) { + return id.equals(other.id) && value.equals(other.value); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.route, this.title); + return Objects.hash(this.id, this.value); } @java.lang.Override @@ -89,29 +79,22 @@ public static IdStage builder() { public interface IdStage { /** - *

The unique identifier for the company.

+ *

The plan custom field this answers, prefixed field_ — the id of the matching entry published by the custom_fields requirement.

*/ - RouteStage id(@NotNull String id); + ValueStage id(@NotNull String id); - Builder from(TransferOriginCompany other); - } - - public interface RouteStage { - /** - *

The URL slug for the company's store page.

- */ - TitleStage route(@NotNull String route); + Builder from(CheckoutSessionCustomFieldResponse other); } - public interface TitleStage { + public interface ValueStage { /** - *

The display name of the company shown to customers.

+ *

The buyer's answer, as typed.

*/ - _FinalStage title(@NotNull String title); + _FinalStage value(@NotNull String value); } public interface _FinalStage { - TransferOriginCompany build(); + CheckoutSessionCustomFieldResponse build(); _FinalStage additionalProperty(String key, Object value); @@ -119,12 +102,10 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, RouteStage, TitleStage, _FinalStage { + public static final class Builder implements IdStage, ValueStage, _FinalStage { private String id; - private String route; - - private String title; + private String value; @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -132,52 +113,39 @@ public static final class Builder implements IdStage, RouteStage, TitleStage, _F private Builder() {} @java.lang.Override - public Builder from(TransferOriginCompany other) { + public Builder from(CheckoutSessionCustomFieldResponse other) { id(other.getId()); - route(other.getRoute()); - title(other.getTitle()); + value(other.getValue()); return this; } /** - *

The unique identifier for the company.

- *

The unique identifier for the company.

+ *

The plan custom field this answers, prefixed field_ — the id of the matching entry published by the custom_fields requirement.

+ *

The plan custom field this answers, prefixed field_ — the id of the matching entry published by the custom_fields requirement.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") - public RouteStage id(@NotNull String id) { + public ValueStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** - *

The URL slug for the company's store page.

- *

The URL slug for the company's store page.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("route") - public TitleStage route(@NotNull String route) { - this.route = Objects.requireNonNull(route, "route must not be null"); - return this; - } - - /** - *

The display name of the company shown to customers.

- *

The display name of the company shown to customers.

+ *

The buyer's answer, as typed.

+ *

The buyer's answer, as typed.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - @JsonSetter("title") - public _FinalStage title(@NotNull String title) { - this.title = Objects.requireNonNull(title, "title must not be null"); + @JsonSetter("value") + public _FinalStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); return this; } @java.lang.Override - public TransferOriginCompany build() { - return new TransferOriginCompany(id, route, title, additionalProperties); + public CheckoutSessionCustomFieldResponse build() { + return new CheckoutSessionCustomFieldResponse(id, value, additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/whop/api/types/CheckoutSessionEntry.java b/src/main/java/com/whop/api/types/CheckoutSessionEntry.java new file mode 100644 index 00000000..1f225bb6 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionEntry.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionEntry.Builder.class) +public final class CheckoutSessionEntry { + private final String id; + + private final CheckoutSessionEntryStatus status; + + private final Map additionalProperties; + + private CheckoutSessionEntry( + String id, CheckoutSessionEntryStatus status, Map additionalProperties) { + this.id = id; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return The waitlist entry created by the confirm, prefixed entry_. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Where the join stands. succeeded — the join stands (whether the seller accepts it is the entry resource's own story). requires_action — the card save has a step left, carried by next_action. processing — the save is being decided; hold. failed — the card save died: the buyer is NOT on the waitlist, and needs a fresh checkout to join. + */ + @JsonProperty("status") + public CheckoutSessionEntryStatus getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionEntry && equalTo((CheckoutSessionEntry) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionEntry other) { + return id.equals(other.id) && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

The waitlist entry created by the confirm, prefixed entry_.

+ */ + StatusStage id(@NotNull String id); + + Builder from(CheckoutSessionEntry other); + } + + public interface StatusStage { + /** + *

Where the join stands. succeeded — the join stands (whether the seller accepts it is the entry resource's own story). requires_action — the card save has a step left, carried by next_action. processing — the save is being decided; hold. failed — the card save died: the buyer is NOT on the waitlist, and needs a fresh checkout to join.

+ */ + _FinalStage status(@NotNull CheckoutSessionEntryStatus status); + } + + public interface _FinalStage { + CheckoutSessionEntry build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, StatusStage, _FinalStage { + private String id; + + private CheckoutSessionEntryStatus status; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionEntry other) { + id(other.getId()); + status(other.getStatus()); + return this; + } + + /** + *

The waitlist entry created by the confirm, prefixed entry_.

+ *

The waitlist entry created by the confirm, prefixed entry_.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Where the join stands. succeeded — the join stands (whether the seller accepts it is the entry resource's own story). requires_action — the card save has a step left, carried by next_action. processing — the save is being decided; hold. failed — the card save died: the buyer is NOT on the waitlist, and needs a fresh checkout to join.

+ *

Where the join stands. succeeded — the join stands (whether the seller accepts it is the entry resource's own story). requires_action — the card save has a step left, carried by next_action. processing — the save is being decided; hold. failed — the card save died: the buyer is NOT on the waitlist, and needs a fresh checkout to join.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public _FinalStage status(@NotNull CheckoutSessionEntryStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + public CheckoutSessionEntry build() { + return new CheckoutSessionEntry(id, status, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionEntryStatus.java b/src/main/java/com/whop/api/types/CheckoutSessionEntryStatus.java new file mode 100644 index 00000000..1fba4b32 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionEntryStatus.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionEntryStatus { + public static final CheckoutSessionEntryStatus FAILED = new CheckoutSessionEntryStatus(Value.FAILED, "failed"); + + public static final CheckoutSessionEntryStatus SUCCEEDED = + new CheckoutSessionEntryStatus(Value.SUCCEEDED, "succeeded"); + + public static final CheckoutSessionEntryStatus PROCESSING = + new CheckoutSessionEntryStatus(Value.PROCESSING, "processing"); + + public static final CheckoutSessionEntryStatus REQUIRES_ACTION = + new CheckoutSessionEntryStatus(Value.REQUIRES_ACTION, "requires_action"); + + private final Value value; + + private final String string; + + CheckoutSessionEntryStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionEntryStatus + && this.string.equals(((CheckoutSessionEntryStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case SUCCEEDED: + return visitor.visitSucceeded(); + case PROCESSING: + return visitor.visitProcessing(); + case REQUIRES_ACTION: + return visitor.visitRequiresAction(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionEntryStatus valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "succeeded": + return SUCCEEDED; + case "processing": + return PROCESSING; + case "requires_action": + return REQUIRES_ACTION; + default: + return new CheckoutSessionEntryStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + REQUIRES_ACTION, + + PROCESSING, + + SUCCEEDED, + + FAILED, + + UNKNOWN + } + + public interface Visitor { + T visitRequiresAction(); + + T visitProcessing(); + + T visitSucceeded(); + + T visitFailed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionItem.java b/src/main/java/com/whop/api/types/CheckoutSessionItem.java new file mode 100644 index 00000000..5e1a9714 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionItem.java @@ -0,0 +1,494 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionItem.Builder.class) +public final class CheckoutSessionItem { + private final Optional description; + + private final Optional expirationDays; + + private final Optional headline; + + private final Optional imageUrl; + + private final String name; + + private final String plan; + + private final int quantity; + + private final Map additionalProperties; + + private CheckoutSessionItem( + Optional description, + Optional expirationDays, + Optional headline, + Optional imageUrl, + String name, + String plan, + int quantity, + Map additionalProperties) { + this.description = description; + this.expirationDays = expirationDays; + this.headline = headline; + this.imageUrl = imageUrl; + this.name = name; + this.plan = plan; + this.quantity = quantity; + this.additionalProperties = additionalProperties; + } + + /** + * @return The seller's longer description of the item, or null. Multi-line text as the seller wrote it, suited to a collapsible details block. + */ + @JsonIgnore + public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } + return description; + } + + /** + * @return How many days of access a one-time purchase grants, or null when access does not expire (a renewing plan's access follows its billing instead). + */ + @JsonIgnore + public Optional getExpirationDays() { + if (expirationDays == null) { + return Optional.empty(); + } + return expirationDays; + } + + /** + * @return One line describing the item, or null. The checkout link's own description when the seller wrote one, otherwise the product's headline. + */ + @JsonIgnore + public Optional getHeadline() { + if (headline == null) { + return Optional.empty(); + } + return headline; + } + + /** + * @return The item's square art image URL, or null when the seller uploaded none. + */ + @JsonIgnore + public Optional getImageUrl() { + if (imageUrl == null) { + return Optional.empty(); + } + return imageUrl; + } + + /** + * @return What this item is called, ready to render — the product's title, falling back to the seller's name. Never empty. + */ + @JsonProperty("name") + public String getName() { + return name; + } + + /** + * @return The plan being purchased (plan_…). The plan is the price — sessions never carry client-asserted amounts. + */ + @JsonProperty("plan") + public String getPlan() { + return plan; + } + + /** + * @return How many of the plan the buyer is purchasing. At least 1. + */ + @JsonProperty("quantity") + public int getQuantity() { + return quantity; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("expiration_days") + private Optional _getExpirationDays() { + return expirationDays; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("headline") + private Optional _getHeadline() { + return headline; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("image_url") + private Optional _getImageUrl() { + return imageUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionItem && equalTo((CheckoutSessionItem) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionItem other) { + return description.equals(other.description) + && expirationDays.equals(other.expirationDays) + && headline.equals(other.headline) + && imageUrl.equals(other.imageUrl) + && name.equals(other.name) + && plan.equals(other.plan) + && quantity == other.quantity; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.description, + this.expirationDays, + this.headline, + this.imageUrl, + this.name, + this.plan, + this.quantity); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static NameStage builder() { + return new Builder(); + } + + public interface NameStage { + /** + *

What this item is called, ready to render — the product's title, falling back to the seller's name. Never empty.

+ */ + PlanStage name(@NotNull String name); + + Builder from(CheckoutSessionItem other); + } + + public interface PlanStage { + /** + *

The plan being purchased (plan_…). The plan is the price — sessions never carry client-asserted amounts.

+ */ + QuantityStage plan(@NotNull String plan); + } + + public interface QuantityStage { + /** + *

How many of the plan the buyer is purchasing. At least 1.

+ */ + _FinalStage quantity(int quantity); + } + + public interface _FinalStage { + CheckoutSessionItem build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The seller's longer description of the item, or null. Multi-line text as the seller wrote it, suited to a collapsible details block.

+ */ + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage description(Nullable description); + + /** + *

How many days of access a one-time purchase grants, or null when access does not expire (a renewing plan's access follows its billing instead).

+ */ + _FinalStage expirationDays(Optional expirationDays); + + _FinalStage expirationDays(Integer expirationDays); + + _FinalStage expirationDays(Nullable expirationDays); + + /** + *

One line describing the item, or null. The checkout link's own description when the seller wrote one, otherwise the product's headline.

+ */ + _FinalStage headline(Optional headline); + + _FinalStage headline(String headline); + + _FinalStage headline(Nullable headline); + + /** + *

The item's square art image URL, or null when the seller uploaded none.

+ */ + _FinalStage imageUrl(Optional imageUrl); + + _FinalStage imageUrl(String imageUrl); + + _FinalStage imageUrl(Nullable imageUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements NameStage, PlanStage, QuantityStage, _FinalStage { + private String name; + + private String plan; + + private int quantity; + + private Optional imageUrl = Optional.empty(); + + private Optional headline = Optional.empty(); + + private Optional expirationDays = Optional.empty(); + + private Optional description = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionItem other) { + description(other.getDescription()); + expirationDays(other.getExpirationDays()); + headline(other.getHeadline()); + imageUrl(other.getImageUrl()); + name(other.getName()); + plan(other.getPlan()); + quantity(other.getQuantity()); + return this; + } + + /** + *

What this item is called, ready to render — the product's title, falling back to the seller's name. Never empty.

+ *

What this item is called, ready to render — the product's title, falling back to the seller's name. Never empty.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("name") + public PlanStage name(@NotNull String name) { + this.name = Objects.requireNonNull(name, "name must not be null"); + return this; + } + + /** + *

The plan being purchased (plan_…). The plan is the price — sessions never carry client-asserted amounts.

+ *

The plan being purchased (plan_…). The plan is the price — sessions never carry client-asserted amounts.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("plan") + public QuantityStage plan(@NotNull String plan) { + this.plan = Objects.requireNonNull(plan, "plan must not be null"); + return this; + } + + /** + *

How many of the plan the buyer is purchasing. At least 1.

+ *

How many of the plan the buyer is purchasing. At least 1.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("quantity") + public _FinalStage quantity(int quantity) { + this.quantity = quantity; + return this; + } + + /** + *

The item's square art image URL, or null when the seller uploaded none.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage imageUrl(Nullable imageUrl) { + if (imageUrl.isNull()) { + this.imageUrl = null; + } else if (imageUrl.isEmpty()) { + this.imageUrl = Optional.empty(); + } else { + this.imageUrl = Optional.of(imageUrl.get()); + } + return this; + } + + /** + *

The item's square art image URL, or null when the seller uploaded none.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage imageUrl(String imageUrl) { + this.imageUrl = Optional.ofNullable(imageUrl); + return this; + } + + /** + *

The item's square art image URL, or null when the seller uploaded none.

+ */ + @java.lang.Override + @JsonSetter(value = "image_url", nulls = Nulls.SKIP) + public _FinalStage imageUrl(Optional imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + *

One line describing the item, or null. The checkout link's own description when the seller wrote one, otherwise the product's headline.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage headline(Nullable headline) { + if (headline.isNull()) { + this.headline = null; + } else if (headline.isEmpty()) { + this.headline = Optional.empty(); + } else { + this.headline = Optional.of(headline.get()); + } + return this; + } + + /** + *

One line describing the item, or null. The checkout link's own description when the seller wrote one, otherwise the product's headline.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage headline(String headline) { + this.headline = Optional.ofNullable(headline); + return this; + } + + /** + *

One line describing the item, or null. The checkout link's own description when the seller wrote one, otherwise the product's headline.

+ */ + @java.lang.Override + @JsonSetter(value = "headline", nulls = Nulls.SKIP) + public _FinalStage headline(Optional headline) { + this.headline = headline; + return this; + } + + /** + *

How many days of access a one-time purchase grants, or null when access does not expire (a renewing plan's access follows its billing instead).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage expirationDays(Nullable expirationDays) { + if (expirationDays.isNull()) { + this.expirationDays = null; + } else if (expirationDays.isEmpty()) { + this.expirationDays = Optional.empty(); + } else { + this.expirationDays = Optional.of(expirationDays.get()); + } + return this; + } + + /** + *

How many days of access a one-time purchase grants, or null when access does not expire (a renewing plan's access follows its billing instead).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage expirationDays(Integer expirationDays) { + this.expirationDays = Optional.ofNullable(expirationDays); + return this; + } + + /** + *

How many days of access a one-time purchase grants, or null when access does not expire (a renewing plan's access follows its billing instead).

+ */ + @java.lang.Override + @JsonSetter(value = "expiration_days", nulls = Nulls.SKIP) + public _FinalStage expirationDays(Optional expirationDays) { + this.expirationDays = expirationDays; + return this; + } + + /** + *

The seller's longer description of the item, or null. Multi-line text as the seller wrote it, suited to a collapsible details block.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + + /** + *

The seller's longer description of the item, or null. Multi-line text as the seller wrote it, suited to a collapsible details block.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

The seller's longer description of the item, or null. Multi-line text as the seller wrote it, suited to a collapsible details block.

+ */ + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + @java.lang.Override + public CheckoutSessionItem build() { + return new CheckoutSessionItem( + description, expirationDays, headline, imageUrl, name, plan, quantity, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionMode.java b/src/main/java/com/whop/api/types/CheckoutSessionMode.java new file mode 100644 index 00000000..87c5f8b1 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionMode.java @@ -0,0 +1,83 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionMode { + public static final CheckoutSessionMode SETUP = new CheckoutSessionMode(Value.SETUP, "setup"); + + public static final CheckoutSessionMode PAYMENT = new CheckoutSessionMode(Value.PAYMENT, "payment"); + + private final Value value; + + private final String string; + + CheckoutSessionMode(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionMode && this.string.equals(((CheckoutSessionMode) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case SETUP: + return visitor.visitSetup(); + case PAYMENT: + return visitor.visitPayment(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionMode valueOf(String value) { + switch (value) { + case "setup": + return SETUP; + case "payment": + return PAYMENT; + default: + return new CheckoutSessionMode(Value.UNKNOWN, value); + } + } + + public enum Value { + PAYMENT, + + SETUP, + + UNKNOWN + } + + public interface Visitor { + T visitPayment(); + + T visitSetup(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionNextAction.java b/src/main/java/com/whop/api/types/CheckoutSessionNextAction.java new file mode 100644 index 00000000..95caac02 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionNextAction.java @@ -0,0 +1,514 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; +import java.util.Optional; + +public final class CheckoutSessionNextAction { + private final Value value; + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + private CheckoutSessionNextAction(Value value) { + this.value = value; + } + + public T visit(Visitor visitor) { + return value.visit(visitor); + } + + public static CheckoutSessionNextAction authenticate(CheckoutSessionAuthenticateAction value) { + return new CheckoutSessionNextAction(new AuthenticateValue(value)); + } + + public static CheckoutSessionNextAction awaitClaim(CheckoutSessionAwaitClaimAction value) { + return new CheckoutSessionNextAction(new AwaitClaimValue(value)); + } + + public static CheckoutSessionNextAction complete(CheckoutSessionCompleteAction value) { + return new CheckoutSessionNextAction(new CompleteValue(value)); + } + + public static CheckoutSessionNextAction redirect(CheckoutSessionRedirectAction value) { + return new CheckoutSessionNextAction(new RedirectValue(value)); + } + + public static CheckoutSessionNextAction upgradeAuthentication(CheckoutSessionUpgradeAuthenticationAction value) { + return new CheckoutSessionNextAction(new UpgradeAuthenticationValue(value)); + } + + public static CheckoutSessionNextAction verifyPhone(CheckoutSessionVerifyPhoneAction value) { + return new CheckoutSessionNextAction(new VerifyPhoneValue(value)); + } + + public static CheckoutSessionNextAction waitForPayment(CheckoutSessionWaitForPaymentAction value) { + return new CheckoutSessionNextAction(new WaitForPaymentValue(value)); + } + + public boolean isAuthenticate() { + return value instanceof AuthenticateValue; + } + + public boolean isAwaitClaim() { + return value instanceof AwaitClaimValue; + } + + public boolean isComplete() { + return value instanceof CompleteValue; + } + + public boolean isRedirect() { + return value instanceof RedirectValue; + } + + public boolean isUpgradeAuthentication() { + return value instanceof UpgradeAuthenticationValue; + } + + public boolean isVerifyPhone() { + return value instanceof VerifyPhoneValue; + } + + public boolean isWaitForPayment() { + return value instanceof WaitForPaymentValue; + } + + public boolean _isUnknown() { + return value instanceof _UnknownValue; + } + + public Optional getAuthenticate() { + if (isAuthenticate()) { + return Optional.of(((AuthenticateValue) value).value); + } + return Optional.empty(); + } + + public Optional getAwaitClaim() { + if (isAwaitClaim()) { + return Optional.of(((AwaitClaimValue) value).value); + } + return Optional.empty(); + } + + public Optional getComplete() { + if (isComplete()) { + return Optional.of(((CompleteValue) value).value); + } + return Optional.empty(); + } + + public Optional getRedirect() { + if (isRedirect()) { + return Optional.of(((RedirectValue) value).value); + } + return Optional.empty(); + } + + public Optional getUpgradeAuthentication() { + if (isUpgradeAuthentication()) { + return Optional.of(((UpgradeAuthenticationValue) value).value); + } + return Optional.empty(); + } + + public Optional getVerifyPhone() { + if (isVerifyPhone()) { + return Optional.of(((VerifyPhoneValue) value).value); + } + return Optional.empty(); + } + + public Optional getWaitForPayment() { + if (isWaitForPayment()) { + return Optional.of(((WaitForPaymentValue) value).value); + } + return Optional.empty(); + } + + public Optional _getUnknown() { + if (_isUnknown()) { + return Optional.of(((_UnknownValue) value).value); + } + return Optional.empty(); + } + + @Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionNextAction && value.equals(((CheckoutSessionNextAction) other).value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + return value.toString(); + } + + @JsonValue + private Value getValue() { + return this.value; + } + + public interface Visitor { + T visitAuthenticate(CheckoutSessionAuthenticateAction authenticate); + + T visitAwaitClaim(CheckoutSessionAwaitClaimAction awaitClaim); + + T visitComplete(CheckoutSessionCompleteAction complete); + + T visitRedirect(CheckoutSessionRedirectAction redirect); + + T visitUpgradeAuthentication(CheckoutSessionUpgradeAuthenticationAction upgradeAuthentication); + + T visitVerifyPhone(CheckoutSessionVerifyPhoneAction verifyPhone); + + T visitWaitForPayment(CheckoutSessionWaitForPaymentAction waitForPayment); + + T _visitUnknown(Object unknownType); + } + + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "type", visible = true, defaultImpl = _UnknownValue.class) + @JsonSubTypes({ + @JsonSubTypes.Type(AuthenticateValue.class), + @JsonSubTypes.Type(AwaitClaimValue.class), + @JsonSubTypes.Type(CompleteValue.class), + @JsonSubTypes.Type(RedirectValue.class), + @JsonSubTypes.Type(UpgradeAuthenticationValue.class), + @JsonSubTypes.Type(VerifyPhoneValue.class), + @JsonSubTypes.Type(WaitForPaymentValue.class) + }) + @JsonIgnoreProperties(ignoreUnknown = true) + private interface Value { + T visit(Visitor visitor); + } + + @JsonTypeName("authenticate") + @JsonIgnoreProperties("type") + private static final class AuthenticateValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private CheckoutSessionAuthenticateAction value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AuthenticateValue() {} + + private AuthenticateValue(CheckoutSessionAuthenticateAction value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAuthenticate(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AuthenticateValue && equalTo((AuthenticateValue) other); + } + + private boolean equalTo(AuthenticateValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionNextAction{" + "value: " + value + "}"; + } + } + + @JsonTypeName("await_claim") + @JsonIgnoreProperties("type") + private static final class AwaitClaimValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private CheckoutSessionAwaitClaimAction value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private AwaitClaimValue() {} + + private AwaitClaimValue(CheckoutSessionAwaitClaimAction value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitAwaitClaim(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof AwaitClaimValue && equalTo((AwaitClaimValue) other); + } + + private boolean equalTo(AwaitClaimValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionNextAction{" + "value: " + value + "}"; + } + } + + @JsonTypeName("complete") + @JsonIgnoreProperties("type") + private static final class CompleteValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private CheckoutSessionCompleteAction value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private CompleteValue() {} + + private CompleteValue(CheckoutSessionCompleteAction value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitComplete(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CompleteValue && equalTo((CompleteValue) other); + } + + private boolean equalTo(CompleteValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionNextAction{" + "value: " + value + "}"; + } + } + + @JsonTypeName("redirect") + @JsonIgnoreProperties("type") + private static final class RedirectValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private CheckoutSessionRedirectAction value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private RedirectValue() {} + + private RedirectValue(CheckoutSessionRedirectAction value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitRedirect(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof RedirectValue && equalTo((RedirectValue) other); + } + + private boolean equalTo(RedirectValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionNextAction{" + "value: " + value + "}"; + } + } + + @JsonTypeName("upgrade_authentication") + @JsonIgnoreProperties("type") + private static final class UpgradeAuthenticationValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private CheckoutSessionUpgradeAuthenticationAction value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private UpgradeAuthenticationValue() {} + + private UpgradeAuthenticationValue(CheckoutSessionUpgradeAuthenticationAction value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitUpgradeAuthentication(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof UpgradeAuthenticationValue && equalTo((UpgradeAuthenticationValue) other); + } + + private boolean equalTo(UpgradeAuthenticationValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionNextAction{" + "value: " + value + "}"; + } + } + + @JsonTypeName("verify_phone") + @JsonIgnoreProperties("type") + private static final class VerifyPhoneValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private CheckoutSessionVerifyPhoneAction value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private VerifyPhoneValue() {} + + private VerifyPhoneValue(CheckoutSessionVerifyPhoneAction value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitVerifyPhone(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof VerifyPhoneValue && equalTo((VerifyPhoneValue) other); + } + + private boolean equalTo(VerifyPhoneValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionNextAction{" + "value: " + value + "}"; + } + } + + @JsonTypeName("wait_for_payment") + @JsonIgnoreProperties("type") + private static final class WaitForPaymentValue implements Value { + @JsonUnwrapped + @JsonIgnoreProperties(value = "type", allowSetters = true) + private CheckoutSessionWaitForPaymentAction value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private WaitForPaymentValue() {} + + private WaitForPaymentValue(CheckoutSessionWaitForPaymentAction value) { + this.value = value; + } + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor.visitWaitForPayment(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof WaitForPaymentValue && equalTo((WaitForPaymentValue) other); + } + + private boolean equalTo(WaitForPaymentValue other) { + return value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionNextAction{" + "value: " + value + "}"; + } + } + + @JsonIgnoreProperties("type") + private static final class _UnknownValue implements Value { + private String type; + + @JsonValue + private Object value; + + @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) + private _UnknownValue(@JsonProperty("value") Object value) {} + + @java.lang.Override + public T visit(Visitor visitor) { + return visitor._visitUnknown(value); + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof _UnknownValue && equalTo((_UnknownValue) other); + } + + private boolean equalTo(_UnknownValue other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return "CheckoutSessionNextAction{" + "type: " + type + ", value: " + value + "}"; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionPayment.java b/src/main/java/com/whop/api/types/CheckoutSessionPayment.java new file mode 100644 index 00000000..b0ad9bd5 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionPayment.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionPayment.Builder.class) +public final class CheckoutSessionPayment { + private final String id; + + private final CheckoutSessionPaymentStatus status; + + private final Map additionalProperties; + + private CheckoutSessionPayment( + String id, CheckoutSessionPaymentStatus status, Map additionalProperties) { + this.id = id; + this.status = status; + this.additionalProperties = additionalProperties; + } + + /** + * @return The payment created by the confirm, prefixed pay_. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return Where the payment stands, and the only honest reading of a completed checkout's outcome. requires_action — a step remains and next_action carries it. processing — accepted and settling (or deciding); hold. succeeded — the money moved. failed — the charge died (declined, expired, voided): the checkout did not go through, whatever the session's own status says, and the buyer needs a fresh checkout to try again. + */ + @JsonProperty("status") + public CheckoutSessionPaymentStatus getStatus() { + return status; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionPayment && equalTo((CheckoutSessionPayment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionPayment other) { + return id.equals(other.id) && status.equals(other.status); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.status); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

The payment created by the confirm, prefixed pay_.

+ */ + StatusStage id(@NotNull String id); + + Builder from(CheckoutSessionPayment other); + } + + public interface StatusStage { + /** + *

Where the payment stands, and the only honest reading of a completed checkout's outcome. requires_action — a step remains and next_action carries it. processing — accepted and settling (or deciding); hold. succeeded — the money moved. failed — the charge died (declined, expired, voided): the checkout did not go through, whatever the session's own status says, and the buyer needs a fresh checkout to try again.

+ */ + _FinalStage status(@NotNull CheckoutSessionPaymentStatus status); + } + + public interface _FinalStage { + CheckoutSessionPayment build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, StatusStage, _FinalStage { + private String id; + + private CheckoutSessionPaymentStatus status; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionPayment other) { + id(other.getId()); + status(other.getStatus()); + return this; + } + + /** + *

The payment created by the confirm, prefixed pay_.

+ *

The payment created by the confirm, prefixed pay_.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public StatusStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

Where the payment stands, and the only honest reading of a completed checkout's outcome. requires_action — a step remains and next_action carries it. processing — accepted and settling (or deciding); hold. succeeded — the money moved. failed — the charge died (declined, expired, voided): the checkout did not go through, whatever the session's own status says, and the buyer needs a fresh checkout to try again.

+ *

Where the payment stands, and the only honest reading of a completed checkout's outcome. requires_action — a step remains and next_action carries it. processing — accepted and settling (or deciding); hold. succeeded — the money moved. failed — the charge died (declined, expired, voided): the checkout did not go through, whatever the session's own status says, and the buyer needs a fresh checkout to try again.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("status") + public _FinalStage status(@NotNull CheckoutSessionPaymentStatus status) { + this.status = Objects.requireNonNull(status, "status must not be null"); + return this; + } + + @java.lang.Override + public CheckoutSessionPayment build() { + return new CheckoutSessionPayment(id, status, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionPaymentStatus.java b/src/main/java/com/whop/api/types/CheckoutSessionPaymentStatus.java new file mode 100644 index 00000000..e1c03bfa --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionPaymentStatus.java @@ -0,0 +1,107 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionPaymentStatus { + public static final CheckoutSessionPaymentStatus FAILED = new CheckoutSessionPaymentStatus(Value.FAILED, "failed"); + + public static final CheckoutSessionPaymentStatus SUCCEEDED = + new CheckoutSessionPaymentStatus(Value.SUCCEEDED, "succeeded"); + + public static final CheckoutSessionPaymentStatus PROCESSING = + new CheckoutSessionPaymentStatus(Value.PROCESSING, "processing"); + + public static final CheckoutSessionPaymentStatus REQUIRES_ACTION = + new CheckoutSessionPaymentStatus(Value.REQUIRES_ACTION, "requires_action"); + + private final Value value; + + private final String string; + + CheckoutSessionPaymentStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionPaymentStatus + && this.string.equals(((CheckoutSessionPaymentStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case SUCCEEDED: + return visitor.visitSucceeded(); + case PROCESSING: + return visitor.visitProcessing(); + case REQUIRES_ACTION: + return visitor.visitRequiresAction(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionPaymentStatus valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "succeeded": + return SUCCEEDED; + case "processing": + return PROCESSING; + case "requires_action": + return REQUIRES_ACTION; + default: + return new CheckoutSessionPaymentStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + REQUIRES_ACTION, + + PROCESSING, + + SUCCEEDED, + + FAILED, + + UNKNOWN + } + + public interface Visitor { + T visitRequiresAction(); + + T visitProcessing(); + + T visitSucceeded(); + + T visitFailed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionPromo.java b/src/main/java/com/whop/api/types/CheckoutSessionPromo.java new file mode 100644 index 00000000..2ee644ef --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionPromo.java @@ -0,0 +1,383 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionPromo.Builder.class) +public final class CheckoutSessionPromo { + private final double amountOff; + + private final String code; + + private final Optional currency; + + private final CheckoutSessionPromoDuration duration; + + private final Optional numberOfIntervals; + + private final CheckoutSessionPromoPromoType promoType; + + private final Map additionalProperties; + + private CheckoutSessionPromo( + double amountOff, + String code, + Optional currency, + CheckoutSessionPromoDuration duration, + Optional numberOfIntervals, + CheckoutSessionPromoPromoType promoType, + Map additionalProperties) { + this.amountOff = amountOff; + this.code = code; + this.currency = currency; + this.duration = duration; + this.numberOfIntervals = numberOfIntervals; + this.promoType = promoType; + this.additionalProperties = additionalProperties; + } + + /** + * @return What each covered charge is discounted by. Percentage discounts are represented as a decimal fraction; fixed-amount discounts are in currency. + */ + @JsonProperty("amount_off") + public double getAmountOff() { + return amountOff; + } + + /** + * @return The promo code, exactly as promo_code states it. + */ + @JsonProperty("code") + public String getCode() { + return code; + } + + /** + * @return Currency of a fixed-amount discount; null for a percentage one. + */ + @JsonIgnore + public Optional getCurrency() { + if (currency == null) { + return Optional.empty(); + } + return currency; + } + + /** + * @return Which charges the discount covers: forever discounts every charge; once covers only the charge at purchase — the code is spent then even when it made that charge free, except on a free trial with nothing due today, where it holds until the trial's first real charge; repeating covers every charge landing within number_of_intervals calendar months of purchase. + */ + @JsonProperty("duration") + public CheckoutSessionPromoDuration getDuration() { + return duration; + } + + /** + * @return How many calendar months of charges a repeating promo covers, counted from purchase — a renewal scheduled past that window bills full price however few charges came before it. null for the other durations. + */ + @JsonIgnore + public Optional getNumberOfIntervals() { + if (numberOfIntervals == null) { + return Optional.empty(); + } + return numberOfIntervals; + } + + /** + * @return Whether the discount is percentage-based or a fixed amount. + */ + @JsonProperty("promo_type") + public CheckoutSessionPromoPromoType getPromoType() { + return promoType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("currency") + private Optional _getCurrency() { + return currency; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("number_of_intervals") + private Optional _getNumberOfIntervals() { + return numberOfIntervals; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionPromo && equalTo((CheckoutSessionPromo) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionPromo other) { + return amountOff == other.amountOff + && code.equals(other.code) + && currency.equals(other.currency) + && duration.equals(other.duration) + && numberOfIntervals.equals(other.numberOfIntervals) + && promoType.equals(other.promoType); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.amountOff, this.code, this.currency, this.duration, this.numberOfIntervals, this.promoType); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static AmountOffStage builder() { + return new Builder(); + } + + public interface AmountOffStage { + /** + *

What each covered charge is discounted by. Percentage discounts are represented as a decimal fraction; fixed-amount discounts are in currency.

+ */ + CodeStage amountOff(double amountOff); + + Builder from(CheckoutSessionPromo other); + } + + public interface CodeStage { + /** + *

The promo code, exactly as promo_code states it.

+ */ + DurationStage code(@NotNull String code); + } + + public interface DurationStage { + /** + *

Which charges the discount covers: forever discounts every charge; once covers only the charge at purchase — the code is spent then even when it made that charge free, except on a free trial with nothing due today, where it holds until the trial's first real charge; repeating covers every charge landing within number_of_intervals calendar months of purchase.

+ */ + PromoTypeStage duration(@NotNull CheckoutSessionPromoDuration duration); + } + + public interface PromoTypeStage { + /** + *

Whether the discount is percentage-based or a fixed amount.

+ */ + _FinalStage promoType(@NotNull CheckoutSessionPromoPromoType promoType); + } + + public interface _FinalStage { + CheckoutSessionPromo build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Currency of a fixed-amount discount; null for a percentage one.

+ */ + _FinalStage currency(Optional currency); + + _FinalStage currency(CheckoutSessionPromoCurrency currency); + + _FinalStage currency(Nullable currency); + + /** + *

How many calendar months of charges a repeating promo covers, counted from purchase — a renewal scheduled past that window bills full price however few charges came before it. null for the other durations.

+ */ + _FinalStage numberOfIntervals(Optional numberOfIntervals); + + _FinalStage numberOfIntervals(Integer numberOfIntervals); + + _FinalStage numberOfIntervals(Nullable numberOfIntervals); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements AmountOffStage, CodeStage, DurationStage, PromoTypeStage, _FinalStage { + private double amountOff; + + private String code; + + private CheckoutSessionPromoDuration duration; + + private CheckoutSessionPromoPromoType promoType; + + private Optional numberOfIntervals = Optional.empty(); + + private Optional currency = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionPromo other) { + amountOff(other.getAmountOff()); + code(other.getCode()); + currency(other.getCurrency()); + duration(other.getDuration()); + numberOfIntervals(other.getNumberOfIntervals()); + promoType(other.getPromoType()); + return this; + } + + /** + *

What each covered charge is discounted by. Percentage discounts are represented as a decimal fraction; fixed-amount discounts are in currency.

+ *

What each covered charge is discounted by. Percentage discounts are represented as a decimal fraction; fixed-amount discounts are in currency.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("amount_off") + public CodeStage amountOff(double amountOff) { + this.amountOff = amountOff; + return this; + } + + /** + *

The promo code, exactly as promo_code states it.

+ *

The promo code, exactly as promo_code states it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("code") + public DurationStage code(@NotNull String code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + /** + *

Which charges the discount covers: forever discounts every charge; once covers only the charge at purchase — the code is spent then even when it made that charge free, except on a free trial with nothing due today, where it holds until the trial's first real charge; repeating covers every charge landing within number_of_intervals calendar months of purchase.

+ *

Which charges the discount covers: forever discounts every charge; once covers only the charge at purchase — the code is spent then even when it made that charge free, except on a free trial with nothing due today, where it holds until the trial's first real charge; repeating covers every charge landing within number_of_intervals calendar months of purchase.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("duration") + public PromoTypeStage duration(@NotNull CheckoutSessionPromoDuration duration) { + this.duration = Objects.requireNonNull(duration, "duration must not be null"); + return this; + } + + /** + *

Whether the discount is percentage-based or a fixed amount.

+ *

Whether the discount is percentage-based or a fixed amount.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("promo_type") + public _FinalStage promoType(@NotNull CheckoutSessionPromoPromoType promoType) { + this.promoType = Objects.requireNonNull(promoType, "promoType must not be null"); + return this; + } + + /** + *

How many calendar months of charges a repeating promo covers, counted from purchase — a renewal scheduled past that window bills full price however few charges came before it. null for the other durations.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage numberOfIntervals(Nullable numberOfIntervals) { + if (numberOfIntervals.isNull()) { + this.numberOfIntervals = null; + } else if (numberOfIntervals.isEmpty()) { + this.numberOfIntervals = Optional.empty(); + } else { + this.numberOfIntervals = Optional.of(numberOfIntervals.get()); + } + return this; + } + + /** + *

How many calendar months of charges a repeating promo covers, counted from purchase — a renewal scheduled past that window bills full price however few charges came before it. null for the other durations.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage numberOfIntervals(Integer numberOfIntervals) { + this.numberOfIntervals = Optional.ofNullable(numberOfIntervals); + return this; + } + + /** + *

How many calendar months of charges a repeating promo covers, counted from purchase — a renewal scheduled past that window bills full price however few charges came before it. null for the other durations.

+ */ + @java.lang.Override + @JsonSetter(value = "number_of_intervals", nulls = Nulls.SKIP) + public _FinalStage numberOfIntervals(Optional numberOfIntervals) { + this.numberOfIntervals = numberOfIntervals; + return this; + } + + /** + *

Currency of a fixed-amount discount; null for a percentage one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage currency(Nullable currency) { + if (currency.isNull()) { + this.currency = null; + } else if (currency.isEmpty()) { + this.currency = Optional.empty(); + } else { + this.currency = Optional.of(currency.get()); + } + return this; + } + + /** + *

Currency of a fixed-amount discount; null for a percentage one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage currency(CheckoutSessionPromoCurrency currency) { + this.currency = Optional.ofNullable(currency); + return this; + } + + /** + *

Currency of a fixed-amount discount; null for a percentage one.

+ */ + @java.lang.Override + @JsonSetter(value = "currency", nulls = Nulls.SKIP) + public _FinalStage currency(Optional currency) { + this.currency = currency; + return this; + } + + @java.lang.Override + public CheckoutSessionPromo build() { + return new CheckoutSessionPromo( + amountOff, code, currency, duration, numberOfIntervals, promoType, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionPromoCurrency.java b/src/main/java/com/whop/api/types/CheckoutSessionPromoCurrency.java new file mode 100644 index 00000000..7dd44c3f --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionPromoCurrency.java @@ -0,0 +1,965 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionPromoCurrency { + public static final CheckoutSessionPromoCurrency CRC = new CheckoutSessionPromoCurrency(Value.CRC, "crc"); + + public static final CheckoutSessionPromoCurrency OMR = new CheckoutSessionPromoCurrency(Value.OMR, "omr"); + + public static final CheckoutSessionPromoCurrency RUB = new CheckoutSessionPromoCurrency(Value.RUB, "rub"); + + public static final CheckoutSessionPromoCurrency BGN = new CheckoutSessionPromoCurrency(Value.BGN, "bgn"); + + public static final CheckoutSessionPromoCurrency SAR = new CheckoutSessionPromoCurrency(Value.SAR, "sar"); + + public static final CheckoutSessionPromoCurrency UYU = new CheckoutSessionPromoCurrency(Value.UYU, "uyu"); + + public static final CheckoutSessionPromoCurrency TZS = new CheckoutSessionPromoCurrency(Value.TZS, "tzs"); + + public static final CheckoutSessionPromoCurrency XCD = new CheckoutSessionPromoCurrency(Value.XCD, "xcd"); + + public static final CheckoutSessionPromoCurrency GTQ = new CheckoutSessionPromoCurrency(Value.GTQ, "gtq"); + + public static final CheckoutSessionPromoCurrency CHF = new CheckoutSessionPromoCurrency(Value.CHF, "chf"); + + public static final CheckoutSessionPromoCurrency RON = new CheckoutSessionPromoCurrency(Value.RON, "ron"); + + public static final CheckoutSessionPromoCurrency PHP = new CheckoutSessionPromoCurrency(Value.PHP, "php"); + + public static final CheckoutSessionPromoCurrency KES = new CheckoutSessionPromoCurrency(Value.KES, "kes"); + + public static final CheckoutSessionPromoCurrency XAU = new CheckoutSessionPromoCurrency(Value.XAU, "xau"); + + public static final CheckoutSessionPromoCurrency BSD = new CheckoutSessionPromoCurrency(Value.BSD, "bsd"); + + public static final CheckoutSessionPromoCurrency INR = new CheckoutSessionPromoCurrency(Value.INR, "inr"); + + public static final CheckoutSessionPromoCurrency HKD = new CheckoutSessionPromoCurrency(Value.HKD, "hkd"); + + public static final CheckoutSessionPromoCurrency JOD = new CheckoutSessionPromoCurrency(Value.JOD, "jod"); + + public static final CheckoutSessionPromoCurrency MKD = new CheckoutSessionPromoCurrency(Value.MKD, "mkd"); + + public static final CheckoutSessionPromoCurrency CLP = new CheckoutSessionPromoCurrency(Value.CLP, "clp"); + + public static final CheckoutSessionPromoCurrency NZD = new CheckoutSessionPromoCurrency(Value.NZD, "nzd"); + + public static final CheckoutSessionPromoCurrency IDR = new CheckoutSessionPromoCurrency(Value.IDR, "idr"); + + public static final CheckoutSessionPromoCurrency MOP = new CheckoutSessionPromoCurrency(Value.MOP, "mop"); + + public static final CheckoutSessionPromoCurrency HUF = new CheckoutSessionPromoCurrency(Value.HUF, "huf"); + + public static final CheckoutSessionPromoCurrency MAD = new CheckoutSessionPromoCurrency(Value.MAD, "mad"); + + public static final CheckoutSessionPromoCurrency KHR = new CheckoutSessionPromoCurrency(Value.KHR, "khr"); + + public static final CheckoutSessionPromoCurrency NGN = new CheckoutSessionPromoCurrency(Value.NGN, "ngn"); + + public static final CheckoutSessionPromoCurrency THB = new CheckoutSessionPromoCurrency(Value.THB, "thb"); + + public static final CheckoutSessionPromoCurrency DZD = new CheckoutSessionPromoCurrency(Value.DZD, "dzd"); + + public static final CheckoutSessionPromoCurrency ARS = new CheckoutSessionPromoCurrency(Value.ARS, "ars"); + + public static final CheckoutSessionPromoCurrency CAD = new CheckoutSessionPromoCurrency(Value.CAD, "cad"); + + public static final CheckoutSessionPromoCurrency MYR = new CheckoutSessionPromoCurrency(Value.MYR, "myr"); + + public static final CheckoutSessionPromoCurrency KRW = new CheckoutSessionPromoCurrency(Value.KRW, "krw"); + + public static final CheckoutSessionPromoCurrency KZT = new CheckoutSessionPromoCurrency(Value.KZT, "kzt"); + + public static final CheckoutSessionPromoCurrency ETH = new CheckoutSessionPromoCurrency(Value.ETH, "eth"); + + public static final CheckoutSessionPromoCurrency COP = new CheckoutSessionPromoCurrency(Value.COP, "cop"); + + public static final CheckoutSessionPromoCurrency JMD = new CheckoutSessionPromoCurrency(Value.JMD, "jmd"); + + public static final CheckoutSessionPromoCurrency NAD = new CheckoutSessionPromoCurrency(Value.NAD, "nad"); + + public static final CheckoutSessionPromoCurrency GYD = new CheckoutSessionPromoCurrency(Value.GYD, "gyd"); + + public static final CheckoutSessionPromoCurrency KWD = new CheckoutSessionPromoCurrency(Value.KWD, "kwd"); + + public static final CheckoutSessionPromoCurrency DOP = new CheckoutSessionPromoCurrency(Value.DOP, "dop"); + + public static final CheckoutSessionPromoCurrency BTC = new CheckoutSessionPromoCurrency(Value.BTC, "btc"); + + public static final CheckoutSessionPromoCurrency AMD = new CheckoutSessionPromoCurrency(Value.AMD, "amd"); + + public static final CheckoutSessionPromoCurrency LKR = new CheckoutSessionPromoCurrency(Value.LKR, "lkr"); + + public static final CheckoutSessionPromoCurrency ALL = new CheckoutSessionPromoCurrency(Value.ALL, "all"); + + public static final CheckoutSessionPromoCurrency USDT = new CheckoutSessionPromoCurrency(Value.USDT, "usdt"); + + public static final CheckoutSessionPromoCurrency TND = new CheckoutSessionPromoCurrency(Value.TND, "tnd"); + + public static final CheckoutSessionPromoCurrency MUR = new CheckoutSessionPromoCurrency(Value.MUR, "mur"); + + public static final CheckoutSessionPromoCurrency PEN = new CheckoutSessionPromoCurrency(Value.PEN, "pen"); + + public static final CheckoutSessionPromoCurrency USD = new CheckoutSessionPromoCurrency(Value.USD, "usd"); + + public static final CheckoutSessionPromoCurrency APE = new CheckoutSessionPromoCurrency(Value.APE, "ape"); + + public static final CheckoutSessionPromoCurrency BHD = new CheckoutSessionPromoCurrency(Value.BHD, "bhd"); + + public static final CheckoutSessionPromoCurrency XOF = new CheckoutSessionPromoCurrency(Value.XOF, "xof"); + + public static final CheckoutSessionPromoCurrency RWF = new CheckoutSessionPromoCurrency(Value.RWF, "rwf"); + + public static final CheckoutSessionPromoCurrency GBP = new CheckoutSessionPromoCurrency(Value.GBP, "gbp"); + + public static final CheckoutSessionPromoCurrency VND = new CheckoutSessionPromoCurrency(Value.VND, "vnd"); + + public static final CheckoutSessionPromoCurrency MNT = new CheckoutSessionPromoCurrency(Value.MNT, "mnt"); + + public static final CheckoutSessionPromoCurrency ETB = new CheckoutSessionPromoCurrency(Value.ETB, "etb"); + + public static final CheckoutSessionPromoCurrency TTD = new CheckoutSessionPromoCurrency(Value.TTD, "ttd"); + + public static final CheckoutSessionPromoCurrency EUR = new CheckoutSessionPromoCurrency(Value.EUR, "eur"); + + public static final CheckoutSessionPromoCurrency BRL = new CheckoutSessionPromoCurrency(Value.BRL, "brl"); + + public static final CheckoutSessionPromoCurrency SEK = new CheckoutSessionPromoCurrency(Value.SEK, "sek"); + + public static final CheckoutSessionPromoCurrency RSD = new CheckoutSessionPromoCurrency(Value.RSD, "rsd"); + + public static final CheckoutSessionPromoCurrency UZS = new CheckoutSessionPromoCurrency(Value.UZS, "uzs"); + + public static final CheckoutSessionPromoCurrency TWD = new CheckoutSessionPromoCurrency(Value.TWD, "twd"); + + public static final CheckoutSessionPromoCurrency NOK = new CheckoutSessionPromoCurrency(Value.NOK, "nok"); + + public static final CheckoutSessionPromoCurrency WHOP_USD = + new CheckoutSessionPromoCurrency(Value.WHOP_USD, "whop_usd"); + + public static final CheckoutSessionPromoCurrency PYG = new CheckoutSessionPromoCurrency(Value.PYG, "pyg"); + + public static final CheckoutSessionPromoCurrency TRY = new CheckoutSessionPromoCurrency(Value.TRY, "try"); + + public static final CheckoutSessionPromoCurrency ZAR = new CheckoutSessionPromoCurrency(Value.ZAR, "zar"); + + public static final CheckoutSessionPromoCurrency PKR = new CheckoutSessionPromoCurrency(Value.PKR, "pkr"); + + public static final CheckoutSessionPromoCurrency CNY = new CheckoutSessionPromoCurrency(Value.CNY, "cny"); + + public static final CheckoutSessionPromoCurrency CZK = new CheckoutSessionPromoCurrency(Value.CZK, "czk"); + + public static final CheckoutSessionPromoCurrency ILS = new CheckoutSessionPromoCurrency(Value.ILS, "ils"); + + public static final CheckoutSessionPromoCurrency MGA = new CheckoutSessionPromoCurrency(Value.MGA, "mga"); + + public static final CheckoutSessionPromoCurrency AED = new CheckoutSessionPromoCurrency(Value.AED, "aed"); + + public static final CheckoutSessionPromoCurrency GHS = new CheckoutSessionPromoCurrency(Value.GHS, "ghs"); + + public static final CheckoutSessionPromoCurrency BAM = new CheckoutSessionPromoCurrency(Value.BAM, "bam"); + + public static final CheckoutSessionPromoCurrency JPY = new CheckoutSessionPromoCurrency(Value.JPY, "jpy"); + + public static final CheckoutSessionPromoCurrency PLN = new CheckoutSessionPromoCurrency(Value.PLN, "pln"); + + public static final CheckoutSessionPromoCurrency BOB = new CheckoutSessionPromoCurrency(Value.BOB, "bob"); + + public static final CheckoutSessionPromoCurrency QAR = new CheckoutSessionPromoCurrency(Value.QAR, "qar"); + + public static final CheckoutSessionPromoCurrency EGP = new CheckoutSessionPromoCurrency(Value.EGP, "egp"); + + public static final CheckoutSessionPromoCurrency AWG = new CheckoutSessionPromoCurrency(Value.AWG, "awg"); + + public static final CheckoutSessionPromoCurrency DKK = new CheckoutSessionPromoCurrency(Value.DKK, "dkk"); + + public static final CheckoutSessionPromoCurrency MDL = new CheckoutSessionPromoCurrency(Value.MDL, "mdl"); + + public static final CheckoutSessionPromoCurrency MXN = new CheckoutSessionPromoCurrency(Value.MXN, "mxn"); + + public static final CheckoutSessionPromoCurrency SGD = new CheckoutSessionPromoCurrency(Value.SGD, "sgd"); + + public static final CheckoutSessionPromoCurrency AUD = new CheckoutSessionPromoCurrency(Value.AUD, "aud"); + + public static final CheckoutSessionPromoCurrency GMD = new CheckoutSessionPromoCurrency(Value.GMD, "gmd"); + + private final Value value; + + private final String string; + + CheckoutSessionPromoCurrency(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionPromoCurrency + && this.string.equals(((CheckoutSessionPromoCurrency) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CRC: + return visitor.visitCrc(); + case OMR: + return visitor.visitOmr(); + case RUB: + return visitor.visitRub(); + case BGN: + return visitor.visitBgn(); + case SAR: + return visitor.visitSar(); + case UYU: + return visitor.visitUyu(); + case TZS: + return visitor.visitTzs(); + case XCD: + return visitor.visitXcd(); + case GTQ: + return visitor.visitGtq(); + case CHF: + return visitor.visitChf(); + case RON: + return visitor.visitRon(); + case PHP: + return visitor.visitPhp(); + case KES: + return visitor.visitKes(); + case XAU: + return visitor.visitXau(); + case BSD: + return visitor.visitBsd(); + case INR: + return visitor.visitInr(); + case HKD: + return visitor.visitHkd(); + case JOD: + return visitor.visitJod(); + case MKD: + return visitor.visitMkd(); + case CLP: + return visitor.visitClp(); + case NZD: + return visitor.visitNzd(); + case IDR: + return visitor.visitIdr(); + case MOP: + return visitor.visitMop(); + case HUF: + return visitor.visitHuf(); + case MAD: + return visitor.visitMad(); + case KHR: + return visitor.visitKhr(); + case NGN: + return visitor.visitNgn(); + case THB: + return visitor.visitThb(); + case DZD: + return visitor.visitDzd(); + case ARS: + return visitor.visitArs(); + case CAD: + return visitor.visitCad(); + case MYR: + return visitor.visitMyr(); + case KRW: + return visitor.visitKrw(); + case KZT: + return visitor.visitKzt(); + case ETH: + return visitor.visitEth(); + case COP: + return visitor.visitCop(); + case JMD: + return visitor.visitJmd(); + case NAD: + return visitor.visitNad(); + case GYD: + return visitor.visitGyd(); + case KWD: + return visitor.visitKwd(); + case DOP: + return visitor.visitDop(); + case BTC: + return visitor.visitBtc(); + case AMD: + return visitor.visitAmd(); + case LKR: + return visitor.visitLkr(); + case ALL: + return visitor.visitAll(); + case USDT: + return visitor.visitUsdt(); + case TND: + return visitor.visitTnd(); + case MUR: + return visitor.visitMur(); + case PEN: + return visitor.visitPen(); + case USD: + return visitor.visitUsd(); + case APE: + return visitor.visitApe(); + case BHD: + return visitor.visitBhd(); + case XOF: + return visitor.visitXof(); + case RWF: + return visitor.visitRwf(); + case GBP: + return visitor.visitGbp(); + case VND: + return visitor.visitVnd(); + case MNT: + return visitor.visitMnt(); + case ETB: + return visitor.visitEtb(); + case TTD: + return visitor.visitTtd(); + case EUR: + return visitor.visitEur(); + case BRL: + return visitor.visitBrl(); + case SEK: + return visitor.visitSek(); + case RSD: + return visitor.visitRsd(); + case UZS: + return visitor.visitUzs(); + case TWD: + return visitor.visitTwd(); + case NOK: + return visitor.visitNok(); + case WHOP_USD: + return visitor.visitWhopUsd(); + case PYG: + return visitor.visitPyg(); + case TRY: + return visitor.visitTry(); + case ZAR: + return visitor.visitZar(); + case PKR: + return visitor.visitPkr(); + case CNY: + return visitor.visitCny(); + case CZK: + return visitor.visitCzk(); + case ILS: + return visitor.visitIls(); + case MGA: + return visitor.visitMga(); + case AED: + return visitor.visitAed(); + case GHS: + return visitor.visitGhs(); + case BAM: + return visitor.visitBam(); + case JPY: + return visitor.visitJpy(); + case PLN: + return visitor.visitPln(); + case BOB: + return visitor.visitBob(); + case QAR: + return visitor.visitQar(); + case EGP: + return visitor.visitEgp(); + case AWG: + return visitor.visitAwg(); + case DKK: + return visitor.visitDkk(); + case MDL: + return visitor.visitMdl(); + case MXN: + return visitor.visitMxn(); + case SGD: + return visitor.visitSgd(); + case AUD: + return visitor.visitAud(); + case GMD: + return visitor.visitGmd(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionPromoCurrency valueOf(String value) { + switch (value) { + case "crc": + return CRC; + case "omr": + return OMR; + case "rub": + return RUB; + case "bgn": + return BGN; + case "sar": + return SAR; + case "uyu": + return UYU; + case "tzs": + return TZS; + case "xcd": + return XCD; + case "gtq": + return GTQ; + case "chf": + return CHF; + case "ron": + return RON; + case "php": + return PHP; + case "kes": + return KES; + case "xau": + return XAU; + case "bsd": + return BSD; + case "inr": + return INR; + case "hkd": + return HKD; + case "jod": + return JOD; + case "mkd": + return MKD; + case "clp": + return CLP; + case "nzd": + return NZD; + case "idr": + return IDR; + case "mop": + return MOP; + case "huf": + return HUF; + case "mad": + return MAD; + case "khr": + return KHR; + case "ngn": + return NGN; + case "thb": + return THB; + case "dzd": + return DZD; + case "ars": + return ARS; + case "cad": + return CAD; + case "myr": + return MYR; + case "krw": + return KRW; + case "kzt": + return KZT; + case "eth": + return ETH; + case "cop": + return COP; + case "jmd": + return JMD; + case "nad": + return NAD; + case "gyd": + return GYD; + case "kwd": + return KWD; + case "dop": + return DOP; + case "btc": + return BTC; + case "amd": + return AMD; + case "lkr": + return LKR; + case "all": + return ALL; + case "usdt": + return USDT; + case "tnd": + return TND; + case "mur": + return MUR; + case "pen": + return PEN; + case "usd": + return USD; + case "ape": + return APE; + case "bhd": + return BHD; + case "xof": + return XOF; + case "rwf": + return RWF; + case "gbp": + return GBP; + case "vnd": + return VND; + case "mnt": + return MNT; + case "etb": + return ETB; + case "ttd": + return TTD; + case "eur": + return EUR; + case "brl": + return BRL; + case "sek": + return SEK; + case "rsd": + return RSD; + case "uzs": + return UZS; + case "twd": + return TWD; + case "nok": + return NOK; + case "whop_usd": + return WHOP_USD; + case "pyg": + return PYG; + case "try": + return TRY; + case "zar": + return ZAR; + case "pkr": + return PKR; + case "cny": + return CNY; + case "czk": + return CZK; + case "ils": + return ILS; + case "mga": + return MGA; + case "aed": + return AED; + case "ghs": + return GHS; + case "bam": + return BAM; + case "jpy": + return JPY; + case "pln": + return PLN; + case "bob": + return BOB; + case "qar": + return QAR; + case "egp": + return EGP; + case "awg": + return AWG; + case "dkk": + return DKK; + case "mdl": + return MDL; + case "mxn": + return MXN; + case "sgd": + return SGD; + case "aud": + return AUD; + case "gmd": + return GMD; + default: + return new CheckoutSessionPromoCurrency(Value.UNKNOWN, value); + } + } + + public enum Value { + USD, + + SGD, + + INR, + + AUD, + + BRL, + + CAD, + + DKK, + + EUR, + + NOK, + + GBP, + + SEK, + + CHF, + + HKD, + + HUF, + + JPY, + + MXN, + + MYR, + + PLN, + + CZK, + + NZD, + + AED, + + ETH, + + APE, + + COP, + + RON, + + THB, + + BGN, + + IDR, + + DOP, + + PHP, + + TRY, + + KRW, + + TWD, + + VND, + + PKR, + + CLP, + + UYU, + + ARS, + + ZAR, + + DZD, + + TND, + + MAD, + + KES, + + KWD, + + JOD, + + ALL, + + XCD, + + AMD, + + BSD, + + BHD, + + BOB, + + BAM, + + KHR, + + CRC, + + XOF, + + EGP, + + ETB, + + GMD, + + GHS, + + GTQ, + + GYD, + + ILS, + + JMD, + + MOP, + + MGA, + + MUR, + + MDL, + + MNT, + + NAD, + + NGN, + + MKD, + + OMR, + + PYG, + + PEN, + + QAR, + + RWF, + + SAR, + + RSD, + + LKR, + + TZS, + + TTD, + + UZS, + + RUB, + + BTC, + + CNY, + + USDT, + + KZT, + + AWG, + + WHOP_USD, + + XAU, + + UNKNOWN + } + + public interface Visitor { + T visitUsd(); + + T visitSgd(); + + T visitInr(); + + T visitAud(); + + T visitBrl(); + + T visitCad(); + + T visitDkk(); + + T visitEur(); + + T visitNok(); + + T visitGbp(); + + T visitSek(); + + T visitChf(); + + T visitHkd(); + + T visitHuf(); + + T visitJpy(); + + T visitMxn(); + + T visitMyr(); + + T visitPln(); + + T visitCzk(); + + T visitNzd(); + + T visitAed(); + + T visitEth(); + + T visitApe(); + + T visitCop(); + + T visitRon(); + + T visitThb(); + + T visitBgn(); + + T visitIdr(); + + T visitDop(); + + T visitPhp(); + + T visitTry(); + + T visitKrw(); + + T visitTwd(); + + T visitVnd(); + + T visitPkr(); + + T visitClp(); + + T visitUyu(); + + T visitArs(); + + T visitZar(); + + T visitDzd(); + + T visitTnd(); + + T visitMad(); + + T visitKes(); + + T visitKwd(); + + T visitJod(); + + T visitAll(); + + T visitXcd(); + + T visitAmd(); + + T visitBsd(); + + T visitBhd(); + + T visitBob(); + + T visitBam(); + + T visitKhr(); + + T visitCrc(); + + T visitXof(); + + T visitEgp(); + + T visitEtb(); + + T visitGmd(); + + T visitGhs(); + + T visitGtq(); + + T visitGyd(); + + T visitIls(); + + T visitJmd(); + + T visitMop(); + + T visitMga(); + + T visitMur(); + + T visitMdl(); + + T visitMnt(); + + T visitNad(); + + T visitNgn(); + + T visitMkd(); + + T visitOmr(); + + T visitPyg(); + + T visitPen(); + + T visitQar(); + + T visitRwf(); + + T visitSar(); + + T visitRsd(); + + T visitLkr(); + + T visitTzs(); + + T visitTtd(); + + T visitUzs(); + + T visitRub(); + + T visitBtc(); + + T visitCny(); + + T visitUsdt(); + + T visitKzt(); + + T visitAwg(); + + T visitWhopUsd(); + + T visitXau(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionPromoDuration.java b/src/main/java/com/whop/api/types/CheckoutSessionPromoDuration.java new file mode 100644 index 00000000..a949cd90 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionPromoDuration.java @@ -0,0 +1,96 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionPromoDuration { + public static final CheckoutSessionPromoDuration REPEATING = + new CheckoutSessionPromoDuration(Value.REPEATING, "repeating"); + + public static final CheckoutSessionPromoDuration ONCE = new CheckoutSessionPromoDuration(Value.ONCE, "once"); + + public static final CheckoutSessionPromoDuration FOREVER = + new CheckoutSessionPromoDuration(Value.FOREVER, "forever"); + + private final Value value; + + private final String string; + + CheckoutSessionPromoDuration(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionPromoDuration + && this.string.equals(((CheckoutSessionPromoDuration) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case REPEATING: + return visitor.visitRepeating(); + case ONCE: + return visitor.visitOnce(); + case FOREVER: + return visitor.visitForever(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionPromoDuration valueOf(String value) { + switch (value) { + case "repeating": + return REPEATING; + case "once": + return ONCE; + case "forever": + return FOREVER; + default: + return new CheckoutSessionPromoDuration(Value.UNKNOWN, value); + } + } + + public enum Value { + FOREVER, + + ONCE, + + REPEATING, + + UNKNOWN + } + + public interface Visitor { + T visitForever(); + + T visitOnce(); + + T visitRepeating(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionPromoPromoType.java b/src/main/java/com/whop/api/types/CheckoutSessionPromoPromoType.java new file mode 100644 index 00000000..b22bf94c --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionPromoPromoType.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionPromoPromoType { + public static final CheckoutSessionPromoPromoType FLAT_AMOUNT = + new CheckoutSessionPromoPromoType(Value.FLAT_AMOUNT, "flat_amount"); + + public static final CheckoutSessionPromoPromoType PERCENTAGE = + new CheckoutSessionPromoPromoType(Value.PERCENTAGE, "percentage"); + + private final Value value; + + private final String string; + + CheckoutSessionPromoPromoType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionPromoPromoType + && this.string.equals(((CheckoutSessionPromoPromoType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FLAT_AMOUNT: + return visitor.visitFlatAmount(); + case PERCENTAGE: + return visitor.visitPercentage(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionPromoPromoType valueOf(String value) { + switch (value) { + case "flat_amount": + return FLAT_AMOUNT; + case "percentage": + return PERCENTAGE; + default: + return new CheckoutSessionPromoPromoType(Value.UNKNOWN, value); + } + } + + public enum Value { + PERCENTAGE, + + FLAT_AMOUNT, + + UNKNOWN + } + + public interface Visitor { + T visitPercentage(); + + T visitFlatAmount(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionQuote.java b/src/main/java/com/whop/api/types/CheckoutSessionQuote.java new file mode 100644 index 00000000..1578db66 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionQuote.java @@ -0,0 +1,441 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionQuote.Builder.class) +public final class CheckoutSessionQuote { + private final double baseAmount; + + private final String baseCurrency; + + private final CheckoutSessionBreakdown breakdown; + + private final String currency; + + private final Optional exchangeRate; + + private final String expiresAt; + + private final String quotedAt; + + private final boolean trialSkipped; + + private final Map additionalProperties; + + private CheckoutSessionQuote( + double baseAmount, + String baseCurrency, + CheckoutSessionBreakdown breakdown, + String currency, + Optional exchangeRate, + String expiresAt, + String quotedAt, + boolean trialSkipped, + Map additionalProperties) { + this.baseAmount = baseAmount; + this.baseCurrency = baseCurrency; + this.breakdown = breakdown; + this.currency = currency; + this.exchangeRate = exchangeRate; + this.expiresAt = expiresAt; + this.quotedAt = quotedAt; + this.trialSkipped = trialSkipped; + this.additionalProperties = additionalProperties; + } + + /** + * @return The total in base_currency, before conversion — what the seller prices in. The figure that is actually charged is breakdown.total, in currency. + */ + @JsonProperty("base_amount") + public double getBaseAmount() { + return baseAmount; + } + + /** + * @return The seller's own currency for these items, lowercase. Equal to currency when no conversion applied. + */ + @JsonProperty("base_currency") + public String getBaseCurrency() { + return baseCurrency; + } + + /** + * @return The same total, itemized — what is being bought, what changes the price, and what is owed later. The tax adjustment arrives pending here and resolves through calculate_tax, which answers with this same shape: render whichever you hold, preferring the calculated one. + */ + @JsonProperty("breakdown") + public CheckoutSessionBreakdown getBreakdown() { + return breakdown; + } + + /** + * @return ISO currency the confirm will charge in, lowercase. This is the buyer's own currency whenever adaptive pricing applies — the card is charged in it, not shown a conversion of it. + */ + @JsonProperty("currency") + public String getCurrency() { + return currency; + } + + /** + * @return The locked rate base_currency was converted at, or null when the charge is in the seller's own currency. Fixed for the life of the quote. + */ + @JsonIgnore + public Optional getExchangeRate() { + if (exchangeRate == null) { + return Optional.empty(); + } + return exchangeRate; + } + + /** + * @return When this quote stops being chargeable, as an ISO 8601 timestamp. A converted quote expires with its exchange rate, which is sooner than an unconverted one. + */ + @JsonProperty("expires_at") + public String getExpiresAt() { + return expiresAt; + } + + /** + * @return When this quote was computed, as an ISO 8601 timestamp. A confirm against a stale quote is refused with quote_expired and the quote refreshes for the retry. + */ + @JsonProperty("quoted_at") + public String getQuotedAt() { + return quotedAt; + } + + /** + * @return Whether this quote priced the plan's free trial as SKIPPED: the resolved buyer has held this plan before, so no trial applies and the full first price is due today. Tell the buyer so before they pay — the trial they can see on the plan is not theirs to start. false for a plan with no trial, and for a session whose buyer is not resolved yet: a returning buyer resolving at confirm is refused with quote_changed and this re-prices to true for the retry. + */ + @JsonProperty("trial_skipped") + public boolean getTrialSkipped() { + return trialSkipped; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("exchange_rate") + private Optional _getExchangeRate() { + return exchangeRate; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionQuote && equalTo((CheckoutSessionQuote) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionQuote other) { + return baseAmount == other.baseAmount + && baseCurrency.equals(other.baseCurrency) + && breakdown.equals(other.breakdown) + && currency.equals(other.currency) + && exchangeRate.equals(other.exchangeRate) + && expiresAt.equals(other.expiresAt) + && quotedAt.equals(other.quotedAt) + && trialSkipped == other.trialSkipped; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.baseAmount, + this.baseCurrency, + this.breakdown, + this.currency, + this.exchangeRate, + this.expiresAt, + this.quotedAt, + this.trialSkipped); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BaseAmountStage builder() { + return new Builder(); + } + + public interface BaseAmountStage { + /** + *

The total in base_currency, before conversion — what the seller prices in. The figure that is actually charged is breakdown.total, in currency.

+ */ + BaseCurrencyStage baseAmount(double baseAmount); + + Builder from(CheckoutSessionQuote other); + } + + public interface BaseCurrencyStage { + /** + *

The seller's own currency for these items, lowercase. Equal to currency when no conversion applied.

+ */ + BreakdownStage baseCurrency(@NotNull String baseCurrency); + } + + public interface BreakdownStage { + /** + *

The same total, itemized — what is being bought, what changes the price, and what is owed later. The tax adjustment arrives pending here and resolves through calculate_tax, which answers with this same shape: render whichever you hold, preferring the calculated one.

+ */ + CurrencyStage breakdown(@NotNull CheckoutSessionBreakdown breakdown); + } + + public interface CurrencyStage { + /** + *

ISO currency the confirm will charge in, lowercase. This is the buyer's own currency whenever adaptive pricing applies — the card is charged in it, not shown a conversion of it.

+ */ + ExpiresAtStage currency(@NotNull String currency); + } + + public interface ExpiresAtStage { + /** + *

When this quote stops being chargeable, as an ISO 8601 timestamp. A converted quote expires with its exchange rate, which is sooner than an unconverted one.

+ */ + QuotedAtStage expiresAt(@NotNull String expiresAt); + } + + public interface QuotedAtStage { + /** + *

When this quote was computed, as an ISO 8601 timestamp. A confirm against a stale quote is refused with quote_expired and the quote refreshes for the retry.

+ */ + TrialSkippedStage quotedAt(@NotNull String quotedAt); + } + + public interface TrialSkippedStage { + /** + *

Whether this quote priced the plan's free trial as SKIPPED: the resolved buyer has held this plan before, so no trial applies and the full first price is due today. Tell the buyer so before they pay — the trial they can see on the plan is not theirs to start. false for a plan with no trial, and for a session whose buyer is not resolved yet: a returning buyer resolving at confirm is refused with quote_changed and this re-prices to true for the retry.

+ */ + _FinalStage trialSkipped(boolean trialSkipped); + } + + public interface _FinalStage { + CheckoutSessionQuote build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The locked rate base_currency was converted at, or null when the charge is in the seller's own currency. Fixed for the life of the quote.

+ */ + _FinalStage exchangeRate(Optional exchangeRate); + + _FinalStage exchangeRate(Double exchangeRate); + + _FinalStage exchangeRate(Nullable exchangeRate); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements BaseAmountStage, + BaseCurrencyStage, + BreakdownStage, + CurrencyStage, + ExpiresAtStage, + QuotedAtStage, + TrialSkippedStage, + _FinalStage { + private double baseAmount; + + private String baseCurrency; + + private CheckoutSessionBreakdown breakdown; + + private String currency; + + private String expiresAt; + + private String quotedAt; + + private boolean trialSkipped; + + private Optional exchangeRate = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionQuote other) { + baseAmount(other.getBaseAmount()); + baseCurrency(other.getBaseCurrency()); + breakdown(other.getBreakdown()); + currency(other.getCurrency()); + exchangeRate(other.getExchangeRate()); + expiresAt(other.getExpiresAt()); + quotedAt(other.getQuotedAt()); + trialSkipped(other.getTrialSkipped()); + return this; + } + + /** + *

The total in base_currency, before conversion — what the seller prices in. The figure that is actually charged is breakdown.total, in currency.

+ *

The total in base_currency, before conversion — what the seller prices in. The figure that is actually charged is breakdown.total, in currency.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("base_amount") + public BaseCurrencyStage baseAmount(double baseAmount) { + this.baseAmount = baseAmount; + return this; + } + + /** + *

The seller's own currency for these items, lowercase. Equal to currency when no conversion applied.

+ *

The seller's own currency for these items, lowercase. Equal to currency when no conversion applied.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("base_currency") + public BreakdownStage baseCurrency(@NotNull String baseCurrency) { + this.baseCurrency = Objects.requireNonNull(baseCurrency, "baseCurrency must not be null"); + return this; + } + + /** + *

The same total, itemized — what is being bought, what changes the price, and what is owed later. The tax adjustment arrives pending here and resolves through calculate_tax, which answers with this same shape: render whichever you hold, preferring the calculated one.

+ *

The same total, itemized — what is being bought, what changes the price, and what is owed later. The tax adjustment arrives pending here and resolves through calculate_tax, which answers with this same shape: render whichever you hold, preferring the calculated one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("breakdown") + public CurrencyStage breakdown(@NotNull CheckoutSessionBreakdown breakdown) { + this.breakdown = Objects.requireNonNull(breakdown, "breakdown must not be null"); + return this; + } + + /** + *

ISO currency the confirm will charge in, lowercase. This is the buyer's own currency whenever adaptive pricing applies — the card is charged in it, not shown a conversion of it.

+ *

ISO currency the confirm will charge in, lowercase. This is the buyer's own currency whenever adaptive pricing applies — the card is charged in it, not shown a conversion of it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("currency") + public ExpiresAtStage currency(@NotNull String currency) { + this.currency = Objects.requireNonNull(currency, "currency must not be null"); + return this; + } + + /** + *

When this quote stops being chargeable, as an ISO 8601 timestamp. A converted quote expires with its exchange rate, which is sooner than an unconverted one.

+ *

When this quote stops being chargeable, as an ISO 8601 timestamp. A converted quote expires with its exchange rate, which is sooner than an unconverted one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("expires_at") + public QuotedAtStage expiresAt(@NotNull String expiresAt) { + this.expiresAt = Objects.requireNonNull(expiresAt, "expiresAt must not be null"); + return this; + } + + /** + *

When this quote was computed, as an ISO 8601 timestamp. A confirm against a stale quote is refused with quote_expired and the quote refreshes for the retry.

+ *

When this quote was computed, as an ISO 8601 timestamp. A confirm against a stale quote is refused with quote_expired and the quote refreshes for the retry.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("quoted_at") + public TrialSkippedStage quotedAt(@NotNull String quotedAt) { + this.quotedAt = Objects.requireNonNull(quotedAt, "quotedAt must not be null"); + return this; + } + + /** + *

Whether this quote priced the plan's free trial as SKIPPED: the resolved buyer has held this plan before, so no trial applies and the full first price is due today. Tell the buyer so before they pay — the trial they can see on the plan is not theirs to start. false for a plan with no trial, and for a session whose buyer is not resolved yet: a returning buyer resolving at confirm is refused with quote_changed and this re-prices to true for the retry.

+ *

Whether this quote priced the plan's free trial as SKIPPED: the resolved buyer has held this plan before, so no trial applies and the full first price is due today. Tell the buyer so before they pay — the trial they can see on the plan is not theirs to start. false for a plan with no trial, and for a session whose buyer is not resolved yet: a returning buyer resolving at confirm is refused with quote_changed and this re-prices to true for the retry.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("trial_skipped") + public _FinalStage trialSkipped(boolean trialSkipped) { + this.trialSkipped = trialSkipped; + return this; + } + + /** + *

The locked rate base_currency was converted at, or null when the charge is in the seller's own currency. Fixed for the life of the quote.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage exchangeRate(Nullable exchangeRate) { + if (exchangeRate.isNull()) { + this.exchangeRate = null; + } else if (exchangeRate.isEmpty()) { + this.exchangeRate = Optional.empty(); + } else { + this.exchangeRate = Optional.of(exchangeRate.get()); + } + return this; + } + + /** + *

The locked rate base_currency was converted at, or null when the charge is in the seller's own currency. Fixed for the life of the quote.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage exchangeRate(Double exchangeRate) { + this.exchangeRate = Optional.ofNullable(exchangeRate); + return this; + } + + /** + *

The locked rate base_currency was converted at, or null when the charge is in the seller's own currency. Fixed for the life of the quote.

+ */ + @java.lang.Override + @JsonSetter(value = "exchange_rate", nulls = Nulls.SKIP) + public _FinalStage exchangeRate(Optional exchangeRate) { + this.exchangeRate = exchangeRate; + return this; + } + + @java.lang.Override + public CheckoutSessionQuote build() { + return new CheckoutSessionQuote( + baseAmount, + baseCurrency, + breakdown, + currency, + exchangeRate, + expiresAt, + quotedAt, + trialSkipped, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionRedirectAction.java b/src/main/java/com/whop/api/types/CheckoutSessionRedirectAction.java new file mode 100644 index 00000000..7e50f5c7 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionRedirectAction.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionRedirectAction.Builder.class) +public final class CheckoutSessionRedirectAction { + private final boolean blocking; + + private final String destinationUrl; + + private final Map additionalProperties; + + private CheckoutSessionRedirectAction( + boolean blocking, String destinationUrl, Map additionalProperties) { + this.blocking = blocking; + this.destinationUrl = destinationUrl; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab. + */ + @JsonProperty("blocking") + public boolean getBlocking() { + return blocking; + } + + /** + * @return Where to send the buyer. An absolute HTTP or HTTPS URL, resolved from the seller's post-purchase settings and already carrying the order's query parameters (receipt_id, payment_id, checkout_status, status, state_id) — navigate straight to it. Distinct from return_url, which is the payment provider's return leg. + */ + @JsonProperty("destination_url") + public String getDestinationUrl() { + return destinationUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionRedirectAction && equalTo((CheckoutSessionRedirectAction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionRedirectAction other) { + return blocking == other.blocking && destinationUrl.equals(other.destinationUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.blocking, this.destinationUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BlockingStage builder() { + return new Builder(); + } + + public interface BlockingStage { + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ */ + DestinationUrlStage blocking(boolean blocking); + + Builder from(CheckoutSessionRedirectAction other); + } + + public interface DestinationUrlStage { + /** + *

Where to send the buyer. An absolute HTTP or HTTPS URL, resolved from the seller's post-purchase settings and already carrying the order's query parameters (receipt_id, payment_id, checkout_status, status, state_id) — navigate straight to it. Distinct from return_url, which is the payment provider's return leg.

+ */ + _FinalStage destinationUrl(@NotNull String destinationUrl); + } + + public interface _FinalStage { + CheckoutSessionRedirectAction build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BlockingStage, DestinationUrlStage, _FinalStage { + private boolean blocking; + + private String destinationUrl; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionRedirectAction other) { + blocking(other.getBlocking()); + destinationUrl(other.getDestinationUrl()); + return this; + } + + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("blocking") + public DestinationUrlStage blocking(boolean blocking) { + this.blocking = blocking; + return this; + } + + /** + *

Where to send the buyer. An absolute HTTP or HTTPS URL, resolved from the seller's post-purchase settings and already carrying the order's query parameters (receipt_id, payment_id, checkout_status, status, state_id) — navigate straight to it. Distinct from return_url, which is the payment provider's return leg.

+ *

Where to send the buyer. An absolute HTTP or HTTPS URL, resolved from the seller's post-purchase settings and already carrying the order's query parameters (receipt_id, payment_id, checkout_status, status, state_id) — navigate straight to it. Distinct from return_url, which is the payment provider's return leg.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("destination_url") + public _FinalStage destinationUrl(@NotNull String destinationUrl) { + this.destinationUrl = Objects.requireNonNull(destinationUrl, "destinationUrl must not be null"); + return this; + } + + @java.lang.Override + public CheckoutSessionRedirectAction build() { + return new CheckoutSessionRedirectAction(blocking, destinationUrl, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionRequirement.java b/src/main/java/com/whop/api/types/CheckoutSessionRequirement.java new file mode 100644 index 00000000..6da29c10 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionRequirement.java @@ -0,0 +1,189 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionRequirement.Builder.class) +public final class CheckoutSessionRequirement { + private final Optional> fields; + + private final CheckoutSessionRequirementType type; + + private final Map additionalProperties; + + private CheckoutSessionRequirement( + Optional> fields, + CheckoutSessionRequirementType type, + Map additionalProperties) { + this.fields = fields; + this.type = type; + this.additionalProperties = additionalProperties; + } + + @JsonIgnore + public Optional> getFields() { + if (fields == null) { + return Optional.empty(); + } + return fields; + } + + /** + * @return What to collect. custom_password — the plan is password-protected: send the buyer's answer through update, and the entry disappears once it is right; confirm refuses while it stands. email — the buyer's email address; it identifies who the purchase is for, and confirm has no other way to resolve them. terms — explicit acceptance, sent as the tos_accepted attestation on confirm; show the seller's documents from account.terms. custom_fields — the seller's own questions, published in fields; answer them through custom_field_responses. shipping_address — a postal address for physical goods, set through shipping_address. phone_number — the seller collects buyer phone numbers: set one through update and it is recorded against the order; a missing number never refuses the confirm. The list is closed; new entries are added deliberately, so an unrecognized type is safe to skip. + */ + @JsonProperty("type") + public CheckoutSessionRequirementType getType() { + return type; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("fields") + private Optional> _getFields() { + return fields; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionRequirement && equalTo((CheckoutSessionRequirement) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionRequirement other) { + return fields.equals(other.fields) && type.equals(other.type); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.fields, this.type); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + /** + *

What to collect. custom_password — the plan is password-protected: send the buyer's answer through update, and the entry disappears once it is right; confirm refuses while it stands. email — the buyer's email address; it identifies who the purchase is for, and confirm has no other way to resolve them. terms — explicit acceptance, sent as the tos_accepted attestation on confirm; show the seller's documents from account.terms. custom_fields — the seller's own questions, published in fields; answer them through custom_field_responses. shipping_address — a postal address for physical goods, set through shipping_address. phone_number — the seller collects buyer phone numbers: set one through update and it is recorded against the order; a missing number never refuses the confirm. The list is closed; new entries are added deliberately, so an unrecognized type is safe to skip.

+ */ + _FinalStage type(@NotNull CheckoutSessionRequirementType type); + + Builder from(CheckoutSessionRequirement other); + } + + public interface _FinalStage { + CheckoutSessionRequirement build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + _FinalStage fields(Optional> fields); + + _FinalStage fields(List fields); + + _FinalStage fields(Nullable> fields); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, _FinalStage { + private CheckoutSessionRequirementType type; + + private Optional> fields = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionRequirement other) { + fields(other.getFields()); + type(other.getType()); + return this; + } + + /** + *

What to collect. custom_password — the plan is password-protected: send the buyer's answer through update, and the entry disappears once it is right; confirm refuses while it stands. email — the buyer's email address; it identifies who the purchase is for, and confirm has no other way to resolve them. terms — explicit acceptance, sent as the tos_accepted attestation on confirm; show the seller's documents from account.terms. custom_fields — the seller's own questions, published in fields; answer them through custom_field_responses. shipping_address — a postal address for physical goods, set through shipping_address. phone_number — the seller collects buyer phone numbers: set one through update and it is recorded against the order; a missing number never refuses the confirm. The list is closed; new entries are added deliberately, so an unrecognized type is safe to skip.

+ *

What to collect. custom_password — the plan is password-protected: send the buyer's answer through update, and the entry disappears once it is right; confirm refuses while it stands. email — the buyer's email address; it identifies who the purchase is for, and confirm has no other way to resolve them. terms — explicit acceptance, sent as the tos_accepted attestation on confirm; show the seller's documents from account.terms. custom_fields — the seller's own questions, published in fields; answer them through custom_field_responses. shipping_address — a postal address for physical goods, set through shipping_address. phone_number — the seller collects buyer phone numbers: set one through update and it is recorded against the order; a missing number never refuses the confirm. The list is closed; new entries are added deliberately, so an unrecognized type is safe to skip.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("type") + public _FinalStage type(@NotNull CheckoutSessionRequirementType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + @java.lang.Override + public _FinalStage fields(Nullable> fields) { + if (fields.isNull()) { + this.fields = null; + } else if (fields.isEmpty()) { + this.fields = Optional.empty(); + } else { + this.fields = Optional.of(fields.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage fields(List fields) { + this.fields = Optional.ofNullable(fields); + return this; + } + + @java.lang.Override + @JsonSetter(value = "fields", nulls = Nulls.SKIP) + public _FinalStage fields(Optional> fields) { + this.fields = fields; + return this; + } + + @java.lang.Override + public CheckoutSessionRequirement build() { + return new CheckoutSessionRequirement(fields, type, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionRequirementType.java b/src/main/java/com/whop/api/types/CheckoutSessionRequirementType.java new file mode 100644 index 00000000..64c2b78d --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionRequirementType.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionRequirementType { + public static final CheckoutSessionRequirementType CUSTOM_PASSWORD = + new CheckoutSessionRequirementType(Value.CUSTOM_PASSWORD, "custom_password"); + + public static final CheckoutSessionRequirementType TERMS = new CheckoutSessionRequirementType(Value.TERMS, "terms"); + + public static final CheckoutSessionRequirementType EMAIL = new CheckoutSessionRequirementType(Value.EMAIL, "email"); + + public static final CheckoutSessionRequirementType SHIPPING_ADDRESS = + new CheckoutSessionRequirementType(Value.SHIPPING_ADDRESS, "shipping_address"); + + public static final CheckoutSessionRequirementType CUSTOM_FIELDS = + new CheckoutSessionRequirementType(Value.CUSTOM_FIELDS, "custom_fields"); + + public static final CheckoutSessionRequirementType PHONE_NUMBER = + new CheckoutSessionRequirementType(Value.PHONE_NUMBER, "phone_number"); + + private final Value value; + + private final String string; + + CheckoutSessionRequirementType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionRequirementType + && this.string.equals(((CheckoutSessionRequirementType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case CUSTOM_PASSWORD: + return visitor.visitCustomPassword(); + case TERMS: + return visitor.visitTerms(); + case EMAIL: + return visitor.visitEmail(); + case SHIPPING_ADDRESS: + return visitor.visitShippingAddress(); + case CUSTOM_FIELDS: + return visitor.visitCustomFields(); + case PHONE_NUMBER: + return visitor.visitPhoneNumber(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionRequirementType valueOf(String value) { + switch (value) { + case "custom_password": + return CUSTOM_PASSWORD; + case "terms": + return TERMS; + case "email": + return EMAIL; + case "shipping_address": + return SHIPPING_ADDRESS; + case "custom_fields": + return CUSTOM_FIELDS; + case "phone_number": + return PHONE_NUMBER; + default: + return new CheckoutSessionRequirementType(Value.UNKNOWN, value); + } + } + + public enum Value { + CUSTOM_PASSWORD, + + EMAIL, + + TERMS, + + CUSTOM_FIELDS, + + SHIPPING_ADDRESS, + + PHONE_NUMBER, + + UNKNOWN + } + + public interface Visitor { + T visitCustomPassword(); + + T visitEmail(); + + T visitTerms(); + + T visitCustomFields(); + + T visitShippingAddress(); + + T visitPhoneNumber(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionSeller.java b/src/main/java/com/whop/api/types/CheckoutSessionSeller.java new file mode 100644 index 00000000..f741e61d --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionSeller.java @@ -0,0 +1,382 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionSeller.Builder.class) +public final class CheckoutSessionSeller { + private final String id; + + private final Optional logoUrl; + + private final Optional redirectPurchaseUrl; + + private final String route; + + private final CheckoutSessionSellerTerms terms; + + private final String title; + + private final Map additionalProperties; + + private CheckoutSessionSeller( + String id, + Optional logoUrl, + Optional redirectPurchaseUrl, + String route, + CheckoutSessionSellerTerms terms, + String title, + Map additionalProperties) { + this.id = id; + this.logoUrl = logoUrl; + this.redirectPurchaseUrl = redirectPurchaseUrl; + this.route = route; + this.terms = terms; + this.title = title; + this.additionalProperties = additionalProperties; + } + + /** + * @return Account ID, prefixed biz_. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return The seller's logo image URL, or null when they have not uploaded one. + */ + @JsonIgnore + public Optional getLogoUrl() { + if (logoUrl == null) { + return Optional.empty(); + } + return logoUrl; + } + + /** + * @return Where this seller sends buyers after any purchase, or null. The plan's and the checkout configuration's own redirects take precedence over it. + */ + @JsonIgnore + public Optional getRedirectPurchaseUrl() { + if (redirectPurchaseUrl == null) { + return Optional.empty(); + } + return redirectPurchaseUrl; + } + + /** + * @return The seller's store-page slug — the :route in whop.com/joined/:route, which is where a purchase lands when nothing more specific is configured. + */ + @JsonProperty("route") + public String getRoute() { + return route; + } + + /** + * @return The seller's checkout legal surface: whether explicit acceptance is required, and the policy documents it covers. + */ + @JsonProperty("terms") + public CheckoutSessionSellerTerms getTerms() { + return terms; + } + + /** + * @return The seller's public name, as the buyer knows them. + */ + @JsonProperty("title") + public String getTitle() { + return title; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("logo_url") + private Optional _getLogoUrl() { + return logoUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("redirect_purchase_url") + private Optional _getRedirectPurchaseUrl() { + return redirectPurchaseUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionSeller && equalTo((CheckoutSessionSeller) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionSeller other) { + return id.equals(other.id) + && logoUrl.equals(other.logoUrl) + && redirectPurchaseUrl.equals(other.redirectPurchaseUrl) + && route.equals(other.route) + && terms.equals(other.terms) + && title.equals(other.title); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.id, this.logoUrl, this.redirectPurchaseUrl, this.route, this.terms, this.title); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Account ID, prefixed biz_.

+ */ + RouteStage id(@NotNull String id); + + Builder from(CheckoutSessionSeller other); + } + + public interface RouteStage { + /** + *

The seller's store-page slug — the :route in whop.com/joined/:route, which is where a purchase lands when nothing more specific is configured.

+ */ + TermsStage route(@NotNull String route); + } + + public interface TermsStage { + /** + *

The seller's checkout legal surface: whether explicit acceptance is required, and the policy documents it covers.

+ */ + TitleStage terms(@NotNull CheckoutSessionSellerTerms terms); + } + + public interface TitleStage { + /** + *

The seller's public name, as the buyer knows them.

+ */ + _FinalStage title(@NotNull String title); + } + + public interface _FinalStage { + CheckoutSessionSeller build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The seller's logo image URL, or null when they have not uploaded one.

+ */ + _FinalStage logoUrl(Optional logoUrl); + + _FinalStage logoUrl(String logoUrl); + + _FinalStage logoUrl(Nullable logoUrl); + + /** + *

Where this seller sends buyers after any purchase, or null. The plan's and the checkout configuration's own redirects take precedence over it.

+ */ + _FinalStage redirectPurchaseUrl(Optional redirectPurchaseUrl); + + _FinalStage redirectPurchaseUrl(String redirectPurchaseUrl); + + _FinalStage redirectPurchaseUrl(Nullable redirectPurchaseUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements IdStage, RouteStage, TermsStage, TitleStage, _FinalStage { + private String id; + + private String route; + + private CheckoutSessionSellerTerms terms; + + private String title; + + private Optional redirectPurchaseUrl = Optional.empty(); + + private Optional logoUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionSeller other) { + id(other.getId()); + logoUrl(other.getLogoUrl()); + redirectPurchaseUrl(other.getRedirectPurchaseUrl()); + route(other.getRoute()); + terms(other.getTerms()); + title(other.getTitle()); + return this; + } + + /** + *

Account ID, prefixed biz_.

+ *

Account ID, prefixed biz_.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public RouteStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

The seller's store-page slug — the :route in whop.com/joined/:route, which is where a purchase lands when nothing more specific is configured.

+ *

The seller's store-page slug — the :route in whop.com/joined/:route, which is where a purchase lands when nothing more specific is configured.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("route") + public TermsStage route(@NotNull String route) { + this.route = Objects.requireNonNull(route, "route must not be null"); + return this; + } + + /** + *

The seller's checkout legal surface: whether explicit acceptance is required, and the policy documents it covers.

+ *

The seller's checkout legal surface: whether explicit acceptance is required, and the policy documents it covers.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("terms") + public TitleStage terms(@NotNull CheckoutSessionSellerTerms terms) { + this.terms = Objects.requireNonNull(terms, "terms must not be null"); + return this; + } + + /** + *

The seller's public name, as the buyer knows them.

+ *

The seller's public name, as the buyer knows them.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("title") + public _FinalStage title(@NotNull String title) { + this.title = Objects.requireNonNull(title, "title must not be null"); + return this; + } + + /** + *

Where this seller sends buyers after any purchase, or null. The plan's and the checkout configuration's own redirects take precedence over it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage redirectPurchaseUrl(Nullable redirectPurchaseUrl) { + if (redirectPurchaseUrl.isNull()) { + this.redirectPurchaseUrl = null; + } else if (redirectPurchaseUrl.isEmpty()) { + this.redirectPurchaseUrl = Optional.empty(); + } else { + this.redirectPurchaseUrl = Optional.of(redirectPurchaseUrl.get()); + } + return this; + } + + /** + *

Where this seller sends buyers after any purchase, or null. The plan's and the checkout configuration's own redirects take precedence over it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage redirectPurchaseUrl(String redirectPurchaseUrl) { + this.redirectPurchaseUrl = Optional.ofNullable(redirectPurchaseUrl); + return this; + } + + /** + *

Where this seller sends buyers after any purchase, or null. The plan's and the checkout configuration's own redirects take precedence over it.

+ */ + @java.lang.Override + @JsonSetter(value = "redirect_purchase_url", nulls = Nulls.SKIP) + public _FinalStage redirectPurchaseUrl(Optional redirectPurchaseUrl) { + this.redirectPurchaseUrl = redirectPurchaseUrl; + return this; + } + + /** + *

The seller's logo image URL, or null when they have not uploaded one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage logoUrl(Nullable logoUrl) { + if (logoUrl.isNull()) { + this.logoUrl = null; + } else if (logoUrl.isEmpty()) { + this.logoUrl = Optional.empty(); + } else { + this.logoUrl = Optional.of(logoUrl.get()); + } + return this; + } + + /** + *

The seller's logo image URL, or null when they have not uploaded one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage logoUrl(String logoUrl) { + this.logoUrl = Optional.ofNullable(logoUrl); + return this; + } + + /** + *

The seller's logo image URL, or null when they have not uploaded one.

+ */ + @java.lang.Override + @JsonSetter(value = "logo_url", nulls = Nulls.SKIP) + public _FinalStage logoUrl(Optional logoUrl) { + this.logoUrl = logoUrl; + return this; + } + + @java.lang.Override + public CheckoutSessionSeller build() { + return new CheckoutSessionSeller( + id, logoUrl, redirectPurchaseUrl, route, terms, title, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionSellerTerms.java b/src/main/java/com/whop/api/types/CheckoutSessionSellerTerms.java new file mode 100644 index 00000000..37df6ced --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionSellerTerms.java @@ -0,0 +1,416 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionSellerTerms.Builder.class) +public final class CheckoutSessionSellerTerms { + private final Optional eulaUrl; + + private final Optional privacyPolicyUrl; + + private final boolean required; + + private final Optional returnPolicyUrl; + + private final Optional termsUrl; + + private final Map additionalProperties; + + private CheckoutSessionSellerTerms( + Optional eulaUrl, + Optional privacyPolicyUrl, + boolean required, + Optional returnPolicyUrl, + Optional termsUrl, + Map additionalProperties) { + this.eulaUrl = eulaUrl; + this.privacyPolicyUrl = privacyPolicyUrl; + this.required = required; + this.returnPolicyUrl = returnPolicyUrl; + this.termsUrl = termsUrl; + this.additionalProperties = additionalProperties; + } + + /** + * @return The seller's end-user licence agreement, or null if they have not published one. + */ + @JsonIgnore + public Optional getEulaUrl() { + if (eulaUrl == null) { + return Optional.empty(); + } + return eulaUrl; + } + + /** + * @return The seller's privacy policy, or null if they have not published one. + */ + @JsonIgnore + public Optional getPrivacyPolicyUrl() { + if (privacyPolicyUrl == null) { + return Optional.empty(); + } + return privacyPolicyUrl; + } + + /** + * @return Whether the buyer must explicitly accept the seller's terms before confirming. true means hold the confirm behind a deliberate act of acceptance; false means the buyer paying through a visible disclosure is the acceptance. + */ + @JsonProperty("required") + public boolean getRequired() { + return required; + } + + /** + * @return The seller's return policy, or null if they have not published one. + */ + @JsonIgnore + public Optional getReturnPolicyUrl() { + if (returnPolicyUrl == null) { + return Optional.empty(); + } + return returnPolicyUrl; + } + + /** + * @return The seller's terms of service, or null if they have not published one. + */ + @JsonIgnore + public Optional getTermsUrl() { + if (termsUrl == null) { + return Optional.empty(); + } + return termsUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("eula_url") + private Optional _getEulaUrl() { + return eulaUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("privacy_policy_url") + private Optional _getPrivacyPolicyUrl() { + return privacyPolicyUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("return_policy_url") + private Optional _getReturnPolicyUrl() { + return returnPolicyUrl; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("terms_url") + private Optional _getTermsUrl() { + return termsUrl; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionSellerTerms && equalTo((CheckoutSessionSellerTerms) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionSellerTerms other) { + return eulaUrl.equals(other.eulaUrl) + && privacyPolicyUrl.equals(other.privacyPolicyUrl) + && required == other.required + && returnPolicyUrl.equals(other.returnPolicyUrl) + && termsUrl.equals(other.termsUrl); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.eulaUrl, this.privacyPolicyUrl, this.required, this.returnPolicyUrl, this.termsUrl); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static RequiredStage builder() { + return new Builder(); + } + + public interface RequiredStage { + /** + *

Whether the buyer must explicitly accept the seller's terms before confirming. true means hold the confirm behind a deliberate act of acceptance; false means the buyer paying through a visible disclosure is the acceptance.

+ */ + _FinalStage required(boolean required); + + Builder from(CheckoutSessionSellerTerms other); + } + + public interface _FinalStage { + CheckoutSessionSellerTerms build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The seller's end-user licence agreement, or null if they have not published one.

+ */ + _FinalStage eulaUrl(Optional eulaUrl); + + _FinalStage eulaUrl(String eulaUrl); + + _FinalStage eulaUrl(Nullable eulaUrl); + + /** + *

The seller's privacy policy, or null if they have not published one.

+ */ + _FinalStage privacyPolicyUrl(Optional privacyPolicyUrl); + + _FinalStage privacyPolicyUrl(String privacyPolicyUrl); + + _FinalStage privacyPolicyUrl(Nullable privacyPolicyUrl); + + /** + *

The seller's return policy, or null if they have not published one.

+ */ + _FinalStage returnPolicyUrl(Optional returnPolicyUrl); + + _FinalStage returnPolicyUrl(String returnPolicyUrl); + + _FinalStage returnPolicyUrl(Nullable returnPolicyUrl); + + /** + *

The seller's terms of service, or null if they have not published one.

+ */ + _FinalStage termsUrl(Optional termsUrl); + + _FinalStage termsUrl(String termsUrl); + + _FinalStage termsUrl(Nullable termsUrl); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements RequiredStage, _FinalStage { + private boolean required; + + private Optional termsUrl = Optional.empty(); + + private Optional returnPolicyUrl = Optional.empty(); + + private Optional privacyPolicyUrl = Optional.empty(); + + private Optional eulaUrl = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionSellerTerms other) { + eulaUrl(other.getEulaUrl()); + privacyPolicyUrl(other.getPrivacyPolicyUrl()); + required(other.getRequired()); + returnPolicyUrl(other.getReturnPolicyUrl()); + termsUrl(other.getTermsUrl()); + return this; + } + + /** + *

Whether the buyer must explicitly accept the seller's terms before confirming. true means hold the confirm behind a deliberate act of acceptance; false means the buyer paying through a visible disclosure is the acceptance.

+ *

Whether the buyer must explicitly accept the seller's terms before confirming. true means hold the confirm behind a deliberate act of acceptance; false means the buyer paying through a visible disclosure is the acceptance.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("required") + public _FinalStage required(boolean required) { + this.required = required; + return this; + } + + /** + *

The seller's terms of service, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage termsUrl(Nullable termsUrl) { + if (termsUrl.isNull()) { + this.termsUrl = null; + } else if (termsUrl.isEmpty()) { + this.termsUrl = Optional.empty(); + } else { + this.termsUrl = Optional.of(termsUrl.get()); + } + return this; + } + + /** + *

The seller's terms of service, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage termsUrl(String termsUrl) { + this.termsUrl = Optional.ofNullable(termsUrl); + return this; + } + + /** + *

The seller's terms of service, or null if they have not published one.

+ */ + @java.lang.Override + @JsonSetter(value = "terms_url", nulls = Nulls.SKIP) + public _FinalStage termsUrl(Optional termsUrl) { + this.termsUrl = termsUrl; + return this; + } + + /** + *

The seller's return policy, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage returnPolicyUrl(Nullable returnPolicyUrl) { + if (returnPolicyUrl.isNull()) { + this.returnPolicyUrl = null; + } else if (returnPolicyUrl.isEmpty()) { + this.returnPolicyUrl = Optional.empty(); + } else { + this.returnPolicyUrl = Optional.of(returnPolicyUrl.get()); + } + return this; + } + + /** + *

The seller's return policy, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage returnPolicyUrl(String returnPolicyUrl) { + this.returnPolicyUrl = Optional.ofNullable(returnPolicyUrl); + return this; + } + + /** + *

The seller's return policy, or null if they have not published one.

+ */ + @java.lang.Override + @JsonSetter(value = "return_policy_url", nulls = Nulls.SKIP) + public _FinalStage returnPolicyUrl(Optional returnPolicyUrl) { + this.returnPolicyUrl = returnPolicyUrl; + return this; + } + + /** + *

The seller's privacy policy, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage privacyPolicyUrl(Nullable privacyPolicyUrl) { + if (privacyPolicyUrl.isNull()) { + this.privacyPolicyUrl = null; + } else if (privacyPolicyUrl.isEmpty()) { + this.privacyPolicyUrl = Optional.empty(); + } else { + this.privacyPolicyUrl = Optional.of(privacyPolicyUrl.get()); + } + return this; + } + + /** + *

The seller's privacy policy, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage privacyPolicyUrl(String privacyPolicyUrl) { + this.privacyPolicyUrl = Optional.ofNullable(privacyPolicyUrl); + return this; + } + + /** + *

The seller's privacy policy, or null if they have not published one.

+ */ + @java.lang.Override + @JsonSetter(value = "privacy_policy_url", nulls = Nulls.SKIP) + public _FinalStage privacyPolicyUrl(Optional privacyPolicyUrl) { + this.privacyPolicyUrl = privacyPolicyUrl; + return this; + } + + /** + *

The seller's end-user licence agreement, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage eulaUrl(Nullable eulaUrl) { + if (eulaUrl.isNull()) { + this.eulaUrl = null; + } else if (eulaUrl.isEmpty()) { + this.eulaUrl = Optional.empty(); + } else { + this.eulaUrl = Optional.of(eulaUrl.get()); + } + return this; + } + + /** + *

The seller's end-user licence agreement, or null if they have not published one.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage eulaUrl(String eulaUrl) { + this.eulaUrl = Optional.ofNullable(eulaUrl); + return this; + } + + /** + *

The seller's end-user licence agreement, or null if they have not published one.

+ */ + @java.lang.Override + @JsonSetter(value = "eula_url", nulls = Nulls.SKIP) + public _FinalStage eulaUrl(Optional eulaUrl) { + this.eulaUrl = eulaUrl; + return this; + } + + @java.lang.Override + public CheckoutSessionSellerTerms build() { + return new CheckoutSessionSellerTerms( + eulaUrl, privacyPolicyUrl, required, returnPolicyUrl, termsUrl, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionShippingAddress.java b/src/main/java/com/whop/api/types/CheckoutSessionShippingAddress.java new file mode 100644 index 00000000..17491195 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionShippingAddress.java @@ -0,0 +1,294 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionShippingAddress.Builder.class) +public final class CheckoutSessionShippingAddress { + private final Optional city; + + private final Optional country; + + private final Optional line1; + + private final Optional line2; + + private final Optional name; + + private final Optional postalCode; + + private final Optional state; + + private final Map additionalProperties; + + private CheckoutSessionShippingAddress( + Optional city, + Optional country, + Optional line1, + Optional line2, + Optional name, + Optional postalCode, + Optional state, + Map additionalProperties) { + this.city = city; + this.country = country; + this.line1 = line1; + this.line2 = line2; + this.name = name; + this.postalCode = postalCode; + this.state = state; + this.additionalProperties = additionalProperties; + } + + /** + * @return City name. + */ + @JsonProperty("city") + public Optional getCity() { + return city; + } + + /** + * @return ISO 3166-1 alpha-2 country code, such as US. + */ + @JsonProperty("country") + public Optional getCountry() { + return country; + } + + /** + * @return First line of the street address. + */ + @JsonProperty("line1") + public Optional getLine1() { + return line1; + } + + /** + * @return Second line of the street address. + */ + @JsonProperty("line2") + public Optional getLine2() { + return line2; + } + + /** + * @return The recipient's full name, as it should appear on the shipping label. + */ + @JsonProperty("name") + public Optional getName() { + return name; + } + + /** + * @return Postal or ZIP code. + */ + @JsonProperty("postal_code") + public Optional getPostalCode() { + return postalCode; + } + + /** + * @return State, province, or region code, such as CA. + */ + @JsonProperty("state") + public Optional getState() { + return state; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionShippingAddress && equalTo((CheckoutSessionShippingAddress) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionShippingAddress other) { + return city.equals(other.city) + && country.equals(other.country) + && line1.equals(other.line1) + && line2.equals(other.line2) + && name.equals(other.name) + && postalCode.equals(other.postalCode) + && state.equals(other.state); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.city, this.country, this.line1, this.line2, this.name, this.postalCode, this.state); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static Builder builder() { + return new Builder(); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder { + private Optional city = Optional.empty(); + + private Optional country = Optional.empty(); + + private Optional line1 = Optional.empty(); + + private Optional line2 = Optional.empty(); + + private Optional name = Optional.empty(); + + private Optional postalCode = Optional.empty(); + + private Optional state = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + public Builder from(CheckoutSessionShippingAddress other) { + city(other.getCity()); + country(other.getCountry()); + line1(other.getLine1()); + line2(other.getLine2()); + name(other.getName()); + postalCode(other.getPostalCode()); + state(other.getState()); + return this; + } + + /** + *

City name.

+ */ + @JsonSetter(value = "city", nulls = Nulls.SKIP) + public Builder city(Optional city) { + this.city = city; + return this; + } + + public Builder city(String city) { + this.city = Optional.ofNullable(city); + return this; + } + + /** + *

ISO 3166-1 alpha-2 country code, such as US.

+ */ + @JsonSetter(value = "country", nulls = Nulls.SKIP) + public Builder country(Optional country) { + this.country = country; + return this; + } + + public Builder country(String country) { + this.country = Optional.ofNullable(country); + return this; + } + + /** + *

First line of the street address.

+ */ + @JsonSetter(value = "line1", nulls = Nulls.SKIP) + public Builder line1(Optional line1) { + this.line1 = line1; + return this; + } + + public Builder line1(String line1) { + this.line1 = Optional.ofNullable(line1); + return this; + } + + /** + *

Second line of the street address.

+ */ + @JsonSetter(value = "line2", nulls = Nulls.SKIP) + public Builder line2(Optional line2) { + this.line2 = line2; + return this; + } + + public Builder line2(String line2) { + this.line2 = Optional.ofNullable(line2); + return this; + } + + /** + *

The recipient's full name, as it should appear on the shipping label.

+ */ + @JsonSetter(value = "name", nulls = Nulls.SKIP) + public Builder name(Optional name) { + this.name = name; + return this; + } + + public Builder name(String name) { + this.name = Optional.ofNullable(name); + return this; + } + + /** + *

Postal or ZIP code.

+ */ + @JsonSetter(value = "postal_code", nulls = Nulls.SKIP) + public Builder postalCode(Optional postalCode) { + this.postalCode = postalCode; + return this; + } + + public Builder postalCode(String postalCode) { + this.postalCode = Optional.ofNullable(postalCode); + return this; + } + + /** + *

State, province, or region code, such as CA.

+ */ + @JsonSetter(value = "state", nulls = Nulls.SKIP) + public Builder state(Optional state) { + this.state = state; + return this; + } + + public Builder state(String state) { + this.state = Optional.ofNullable(state); + return this; + } + + public CheckoutSessionShippingAddress build() { + return new CheckoutSessionShippingAddress( + city, country, line1, line2, name, postalCode, state, additionalProperties); + } + + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionStatus.java b/src/main/java/com/whop/api/types/CheckoutSessionStatus.java new file mode 100644 index 00000000..f2fc603f --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionStatus.java @@ -0,0 +1,94 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionStatus { + public static final CheckoutSessionStatus COMPLETED = new CheckoutSessionStatus(Value.COMPLETED, "completed"); + + public static final CheckoutSessionStatus EXPIRED = new CheckoutSessionStatus(Value.EXPIRED, "expired"); + + public static final CheckoutSessionStatus OPEN = new CheckoutSessionStatus(Value.OPEN, "open"); + + private final Value value; + + private final String string; + + CheckoutSessionStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionStatus + && this.string.equals(((CheckoutSessionStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case COMPLETED: + return visitor.visitCompleted(); + case EXPIRED: + return visitor.visitExpired(); + case OPEN: + return visitor.visitOpen(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionStatus valueOf(String value) { + switch (value) { + case "completed": + return COMPLETED; + case "expired": + return EXPIRED; + case "open": + return OPEN; + default: + return new CheckoutSessionStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + OPEN, + + COMPLETED, + + EXPIRED, + + UNKNOWN + } + + public interface Visitor { + T visitOpen(); + + T visitCompleted(); + + T visitExpired(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionTaxBehavior.java b/src/main/java/com/whop/api/types/CheckoutSessionTaxBehavior.java new file mode 100644 index 00000000..86109e50 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionTaxBehavior.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionTaxBehavior { + public static final CheckoutSessionTaxBehavior EXCLUSIVE = + new CheckoutSessionTaxBehavior(Value.EXCLUSIVE, "exclusive"); + + public static final CheckoutSessionTaxBehavior INCLUSIVE = + new CheckoutSessionTaxBehavior(Value.INCLUSIVE, "inclusive"); + + private final Value value; + + private final String string; + + CheckoutSessionTaxBehavior(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionTaxBehavior + && this.string.equals(((CheckoutSessionTaxBehavior) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case EXCLUSIVE: + return visitor.visitExclusive(); + case INCLUSIVE: + return visitor.visitInclusive(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionTaxBehavior valueOf(String value) { + switch (value) { + case "exclusive": + return EXCLUSIVE; + case "inclusive": + return INCLUSIVE; + default: + return new CheckoutSessionTaxBehavior(Value.UNKNOWN, value); + } + } + + public enum Value { + INCLUSIVE, + + EXCLUSIVE, + + UNKNOWN + } + + public interface Visitor { + T visitInclusive(); + + T visitExclusive(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionTaxId.java b/src/main/java/com/whop/api/types/CheckoutSessionTaxId.java new file mode 100644 index 00000000..5a19b211 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionTaxId.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionTaxId.Builder.class) +public final class CheckoutSessionTaxId { + private final CheckoutSessionTaxIdType type; + + private final String value; + + private final Map additionalProperties; + + private CheckoutSessionTaxId( + CheckoutSessionTaxIdType type, String value, Map additionalProperties) { + this.type = type; + this.value = value; + this.additionalProperties = additionalProperties; + } + + /** + * @return The registration's type, such as eu_vat. + */ + @JsonProperty("type") + public CheckoutSessionTaxIdType getType() { + return type; + } + + /** + * @return The registration number, stored as the buyer entered it (whitespace removed). + */ + @JsonProperty("value") + public String getValue() { + return value; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionTaxId && equalTo((CheckoutSessionTaxId) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionTaxId other) { + return type.equals(other.type) && value.equals(other.value); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.type, this.value); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static TypeStage builder() { + return new Builder(); + } + + public interface TypeStage { + /** + *

The registration's type, such as eu_vat.

+ */ + ValueStage type(@NotNull CheckoutSessionTaxIdType type); + + Builder from(CheckoutSessionTaxId other); + } + + public interface ValueStage { + /** + *

The registration number, stored as the buyer entered it (whitespace removed).

+ */ + _FinalStage value(@NotNull String value); + } + + public interface _FinalStage { + CheckoutSessionTaxId build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements TypeStage, ValueStage, _FinalStage { + private CheckoutSessionTaxIdType type; + + private String value; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionTaxId other) { + type(other.getType()); + value(other.getValue()); + return this; + } + + /** + *

The registration's type, such as eu_vat.

+ *

The registration's type, such as eu_vat.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("type") + public ValueStage type(@NotNull CheckoutSessionTaxIdType type) { + this.type = Objects.requireNonNull(type, "type must not be null"); + return this; + } + + /** + *

The registration number, stored as the buyer entered it (whitespace removed).

+ *

The registration number, stored as the buyer entered it (whitespace removed).

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("value") + public _FinalStage value(@NotNull String value) { + this.value = Objects.requireNonNull(value, "value must not be null"); + return this; + } + + @java.lang.Override + public CheckoutSessionTaxId build() { + return new CheckoutSessionTaxId(type, value, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionTaxIdType.java b/src/main/java/com/whop/api/types/CheckoutSessionTaxIdType.java new file mode 100644 index 00000000..3383bd13 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionTaxIdType.java @@ -0,0 +1,1196 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionTaxIdType { + public static final CheckoutSessionTaxIdType TW_VAT = new CheckoutSessionTaxIdType(Value.TW_VAT, "tw_vat"); + + public static final CheckoutSessionTaxIdType VE_RIF = new CheckoutSessionTaxIdType(Value.VE_RIF, "ve_rif"); + + public static final CheckoutSessionTaxIdType KR_BRN = new CheckoutSessionTaxIdType(Value.KR_BRN, "kr_brn"); + + public static final CheckoutSessionTaxIdType SN_NINEA = new CheckoutSessionTaxIdType(Value.SN_NINEA, "sn_ninea"); + + public static final CheckoutSessionTaxIdType AU_ABN = new CheckoutSessionTaxIdType(Value.AU_ABN, "au_abn"); + + public static final CheckoutSessionTaxIdType MY_SST = new CheckoutSessionTaxIdType(Value.MY_SST, "my_sst"); + + public static final CheckoutSessionTaxIdType EU_VAT = new CheckoutSessionTaxIdType(Value.EU_VAT, "eu_vat"); + + public static final CheckoutSessionTaxIdType IN_GST = new CheckoutSessionTaxIdType(Value.IN_GST, "in_gst"); + + public static final CheckoutSessionTaxIdType CA_QST = new CheckoutSessionTaxIdType(Value.CA_QST, "ca_qst"); + + public static final CheckoutSessionTaxIdType MA_VAT = new CheckoutSessionTaxIdType(Value.MA_VAT, "ma_vat"); + + public static final CheckoutSessionTaxIdType MK_VAT = new CheckoutSessionTaxIdType(Value.MK_VAT, "mk_vat"); + + public static final CheckoutSessionTaxIdType UA_VAT = new CheckoutSessionTaxIdType(Value.UA_VAT, "ua_vat"); + + public static final CheckoutSessionTaxIdType CN_TIN = new CheckoutSessionTaxIdType(Value.CN_TIN, "cn_tin"); + + public static final CheckoutSessionTaxIdType MX_RFC = new CheckoutSessionTaxIdType(Value.MX_RFC, "mx_rfc"); + + public static final CheckoutSessionTaxIdType BY_TIN = new CheckoutSessionTaxIdType(Value.BY_TIN, "by_tin"); + + public static final CheckoutSessionTaxIdType CA_PST_BC = new CheckoutSessionTaxIdType(Value.CA_PST_BC, "ca_pst_bc"); + + public static final CheckoutSessionTaxIdType ID_NPWP = new CheckoutSessionTaxIdType(Value.ID_NPWP, "id_npwp"); + + public static final CheckoutSessionTaxIdType PH_TIN = new CheckoutSessionTaxIdType(Value.PH_TIN, "ph_tin"); + + public static final CheckoutSessionTaxIdType AE_TRN = new CheckoutSessionTaxIdType(Value.AE_TRN, "ae_trn"); + + public static final CheckoutSessionTaxIdType EC_RUC = new CheckoutSessionTaxIdType(Value.EC_RUC, "ec_ruc"); + + public static final CheckoutSessionTaxIdType XI_VAT = new CheckoutSessionTaxIdType(Value.XI_VAT, "xi_vat"); + + public static final CheckoutSessionTaxIdType DE_STN = new CheckoutSessionTaxIdType(Value.DE_STN, "de_stn"); + + public static final CheckoutSessionTaxIdType US_EIN = new CheckoutSessionTaxIdType(Value.US_EIN, "us_ein"); + + public static final CheckoutSessionTaxIdType CM_NIU = new CheckoutSessionTaxIdType(Value.CM_NIU, "cm_niu"); + + public static final CheckoutSessionTaxIdType ET_TIN = new CheckoutSessionTaxIdType(Value.ET_TIN, "et_tin"); + + public static final CheckoutSessionTaxIdType IS_VAT = new CheckoutSessionTaxIdType(Value.IS_VAT, "is_vat"); + + public static final CheckoutSessionTaxIdType MY_FRP = new CheckoutSessionTaxIdType(Value.MY_FRP, "my_frp"); + + public static final CheckoutSessionTaxIdType SG_UEN = new CheckoutSessionTaxIdType(Value.SG_UEN, "sg_uen"); + + public static final CheckoutSessionTaxIdType HU_TIN = new CheckoutSessionTaxIdType(Value.HU_TIN, "hu_tin"); + + public static final CheckoutSessionTaxIdType CO_NIT = new CheckoutSessionTaxIdType(Value.CO_NIT, "co_nit"); + + public static final CheckoutSessionTaxIdType JP_CN = new CheckoutSessionTaxIdType(Value.JP_CN, "jp_cn"); + + public static final CheckoutSessionTaxIdType MY_ITN = new CheckoutSessionTaxIdType(Value.MY_ITN, "my_itn"); + + public static final CheckoutSessionTaxIdType RU_KPP = new CheckoutSessionTaxIdType(Value.RU_KPP, "ru_kpp"); + + public static final CheckoutSessionTaxIdType KE_PIN = new CheckoutSessionTaxIdType(Value.KE_PIN, "ke_pin"); + + public static final CheckoutSessionTaxIdType AR_CUIT = new CheckoutSessionTaxIdType(Value.AR_CUIT, "ar_cuit"); + + public static final CheckoutSessionTaxIdType PE_RUC = new CheckoutSessionTaxIdType(Value.PE_RUC, "pe_ruc"); + + public static final CheckoutSessionTaxIdType CA_PST_MB = new CheckoutSessionTaxIdType(Value.CA_PST_MB, "ca_pst_mb"); + + public static final CheckoutSessionTaxIdType AM_TIN = new CheckoutSessionTaxIdType(Value.AM_TIN, "am_tin"); + + public static final CheckoutSessionTaxIdType DO_RCN = new CheckoutSessionTaxIdType(Value.DO_RCN, "do_rcn"); + + public static final CheckoutSessionTaxIdType BB_TIN = new CheckoutSessionTaxIdType(Value.BB_TIN, "bb_tin"); + + public static final CheckoutSessionTaxIdType JP_TRN = new CheckoutSessionTaxIdType(Value.JP_TRN, "jp_trn"); + + public static final CheckoutSessionTaxIdType HK_BR = new CheckoutSessionTaxIdType(Value.HK_BR, "hk_br"); + + public static final CheckoutSessionTaxIdType UZ_TIN = new CheckoutSessionTaxIdType(Value.UZ_TIN, "uz_tin"); + + public static final CheckoutSessionTaxIdType ME_PIB = new CheckoutSessionTaxIdType(Value.ME_PIB, "me_pib"); + + public static final CheckoutSessionTaxIdType BS_TIN = new CheckoutSessionTaxIdType(Value.BS_TIN, "bs_tin"); + + public static final CheckoutSessionTaxIdType GN_NIF = new CheckoutSessionTaxIdType(Value.GN_NIF, "gn_nif"); + + public static final CheckoutSessionTaxIdType KH_TIN = new CheckoutSessionTaxIdType(Value.KH_TIN, "kh_tin"); + + public static final CheckoutSessionTaxIdType CD_NIF = new CheckoutSessionTaxIdType(Value.CD_NIF, "cd_nif"); + + public static final CheckoutSessionTaxIdType NZ_GST = new CheckoutSessionTaxIdType(Value.NZ_GST, "nz_gst"); + + public static final CheckoutSessionTaxIdType TH_VAT = new CheckoutSessionTaxIdType(Value.TH_VAT, "th_vat"); + + public static final CheckoutSessionTaxIdType JP_RN = new CheckoutSessionTaxIdType(Value.JP_RN, "jp_rn"); + + public static final CheckoutSessionTaxIdType RU_INN = new CheckoutSessionTaxIdType(Value.RU_INN, "ru_inn"); + + public static final CheckoutSessionTaxIdType SG_GST = new CheckoutSessionTaxIdType(Value.SG_GST, "sg_gst"); + + public static final CheckoutSessionTaxIdType NO_VAT = new CheckoutSessionTaxIdType(Value.NO_VAT, "no_vat"); + + public static final CheckoutSessionTaxIdType BA_TIN = new CheckoutSessionTaxIdType(Value.BA_TIN, "ba_tin"); + + public static final CheckoutSessionTaxIdType KZ_BIN = new CheckoutSessionTaxIdType(Value.KZ_BIN, "kz_bin"); + + public static final CheckoutSessionTaxIdType AL_TIN = new CheckoutSessionTaxIdType(Value.AL_TIN, "al_tin"); + + public static final CheckoutSessionTaxIdType EG_TIN = new CheckoutSessionTaxIdType(Value.EG_TIN, "eg_tin"); + + public static final CheckoutSessionTaxIdType NP_PAN = new CheckoutSessionTaxIdType(Value.NP_PAN, "np_pan"); + + public static final CheckoutSessionTaxIdType CH_VAT = new CheckoutSessionTaxIdType(Value.CH_VAT, "ch_vat"); + + public static final CheckoutSessionTaxIdType NO_VOEC = new CheckoutSessionTaxIdType(Value.NO_VOEC, "no_voec"); + + public static final CheckoutSessionTaxIdType UZ_VAT = new CheckoutSessionTaxIdType(Value.UZ_VAT, "uz_vat"); + + public static final CheckoutSessionTaxIdType SR_FIN = new CheckoutSessionTaxIdType(Value.SR_FIN, "sr_fin"); + + public static final CheckoutSessionTaxIdType BG_UIC = new CheckoutSessionTaxIdType(Value.BG_UIC, "bg_uic"); + + public static final CheckoutSessionTaxIdType AU_ARN = new CheckoutSessionTaxIdType(Value.AU_ARN, "au_arn"); + + public static final CheckoutSessionTaxIdType BR_CNPJ = new CheckoutSessionTaxIdType(Value.BR_CNPJ, "br_cnpj"); + + public static final CheckoutSessionTaxIdType UG_TIN = new CheckoutSessionTaxIdType(Value.UG_TIN, "ug_tin"); + + public static final CheckoutSessionTaxIdType CA_PST_SK = new CheckoutSessionTaxIdType(Value.CA_PST_SK, "ca_pst_sk"); + + public static final CheckoutSessionTaxIdType OM_VAT = new CheckoutSessionTaxIdType(Value.OM_VAT, "om_vat"); + + public static final CheckoutSessionTaxIdType BR_CPF = new CheckoutSessionTaxIdType(Value.BR_CPF, "br_cpf"); + + public static final CheckoutSessionTaxIdType MR_NIF = new CheckoutSessionTaxIdType(Value.MR_NIF, "mr_nif"); + + public static final CheckoutSessionTaxIdType TR_TIN = new CheckoutSessionTaxIdType(Value.TR_TIN, "tr_tin"); + + public static final CheckoutSessionTaxIdType BJ_IFU = new CheckoutSessionTaxIdType(Value.BJ_IFU, "bj_ifu"); + + public static final CheckoutSessionTaxIdType ZW_TIN = new CheckoutSessionTaxIdType(Value.ZW_TIN, "zw_tin"); + + public static final CheckoutSessionTaxIdType LI_VAT = new CheckoutSessionTaxIdType(Value.LI_VAT, "li_vat"); + + public static final CheckoutSessionTaxIdType ZM_TIN = new CheckoutSessionTaxIdType(Value.ZM_TIN, "zm_tin"); + + public static final CheckoutSessionTaxIdType SI_TIN = new CheckoutSessionTaxIdType(Value.SI_TIN, "si_tin"); + + public static final CheckoutSessionTaxIdType CV_NIF = new CheckoutSessionTaxIdType(Value.CV_NIF, "cv_nif"); + + public static final CheckoutSessionTaxIdType LI_UID = new CheckoutSessionTaxIdType(Value.LI_UID, "li_uid"); + + public static final CheckoutSessionTaxIdType RS_PIB = new CheckoutSessionTaxIdType(Value.RS_PIB, "rs_pib"); + + public static final CheckoutSessionTaxIdType IL_VAT = new CheckoutSessionTaxIdType(Value.IL_VAT, "il_vat"); + + public static final CheckoutSessionTaxIdType TZ_VAT = new CheckoutSessionTaxIdType(Value.TZ_VAT, "tz_vat"); + + public static final CheckoutSessionTaxIdType BH_VAT = new CheckoutSessionTaxIdType(Value.BH_VAT, "bh_vat"); + + public static final CheckoutSessionTaxIdType HR_OIB = new CheckoutSessionTaxIdType(Value.HR_OIB, "hr_oib"); + + public static final CheckoutSessionTaxIdType NG_TIN = new CheckoutSessionTaxIdType(Value.NG_TIN, "ng_tin"); + + public static final CheckoutSessionTaxIdType ZA_VAT = new CheckoutSessionTaxIdType(Value.ZA_VAT, "za_vat"); + + public static final CheckoutSessionTaxIdType AO_TIN = new CheckoutSessionTaxIdType(Value.AO_TIN, "ao_tin"); + + public static final CheckoutSessionTaxIdType MD_VAT = new CheckoutSessionTaxIdType(Value.MD_VAT, "md_vat"); + + public static final CheckoutSessionTaxIdType UY_RUC = new CheckoutSessionTaxIdType(Value.UY_RUC, "uy_ruc"); + + public static final CheckoutSessionTaxIdType AD_NRT = new CheckoutSessionTaxIdType(Value.AD_NRT, "ad_nrt"); + + public static final CheckoutSessionTaxIdType BF_IFU = new CheckoutSessionTaxIdType(Value.BF_IFU, "bf_ifu"); + + public static final CheckoutSessionTaxIdType VN_TIN = new CheckoutSessionTaxIdType(Value.VN_TIN, "vn_tin"); + + public static final CheckoutSessionTaxIdType CL_TIN = new CheckoutSessionTaxIdType(Value.CL_TIN, "cl_tin"); + + public static final CheckoutSessionTaxIdType LA_TIN = new CheckoutSessionTaxIdType(Value.LA_TIN, "la_tin"); + + public static final CheckoutSessionTaxIdType KG_TIN = new CheckoutSessionTaxIdType(Value.KG_TIN, "kg_tin"); + + public static final CheckoutSessionTaxIdType CA_BN = new CheckoutSessionTaxIdType(Value.CA_BN, "ca_bn"); + + public static final CheckoutSessionTaxIdType SA_VAT = new CheckoutSessionTaxIdType(Value.SA_VAT, "sa_vat"); + + public static final CheckoutSessionTaxIdType EU_OSS_VAT = + new CheckoutSessionTaxIdType(Value.EU_OSS_VAT, "eu_oss_vat"); + + public static final CheckoutSessionTaxIdType BD_BIN = new CheckoutSessionTaxIdType(Value.BD_BIN, "bd_bin"); + + public static final CheckoutSessionTaxIdType SV_NIT = new CheckoutSessionTaxIdType(Value.SV_NIT, "sv_nit"); + + public static final CheckoutSessionTaxIdType BO_TIN = new CheckoutSessionTaxIdType(Value.BO_TIN, "bo_tin"); + + public static final CheckoutSessionTaxIdType GE_VAT = new CheckoutSessionTaxIdType(Value.GE_VAT, "ge_vat"); + + public static final CheckoutSessionTaxIdType AZ_TIN = new CheckoutSessionTaxIdType(Value.AZ_TIN, "az_tin"); + + public static final CheckoutSessionTaxIdType CH_UID = new CheckoutSessionTaxIdType(Value.CH_UID, "ch_uid"); + + public static final CheckoutSessionTaxIdType RO_TIN = new CheckoutSessionTaxIdType(Value.RO_TIN, "ro_tin"); + + public static final CheckoutSessionTaxIdType TJ_TIN = new CheckoutSessionTaxIdType(Value.TJ_TIN, "tj_tin"); + + public static final CheckoutSessionTaxIdType AW_TIN = new CheckoutSessionTaxIdType(Value.AW_TIN, "aw_tin"); + + public static final CheckoutSessionTaxIdType CR_TIN = new CheckoutSessionTaxIdType(Value.CR_TIN, "cr_tin"); + + public static final CheckoutSessionTaxIdType GB_VAT = new CheckoutSessionTaxIdType(Value.GB_VAT, "gb_vat"); + + public static final CheckoutSessionTaxIdType ES_CIF = new CheckoutSessionTaxIdType(Value.ES_CIF, "es_cif"); + + public static final CheckoutSessionTaxIdType PL_NIP = new CheckoutSessionTaxIdType(Value.PL_NIP, "pl_nip"); + + public static final CheckoutSessionTaxIdType GH_TIN = new CheckoutSessionTaxIdType(Value.GH_TIN, "gh_tin"); + + public static final CheckoutSessionTaxIdType CA_GST_HST = + new CheckoutSessionTaxIdType(Value.CA_GST_HST, "ca_gst_hst"); + + private final Value value; + + private final String string; + + CheckoutSessionTaxIdType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionTaxIdType + && this.string.equals(((CheckoutSessionTaxIdType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case TW_VAT: + return visitor.visitTwVat(); + case VE_RIF: + return visitor.visitVeRif(); + case KR_BRN: + return visitor.visitKrBrn(); + case SN_NINEA: + return visitor.visitSnNinea(); + case AU_ABN: + return visitor.visitAuAbn(); + case MY_SST: + return visitor.visitMySst(); + case EU_VAT: + return visitor.visitEuVat(); + case IN_GST: + return visitor.visitInGst(); + case CA_QST: + return visitor.visitCaQst(); + case MA_VAT: + return visitor.visitMaVat(); + case MK_VAT: + return visitor.visitMkVat(); + case UA_VAT: + return visitor.visitUaVat(); + case CN_TIN: + return visitor.visitCnTin(); + case MX_RFC: + return visitor.visitMxRfc(); + case BY_TIN: + return visitor.visitByTin(); + case CA_PST_BC: + return visitor.visitCaPstBc(); + case ID_NPWP: + return visitor.visitIdNpwp(); + case PH_TIN: + return visitor.visitPhTin(); + case AE_TRN: + return visitor.visitAeTrn(); + case EC_RUC: + return visitor.visitEcRuc(); + case XI_VAT: + return visitor.visitXiVat(); + case DE_STN: + return visitor.visitDeStn(); + case US_EIN: + return visitor.visitUsEin(); + case CM_NIU: + return visitor.visitCmNiu(); + case ET_TIN: + return visitor.visitEtTin(); + case IS_VAT: + return visitor.visitIsVat(); + case MY_FRP: + return visitor.visitMyFrp(); + case SG_UEN: + return visitor.visitSgUen(); + case HU_TIN: + return visitor.visitHuTin(); + case CO_NIT: + return visitor.visitCoNit(); + case JP_CN: + return visitor.visitJpCn(); + case MY_ITN: + return visitor.visitMyItn(); + case RU_KPP: + return visitor.visitRuKpp(); + case KE_PIN: + return visitor.visitKePin(); + case AR_CUIT: + return visitor.visitArCuit(); + case PE_RUC: + return visitor.visitPeRuc(); + case CA_PST_MB: + return visitor.visitCaPstMb(); + case AM_TIN: + return visitor.visitAmTin(); + case DO_RCN: + return visitor.visitDoRcn(); + case BB_TIN: + return visitor.visitBbTin(); + case JP_TRN: + return visitor.visitJpTrn(); + case HK_BR: + return visitor.visitHkBr(); + case UZ_TIN: + return visitor.visitUzTin(); + case ME_PIB: + return visitor.visitMePib(); + case BS_TIN: + return visitor.visitBsTin(); + case GN_NIF: + return visitor.visitGnNif(); + case KH_TIN: + return visitor.visitKhTin(); + case CD_NIF: + return visitor.visitCdNif(); + case NZ_GST: + return visitor.visitNzGst(); + case TH_VAT: + return visitor.visitThVat(); + case JP_RN: + return visitor.visitJpRn(); + case RU_INN: + return visitor.visitRuInn(); + case SG_GST: + return visitor.visitSgGst(); + case NO_VAT: + return visitor.visitNoVat(); + case BA_TIN: + return visitor.visitBaTin(); + case KZ_BIN: + return visitor.visitKzBin(); + case AL_TIN: + return visitor.visitAlTin(); + case EG_TIN: + return visitor.visitEgTin(); + case NP_PAN: + return visitor.visitNpPan(); + case CH_VAT: + return visitor.visitChVat(); + case NO_VOEC: + return visitor.visitNoVoec(); + case UZ_VAT: + return visitor.visitUzVat(); + case SR_FIN: + return visitor.visitSrFin(); + case BG_UIC: + return visitor.visitBgUic(); + case AU_ARN: + return visitor.visitAuArn(); + case BR_CNPJ: + return visitor.visitBrCnpj(); + case UG_TIN: + return visitor.visitUgTin(); + case CA_PST_SK: + return visitor.visitCaPstSk(); + case OM_VAT: + return visitor.visitOmVat(); + case BR_CPF: + return visitor.visitBrCpf(); + case MR_NIF: + return visitor.visitMrNif(); + case TR_TIN: + return visitor.visitTrTin(); + case BJ_IFU: + return visitor.visitBjIfu(); + case ZW_TIN: + return visitor.visitZwTin(); + case LI_VAT: + return visitor.visitLiVat(); + case ZM_TIN: + return visitor.visitZmTin(); + case SI_TIN: + return visitor.visitSiTin(); + case CV_NIF: + return visitor.visitCvNif(); + case LI_UID: + return visitor.visitLiUid(); + case RS_PIB: + return visitor.visitRsPib(); + case IL_VAT: + return visitor.visitIlVat(); + case TZ_VAT: + return visitor.visitTzVat(); + case BH_VAT: + return visitor.visitBhVat(); + case HR_OIB: + return visitor.visitHrOib(); + case NG_TIN: + return visitor.visitNgTin(); + case ZA_VAT: + return visitor.visitZaVat(); + case AO_TIN: + return visitor.visitAoTin(); + case MD_VAT: + return visitor.visitMdVat(); + case UY_RUC: + return visitor.visitUyRuc(); + case AD_NRT: + return visitor.visitAdNrt(); + case BF_IFU: + return visitor.visitBfIfu(); + case VN_TIN: + return visitor.visitVnTin(); + case CL_TIN: + return visitor.visitClTin(); + case LA_TIN: + return visitor.visitLaTin(); + case KG_TIN: + return visitor.visitKgTin(); + case CA_BN: + return visitor.visitCaBn(); + case SA_VAT: + return visitor.visitSaVat(); + case EU_OSS_VAT: + return visitor.visitEuOssVat(); + case BD_BIN: + return visitor.visitBdBin(); + case SV_NIT: + return visitor.visitSvNit(); + case BO_TIN: + return visitor.visitBoTin(); + case GE_VAT: + return visitor.visitGeVat(); + case AZ_TIN: + return visitor.visitAzTin(); + case CH_UID: + return visitor.visitChUid(); + case RO_TIN: + return visitor.visitRoTin(); + case TJ_TIN: + return visitor.visitTjTin(); + case AW_TIN: + return visitor.visitAwTin(); + case CR_TIN: + return visitor.visitCrTin(); + case GB_VAT: + return visitor.visitGbVat(); + case ES_CIF: + return visitor.visitEsCif(); + case PL_NIP: + return visitor.visitPlNip(); + case GH_TIN: + return visitor.visitGhTin(); + case CA_GST_HST: + return visitor.visitCaGstHst(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionTaxIdType valueOf(String value) { + switch (value) { + case "tw_vat": + return TW_VAT; + case "ve_rif": + return VE_RIF; + case "kr_brn": + return KR_BRN; + case "sn_ninea": + return SN_NINEA; + case "au_abn": + return AU_ABN; + case "my_sst": + return MY_SST; + case "eu_vat": + return EU_VAT; + case "in_gst": + return IN_GST; + case "ca_qst": + return CA_QST; + case "ma_vat": + return MA_VAT; + case "mk_vat": + return MK_VAT; + case "ua_vat": + return UA_VAT; + case "cn_tin": + return CN_TIN; + case "mx_rfc": + return MX_RFC; + case "by_tin": + return BY_TIN; + case "ca_pst_bc": + return CA_PST_BC; + case "id_npwp": + return ID_NPWP; + case "ph_tin": + return PH_TIN; + case "ae_trn": + return AE_TRN; + case "ec_ruc": + return EC_RUC; + case "xi_vat": + return XI_VAT; + case "de_stn": + return DE_STN; + case "us_ein": + return US_EIN; + case "cm_niu": + return CM_NIU; + case "et_tin": + return ET_TIN; + case "is_vat": + return IS_VAT; + case "my_frp": + return MY_FRP; + case "sg_uen": + return SG_UEN; + case "hu_tin": + return HU_TIN; + case "co_nit": + return CO_NIT; + case "jp_cn": + return JP_CN; + case "my_itn": + return MY_ITN; + case "ru_kpp": + return RU_KPP; + case "ke_pin": + return KE_PIN; + case "ar_cuit": + return AR_CUIT; + case "pe_ruc": + return PE_RUC; + case "ca_pst_mb": + return CA_PST_MB; + case "am_tin": + return AM_TIN; + case "do_rcn": + return DO_RCN; + case "bb_tin": + return BB_TIN; + case "jp_trn": + return JP_TRN; + case "hk_br": + return HK_BR; + case "uz_tin": + return UZ_TIN; + case "me_pib": + return ME_PIB; + case "bs_tin": + return BS_TIN; + case "gn_nif": + return GN_NIF; + case "kh_tin": + return KH_TIN; + case "cd_nif": + return CD_NIF; + case "nz_gst": + return NZ_GST; + case "th_vat": + return TH_VAT; + case "jp_rn": + return JP_RN; + case "ru_inn": + return RU_INN; + case "sg_gst": + return SG_GST; + case "no_vat": + return NO_VAT; + case "ba_tin": + return BA_TIN; + case "kz_bin": + return KZ_BIN; + case "al_tin": + return AL_TIN; + case "eg_tin": + return EG_TIN; + case "np_pan": + return NP_PAN; + case "ch_vat": + return CH_VAT; + case "no_voec": + return NO_VOEC; + case "uz_vat": + return UZ_VAT; + case "sr_fin": + return SR_FIN; + case "bg_uic": + return BG_UIC; + case "au_arn": + return AU_ARN; + case "br_cnpj": + return BR_CNPJ; + case "ug_tin": + return UG_TIN; + case "ca_pst_sk": + return CA_PST_SK; + case "om_vat": + return OM_VAT; + case "br_cpf": + return BR_CPF; + case "mr_nif": + return MR_NIF; + case "tr_tin": + return TR_TIN; + case "bj_ifu": + return BJ_IFU; + case "zw_tin": + return ZW_TIN; + case "li_vat": + return LI_VAT; + case "zm_tin": + return ZM_TIN; + case "si_tin": + return SI_TIN; + case "cv_nif": + return CV_NIF; + case "li_uid": + return LI_UID; + case "rs_pib": + return RS_PIB; + case "il_vat": + return IL_VAT; + case "tz_vat": + return TZ_VAT; + case "bh_vat": + return BH_VAT; + case "hr_oib": + return HR_OIB; + case "ng_tin": + return NG_TIN; + case "za_vat": + return ZA_VAT; + case "ao_tin": + return AO_TIN; + case "md_vat": + return MD_VAT; + case "uy_ruc": + return UY_RUC; + case "ad_nrt": + return AD_NRT; + case "bf_ifu": + return BF_IFU; + case "vn_tin": + return VN_TIN; + case "cl_tin": + return CL_TIN; + case "la_tin": + return LA_TIN; + case "kg_tin": + return KG_TIN; + case "ca_bn": + return CA_BN; + case "sa_vat": + return SA_VAT; + case "eu_oss_vat": + return EU_OSS_VAT; + case "bd_bin": + return BD_BIN; + case "sv_nit": + return SV_NIT; + case "bo_tin": + return BO_TIN; + case "ge_vat": + return GE_VAT; + case "az_tin": + return AZ_TIN; + case "ch_uid": + return CH_UID; + case "ro_tin": + return RO_TIN; + case "tj_tin": + return TJ_TIN; + case "aw_tin": + return AW_TIN; + case "cr_tin": + return CR_TIN; + case "gb_vat": + return GB_VAT; + case "es_cif": + return ES_CIF; + case "pl_nip": + return PL_NIP; + case "gh_tin": + return GH_TIN; + case "ca_gst_hst": + return CA_GST_HST; + default: + return new CheckoutSessionTaxIdType(Value.UNKNOWN, value); + } + } + + public enum Value { + AD_NRT, + + AO_TIN, + + AR_CUIT, + + AL_TIN, + + AM_TIN, + + AW_TIN, + + AU_ABN, + + AU_ARN, + + EU_VAT, + + AZ_TIN, + + BS_TIN, + + BH_VAT, + + BD_BIN, + + BB_TIN, + + BY_TIN, + + BJ_IFU, + + BO_TIN, + + BA_TIN, + + BR_CNPJ, + + BR_CPF, + + BG_UIC, + + BF_IFU, + + KH_TIN, + + CM_NIU, + + CA_BN, + + CA_GST_HST, + + CA_PST_BC, + + CA_PST_MB, + + CA_PST_SK, + + CA_QST, + + CV_NIF, + + CL_TIN, + + CN_TIN, + + CO_NIT, + + CD_NIF, + + CR_TIN, + + HR_OIB, + + DO_RCN, + + EC_RUC, + + EG_TIN, + + SV_NIT, + + ET_TIN, + + EU_OSS_VAT, + + GE_VAT, + + GH_TIN, + + DE_STN, + + GB_VAT, + + GN_NIF, + + HK_BR, + + HU_TIN, + + IS_VAT, + + IN_GST, + + ID_NPWP, + + IL_VAT, + + JP_CN, + + JP_RN, + + JP_TRN, + + KZ_BIN, + + KE_PIN, + + KG_TIN, + + LA_TIN, + + LI_UID, + + LI_VAT, + + MY_FRP, + + MY_ITN, + + MY_SST, + + MR_NIF, + + MX_RFC, + + MD_VAT, + + ME_PIB, + + MA_VAT, + + NP_PAN, + + NZ_GST, + + NG_TIN, + + MK_VAT, + + NO_VAT, + + NO_VOEC, + + OM_VAT, + + PE_RUC, + + PH_TIN, + + PL_NIP, + + RO_TIN, + + RU_INN, + + RU_KPP, + + SA_VAT, + + SN_NINEA, + + RS_PIB, + + SG_GST, + + SG_UEN, + + SI_TIN, + + ZA_VAT, + + KR_BRN, + + ES_CIF, + + CH_UID, + + CH_VAT, + + TW_VAT, + + TJ_TIN, + + TZ_VAT, + + TH_VAT, + + TR_TIN, + + UG_TIN, + + UA_VAT, + + AE_TRN, + + US_EIN, + + UY_RUC, + + UZ_TIN, + + UZ_VAT, + + VE_RIF, + + VN_TIN, + + ZM_TIN, + + ZW_TIN, + + SR_FIN, + + XI_VAT, + + UNKNOWN + } + + public interface Visitor { + T visitAdNrt(); + + T visitAoTin(); + + T visitArCuit(); + + T visitAlTin(); + + T visitAmTin(); + + T visitAwTin(); + + T visitAuAbn(); + + T visitAuArn(); + + T visitEuVat(); + + T visitAzTin(); + + T visitBsTin(); + + T visitBhVat(); + + T visitBdBin(); + + T visitBbTin(); + + T visitByTin(); + + T visitBjIfu(); + + T visitBoTin(); + + T visitBaTin(); + + T visitBrCnpj(); + + T visitBrCpf(); + + T visitBgUic(); + + T visitBfIfu(); + + T visitKhTin(); + + T visitCmNiu(); + + T visitCaBn(); + + T visitCaGstHst(); + + T visitCaPstBc(); + + T visitCaPstMb(); + + T visitCaPstSk(); + + T visitCaQst(); + + T visitCvNif(); + + T visitClTin(); + + T visitCnTin(); + + T visitCoNit(); + + T visitCdNif(); + + T visitCrTin(); + + T visitHrOib(); + + T visitDoRcn(); + + T visitEcRuc(); + + T visitEgTin(); + + T visitSvNit(); + + T visitEtTin(); + + T visitEuOssVat(); + + T visitGeVat(); + + T visitGhTin(); + + T visitDeStn(); + + T visitGbVat(); + + T visitGnNif(); + + T visitHkBr(); + + T visitHuTin(); + + T visitIsVat(); + + T visitInGst(); + + T visitIdNpwp(); + + T visitIlVat(); + + T visitJpCn(); + + T visitJpRn(); + + T visitJpTrn(); + + T visitKzBin(); + + T visitKePin(); + + T visitKgTin(); + + T visitLaTin(); + + T visitLiUid(); + + T visitLiVat(); + + T visitMyFrp(); + + T visitMyItn(); + + T visitMySst(); + + T visitMrNif(); + + T visitMxRfc(); + + T visitMdVat(); + + T visitMePib(); + + T visitMaVat(); + + T visitNpPan(); + + T visitNzGst(); + + T visitNgTin(); + + T visitMkVat(); + + T visitNoVat(); + + T visitNoVoec(); + + T visitOmVat(); + + T visitPeRuc(); + + T visitPhTin(); + + T visitPlNip(); + + T visitRoTin(); + + T visitRuInn(); + + T visitRuKpp(); + + T visitSaVat(); + + T visitSnNinea(); + + T visitRsPib(); + + T visitSgGst(); + + T visitSgUen(); + + T visitSiTin(); + + T visitZaVat(); + + T visitKrBrn(); + + T visitEsCif(); + + T visitChUid(); + + T visitChVat(); + + T visitTwVat(); + + T visitTjTin(); + + T visitTzVat(); + + T visitThVat(); + + T visitTrTin(); + + T visitUgTin(); + + T visitUaVat(); + + T visitAeTrn(); + + T visitUsEin(); + + T visitUyRuc(); + + T visitUzTin(); + + T visitUzVat(); + + T visitVeRif(); + + T visitVnTin(); + + T visitZmTin(); + + T visitZwTin(); + + T visitSrFin(); + + T visitXiVat(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionThreeDsLevel.java b/src/main/java/com/whop/api/types/CheckoutSessionThreeDsLevel.java new file mode 100644 index 00000000..2dd8ccf9 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionThreeDsLevel.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionThreeDsLevel { + public static final CheckoutSessionThreeDsLevel MANDATE_CHALLENGE = + new CheckoutSessionThreeDsLevel(Value.MANDATE_CHALLENGE, "mandate_challenge"); + + public static final CheckoutSessionThreeDsLevel FRICTIONLESS = + new CheckoutSessionThreeDsLevel(Value.FRICTIONLESS, "frictionless"); + + private final Value value; + + private final String string; + + CheckoutSessionThreeDsLevel(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionThreeDsLevel + && this.string.equals(((CheckoutSessionThreeDsLevel) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case MANDATE_CHALLENGE: + return visitor.visitMandateChallenge(); + case FRICTIONLESS: + return visitor.visitFrictionless(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionThreeDsLevel valueOf(String value) { + switch (value) { + case "mandate_challenge": + return MANDATE_CHALLENGE; + case "frictionless": + return FRICTIONLESS; + default: + return new CheckoutSessionThreeDsLevel(Value.UNKNOWN, value); + } + } + + public enum Value { + MANDATE_CHALLENGE, + + FRICTIONLESS, + + UNKNOWN + } + + public interface Visitor { + T visitMandateChallenge(); + + T visitFrictionless(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionTransfer.java b/src/main/java/com/whop/api/types/CheckoutSessionTransfer.java new file mode 100644 index 00000000..d841b130 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionTransfer.java @@ -0,0 +1,276 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionTransfer.Builder.class) +public final class CheckoutSessionTransfer { + private final String code; + + private final Optional originExpiresAt; + + private final Optional originRenewalPeriodEnd; + + private final Map additionalProperties; + + private CheckoutSessionTransfer( + String code, + Optional originExpiresAt, + Optional originRenewalPeriodEnd, + Map additionalProperties) { + this.code = code; + this.originExpiresAt = originExpiresAt; + this.originRenewalPeriodEnd = originRenewalPeriodEnd; + this.additionalProperties = additionalProperties; + } + + /** + * @return The 40-character transfer code this checkout was opened from — the same value the link carried. + */ + @JsonProperty("code") + public String getCode() { + return code; + } + + /** + * @return When the transferred membership's access expires, as an ISO 8601 timestamp, or null when it does not. The recipient inherits this — a transfer moves the remaining time, it does not restart it. + */ + @JsonIgnore + public Optional getOriginExpiresAt() { + if (originExpiresAt == null) { + return Optional.empty(); + } + return originExpiresAt; + } + + /** + * @return When the transferred membership's current billing period ends, as an ISO 8601 timestamp, or null for a non-renewing membership. The recipient's first renewal charge falls here — nothing is charged at the transfer itself. + */ + @JsonIgnore + public Optional getOriginRenewalPeriodEnd() { + if (originRenewalPeriodEnd == null) { + return Optional.empty(); + } + return originRenewalPeriodEnd; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("origin_expires_at") + private Optional _getOriginExpiresAt() { + return originExpiresAt; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("origin_renewal_period_end") + private Optional _getOriginRenewalPeriodEnd() { + return originRenewalPeriodEnd; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionTransfer && equalTo((CheckoutSessionTransfer) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionTransfer other) { + return code.equals(other.code) + && originExpiresAt.equals(other.originExpiresAt) + && originRenewalPeriodEnd.equals(other.originRenewalPeriodEnd); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.code, this.originExpiresAt, this.originRenewalPeriodEnd); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CodeStage builder() { + return new Builder(); + } + + public interface CodeStage { + /** + *

The 40-character transfer code this checkout was opened from — the same value the link carried.

+ */ + _FinalStage code(@NotNull String code); + + Builder from(CheckoutSessionTransfer other); + } + + public interface _FinalStage { + CheckoutSessionTransfer build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

When the transferred membership's access expires, as an ISO 8601 timestamp, or null when it does not. The recipient inherits this — a transfer moves the remaining time, it does not restart it.

+ */ + _FinalStage originExpiresAt(Optional originExpiresAt); + + _FinalStage originExpiresAt(String originExpiresAt); + + _FinalStage originExpiresAt(Nullable originExpiresAt); + + /** + *

When the transferred membership's current billing period ends, as an ISO 8601 timestamp, or null for a non-renewing membership. The recipient's first renewal charge falls here — nothing is charged at the transfer itself.

+ */ + _FinalStage originRenewalPeriodEnd(Optional originRenewalPeriodEnd); + + _FinalStage originRenewalPeriodEnd(String originRenewalPeriodEnd); + + _FinalStage originRenewalPeriodEnd(Nullable originRenewalPeriodEnd); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CodeStage, _FinalStage { + private String code; + + private Optional originRenewalPeriodEnd = Optional.empty(); + + private Optional originExpiresAt = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionTransfer other) { + code(other.getCode()); + originExpiresAt(other.getOriginExpiresAt()); + originRenewalPeriodEnd(other.getOriginRenewalPeriodEnd()); + return this; + } + + /** + *

The 40-character transfer code this checkout was opened from — the same value the link carried.

+ *

The 40-character transfer code this checkout was opened from — the same value the link carried.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("code") + public _FinalStage code(@NotNull String code) { + this.code = Objects.requireNonNull(code, "code must not be null"); + return this; + } + + /** + *

When the transferred membership's current billing period ends, as an ISO 8601 timestamp, or null for a non-renewing membership. The recipient's first renewal charge falls here — nothing is charged at the transfer itself.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage originRenewalPeriodEnd(Nullable originRenewalPeriodEnd) { + if (originRenewalPeriodEnd.isNull()) { + this.originRenewalPeriodEnd = null; + } else if (originRenewalPeriodEnd.isEmpty()) { + this.originRenewalPeriodEnd = Optional.empty(); + } else { + this.originRenewalPeriodEnd = Optional.of(originRenewalPeriodEnd.get()); + } + return this; + } + + /** + *

When the transferred membership's current billing period ends, as an ISO 8601 timestamp, or null for a non-renewing membership. The recipient's first renewal charge falls here — nothing is charged at the transfer itself.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage originRenewalPeriodEnd(String originRenewalPeriodEnd) { + this.originRenewalPeriodEnd = Optional.ofNullable(originRenewalPeriodEnd); + return this; + } + + /** + *

When the transferred membership's current billing period ends, as an ISO 8601 timestamp, or null for a non-renewing membership. The recipient's first renewal charge falls here — nothing is charged at the transfer itself.

+ */ + @java.lang.Override + @JsonSetter(value = "origin_renewal_period_end", nulls = Nulls.SKIP) + public _FinalStage originRenewalPeriodEnd(Optional originRenewalPeriodEnd) { + this.originRenewalPeriodEnd = originRenewalPeriodEnd; + return this; + } + + /** + *

When the transferred membership's access expires, as an ISO 8601 timestamp, or null when it does not. The recipient inherits this — a transfer moves the remaining time, it does not restart it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage originExpiresAt(Nullable originExpiresAt) { + if (originExpiresAt.isNull()) { + this.originExpiresAt = null; + } else if (originExpiresAt.isEmpty()) { + this.originExpiresAt = Optional.empty(); + } else { + this.originExpiresAt = Optional.of(originExpiresAt.get()); + } + return this; + } + + /** + *

When the transferred membership's access expires, as an ISO 8601 timestamp, or null when it does not. The recipient inherits this — a transfer moves the remaining time, it does not restart it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage originExpiresAt(String originExpiresAt) { + this.originExpiresAt = Optional.ofNullable(originExpiresAt); + return this; + } + + /** + *

When the transferred membership's access expires, as an ISO 8601 timestamp, or null when it does not. The recipient inherits this — a transfer moves the remaining time, it does not restart it.

+ */ + @java.lang.Override + @JsonSetter(value = "origin_expires_at", nulls = Nulls.SKIP) + public _FinalStage originExpiresAt(Optional originExpiresAt) { + this.originExpiresAt = originExpiresAt; + return this; + } + + @java.lang.Override + public CheckoutSessionTransfer build() { + return new CheckoutSessionTransfer(code, originExpiresAt, originRenewalPeriodEnd, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionUpgradeAuthenticationAction.java b/src/main/java/com/whop/api/types/CheckoutSessionUpgradeAuthenticationAction.java new file mode 100644 index 00000000..03f33475 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionUpgradeAuthenticationAction.java @@ -0,0 +1,278 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionUpgradeAuthenticationAction.Builder.class) +public final class CheckoutSessionUpgradeAuthenticationAction { + private final boolean blocking; + + private final String email; + + private final Optional sessionIntentId; + + private final CheckoutSessionUpgradeAuthenticationActionSignInIntent signInIntent; + + private final Map additionalProperties; + + private CheckoutSessionUpgradeAuthenticationAction( + boolean blocking, + String email, + Optional sessionIntentId, + CheckoutSessionUpgradeAuthenticationActionSignInIntent signInIntent, + Map additionalProperties) { + this.blocking = blocking; + this.email = email; + this.sessionIntentId = sessionIntentId; + this.signInIntent = signInIntent; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab. + */ + @JsonProperty("blocking") + public boolean getBlocking() { + return blocking; + } + + /** + * @return The address the sign-in starts with — the buyer's own, resolved by this checkout. Pass it to the session-intent create; the one-time code goes to this inbox, and holding that inbox is the entire proof. + */ + @JsonProperty("email") + public String getEmail() { + return email; + } + + /** + * @return The continuation, when this reader can take it: the id (ses_…) of the buyer's own mid-checkout sign-in, named only when the read presented the credential that sign-in's verify installed and the sign-in can still be finished. Skip the create and the verify — the emailed factor is already proven — and call THIS intent's upgrade endpoint naming the checkout session: on a first-party page the same credential authorizes it with no bearer at all, and the login collects only what it still owes (nothing, or the account's second factor). null runs the full recipe; a refused continuation is answered the same way, by falling back to it. + */ + @JsonIgnore + public Optional getSessionIntentId() { + if (sessionIntentId == null) { + return Optional.empty(); + } + return sessionIntentId; + } + + /** + * @return The intent to declare on the session-intent create. Declaring it is what keeps the verification credential checkout-scoped — the full login is minted only by the upgrade call, never by the code alone. + */ + @JsonProperty("sign_in_intent") + public CheckoutSessionUpgradeAuthenticationActionSignInIntent getSignInIntent() { + return signInIntent; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("session_intent_id") + private Optional _getSessionIntentId() { + return sessionIntentId; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionUpgradeAuthenticationAction + && equalTo((CheckoutSessionUpgradeAuthenticationAction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionUpgradeAuthenticationAction other) { + return blocking == other.blocking + && email.equals(other.email) + && sessionIntentId.equals(other.sessionIntentId) + && signInIntent.equals(other.signInIntent); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.blocking, this.email, this.sessionIntentId, this.signInIntent); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BlockingStage builder() { + return new Builder(); + } + + public interface BlockingStage { + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ */ + EmailStage blocking(boolean blocking); + + Builder from(CheckoutSessionUpgradeAuthenticationAction other); + } + + public interface EmailStage { + /** + *

The address the sign-in starts with — the buyer's own, resolved by this checkout. Pass it to the session-intent create; the one-time code goes to this inbox, and holding that inbox is the entire proof.

+ */ + SignInIntentStage email(@NotNull String email); + } + + public interface SignInIntentStage { + /** + *

The intent to declare on the session-intent create. Declaring it is what keeps the verification credential checkout-scoped — the full login is minted only by the upgrade call, never by the code alone.

+ */ + _FinalStage signInIntent(@NotNull CheckoutSessionUpgradeAuthenticationActionSignInIntent signInIntent); + } + + public interface _FinalStage { + CheckoutSessionUpgradeAuthenticationAction build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

The continuation, when this reader can take it: the id (ses_…) of the buyer's own mid-checkout sign-in, named only when the read presented the credential that sign-in's verify installed and the sign-in can still be finished. Skip the create and the verify — the emailed factor is already proven — and call THIS intent's upgrade endpoint naming the checkout session: on a first-party page the same credential authorizes it with no bearer at all, and the login collects only what it still owes (nothing, or the account's second factor). null runs the full recipe; a refused continuation is answered the same way, by falling back to it.

+ */ + _FinalStage sessionIntentId(Optional sessionIntentId); + + _FinalStage sessionIntentId(String sessionIntentId); + + _FinalStage sessionIntentId(Nullable sessionIntentId); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BlockingStage, EmailStage, SignInIntentStage, _FinalStage { + private boolean blocking; + + private String email; + + private CheckoutSessionUpgradeAuthenticationActionSignInIntent signInIntent; + + private Optional sessionIntentId = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionUpgradeAuthenticationAction other) { + blocking(other.getBlocking()); + email(other.getEmail()); + sessionIntentId(other.getSessionIntentId()); + signInIntent(other.getSignInIntent()); + return this; + } + + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("blocking") + public EmailStage blocking(boolean blocking) { + this.blocking = blocking; + return this; + } + + /** + *

The address the sign-in starts with — the buyer's own, resolved by this checkout. Pass it to the session-intent create; the one-time code goes to this inbox, and holding that inbox is the entire proof.

+ *

The address the sign-in starts with — the buyer's own, resolved by this checkout. Pass it to the session-intent create; the one-time code goes to this inbox, and holding that inbox is the entire proof.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("email") + public SignInIntentStage email(@NotNull String email) { + this.email = Objects.requireNonNull(email, "email must not be null"); + return this; + } + + /** + *

The intent to declare on the session-intent create. Declaring it is what keeps the verification credential checkout-scoped — the full login is minted only by the upgrade call, never by the code alone.

+ *

The intent to declare on the session-intent create. Declaring it is what keeps the verification credential checkout-scoped — the full login is minted only by the upgrade call, never by the code alone.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("sign_in_intent") + public _FinalStage signInIntent(@NotNull CheckoutSessionUpgradeAuthenticationActionSignInIntent signInIntent) { + this.signInIntent = Objects.requireNonNull(signInIntent, "signInIntent must not be null"); + return this; + } + + /** + *

The continuation, when this reader can take it: the id (ses_…) of the buyer's own mid-checkout sign-in, named only when the read presented the credential that sign-in's verify installed and the sign-in can still be finished. Skip the create and the verify — the emailed factor is already proven — and call THIS intent's upgrade endpoint naming the checkout session: on a first-party page the same credential authorizes it with no bearer at all, and the login collects only what it still owes (nothing, or the account's second factor). null runs the full recipe; a refused continuation is answered the same way, by falling back to it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage sessionIntentId(Nullable sessionIntentId) { + if (sessionIntentId.isNull()) { + this.sessionIntentId = null; + } else if (sessionIntentId.isEmpty()) { + this.sessionIntentId = Optional.empty(); + } else { + this.sessionIntentId = Optional.of(sessionIntentId.get()); + } + return this; + } + + /** + *

The continuation, when this reader can take it: the id (ses_…) of the buyer's own mid-checkout sign-in, named only when the read presented the credential that sign-in's verify installed and the sign-in can still be finished. Skip the create and the verify — the emailed factor is already proven — and call THIS intent's upgrade endpoint naming the checkout session: on a first-party page the same credential authorizes it with no bearer at all, and the login collects only what it still owes (nothing, or the account's second factor). null runs the full recipe; a refused continuation is answered the same way, by falling back to it.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage sessionIntentId(String sessionIntentId) { + this.sessionIntentId = Optional.ofNullable(sessionIntentId); + return this; + } + + /** + *

The continuation, when this reader can take it: the id (ses_…) of the buyer's own mid-checkout sign-in, named only when the read presented the credential that sign-in's verify installed and the sign-in can still be finished. Skip the create and the verify — the emailed factor is already proven — and call THIS intent's upgrade endpoint naming the checkout session: on a first-party page the same credential authorizes it with no bearer at all, and the login collects only what it still owes (nothing, or the account's second factor). null runs the full recipe; a refused continuation is answered the same way, by falling back to it.

+ */ + @java.lang.Override + @JsonSetter(value = "session_intent_id", nulls = Nulls.SKIP) + public _FinalStage sessionIntentId(Optional sessionIntentId) { + this.sessionIntentId = sessionIntentId; + return this; + } + + @java.lang.Override + public CheckoutSessionUpgradeAuthenticationAction build() { + return new CheckoutSessionUpgradeAuthenticationAction( + blocking, email, sessionIntentId, signInIntent, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionUpgradeAuthenticationActionSignInIntent.java b/src/main/java/com/whop/api/types/CheckoutSessionUpgradeAuthenticationActionSignInIntent.java new file mode 100644 index 00000000..23219e3e --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionUpgradeAuthenticationActionSignInIntent.java @@ -0,0 +1,75 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class CheckoutSessionUpgradeAuthenticationActionSignInIntent { + public static final CheckoutSessionUpgradeAuthenticationActionSignInIntent PAYMENT = + new CheckoutSessionUpgradeAuthenticationActionSignInIntent(Value.PAYMENT, "payment"); + + private final Value value; + + private final String string; + + CheckoutSessionUpgradeAuthenticationActionSignInIntent(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof CheckoutSessionUpgradeAuthenticationActionSignInIntent + && this.string.equals(((CheckoutSessionUpgradeAuthenticationActionSignInIntent) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PAYMENT: + return visitor.visitPayment(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static CheckoutSessionUpgradeAuthenticationActionSignInIntent valueOf(String value) { + switch (value) { + case "payment": + return PAYMENT; + default: + return new CheckoutSessionUpgradeAuthenticationActionSignInIntent(Value.UNKNOWN, value); + } + } + + public enum Value { + PAYMENT, + + UNKNOWN + } + + public interface Visitor { + T visitPayment(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionVerifyPhoneAction.java b/src/main/java/com/whop/api/types/CheckoutSessionVerifyPhoneAction.java new file mode 100644 index 00000000..4e44307a --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionVerifyPhoneAction.java @@ -0,0 +1,128 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionVerifyPhoneAction.Builder.class) +public final class CheckoutSessionVerifyPhoneAction { + private final boolean blocking; + + private final Map additionalProperties; + + private CheckoutSessionVerifyPhoneAction(boolean blocking, Map additionalProperties) { + this.blocking = blocking; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab. + */ + @JsonProperty("blocking") + public boolean getBlocking() { + return blocking; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionVerifyPhoneAction && equalTo((CheckoutSessionVerifyPhoneAction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionVerifyPhoneAction other) { + return blocking == other.blocking; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.blocking); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BlockingStage builder() { + return new Builder(); + } + + public interface BlockingStage { + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ */ + _FinalStage blocking(boolean blocking); + + Builder from(CheckoutSessionVerifyPhoneAction other); + } + + public interface _FinalStage { + CheckoutSessionVerifyPhoneAction build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BlockingStage, _FinalStage { + private boolean blocking; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionVerifyPhoneAction other) { + blocking(other.getBlocking()); + return this; + } + + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("blocking") + public _FinalStage blocking(boolean blocking) { + this.blocking = blocking; + return this; + } + + @java.lang.Override + public CheckoutSessionVerifyPhoneAction build() { + return new CheckoutSessionVerifyPhoneAction(blocking, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/CheckoutSessionWaitForPaymentAction.java b/src/main/java/com/whop/api/types/CheckoutSessionWaitForPaymentAction.java new file mode 100644 index 00000000..93777224 --- /dev/null +++ b/src/main/java/com/whop/api/types/CheckoutSessionWaitForPaymentAction.java @@ -0,0 +1,163 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = CheckoutSessionWaitForPaymentAction.Builder.class) +public final class CheckoutSessionWaitForPaymentAction { + private final boolean blocking; + + private final int pollAfterSeconds; + + private final Map additionalProperties; + + private CheckoutSessionWaitForPaymentAction( + boolean blocking, int pollAfterSeconds, Map additionalProperties) { + this.blocking = blocking; + this.pollAfterSeconds = pollAfterSeconds; + this.additionalProperties = additionalProperties; + } + + /** + * @return Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab. + */ + @JsonProperty("blocking") + public boolean getBlocking() { + return blocking; + } + + /** + * @return How long to hold before reading the session again, in seconds. A hint for the next read's timing, not a budget: how long a surface is willing to keep the buyer waiting before saying "we'll email you when it clears" is the surface's own call. + */ + @JsonProperty("poll_after_seconds") + public int getPollAfterSeconds() { + return pollAfterSeconds; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof CheckoutSessionWaitForPaymentAction + && equalTo((CheckoutSessionWaitForPaymentAction) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(CheckoutSessionWaitForPaymentAction other) { + return blocking == other.blocking && pollAfterSeconds == other.pollAfterSeconds; + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.blocking, this.pollAfterSeconds); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static BlockingStage builder() { + return new Builder(); + } + + public interface BlockingStage { + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ */ + PollAfterSecondsStage blocking(boolean blocking); + + Builder from(CheckoutSessionWaitForPaymentAction other); + } + + public interface PollAfterSecondsStage { + /** + *

How long to hold before reading the session again, in seconds. A hint for the next read's timing, not a budget: how long a surface is willing to keep the buyer waiting before saying "we'll email you when it clears" is the surface's own call.

+ */ + _FinalStage pollAfterSeconds(int pollAfterSeconds); + } + + public interface _FinalStage { + CheckoutSessionWaitForPaymentAction build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements BlockingStage, PollAfterSecondsStage, _FinalStage { + private boolean blocking; + + private int pollAfterSeconds; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(CheckoutSessionWaitForPaymentAction other) { + blocking(other.getBlocking()); + pollAfterSeconds(other.getPollAfterSeconds()); + return this; + } + + /** + *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ *

Whether the sale depends on this. true stops the purchase until it is done — confirm refuses regardless of whether you ran it, so skipping it only costs the buyer an unexplained refusal. false is advisory: the purchase is already made and it stands whether or not the buyer ever does this, so the buyer may close the tab.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("blocking") + public PollAfterSecondsStage blocking(boolean blocking) { + this.blocking = blocking; + return this; + } + + /** + *

How long to hold before reading the session again, in seconds. A hint for the next read's timing, not a budget: how long a surface is willing to keep the buyer waiting before saying "we'll email you when it clears" is the surface's own call.

+ *

How long to hold before reading the session again, in seconds. A hint for the next read's timing, not a budget: how long a surface is willing to keep the buyer waiting before saying "we'll email you when it clears" is the surface's own call.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("poll_after_seconds") + public _FinalStage pollAfterSeconds(int pollAfterSeconds) { + this.pollAfterSeconds = pollAfterSeconds; + return this; + } + + @java.lang.Override + public CheckoutSessionWaitForPaymentAction build() { + return new CheckoutSessionWaitForPaymentAction(blocking, pollAfterSeconds, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/DisputeEvidenceDocument.java b/src/main/java/com/whop/api/types/DisputeEvidenceDocument.java index fba23ff3..09e96c5d 100644 --- a/src/main/java/com/whop/api/types/DisputeEvidenceDocument.java +++ b/src/main/java/com/whop/api/types/DisputeEvidenceDocument.java @@ -16,6 +16,7 @@ import com.whop.api.core.NullableNonemptyFilter; import com.whop.api.core.ObjectMappers; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -26,28 +27,68 @@ public final class DisputeEvidenceDocument { private final Optional contentType; + private final String createdAt; + private final DisputeEvidenceDocumentDocumentType documentType; private final Optional filename; private final String id; + private final Optional multipartChunkSize; + + private final Optional multipartUploadId; + + private final Optional> multipartUploadUrls; + + private final String object; + + private final Optional size; + + private final Optional> uploadHeaders; + + private final DisputeEvidenceDocumentUploadStatus uploadStatus; + + private final Optional uploadUrl; + private final Optional url; + private final DisputeEvidenceDocumentVisibility visibility; + private final Map additionalProperties; private DisputeEvidenceDocument( Optional contentType, + String createdAt, DisputeEvidenceDocumentDocumentType documentType, Optional filename, String id, + Optional multipartChunkSize, + Optional multipartUploadId, + Optional> multipartUploadUrls, + String object, + Optional size, + Optional> uploadHeaders, + DisputeEvidenceDocumentUploadStatus uploadStatus, + Optional uploadUrl, Optional url, + DisputeEvidenceDocumentVisibility visibility, Map additionalProperties) { this.contentType = contentType; + this.createdAt = createdAt; this.documentType = documentType; this.filename = filename; this.id = id; + this.multipartChunkSize = multipartChunkSize; + this.multipartUploadId = multipartUploadId; + this.multipartUploadUrls = multipartUploadUrls; + this.object = object; + this.size = size; + this.uploadHeaders = uploadHeaders; + this.uploadStatus = uploadStatus; + this.uploadUrl = uploadUrl; this.url = url; + this.visibility = visibility; this.additionalProperties = additionalProperties; } @@ -62,6 +103,14 @@ public Optional getContentType() { return contentType; } + /** + * @return When the file was created, as an ISO 8601 timestamp. + */ + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + /** * @return What kind of evidence the document is. */ @@ -71,7 +120,7 @@ public DisputeEvidenceDocumentDocumentType getDocumentType() { } /** - * @return The uploaded file's name. + * @return The original filename, including its extension. */ @JsonIgnore public Optional getFilename() { @@ -82,7 +131,7 @@ public Optional getFilename() { } /** - * @return The attachment's ID, prefixed file_. + * @return The file's ID, prefixed file_. */ @JsonProperty("id") public String getId() { @@ -90,7 +139,83 @@ public String getId() { } /** - * @return A URL to download the document. + * @return The byte size each part (except the last) must be. Present only on create, and only for multipart uploads. + */ + @JsonIgnore + public Optional getMultipartChunkSize() { + if (multipartChunkSize == null) { + return Optional.empty(); + } + return multipartChunkSize; + } + + /** + * @return The ID of the multipart upload, passed back to complete. Present only on create, and only for multipart uploads. + */ + @JsonIgnore + public Optional getMultipartUploadId() { + if (multipartUploadId == null) { + return Optional.empty(); + } + return multipartUploadId; + } + + @JsonIgnore + public Optional> getMultipartUploadUrls() { + if (multipartUploadUrls == null) { + return Optional.empty(); + } + return multipartUploadUrls; + } + + /** + * @return The type of this object, always file. + */ + @JsonProperty("object") + public String getObject() { + return object; + } + + /** + * @return The file size in bytes. null until the upload has finished. + */ + @JsonIgnore + public Optional getSize() { + if (size == null) { + return Optional.empty(); + } + return size; + } + + /** + * @return Headers to send with the upload PUT. Present only on create. + */ + @JsonProperty("upload_headers") + public Optional> getUploadHeaders() { + return uploadHeaders; + } + + /** + * @return Where the file is in its upload lifecycle. + */ + @JsonProperty("upload_status") + public DisputeEvidenceDocumentUploadStatus getUploadStatus() { + return uploadStatus; + } + + /** + * @return Presigned URL to PUT the file's bytes to. Present only on create, and only for single-part uploads. + */ + @JsonIgnore + public Optional getUploadUrl() { + if (uploadUrl == null) { + return Optional.empty(); + } + return uploadUrl; + } + + /** + * @return A URL to download the file: a permanent CDN URL for public files, a signed expiring URL for private ones. null until the upload has finished. */ @JsonIgnore public Optional getUrl() { @@ -100,6 +225,14 @@ public Optional getUrl() { return url; } + /** + * @return public files are served via an unsigned CDN URL; private files via a signed, expiring URL. + */ + @JsonProperty("visibility") + public DisputeEvidenceDocumentVisibility getVisibility() { + return visibility; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("content_type") private Optional _getContentType() { @@ -112,6 +245,36 @@ private Optional _getFilename() { return filename; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_chunk_size") + private Optional _getMultipartChunkSize() { + return multipartChunkSize; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_upload_id") + private Optional _getMultipartUploadId() { + return multipartUploadId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_upload_urls") + private Optional> _getMultipartUploadUrls() { + return multipartUploadUrls; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("size") + private Optional _getSize() { + return size; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upload_url") + private Optional _getUploadUrl() { + return uploadUrl; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("url") private Optional _getUrl() { @@ -131,15 +294,40 @@ public Map getAdditionalProperties() { private boolean equalTo(DisputeEvidenceDocument other) { return contentType.equals(other.contentType) + && createdAt.equals(other.createdAt) && documentType.equals(other.documentType) && filename.equals(other.filename) && id.equals(other.id) - && url.equals(other.url); + && multipartChunkSize.equals(other.multipartChunkSize) + && multipartUploadId.equals(other.multipartUploadId) + && multipartUploadUrls.equals(other.multipartUploadUrls) + && object.equals(other.object) + && size.equals(other.size) + && uploadHeaders.equals(other.uploadHeaders) + && uploadStatus.equals(other.uploadStatus) + && uploadUrl.equals(other.uploadUrl) + && url.equals(other.url) + && visibility.equals(other.visibility); } @java.lang.Override public int hashCode() { - return Objects.hash(this.contentType, this.documentType, this.filename, this.id, this.url); + return Objects.hash( + this.contentType, + this.createdAt, + this.documentType, + this.filename, + this.id, + this.multipartChunkSize, + this.multipartUploadId, + this.multipartUploadUrls, + this.object, + this.size, + this.uploadHeaders, + this.uploadStatus, + this.uploadUrl, + this.url, + this.visibility); } @java.lang.Override @@ -147,24 +335,52 @@ public String toString() { return ObjectMappers.stringify(this); } - public static DocumentTypeStage builder() { + public static CreatedAtStage builder() { return new Builder(); } + public interface CreatedAtStage { + /** + *

When the file was created, as an ISO 8601 timestamp.

+ */ + DocumentTypeStage createdAt(@NotNull String createdAt); + + Builder from(DisputeEvidenceDocument other); + } + public interface DocumentTypeStage { /** *

What kind of evidence the document is.

*/ IdStage documentType(@NotNull DisputeEvidenceDocumentDocumentType documentType); - - Builder from(DisputeEvidenceDocument other); } public interface IdStage { /** - *

The attachment's ID, prefixed file_.

+ *

The file's ID, prefixed file_.

*/ - _FinalStage id(@NotNull String id); + ObjectStage id(@NotNull String id); + } + + public interface ObjectStage { + /** + *

The type of this object, always file.

+ */ + UploadStatusStage object(@NotNull String object); + } + + public interface UploadStatusStage { + /** + *

Where the file is in its upload lifecycle.

+ */ + VisibilityStage uploadStatus(@NotNull DisputeEvidenceDocumentUploadStatus uploadStatus); + } + + public interface VisibilityStage { + /** + *

public files are served via an unsigned CDN URL; private files via a signed, expiring URL.

+ */ + _FinalStage visibility(@NotNull DisputeEvidenceDocumentVisibility visibility); } public interface _FinalStage { @@ -184,7 +400,7 @@ public interface _FinalStage { _FinalStage contentType(Nullable contentType); /** - *

The uploaded file's name.

+ *

The original filename, including its extension.

*/ _FinalStage filename(Optional filename); @@ -193,7 +409,56 @@ public interface _FinalStage { _FinalStage filename(Nullable filename); /** - *

A URL to download the document.

+ *

The byte size each part (except the last) must be. Present only on create, and only for multipart uploads.

+ */ + _FinalStage multipartChunkSize(Optional multipartChunkSize); + + _FinalStage multipartChunkSize(Integer multipartChunkSize); + + _FinalStage multipartChunkSize(Nullable multipartChunkSize); + + /** + *

The ID of the multipart upload, passed back to complete. Present only on create, and only for multipart uploads.

+ */ + _FinalStage multipartUploadId(Optional multipartUploadId); + + _FinalStage multipartUploadId(String multipartUploadId); + + _FinalStage multipartUploadId(Nullable multipartUploadId); + + _FinalStage multipartUploadUrls(Optional> multipartUploadUrls); + + _FinalStage multipartUploadUrls(List multipartUploadUrls); + + _FinalStage multipartUploadUrls(Nullable> multipartUploadUrls); + + /** + *

The file size in bytes. null until the upload has finished.

+ */ + _FinalStage size(Optional size); + + _FinalStage size(Integer size); + + _FinalStage size(Nullable size); + + /** + *

Headers to send with the upload PUT. Present only on create.

+ */ + _FinalStage uploadHeaders(Optional> uploadHeaders); + + _FinalStage uploadHeaders(Map uploadHeaders); + + /** + *

Presigned URL to PUT the file's bytes to. Present only on create, and only for single-part uploads.

+ */ + _FinalStage uploadUrl(Optional uploadUrl); + + _FinalStage uploadUrl(String uploadUrl); + + _FinalStage uploadUrl(Nullable uploadUrl); + + /** + *

A URL to download the file: a permanent CDN URL for public files, a signed expiring URL for private ones. null until the upload has finished.

*/ _FinalStage url(Optional url); @@ -203,13 +468,40 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements DocumentTypeStage, IdStage, _FinalStage { + public static final class Builder + implements CreatedAtStage, + DocumentTypeStage, + IdStage, + ObjectStage, + UploadStatusStage, + VisibilityStage, + _FinalStage { + private String createdAt; + private DisputeEvidenceDocumentDocumentType documentType; private String id; + private String object; + + private DisputeEvidenceDocumentUploadStatus uploadStatus; + + private DisputeEvidenceDocumentVisibility visibility; + private Optional url = Optional.empty(); + private Optional uploadUrl = Optional.empty(); + + private Optional> uploadHeaders = Optional.empty(); + + private Optional size = Optional.empty(); + + private Optional> multipartUploadUrls = Optional.empty(); + + private Optional multipartUploadId = Optional.empty(); + + private Optional multipartChunkSize = Optional.empty(); + private Optional filename = Optional.empty(); private Optional contentType = Optional.empty(); @@ -222,10 +514,32 @@ private Builder() {} @java.lang.Override public Builder from(DisputeEvidenceDocument other) { contentType(other.getContentType()); + createdAt(other.getCreatedAt()); documentType(other.getDocumentType()); filename(other.getFilename()); id(other.getId()); + multipartChunkSize(other.getMultipartChunkSize()); + multipartUploadId(other.getMultipartUploadId()); + multipartUploadUrls(other.getMultipartUploadUrls()); + object(other.getObject()); + size(other.getSize()); + uploadHeaders(other.getUploadHeaders()); + uploadStatus(other.getUploadStatus()); + uploadUrl(other.getUploadUrl()); url(other.getUrl()); + visibility(other.getVisibility()); + return this; + } + + /** + *

When the file was created, as an ISO 8601 timestamp.

+ *

When the file was created, as an ISO 8601 timestamp.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public DocumentTypeStage createdAt(@NotNull String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); return this; } @@ -242,19 +556,55 @@ public IdStage documentType(@NotNull DisputeEvidenceDocumentDocumentType documen } /** - *

The attachment's ID, prefixed file_.

- *

The attachment's ID, prefixed file_.

+ *

The file's ID, prefixed file_.

+ *

The file's ID, prefixed file_.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") - public _FinalStage id(@NotNull String id) { + public ObjectStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** - *

A URL to download the document.

+ *

The type of this object, always file.

+ *

The type of this object, always file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("object") + public UploadStatusStage object(@NotNull String object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + /** + *

Where the file is in its upload lifecycle.

+ *

Where the file is in its upload lifecycle.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("upload_status") + public VisibilityStage uploadStatus(@NotNull DisputeEvidenceDocumentUploadStatus uploadStatus) { + this.uploadStatus = Objects.requireNonNull(uploadStatus, "uploadStatus must not be null"); + return this; + } + + /** + *

public files are served via an unsigned CDN URL; private files via a signed, expiring URL.

+ *

public files are served via an unsigned CDN URL; private files via a signed, expiring URL.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("visibility") + public _FinalStage visibility(@NotNull DisputeEvidenceDocumentVisibility visibility) { + this.visibility = Objects.requireNonNull(visibility, "visibility must not be null"); + return this; + } + + /** + *

A URL to download the file: a permanent CDN URL for public files, a signed expiring URL for private ones. null until the upload has finished.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -270,7 +620,7 @@ public _FinalStage url(Nullable url) { } /** - *

A URL to download the document.

+ *

A URL to download the file: a permanent CDN URL for public files, a signed expiring URL for private ones. null until the upload has finished.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -280,7 +630,7 @@ public _FinalStage url(String url) { } /** - *

A URL to download the document.

+ *

A URL to download the file: a permanent CDN URL for public files, a signed expiring URL for private ones. null until the upload has finished.

*/ @java.lang.Override @JsonSetter(value = "url", nulls = Nulls.SKIP) @@ -290,7 +640,196 @@ public _FinalStage url(Optional url) { } /** - *

The uploaded file's name.

+ *

Presigned URL to PUT the file's bytes to. Present only on create, and only for single-part uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage uploadUrl(Nullable uploadUrl) { + if (uploadUrl.isNull()) { + this.uploadUrl = null; + } else if (uploadUrl.isEmpty()) { + this.uploadUrl = Optional.empty(); + } else { + this.uploadUrl = Optional.of(uploadUrl.get()); + } + return this; + } + + /** + *

Presigned URL to PUT the file's bytes to. Present only on create, and only for single-part uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage uploadUrl(String uploadUrl) { + this.uploadUrl = Optional.ofNullable(uploadUrl); + return this; + } + + /** + *

Presigned URL to PUT the file's bytes to. Present only on create, and only for single-part uploads.

+ */ + @java.lang.Override + @JsonSetter(value = "upload_url", nulls = Nulls.SKIP) + public _FinalStage uploadUrl(Optional uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + + /** + *

Headers to send with the upload PUT. Present only on create.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage uploadHeaders(Map uploadHeaders) { + this.uploadHeaders = Optional.ofNullable(uploadHeaders); + return this; + } + + /** + *

Headers to send with the upload PUT. Present only on create.

+ */ + @java.lang.Override + @JsonSetter(value = "upload_headers", nulls = Nulls.SKIP) + public _FinalStage uploadHeaders(Optional> uploadHeaders) { + this.uploadHeaders = uploadHeaders; + return this; + } + + /** + *

The file size in bytes. null until the upload has finished.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage size(Nullable size) { + if (size.isNull()) { + this.size = null; + } else if (size.isEmpty()) { + this.size = Optional.empty(); + } else { + this.size = Optional.of(size.get()); + } + return this; + } + + /** + *

The file size in bytes. null until the upload has finished.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage size(Integer size) { + this.size = Optional.ofNullable(size); + return this; + } + + /** + *

The file size in bytes. null until the upload has finished.

+ */ + @java.lang.Override + @JsonSetter(value = "size", nulls = Nulls.SKIP) + public _FinalStage size(Optional size) { + this.size = size; + return this; + } + + @java.lang.Override + public _FinalStage multipartUploadUrls(Nullable> multipartUploadUrls) { + if (multipartUploadUrls.isNull()) { + this.multipartUploadUrls = null; + } else if (multipartUploadUrls.isEmpty()) { + this.multipartUploadUrls = Optional.empty(); + } else { + this.multipartUploadUrls = Optional.of(multipartUploadUrls.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage multipartUploadUrls(List multipartUploadUrls) { + this.multipartUploadUrls = Optional.ofNullable(multipartUploadUrls); + return this; + } + + @java.lang.Override + @JsonSetter(value = "multipart_upload_urls", nulls = Nulls.SKIP) + public _FinalStage multipartUploadUrls(Optional> multipartUploadUrls) { + this.multipartUploadUrls = multipartUploadUrls; + return this; + } + + /** + *

The ID of the multipart upload, passed back to complete. Present only on create, and only for multipart uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartUploadId(Nullable multipartUploadId) { + if (multipartUploadId.isNull()) { + this.multipartUploadId = null; + } else if (multipartUploadId.isEmpty()) { + this.multipartUploadId = Optional.empty(); + } else { + this.multipartUploadId = Optional.of(multipartUploadId.get()); + } + return this; + } + + /** + *

The ID of the multipart upload, passed back to complete. Present only on create, and only for multipart uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartUploadId(String multipartUploadId) { + this.multipartUploadId = Optional.ofNullable(multipartUploadId); + return this; + } + + /** + *

The ID of the multipart upload, passed back to complete. Present only on create, and only for multipart uploads.

+ */ + @java.lang.Override + @JsonSetter(value = "multipart_upload_id", nulls = Nulls.SKIP) + public _FinalStage multipartUploadId(Optional multipartUploadId) { + this.multipartUploadId = multipartUploadId; + return this; + } + + /** + *

The byte size each part (except the last) must be. Present only on create, and only for multipart uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartChunkSize(Nullable multipartChunkSize) { + if (multipartChunkSize.isNull()) { + this.multipartChunkSize = null; + } else if (multipartChunkSize.isEmpty()) { + this.multipartChunkSize = Optional.empty(); + } else { + this.multipartChunkSize = Optional.of(multipartChunkSize.get()); + } + return this; + } + + /** + *

The byte size each part (except the last) must be. Present only on create, and only for multipart uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartChunkSize(Integer multipartChunkSize) { + this.multipartChunkSize = Optional.ofNullable(multipartChunkSize); + return this; + } + + /** + *

The byte size each part (except the last) must be. Present only on create, and only for multipart uploads.

+ */ + @java.lang.Override + @JsonSetter(value = "multipart_chunk_size", nulls = Nulls.SKIP) + public _FinalStage multipartChunkSize(Optional multipartChunkSize) { + this.multipartChunkSize = multipartChunkSize; + return this; + } + + /** + *

The original filename, including its extension.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -306,7 +845,7 @@ public _FinalStage filename(Nullable filename) { } /** - *

The uploaded file's name.

+ *

The original filename, including its extension.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -316,7 +855,7 @@ public _FinalStage filename(String filename) { } /** - *

The uploaded file's name.

+ *

The original filename, including its extension.

*/ @java.lang.Override @JsonSetter(value = "filename", nulls = Nulls.SKIP) @@ -363,7 +902,23 @@ public _FinalStage contentType(Optional cont @java.lang.Override public DisputeEvidenceDocument build() { - return new DisputeEvidenceDocument(contentType, documentType, filename, id, url, additionalProperties); + return new DisputeEvidenceDocument( + contentType, + createdAt, + documentType, + filename, + id, + multipartChunkSize, + multipartUploadId, + multipartUploadUrls, + object, + size, + uploadHeaders, + uploadStatus, + uploadUrl, + url, + visibility, + additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/whop/api/types/DisputeEvidenceDocumentUploadStatus.java b/src/main/java/com/whop/api/types/DisputeEvidenceDocumentUploadStatus.java new file mode 100644 index 00000000..1f31a2e6 --- /dev/null +++ b/src/main/java/com/whop/api/types/DisputeEvidenceDocumentUploadStatus.java @@ -0,0 +1,108 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DisputeEvidenceDocumentUploadStatus { + public static final DisputeEvidenceDocumentUploadStatus FAILED = + new DisputeEvidenceDocumentUploadStatus(Value.FAILED, "failed"); + + public static final DisputeEvidenceDocumentUploadStatus PENDING = + new DisputeEvidenceDocumentUploadStatus(Value.PENDING, "pending"); + + public static final DisputeEvidenceDocumentUploadStatus PROCESSING = + new DisputeEvidenceDocumentUploadStatus(Value.PROCESSING, "processing"); + + public static final DisputeEvidenceDocumentUploadStatus READY = + new DisputeEvidenceDocumentUploadStatus(Value.READY, "ready"); + + private final Value value; + + private final String string; + + DisputeEvidenceDocumentUploadStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DisputeEvidenceDocumentUploadStatus + && this.string.equals(((DisputeEvidenceDocumentUploadStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case PENDING: + return visitor.visitPending(); + case PROCESSING: + return visitor.visitProcessing(); + case READY: + return visitor.visitReady(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DisputeEvidenceDocumentUploadStatus valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "pending": + return PENDING; + case "processing": + return PROCESSING; + case "ready": + return READY; + default: + return new DisputeEvidenceDocumentUploadStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + PROCESSING, + + READY, + + FAILED, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitProcessing(); + + T visitReady(); + + T visitFailed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/DisputeEvidenceDocumentVisibility.java b/src/main/java/com/whop/api/types/DisputeEvidenceDocumentVisibility.java new file mode 100644 index 00000000..bf350a3a --- /dev/null +++ b/src/main/java/com/whop/api/types/DisputeEvidenceDocumentVisibility.java @@ -0,0 +1,86 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class DisputeEvidenceDocumentVisibility { + public static final DisputeEvidenceDocumentVisibility PRIVATE = + new DisputeEvidenceDocumentVisibility(Value.PRIVATE, "private"); + + public static final DisputeEvidenceDocumentVisibility PUBLIC = + new DisputeEvidenceDocumentVisibility(Value.PUBLIC, "public"); + + private final Value value; + + private final String string; + + DisputeEvidenceDocumentVisibility(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof DisputeEvidenceDocumentVisibility + && this.string.equals(((DisputeEvidenceDocumentVisibility) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PRIVATE: + return visitor.visitPrivate(); + case PUBLIC: + return visitor.visitPublic(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static DisputeEvidenceDocumentVisibility valueOf(String value) { + switch (value) { + case "private": + return PRIVATE; + case "public": + return PUBLIC; + default: + return new DisputeEvidenceDocumentVisibility(Value.UNKNOWN, value); + } + } + + public enum Value { + PUBLIC, + + PRIVATE, + + UNKNOWN + } + + public interface Visitor { + T visitPublic(); + + T visitPrivate(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/ExportResource.java b/src/main/java/com/whop/api/types/ExportResource.java index be48ffec..58c24b72 100644 --- a/src/main/java/com/whop/api/types/ExportResource.java +++ b/src/main/java/com/whop/api/types/ExportResource.java @@ -45,10 +45,10 @@ public final class ExportResource { public static final ExportResource ENTRIES = new ExportResource(Value.ENTRIES, "entries"); - public static final ExportResource MEMBERSHIPS = new ExportResource(Value.MEMBERSHIPS, "memberships"); - public static final ExportResource TRANSFERS = new ExportResource(Value.TRANSFERS, "transfers"); + public static final ExportResource MEMBERSHIPS = new ExportResource(Value.MEMBERSHIPS, "memberships"); + public static final ExportResource CHILD_COMPANIES = new ExportResource(Value.CHILD_COMPANIES, "child_companies"); public static final ExportResource WITHDRAWAL_LINES = @@ -158,10 +158,10 @@ public T visit(Visitor visitor) { return visitor.visitShipments(); case ENTRIES: return visitor.visitEntries(); - case MEMBERSHIPS: - return visitor.visitMemberships(); case TRANSFERS: return visitor.visitTransfers(); + case MEMBERSHIPS: + return visitor.visitMemberships(); case CHILD_COMPANIES: return visitor.visitChildCompanies(); case WITHDRAWAL_LINES: @@ -243,10 +243,10 @@ public static ExportResource valueOf(String value) { return SHIPMENTS; case "entries": return ENTRIES; - case "memberships": - return MEMBERSHIPS; case "transfers": return TRANSFERS; + case "memberships": + return MEMBERSHIPS; case "child_companies": return CHILD_COMPANIES; case "withdrawal_lines": @@ -315,10 +315,6 @@ public enum Value { FINANCIAL_ACTIVITY, - MEMBERS, - - MEMBERSHIPS, - PAYOUT_METHODS, PAYOUTS, @@ -341,10 +337,14 @@ public enum Value { WEBHOOKS, + MEMBERS, + RECEIPTS, UNCLAIMED_MEMBERSHIPS, + MEMBERSHIPS, + TRACKING_LINKS, PROMO_CODES, @@ -395,10 +395,6 @@ public interface Visitor { T visitFinancialActivity(); - T visitMembers(); - - T visitMemberships(); - T visitPayoutMethods(); T visitPayouts(); @@ -421,10 +417,14 @@ public interface Visitor { T visitWebhooks(); + T visitMembers(); + T visitReceipts(); T visitUnclaimedMemberships(); + T visitMemberships(); + T visitTrackingLinks(); T visitPromoCodes(); diff --git a/src/main/java/com/whop/api/types/File.java b/src/main/java/com/whop/api/types/File.java index a32808bf..5c80d7f0 100644 --- a/src/main/java/com/whop/api/types/File.java +++ b/src/main/java/com/whop/api/types/File.java @@ -16,6 +16,7 @@ import com.whop.api.core.NullableNonemptyFilter; import com.whop.api.core.ObjectMappers; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -26,13 +27,27 @@ public final class File { private final Optional contentType; + private final String createdAt; + private final Optional filename; private final String id; - private final Optional size; + private final Optional multipartChunkSize; + + private final Optional multipartUploadId; + + private final Optional> multipartUploadUrls; + + private final String object; + + private final Optional size; + + private final Optional> uploadHeaders; + + private final FileUploadStatus uploadStatus; - private final UploadStatuses uploadStatus; + private final Optional uploadUrl; private final Optional url; @@ -42,25 +57,39 @@ public final class File { private File( Optional contentType, + String createdAt, Optional filename, String id, - Optional size, - UploadStatuses uploadStatus, + Optional multipartChunkSize, + Optional multipartUploadId, + Optional> multipartUploadUrls, + String object, + Optional size, + Optional> uploadHeaders, + FileUploadStatus uploadStatus, + Optional uploadUrl, Optional url, FileVisibility visibility, Map additionalProperties) { this.contentType = contentType; + this.createdAt = createdAt; this.filename = filename; this.id = id; + this.multipartChunkSize = multipartChunkSize; + this.multipartUploadId = multipartUploadId; + this.multipartUploadUrls = multipartUploadUrls; + this.object = object; this.size = size; + this.uploadHeaders = uploadHeaders; this.uploadStatus = uploadStatus; + this.uploadUrl = uploadUrl; this.url = url; this.visibility = visibility; this.additionalProperties = additionalProperties; } /** - * @return The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg). + * @return The file's MIME type, e.g. application/pdf. */ @JsonIgnore public Optional getContentType() { @@ -71,7 +100,15 @@ public Optional getContentType() { } /** - * @return The original filename of the uploaded file, including its file extension. + * @return When the file was created, as an ISO 8601 timestamp. + */ + @JsonProperty("created_at") + public String getCreatedAt() { + return createdAt; + } + + /** + * @return The original filename, including its extension. */ @JsonIgnore public Optional getFilename() { @@ -82,7 +119,7 @@ public Optional getFilename() { } /** - * @return The unique identifier for the file. + * @return The file's ID, prefixed file_. */ @JsonProperty("id") public String getId() { @@ -90,10 +127,48 @@ public String getId() { } /** - * @return The file size in bytes. Null if the file has not finished uploading. + * @return The byte size each part (except the last) must be. Present only on create, and only for multipart uploads. + */ + @JsonIgnore + public Optional getMultipartChunkSize() { + if (multipartChunkSize == null) { + return Optional.empty(); + } + return multipartChunkSize; + } + + /** + * @return The ID of the multipart upload, passed back to complete. Present only on create, and only for multipart uploads. */ @JsonIgnore - public Optional getSize() { + public Optional getMultipartUploadId() { + if (multipartUploadId == null) { + return Optional.empty(); + } + return multipartUploadId; + } + + @JsonIgnore + public Optional> getMultipartUploadUrls() { + if (multipartUploadUrls == null) { + return Optional.empty(); + } + return multipartUploadUrls; + } + + /** + * @return The type of this object, always file. + */ + @JsonProperty("object") + public String getObject() { + return object; + } + + /** + * @return The file size in bytes. null until the upload has finished. + */ + @JsonIgnore + public Optional getSize() { if (size == null) { return Optional.empty(); } @@ -101,15 +176,34 @@ public Optional getSize() { } /** - * @return The current upload status of the file (e.g., pending, ready). + * @return Headers to send with the upload PUT. Present only on create. + */ + @JsonProperty("upload_headers") + public Optional> getUploadHeaders() { + return uploadHeaders; + } + + /** + * @return Where the file is in its upload lifecycle. */ @JsonProperty("upload_status") - public UploadStatuses getUploadStatus() { + public FileUploadStatus getUploadStatus() { return uploadStatus; } /** - * @return The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading. + * @return Presigned URL to PUT the file's bytes to. Present only on create, and only for single-part uploads. + */ + @JsonIgnore + public Optional getUploadUrl() { + if (uploadUrl == null) { + return Optional.empty(); + } + return uploadUrl; + } + + /** + * @return A URL to download the file: a permanent CDN URL for public files, a signed expiring URL for private ones. null until the upload has finished. */ @JsonIgnore public Optional getUrl() { @@ -120,7 +214,7 @@ public Optional getUrl() { } /** - * @return Whether the file is publicly accessible or requires authentication. + * @return public files are served via an unsigned CDN URL; private files via a signed, expiring URL. */ @JsonProperty("visibility") public FileVisibility getVisibility() { @@ -139,12 +233,36 @@ private Optional _getFilename() { return filename; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_chunk_size") + private Optional _getMultipartChunkSize() { + return multipartChunkSize; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_upload_id") + private Optional _getMultipartUploadId() { + return multipartUploadId; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("multipart_upload_urls") + private Optional> _getMultipartUploadUrls() { + return multipartUploadUrls; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("size") - private Optional _getSize() { + private Optional _getSize() { return size; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("upload_url") + private Optional _getUploadUrl() { + return uploadUrl; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("url") private Optional _getUrl() { @@ -164,10 +282,17 @@ public Map getAdditionalProperties() { private boolean equalTo(File other) { return contentType.equals(other.contentType) + && createdAt.equals(other.createdAt) && filename.equals(other.filename) && id.equals(other.id) + && multipartChunkSize.equals(other.multipartChunkSize) + && multipartUploadId.equals(other.multipartUploadId) + && multipartUploadUrls.equals(other.multipartUploadUrls) + && object.equals(other.object) && size.equals(other.size) + && uploadHeaders.equals(other.uploadHeaders) && uploadStatus.equals(other.uploadStatus) + && uploadUrl.equals(other.uploadUrl) && url.equals(other.url) && visibility.equals(other.visibility); } @@ -175,7 +300,20 @@ private boolean equalTo(File other) { @java.lang.Override public int hashCode() { return Objects.hash( - this.contentType, this.filename, this.id, this.size, this.uploadStatus, this.url, this.visibility); + this.contentType, + this.createdAt, + this.filename, + this.id, + this.multipartChunkSize, + this.multipartUploadId, + this.multipartUploadUrls, + this.object, + this.size, + this.uploadHeaders, + this.uploadStatus, + this.uploadUrl, + this.url, + this.visibility); } @java.lang.Override @@ -183,29 +321,43 @@ public String toString() { return ObjectMappers.stringify(this); } - public static IdStage builder() { + public static CreatedAtStage builder() { return new Builder(); } - public interface IdStage { + public interface CreatedAtStage { /** - *

The unique identifier for the file.

+ *

When the file was created, as an ISO 8601 timestamp.

*/ - UploadStatusStage id(@NotNull String id); + IdStage createdAt(@NotNull String createdAt); Builder from(File other); } + public interface IdStage { + /** + *

The file's ID, prefixed file_.

+ */ + ObjectStage id(@NotNull String id); + } + + public interface ObjectStage { + /** + *

The type of this object, always file.

+ */ + UploadStatusStage object(@NotNull String object); + } + public interface UploadStatusStage { /** - *

The current upload status of the file (e.g., pending, ready).

+ *

Where the file is in its upload lifecycle.

*/ - VisibilityStage uploadStatus(@NotNull UploadStatuses uploadStatus); + VisibilityStage uploadStatus(@NotNull FileUploadStatus uploadStatus); } public interface VisibilityStage { /** - *

Whether the file is publicly accessible or requires authentication.

+ *

public files are served via an unsigned CDN URL; private files via a signed, expiring URL.

*/ _FinalStage visibility(@NotNull FileVisibility visibility); } @@ -218,7 +370,7 @@ public interface _FinalStage { _FinalStage additionalProperties(Map additionalProperties); /** - *

The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).

+ *

The file's MIME type, e.g. application/pdf.

*/ _FinalStage contentType(Optional contentType); @@ -227,7 +379,7 @@ public interface _FinalStage { _FinalStage contentType(Nullable contentType); /** - *

The original filename of the uploaded file, including its file extension.

+ *

The original filename, including its extension.

*/ _FinalStage filename(Optional filename); @@ -236,16 +388,56 @@ public interface _FinalStage { _FinalStage filename(Nullable filename); /** - *

The file size in bytes. Null if the file has not finished uploading.

+ *

The byte size each part (except the last) must be. Present only on create, and only for multipart uploads.

*/ - _FinalStage size(Optional size); + _FinalStage multipartChunkSize(Optional multipartChunkSize); - _FinalStage size(String size); + _FinalStage multipartChunkSize(Integer multipartChunkSize); - _FinalStage size(Nullable size); + _FinalStage multipartChunkSize(Nullable multipartChunkSize); /** - *

The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading.

+ *

The ID of the multipart upload, passed back to complete. Present only on create, and only for multipart uploads.

+ */ + _FinalStage multipartUploadId(Optional multipartUploadId); + + _FinalStage multipartUploadId(String multipartUploadId); + + _FinalStage multipartUploadId(Nullable multipartUploadId); + + _FinalStage multipartUploadUrls(Optional> multipartUploadUrls); + + _FinalStage multipartUploadUrls(List multipartUploadUrls); + + _FinalStage multipartUploadUrls(Nullable> multipartUploadUrls); + + /** + *

The file size in bytes. null until the upload has finished.

+ */ + _FinalStage size(Optional size); + + _FinalStage size(Integer size); + + _FinalStage size(Nullable size); + + /** + *

Headers to send with the upload PUT. Present only on create.

+ */ + _FinalStage uploadHeaders(Optional> uploadHeaders); + + _FinalStage uploadHeaders(Map uploadHeaders); + + /** + *

Presigned URL to PUT the file's bytes to. Present only on create, and only for single-part uploads.

+ */ + _FinalStage uploadUrl(Optional uploadUrl); + + _FinalStage uploadUrl(String uploadUrl); + + _FinalStage uploadUrl(Nullable uploadUrl); + + /** + *

A URL to download the file: a permanent CDN URL for public files, a signed expiring URL for private ones. null until the upload has finished.

*/ _FinalStage url(Optional url); @@ -255,16 +447,31 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, UploadStatusStage, VisibilityStage, _FinalStage { + public static final class Builder + implements CreatedAtStage, IdStage, ObjectStage, UploadStatusStage, VisibilityStage, _FinalStage { + private String createdAt; + private String id; - private UploadStatuses uploadStatus; + private String object; + + private FileUploadStatus uploadStatus; private FileVisibility visibility; private Optional url = Optional.empty(); - private Optional size = Optional.empty(); + private Optional uploadUrl = Optional.empty(); + + private Optional> uploadHeaders = Optional.empty(); + + private Optional size = Optional.empty(); + + private Optional> multipartUploadUrls = Optional.empty(); + + private Optional multipartUploadId = Optional.empty(); + + private Optional multipartChunkSize = Optional.empty(); private Optional filename = Optional.empty(); @@ -278,42 +485,73 @@ private Builder() {} @java.lang.Override public Builder from(File other) { contentType(other.getContentType()); + createdAt(other.getCreatedAt()); filename(other.getFilename()); id(other.getId()); + multipartChunkSize(other.getMultipartChunkSize()); + multipartUploadId(other.getMultipartUploadId()); + multipartUploadUrls(other.getMultipartUploadUrls()); + object(other.getObject()); size(other.getSize()); + uploadHeaders(other.getUploadHeaders()); uploadStatus(other.getUploadStatus()); + uploadUrl(other.getUploadUrl()); url(other.getUrl()); visibility(other.getVisibility()); return this; } /** - *

The unique identifier for the file.

- *

The unique identifier for the file.

+ *

When the file was created, as an ISO 8601 timestamp.

+ *

When the file was created, as an ISO 8601 timestamp.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public IdStage createdAt(@NotNull String createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

The file's ID, prefixed file_.

+ *

The file's ID, prefixed file_.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("id") - public UploadStatusStage id(@NotNull String id) { + public ObjectStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } /** - *

The current upload status of the file (e.g., pending, ready).

- *

The current upload status of the file (e.g., pending, ready).

+ *

The type of this object, always file.

+ *

The type of this object, always file.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("object") + public UploadStatusStage object(@NotNull String object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + /** + *

Where the file is in its upload lifecycle.

+ *

Where the file is in its upload lifecycle.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @JsonSetter("upload_status") - public VisibilityStage uploadStatus(@NotNull UploadStatuses uploadStatus) { + public VisibilityStage uploadStatus(@NotNull FileUploadStatus uploadStatus) { this.uploadStatus = Objects.requireNonNull(uploadStatus, "uploadStatus must not be null"); return this; } /** - *

Whether the file is publicly accessible or requires authentication.

- *

Whether the file is publicly accessible or requires authentication.

+ *

public files are served via an unsigned CDN URL; private files via a signed, expiring URL.

+ *

public files are served via an unsigned CDN URL; private files via a signed, expiring URL.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -324,7 +562,7 @@ public _FinalStage visibility(@NotNull FileVisibility visibility) { } /** - *

The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading.

+ *

A URL to download the file: a permanent CDN URL for public files, a signed expiring URL for private ones. null until the upload has finished.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -340,7 +578,7 @@ public _FinalStage url(Nullable url) { } /** - *

The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading.

+ *

A URL to download the file: a permanent CDN URL for public files, a signed expiring URL for private ones. null until the upload has finished.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -350,7 +588,7 @@ public _FinalStage url(String url) { } /** - *

The URL for accessing the file. For public files, this is a permanent CDN URL. For private files, this is a signed URL that expires. Null if the file has not finished uploading.

+ *

A URL to download the file: a permanent CDN URL for public files, a signed expiring URL for private ones. null until the upload has finished.

*/ @java.lang.Override @JsonSetter(value = "url", nulls = Nulls.SKIP) @@ -360,11 +598,67 @@ public _FinalStage url(Optional url) { } /** - *

The file size in bytes. Null if the file has not finished uploading.

+ *

Presigned URL to PUT the file's bytes to. Present only on create, and only for single-part uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage uploadUrl(Nullable uploadUrl) { + if (uploadUrl.isNull()) { + this.uploadUrl = null; + } else if (uploadUrl.isEmpty()) { + this.uploadUrl = Optional.empty(); + } else { + this.uploadUrl = Optional.of(uploadUrl.get()); + } + return this; + } + + /** + *

Presigned URL to PUT the file's bytes to. Present only on create, and only for single-part uploads.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage size(Nullable size) { + public _FinalStage uploadUrl(String uploadUrl) { + this.uploadUrl = Optional.ofNullable(uploadUrl); + return this; + } + + /** + *

Presigned URL to PUT the file's bytes to. Present only on create, and only for single-part uploads.

+ */ + @java.lang.Override + @JsonSetter(value = "upload_url", nulls = Nulls.SKIP) + public _FinalStage uploadUrl(Optional uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + + /** + *

Headers to send with the upload PUT. Present only on create.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage uploadHeaders(Map uploadHeaders) { + this.uploadHeaders = Optional.ofNullable(uploadHeaders); + return this; + } + + /** + *

Headers to send with the upload PUT. Present only on create.

+ */ + @java.lang.Override + @JsonSetter(value = "upload_headers", nulls = Nulls.SKIP) + public _FinalStage uploadHeaders(Optional> uploadHeaders) { + this.uploadHeaders = uploadHeaders; + return this; + } + + /** + *

The file size in bytes. null until the upload has finished.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage size(Nullable size) { if (size.isNull()) { this.size = null; } else if (size.isEmpty()) { @@ -376,27 +670,124 @@ public _FinalStage size(Nullable size) { } /** - *

The file size in bytes. Null if the file has not finished uploading.

+ *

The file size in bytes. null until the upload has finished.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override - public _FinalStage size(String size) { + public _FinalStage size(Integer size) { this.size = Optional.ofNullable(size); return this; } /** - *

The file size in bytes. Null if the file has not finished uploading.

+ *

The file size in bytes. null until the upload has finished.

*/ @java.lang.Override @JsonSetter(value = "size", nulls = Nulls.SKIP) - public _FinalStage size(Optional size) { + public _FinalStage size(Optional size) { this.size = size; return this; } + @java.lang.Override + public _FinalStage multipartUploadUrls(Nullable> multipartUploadUrls) { + if (multipartUploadUrls.isNull()) { + this.multipartUploadUrls = null; + } else if (multipartUploadUrls.isEmpty()) { + this.multipartUploadUrls = Optional.empty(); + } else { + this.multipartUploadUrls = Optional.of(multipartUploadUrls.get()); + } + return this; + } + + @java.lang.Override + public _FinalStage multipartUploadUrls(List multipartUploadUrls) { + this.multipartUploadUrls = Optional.ofNullable(multipartUploadUrls); + return this; + } + + @java.lang.Override + @JsonSetter(value = "multipart_upload_urls", nulls = Nulls.SKIP) + public _FinalStage multipartUploadUrls(Optional> multipartUploadUrls) { + this.multipartUploadUrls = multipartUploadUrls; + return this; + } + + /** + *

The ID of the multipart upload, passed back to complete. Present only on create, and only for multipart uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartUploadId(Nullable multipartUploadId) { + if (multipartUploadId.isNull()) { + this.multipartUploadId = null; + } else if (multipartUploadId.isEmpty()) { + this.multipartUploadId = Optional.empty(); + } else { + this.multipartUploadId = Optional.of(multipartUploadId.get()); + } + return this; + } + + /** + *

The ID of the multipart upload, passed back to complete. Present only on create, and only for multipart uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartUploadId(String multipartUploadId) { + this.multipartUploadId = Optional.ofNullable(multipartUploadId); + return this; + } + + /** + *

The ID of the multipart upload, passed back to complete. Present only on create, and only for multipart uploads.

+ */ + @java.lang.Override + @JsonSetter(value = "multipart_upload_id", nulls = Nulls.SKIP) + public _FinalStage multipartUploadId(Optional multipartUploadId) { + this.multipartUploadId = multipartUploadId; + return this; + } + + /** + *

The byte size each part (except the last) must be. Present only on create, and only for multipart uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartChunkSize(Nullable multipartChunkSize) { + if (multipartChunkSize.isNull()) { + this.multipartChunkSize = null; + } else if (multipartChunkSize.isEmpty()) { + this.multipartChunkSize = Optional.empty(); + } else { + this.multipartChunkSize = Optional.of(multipartChunkSize.get()); + } + return this; + } + + /** + *

The byte size each part (except the last) must be. Present only on create, and only for multipart uploads.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage multipartChunkSize(Integer multipartChunkSize) { + this.multipartChunkSize = Optional.ofNullable(multipartChunkSize); + return this; + } + + /** + *

The byte size each part (except the last) must be. Present only on create, and only for multipart uploads.

+ */ + @java.lang.Override + @JsonSetter(value = "multipart_chunk_size", nulls = Nulls.SKIP) + public _FinalStage multipartChunkSize(Optional multipartChunkSize) { + this.multipartChunkSize = multipartChunkSize; + return this; + } + /** - *

The original filename of the uploaded file, including its file extension.

+ *

The original filename, including its extension.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -412,7 +803,7 @@ public _FinalStage filename(Nullable filename) { } /** - *

The original filename of the uploaded file, including its file extension.

+ *

The original filename, including its extension.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -422,7 +813,7 @@ public _FinalStage filename(String filename) { } /** - *

The original filename of the uploaded file, including its file extension.

+ *

The original filename, including its extension.

*/ @java.lang.Override @JsonSetter(value = "filename", nulls = Nulls.SKIP) @@ -432,7 +823,7 @@ public _FinalStage filename(Optional filename) { } /** - *

The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).

+ *

The file's MIME type, e.g. application/pdf.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -448,7 +839,7 @@ public _FinalStage contentType(Nullable contentType) { } /** - *

The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).

+ *

The file's MIME type, e.g. application/pdf.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -458,7 +849,7 @@ public _FinalStage contentType(String contentType) { } /** - *

The MIME type of the uploaded file (e.g., image/jpeg, video/mp4, audio/mpeg).

+ *

The file's MIME type, e.g. application/pdf.

*/ @java.lang.Override @JsonSetter(value = "content_type", nulls = Nulls.SKIP) @@ -469,7 +860,22 @@ public _FinalStage contentType(Optional contentType) { @java.lang.Override public File build() { - return new File(contentType, filename, id, size, uploadStatus, url, visibility, additionalProperties); + return new File( + contentType, + createdAt, + filename, + id, + multipartChunkSize, + multipartUploadId, + multipartUploadUrls, + object, + size, + uploadHeaders, + uploadStatus, + uploadUrl, + url, + visibility, + additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/whop/api/types/FileMultipartUrl.java b/src/main/java/com/whop/api/types/FileMultipartUrl.java new file mode 100644 index 00000000..b59bcd8b --- /dev/null +++ b/src/main/java/com/whop/api/types/FileMultipartUrl.java @@ -0,0 +1,162 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = FileMultipartUrl.Builder.class) +public final class FileMultipartUrl { + private final int partNumber; + + private final String url; + + private final Map additionalProperties; + + private FileMultipartUrl(int partNumber, String url, Map additionalProperties) { + this.partNumber = partNumber; + this.url = url; + this.additionalProperties = additionalProperties; + } + + /** + * @return The 1-based index of this part within the multipart upload. + */ + @JsonProperty("part_number") + public int getPartNumber() { + return partNumber; + } + + /** + * @return The presigned URL to PUT this part's bytes to. + */ + @JsonProperty("url") + public String getUrl() { + return url; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof FileMultipartUrl && equalTo((FileMultipartUrl) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(FileMultipartUrl other) { + return partNumber == other.partNumber && url.equals(other.url); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash(this.partNumber, this.url); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static PartNumberStage builder() { + return new Builder(); + } + + public interface PartNumberStage { + /** + *

The 1-based index of this part within the multipart upload.

+ */ + UrlStage partNumber(int partNumber); + + Builder from(FileMultipartUrl other); + } + + public interface UrlStage { + /** + *

The presigned URL to PUT this part's bytes to.

+ */ + _FinalStage url(@NotNull String url); + } + + public interface _FinalStage { + FileMultipartUrl build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements PartNumberStage, UrlStage, _FinalStage { + private int partNumber; + + private String url; + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(FileMultipartUrl other) { + partNumber(other.getPartNumber()); + url(other.getUrl()); + return this; + } + + /** + *

The 1-based index of this part within the multipart upload.

+ *

The 1-based index of this part within the multipart upload.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("part_number") + public UrlStage partNumber(int partNumber) { + this.partNumber = partNumber; + return this; + } + + /** + *

The presigned URL to PUT this part's bytes to.

+ *

The presigned URL to PUT this part's bytes to.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("url") + public _FinalStage url(@NotNull String url) { + this.url = Objects.requireNonNull(url, "url must not be null"); + return this; + } + + @java.lang.Override + public FileMultipartUrl build() { + return new FileMultipartUrl(partNumber, url, additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/FileUploadStatus.java b/src/main/java/com/whop/api/types/FileUploadStatus.java new file mode 100644 index 00000000..aefbc870 --- /dev/null +++ b/src/main/java/com/whop/api/types/FileUploadStatus.java @@ -0,0 +1,103 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class FileUploadStatus { + public static final FileUploadStatus FAILED = new FileUploadStatus(Value.FAILED, "failed"); + + public static final FileUploadStatus PENDING = new FileUploadStatus(Value.PENDING, "pending"); + + public static final FileUploadStatus PROCESSING = new FileUploadStatus(Value.PROCESSING, "processing"); + + public static final FileUploadStatus READY = new FileUploadStatus(Value.READY, "ready"); + + private final Value value; + + private final String string; + + FileUploadStatus(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof FileUploadStatus && this.string.equals(((FileUploadStatus) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case FAILED: + return visitor.visitFailed(); + case PENDING: + return visitor.visitPending(); + case PROCESSING: + return visitor.visitProcessing(); + case READY: + return visitor.visitReady(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static FileUploadStatus valueOf(String value) { + switch (value) { + case "failed": + return FAILED; + case "pending": + return PENDING; + case "processing": + return PROCESSING; + case "ready": + return READY; + default: + return new FileUploadStatus(Value.UNKNOWN, value); + } + } + + public enum Value { + PENDING, + + PROCESSING, + + READY, + + FAILED, + + UNKNOWN + } + + public interface Visitor { + T visitPending(); + + T visitProcessing(); + + T visitReady(); + + T visitFailed(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/ForumExperience.java b/src/main/java/com/whop/api/types/ForumExperience.java index f8d69d82..5cce1ba8 100644 --- a/src/main/java/com/whop/api/types/ForumExperience.java +++ b/src/main/java/com/whop/api/types/ForumExperience.java @@ -21,12 +21,15 @@ public final class ForumExperience { private final String id; + private final boolean isPublic; + private final String name; private final Map additionalProperties; - private ForumExperience(String id, String name, Map additionalProperties) { + private ForumExperience(String id, boolean isPublic, String name, Map additionalProperties) { this.id = id; + this.isPublic = isPublic; this.name = name; this.additionalProperties = additionalProperties; } @@ -39,6 +42,14 @@ public String getId() { return id; } + /** + * @return Whether this experience is publicly visible to all users, including those without a membership. + */ + @JsonProperty("is_public") + public boolean getIsPublic() { + return isPublic; + } + /** * @return The display name of this experience shown to users in the product navigation. Maximum 255 characters. */ @@ -59,12 +70,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(ForumExperience other) { - return id.equals(other.id) && name.equals(other.name); + return id.equals(other.id) && isPublic == other.isPublic && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.name); + return Objects.hash(this.id, this.isPublic, this.name); } @java.lang.Override @@ -80,11 +91,18 @@ public interface IdStage { /** *

The unique identifier for the experience.

*/ - NameStage id(@NotNull String id); + IsPublicStage id(@NotNull String id); Builder from(ForumExperience other); } + public interface IsPublicStage { + /** + *

Whether this experience is publicly visible to all users, including those without a membership.

+ */ + NameStage isPublic(boolean isPublic); + } + public interface NameStage { /** *

The display name of this experience shown to users in the product navigation. Maximum 255 characters.

@@ -101,9 +119,11 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, NameStage, _FinalStage { + public static final class Builder implements IdStage, IsPublicStage, NameStage, _FinalStage { private String id; + private boolean isPublic; + private String name; @JsonAnySetter @@ -114,6 +134,7 @@ private Builder() {} @java.lang.Override public Builder from(ForumExperience other) { id(other.getId()); + isPublic(other.getIsPublic()); name(other.getName()); return this; } @@ -125,11 +146,23 @@ public Builder from(ForumExperience other) { */ @java.lang.Override @JsonSetter("id") - public NameStage id(@NotNull String id) { + public IsPublicStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } + /** + *

Whether this experience is publicly visible to all users, including those without a membership.

+ *

Whether this experience is publicly visible to all users, including those without a membership.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("is_public") + public NameStage isPublic(boolean isPublic) { + this.isPublic = isPublic; + return this; + } + /** *

The display name of this experience shown to users in the product navigation. Maximum 255 characters.

*

The display name of this experience shown to users in the product navigation. Maximum 255 characters.

@@ -144,7 +177,7 @@ public _FinalStage name(@NotNull String name) { @java.lang.Override public ForumExperience build() { - return new ForumExperience(id, name, additionalProperties); + return new ForumExperience(id, isPublic, name, additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/whop/api/types/ForumListItemExperience.java b/src/main/java/com/whop/api/types/ForumListItemExperience.java index d6f726e1..6217870e 100644 --- a/src/main/java/com/whop/api/types/ForumListItemExperience.java +++ b/src/main/java/com/whop/api/types/ForumListItemExperience.java @@ -21,12 +21,16 @@ public final class ForumListItemExperience { private final String id; + private final boolean isPublic; + private final String name; private final Map additionalProperties; - private ForumListItemExperience(String id, String name, Map additionalProperties) { + private ForumListItemExperience( + String id, boolean isPublic, String name, Map additionalProperties) { this.id = id; + this.isPublic = isPublic; this.name = name; this.additionalProperties = additionalProperties; } @@ -39,6 +43,14 @@ public String getId() { return id; } + /** + * @return Whether this experience is publicly visible to all users, including those without a membership. + */ + @JsonProperty("is_public") + public boolean getIsPublic() { + return isPublic; + } + /** * @return The display name of this experience shown to users in the product navigation. Maximum 255 characters. */ @@ -59,12 +71,12 @@ public Map getAdditionalProperties() { } private boolean equalTo(ForumListItemExperience other) { - return id.equals(other.id) && name.equals(other.name); + return id.equals(other.id) && isPublic == other.isPublic && name.equals(other.name); } @java.lang.Override public int hashCode() { - return Objects.hash(this.id, this.name); + return Objects.hash(this.id, this.isPublic, this.name); } @java.lang.Override @@ -80,11 +92,18 @@ public interface IdStage { /** *

The unique identifier for the experience.

*/ - NameStage id(@NotNull String id); + IsPublicStage id(@NotNull String id); Builder from(ForumListItemExperience other); } + public interface IsPublicStage { + /** + *

Whether this experience is publicly visible to all users, including those without a membership.

+ */ + NameStage isPublic(boolean isPublic); + } + public interface NameStage { /** *

The display name of this experience shown to users in the product navigation. Maximum 255 characters.

@@ -101,9 +120,11 @@ public interface _FinalStage { } @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, NameStage, _FinalStage { + public static final class Builder implements IdStage, IsPublicStage, NameStage, _FinalStage { private String id; + private boolean isPublic; + private String name; @JsonAnySetter @@ -114,6 +135,7 @@ private Builder() {} @java.lang.Override public Builder from(ForumListItemExperience other) { id(other.getId()); + isPublic(other.getIsPublic()); name(other.getName()); return this; } @@ -125,11 +147,23 @@ public Builder from(ForumListItemExperience other) { */ @java.lang.Override @JsonSetter("id") - public NameStage id(@NotNull String id) { + public IsPublicStage id(@NotNull String id) { this.id = Objects.requireNonNull(id, "id must not be null"); return this; } + /** + *

Whether this experience is publicly visible to all users, including those without a membership.

+ *

Whether this experience is publicly visible to all users, including those without a membership.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("is_public") + public NameStage isPublic(boolean isPublic) { + this.isPublic = isPublic; + return this; + } + /** *

The display name of this experience shown to users in the product navigation. Maximum 255 characters.

*

The display name of this experience shown to users in the product navigation. Maximum 255 characters.

@@ -144,7 +178,7 @@ public _FinalStage name(@NotNull String name) { @java.lang.Override public ForumListItemExperience build() { - return new ForumListItemExperience(id, name, additionalProperties); + return new ForumListItemExperience(id, isPublic, name, additionalProperties); } @java.lang.Override diff --git a/src/main/java/com/whop/api/types/InvoiceLineItemsItem.java b/src/main/java/com/whop/api/types/InvoiceLineItemsItem.java index 2fa1d6d0..c99aa27b 100644 --- a/src/main/java/com/whop/api/types/InvoiceLineItemsItem.java +++ b/src/main/java/com/whop/api/types/InvoiceLineItemsItem.java @@ -79,7 +79,7 @@ public double getTotal() { } /** - * @return The unit price for this line item. + * @return The unit price for this line item. Negative for a credit or deduction. */ @JsonProperty("unit_price") public double getUnitPrice() { @@ -151,7 +151,7 @@ public interface TotalStage { public interface UnitPriceStage { /** - *

The unit price for this line item.

+ *

The unit price for this line item. Negative for a credit or deduction.

*/ _FinalStage unitPrice(double unitPrice); } @@ -241,8 +241,8 @@ public UnitPriceStage total(double total) { } /** - *

The unit price for this line item.

- *

The unit price for this line item.

+ *

The unit price for this line item. Negative for a credit or deduction.

+ *

The unit price for this line item. Negative for a credit or deduction.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override diff --git a/src/main/java/com/whop/api/types/InvoiceListItemLineItemsItem.java b/src/main/java/com/whop/api/types/InvoiceListItemLineItemsItem.java index d4eeabfc..e2e82c6f 100644 --- a/src/main/java/com/whop/api/types/InvoiceListItemLineItemsItem.java +++ b/src/main/java/com/whop/api/types/InvoiceListItemLineItemsItem.java @@ -79,7 +79,7 @@ public double getTotal() { } /** - * @return The unit price for this line item. + * @return The unit price for this line item. Negative for a credit or deduction. */ @JsonProperty("unit_price") public double getUnitPrice() { @@ -151,7 +151,7 @@ public interface TotalStage { public interface UnitPriceStage { /** - *

The unit price for this line item.

+ *

The unit price for this line item. Negative for a credit or deduction.

*/ _FinalStage unitPrice(double unitPrice); } @@ -241,8 +241,8 @@ public UnitPriceStage total(double total) { } /** - *

The unit price for this line item.

- *

The unit price for this line item.

+ *

The unit price for this line item. Negative for a credit or deduction.

+ *

The unit price for this line item. Negative for a credit or deduction.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override diff --git a/src/main/java/com/whop/api/types/LedgerActivity.java b/src/main/java/com/whop/api/types/LedgerActivity.java index 19b0c916..b0f50cf9 100644 --- a/src/main/java/com/whop/api/types/LedgerActivity.java +++ b/src/main/java/com/whop/api/types/LedgerActivity.java @@ -43,6 +43,8 @@ public final class LedgerActivity { private final LedgerActivityObject object; + private final Optional payment; + private final OffsetDateTime postedAt; private final Optional resource; @@ -61,6 +63,7 @@ private LedgerActivity( Optional ledgerAccountId, LedgerActivityLineType lineType, LedgerActivityObject object, + Optional payment, OffsetDateTime postedAt, Optional resource, Optional source, @@ -74,6 +77,7 @@ private LedgerActivity( this.ledgerAccountId = ledgerAccountId; this.lineType = lineType; this.object = object; + this.payment = payment; this.postedAt = postedAt; this.resource = resource; this.source = source; @@ -158,6 +162,17 @@ public LedgerActivityObject getObject() { return object; } + /** + * @return Payment related to this ledger activity. Included when rich resource hydration is enabled and the movement is tied to a payment. + */ + @JsonIgnore + public Optional getPayment() { + if (payment == null) { + return Optional.empty(); + } + return payment; + } + /** * @return When the activity posted to the ledger. */ @@ -206,6 +221,12 @@ private Optional _getLedgerAccountId() { return ledgerAccountId; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment") + private Optional _getPayment() { + return payment; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("resource") private Optional _getResource() { @@ -239,6 +260,7 @@ private boolean equalTo(LedgerActivity other) { && ledgerAccountId.equals(other.ledgerAccountId) && lineType.equals(other.lineType) && object.equals(other.object) + && payment.equals(other.payment) && postedAt.equals(other.postedAt) && resource.equals(other.resource) && source.equals(other.source); @@ -256,6 +278,7 @@ public int hashCode() { this.ledgerAccountId, this.lineType, this.object, + this.payment, this.postedAt, this.resource, this.source); @@ -352,6 +375,15 @@ public interface _FinalStage { _FinalStage ledgerAccountId(Nullable ledgerAccountId); + /** + *

Payment related to this ledger activity. Included when rich resource hydration is enabled and the movement is tied to a payment.

+ */ + _FinalStage payment(Optional payment); + + _FinalStage payment(LedgerActivityPayment payment); + + _FinalStage payment(Nullable payment); + /** *

Resource associated with this ledger activity.

*/ @@ -390,6 +422,8 @@ public static final class Builder private Optional resource = Optional.empty(); + private Optional payment = Optional.empty(); + private Optional ledgerAccountId = Optional.empty(); private Optional createdAt = Optional.empty(); @@ -414,6 +448,7 @@ public Builder from(LedgerActivity other) { ledgerAccountId(other.getLedgerAccountId()); lineType(other.getLineType()); object(other.getObject()); + payment(other.getPayment()); postedAt(other.getPostedAt()); resource(other.getResource()); source(other.getSource()); @@ -559,6 +594,42 @@ public _FinalStage resource(Optional resource) { return this; } + /** + *

Payment related to this ledger activity. Included when rich resource hydration is enabled and the movement is tied to a payment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage payment(Nullable payment) { + if (payment.isNull()) { + this.payment = null; + } else if (payment.isEmpty()) { + this.payment = Optional.empty(); + } else { + this.payment = Optional.of(payment.get()); + } + return this; + } + + /** + *

Payment related to this ledger activity. Included when rich resource hydration is enabled and the movement is tied to a payment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage payment(LedgerActivityPayment payment) { + this.payment = Optional.ofNullable(payment); + return this; + } + + /** + *

Payment related to this ledger activity. Included when rich resource hydration is enabled and the movement is tied to a payment.

+ */ + @java.lang.Override + @JsonSetter(value = "payment", nulls = Nulls.SKIP) + public _FinalStage payment(Optional payment) { + this.payment = payment; + return this; + } + /** *

The ledger account (a ldgr_ identifier) this row belongs to. Present only when the response aggregates owned accounts (include_owned_accounts=true); omitted otherwise. Pair it with account to scope drawers and dashboard links to the owning business.

* @return Reference to {@code this} so that method calls can be chained together. @@ -699,6 +770,7 @@ public LedgerActivity build() { ledgerAccountId, lineType, object, + payment, postedAt, resource, source, diff --git a/src/main/java/com/whop/api/types/LedgerActivityLineType.java b/src/main/java/com/whop/api/types/LedgerActivityLineType.java index 62f9fcf3..2c0209c0 100644 --- a/src/main/java/com/whop/api/types/LedgerActivityLineType.java +++ b/src/main/java/com/whop/api/types/LedgerActivityLineType.java @@ -28,58 +28,23 @@ public final class LedgerActivityLineType { public static final LedgerActivityLineType RESOLUTION_CENTER_REFUND = new LedgerActivityLineType(Value.RESOLUTION_CENTER_REFUND, "resolution_center_refund"); - public static final LedgerActivityLineType AD_PUBLISHER_PAYOUT = - new LedgerActivityLineType(Value.AD_PUBLISHER_PAYOUT, "ad_publisher_payout"); - - public static final LedgerActivityLineType BILLING_PERCENTAGE_FEE = - new LedgerActivityLineType(Value.BILLING_PERCENTAGE_FEE, "billing_percentage_fee"); - - public static final LedgerActivityLineType PAYMENT_DISPUTE = - new LedgerActivityLineType(Value.PAYMENT_DISPUTE, "payment_dispute"); - - public static final LedgerActivityLineType PAYMENT_DISPUTE_ADJUSTMENT = - new LedgerActivityLineType(Value.PAYMENT_DISPUTE_ADJUSTMENT, "payment_dispute_adjustment"); - - public static final LedgerActivityLineType PAYMENT_PROCESSING_PERCENTAGE_FEE = - new LedgerActivityLineType(Value.PAYMENT_PROCESSING_PERCENTAGE_FEE, "payment_processing_percentage_fee"); - public static final LedgerActivityLineType THREE_DS_FIXED_FEE = new LedgerActivityLineType(Value.THREE_DS_FIXED_FEE, "three_ds_fixed_fee"); public static final LedgerActivityLineType PAYMENT_REVSHARE_REFUND = new LedgerActivityLineType(Value.PAYMENT_REVSHARE_REFUND, "payment_revshare_refund"); - public static final LedgerActivityLineType DISPUTE_ALERT_FEE = - new LedgerActivityLineType(Value.DISPUTE_ALERT_FEE, "dispute_alert_fee"); - - public static final LedgerActivityLineType APPLICATION_FEE = - new LedgerActivityLineType(Value.APPLICATION_FEE, "application_fee"); - public static final LedgerActivityLineType AIRDROP_LINK_RETURNED = new LedgerActivityLineType(Value.AIRDROP_LINK_RETURNED, "airdrop_link_returned"); - public static final LedgerActivityLineType WITHDRAWAL = new LedgerActivityLineType(Value.WITHDRAWAL, "withdrawal"); - public static final LedgerActivityLineType PAYOUT_FEE = new LedgerActivityLineType(Value.PAYOUT_FEE, "payout_fee"); public static final LedgerActivityLineType INSTALLMENT_DEFAULT = new LedgerActivityLineType(Value.INSTALLMENT_DEFAULT, "installment_default"); - public static final LedgerActivityLineType ONCHAIN_WALLET_TRANSFER_OUTGOING = - new LedgerActivityLineType(Value.ONCHAIN_WALLET_TRANSFER_OUTGOING, "onchain_wallet_transfer_outgoing"); - - public static final LedgerActivityLineType LICENSE_SALE = - new LedgerActivityLineType(Value.LICENSE_SALE, "license_sale"); - - public static final LedgerActivityLineType APPLICATION_FEE_PAYOUT = - new LedgerActivityLineType(Value.APPLICATION_FEE_PAYOUT, "application_fee_payout"); - public static final LedgerActivityLineType PLATFORM_BALANCE_PAYMENT = new LedgerActivityLineType(Value.PLATFORM_BALANCE_PAYMENT, "platform_balance_payment"); - public static final LedgerActivityLineType LEGACY_PAYMENT = - new LedgerActivityLineType(Value.LEGACY_PAYMENT, "legacy_payment"); - public static final LedgerActivityLineType AD_PUBLISHER_PAYOUT_RECEIVED = new LedgerActivityLineType(Value.AD_PUBLISHER_PAYOUT_RECEIVED, "ad_publisher_payout_received"); @@ -89,67 +54,30 @@ public final class LedgerActivityLineType { public static final LedgerActivityLineType LEGACY_CRYPTO_PAYMENT = new LedgerActivityLineType(Value.LEGACY_CRYPTO_PAYMENT, "legacy_crypto_payment"); - public static final LedgerActivityLineType AD_BUDGET_RELEASE = - new LedgerActivityLineType(Value.AD_BUDGET_RELEASE, "ad_budget_release"); - - public static final LedgerActivityLineType AD_SPEND_CHARGE = - new LedgerActivityLineType(Value.AD_SPEND_CHARGE, "ad_spend_charge"); - public static final LedgerActivityLineType PLATFORM_BALANCE_TRANSFER_INCOMING = new LedgerActivityLineType(Value.PLATFORM_BALANCE_TRANSFER_INCOMING, "platform_balance_transfer_incoming"); public static final LedgerActivityLineType PAYMENT_REFERRAL = new LedgerActivityLineType(Value.PAYMENT_REFERRAL, "payment_referral"); - public static final LedgerActivityLineType PROMO_REVERSAL = - new LedgerActivityLineType(Value.PROMO_REVERSAL, "promo_reversal"); - public static final LedgerActivityLineType TOPUP_REVERSAL = new LedgerActivityLineType(Value.TOPUP_REVERSAL, "topup_reversal"); - public static final LedgerActivityLineType PLATFORM_AFFILIATE_PAYMENT_REVERSAL = new LedgerActivityLineType( - Value.PLATFORM_AFFILIATE_PAYMENT_REVERSAL, "platform_affiliate_payment_reversal"); - - public static final LedgerActivityLineType AIRDROP = new LedgerActivityLineType(Value.AIRDROP, "airdrop"); - public static final LedgerActivityLineType WITHDRAWAL_CLAWBACK_REVERSAL = new LedgerActivityLineType(Value.WITHDRAWAL_CLAWBACK_REVERSAL, "withdrawal_clawback_reversal"); public static final LedgerActivityLineType CARD_SPEND_AUTHORIZATION = new LedgerActivityLineType(Value.CARD_SPEND_AUTHORIZATION, "card_spend_authorization"); - public static final LedgerActivityLineType LICENSE_SALE_REVENUE = - new LedgerActivityLineType(Value.LICENSE_SALE_REVENUE, "license_sale_revenue"); - - public static final LedgerActivityLineType TOPUP = new LedgerActivityLineType(Value.TOPUP, "topup"); - - public static final LedgerActivityLineType HIGH_RISK_MERCHANT_FEE = - new LedgerActivityLineType(Value.HIGH_RISK_MERCHANT_FEE, "high_risk_merchant_fee"); - public static final LedgerActivityLineType PAYMENT_REVSHARE_PAYOUT = new LedgerActivityLineType(Value.PAYMENT_REVSHARE_PAYOUT, "payment_revshare_payout"); - public static final LedgerActivityLineType INTERNAL_BALANCE_TRANSFER_INCOMING = - new LedgerActivityLineType(Value.INTERNAL_BALANCE_TRANSFER_INCOMING, "internal_balance_transfer_incoming"); - public static final LedgerActivityLineType PAYMENT_REFUND_REVERSAL = new LedgerActivityLineType(Value.PAYMENT_REFUND_REVERSAL, "payment_refund_reversal"); - public static final LedgerActivityLineType ONCHAIN_DEPOSIT = - new LedgerActivityLineType(Value.ONCHAIN_DEPOSIT, "onchain_deposit"); - - public static final LedgerActivityLineType WITHDRAWAL_RECLASSIFICATION = - new LedgerActivityLineType(Value.WITHDRAWAL_RECLASSIFICATION, "withdrawal_reclassification"); - public static final LedgerActivityLineType FRAUD_PREVENTION_FEE = new LedgerActivityLineType(Value.FRAUD_PREVENTION_FEE, "fraud_prevention_fee"); - public static final LedgerActivityLineType STRIPE_DOMESTIC_PROCESSING_FEE = - new LedgerActivityLineType(Value.STRIPE_DOMESTIC_PROCESSING_FEE, "stripe_domestic_processing_fee"); - - public static final LedgerActivityLineType MISC_PURCHASE = - new LedgerActivityLineType(Value.MISC_PURCHASE, "misc_purchase"); - public static final LedgerActivityLineType PLATFORM_BALANCE_TRANSFER_OUTGOING = new LedgerActivityLineType(Value.PLATFORM_BALANCE_TRANSFER_OUTGOING, "platform_balance_transfer_outgoing"); @@ -165,12 +93,6 @@ public final class LedgerActivityLineType { public static final LedgerActivityLineType AD_CAMPAIGN_BUDGET = new LedgerActivityLineType(Value.AD_CAMPAIGN_BUDGET, "ad_campaign_budget"); - public static final LedgerActivityLineType SOFTWARE_RENTAL_TRANSACTION = - new LedgerActivityLineType(Value.SOFTWARE_RENTAL_TRANSACTION, "software_rental_transaction"); - - public static final LedgerActivityLineType CURRENCY_CONVERSION_INCOMING = - new LedgerActivityLineType(Value.CURRENCY_CONVERSION_INCOMING, "currency_conversion_incoming"); - public static final LedgerActivityLineType AFFILIATE_FEE = new LedgerActivityLineType(Value.AFFILIATE_FEE, "affiliate_fee"); @@ -183,18 +105,9 @@ public final class LedgerActivityLineType { public static final LedgerActivityLineType LEGACY_PAYMENT_REFUND = new LedgerActivityLineType(Value.LEGACY_PAYMENT_REFUND, "legacy_payment_refund"); - public static final LedgerActivityLineType PASSTHROUGH_GMV = - new LedgerActivityLineType(Value.PASSTHROUGH_GMV, "passthrough_gmv"); - - public static final LedgerActivityLineType DISPUTE_HOLD_ADJUSTMENT = - new LedgerActivityLineType(Value.DISPUTE_HOLD_ADJUSTMENT, "dispute_hold_adjustment"); - public static final LedgerActivityLineType INTERNAL_WITHDRAWAL = new LedgerActivityLineType(Value.INTERNAL_WITHDRAWAL, "internal_withdrawal"); - public static final LedgerActivityLineType PAYMENT_GROSS = - new LedgerActivityLineType(Value.PAYMENT_GROSS, "payment_gross"); - public static final LedgerActivityLineType BANK_TRANSFER = new LedgerActivityLineType(Value.BANK_TRANSFER, "bank_transfer"); @@ -204,44 +117,24 @@ public final class LedgerActivityLineType { public static final LedgerActivityLineType INTERNAL_BALANCE_TRANSFER_OUTGOING = new LedgerActivityLineType(Value.INTERNAL_BALANCE_TRANSFER_OUTGOING, "internal_balance_transfer_outgoing"); - public static final LedgerActivityLineType SALES_TAX_REMITTANCE_REVERSAL = - new LedgerActivityLineType(Value.SALES_TAX_REMITTANCE_REVERSAL, "sales_tax_remittance_reversal"); + public static final LedgerActivityLineType BALANCE_RESERVATION_REVERSAL = + new LedgerActivityLineType(Value.BALANCE_RESERVATION_REVERSAL, "balance_reservation_reversal"); public static final LedgerActivityLineType WITHDRAWAL_CLAWBACK = new LedgerActivityLineType(Value.WITHDRAWAL_CLAWBACK, "withdrawal_clawback"); - public static final LedgerActivityLineType LICENSE_SALE_COMMISSION = - new LedgerActivityLineType(Value.LICENSE_SALE_COMMISSION, "license_sale_commission"); - public static final LedgerActivityLineType REVSHARE_PERCENTAGE_FEE = new LedgerActivityLineType(Value.REVSHARE_PERCENTAGE_FEE, "revshare_percentage_fee"); - public static final LedgerActivityLineType SALES_TAX_FEE = - new LedgerActivityLineType(Value.SALES_TAX_FEE, "sales_tax_fee"); - - public static final LedgerActivityLineType WITHDRAWAL_REVERSAL = - new LedgerActivityLineType(Value.WITHDRAWAL_REVERSAL, "withdrawal_reversal"); - public static final LedgerActivityLineType AIRDROP_REVERSAL = new LedgerActivityLineType(Value.AIRDROP_REVERSAL, "airdrop_reversal"); public static final LedgerActivityLineType PAYMENT_REFUND = new LedgerActivityLineType(Value.PAYMENT_REFUND, "payment_refund"); - public static final LedgerActivityLineType CROSS_BORDER_PERCENTAGE_FEE = - new LedgerActivityLineType(Value.CROSS_BORDER_PERCENTAGE_FEE, "cross_border_percentage_fee"); - - public static final LedgerActivityLineType TOPUP_FEE = new LedgerActivityLineType(Value.TOPUP_FEE, "topup_fee"); - public static final LedgerActivityLineType AIRDROP_LINK_CREATED = new LedgerActivityLineType(Value.AIRDROP_LINK_CREATED, "airdrop_link_created"); - public static final LedgerActivityLineType FX_PERCENTAGE_FEE = - new LedgerActivityLineType(Value.FX_PERCENTAGE_FEE, "fx_percentage_fee"); - - public static final LedgerActivityLineType CURRENCY_CONVERSION_OUTGOING = - new LedgerActivityLineType(Value.CURRENCY_CONVERSION_OUTGOING, "currency_conversion_outgoing"); - public static final LedgerActivityLineType COMPANY_REFERRAL = new LedgerActivityLineType(Value.COMPANY_REFERRAL, "company_referral"); @@ -254,15 +147,137 @@ public final class LedgerActivityLineType { public static final LedgerActivityLineType PAYMENT_REVSHARE_REVERSAL = new LedgerActivityLineType(Value.PAYMENT_REVSHARE_REVERSAL, "payment_revshare_reversal"); + public static final LedgerActivityLineType MISC_REFUND = + new LedgerActivityLineType(Value.MISC_REFUND, "misc_refund"); + + public static final LedgerActivityLineType ONCHAIN_WALLET_TRANSFER_INCOMING = + new LedgerActivityLineType(Value.ONCHAIN_WALLET_TRANSFER_INCOMING, "onchain_wallet_transfer_incoming"); + + public static final LedgerActivityLineType PAYMENT_REVSHARE = + new LedgerActivityLineType(Value.PAYMENT_REVSHARE, "payment_revshare"); + + public static final LedgerActivityLineType PAYMENT_DISPUTE_FEE = + new LedgerActivityLineType(Value.PAYMENT_DISPUTE_FEE, "payment_dispute_fee"); + + public static final LedgerActivityLineType AD_PUBLISHER_PAYOUT = + new LedgerActivityLineType(Value.AD_PUBLISHER_PAYOUT, "ad_publisher_payout"); + + public static final LedgerActivityLineType BILLING_PERCENTAGE_FEE = + new LedgerActivityLineType(Value.BILLING_PERCENTAGE_FEE, "billing_percentage_fee"); + + public static final LedgerActivityLineType PAYMENT_DISPUTE = + new LedgerActivityLineType(Value.PAYMENT_DISPUTE, "payment_dispute"); + + public static final LedgerActivityLineType PAYMENT_DISPUTE_ADJUSTMENT = + new LedgerActivityLineType(Value.PAYMENT_DISPUTE_ADJUSTMENT, "payment_dispute_adjustment"); + + public static final LedgerActivityLineType PAYMENT_PROCESSING_PERCENTAGE_FEE = + new LedgerActivityLineType(Value.PAYMENT_PROCESSING_PERCENTAGE_FEE, "payment_processing_percentage_fee"); + + public static final LedgerActivityLineType DISPUTE_ALERT_FEE = + new LedgerActivityLineType(Value.DISPUTE_ALERT_FEE, "dispute_alert_fee"); + + public static final LedgerActivityLineType APPLICATION_FEE = + new LedgerActivityLineType(Value.APPLICATION_FEE, "application_fee"); + + public static final LedgerActivityLineType WITHDRAWAL = new LedgerActivityLineType(Value.WITHDRAWAL, "withdrawal"); + + public static final LedgerActivityLineType BALANCE_RESERVATION = + new LedgerActivityLineType(Value.BALANCE_RESERVATION, "balance_reservation"); + + public static final LedgerActivityLineType ONCHAIN_WALLET_TRANSFER_OUTGOING = + new LedgerActivityLineType(Value.ONCHAIN_WALLET_TRANSFER_OUTGOING, "onchain_wallet_transfer_outgoing"); + + public static final LedgerActivityLineType LICENSE_SALE = + new LedgerActivityLineType(Value.LICENSE_SALE, "license_sale"); + + public static final LedgerActivityLineType APPLICATION_FEE_PAYOUT = + new LedgerActivityLineType(Value.APPLICATION_FEE_PAYOUT, "application_fee_payout"); + + public static final LedgerActivityLineType LEGACY_PAYMENT = + new LedgerActivityLineType(Value.LEGACY_PAYMENT, "legacy_payment"); + + public static final LedgerActivityLineType AD_BUDGET_RELEASE = + new LedgerActivityLineType(Value.AD_BUDGET_RELEASE, "ad_budget_release"); + + public static final LedgerActivityLineType AD_SPEND_CHARGE = + new LedgerActivityLineType(Value.AD_SPEND_CHARGE, "ad_spend_charge"); + + public static final LedgerActivityLineType PROMO_REVERSAL = + new LedgerActivityLineType(Value.PROMO_REVERSAL, "promo_reversal"); + + public static final LedgerActivityLineType PLATFORM_AFFILIATE_PAYMENT_REVERSAL = new LedgerActivityLineType( + Value.PLATFORM_AFFILIATE_PAYMENT_REVERSAL, "platform_affiliate_payment_reversal"); + + public static final LedgerActivityLineType AIRDROP = new LedgerActivityLineType(Value.AIRDROP, "airdrop"); + + public static final LedgerActivityLineType LICENSE_SALE_REVENUE = + new LedgerActivityLineType(Value.LICENSE_SALE_REVENUE, "license_sale_revenue"); + + public static final LedgerActivityLineType TOPUP = new LedgerActivityLineType(Value.TOPUP, "topup"); + + public static final LedgerActivityLineType HIGH_RISK_MERCHANT_FEE = + new LedgerActivityLineType(Value.HIGH_RISK_MERCHANT_FEE, "high_risk_merchant_fee"); + + public static final LedgerActivityLineType INTERNAL_BALANCE_TRANSFER_INCOMING = + new LedgerActivityLineType(Value.INTERNAL_BALANCE_TRANSFER_INCOMING, "internal_balance_transfer_incoming"); + + public static final LedgerActivityLineType ONCHAIN_DEPOSIT = + new LedgerActivityLineType(Value.ONCHAIN_DEPOSIT, "onchain_deposit"); + + public static final LedgerActivityLineType WITHDRAWAL_RECLASSIFICATION = + new LedgerActivityLineType(Value.WITHDRAWAL_RECLASSIFICATION, "withdrawal_reclassification"); + + public static final LedgerActivityLineType STRIPE_DOMESTIC_PROCESSING_FEE = + new LedgerActivityLineType(Value.STRIPE_DOMESTIC_PROCESSING_FEE, "stripe_domestic_processing_fee"); + + public static final LedgerActivityLineType MISC_PURCHASE = + new LedgerActivityLineType(Value.MISC_PURCHASE, "misc_purchase"); + + public static final LedgerActivityLineType SOFTWARE_RENTAL_TRANSACTION = + new LedgerActivityLineType(Value.SOFTWARE_RENTAL_TRANSACTION, "software_rental_transaction"); + + public static final LedgerActivityLineType CURRENCY_CONVERSION_INCOMING = + new LedgerActivityLineType(Value.CURRENCY_CONVERSION_INCOMING, "currency_conversion_incoming"); + + public static final LedgerActivityLineType PASSTHROUGH_GMV = + new LedgerActivityLineType(Value.PASSTHROUGH_GMV, "passthrough_gmv"); + + public static final LedgerActivityLineType DISPUTE_HOLD_ADJUSTMENT = + new LedgerActivityLineType(Value.DISPUTE_HOLD_ADJUSTMENT, "dispute_hold_adjustment"); + + public static final LedgerActivityLineType PAYMENT_GROSS = + new LedgerActivityLineType(Value.PAYMENT_GROSS, "payment_gross"); + + public static final LedgerActivityLineType SALES_TAX_REMITTANCE_REVERSAL = + new LedgerActivityLineType(Value.SALES_TAX_REMITTANCE_REVERSAL, "sales_tax_remittance_reversal"); + + public static final LedgerActivityLineType LICENSE_SALE_COMMISSION = + new LedgerActivityLineType(Value.LICENSE_SALE_COMMISSION, "license_sale_commission"); + + public static final LedgerActivityLineType SALES_TAX_FEE = + new LedgerActivityLineType(Value.SALES_TAX_FEE, "sales_tax_fee"); + + public static final LedgerActivityLineType WITHDRAWAL_REVERSAL = + new LedgerActivityLineType(Value.WITHDRAWAL_REVERSAL, "withdrawal_reversal"); + + public static final LedgerActivityLineType CROSS_BORDER_PERCENTAGE_FEE = + new LedgerActivityLineType(Value.CROSS_BORDER_PERCENTAGE_FEE, "cross_border_percentage_fee"); + + public static final LedgerActivityLineType TOPUP_FEE = new LedgerActivityLineType(Value.TOPUP_FEE, "topup_fee"); + + public static final LedgerActivityLineType FX_PERCENTAGE_FEE = + new LedgerActivityLineType(Value.FX_PERCENTAGE_FEE, "fx_percentage_fee"); + + public static final LedgerActivityLineType CURRENCY_CONVERSION_OUTGOING = + new LedgerActivityLineType(Value.CURRENCY_CONVERSION_OUTGOING, "currency_conversion_outgoing"); + public static final LedgerActivityLineType PLATFORM_AFFILIATE_PAYMENT = new LedgerActivityLineType(Value.PLATFORM_AFFILIATE_PAYMENT, "platform_affiliate_payment"); public static final LedgerActivityLineType SALES_TAX_REMITTANCE = new LedgerActivityLineType(Value.SALES_TAX_REMITTANCE, "sales_tax_remittance"); - public static final LedgerActivityLineType MISC_REFUND = - new LedgerActivityLineType(Value.MISC_REFUND, "misc_refund"); - public static final LedgerActivityLineType PAYMENT_PROCESSING_FIXED_FEE = new LedgerActivityLineType(Value.PAYMENT_PROCESSING_FIXED_FEE, "payment_processing_fixed_fee"); @@ -277,15 +292,6 @@ public final class LedgerActivityLineType { public static final LedgerActivityLineType WHOP_PROCESSING_FEE = new LedgerActivityLineType(Value.WHOP_PROCESSING_FEE, "whop_processing_fee"); - public static final LedgerActivityLineType ONCHAIN_WALLET_TRANSFER_INCOMING = - new LedgerActivityLineType(Value.ONCHAIN_WALLET_TRANSFER_INCOMING, "onchain_wallet_transfer_incoming"); - - public static final LedgerActivityLineType PAYMENT_REVSHARE = - new LedgerActivityLineType(Value.PAYMENT_REVSHARE, "payment_revshare"); - - public static final LedgerActivityLineType PAYMENT_DISPUTE_FEE = - new LedgerActivityLineType(Value.PAYMENT_DISPUTE_FEE, "payment_dispute_fee"); - private final Value value; private final String string; @@ -333,6 +339,94 @@ public T visit(Visitor visitor) { return visitor.visitPlatformCoveredDispute(); case RESOLUTION_CENTER_REFUND: return visitor.visitResolutionCenterRefund(); + case THREE_DS_FIXED_FEE: + return visitor.visitThreeDsFixedFee(); + case PAYMENT_REVSHARE_REFUND: + return visitor.visitPaymentRevshareRefund(); + case AIRDROP_LINK_RETURNED: + return visitor.visitAirdropLinkReturned(); + case PAYOUT_FEE: + return visitor.visitPayoutFee(); + case INSTALLMENT_DEFAULT: + return visitor.visitInstallmentDefault(); + case PLATFORM_BALANCE_PAYMENT: + return visitor.visitPlatformBalancePayment(); + case AD_PUBLISHER_PAYOUT_RECEIVED: + return visitor.visitAdPublisherPayoutReceived(); + case PAYMENT_REFERRAL_REVERSAL: + return visitor.visitPaymentReferralReversal(); + case LEGACY_CRYPTO_PAYMENT: + return visitor.visitLegacyCryptoPayment(); + case PLATFORM_BALANCE_TRANSFER_INCOMING: + return visitor.visitPlatformBalanceTransferIncoming(); + case PAYMENT_REFERRAL: + return visitor.visitPaymentReferral(); + case TOPUP_REVERSAL: + return visitor.visitTopupReversal(); + case WITHDRAWAL_CLAWBACK_REVERSAL: + return visitor.visitWithdrawalClawbackReversal(); + case CARD_SPEND_AUTHORIZATION: + return visitor.visitCardSpendAuthorization(); + case PAYMENT_REVSHARE_PAYOUT: + return visitor.visitPaymentRevsharePayout(); + case PAYMENT_REFUND_REVERSAL: + return visitor.visitPaymentRefundReversal(); + case FRAUD_PREVENTION_FEE: + return visitor.visitFraudPreventionFee(); + case PLATFORM_BALANCE_TRANSFER_OUTGOING: + return visitor.visitPlatformBalanceTransferOutgoing(); + case MISC_REVERSAL: + return visitor.visitMiscReversal(); + case AIRDROP_LINK_REDEEMED: + return visitor.visitAirdropLinkRedeemed(); + case ONCHAIN_SWAP_TARGET: + return visitor.visitOnchainSwapTarget(); + case AD_CAMPAIGN_BUDGET: + return visitor.visitAdCampaignBudget(); + case AFFILIATE_FEE: + return visitor.visitAffiliateFee(); + case CARD_SPEND_AUTHORIZATION_VOID: + return visitor.visitCardSpendAuthorizationVoid(); + case PAYMENT_GROSS_REVERSAL: + return visitor.visitPaymentGrossReversal(); + case LEGACY_PAYMENT_REFUND: + return visitor.visitLegacyPaymentRefund(); + case INTERNAL_WITHDRAWAL: + return visitor.visitInternalWithdrawal(); + case BANK_TRANSFER: + return visitor.visitBankTransfer(); + case REFERRAL_BONUS: + return visitor.visitReferralBonus(); + case INTERNAL_BALANCE_TRANSFER_OUTGOING: + return visitor.visitInternalBalanceTransferOutgoing(); + case BALANCE_RESERVATION_REVERSAL: + return visitor.visitBalanceReservationReversal(); + case WITHDRAWAL_CLAWBACK: + return visitor.visitWithdrawalClawback(); + case REVSHARE_PERCENTAGE_FEE: + return visitor.visitRevsharePercentageFee(); + case AIRDROP_REVERSAL: + return visitor.visitAirdropReversal(); + case PAYMENT_REFUND: + return visitor.visitPaymentRefund(); + case AIRDROP_LINK_CREATED: + return visitor.visitAirdropLinkCreated(); + case COMPANY_REFERRAL: + return visitor.visitCompanyReferral(); + case ORCHESTRATION_PERCENTAGE_FEE: + return visitor.visitOrchestrationPercentageFee(); + case CARD_SPEND_REFUND: + return visitor.visitCardSpendRefund(); + case PAYMENT_REVSHARE_REVERSAL: + return visitor.visitPaymentRevshareReversal(); + case MISC_REFUND: + return visitor.visitMiscRefund(); + case ONCHAIN_WALLET_TRANSFER_INCOMING: + return visitor.visitOnchainWalletTransferIncoming(); + case PAYMENT_REVSHARE: + return visitor.visitPaymentRevshare(); + case PAYMENT_DISPUTE_FEE: + return visitor.visitPaymentDisputeFee(); case AD_PUBLISHER_PAYOUT: return visitor.visitAdPublisherPayout(); case BILLING_PERCENTAGE_FEE: @@ -341,158 +435,80 @@ public T visit(Visitor visitor) { return visitor.visitPaymentDispute(); case PAYMENT_DISPUTE_ADJUSTMENT: return visitor.visitPaymentDisputeAdjustment(); - case PAYMENT_PROCESSING_PERCENTAGE_FEE: - return visitor.visitPaymentProcessingPercentageFee(); - case THREE_DS_FIXED_FEE: - return visitor.visitThreeDsFixedFee(); - case PAYMENT_REVSHARE_REFUND: - return visitor.visitPaymentRevshareRefund(); + case PAYMENT_PROCESSING_PERCENTAGE_FEE: + return visitor.visitPaymentProcessingPercentageFee(); case DISPUTE_ALERT_FEE: return visitor.visitDisputeAlertFee(); case APPLICATION_FEE: return visitor.visitApplicationFee(); - case AIRDROP_LINK_RETURNED: - return visitor.visitAirdropLinkReturned(); case WITHDRAWAL: return visitor.visitWithdrawal(); - case PAYOUT_FEE: - return visitor.visitPayoutFee(); - case INSTALLMENT_DEFAULT: - return visitor.visitInstallmentDefault(); + case BALANCE_RESERVATION: + return visitor.visitBalanceReservation(); case ONCHAIN_WALLET_TRANSFER_OUTGOING: return visitor.visitOnchainWalletTransferOutgoing(); case LICENSE_SALE: return visitor.visitLicenseSale(); case APPLICATION_FEE_PAYOUT: return visitor.visitApplicationFeePayout(); - case PLATFORM_BALANCE_PAYMENT: - return visitor.visitPlatformBalancePayment(); case LEGACY_PAYMENT: return visitor.visitLegacyPayment(); - case AD_PUBLISHER_PAYOUT_RECEIVED: - return visitor.visitAdPublisherPayoutReceived(); - case PAYMENT_REFERRAL_REVERSAL: - return visitor.visitPaymentReferralReversal(); - case LEGACY_CRYPTO_PAYMENT: - return visitor.visitLegacyCryptoPayment(); case AD_BUDGET_RELEASE: return visitor.visitAdBudgetRelease(); case AD_SPEND_CHARGE: return visitor.visitAdSpendCharge(); - case PLATFORM_BALANCE_TRANSFER_INCOMING: - return visitor.visitPlatformBalanceTransferIncoming(); - case PAYMENT_REFERRAL: - return visitor.visitPaymentReferral(); case PROMO_REVERSAL: return visitor.visitPromoReversal(); - case TOPUP_REVERSAL: - return visitor.visitTopupReversal(); case PLATFORM_AFFILIATE_PAYMENT_REVERSAL: return visitor.visitPlatformAffiliatePaymentReversal(); case AIRDROP: return visitor.visitAirdrop(); - case WITHDRAWAL_CLAWBACK_REVERSAL: - return visitor.visitWithdrawalClawbackReversal(); - case CARD_SPEND_AUTHORIZATION: - return visitor.visitCardSpendAuthorization(); case LICENSE_SALE_REVENUE: return visitor.visitLicenseSaleRevenue(); case TOPUP: return visitor.visitTopup(); case HIGH_RISK_MERCHANT_FEE: return visitor.visitHighRiskMerchantFee(); - case PAYMENT_REVSHARE_PAYOUT: - return visitor.visitPaymentRevsharePayout(); case INTERNAL_BALANCE_TRANSFER_INCOMING: return visitor.visitInternalBalanceTransferIncoming(); - case PAYMENT_REFUND_REVERSAL: - return visitor.visitPaymentRefundReversal(); case ONCHAIN_DEPOSIT: return visitor.visitOnchainDeposit(); case WITHDRAWAL_RECLASSIFICATION: return visitor.visitWithdrawalReclassification(); - case FRAUD_PREVENTION_FEE: - return visitor.visitFraudPreventionFee(); case STRIPE_DOMESTIC_PROCESSING_FEE: return visitor.visitStripeDomesticProcessingFee(); case MISC_PURCHASE: return visitor.visitMiscPurchase(); - case PLATFORM_BALANCE_TRANSFER_OUTGOING: - return visitor.visitPlatformBalanceTransferOutgoing(); - case MISC_REVERSAL: - return visitor.visitMiscReversal(); - case AIRDROP_LINK_REDEEMED: - return visitor.visitAirdropLinkRedeemed(); - case ONCHAIN_SWAP_TARGET: - return visitor.visitOnchainSwapTarget(); - case AD_CAMPAIGN_BUDGET: - return visitor.visitAdCampaignBudget(); case SOFTWARE_RENTAL_TRANSACTION: return visitor.visitSoftwareRentalTransaction(); case CURRENCY_CONVERSION_INCOMING: return visitor.visitCurrencyConversionIncoming(); - case AFFILIATE_FEE: - return visitor.visitAffiliateFee(); - case CARD_SPEND_AUTHORIZATION_VOID: - return visitor.visitCardSpendAuthorizationVoid(); - case PAYMENT_GROSS_REVERSAL: - return visitor.visitPaymentGrossReversal(); - case LEGACY_PAYMENT_REFUND: - return visitor.visitLegacyPaymentRefund(); case PASSTHROUGH_GMV: return visitor.visitPassthroughGmv(); case DISPUTE_HOLD_ADJUSTMENT: return visitor.visitDisputeHoldAdjustment(); - case INTERNAL_WITHDRAWAL: - return visitor.visitInternalWithdrawal(); case PAYMENT_GROSS: return visitor.visitPaymentGross(); - case BANK_TRANSFER: - return visitor.visitBankTransfer(); - case REFERRAL_BONUS: - return visitor.visitReferralBonus(); - case INTERNAL_BALANCE_TRANSFER_OUTGOING: - return visitor.visitInternalBalanceTransferOutgoing(); case SALES_TAX_REMITTANCE_REVERSAL: return visitor.visitSalesTaxRemittanceReversal(); - case WITHDRAWAL_CLAWBACK: - return visitor.visitWithdrawalClawback(); case LICENSE_SALE_COMMISSION: return visitor.visitLicenseSaleCommission(); - case REVSHARE_PERCENTAGE_FEE: - return visitor.visitRevsharePercentageFee(); case SALES_TAX_FEE: return visitor.visitSalesTaxFee(); case WITHDRAWAL_REVERSAL: return visitor.visitWithdrawalReversal(); - case AIRDROP_REVERSAL: - return visitor.visitAirdropReversal(); - case PAYMENT_REFUND: - return visitor.visitPaymentRefund(); case CROSS_BORDER_PERCENTAGE_FEE: return visitor.visitCrossBorderPercentageFee(); case TOPUP_FEE: return visitor.visitTopupFee(); - case AIRDROP_LINK_CREATED: - return visitor.visitAirdropLinkCreated(); case FX_PERCENTAGE_FEE: return visitor.visitFxPercentageFee(); case CURRENCY_CONVERSION_OUTGOING: return visitor.visitCurrencyConversionOutgoing(); - case COMPANY_REFERRAL: - return visitor.visitCompanyReferral(); - case ORCHESTRATION_PERCENTAGE_FEE: - return visitor.visitOrchestrationPercentageFee(); - case CARD_SPEND_REFUND: - return visitor.visitCardSpendRefund(); - case PAYMENT_REVSHARE_REVERSAL: - return visitor.visitPaymentRevshareReversal(); case PLATFORM_AFFILIATE_PAYMENT: return visitor.visitPlatformAffiliatePayment(); case SALES_TAX_REMITTANCE: return visitor.visitSalesTaxRemittance(); - case MISC_REFUND: - return visitor.visitMiscRefund(); case PAYMENT_PROCESSING_FIXED_FEE: return visitor.visitPaymentProcessingFixedFee(); case INTERNAL_WITHDRAWAL_REVERSAL: @@ -503,12 +519,6 @@ public T visit(Visitor visitor) { return visitor.visitBuyerFee(); case WHOP_PROCESSING_FEE: return visitor.visitWhopProcessingFee(); - case ONCHAIN_WALLET_TRANSFER_INCOMING: - return visitor.visitOnchainWalletTransferIncoming(); - case PAYMENT_REVSHARE: - return visitor.visitPaymentRevshare(); - case PAYMENT_DISPUTE_FEE: - return visitor.visitPaymentDisputeFee(); case UNKNOWN: default: return visitor.visitUnknown(string); @@ -532,90 +542,40 @@ public static LedgerActivityLineType valueOf(String value) { return PLATFORM_COVERED_DISPUTE; case "resolution_center_refund": return RESOLUTION_CENTER_REFUND; - case "ad_publisher_payout": - return AD_PUBLISHER_PAYOUT; - case "billing_percentage_fee": - return BILLING_PERCENTAGE_FEE; - case "payment_dispute": - return PAYMENT_DISPUTE; - case "payment_dispute_adjustment": - return PAYMENT_DISPUTE_ADJUSTMENT; - case "payment_processing_percentage_fee": - return PAYMENT_PROCESSING_PERCENTAGE_FEE; case "three_ds_fixed_fee": return THREE_DS_FIXED_FEE; case "payment_revshare_refund": return PAYMENT_REVSHARE_REFUND; - case "dispute_alert_fee": - return DISPUTE_ALERT_FEE; - case "application_fee": - return APPLICATION_FEE; case "airdrop_link_returned": return AIRDROP_LINK_RETURNED; - case "withdrawal": - return WITHDRAWAL; case "payout_fee": return PAYOUT_FEE; case "installment_default": return INSTALLMENT_DEFAULT; - case "onchain_wallet_transfer_outgoing": - return ONCHAIN_WALLET_TRANSFER_OUTGOING; - case "license_sale": - return LICENSE_SALE; - case "application_fee_payout": - return APPLICATION_FEE_PAYOUT; case "platform_balance_payment": return PLATFORM_BALANCE_PAYMENT; - case "legacy_payment": - return LEGACY_PAYMENT; case "ad_publisher_payout_received": return AD_PUBLISHER_PAYOUT_RECEIVED; case "payment_referral_reversal": return PAYMENT_REFERRAL_REVERSAL; case "legacy_crypto_payment": return LEGACY_CRYPTO_PAYMENT; - case "ad_budget_release": - return AD_BUDGET_RELEASE; - case "ad_spend_charge": - return AD_SPEND_CHARGE; case "platform_balance_transfer_incoming": return PLATFORM_BALANCE_TRANSFER_INCOMING; case "payment_referral": return PAYMENT_REFERRAL; - case "promo_reversal": - return PROMO_REVERSAL; case "topup_reversal": return TOPUP_REVERSAL; - case "platform_affiliate_payment_reversal": - return PLATFORM_AFFILIATE_PAYMENT_REVERSAL; - case "airdrop": - return AIRDROP; case "withdrawal_clawback_reversal": return WITHDRAWAL_CLAWBACK_REVERSAL; case "card_spend_authorization": return CARD_SPEND_AUTHORIZATION; - case "license_sale_revenue": - return LICENSE_SALE_REVENUE; - case "topup": - return TOPUP; - case "high_risk_merchant_fee": - return HIGH_RISK_MERCHANT_FEE; case "payment_revshare_payout": return PAYMENT_REVSHARE_PAYOUT; - case "internal_balance_transfer_incoming": - return INTERNAL_BALANCE_TRANSFER_INCOMING; case "payment_refund_reversal": return PAYMENT_REFUND_REVERSAL; - case "onchain_deposit": - return ONCHAIN_DEPOSIT; - case "withdrawal_reclassification": - return WITHDRAWAL_RECLASSIFICATION; case "fraud_prevention_fee": return FRAUD_PREVENTION_FEE; - case "stripe_domestic_processing_fee": - return STRIPE_DOMESTIC_PROCESSING_FEE; - case "misc_purchase": - return MISC_PURCHASE; case "platform_balance_transfer_outgoing": return PLATFORM_BALANCE_TRANSFER_OUTGOING; case "misc_reversal": @@ -626,10 +586,6 @@ public static LedgerActivityLineType valueOf(String value) { return ONCHAIN_SWAP_TARGET; case "ad_campaign_budget": return AD_CAMPAIGN_BUDGET; - case "software_rental_transaction": - return SOFTWARE_RENTAL_TRANSACTION; - case "currency_conversion_incoming": - return CURRENCY_CONVERSION_INCOMING; case "affiliate_fee": return AFFILIATE_FEE; case "card_spend_authorization_void": @@ -638,46 +594,26 @@ public static LedgerActivityLineType valueOf(String value) { return PAYMENT_GROSS_REVERSAL; case "legacy_payment_refund": return LEGACY_PAYMENT_REFUND; - case "passthrough_gmv": - return PASSTHROUGH_GMV; - case "dispute_hold_adjustment": - return DISPUTE_HOLD_ADJUSTMENT; case "internal_withdrawal": return INTERNAL_WITHDRAWAL; - case "payment_gross": - return PAYMENT_GROSS; case "bank_transfer": return BANK_TRANSFER; case "referral_bonus": return REFERRAL_BONUS; case "internal_balance_transfer_outgoing": return INTERNAL_BALANCE_TRANSFER_OUTGOING; - case "sales_tax_remittance_reversal": - return SALES_TAX_REMITTANCE_REVERSAL; + case "balance_reservation_reversal": + return BALANCE_RESERVATION_REVERSAL; case "withdrawal_clawback": return WITHDRAWAL_CLAWBACK; - case "license_sale_commission": - return LICENSE_SALE_COMMISSION; case "revshare_percentage_fee": return REVSHARE_PERCENTAGE_FEE; - case "sales_tax_fee": - return SALES_TAX_FEE; - case "withdrawal_reversal": - return WITHDRAWAL_REVERSAL; case "airdrop_reversal": return AIRDROP_REVERSAL; case "payment_refund": return PAYMENT_REFUND; - case "cross_border_percentage_fee": - return CROSS_BORDER_PERCENTAGE_FEE; - case "topup_fee": - return TOPUP_FEE; case "airdrop_link_created": return AIRDROP_LINK_CREATED; - case "fx_percentage_fee": - return FX_PERCENTAGE_FEE; - case "currency_conversion_outgoing": - return CURRENCY_CONVERSION_OUTGOING; case "company_referral": return COMPANY_REFERRAL; case "orchestration_percentage_fee": @@ -686,12 +622,96 @@ public static LedgerActivityLineType valueOf(String value) { return CARD_SPEND_REFUND; case "payment_revshare_reversal": return PAYMENT_REVSHARE_REVERSAL; + case "misc_refund": + return MISC_REFUND; + case "onchain_wallet_transfer_incoming": + return ONCHAIN_WALLET_TRANSFER_INCOMING; + case "payment_revshare": + return PAYMENT_REVSHARE; + case "payment_dispute_fee": + return PAYMENT_DISPUTE_FEE; + case "ad_publisher_payout": + return AD_PUBLISHER_PAYOUT; + case "billing_percentage_fee": + return BILLING_PERCENTAGE_FEE; + case "payment_dispute": + return PAYMENT_DISPUTE; + case "payment_dispute_adjustment": + return PAYMENT_DISPUTE_ADJUSTMENT; + case "payment_processing_percentage_fee": + return PAYMENT_PROCESSING_PERCENTAGE_FEE; + case "dispute_alert_fee": + return DISPUTE_ALERT_FEE; + case "application_fee": + return APPLICATION_FEE; + case "withdrawal": + return WITHDRAWAL; + case "balance_reservation": + return BALANCE_RESERVATION; + case "onchain_wallet_transfer_outgoing": + return ONCHAIN_WALLET_TRANSFER_OUTGOING; + case "license_sale": + return LICENSE_SALE; + case "application_fee_payout": + return APPLICATION_FEE_PAYOUT; + case "legacy_payment": + return LEGACY_PAYMENT; + case "ad_budget_release": + return AD_BUDGET_RELEASE; + case "ad_spend_charge": + return AD_SPEND_CHARGE; + case "promo_reversal": + return PROMO_REVERSAL; + case "platform_affiliate_payment_reversal": + return PLATFORM_AFFILIATE_PAYMENT_REVERSAL; + case "airdrop": + return AIRDROP; + case "license_sale_revenue": + return LICENSE_SALE_REVENUE; + case "topup": + return TOPUP; + case "high_risk_merchant_fee": + return HIGH_RISK_MERCHANT_FEE; + case "internal_balance_transfer_incoming": + return INTERNAL_BALANCE_TRANSFER_INCOMING; + case "onchain_deposit": + return ONCHAIN_DEPOSIT; + case "withdrawal_reclassification": + return WITHDRAWAL_RECLASSIFICATION; + case "stripe_domestic_processing_fee": + return STRIPE_DOMESTIC_PROCESSING_FEE; + case "misc_purchase": + return MISC_PURCHASE; + case "software_rental_transaction": + return SOFTWARE_RENTAL_TRANSACTION; + case "currency_conversion_incoming": + return CURRENCY_CONVERSION_INCOMING; + case "passthrough_gmv": + return PASSTHROUGH_GMV; + case "dispute_hold_adjustment": + return DISPUTE_HOLD_ADJUSTMENT; + case "payment_gross": + return PAYMENT_GROSS; + case "sales_tax_remittance_reversal": + return SALES_TAX_REMITTANCE_REVERSAL; + case "license_sale_commission": + return LICENSE_SALE_COMMISSION; + case "sales_tax_fee": + return SALES_TAX_FEE; + case "withdrawal_reversal": + return WITHDRAWAL_REVERSAL; + case "cross_border_percentage_fee": + return CROSS_BORDER_PERCENTAGE_FEE; + case "topup_fee": + return TOPUP_FEE; + case "fx_percentage_fee": + return FX_PERCENTAGE_FEE; + case "currency_conversion_outgoing": + return CURRENCY_CONVERSION_OUTGOING; case "platform_affiliate_payment": return PLATFORM_AFFILIATE_PAYMENT; case "sales_tax_remittance": return SALES_TAX_REMITTANCE; - case "misc_refund": - return MISC_REFUND; case "payment_processing_fixed_fee": return PAYMENT_PROCESSING_FIXED_FEE; case "internal_withdrawal_reversal": @@ -702,12 +722,6 @@ public static LedgerActivityLineType valueOf(String value) { return BUYER_FEE; case "whop_processing_fee": return WHOP_PROCESSING_FEE; - case "onchain_wallet_transfer_incoming": - return ONCHAIN_WALLET_TRANSFER_INCOMING; - case "payment_revshare": - return PAYMENT_REVSHARE; - case "payment_dispute_fee": - return PAYMENT_DISPUTE_FEE; default: return new LedgerActivityLineType(Value.UNKNOWN, value); } @@ -740,6 +754,10 @@ public enum Value { APPLICATION_FEE_PAYOUT, + BALANCE_RESERVATION, + + BALANCE_RESERVATION_REVERSAL, + BANK_TRANSFER, BILLING_PERCENTAGE_FEE, @@ -934,6 +952,10 @@ public interface Visitor { T visitApplicationFeePayout(); + T visitBalanceReservation(); + + T visitBalanceReservationReversal(); + T visitBankTransfer(); T visitBillingPercentageFee(); diff --git a/src/main/java/com/whop/api/types/LedgerActivityPayment.java b/src/main/java/com/whop/api/types/LedgerActivityPayment.java new file mode 100644 index 00000000..974c7a47 --- /dev/null +++ b/src/main/java/com/whop/api/types/LedgerActivityPayment.java @@ -0,0 +1,563 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = LedgerActivityPayment.Builder.class) +public final class LedgerActivityPayment { + private final Optional amount; + + private final Optional cardBrand; + + private final Optional cardLast4; + + private final OffsetDateTime createdAt; + + private final String id; + + private final LedgerActivityPaymentObject object; + + private final Optional paymentMethodType; + + private final Optional paymentProcessor; + + private final Map additionalProperties; + + private LedgerActivityPayment( + Optional amount, + Optional cardBrand, + Optional cardLast4, + OffsetDateTime createdAt, + String id, + LedgerActivityPaymentObject object, + Optional paymentMethodType, + Optional paymentProcessor, + Map additionalProperties) { + this.amount = amount; + this.cardBrand = cardBrand; + this.cardLast4 = cardLast4; + this.createdAt = createdAt; + this.id = id; + this.object = object; + this.paymentMethodType = paymentMethodType; + this.paymentProcessor = paymentProcessor; + this.additionalProperties = additionalProperties; + } + + /** + * @return Total charged by the payment. + */ + @JsonIgnore + public Optional getAmount() { + if (amount == null) { + return Optional.empty(); + } + return amount; + } + + /** + * @return Card brand, when the customer paid by card. + */ + @JsonIgnore + public Optional getCardBrand() { + if (cardBrand == null) { + return Optional.empty(); + } + return cardBrand; + } + + /** + * @return Last four digits of the card, when the customer paid by card. + */ + @JsonIgnore + public Optional getCardLast4() { + if (cardLast4 == null) { + return Optional.empty(); + } + return cardLast4; + } + + /** + * @return When the payment was created. + */ + @JsonProperty("created_at") + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + /** + * @return Payment ID, prefixed pay_. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + @JsonProperty("object") + public LedgerActivityPaymentObject getObject() { + return object; + } + + /** + * @return How the customer paid, such as card or paypal. + */ + @JsonIgnore + public Optional getPaymentMethodType() { + if (paymentMethodType == null) { + return Optional.empty(); + } + return paymentMethodType; + } + + /** + * @return Processor that handled the payment, such as stripe. + */ + @JsonIgnore + public Optional getPaymentProcessor() { + if (paymentProcessor == null) { + return Optional.empty(); + } + return paymentProcessor; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("amount") + private Optional _getAmount() { + return amount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("card_brand") + private Optional _getCardBrand() { + return cardBrand; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("card_last4") + private Optional _getCardLast4() { + return cardLast4; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_method_type") + private Optional _getPaymentMethodType() { + return paymentMethodType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_processor") + private Optional _getPaymentProcessor() { + return paymentProcessor; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof LedgerActivityPayment && equalTo((LedgerActivityPayment) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(LedgerActivityPayment other) { + return amount.equals(other.amount) + && cardBrand.equals(other.cardBrand) + && cardLast4.equals(other.cardLast4) + && createdAt.equals(other.createdAt) + && id.equals(other.id) + && object.equals(other.object) + && paymentMethodType.equals(other.paymentMethodType) + && paymentProcessor.equals(other.paymentProcessor); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.amount, + this.cardBrand, + this.cardLast4, + this.createdAt, + this.id, + this.object, + this.paymentMethodType, + this.paymentProcessor); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static CreatedAtStage builder() { + return new Builder(); + } + + public interface CreatedAtStage { + /** + *

When the payment was created.

+ */ + IdStage createdAt(@NotNull OffsetDateTime createdAt); + + Builder from(LedgerActivityPayment other); + } + + public interface IdStage { + /** + *

Payment ID, prefixed pay_.

+ */ + ObjectStage id(@NotNull String id); + } + + public interface ObjectStage { + _FinalStage object(@NotNull LedgerActivityPaymentObject object); + } + + public interface _FinalStage { + LedgerActivityPayment build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Total charged by the payment.

+ */ + _FinalStage amount(Optional amount); + + _FinalStage amount(Money amount); + + _FinalStage amount(Nullable amount); + + /** + *

Card brand, when the customer paid by card.

+ */ + _FinalStage cardBrand(Optional cardBrand); + + _FinalStage cardBrand(String cardBrand); + + _FinalStage cardBrand(Nullable cardBrand); + + /** + *

Last four digits of the card, when the customer paid by card.

+ */ + _FinalStage cardLast4(Optional cardLast4); + + _FinalStage cardLast4(String cardLast4); + + _FinalStage cardLast4(Nullable cardLast4); + + /** + *

How the customer paid, such as card or paypal.

+ */ + _FinalStage paymentMethodType(Optional paymentMethodType); + + _FinalStage paymentMethodType(String paymentMethodType); + + _FinalStage paymentMethodType(Nullable paymentMethodType); + + /** + *

Processor that handled the payment, such as stripe.

+ */ + _FinalStage paymentProcessor(Optional paymentProcessor); + + _FinalStage paymentProcessor(String paymentProcessor); + + _FinalStage paymentProcessor(Nullable paymentProcessor); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder implements CreatedAtStage, IdStage, ObjectStage, _FinalStage { + private OffsetDateTime createdAt; + + private String id; + + private LedgerActivityPaymentObject object; + + private Optional paymentProcessor = Optional.empty(); + + private Optional paymentMethodType = Optional.empty(); + + private Optional cardLast4 = Optional.empty(); + + private Optional cardBrand = Optional.empty(); + + private Optional amount = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(LedgerActivityPayment other) { + amount(other.getAmount()); + cardBrand(other.getCardBrand()); + cardLast4(other.getCardLast4()); + createdAt(other.getCreatedAt()); + id(other.getId()); + object(other.getObject()); + paymentMethodType(other.getPaymentMethodType()); + paymentProcessor(other.getPaymentProcessor()); + return this; + } + + /** + *

When the payment was created.

+ *

When the payment was created.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("created_at") + public IdStage createdAt(@NotNull OffsetDateTime createdAt) { + this.createdAt = Objects.requireNonNull(createdAt, "createdAt must not be null"); + return this; + } + + /** + *

Payment ID, prefixed pay_.

+ *

Payment ID, prefixed pay_.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public ObjectStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + @java.lang.Override + @JsonSetter("object") + public _FinalStage object(@NotNull LedgerActivityPaymentObject object) { + this.object = Objects.requireNonNull(object, "object must not be null"); + return this; + } + + /** + *

Processor that handled the payment, such as stripe.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentProcessor(Nullable paymentProcessor) { + if (paymentProcessor.isNull()) { + this.paymentProcessor = null; + } else if (paymentProcessor.isEmpty()) { + this.paymentProcessor = Optional.empty(); + } else { + this.paymentProcessor = Optional.of(paymentProcessor.get()); + } + return this; + } + + /** + *

Processor that handled the payment, such as stripe.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentProcessor(String paymentProcessor) { + this.paymentProcessor = Optional.ofNullable(paymentProcessor); + return this; + } + + /** + *

Processor that handled the payment, such as stripe.

+ */ + @java.lang.Override + @JsonSetter(value = "payment_processor", nulls = Nulls.SKIP) + public _FinalStage paymentProcessor(Optional paymentProcessor) { + this.paymentProcessor = paymentProcessor; + return this; + } + + /** + *

How the customer paid, such as card or paypal.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentMethodType(Nullable paymentMethodType) { + if (paymentMethodType.isNull()) { + this.paymentMethodType = null; + } else if (paymentMethodType.isEmpty()) { + this.paymentMethodType = Optional.empty(); + } else { + this.paymentMethodType = Optional.of(paymentMethodType.get()); + } + return this; + } + + /** + *

How the customer paid, such as card or paypal.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentMethodType(String paymentMethodType) { + this.paymentMethodType = Optional.ofNullable(paymentMethodType); + return this; + } + + /** + *

How the customer paid, such as card or paypal.

+ */ + @java.lang.Override + @JsonSetter(value = "payment_method_type", nulls = Nulls.SKIP) + public _FinalStage paymentMethodType(Optional paymentMethodType) { + this.paymentMethodType = paymentMethodType; + return this; + } + + /** + *

Last four digits of the card, when the customer paid by card.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage cardLast4(Nullable cardLast4) { + if (cardLast4.isNull()) { + this.cardLast4 = null; + } else if (cardLast4.isEmpty()) { + this.cardLast4 = Optional.empty(); + } else { + this.cardLast4 = Optional.of(cardLast4.get()); + } + return this; + } + + /** + *

Last four digits of the card, when the customer paid by card.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage cardLast4(String cardLast4) { + this.cardLast4 = Optional.ofNullable(cardLast4); + return this; + } + + /** + *

Last four digits of the card, when the customer paid by card.

+ */ + @java.lang.Override + @JsonSetter(value = "card_last4", nulls = Nulls.SKIP) + public _FinalStage cardLast4(Optional cardLast4) { + this.cardLast4 = cardLast4; + return this; + } + + /** + *

Card brand, when the customer paid by card.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage cardBrand(Nullable cardBrand) { + if (cardBrand.isNull()) { + this.cardBrand = null; + } else if (cardBrand.isEmpty()) { + this.cardBrand = Optional.empty(); + } else { + this.cardBrand = Optional.of(cardBrand.get()); + } + return this; + } + + /** + *

Card brand, when the customer paid by card.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage cardBrand(String cardBrand) { + this.cardBrand = Optional.ofNullable(cardBrand); + return this; + } + + /** + *

Card brand, when the customer paid by card.

+ */ + @java.lang.Override + @JsonSetter(value = "card_brand", nulls = Nulls.SKIP) + public _FinalStage cardBrand(Optional cardBrand) { + this.cardBrand = cardBrand; + return this; + } + + /** + *

Total charged by the payment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage amount(Nullable amount) { + if (amount.isNull()) { + this.amount = null; + } else if (amount.isEmpty()) { + this.amount = Optional.empty(); + } else { + this.amount = Optional.of(amount.get()); + } + return this; + } + + /** + *

Total charged by the payment.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage amount(Money amount) { + this.amount = Optional.ofNullable(amount); + return this; + } + + /** + *

Total charged by the payment.

+ */ + @java.lang.Override + @JsonSetter(value = "amount", nulls = Nulls.SKIP) + public _FinalStage amount(Optional amount) { + this.amount = amount; + return this; + } + + @java.lang.Override + public LedgerActivityPayment build() { + return new LedgerActivityPayment( + amount, + cardBrand, + cardLast4, + createdAt, + id, + object, + paymentMethodType, + paymentProcessor, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/LedgerActivityPaymentObject.java b/src/main/java/com/whop/api/types/LedgerActivityPaymentObject.java new file mode 100644 index 00000000..a305a378 --- /dev/null +++ b/src/main/java/com/whop/api/types/LedgerActivityPaymentObject.java @@ -0,0 +1,74 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class LedgerActivityPaymentObject { + public static final LedgerActivityPaymentObject PAYMENT = new LedgerActivityPaymentObject(Value.PAYMENT, "payment"); + + private final Value value; + + private final String string; + + LedgerActivityPaymentObject(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof LedgerActivityPaymentObject + && this.string.equals(((LedgerActivityPaymentObject) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case PAYMENT: + return visitor.visitPayment(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static LedgerActivityPaymentObject valueOf(String value) { + switch (value) { + case "payment": + return PAYMENT; + default: + return new LedgerActivityPaymentObject(Value.UNKNOWN, value); + } + } + + public enum Value { + PAYMENT, + + UNKNOWN + } + + public interface Visitor { + T visitPayment(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/LedgerActivitySource.java b/src/main/java/com/whop/api/types/LedgerActivitySource.java index 3b06e969..4c9986df 100644 --- a/src/main/java/com/whop/api/types/LedgerActivitySource.java +++ b/src/main/java/com/whop/api/types/LedgerActivitySource.java @@ -27,6 +27,8 @@ public final class LedgerActivitySource { private final Optional amountFloat; + private final Optional cardBrand; + private final Optional chain; private final Optional claimUrl; @@ -45,6 +47,12 @@ public final class LedgerActivitySource { private final Optional payerName; + private final Optional paymentAmount; + + private final Optional paymentMethodType; + + private final Optional paymentProcessor; + private final Optional payoutDestination; private final Optional payoutTokenNickname; @@ -65,6 +73,7 @@ public final class LedgerActivitySource { private LedgerActivitySource( Optional amountFloat, + Optional cardBrand, Optional chain, Optional claimUrl, Optional createdAt, @@ -74,6 +83,9 @@ private LedgerActivitySource( String id, String object, Optional payerName, + Optional paymentAmount, + Optional paymentMethodType, + Optional paymentProcessor, Optional payoutDestination, Optional payoutTokenNickname, Optional reason, @@ -84,6 +96,7 @@ private LedgerActivitySource( Optional txHash, Map additionalProperties) { this.amountFloat = amountFloat; + this.cardBrand = cardBrand; this.chain = chain; this.claimUrl = claimUrl; this.createdAt = createdAt; @@ -93,6 +106,9 @@ private LedgerActivitySource( this.id = id; this.object = object; this.payerName = payerName; + this.paymentAmount = paymentAmount; + this.paymentMethodType = paymentMethodType; + this.paymentProcessor = paymentProcessor; this.payoutDestination = payoutDestination; this.payoutTokenNickname = payoutTokenNickname; this.reason = reason; @@ -115,6 +131,17 @@ public Optional getAmountFloat() { return amountFloat; } + /** + * @return Card brand used by the payment source. + */ + @JsonIgnore + public Optional getCardBrand() { + if (cardBrand == null) { + return Optional.empty(); + } + return cardBrand; + } + /** * @return Chain the deposit landed on, for example plasma (onchain_transaction sources only). */ @@ -202,6 +229,39 @@ public Optional getPayerName() { return payerName; } + /** + * @return Total charged by the payment source. + */ + @JsonIgnore + public Optional getPaymentAmount() { + if (paymentAmount == null) { + return Optional.empty(); + } + return paymentAmount; + } + + /** + * @return Payment method used by the payment source. + */ + @JsonIgnore + public Optional getPaymentMethodType() { + if (paymentMethodType == null) { + return Optional.empty(); + } + return paymentMethodType; + } + + /** + * @return Processor used by the payment source. + */ + @JsonIgnore + public Optional getPaymentProcessor() { + if (paymentProcessor == null) { + return Optional.empty(); + } + return paymentProcessor; + } + /** * @return Payout destination display info (withdrawal sources only). */ @@ -296,6 +356,12 @@ private Optional _getAmountFloat() { return amountFloat; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("card_brand") + private Optional _getCardBrand() { + return cardBrand; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("chain") private Optional _getChain() { @@ -338,6 +404,24 @@ private Optional _getPayerName() { return payerName; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_amount") + private Optional _getPaymentAmount() { + return paymentAmount; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_method_type") + private Optional _getPaymentMethodType() { + return paymentMethodType; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("payment_processor") + private Optional _getPaymentProcessor() { + return paymentProcessor; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("payout_destination") private Optional _getPayoutDestination() { @@ -399,6 +483,7 @@ public Map getAdditionalProperties() { private boolean equalTo(LedgerActivitySource other) { return amountFloat.equals(other.amountFloat) + && cardBrand.equals(other.cardBrand) && chain.equals(other.chain) && claimUrl.equals(other.claimUrl) && createdAt.equals(other.createdAt) @@ -408,6 +493,9 @@ private boolean equalTo(LedgerActivitySource other) { && id.equals(other.id) && object.equals(other.object) && payerName.equals(other.payerName) + && paymentAmount.equals(other.paymentAmount) + && paymentMethodType.equals(other.paymentMethodType) + && paymentProcessor.equals(other.paymentProcessor) && payoutDestination.equals(other.payoutDestination) && payoutTokenNickname.equals(other.payoutTokenNickname) && reason.equals(other.reason) @@ -422,6 +510,7 @@ private boolean equalTo(LedgerActivitySource other) { public int hashCode() { return Objects.hash( this.amountFloat, + this.cardBrand, this.chain, this.claimUrl, this.createdAt, @@ -431,6 +520,9 @@ public int hashCode() { this.id, this.object, this.payerName, + this.paymentAmount, + this.paymentMethodType, + this.paymentProcessor, this.payoutDestination, this.payoutTokenNickname, this.reason, @@ -476,6 +568,15 @@ public interface _FinalStage { _FinalStage amountFloat(Nullable amountFloat); + /** + *

Card brand used by the payment source.

+ */ + _FinalStage cardBrand(Optional cardBrand); + + _FinalStage cardBrand(String cardBrand); + + _FinalStage cardBrand(Nullable cardBrand); + /** *

Chain the deposit landed on, for example plasma (onchain_transaction sources only).

*/ @@ -539,6 +640,33 @@ public interface _FinalStage { _FinalStage payerName(Nullable payerName); + /** + *

Total charged by the payment source.

+ */ + _FinalStage paymentAmount(Optional paymentAmount); + + _FinalStage paymentAmount(Money paymentAmount); + + _FinalStage paymentAmount(Nullable paymentAmount); + + /** + *

Payment method used by the payment source.

+ */ + _FinalStage paymentMethodType(Optional paymentMethodType); + + _FinalStage paymentMethodType(String paymentMethodType); + + _FinalStage paymentMethodType(Nullable paymentMethodType); + + /** + *

Processor used by the payment source.

+ */ + _FinalStage paymentProcessor(Optional paymentProcessor); + + _FinalStage paymentProcessor(String paymentProcessor); + + _FinalStage paymentProcessor(Nullable paymentProcessor); + /** *

Payout destination display info (withdrawal sources only).

*/ @@ -634,6 +762,12 @@ public static final class Builder implements IdStage, ObjectStage, _FinalStage { private Optional payoutDestination = Optional.empty(); + private Optional paymentProcessor = Optional.empty(); + + private Optional paymentMethodType = Optional.empty(); + + private Optional paymentAmount = Optional.empty(); + private Optional payerName = Optional.empty(); private Optional fromCurrency = Optional.empty(); @@ -648,6 +782,8 @@ public static final class Builder implements IdStage, ObjectStage, _FinalStage { private Optional chain = Optional.empty(); + private Optional cardBrand = Optional.empty(); + private Optional amountFloat = Optional.empty(); @JsonAnySetter @@ -658,6 +794,7 @@ private Builder() {} @java.lang.Override public Builder from(LedgerActivitySource other) { amountFloat(other.getAmountFloat()); + cardBrand(other.getCardBrand()); chain(other.getChain()); claimUrl(other.getClaimUrl()); createdAt(other.getCreatedAt()); @@ -667,6 +804,9 @@ public Builder from(LedgerActivitySource other) { id(other.getId()); object(other.getObject()); payerName(other.getPayerName()); + paymentAmount(other.getPaymentAmount()); + paymentMethodType(other.getPaymentMethodType()); + paymentProcessor(other.getPaymentProcessor()); payoutDestination(other.getPayoutDestination()); payoutTokenNickname(other.getPayoutTokenNickname()); reason(other.getReason()); @@ -980,6 +1120,114 @@ public _FinalStage payoutDestination(OptionalProcessor used by the payment source.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentProcessor(Nullable paymentProcessor) { + if (paymentProcessor.isNull()) { + this.paymentProcessor = null; + } else if (paymentProcessor.isEmpty()) { + this.paymentProcessor = Optional.empty(); + } else { + this.paymentProcessor = Optional.of(paymentProcessor.get()); + } + return this; + } + + /** + *

Processor used by the payment source.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentProcessor(String paymentProcessor) { + this.paymentProcessor = Optional.ofNullable(paymentProcessor); + return this; + } + + /** + *

Processor used by the payment source.

+ */ + @java.lang.Override + @JsonSetter(value = "payment_processor", nulls = Nulls.SKIP) + public _FinalStage paymentProcessor(Optional paymentProcessor) { + this.paymentProcessor = paymentProcessor; + return this; + } + + /** + *

Payment method used by the payment source.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentMethodType(Nullable paymentMethodType) { + if (paymentMethodType.isNull()) { + this.paymentMethodType = null; + } else if (paymentMethodType.isEmpty()) { + this.paymentMethodType = Optional.empty(); + } else { + this.paymentMethodType = Optional.of(paymentMethodType.get()); + } + return this; + } + + /** + *

Payment method used by the payment source.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentMethodType(String paymentMethodType) { + this.paymentMethodType = Optional.ofNullable(paymentMethodType); + return this; + } + + /** + *

Payment method used by the payment source.

+ */ + @java.lang.Override + @JsonSetter(value = "payment_method_type", nulls = Nulls.SKIP) + public _FinalStage paymentMethodType(Optional paymentMethodType) { + this.paymentMethodType = paymentMethodType; + return this; + } + + /** + *

Total charged by the payment source.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentAmount(Nullable paymentAmount) { + if (paymentAmount.isNull()) { + this.paymentAmount = null; + } else if (paymentAmount.isEmpty()) { + this.paymentAmount = Optional.empty(); + } else { + this.paymentAmount = Optional.of(paymentAmount.get()); + } + return this; + } + + /** + *

Total charged by the payment source.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage paymentAmount(Money paymentAmount) { + this.paymentAmount = Optional.ofNullable(paymentAmount); + return this; + } + + /** + *

Total charged by the payment source.

+ */ + @java.lang.Override + @JsonSetter(value = "payment_amount", nulls = Nulls.SKIP) + public _FinalStage paymentAmount(Optional paymentAmount) { + this.paymentAmount = paymentAmount; + return this; + } + /** *

Name of the entity processing the payout (withdrawal sources only; requires payout:withdrawal:read).

* @return Reference to {@code this} so that method calls can be chained together. @@ -1232,6 +1480,42 @@ public _FinalStage chain(Optional chain) { return this; } + /** + *

Card brand used by the payment source.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage cardBrand(Nullable cardBrand) { + if (cardBrand.isNull()) { + this.cardBrand = null; + } else if (cardBrand.isEmpty()) { + this.cardBrand = Optional.empty(); + } else { + this.cardBrand = Optional.of(cardBrand.get()); + } + return this; + } + + /** + *

Card brand used by the payment source.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage cardBrand(String cardBrand) { + this.cardBrand = Optional.ofNullable(cardBrand); + return this; + } + + /** + *

Card brand used by the payment source.

+ */ + @java.lang.Override + @JsonSetter(value = "card_brand", nulls = Nulls.SKIP) + public _FinalStage cardBrand(Optional cardBrand) { + this.cardBrand = cardBrand; + return this; + } + /** *

Withdrawal amount as a decimal number in the destination currency (withdrawal sources only; requires payout:withdrawal:read).

* @return Reference to {@code this} so that method calls can be chained together. @@ -1272,6 +1556,7 @@ public _FinalStage amountFloat(Optional amountFloat) { public LedgerActivitySource build() { return new LedgerActivitySource( amountFloat, + cardBrand, chain, claimUrl, createdAt, @@ -1281,6 +1566,9 @@ public LedgerActivitySource build() { id, object, payerName, + paymentAmount, + paymentMethodType, + paymentProcessor, payoutDestination, payoutTokenNickname, reason, diff --git a/src/main/java/com/whop/api/types/Product.java b/src/main/java/com/whop/api/types/Product.java index bf6481c1..ff2aed97 100644 --- a/src/main/java/com/whop/api/types/Product.java +++ b/src/main/java/com/whop/api/types/Product.java @@ -36,6 +36,8 @@ public final class Product { private final Optional customStatementDescriptor; + private final Optional defaultPlan; + private final Optional description; private final Optional externalIdentifier; @@ -86,6 +88,7 @@ private Product( Optional customCta, Optional customCtaUrl, Optional customStatementDescriptor, + Optional defaultPlan, Optional description, Optional externalIdentifier, List galleryImages, @@ -113,6 +116,7 @@ private Product( this.customCta = customCta; this.customCtaUrl = customCtaUrl; this.customStatementDescriptor = customStatementDescriptor; + this.defaultPlan = defaultPlan; this.description = description; this.externalIdentifier = externalIdentifier; this.galleryImages = galleryImages; @@ -190,7 +194,18 @@ public Optional getCustomStatementDescriptor() { } /** - * @return Written description displayed on product page. + * @return Buyable plan to show and check out with. The configured default when that plan is buyable, otherwise the first buyable plan in product-page order. null when none is buyable. + */ + @JsonIgnore + public Optional getDefaultPlan() { + if (defaultPlan == null) { + return Optional.empty(); + } + return defaultPlan; + } + + /** + * @return Written description displayed on the product page. null if none is set. */ @JsonIgnore public Optional getDescription() { @@ -408,6 +423,12 @@ private Optional _getCustomStatementDescriptor() { return customStatementDescriptor; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_plan") + private Optional _getDefaultPlan() { + return defaultPlan; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("description") private Optional _getDescription() { @@ -491,6 +512,7 @@ private boolean equalTo(Product other) { && customCta.equals(other.customCta) && customCtaUrl.equals(other.customCtaUrl) && customStatementDescriptor.equals(other.customStatementDescriptor) + && defaultPlan.equals(other.defaultPlan) && description.equals(other.description) && externalIdentifier.equals(other.externalIdentifier) && galleryImages.equals(other.galleryImages) @@ -522,6 +544,7 @@ public int hashCode() { this.customCta, this.customCtaUrl, this.customStatementDescriptor, + this.defaultPlan, this.description, this.externalIdentifier, this.galleryImages, @@ -663,7 +686,16 @@ public interface _FinalStage { _FinalStage customStatementDescriptor(Nullable customStatementDescriptor); /** - *

Written description displayed on product page.

+ *

Buyable plan to show and check out with. The configured default when that plan is buyable, otherwise the first buyable plan in product-page order. null when none is buyable.

+ */ + _FinalStage defaultPlan(Optional defaultPlan); + + _FinalStage defaultPlan(ProductPublicPlan defaultPlan); + + _FinalStage defaultPlan(Nullable defaultPlan); + + /** + *

Written description displayed on the product page. null if none is set.

*/ _FinalStage description(Optional description); @@ -830,6 +862,8 @@ public static final class Builder private Optional description = Optional.empty(); + private Optional defaultPlan = Optional.empty(); + private Optional customStatementDescriptor = Optional.empty(); private Optional customCtaUrl = Optional.empty(); @@ -850,6 +884,7 @@ public Builder from(Product other) { customCta(other.getCustomCta()); customCtaUrl(other.getCustomCtaUrl()); customStatementDescriptor(other.getCustomStatementDescriptor()); + defaultPlan(other.getDefaultPlan()); description(other.getDescription()); externalIdentifier(other.getExternalIdentifier()); galleryImages(other.getGalleryImages()); @@ -1391,7 +1426,7 @@ public _FinalStage externalIdentifier(Optional externalIdentifier) { } /** - *

Written description displayed on product page.

+ *

Written description displayed on the product page. null if none is set.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -1407,7 +1442,7 @@ public _FinalStage description(Nullable description) { } /** - *

Written description displayed on product page.

+ *

Written description displayed on the product page. null if none is set.

* @return Reference to {@code this} so that method calls can be chained together. */ @java.lang.Override @@ -1417,7 +1452,7 @@ public _FinalStage description(String description) { } /** - *

Written description displayed on product page.

+ *

Written description displayed on the product page. null if none is set.

*/ @java.lang.Override @JsonSetter(value = "description", nulls = Nulls.SKIP) @@ -1426,6 +1461,42 @@ public _FinalStage description(Optional description) { return this; } + /** + *

Buyable plan to show and check out with. The configured default when that plan is buyable, otherwise the first buyable plan in product-page order. null when none is buyable.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage defaultPlan(Nullable defaultPlan) { + if (defaultPlan.isNull()) { + this.defaultPlan = null; + } else if (defaultPlan.isEmpty()) { + this.defaultPlan = Optional.empty(); + } else { + this.defaultPlan = Optional.of(defaultPlan.get()); + } + return this; + } + + /** + *

Buyable plan to show and check out with. The configured default when that plan is buyable, otherwise the first buyable plan in product-page order. null when none is buyable.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage defaultPlan(ProductPublicPlan defaultPlan) { + this.defaultPlan = Optional.ofNullable(defaultPlan); + return this; + } + + /** + *

Buyable plan to show and check out with. The configured default when that plan is buyable, otherwise the first buyable plan in product-page order. null when none is buyable.

+ */ + @java.lang.Override + @JsonSetter(value = "default_plan", nulls = Nulls.SKIP) + public _FinalStage defaultPlan(Optional defaultPlan) { + this.defaultPlan = defaultPlan; + return this; + } + /** *

Custom text label on customer's bank statement.

* @return Reference to {@code this} so that method calls can be chained together. @@ -1578,6 +1649,7 @@ public Product build() { customCta, customCtaUrl, customStatementDescriptor, + defaultPlan, description, externalIdentifier, galleryImages, diff --git a/src/main/java/com/whop/api/types/ProductListItem.java b/src/main/java/com/whop/api/types/ProductListItem.java index 2e8e3c26..bf156acd 100644 --- a/src/main/java/com/whop/api/types/ProductListItem.java +++ b/src/main/java/com/whop/api/types/ProductListItem.java @@ -26,8 +26,14 @@ @JsonInclude(JsonInclude.Include.NON_ABSENT) @JsonDeserialize(builder = ProductListItem.Builder.class) public final class ProductListItem { + private final Optional> account; + private final String createdAt; + private final Optional defaultPlan; + + private final Optional description; + private final Optional externalIdentifier; private final List galleryImages; @@ -57,7 +63,10 @@ public final class ProductListItem { private final Map additionalProperties; private ProductListItem( + Optional> account, String createdAt, + Optional defaultPlan, + Optional description, Optional externalIdentifier, List galleryImages, Optional headline, @@ -72,7 +81,10 @@ private ProductListItem( boolean verified, Optional visibility, Map additionalProperties) { + this.account = account; this.createdAt = createdAt; + this.defaultPlan = defaultPlan; + this.description = description; this.externalIdentifier = externalIdentifier; this.galleryImages = galleryImages; this.headline = headline; @@ -89,6 +101,17 @@ private ProductListItem( this.additionalProperties = additionalProperties; } + /** + * @return Account that sells this product. + */ + @JsonIgnore + public Optional> getAccount() { + if (account == null) { + return Optional.empty(); + } + return account; + } + /** * @return When the product was created, as an ISO 8601 timestamp. */ @@ -97,6 +120,28 @@ public String getCreatedAt() { return createdAt; } + /** + * @return Buyable plan to show and check out with. The configured default when that plan is buyable, otherwise the first buyable plan in product-page order. null when none is buyable. + */ + @JsonIgnore + public Optional getDefaultPlan() { + if (defaultPlan == null) { + return Optional.empty(); + } + return defaultPlan; + } + + /** + * @return Written description displayed on the product page. null if none is set. + */ + @JsonIgnore + public Optional getDescription() { + if (description == null) { + return Optional.empty(); + } + return description; + } + /** * @return External identifier stored on the product for your own reference. */ @@ -207,6 +252,24 @@ public Optional getVisibility() { return visibility; } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("account") + private Optional> _getAccount() { + return account; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("default_plan") + private Optional _getDefaultPlan() { + return defaultPlan; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("description") + private Optional _getDescription() { + return description; + } + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) @JsonProperty("external_identifier") private Optional _getExternalIdentifier() { @@ -243,7 +306,10 @@ public Map getAdditionalProperties() { } private boolean equalTo(ProductListItem other) { - return createdAt.equals(other.createdAt) + return account.equals(other.account) + && createdAt.equals(other.createdAt) + && defaultPlan.equals(other.defaultPlan) + && description.equals(other.description) && externalIdentifier.equals(other.externalIdentifier) && galleryImages.equals(other.galleryImages) && headline.equals(other.headline) @@ -262,7 +328,10 @@ private boolean equalTo(ProductListItem other) { @java.lang.Override public int hashCode() { return Objects.hash( + this.account, this.createdAt, + this.defaultPlan, + this.description, this.externalIdentifier, this.galleryImages, this.headline, @@ -352,6 +421,33 @@ public interface _FinalStage { _FinalStage additionalProperties(Map additionalProperties); + /** + *

Account that sells this product.

+ */ + _FinalStage account(Optional> account); + + _FinalStage account(Map account); + + _FinalStage account(Nullable> account); + + /** + *

Buyable plan to show and check out with. The configured default when that plan is buyable, otherwise the first buyable plan in product-page order. null when none is buyable.

+ */ + _FinalStage defaultPlan(Optional defaultPlan); + + _FinalStage defaultPlan(ProductPublicPlan defaultPlan); + + _FinalStage defaultPlan(Nullable defaultPlan); + + /** + *

Written description displayed on the product page. null if none is set.

+ */ + _FinalStage description(Optional description); + + _FinalStage description(String description); + + _FinalStage description(Nullable description); + /** *

External identifier stored on the product for your own reference.

*/ @@ -440,6 +536,12 @@ public static final class Builder private Optional externalIdentifier = Optional.empty(); + private Optional description = Optional.empty(); + + private Optional defaultPlan = Optional.empty(); + + private Optional> account = Optional.empty(); + @JsonAnySetter private Map additionalProperties = new HashMap<>(); @@ -447,7 +549,10 @@ private Builder() {} @java.lang.Override public Builder from(ProductListItem other) { + account(other.getAccount()); createdAt(other.getCreatedAt()); + defaultPlan(other.getDefaultPlan()); + description(other.getDescription()); externalIdentifier(other.getExternalIdentifier()); galleryImages(other.getGalleryImages()); headline(other.getHeadline()); @@ -752,10 +857,121 @@ public _FinalStage externalIdentifier(Optional externalIdentifier) { return this; } + /** + *

Written description displayed on the product page. null if none is set.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(Nullable description) { + if (description.isNull()) { + this.description = null; + } else if (description.isEmpty()) { + this.description = Optional.empty(); + } else { + this.description = Optional.of(description.get()); + } + return this; + } + + /** + *

Written description displayed on the product page. null if none is set.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage description(String description) { + this.description = Optional.ofNullable(description); + return this; + } + + /** + *

Written description displayed on the product page. null if none is set.

+ */ + @java.lang.Override + @JsonSetter(value = "description", nulls = Nulls.SKIP) + public _FinalStage description(Optional description) { + this.description = description; + return this; + } + + /** + *

Buyable plan to show and check out with. The configured default when that plan is buyable, otherwise the first buyable plan in product-page order. null when none is buyable.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage defaultPlan(Nullable defaultPlan) { + if (defaultPlan.isNull()) { + this.defaultPlan = null; + } else if (defaultPlan.isEmpty()) { + this.defaultPlan = Optional.empty(); + } else { + this.defaultPlan = Optional.of(defaultPlan.get()); + } + return this; + } + + /** + *

Buyable plan to show and check out with. The configured default when that plan is buyable, otherwise the first buyable plan in product-page order. null when none is buyable.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage defaultPlan(ProductPublicPlan defaultPlan) { + this.defaultPlan = Optional.ofNullable(defaultPlan); + return this; + } + + /** + *

Buyable plan to show and check out with. The configured default when that plan is buyable, otherwise the first buyable plan in product-page order. null when none is buyable.

+ */ + @java.lang.Override + @JsonSetter(value = "default_plan", nulls = Nulls.SKIP) + public _FinalStage defaultPlan(Optional defaultPlan) { + this.defaultPlan = defaultPlan; + return this; + } + + /** + *

Account that sells this product.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage account(Nullable> account) { + if (account.isNull()) { + this.account = null; + } else if (account.isEmpty()) { + this.account = Optional.empty(); + } else { + this.account = Optional.of(account.get()); + } + return this; + } + + /** + *

Account that sells this product.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage account(Map account) { + this.account = Optional.ofNullable(account); + return this; + } + + /** + *

Account that sells this product.

+ */ + @java.lang.Override + @JsonSetter(value = "account", nulls = Nulls.SKIP) + public _FinalStage account(Optional> account) { + this.account = account; + return this; + } + @java.lang.Override public ProductListItem build() { return new ProductListItem( + account, createdAt, + defaultPlan, + description, externalIdentifier, galleryImages, headline, diff --git a/src/main/java/com/whop/api/types/ProductPublicPlan.java b/src/main/java/com/whop/api/types/ProductPublicPlan.java new file mode 100644 index 00000000..7141448f --- /dev/null +++ b/src/main/java/com/whop/api/types/ProductPublicPlan.java @@ -0,0 +1,547 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.annotation.Nulls; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.whop.api.core.Nullable; +import com.whop.api.core.NullableNonemptyFilter; +import com.whop.api.core.ObjectMappers; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.jetbrains.annotations.NotNull; + +@JsonInclude(JsonInclude.Include.NON_ABSENT) +@JsonDeserialize(builder = ProductPublicPlan.Builder.class) +public final class ProductPublicPlan { + private final Optional billingPeriod; + + private final Optional expirationDays; + + private final String id; + + private final Money initialPrice; + + private final ProductPublicPlanPlanType planType; + + private final Money renewalPrice; + + private final Optional title; + + private final boolean unlimitedStock; + + private final ProductPublicPlanVisibility visibility; + + private final Map additionalProperties; + + private ProductPublicPlan( + Optional billingPeriod, + Optional expirationDays, + String id, + Money initialPrice, + ProductPublicPlanPlanType planType, + Money renewalPrice, + Optional title, + boolean unlimitedStock, + ProductPublicPlanVisibility visibility, + Map additionalProperties) { + this.billingPeriod = billingPeriod; + this.expirationDays = expirationDays; + this.id = id; + this.initialPrice = initialPrice; + this.planType = planType; + this.renewalPrice = renewalPrice; + this.title = title; + this.unlimitedStock = unlimitedStock; + this.visibility = visibility; + this.additionalProperties = additionalProperties; + } + + /** + * @return Number of days between recurring charges, such as 30 for monthly or 365 for annual. null for one-time plans. + */ + @JsonIgnore + public Optional getBillingPeriod() { + if (billingPeriod == null) { + return Optional.empty(); + } + return billingPeriod; + } + + /** + * @return Access duration in days for expiration-based plans. null for plans without an expiration. + */ + @JsonIgnore + public Optional getExpirationDays() { + if (expirationDays == null) { + return Optional.empty(); + } + return expirationDays; + } + + /** + * @return Plan ID, prefixed plan_. + */ + @JsonProperty("id") + public String getId() { + return id; + } + + /** + * @return What checkout charges up front. amount is "0.00" when the first charge is free, such as a trial. + */ + @JsonProperty("initial_price") + public Money getInitialPrice() { + return initialPrice; + } + + /** + * @return Billing model for this plan: one_time or renewal. + */ + @JsonProperty("plan_type") + public ProductPublicPlanPlanType getPlanType() { + return planType; + } + + /** + * @return The recurring charge every billing_period days. amount is "0.00" for one-time plans. + */ + @JsonProperty("renewal_price") + public Money getRenewalPrice() { + return renewalPrice; + } + + /** + * @return Plan display name shown to customers. null if no title has been set. + */ + @JsonIgnore + public Optional getTitle() { + if (title == null) { + return Optional.empty(); + } + return title; + } + + /** + * @return Whether the plan has unlimited stock. + */ + @JsonProperty("unlimited_stock") + public boolean getUnlimitedStock() { + return unlimitedStock; + } + + /** + * @return Where this plan can be seen. visible plans appear on the product page. + */ + @JsonProperty("visibility") + public ProductPublicPlanVisibility getVisibility() { + return visibility; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("billing_period") + private Optional _getBillingPeriod() { + return billingPeriod; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("expiration_days") + private Optional _getExpirationDays() { + return expirationDays; + } + + @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) + @JsonProperty("title") + private Optional _getTitle() { + return title; + } + + @java.lang.Override + public boolean equals(Object other) { + if (this == other) return true; + return other instanceof ProductPublicPlan && equalTo((ProductPublicPlan) other); + } + + @JsonAnyGetter + public Map getAdditionalProperties() { + return this.additionalProperties; + } + + private boolean equalTo(ProductPublicPlan other) { + return billingPeriod.equals(other.billingPeriod) + && expirationDays.equals(other.expirationDays) + && id.equals(other.id) + && initialPrice.equals(other.initialPrice) + && planType.equals(other.planType) + && renewalPrice.equals(other.renewalPrice) + && title.equals(other.title) + && unlimitedStock == other.unlimitedStock + && visibility.equals(other.visibility); + } + + @java.lang.Override + public int hashCode() { + return Objects.hash( + this.billingPeriod, + this.expirationDays, + this.id, + this.initialPrice, + this.planType, + this.renewalPrice, + this.title, + this.unlimitedStock, + this.visibility); + } + + @java.lang.Override + public String toString() { + return ObjectMappers.stringify(this); + } + + public static IdStage builder() { + return new Builder(); + } + + public interface IdStage { + /** + *

Plan ID, prefixed plan_.

+ */ + InitialPriceStage id(@NotNull String id); + + Builder from(ProductPublicPlan other); + } + + public interface InitialPriceStage { + /** + *

What checkout charges up front. amount is "0.00" when the first charge is free, such as a trial.

+ */ + PlanTypeStage initialPrice(@NotNull Money initialPrice); + } + + public interface PlanTypeStage { + /** + *

Billing model for this plan: one_time or renewal.

+ */ + RenewalPriceStage planType(@NotNull ProductPublicPlanPlanType planType); + } + + public interface RenewalPriceStage { + /** + *

The recurring charge every billing_period days. amount is "0.00" for one-time plans.

+ */ + UnlimitedStockStage renewalPrice(@NotNull Money renewalPrice); + } + + public interface UnlimitedStockStage { + /** + *

Whether the plan has unlimited stock.

+ */ + VisibilityStage unlimitedStock(boolean unlimitedStock); + } + + public interface VisibilityStage { + /** + *

Where this plan can be seen. visible plans appear on the product page.

+ */ + _FinalStage visibility(@NotNull ProductPublicPlanVisibility visibility); + } + + public interface _FinalStage { + ProductPublicPlan build(); + + _FinalStage additionalProperty(String key, Object value); + + _FinalStage additionalProperties(Map additionalProperties); + + /** + *

Number of days between recurring charges, such as 30 for monthly or 365 for annual. null for one-time plans.

+ */ + _FinalStage billingPeriod(Optional billingPeriod); + + _FinalStage billingPeriod(Double billingPeriod); + + _FinalStage billingPeriod(Nullable billingPeriod); + + /** + *

Access duration in days for expiration-based plans. null for plans without an expiration.

+ */ + _FinalStage expirationDays(Optional expirationDays); + + _FinalStage expirationDays(Double expirationDays); + + _FinalStage expirationDays(Nullable expirationDays); + + /** + *

Plan display name shown to customers. null if no title has been set.

+ */ + _FinalStage title(Optional title); + + _FinalStage title(String title); + + _FinalStage title(Nullable title); + } + + @JsonIgnoreProperties(ignoreUnknown = true) + public static final class Builder + implements IdStage, + InitialPriceStage, + PlanTypeStage, + RenewalPriceStage, + UnlimitedStockStage, + VisibilityStage, + _FinalStage { + private String id; + + private Money initialPrice; + + private ProductPublicPlanPlanType planType; + + private Money renewalPrice; + + private boolean unlimitedStock; + + private ProductPublicPlanVisibility visibility; + + private Optional title = Optional.empty(); + + private Optional expirationDays = Optional.empty(); + + private Optional billingPeriod = Optional.empty(); + + @JsonAnySetter + private Map additionalProperties = new HashMap<>(); + + private Builder() {} + + @java.lang.Override + public Builder from(ProductPublicPlan other) { + billingPeriod(other.getBillingPeriod()); + expirationDays(other.getExpirationDays()); + id(other.getId()); + initialPrice(other.getInitialPrice()); + planType(other.getPlanType()); + renewalPrice(other.getRenewalPrice()); + title(other.getTitle()); + unlimitedStock(other.getUnlimitedStock()); + visibility(other.getVisibility()); + return this; + } + + /** + *

Plan ID, prefixed plan_.

+ *

Plan ID, prefixed plan_.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("id") + public InitialPriceStage id(@NotNull String id) { + this.id = Objects.requireNonNull(id, "id must not be null"); + return this; + } + + /** + *

What checkout charges up front. amount is "0.00" when the first charge is free, such as a trial.

+ *

What checkout charges up front. amount is "0.00" when the first charge is free, such as a trial.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("initial_price") + public PlanTypeStage initialPrice(@NotNull Money initialPrice) { + this.initialPrice = Objects.requireNonNull(initialPrice, "initialPrice must not be null"); + return this; + } + + /** + *

Billing model for this plan: one_time or renewal.

+ *

Billing model for this plan: one_time or renewal.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("plan_type") + public RenewalPriceStage planType(@NotNull ProductPublicPlanPlanType planType) { + this.planType = Objects.requireNonNull(planType, "planType must not be null"); + return this; + } + + /** + *

The recurring charge every billing_period days. amount is "0.00" for one-time plans.

+ *

The recurring charge every billing_period days. amount is "0.00" for one-time plans.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("renewal_price") + public UnlimitedStockStage renewalPrice(@NotNull Money renewalPrice) { + this.renewalPrice = Objects.requireNonNull(renewalPrice, "renewalPrice must not be null"); + return this; + } + + /** + *

Whether the plan has unlimited stock.

+ *

Whether the plan has unlimited stock.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("unlimited_stock") + public VisibilityStage unlimitedStock(boolean unlimitedStock) { + this.unlimitedStock = unlimitedStock; + return this; + } + + /** + *

Where this plan can be seen. visible plans appear on the product page.

+ *

Where this plan can be seen. visible plans appear on the product page.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + @JsonSetter("visibility") + public _FinalStage visibility(@NotNull ProductPublicPlanVisibility visibility) { + this.visibility = Objects.requireNonNull(visibility, "visibility must not be null"); + return this; + } + + /** + *

Plan display name shown to customers. null if no title has been set.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage title(Nullable title) { + if (title.isNull()) { + this.title = null; + } else if (title.isEmpty()) { + this.title = Optional.empty(); + } else { + this.title = Optional.of(title.get()); + } + return this; + } + + /** + *

Plan display name shown to customers. null if no title has been set.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage title(String title) { + this.title = Optional.ofNullable(title); + return this; + } + + /** + *

Plan display name shown to customers. null if no title has been set.

+ */ + @java.lang.Override + @JsonSetter(value = "title", nulls = Nulls.SKIP) + public _FinalStage title(Optional title) { + this.title = title; + return this; + } + + /** + *

Access duration in days for expiration-based plans. null for plans without an expiration.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage expirationDays(Nullable expirationDays) { + if (expirationDays.isNull()) { + this.expirationDays = null; + } else if (expirationDays.isEmpty()) { + this.expirationDays = Optional.empty(); + } else { + this.expirationDays = Optional.of(expirationDays.get()); + } + return this; + } + + /** + *

Access duration in days for expiration-based plans. null for plans without an expiration.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage expirationDays(Double expirationDays) { + this.expirationDays = Optional.ofNullable(expirationDays); + return this; + } + + /** + *

Access duration in days for expiration-based plans. null for plans without an expiration.

+ */ + @java.lang.Override + @JsonSetter(value = "expiration_days", nulls = Nulls.SKIP) + public _FinalStage expirationDays(Optional expirationDays) { + this.expirationDays = expirationDays; + return this; + } + + /** + *

Number of days between recurring charges, such as 30 for monthly or 365 for annual. null for one-time plans.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage billingPeriod(Nullable billingPeriod) { + if (billingPeriod.isNull()) { + this.billingPeriod = null; + } else if (billingPeriod.isEmpty()) { + this.billingPeriod = Optional.empty(); + } else { + this.billingPeriod = Optional.of(billingPeriod.get()); + } + return this; + } + + /** + *

Number of days between recurring charges, such as 30 for monthly or 365 for annual. null for one-time plans.

+ * @return Reference to {@code this} so that method calls can be chained together. + */ + @java.lang.Override + public _FinalStage billingPeriod(Double billingPeriod) { + this.billingPeriod = Optional.ofNullable(billingPeriod); + return this; + } + + /** + *

Number of days between recurring charges, such as 30 for monthly or 365 for annual. null for one-time plans.

+ */ + @java.lang.Override + @JsonSetter(value = "billing_period", nulls = Nulls.SKIP) + public _FinalStage billingPeriod(Optional billingPeriod) { + this.billingPeriod = billingPeriod; + return this; + } + + @java.lang.Override + public ProductPublicPlan build() { + return new ProductPublicPlan( + billingPeriod, + expirationDays, + id, + initialPrice, + planType, + renewalPrice, + title, + unlimitedStock, + visibility, + additionalProperties); + } + + @java.lang.Override + public Builder additionalProperty(String key, Object value) { + this.additionalProperties.put(key, value); + return this; + } + + @java.lang.Override + public Builder additionalProperties(Map additionalProperties) { + this.additionalProperties.putAll(additionalProperties); + return this; + } + } +} diff --git a/src/main/java/com/whop/api/types/ProductPublicPlanPlanType.java b/src/main/java/com/whop/api/types/ProductPublicPlanPlanType.java new file mode 100644 index 00000000..7f8a47ff --- /dev/null +++ b/src/main/java/com/whop/api/types/ProductPublicPlanPlanType.java @@ -0,0 +1,84 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ProductPublicPlanPlanType { + public static final ProductPublicPlanPlanType RENEWAL = new ProductPublicPlanPlanType(Value.RENEWAL, "renewal"); + + public static final ProductPublicPlanPlanType ONE_TIME = new ProductPublicPlanPlanType(Value.ONE_TIME, "one_time"); + + private final Value value; + + private final String string; + + ProductPublicPlanPlanType(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ProductPublicPlanPlanType + && this.string.equals(((ProductPublicPlanPlanType) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case RENEWAL: + return visitor.visitRenewal(); + case ONE_TIME: + return visitor.visitOneTime(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ProductPublicPlanPlanType valueOf(String value) { + switch (value) { + case "renewal": + return RENEWAL; + case "one_time": + return ONE_TIME; + default: + return new ProductPublicPlanPlanType(Value.UNKNOWN, value); + } + } + + public enum Value { + RENEWAL, + + ONE_TIME, + + UNKNOWN + } + + public interface Visitor { + T visitRenewal(); + + T visitOneTime(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/ProductPublicPlanVisibility.java b/src/main/java/com/whop/api/types/ProductPublicPlanVisibility.java new file mode 100644 index 00000000..aa7d7628 --- /dev/null +++ b/src/main/java/com/whop/api/types/ProductPublicPlanVisibility.java @@ -0,0 +1,106 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ +package com.whop.api.types; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +public final class ProductPublicPlanVisibility { + public static final ProductPublicPlanVisibility VISIBLE = new ProductPublicPlanVisibility(Value.VISIBLE, "visible"); + + public static final ProductPublicPlanVisibility HIDDEN = new ProductPublicPlanVisibility(Value.HIDDEN, "hidden"); + + public static final ProductPublicPlanVisibility QUICK_LINK = + new ProductPublicPlanVisibility(Value.QUICK_LINK, "quick_link"); + + public static final ProductPublicPlanVisibility ARCHIVED = + new ProductPublicPlanVisibility(Value.ARCHIVED, "archived"); + + private final Value value; + + private final String string; + + ProductPublicPlanVisibility(Value value, String string) { + this.value = value; + this.string = string; + } + + public Value getEnumValue() { + return value; + } + + @java.lang.Override + @JsonValue + public String toString() { + return this.string; + } + + @java.lang.Override + public boolean equals(Object other) { + return (this == other) + || (other instanceof ProductPublicPlanVisibility + && this.string.equals(((ProductPublicPlanVisibility) other).string)); + } + + @java.lang.Override + public int hashCode() { + return this.string.hashCode(); + } + + public T visit(Visitor visitor) { + switch (value) { + case VISIBLE: + return visitor.visitVisible(); + case HIDDEN: + return visitor.visitHidden(); + case QUICK_LINK: + return visitor.visitQuickLink(); + case ARCHIVED: + return visitor.visitArchived(); + case UNKNOWN: + default: + return visitor.visitUnknown(string); + } + } + + @JsonCreator(mode = JsonCreator.Mode.DELEGATING) + public static ProductPublicPlanVisibility valueOf(String value) { + switch (value) { + case "visible": + return VISIBLE; + case "hidden": + return HIDDEN; + case "quick_link": + return QUICK_LINK; + case "archived": + return ARCHIVED; + default: + return new ProductPublicPlanVisibility(Value.UNKNOWN, value); + } + } + + public enum Value { + VISIBLE, + + HIDDEN, + + ARCHIVED, + + QUICK_LINK, + + UNKNOWN + } + + public interface Visitor { + T visitVisible(); + + T visitHidden(); + + T visitArchived(); + + T visitQuickLink(); + + T visitUnknown(String unknownType); + } +} diff --git a/src/main/java/com/whop/api/types/Transfer.java b/src/main/java/com/whop/api/types/Transfer.java deleted file mode 100644 index e3b40540..00000000 --- a/src/main/java/com/whop/api/types/Transfer.java +++ /dev/null @@ -1,130 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.whop.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.whop.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = Transfer.Builder.class) -public final class Transfer { - private final Optional origin; - - private final Optional destination; - - private final Map additionalProperties; - - private Transfer( - Optional origin, - Optional destination, - Map additionalProperties) { - this.origin = origin; - this.destination = destination; - this.additionalProperties = additionalProperties; - } - - @JsonProperty("origin") - public Optional getOrigin() { - return origin; - } - - @JsonProperty("destination") - public Optional getDestination() { - return destination; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof Transfer && equalTo((Transfer) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(Transfer other) { - return origin.equals(other.origin) && destination.equals(other.destination); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.origin, this.destination); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static Builder builder() { - return new Builder(); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder { - private Optional origin = Optional.empty(); - - private Optional destination = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - public Builder from(Transfer other) { - origin(other.getOrigin()); - destination(other.getDestination()); - return this; - } - - @JsonSetter(value = "origin", nulls = Nulls.SKIP) - public Builder origin(Optional origin) { - this.origin = origin; - return this; - } - - public Builder origin(TransferOrigin origin) { - this.origin = Optional.ofNullable(origin); - return this; - } - - @JsonSetter(value = "destination", nulls = Nulls.SKIP) - public Builder destination(Optional destination) { - this.destination = destination; - return this; - } - - public Builder destination(TransferDestination destination) { - this.destination = Optional.ofNullable(destination); - return this; - } - - public Transfer build() { - return new Transfer(origin, destination, additionalProperties); - } - - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/whop/api/types/TransferDestination.java b/src/main/java/com/whop/api/types/TransferDestination.java deleted file mode 100644 index b1f087f8..00000000 --- a/src/main/java/com/whop/api/types/TransferDestination.java +++ /dev/null @@ -1,221 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.whop.api.types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; -import java.util.Optional; - -public final class TransferDestination { - private final Value value; - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private TransferDestination(Value value) { - this.value = value; - } - - public T visit(Visitor visitor) { - return value.visit(visitor); - } - - public static TransferDestination user(TransferDestinationUser value) { - return new TransferDestination(new UserValue(value)); - } - - public static TransferDestination company(TransferDestinationCompany value) { - return new TransferDestination(new CompanyValue(value)); - } - - public boolean isUser() { - return value instanceof UserValue; - } - - public boolean isCompany() { - return value instanceof CompanyValue; - } - - public boolean _isUnknown() { - return value instanceof _UnknownValue; - } - - public Optional getUser() { - if (isUser()) { - return Optional.of(((UserValue) value).value); - } - return Optional.empty(); - } - - public Optional getCompany() { - if (isCompany()) { - return Optional.of(((CompanyValue) value).value); - } - return Optional.empty(); - } - - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TransferDestination && value.equals(((TransferDestination) other).value); - } - - @Override - public int hashCode() { - return Objects.hash(value); - } - - @Override - public String toString() { - return value.toString(); - } - - @JsonValue - private Value getValue() { - return this.value; - } - - public interface Visitor { - T visitUser(TransferDestinationUser user); - - T visitCompany(TransferDestinationCompany company); - - T _visitUnknown(Object unknownType); - } - - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "typename", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({@JsonSubTypes.Type(UserValue.class), @JsonSubTypes.Type(CompanyValue.class)}) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); - } - - @JsonTypeName("User") - @JsonIgnoreProperties("typename") - private static final class UserValue implements Value { - @JsonUnwrapped - @JsonIgnoreProperties(value = "typename", allowSetters = true) - private TransferDestinationUser value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private UserValue() {} - - private UserValue(TransferDestinationUser value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitUser(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UserValue && equalTo((UserValue) other); - } - - private boolean equalTo(UserValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "TransferDestination{" + "value: " + value + "}"; - } - } - - @JsonTypeName("Company") - @JsonIgnoreProperties("typename") - private static final class CompanyValue implements Value { - @JsonUnwrapped - @JsonIgnoreProperties(value = "typename", allowSetters = true) - private TransferDestinationCompany value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private CompanyValue() {} - - private CompanyValue(TransferDestinationCompany value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitCompany(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CompanyValue && equalTo((CompanyValue) other); - } - - private boolean equalTo(CompanyValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "TransferDestination{" + "value: " + value + "}"; - } - } - - @JsonIgnoreProperties("typename") - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @java.lang.Override - public String toString() { - return "TransferDestination{" + "type: " + type + ", value: " + value + "}"; - } - } -} diff --git a/src/main/java/com/whop/api/types/TransferDestinationCompany.java b/src/main/java/com/whop/api/types/TransferDestinationCompany.java deleted file mode 100644 index 665edc24..00000000 --- a/src/main/java/com/whop/api/types/TransferDestinationCompany.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.whop.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.whop.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TransferDestinationCompany.Builder.class) -public final class TransferDestinationCompany { - private final String id; - - private final String route; - - private final String title; - - private final Map additionalProperties; - - private TransferDestinationCompany( - String id, String route, String title, Map additionalProperties) { - this.id = id; - this.route = route; - this.title = title; - this.additionalProperties = additionalProperties; - } - - /** - * @return The unique identifier for the company. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * @return The URL slug for the company's store page. - */ - @JsonProperty("route") - public String getRoute() { - return route; - } - - /** - * @return The display name of the company shown to customers. - */ - @JsonProperty("title") - public String getTitle() { - return title; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TransferDestinationCompany && equalTo((TransferDestinationCompany) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TransferDestinationCompany other) { - return id.equals(other.id) && route.equals(other.route) && title.equals(other.title); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.route, this.title); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - /** - *

The unique identifier for the company.

- */ - RouteStage id(@NotNull String id); - - Builder from(TransferDestinationCompany other); - } - - public interface RouteStage { - /** - *

The URL slug for the company's store page.

- */ - TitleStage route(@NotNull String route); - } - - public interface TitleStage { - /** - *

The display name of the company shown to customers.

- */ - _FinalStage title(@NotNull String title); - } - - public interface _FinalStage { - TransferDestinationCompany build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, RouteStage, TitleStage, _FinalStage { - private String id; - - private String route; - - private String title; - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(TransferDestinationCompany other) { - id(other.getId()); - route(other.getRoute()); - title(other.getTitle()); - return this; - } - - /** - *

The unique identifier for the company.

- *

The unique identifier for the company.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("id") - public RouteStage id(@NotNull String id) { - this.id = Objects.requireNonNull(id, "id must not be null"); - return this; - } - - /** - *

The URL slug for the company's store page.

- *

The URL slug for the company's store page.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("route") - public TitleStage route(@NotNull String route) { - this.route = Objects.requireNonNull(route, "route must not be null"); - return this; - } - - /** - *

The display name of the company shown to customers.

- *

The display name of the company shown to customers.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("title") - public _FinalStage title(@NotNull String title) { - this.title = Objects.requireNonNull(title, "title must not be null"); - return this; - } - - @java.lang.Override - public TransferDestinationCompany build() { - return new TransferDestinationCompany(id, route, title, additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} diff --git a/src/main/java/com/whop/api/types/TransferOrigin.java b/src/main/java/com/whop/api/types/TransferOrigin.java deleted file mode 100644 index aad0580c..00000000 --- a/src/main/java/com/whop/api/types/TransferOrigin.java +++ /dev/null @@ -1,221 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.whop.api.types; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonUnwrapped; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Objects; -import java.util.Optional; - -public final class TransferOrigin { - private final Value value; - - @JsonCreator(mode = JsonCreator.Mode.DELEGATING) - private TransferOrigin(Value value) { - this.value = value; - } - - public T visit(Visitor visitor) { - return value.visit(visitor); - } - - public static TransferOrigin user(TransferOriginUser value) { - return new TransferOrigin(new UserValue(value)); - } - - public static TransferOrigin company(TransferOriginCompany value) { - return new TransferOrigin(new CompanyValue(value)); - } - - public boolean isUser() { - return value instanceof UserValue; - } - - public boolean isCompany() { - return value instanceof CompanyValue; - } - - public boolean _isUnknown() { - return value instanceof _UnknownValue; - } - - public Optional getUser() { - if (isUser()) { - return Optional.of(((UserValue) value).value); - } - return Optional.empty(); - } - - public Optional getCompany() { - if (isCompany()) { - return Optional.of(((CompanyValue) value).value); - } - return Optional.empty(); - } - - public Optional _getUnknown() { - if (_isUnknown()) { - return Optional.of(((_UnknownValue) value).value); - } - return Optional.empty(); - } - - @Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TransferOrigin && value.equals(((TransferOrigin) other).value); - } - - @Override - public int hashCode() { - return Objects.hash(value); - } - - @Override - public String toString() { - return value.toString(); - } - - @JsonValue - private Value getValue() { - return this.value; - } - - public interface Visitor { - T visitUser(TransferOriginUser user); - - T visitCompany(TransferOriginCompany company); - - T _visitUnknown(Object unknownType); - } - - @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, property = "typename", visible = true, defaultImpl = _UnknownValue.class) - @JsonSubTypes({@JsonSubTypes.Type(UserValue.class), @JsonSubTypes.Type(CompanyValue.class)}) - @JsonIgnoreProperties(ignoreUnknown = true) - private interface Value { - T visit(Visitor visitor); - } - - @JsonTypeName("User") - @JsonIgnoreProperties("typename") - private static final class UserValue implements Value { - @JsonUnwrapped - @JsonIgnoreProperties(value = "typename", allowSetters = true) - private TransferOriginUser value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private UserValue() {} - - private UserValue(TransferOriginUser value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitUser(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof UserValue && equalTo((UserValue) other); - } - - private boolean equalTo(UserValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "TransferOrigin{" + "value: " + value + "}"; - } - } - - @JsonTypeName("Company") - @JsonIgnoreProperties("typename") - private static final class CompanyValue implements Value { - @JsonUnwrapped - @JsonIgnoreProperties(value = "typename", allowSetters = true) - private TransferOriginCompany value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private CompanyValue() {} - - private CompanyValue(TransferOriginCompany value) { - this.value = value; - } - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor.visitCompany(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof CompanyValue && equalTo((CompanyValue) other); - } - - private boolean equalTo(CompanyValue other) { - return value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.value); - } - - @java.lang.Override - public String toString() { - return "TransferOrigin{" + "value: " + value + "}"; - } - } - - @JsonIgnoreProperties("typename") - private static final class _UnknownValue implements Value { - private String type; - - @JsonValue - private Object value; - - @JsonCreator(mode = JsonCreator.Mode.PROPERTIES) - private _UnknownValue(@JsonProperty("value") Object value) {} - - @java.lang.Override - public T visit(Visitor visitor) { - return visitor._visitUnknown(value); - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof _UnknownValue && equalTo((_UnknownValue) other); - } - - private boolean equalTo(_UnknownValue other) { - return type.equals(other.type) && value.equals(other.value); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.type, this.value); - } - - @java.lang.Override - public String toString() { - return "TransferOrigin{" + "type: " + type + ", value: " + value + "}"; - } - } -} diff --git a/src/main/java/com/whop/api/types/TransferOriginUser.java b/src/main/java/com/whop/api/types/TransferOriginUser.java deleted file mode 100644 index 9c30f5fd..00000000 --- a/src/main/java/com/whop/api/types/TransferOriginUser.java +++ /dev/null @@ -1,236 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ -package com.whop.api.types; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSetter; -import com.fasterxml.jackson.annotation.Nulls; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import com.whop.api.core.Nullable; -import com.whop.api.core.NullableNonemptyFilter; -import com.whop.api.core.ObjectMappers; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import org.jetbrains.annotations.NotNull; - -@JsonInclude(JsonInclude.Include.NON_ABSENT) -@JsonDeserialize(builder = TransferOriginUser.Builder.class) -public final class TransferOriginUser { - private final String id; - - private final Optional name; - - private final String username; - - private final Map additionalProperties; - - private TransferOriginUser( - String id, Optional name, String username, Map additionalProperties) { - this.id = id; - this.name = name; - this.username = username; - this.additionalProperties = additionalProperties; - } - - /** - * @return The unique identifier for the user. - */ - @JsonProperty("id") - public String getId() { - return id; - } - - /** - * @return The user's display name shown on their public profile. - */ - @JsonIgnore - public Optional getName() { - if (name == null) { - return Optional.empty(); - } - return name; - } - - /** - * @return The user's unique username shown on their public profile. - */ - @JsonProperty("username") - public String getUsername() { - return username; - } - - @JsonInclude(value = JsonInclude.Include.CUSTOM, valueFilter = NullableNonemptyFilter.class) - @JsonProperty("name") - private Optional _getName() { - return name; - } - - @java.lang.Override - public boolean equals(Object other) { - if (this == other) return true; - return other instanceof TransferOriginUser && equalTo((TransferOriginUser) other); - } - - @JsonAnyGetter - public Map getAdditionalProperties() { - return this.additionalProperties; - } - - private boolean equalTo(TransferOriginUser other) { - return id.equals(other.id) && name.equals(other.name) && username.equals(other.username); - } - - @java.lang.Override - public int hashCode() { - return Objects.hash(this.id, this.name, this.username); - } - - @java.lang.Override - public String toString() { - return ObjectMappers.stringify(this); - } - - public static IdStage builder() { - return new Builder(); - } - - public interface IdStage { - /** - *

The unique identifier for the user.

- */ - UsernameStage id(@NotNull String id); - - Builder from(TransferOriginUser other); - } - - public interface UsernameStage { - /** - *

The user's unique username shown on their public profile.

- */ - _FinalStage username(@NotNull String username); - } - - public interface _FinalStage { - TransferOriginUser build(); - - _FinalStage additionalProperty(String key, Object value); - - _FinalStage additionalProperties(Map additionalProperties); - - /** - *

The user's display name shown on their public profile.

- */ - _FinalStage name(Optional name); - - _FinalStage name(String name); - - _FinalStage name(Nullable name); - } - - @JsonIgnoreProperties(ignoreUnknown = true) - public static final class Builder implements IdStage, UsernameStage, _FinalStage { - private String id; - - private String username; - - private Optional name = Optional.empty(); - - @JsonAnySetter - private Map additionalProperties = new HashMap<>(); - - private Builder() {} - - @java.lang.Override - public Builder from(TransferOriginUser other) { - id(other.getId()); - name(other.getName()); - username(other.getUsername()); - return this; - } - - /** - *

The unique identifier for the user.

- *

The unique identifier for the user.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("id") - public UsernameStage id(@NotNull String id) { - this.id = Objects.requireNonNull(id, "id must not be null"); - return this; - } - - /** - *

The user's unique username shown on their public profile.

- *

The user's unique username shown on their public profile.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - @JsonSetter("username") - public _FinalStage username(@NotNull String username) { - this.username = Objects.requireNonNull(username, "username must not be null"); - return this; - } - - /** - *

The user's display name shown on their public profile.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage name(Nullable name) { - if (name.isNull()) { - this.name = null; - } else if (name.isEmpty()) { - this.name = Optional.empty(); - } else { - this.name = Optional.of(name.get()); - } - return this; - } - - /** - *

The user's display name shown on their public profile.

- * @return Reference to {@code this} so that method calls can be chained together. - */ - @java.lang.Override - public _FinalStage name(String name) { - this.name = Optional.ofNullable(name); - return this; - } - - /** - *

The user's display name shown on their public profile.

- */ - @java.lang.Override - @JsonSetter(value = "name", nulls = Nulls.SKIP) - public _FinalStage name(Optional name) { - this.name = name; - return this; - } - - @java.lang.Override - public TransferOriginUser build() { - return new TransferOriginUser(id, name, username, additionalProperties); - } - - @java.lang.Override - public Builder additionalProperty(String key, Object value) { - this.additionalProperties.put(key, value); - return this; - } - - @java.lang.Override - public Builder additionalProperties(Map additionalProperties) { - this.additionalProperties.putAll(additionalProperties); - return this; - } - } -} From 5163b2f50670ff60d22a6a81d765508a23c65f3c Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 25 Aug 2026 06:27:38 +0000 Subject: [PATCH 2/2] [fern-replay] advance lockfile --- .fern/replay.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index eb81c445..9a6f85fd 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -6,5 +6,11 @@ generations: timestamp: 2026-08-25T06:27:34.649Z cli_version: unknown generator_versions: {} -current_generation: 16ad88382c9b9ec024bfc077d46509a0e6d8a725 + - commit_sha: de6328c734e425e50912623b0d32e00c56ba3f4e + tree_hash: 8f604d808fa4a7c7fe05e16e8fc7ff2f42cc65ea + timestamp: 2026-08-25T06:27:35.311Z + cli_version: unknown + generator_versions: + fernapi/fern-java-sdk: 4.9.1 +current_generation: de6328c734e425e50912623b0d32e00c56ba3f4e patches: []