From d3ace55d67663490701c0950b28b05701dc64f4c Mon Sep 17 00:00:00 2001 From: chargebee-ci Date: Wed, 19 Aug 2026 10:15:52 +0000 Subject: [PATCH] Releasing v4.15.0 --- CHANGELOG.md | 69 ++++ VERSION | 2 +- build.gradle.kts | 2 +- .../chargebee/v4/client/ClientMethods.java | 18 + .../v4/client/ClientMethodsImpl.java | 14 + .../chargebee/v4/client/ServiceRegistry.java | 38 +++ .../params/CreditNoteUpdateParams.java | 112 +++++++ .../responses/CreditNoteUpdateResponse.java | 99 ++++++ .../params/CreditUnitListParams.java | 20 +- .../params/EntitlementListParams.java | 20 +- ...imateCancelSubscriptionForItemsParams.java | 2 + .../EstimateCancelSubscriptionParams.java | 2 + .../com/chargebee/v4/models/event/Event.java | 8 + ...hannelSubscriptionItemMrrUpdatedEvent.java | 227 +++++++++++++ .../models/event/VaultTokenCreatedEvent.java | 184 ++++++++++ .../models/event/VaultTokenDeletedEvent.java | 184 ++++++++++ .../models/event/VaultTokenUpdatedEvent.java | 184 ++++++++++ .../models/event/params/EventListParams.java | 40 +++ .../export/params/ExportRampsParams.java | 231 +++++++++++++ .../export/responses/ExportRampsResponse.java | 96 ++++++ .../GatewayPaymentMethodToken.java | 314 ++++++++++++++++++ .../params/HostedPagePreCancelParams.java | 20 ++ .../InvoiceVoidBeforeCaptureParams.java | 128 +++++++ .../InvoiceVoidBeforeCaptureResponse.java | 128 +++++++ .../params/ListLedgerOperationsParams.java | 20 +- .../OmnichannelSubscriptionItemMetric.java | 173 ++++++++++ .../models/paymentIntent/PaymentIntent.java | 90 ++++- .../params/PaymentIntentCreateParams.java | 21 ++ .../params/PaymentIntentUpdateParams.java | 21 ++ .../models/paymentSource/PaymentSource.java | 15 + ...stGatewayTokensForPaymentSourceParams.java | 67 ++++ ...GatewayTokensForPaymentSourceResponse.java | 240 +++++++++++++ .../com/chargebee/v4/models/quote/Quote.java | 13 + ...bscriptionItemsForCustomerQuoteParams.java | 251 ++++++++++++++ ...bscriptionCustomerQuoteForItemsParams.java | 251 ++++++++++++++ ...UpdateSubscriptionQuoteForItemsParams.java | 251 ++++++++++++++ ...UpdateSubscriptionQuoteForItemsParams.java | 251 ++++++++++++++ .../quoteEntitlement/QuoteEntitlement.java | 110 +++++- .../params/ListQuoteEntitlementsParams.java | 96 ++++++ .../ListQuoteEntitlementsResponse.java | 227 +++++++++++++ .../v4/models/quotedRamp/QuotedRamp.java | 15 +- .../v4/models/ramp/params/RampListParams.java | 20 +- .../SubscriptionCancelForItemsParams.java | 2 + .../params/SubscriptionCancelParams.java | 2 + .../VaultedPaymentMethod.java | 100 ++++++ .../VaultedPaymentMethodRetrieveParams.java | 50 +++ .../VaultedPaymentMethodRetrieveResponse.java | 104 ++++++ .../v4/services/CreditNoteService.java | 62 ++++ .../chargebee/v4/services/ExportService.java | 30 ++ .../chargebee/v4/services/InvoiceService.java | 68 ++++ .../v4/services/PaymentSourceService.java | 101 ++++++ .../v4/services/QuoteEntitlementService.java | 126 +++++++ .../services/VaultedPaymentMethodService.java | 85 +++++ 53 files changed, 4940 insertions(+), 64 deletions(-) create mode 100644 src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteUpdateParams.java create mode 100644 src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteUpdateResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/event/OmnichannelSubscriptionItemMrrUpdatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/VaultTokenCreatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/VaultTokenDeletedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/event/VaultTokenUpdatedEvent.java create mode 100644 src/main/java/com/chargebee/v4/models/export/params/ExportRampsParams.java create mode 100644 src/main/java/com/chargebee/v4/models/export/responses/ExportRampsResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java create mode 100644 src/main/java/com/chargebee/v4/models/invoice/params/InvoiceVoidBeforeCaptureParams.java create mode 100644 src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceVoidBeforeCaptureResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.java create mode 100644 src/main/java/com/chargebee/v4/models/paymentSource/params/ListGatewayTokensForPaymentSourceParams.java create mode 100644 src/main/java/com/chargebee/v4/models/paymentSource/responses/ListGatewayTokensForPaymentSourceResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/quoteEntitlement/params/ListQuoteEntitlementsParams.java create mode 100644 src/main/java/com/chargebee/v4/models/quoteEntitlement/responses/ListQuoteEntitlementsResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/VaultedPaymentMethod.java create mode 100644 src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/params/VaultedPaymentMethodRetrieveParams.java create mode 100644 src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/responses/VaultedPaymentMethodRetrieveResponse.java create mode 100644 src/main/java/com/chargebee/v4/services/QuoteEntitlementService.java create mode 100644 src/main/java/com/chargebee/v4/services/VaultedPaymentMethodService.java diff --git a/CHANGELOG.md b/CHANGELOG.md index b75cd9518..ef01a2ba6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,72 @@ +### v4.15.0 (2026-08-19) +* * * +### New Resources: +- [`GatewayPaymentMethodToken`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens) has been added. +- [`OmnichannelSubscriptionItemMetric`](https://apidocs.chargebee.com/docs/api/omnichannel_subscription_item_metrics) has been added. +- [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements) has been added. +- [`VaultedPaymentMethod`](https://apidocs.chargebee.com/docs/api/vaulted_payment_methods) has been added. + + +### New Actions: +- [`update_credit_note_details`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details) has been added to [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) has been added to [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`void_authorizations_before_capture`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture) has been added to [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). + + +### New Attributes: +- [`payment_method_options`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_options) has been added to [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- [`vault_token`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#vault_token) has been added to [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`has_entitlements`](https://apidocs.chargebee.com/docs/api/quotes/quote-object#has_entitlements) has been added to [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + +### New Parameters: +- [`updated_at.on`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at_on) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`updated_at.between`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#updated_at_between) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`purchased_at.on`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at_on) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`purchased_at.between`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions#purchased_at_between) has been added as query parameter to [`list_omnichannel_subscriptions`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions/list-omnichannel-subscriptions) in [`OmnichannelSubscription`](https://apidocs.chargebee.com/docs/api/omnichannel_subscriptions). +- [`limit`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#limit) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`offset`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#offset) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`include_deleted`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source#include_deleted) has been added as query parameter to [`list_gateway_payment_method_tokens_for_a_payment_source`](https://apidocs.chargebee.com/docs/api/payment_sources/list-gateway-payment-method-tokens-for-a-payment-source) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- [`comment`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details#comment) has been added as request body parameter to [`update_credit_note_details`](https://apidocs.chargebee.com/docs/api/credit_notes/update-credit-note-details) in [`CreditNote`](https://apidocs.chargebee.com/docs/api/credit_notes). +- [`ramp`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps#ramp) has been added as request body parameter to [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`export_type`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps#export_type) has been added as request body parameter to [`export_subscription_ramps`](https://apidocs.chargebee.com/docs/api/exports/export-subscription-ramps) in [`Export`](https://apidocs.chargebee.com/docs/api/exports). +- [`locale`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-a-pre-cancel-hosted-page#locale) has been added as request body parameter to [`create_a_pre-cancel_hosted_page`](https://apidocs.chargebee.com/docs/api/hosted_pages/create-a-pre-cancel-hosted-page) in [`HostedPage`](https://apidocs.chargebee.com/docs/api/hosted_pages). +- [`comment`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture#comment) has been added as request body parameter to [`void_authorizations_before_capture`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`void_reason_code`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture#void_reason_code) has been added as request body parameter to [`void_authorizations_before_capture`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`invoice_action`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture#invoice_action) has been added as request body parameter to [`void_authorizations_before_capture`](https://apidocs.chargebee.com/docs/api/invoices/void-authorizations-before-capture) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`payment_method_options`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent#payment_method_options) has been added as request body parameter to [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- [`payment_method_options`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent#payment_method_options) has been added as request body parameter to [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items#subscription_items_description) has been added as request body parameter to [`create_a_quote_for_a_new_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`entitlement_overrides`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items#entitlement_overrides) has been added as request body parameter to [`create_a_quote_for_a_new_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-a-new-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items#subscription_items_description) has been added as request body parameter to [`edit_update_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`entitlement_overrides`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items#entitlement_overrides) has been added as request body parameter to [`edit_update_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-update-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items#subscription_items_description) has been added as request body parameter to [`edit_create_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`entitlement_overrides`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items#entitlement_overrides) has been added as request body parameter to [`edit_create_subscription_quote_for_items`](https://apidocs.chargebee.com/docs/api/quotes/edit-create-subscription-quote-for-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`subscription_items.description`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items#subscription_items_description) has been added as request body parameter to [`create_a_quote_for_update_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`entitlement_overrides`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items#entitlement_overrides) has been added as request body parameter to [`create_a_quote_for_update_subscription_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-update-subscription-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + +### New Events: +- [`vault_token_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_updated) has been added. +- [`vault_token_deleted`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_deleted) has been added. +- [`omnichannel_subscription_item_mrr_updated`](https://apidocs.chargebee.com/docs/api/events/webhook/omnichannel_subscription_item_mrr_updated) has been added. +- [`vault_token_created`](https://apidocs.chargebee.com/docs/api/events/webhook/vault_token_created) has been added. + + +### New Enums: +- `consumption_based` has been added as a new value enum `CreditOptionForCurrentTermCharges`. +- `omnichannel_subscription_item_metric` has been added as a new value enum `EntityType`. +- `omnichannel_subscription_item_mrr_updated`, `vault_token_created`, `vault_token_updated`, and `vault_token_deleted` have been added as new values enum `EventType`. +- `chargebee`, `chargebee_payments`, `adyen`, `stripe`, `wepay`, `braintree`, `authorize_net`, `paypal_pro`, `pin`, `eway`, `eway_rapid`, `worldpay`, `balanced_payments`, `beanstream`, `bluepay`, `elavon`, `first_data_global`, `hdfc`, `migs`, `nmi`, `ogone`, `paymill`, `paypal_payflow_pro`, `sage_pay`, `tco`, `wirecard`, `amazon_payments`, `paypal_express_checkout`, `gocardless`, `orbital`, `moneris_us`, `moneris`, `bluesnap`, `cybersource`, `vantiv`, `checkout_com`, `paypal`, `ingenico_direct`, `exact`, `mollie`, `quickbooks`, `razorpay`, `global_payments`, `bank_of_america`, `ecentric`, `metrics_global`, `windcave`, `pay_com`, `ebanx`, `dlocal`, `nuvei`, `solidgate`, `paystack`, `jp_morgan`, `deutsche_bank`, `ezidebit`, `twikey`, `tempus`, `moyasar`, `payway`, and `not_applicable` have been added as new values enum `GatewayName`. +- `void` and `write_off` have been added as new values enum `InvoiceAction`. +- `active`, `inactive`, and `pending_verification` have been added as new values to enum attribute [`status`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens/gateway-payment-method-token-object#status) in [`GatewayPaymentMethodToken`](https://apidocs.chargebee.com/docs/api/gateway_payment_method_tokens). +- `payment_method_helper`, `card_components`, `checkout`, `collect_now`, `portal`, and `payment_components` have been added as new values to enum attribute [`payment_intent_metadata.source`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_intent_metadata_source) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `plan_price`, `addon_price`, `charge_price`, and `charge` have been added as new values to enum attribute [`entity_type`](https://apidocs.chargebee.com/docs/api/quote_entitlements/quote-entitlement-object#entity_type) in [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements). +- `upsert` and `remove` have been added as new values to enum attribute [`action_type`](https://apidocs.chargebee.com/docs/api/quote_entitlements/quote-entitlement-object#action_type) in [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements). + + + ### v4.14.0 (2026-07-30) * * * ### New Resources: diff --git a/VERSION b/VERSION index c412a4e2e..5c517bf11 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.14.0 +4.15.0 diff --git a/build.gradle.kts b/build.gradle.kts index 93b25bad6..7613af0c0 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "com.chargebee" -version = "4.14.0" +version = "4.15.0" description = "Java client library for ChargeBee" // Project metadata diff --git a/src/main/java/com/chargebee/v4/client/ClientMethods.java b/src/main/java/com/chargebee/v4/client/ClientMethods.java index 5e3d1a5b2..24af43916 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethods.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethods.java @@ -4,6 +4,8 @@ import com.chargebee.v4.services.CsvTaxRuleService; +import com.chargebee.v4.services.QuoteEntitlementService; + import com.chargebee.v4.services.UsageService; import com.chargebee.v4.services.TimeMachineService; @@ -164,6 +166,8 @@ import com.chargebee.v4.services.ThirdPartyEntityMappingService; +import com.chargebee.v4.services.VaultedPaymentMethodService; + import com.chargebee.v4.services.UsageChargeService; import com.chargebee.v4.services.EntitlementOverrideService; @@ -204,6 +208,13 @@ public interface ClientMethods { */ CsvTaxRuleService csvTaxRules(); + /** + * Access quote_entitlement-related operations. + * + * @return QuoteEntitlementService instance for fluent API access + */ + QuoteEntitlementService quoteEntitlements(); + /** * Access usage-related operations. * @@ -764,6 +775,13 @@ public interface ClientMethods { */ ThirdPartyEntityMappingService thirdPartyEntityMappings(); + /** + * Access vaulted_payment_method-related operations. + * + * @return VaultedPaymentMethodService instance for fluent API access + */ + VaultedPaymentMethodService vaultedPaymentMethods(); + /** * Access usage_charge-related operations. * diff --git a/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java b/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java index 633024cdf..79dcf2b7e 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java @@ -4,6 +4,8 @@ import com.chargebee.v4.services.CsvTaxRuleService; +import com.chargebee.v4.services.QuoteEntitlementService; + import com.chargebee.v4.services.UsageService; import com.chargebee.v4.services.TimeMachineService; @@ -164,6 +166,8 @@ import com.chargebee.v4.services.ThirdPartyEntityMappingService; +import com.chargebee.v4.services.VaultedPaymentMethodService; + import com.chargebee.v4.services.UsageChargeService; import com.chargebee.v4.services.EntitlementOverrideService; @@ -202,6 +206,11 @@ public CsvTaxRuleService csvTaxRules() { return getServiceRegistry().csvTaxRules(); } + @Override + public QuoteEntitlementService quoteEntitlements() { + return getServiceRegistry().quoteEntitlements(); + } + @Override public UsageService usages() { return getServiceRegistry().usages(); @@ -602,6 +611,11 @@ public ThirdPartyEntityMappingService thirdPartyEntityMappings() { return getServiceRegistry().thirdPartyEntityMappings(); } + @Override + public VaultedPaymentMethodService vaultedPaymentMethods() { + return getServiceRegistry().vaultedPaymentMethods(); + } + @Override public UsageChargeService usageCharges() { return getServiceRegistry().usageCharges(); diff --git a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java index f5c0928c4..6d315d58a 100644 --- a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java +++ b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java @@ -4,6 +4,8 @@ import com.chargebee.v4.services.CsvTaxRuleService; +import com.chargebee.v4.services.QuoteEntitlementService; + import com.chargebee.v4.services.UsageService; import com.chargebee.v4.services.TimeMachineService; @@ -164,6 +166,8 @@ import com.chargebee.v4.services.ThirdPartyEntityMappingService; +import com.chargebee.v4.services.VaultedPaymentMethodService; + import com.chargebee.v4.services.UsageChargeService; import com.chargebee.v4.services.EntitlementOverrideService; @@ -195,6 +199,8 @@ final class ServiceRegistry { private volatile CsvTaxRuleService csvTaxRuleService; + private volatile QuoteEntitlementService quoteEntitlementService; + private volatile UsageService usageService; private volatile TimeMachineService timeMachineService; @@ -355,6 +361,8 @@ final class ServiceRegistry { private volatile ThirdPartyEntityMappingService thirdPartyEntityMappingService; + private volatile VaultedPaymentMethodService vaultedPaymentMethodService; + private volatile UsageChargeService usageChargeService; private volatile EntitlementOverrideService entitlementOverrideService; @@ -409,6 +417,21 @@ CsvTaxRuleService csvTaxRules() { return csvTaxRuleService; } + /** + * Get or create the QuoteEntitlementService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + QuoteEntitlementService quoteEntitlements() { + if (quoteEntitlementService == null) { + synchronized (this) { + if (quoteEntitlementService == null) { + quoteEntitlementService = new QuoteEntitlementService(client); + } + } + } + return quoteEntitlementService; + } + /** * Get or create the UsageService instance. Thread-safe lazy initialization using double-checked * locking. @@ -1609,6 +1632,21 @@ ThirdPartyEntityMappingService thirdPartyEntityMappings() { return thirdPartyEntityMappingService; } + /** + * Get or create the VaultedPaymentMethodService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + VaultedPaymentMethodService vaultedPaymentMethods() { + if (vaultedPaymentMethodService == null) { + synchronized (this) { + if (vaultedPaymentMethodService == null) { + vaultedPaymentMethodService = new VaultedPaymentMethodService(client); + } + } + } + return vaultedPaymentMethodService; + } + /** * Get or create the UsageChargeService instance. Thread-safe lazy initialization using * double-checked locking. diff --git a/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteUpdateParams.java b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteUpdateParams.java new file mode 100644 index 000000000..2b6c5eb41 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/params/CreditNoteUpdateParams.java @@ -0,0 +1,112 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ +package com.chargebee.v4.models.creditNote.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class CreditNoteUpdateParams { + + private final String comment; + + private final Map customFields; + + private CreditNoteUpdateParams(CreditNoteUpdateBuilder builder) { + + this.comment = builder.comment; + + this.customFields = + builder.customFields.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.customFields)); + } + + public String getComment() { + return comment; + } + + public Map customFields() { + return customFields; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + formData.putAll(customFields); + + return formData; + } + + /** Create a new builder for CreditNoteUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static CreditNoteUpdateBuilder builder() { + return new CreditNoteUpdateBuilder(); + } + + public static final class CreditNoteUpdateBuilder { + + private String comment; + + private Map customFields = new LinkedHashMap<>(); + + private CreditNoteUpdateBuilder() {} + + public CreditNoteUpdateBuilder comment(String value) { + this.comment = value; + return this; + } + + /** + * Add a custom field to the request. Custom fields must start with "cf_". + * + * @param fieldName the name of the custom field (e.g., "cf_custom_field_name") + * @param value the value of the custom field + * @return this builder + * @throws IllegalArgumentException if fieldName doesn't start with "cf_" + */ + public CreditNoteUpdateBuilder customField(String fieldName, String value) { + if (fieldName == null || !fieldName.startsWith("cf_")) { + throw new IllegalArgumentException("Custom field name must start with 'cf_'"); + } + this.customFields.put(fieldName, value); + return this; + } + + /** + * Add multiple custom fields to the request. All field names must start with "cf_". + * + * @param customFields map of custom field names to values + * @return this builder + * @throws IllegalArgumentException if any field name doesn't start with "cf_" + */ + public CreditNoteUpdateBuilder customFields(Map customFields) { + if (customFields != null) { + for (Map.Entry entry : customFields.entrySet()) { + if (entry.getKey() == null || !entry.getKey().startsWith("cf_")) { + throw new IllegalArgumentException( + "Custom field name must start with 'cf_': " + entry.getKey()); + } + this.customFields.put(entry.getKey(), entry.getValue()); + } + } + return this; + } + + public CreditNoteUpdateParams build() { + return new CreditNoteUpdateParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteUpdateResponse.java b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteUpdateResponse.java new file mode 100644 index 000000000..2a7f4d881 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/creditNote/responses/CreditNoteUpdateResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.creditNote.responses; + +import com.chargebee.v4.models.creditNote.CreditNote; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for CreditNoteUpdate operation. Contains the response data from the + * API. + */ +public final class CreditNoteUpdateResponse extends BaseResponse { + private final CreditNote creditNote; + + private CreditNoteUpdateResponse(Builder builder) { + super(builder.httpResponse); + + this.creditNote = builder.creditNote; + } + + /** Parse JSON response into CreditNoteUpdateResponse object. */ + public static CreditNoteUpdateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into CreditNoteUpdateResponse object with HTTP response. */ + public static CreditNoteUpdateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __creditNoteObj = JsonUtil.getJsonObject(jsonObj, "credit_note"); + if (__creditNoteObj != null) { + builder.creditNote(CreditNote.fromJson(__creditNoteObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse CreditNoteUpdateResponse from JSON", e); + } + } + + /** Create a new builder for CreditNoteUpdateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for CreditNoteUpdateResponse. */ + public static class Builder { + + private CreditNote creditNote; + + private Response httpResponse; + + private Builder() {} + + public Builder creditNote(CreditNote creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public CreditNoteUpdateResponse build() { + return new CreditNoteUpdateResponse(this); + } + } + + /** Get the creditNote from the response. */ + public CreditNote getCreditNote() { + return creditNote; + } + + @Override + public String toString() { + return "CreditNoteUpdateResponse{" + "creditNote=" + creditNote + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + CreditNoteUpdateResponse that = (CreditNoteUpdateResponse) o; + return java.util.Objects.equals(creditNote, that.creditNote); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(creditNote); + } +} diff --git a/src/main/java/com/chargebee/v4/models/creditUnit/params/CreditUnitListParams.java b/src/main/java/com/chargebee/v4/models/creditUnit/params/CreditUnitListParams.java index 2bec3c69b..b5925e62e 100644 --- a/src/main/java/com/chargebee/v4/models/creditUnit/params/CreditUnitListParams.java +++ b/src/main/java/com/chargebee/v4/models/creditUnit/params/CreditUnitListParams.java @@ -132,16 +132,16 @@ public static final class IdFilter extends StringFilter { } } - public enum StatusIn { + public enum StatusIs { ACTIVE("active"), ARCHIVED("archived"), - /** An enum member indicating that StatusIn was instantiated with an unknown value. */ + /** An enum member indicating that StatusIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - StatusIn(String value) { + StatusIs(String value) { this.value = value; } @@ -149,9 +149,9 @@ public String getValue() { return value; } - public static StatusIn fromString(String value) { + public static StatusIs fromString(String value) { if (value == null) return _UNKNOWN; - for (StatusIn enumValue : StatusIn.values()) { + for (StatusIs enumValue : StatusIs.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -160,16 +160,16 @@ public static StatusIn fromString(String value) { } } - public enum StatusIs { + public enum StatusIn { ACTIVE("active"), ARCHIVED("archived"), - /** An enum member indicating that StatusIs was instantiated with an unknown value. */ + /** An enum member indicating that StatusIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - StatusIs(String value) { + StatusIn(String value) { this.value = value; } @@ -177,9 +177,9 @@ public String getValue() { return value; } - public static StatusIs fromString(String value) { + public static StatusIn fromString(String value) { if (value == null) return _UNKNOWN; - for (StatusIs enumValue : StatusIs.values()) { + for (StatusIn enumValue : StatusIn.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } diff --git a/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java b/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java index 22469fb15..b10179b6d 100644 --- a/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java +++ b/src/main/java/com/chargebee/v4/models/entitlement/params/EntitlementListParams.java @@ -157,7 +157,7 @@ public static final class EntityIdFilter extends StringFilter map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static OmnichannelSubscriptionItemMrrUpdatedEvent fromJson(JsonObject jsonObj) { + OmnichannelSubscriptionItemMrrUpdatedEvent obj = + new OmnichannelSubscriptionItemMrrUpdatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "OmnichannelSubscriptionItemMrrUpdatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + OmnichannelSubscriptionItemMrrUpdatedEvent that = + (OmnichannelSubscriptionItemMrrUpdatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private OmnichannelSubscriptionItem omnichannelSubscriptionItem; + private OmnichannelSubscription omnichannelSubscription; + private OmnichannelSubscriptionItemMetric omnichannelSubscriptionItemMetric; + + public OmnichannelSubscriptionItem getOmnichannelSubscriptionItem() { + return omnichannelSubscriptionItem; + } + + public OmnichannelSubscription getOmnichannelSubscription() { + return omnichannelSubscription; + } + + public OmnichannelSubscriptionItemMetric getOmnichannelSubscriptionItemMetric() { + return omnichannelSubscriptionItemMetric; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __omnichannelSubscriptionItemObj = + JsonUtil.getJsonObject(jsonObj, "omnichannel_subscription_item"); + if (__omnichannelSubscriptionItemObj != null) { + obj.omnichannelSubscriptionItem = + OmnichannelSubscriptionItem.fromJson(__omnichannelSubscriptionItemObj); + } + + JsonObject __omnichannelSubscriptionObj = + JsonUtil.getJsonObject(jsonObj, "omnichannel_subscription"); + if (__omnichannelSubscriptionObj != null) { + obj.omnichannelSubscription = + OmnichannelSubscription.fromJson(__omnichannelSubscriptionObj); + } + + JsonObject __omnichannelSubscriptionItemMetricObj = + JsonUtil.getJsonObject(jsonObj, "omnichannel_subscription_item_metric"); + if (__omnichannelSubscriptionItemMetricObj != null) { + obj.omnichannelSubscriptionItemMetric = + OmnichannelSubscriptionItemMetric.fromJson(__omnichannelSubscriptionItemMetricObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + + "omnichannelSubscriptionItem=" + + omnichannelSubscriptionItem + + ", omnichannelSubscription=" + + omnichannelSubscription + + ", omnichannelSubscriptionItemMetric=" + + omnichannelSubscriptionItemMetric + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(omnichannelSubscriptionItem, that.omnichannelSubscriptionItem) + && java.util.Objects.equals(omnichannelSubscription, that.omnichannelSubscription) + && java.util.Objects.equals( + omnichannelSubscriptionItemMetric, that.omnichannelSubscriptionItemMetric); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + omnichannelSubscriptionItem, omnichannelSubscription, omnichannelSubscriptionItemMetric); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/VaultTokenCreatedEvent.java b/src/main/java/com/chargebee/v4/models/event/VaultTokenCreatedEvent.java new file mode 100644 index 000000000..bf8cfc99e --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/VaultTokenCreatedEvent.java @@ -0,0 +1,184 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.vaultedPaymentMethod.VaultedPaymentMethod; + +public class VaultTokenCreatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static VaultTokenCreatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static VaultTokenCreatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static VaultTokenCreatedEvent fromJson(JsonObject jsonObj) { + VaultTokenCreatedEvent obj = new VaultTokenCreatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "VaultTokenCreatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VaultTokenCreatedEvent that = (VaultTokenCreatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private VaultedPaymentMethod vaultedPaymentMethod; + + public VaultedPaymentMethod getVaultedPaymentMethod() { + return vaultedPaymentMethod; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __vaultedPaymentMethodObj = + JsonUtil.getJsonObject(jsonObj, "vaulted_payment_method"); + if (__vaultedPaymentMethodObj != null) { + obj.vaultedPaymentMethod = VaultedPaymentMethod.fromJson(__vaultedPaymentMethodObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "vaultedPaymentMethod=" + vaultedPaymentMethod + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(vaultedPaymentMethod, that.vaultedPaymentMethod); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(vaultedPaymentMethod); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/VaultTokenDeletedEvent.java b/src/main/java/com/chargebee/v4/models/event/VaultTokenDeletedEvent.java new file mode 100644 index 000000000..54fa5c182 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/VaultTokenDeletedEvent.java @@ -0,0 +1,184 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.vaultedPaymentMethod.VaultedPaymentMethod; + +public class VaultTokenDeletedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static VaultTokenDeletedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static VaultTokenDeletedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static VaultTokenDeletedEvent fromJson(JsonObject jsonObj) { + VaultTokenDeletedEvent obj = new VaultTokenDeletedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "VaultTokenDeletedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VaultTokenDeletedEvent that = (VaultTokenDeletedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private VaultedPaymentMethod vaultedPaymentMethod; + + public VaultedPaymentMethod getVaultedPaymentMethod() { + return vaultedPaymentMethod; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __vaultedPaymentMethodObj = + JsonUtil.getJsonObject(jsonObj, "vaulted_payment_method"); + if (__vaultedPaymentMethodObj != null) { + obj.vaultedPaymentMethod = VaultedPaymentMethod.fromJson(__vaultedPaymentMethodObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "vaultedPaymentMethod=" + vaultedPaymentMethod + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(vaultedPaymentMethod, that.vaultedPaymentMethod); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(vaultedPaymentMethod); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/VaultTokenUpdatedEvent.java b/src/main/java/com/chargebee/v4/models/event/VaultTokenUpdatedEvent.java new file mode 100644 index 000000000..070e86d07 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/event/VaultTokenUpdatedEvent.java @@ -0,0 +1,184 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.event; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; + +import com.chargebee.v4.models.vaultedPaymentMethod.VaultedPaymentMethod; + +public class VaultTokenUpdatedEvent { + + private String id; + private Long occurredAt; + private String source; + private String object; + private String apiVersion; + private String eventType; + private String webhookStatus; + private Content content; + + public String getId() { + return id; + } + + public Long getOccurredAt() { + return occurredAt; + } + + public String getSource() { + return source; + } + + public String getObject() { + return object; + } + + public String getApiVersion() { + return apiVersion; + } + + public String getEventType() { + return eventType; + } + + public String getWebhookStatus() { + return webhookStatus; + } + + public Content getContent() { + return content; + } + + public static VaultTokenUpdatedEvent fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static VaultTokenUpdatedEvent fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static VaultTokenUpdatedEvent fromJson(JsonObject jsonObj) { + VaultTokenUpdatedEvent obj = new VaultTokenUpdatedEvent(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.occurredAt = JsonUtil.getLong(jsonObj, "occurred_at"); + + obj.source = JsonUtil.getString(jsonObj, "source"); + + obj.object = JsonUtil.getString(jsonObj, "object"); + + obj.apiVersion = JsonUtil.getString(jsonObj, "api_version"); + + obj.eventType = JsonUtil.getString(jsonObj, "event_type"); + + obj.webhookStatus = JsonUtil.getString(jsonObj, "webhook_status"); + + JsonObject __contentObj = JsonUtil.getJsonObject(jsonObj, "content"); + if (__contentObj != null) { + obj.content = Content.fromJson(__contentObj); + } + + return obj; + } + + @Override + public String toString() { + return "VaultTokenUpdatedEvent{" + + "id=" + + id + + ", occurredAt=" + + occurredAt + + ", source=" + + source + + ", object=" + + object + + ", apiVersion=" + + apiVersion + + ", eventType=" + + eventType + + ", webhookStatus=" + + webhookStatus + + ", content=" + + content + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VaultTokenUpdatedEvent that = (VaultTokenUpdatedEvent) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(occurredAt, that.occurredAt) + && java.util.Objects.equals(source, that.source) + && java.util.Objects.equals(object, that.object) + && java.util.Objects.equals(apiVersion, that.apiVersion) + && java.util.Objects.equals(eventType, that.eventType) + && java.util.Objects.equals(webhookStatus, that.webhookStatus) + && java.util.Objects.equals(content, that.content); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, occurredAt, source, object, apiVersion, eventType, webhookStatus, content); + } + + public static class Content { + + private VaultedPaymentMethod vaultedPaymentMethod; + + public VaultedPaymentMethod getVaultedPaymentMethod() { + return vaultedPaymentMethod; + } + + public static Content fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static Content fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static Content fromJson(JsonObject jsonObj) { + Content obj = new Content(); + + JsonObject __vaultedPaymentMethodObj = + JsonUtil.getJsonObject(jsonObj, "vaulted_payment_method"); + if (__vaultedPaymentMethodObj != null) { + obj.vaultedPaymentMethod = VaultedPaymentMethod.fromJson(__vaultedPaymentMethodObj); + } + + return obj; + } + + @Override + public String toString() { + return "Content{" + "vaultedPaymentMethod=" + vaultedPaymentMethod + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Content that = (Content) o; + return java.util.Objects.equals(vaultedPaymentMethod, that.vaultedPaymentMethod); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(vaultedPaymentMethod); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java b/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java index b9909a75a..f817e0bb7 100644 --- a/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java +++ b/src/main/java/com/chargebee/v4/models/event/params/EventListParams.java @@ -944,6 +944,8 @@ public enum EventTypeIs { OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED("omnichannel_subscription_item_recovered"), + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED("omnichannel_subscription_item_mrr_updated"), + LEDGER_ACCOUNT_BALANCE_UPDATED("ledger_account_balance_updated"), GRANT_BLOCKS_CREATED("grant_blocks_created"), @@ -952,6 +954,12 @@ public enum EventTypeIs { LEDGER_UPDATED("ledger_updated"), + VAULT_TOKEN_CREATED("vault_token_created"), + + VAULT_TOKEN_UPDATED("vault_token_updated"), + + VAULT_TOKEN_DELETED("vault_token_deleted"), + /** An enum member indicating that EventTypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1430,6 +1438,8 @@ public enum EventTypeIsNot { OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED("omnichannel_subscription_item_recovered"), + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED("omnichannel_subscription_item_mrr_updated"), + LEDGER_ACCOUNT_BALANCE_UPDATED("ledger_account_balance_updated"), GRANT_BLOCKS_CREATED("grant_blocks_created"), @@ -1438,6 +1448,12 @@ public enum EventTypeIsNot { LEDGER_UPDATED("ledger_updated"), + VAULT_TOKEN_CREATED("vault_token_created"), + + VAULT_TOKEN_UPDATED("vault_token_updated"), + + VAULT_TOKEN_DELETED("vault_token_deleted"), + /** An enum member indicating that EventTypeIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1916,6 +1932,8 @@ public enum EventTypeIn { OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED("omnichannel_subscription_item_recovered"), + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED("omnichannel_subscription_item_mrr_updated"), + LEDGER_ACCOUNT_BALANCE_UPDATED("ledger_account_balance_updated"), GRANT_BLOCKS_CREATED("grant_blocks_created"), @@ -1924,6 +1942,12 @@ public enum EventTypeIn { LEDGER_UPDATED("ledger_updated"), + VAULT_TOKEN_CREATED("vault_token_created"), + + VAULT_TOKEN_UPDATED("vault_token_updated"), + + VAULT_TOKEN_DELETED("vault_token_deleted"), + /** An enum member indicating that EventTypeIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2402,6 +2426,8 @@ public enum EventTypeNotIn { OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED("omnichannel_subscription_item_recovered"), + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED("omnichannel_subscription_item_mrr_updated"), + LEDGER_ACCOUNT_BALANCE_UPDATED("ledger_account_balance_updated"), GRANT_BLOCKS_CREATED("grant_blocks_created"), @@ -2410,6 +2436,12 @@ public enum EventTypeNotIn { LEDGER_UPDATED("ledger_updated"), + VAULT_TOKEN_CREATED("vault_token_created"), + + VAULT_TOKEN_UPDATED("vault_token_updated"), + + VAULT_TOKEN_DELETED("vault_token_deleted"), + /** An enum member indicating that EventTypeNotIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3166,6 +3198,8 @@ public enum EventType { OMNICHANNEL_SUBSCRIPTION_ITEM_RECOVERED("omnichannel_subscription_item_recovered"), + OMNICHANNEL_SUBSCRIPTION_ITEM_MRR_UPDATED("omnichannel_subscription_item_mrr_updated"), + LEDGER_ACCOUNT_BALANCE_UPDATED("ledger_account_balance_updated"), GRANT_BLOCKS_CREATED("grant_blocks_created"), @@ -3174,6 +3208,12 @@ public enum EventType { LEDGER_UPDATED("ledger_updated"), + VAULT_TOKEN_CREATED("vault_token_created"), + + VAULT_TOKEN_UPDATED("vault_token_updated"), + + VAULT_TOKEN_DELETED("vault_token_deleted"), + /** An enum member indicating that EventType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/export/params/ExportRampsParams.java b/src/main/java/com/chargebee/v4/models/export/params/ExportRampsParams.java new file mode 100644 index 000000000..4b1224987 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/params/ExportRampsParams.java @@ -0,0 +1,231 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ +package com.chargebee.v4.models.export.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.TimestampFilter; +import com.chargebee.v4.filters.EnumFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ExportRampsParams { + + private final ExportType exportType; + + private final RampParams ramp; + + private ExportRampsParams(ExportRampsBuilder builder) { + + this.exportType = builder.exportType; + + this.ramp = builder.ramp; + } + + public ExportType getExportType() { + return exportType; + } + + public RampParams getRamp() { + return ramp; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.exportType != null) { + + formData.put("export_type", this.exportType); + } + + if (this.ramp != null) { + + // Single object + Map nestedData = this.ramp.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String key = entry.getKey(); + String nestedKey = + key.contains("[") ? "ramp[" + key.replace("[", "][") : "ramp[" + key + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for ExportRampsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ExportRampsBuilder builder() { + return new ExportRampsBuilder(); + } + + public static final class ExportRampsBuilder { + + private ExportType exportType; + + private RampParams ramp; + + private ExportRampsBuilder() {} + + public ExportRampsBuilder exportType(ExportType value) { + this.exportType = value; + return this; + } + + public ExportRampsBuilder ramp(RampParams value) { + this.ramp = value; + return this; + } + + public ExportRampsParams build() { + return new ExportRampsParams(this); + } + } + + public enum ExportType { + DATA("data"), + + IMPORT_FRIENDLY_DATA("import_friendly_data"), + + /** An enum member indicating that ExportType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ExportType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ExportType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ExportType enumValue : ExportType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class RampParams { + + private final Map filterParams; + + private RampParams(RampBuilder builder) { + + this.filterParams = + builder.filterParams.isEmpty() + ? Collections.emptyMap() + : Collections.unmodifiableMap(new LinkedHashMap<>(builder.filterParams)); + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + // Add filter params + formData.putAll(filterParams); + + return formData; + } + + /** Create a new builder for RampParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static RampBuilder builder() { + return new RampBuilder(); + } + + public static final class RampBuilder { + + private final Map filterParams = new LinkedHashMap<>(); + + private RampBuilder() {} + + public StatusFilter status() { + return new StatusFilter("status", this, filterParams); + } + + public SubscriptionIdFilter subscriptionId() { + return new SubscriptionIdFilter("subscription_id", this, filterParams); + } + + public EffectiveFromFilter effectiveFrom() { + return new EffectiveFromFilter("effective_from", this, filterParams); + } + + public UpdatedAtFilter updatedAt() { + return new UpdatedAtFilter("updated_at", this, filterParams); + } + + public RampParams build() { + return new RampParams(this); + } + + public static final class StatusFilter extends EnumFilter { + StatusFilter(String fieldName, RampBuilder builder, Map params) { + super(fieldName, builder, params, Status::getValue); + } + } + + public static final class SubscriptionIdFilter extends StringFilter { + SubscriptionIdFilter(String fieldName, RampBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class EffectiveFromFilter extends TimestampFilter { + EffectiveFromFilter(String fieldName, RampBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class UpdatedAtFilter extends TimestampFilter { + UpdatedAtFilter(String fieldName, RampBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + } + + public enum Status { + SCHEDULED("scheduled"), + + SUCCEEDED("succeeded"), + + FAILED("failed"), + + DRAFT("draft"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/export/responses/ExportRampsResponse.java b/src/main/java/com/chargebee/v4/models/export/responses/ExportRampsResponse.java new file mode 100644 index 000000000..0ed4618a7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/export/responses/ExportRampsResponse.java @@ -0,0 +1,96 @@ +package com.chargebee.v4.models.export.responses; + +import com.chargebee.v4.models.export.Export; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import com.chargebee.v4.transport.Response; + +/** Immutable response object for ExportRamps operation. Contains the response data from the API. */ +public final class ExportRampsResponse extends BaseResponse { + private final Export export; + + private ExportRampsResponse(Builder builder) { + super(builder.httpResponse); + + this.export = builder.export; + } + + /** Parse JSON response into ExportRampsResponse object. */ + public static ExportRampsResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into ExportRampsResponse object with HTTP response. */ + public static ExportRampsResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __exportObj = JsonUtil.getJsonObject(jsonObj, "export"); + if (__exportObj != null) { + builder.export(Export.fromJson(__exportObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ExportRampsResponse from JSON", e); + } + } + + /** Create a new builder for ExportRampsResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for ExportRampsResponse. */ + public static class Builder { + + private Export export; + + private Response httpResponse; + + private Builder() {} + + public Builder export(Export export) { + this.export = export; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public ExportRampsResponse build() { + return new ExportRampsResponse(this); + } + } + + /** Get the export from the response. */ + public Export getExport() { + return export; + } + + @Override + public String toString() { + return "ExportRampsResponse{" + "export=" + export + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ExportRampsResponse that = (ExportRampsResponse) o; + return java.util.Objects.equals(export, that.export); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(export); + } +} diff --git a/src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java b/src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java new file mode 100644 index 000000000..b7b774880 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/gatewayPaymentMethodToken/GatewayPaymentMethodToken.java @@ -0,0 +1,314 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.gatewayPaymentMethodToken; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class GatewayPaymentMethodToken { + + private String id; + private String gatewayAccountId; + private GatewayName gatewayName; + private String gatewayCustomerId; + private String gatewayToken; + private Status status; + private Timestamp createdAt; + private Timestamp updatedAt; + + public String getId() { + return id; + } + + public String getGatewayAccountId() { + return gatewayAccountId; + } + + public GatewayName getGatewayName() { + return gatewayName; + } + + public String getGatewayCustomerId() { + return gatewayCustomerId; + } + + public String getGatewayToken() { + return gatewayToken; + } + + public Status getStatus() { + return status; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getUpdatedAt() { + return updatedAt; + } + + public enum GatewayName { + CHARGEBEE("chargebee"), + + CHARGEBEE_PAYMENTS("chargebee_payments"), + + ADYEN("adyen"), + + STRIPE("stripe"), + + WEPAY("wepay"), + + BRAINTREE("braintree"), + + AUTHORIZE_NET("authorize_net"), + + PAYPAL_PRO("paypal_pro"), + + PIN("pin"), + + EWAY("eway"), + + EWAY_RAPID("eway_rapid"), + + WORLDPAY("worldpay"), + + BALANCED_PAYMENTS("balanced_payments"), + + BEANSTREAM("beanstream"), + + BLUEPAY("bluepay"), + + ELAVON("elavon"), + + FIRST_DATA_GLOBAL("first_data_global"), + + HDFC("hdfc"), + + MIGS("migs"), + + NMI("nmi"), + + OGONE("ogone"), + + PAYMILL("paymill"), + + PAYPAL_PAYFLOW_PRO("paypal_payflow_pro"), + + SAGE_PAY("sage_pay"), + + TCO("tco"), + + WIRECARD("wirecard"), + + AMAZON_PAYMENTS("amazon_payments"), + + PAYPAL_EXPRESS_CHECKOUT("paypal_express_checkout"), + + GOCARDLESS("gocardless"), + + ORBITAL("orbital"), + + MONERIS_US("moneris_us"), + + MONERIS("moneris"), + + BLUESNAP("bluesnap"), + + CYBERSOURCE("cybersource"), + + VANTIV("vantiv"), + + CHECKOUT_COM("checkout_com"), + + PAYPAL("paypal"), + + INGENICO_DIRECT("ingenico_direct"), + + EXACT("exact"), + + MOLLIE("mollie"), + + QUICKBOOKS("quickbooks"), + + RAZORPAY("razorpay"), + + GLOBAL_PAYMENTS("global_payments"), + + BANK_OF_AMERICA("bank_of_america"), + + ECENTRIC("ecentric"), + + METRICS_GLOBAL("metrics_global"), + + WINDCAVE("windcave"), + + PAY_COM("pay_com"), + + EBANX("ebanx"), + + DLOCAL("dlocal"), + + NUVEI("nuvei"), + + SOLIDGATE("solidgate"), + + PAYSTACK("paystack"), + + JP_MORGAN("jp_morgan"), + + DEUTSCHE_BANK("deutsche_bank"), + + EZIDEBIT("ezidebit"), + + TWIKEY("twikey"), + + TEMPUS("tempus"), + + MOYASAR("moyasar"), + + PAYWAY("payway"), + + NOT_APPLICABLE("not_applicable"), + + /** An enum member indicating that GatewayName was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + GatewayName(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static GatewayName fromString(String value) { + if (value == null) return _UNKNOWN; + for (GatewayName enumValue : GatewayName.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ACTIVE("active"), + + INACTIVE("inactive"), + + PENDING_VERIFICATION("pending_verification"), + + /** An enum member indicating that Status was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Status(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Status fromString(String value) { + if (value == null) return _UNKNOWN; + for (Status enumValue : Status.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static GatewayPaymentMethodToken fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static GatewayPaymentMethodToken fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static GatewayPaymentMethodToken fromJson(JsonObject jsonObj) { + GatewayPaymentMethodToken obj = new GatewayPaymentMethodToken(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.gatewayAccountId = JsonUtil.getString(jsonObj, "gateway_account_id"); + + obj.gatewayName = GatewayName.fromString(JsonUtil.getString(jsonObj, "gateway_name")); + + obj.gatewayCustomerId = JsonUtil.getString(jsonObj, "gateway_customer_id"); + + obj.gatewayToken = JsonUtil.getString(jsonObj, "gateway_token"); + + obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + + return obj; + } + + @Override + public String toString() { + return "GatewayPaymentMethodToken{" + + "id=" + + id + + ", gatewayAccountId=" + + gatewayAccountId + + ", gatewayName=" + + gatewayName + + ", gatewayCustomerId=" + + gatewayCustomerId + + ", gatewayToken=" + + gatewayToken + + ", status=" + + status + + ", createdAt=" + + createdAt + + ", updatedAt=" + + updatedAt + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + GatewayPaymentMethodToken that = (GatewayPaymentMethodToken) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(gatewayAccountId, that.gatewayAccountId) + && java.util.Objects.equals(gatewayName, that.gatewayName) + && java.util.Objects.equals(gatewayCustomerId, that.gatewayCustomerId) + && java.util.Objects.equals(gatewayToken, that.gatewayToken) + && java.util.Objects.equals(status, that.status) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(updatedAt, that.updatedAt); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, + gatewayAccountId, + gatewayName, + gatewayCustomerId, + gatewayToken, + status, + createdAt, + updatedAt); + } +} diff --git a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPagePreCancelParams.java b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPagePreCancelParams.java index 0385991be..c42e3d638 100644 --- a/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPagePreCancelParams.java +++ b/src/main/java/com/chargebee/v4/models/hostedPage/params/HostedPagePreCancelParams.java @@ -19,6 +19,8 @@ public final class HostedPagePreCancelParams { private final String redirectUrl; + private final String locale; + private final SubscriptionParams subscription; private HostedPagePreCancelParams(HostedPagePreCancelBuilder builder) { @@ -29,6 +31,8 @@ private HostedPagePreCancelParams(HostedPagePreCancelBuilder builder) { this.redirectUrl = builder.redirectUrl; + this.locale = builder.locale; + this.subscription = builder.subscription; } @@ -44,6 +48,10 @@ public String getRedirectUrl() { return redirectUrl; } + public String getLocale() { + return locale; + } + public SubscriptionParams getSubscription() { return subscription; } @@ -67,6 +75,11 @@ public Map toFormData() { formData.put("redirect_url", this.redirectUrl); } + if (this.locale != null) { + + formData.put("locale", this.locale); + } + if (this.subscription != null) { // Single object @@ -94,6 +107,8 @@ public static final class HostedPagePreCancelBuilder { private String redirectUrl; + private String locale; + private SubscriptionParams subscription; private HostedPagePreCancelBuilder() {} @@ -113,6 +128,11 @@ public HostedPagePreCancelBuilder redirectUrl(String value) { return this; } + public HostedPagePreCancelBuilder locale(String value) { + this.locale = value; + return this; + } + public HostedPagePreCancelBuilder subscription(SubscriptionParams value) { this.subscription = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceVoidBeforeCaptureParams.java b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceVoidBeforeCaptureParams.java new file mode 100644 index 000000000..57dc2f000 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/params/InvoiceVoidBeforeCaptureParams.java @@ -0,0 +1,128 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ +package com.chargebee.v4.models.invoice.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class InvoiceVoidBeforeCaptureParams { + + private final String comment; + + private final String voidReasonCode; + + private final InvoiceAction invoiceAction; + + private InvoiceVoidBeforeCaptureParams(InvoiceVoidBeforeCaptureBuilder builder) { + + this.comment = builder.comment; + + this.voidReasonCode = builder.voidReasonCode; + + this.invoiceAction = builder.invoiceAction; + } + + public String getComment() { + return comment; + } + + public String getVoidReasonCode() { + return voidReasonCode; + } + + public InvoiceAction getInvoiceAction() { + return invoiceAction; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.comment != null) { + + formData.put("comment", this.comment); + } + + if (this.voidReasonCode != null) { + + formData.put("void_reason_code", this.voidReasonCode); + } + + if (this.invoiceAction != null) { + + formData.put("invoice_action", this.invoiceAction); + } + + return formData; + } + + /** Create a new builder for InvoiceVoidBeforeCaptureParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static InvoiceVoidBeforeCaptureBuilder builder() { + return new InvoiceVoidBeforeCaptureBuilder(); + } + + public static final class InvoiceVoidBeforeCaptureBuilder { + + private String comment; + + private String voidReasonCode; + + private InvoiceAction invoiceAction; + + private InvoiceVoidBeforeCaptureBuilder() {} + + public InvoiceVoidBeforeCaptureBuilder comment(String value) { + this.comment = value; + return this; + } + + public InvoiceVoidBeforeCaptureBuilder voidReasonCode(String value) { + this.voidReasonCode = value; + return this; + } + + public InvoiceVoidBeforeCaptureBuilder invoiceAction(InvoiceAction value) { + this.invoiceAction = value; + return this; + } + + public InvoiceVoidBeforeCaptureParams build() { + return new InvoiceVoidBeforeCaptureParams(this); + } + } + + public enum InvoiceAction { + VOID("void"), + + WRITE_OFF("write_off"), + + /** An enum member indicating that InvoiceAction was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + InvoiceAction(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static InvoiceAction fromString(String value) { + if (value == null) return _UNKNOWN; + for (InvoiceAction enumValue : InvoiceAction.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceVoidBeforeCaptureResponse.java b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceVoidBeforeCaptureResponse.java new file mode 100644 index 000000000..6e490ec9b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/invoice/responses/InvoiceVoidBeforeCaptureResponse.java @@ -0,0 +1,128 @@ +package com.chargebee.v4.models.invoice.responses; + +import com.chargebee.v4.models.invoice.Invoice; + +import com.chargebee.v4.models.creditNote.CreditNote; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for InvoiceVoidBeforeCapture operation. Contains the response data from + * the API. + */ +public final class InvoiceVoidBeforeCaptureResponse extends BaseResponse { + private final Invoice invoice; + + private final CreditNote creditNote; + + private InvoiceVoidBeforeCaptureResponse(Builder builder) { + super(builder.httpResponse); + + this.invoice = builder.invoice; + + this.creditNote = builder.creditNote; + } + + /** Parse JSON response into InvoiceVoidBeforeCaptureResponse object. */ + public static InvoiceVoidBeforeCaptureResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into InvoiceVoidBeforeCaptureResponse object with HTTP response. */ + public static InvoiceVoidBeforeCaptureResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __invoiceObj = JsonUtil.getJsonObject(jsonObj, "invoice"); + if (__invoiceObj != null) { + builder.invoice(Invoice.fromJson(__invoiceObj)); + } + + JsonObject __creditNoteObj = JsonUtil.getJsonObject(jsonObj, "credit_note"); + if (__creditNoteObj != null) { + builder.creditNote(CreditNote.fromJson(__creditNoteObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse InvoiceVoidBeforeCaptureResponse from JSON", e); + } + } + + /** Create a new builder for InvoiceVoidBeforeCaptureResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for InvoiceVoidBeforeCaptureResponse. */ + public static class Builder { + + private Invoice invoice; + + private CreditNote creditNote; + + private Response httpResponse; + + private Builder() {} + + public Builder invoice(Invoice invoice) { + this.invoice = invoice; + return this; + } + + public Builder creditNote(CreditNote creditNote) { + this.creditNote = creditNote; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public InvoiceVoidBeforeCaptureResponse build() { + return new InvoiceVoidBeforeCaptureResponse(this); + } + } + + /** Get the invoice from the response. */ + public Invoice getInvoice() { + return invoice; + } + + /** Get the creditNote from the response. */ + public CreditNote getCreditNote() { + return creditNote; + } + + @Override + public String toString() { + return "InvoiceVoidBeforeCaptureResponse{" + + "invoice=" + + invoice + + ", creditNote=" + + creditNote + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + InvoiceVoidBeforeCaptureResponse that = (InvoiceVoidBeforeCaptureResponse) o; + return java.util.Objects.equals(invoice, that.invoice) + && java.util.Objects.equals(creditNote, that.creditNote); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(invoice, creditNote); + } +} diff --git a/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java b/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java index 4816665c8..5de0838d7 100644 --- a/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java +++ b/src/main/java/com/chargebee/v4/models/ledgerOperation/params/ListLedgerOperationsParams.java @@ -198,7 +198,7 @@ public ListLedgerOperationsBuilder desc() { } } - public enum TypeIn { + public enum TypeIs { ALLOCATION("allocation"), CAPTURE("capture"), @@ -217,11 +217,11 @@ public enum TypeIn { ADJUSTMENT("adjustment"), - /** An enum member indicating that TypeIn was instantiated with an unknown value. */ + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - TypeIn(String value) { + TypeIs(String value) { this.value = value; } @@ -229,9 +229,9 @@ public String getValue() { return value; } - public static TypeIn fromString(String value) { + public static TypeIs fromString(String value) { if (value == null) return _UNKNOWN; - for (TypeIn enumValue : TypeIn.values()) { + for (TypeIs enumValue : TypeIs.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -240,7 +240,7 @@ public static TypeIn fromString(String value) { } } - public enum TypeIs { + public enum TypeIn { ALLOCATION("allocation"), CAPTURE("capture"), @@ -259,11 +259,11 @@ public enum TypeIs { ADJUSTMENT("adjustment"), - /** An enum member indicating that TypeIs was instantiated with an unknown value. */ + /** An enum member indicating that TypeIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - TypeIs(String value) { + TypeIn(String value) { this.value = value; } @@ -271,9 +271,9 @@ public String getValue() { return value; } - public static TypeIs fromString(String value) { + public static TypeIn fromString(String value) { if (value == null) return _UNKNOWN; - for (TypeIs enumValue : TypeIs.values()) { + for (TypeIn enumValue : TypeIn.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } diff --git a/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.java b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.java new file mode 100644 index 000000000..1428a9520 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/omnichannelSubscriptionItemMetric/OmnichannelSubscriptionItemMetric.java @@ -0,0 +1,173 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.omnichannelSubscriptionItemMetric; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class OmnichannelSubscriptionItemMetric { + + private String customerId; + private String omnichannelSubscriptionId; + private String omnichannelSubscriptionItemId; + private String itemIdAtSource; + private String mrrCurrency; + private Long mrrUnits; + private Long mrrNanos; + private Timestamp effectiveFrom; + private Timestamp calculatedAt; + private Timestamp createdAt; + private Long resourceVersion; + + public String getCustomerId() { + return customerId; + } + + public String getOmnichannelSubscriptionId() { + return omnichannelSubscriptionId; + } + + public String getOmnichannelSubscriptionItemId() { + return omnichannelSubscriptionItemId; + } + + public String getItemIdAtSource() { + return itemIdAtSource; + } + + public String getMrrCurrency() { + return mrrCurrency; + } + + public Long getMrrUnits() { + return mrrUnits; + } + + public Long getMrrNanos() { + return mrrNanos; + } + + public Timestamp getEffectiveFrom() { + return effectiveFrom; + } + + public Timestamp getCalculatedAt() { + return calculatedAt; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Long getResourceVersion() { + return resourceVersion; + } + + public static OmnichannelSubscriptionItemMetric fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static OmnichannelSubscriptionItemMetric fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static OmnichannelSubscriptionItemMetric fromJson(JsonObject jsonObj) { + OmnichannelSubscriptionItemMetric obj = new OmnichannelSubscriptionItemMetric(); + + obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + + obj.omnichannelSubscriptionId = JsonUtil.getString(jsonObj, "omnichannel_subscription_id"); + + obj.omnichannelSubscriptionItemId = + JsonUtil.getString(jsonObj, "omnichannel_subscription_item_id"); + + obj.itemIdAtSource = JsonUtil.getString(jsonObj, "item_id_at_source"); + + obj.mrrCurrency = JsonUtil.getString(jsonObj, "mrr_currency"); + + obj.mrrUnits = JsonUtil.getLong(jsonObj, "mrr_units"); + + obj.mrrNanos = JsonUtil.getLong(jsonObj, "mrr_nanos"); + + obj.effectiveFrom = JsonUtil.getTimestamp(jsonObj, "effective_from"); + + obj.calculatedAt = JsonUtil.getTimestamp(jsonObj, "calculated_at"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.resourceVersion = JsonUtil.getLong(jsonObj, "resource_version"); + + return obj; + } + + @Override + public String toString() { + return "OmnichannelSubscriptionItemMetric{" + + "customerId=" + + customerId + + ", omnichannelSubscriptionId=" + + omnichannelSubscriptionId + + ", omnichannelSubscriptionItemId=" + + omnichannelSubscriptionItemId + + ", itemIdAtSource=" + + itemIdAtSource + + ", mrrCurrency=" + + mrrCurrency + + ", mrrUnits=" + + mrrUnits + + ", mrrNanos=" + + mrrNanos + + ", effectiveFrom=" + + effectiveFrom + + ", calculatedAt=" + + calculatedAt + + ", createdAt=" + + createdAt + + ", resourceVersion=" + + resourceVersion + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + OmnichannelSubscriptionItemMetric that = (OmnichannelSubscriptionItemMetric) o; + return java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(omnichannelSubscriptionId, that.omnichannelSubscriptionId) + && java.util.Objects.equals( + omnichannelSubscriptionItemId, that.omnichannelSubscriptionItemId) + && java.util.Objects.equals(itemIdAtSource, that.itemIdAtSource) + && java.util.Objects.equals(mrrCurrency, that.mrrCurrency) + && java.util.Objects.equals(mrrUnits, that.mrrUnits) + && java.util.Objects.equals(mrrNanos, that.mrrNanos) + && java.util.Objects.equals(effectiveFrom, that.effectiveFrom) + && java.util.Objects.equals(calculatedAt, that.calculatedAt) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(resourceVersion, that.resourceVersion); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + customerId, + omnichannelSubscriptionId, + omnichannelSubscriptionItemId, + itemIdAtSource, + mrrCurrency, + mrrUnits, + mrrNanos, + effectiveFrom, + calculatedAt, + createdAt, + resourceVersion); + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java b/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java index 0cc1ee246..ad6e8ffe3 100644 --- a/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java @@ -28,6 +28,7 @@ public class PaymentIntent { private Timestamp modifiedAt; private Long resourceVersion; private Timestamp updatedAt; + private java.util.Map paymentMethodOptions; private String customerId; private String gateway; private String businessEntityId; @@ -91,6 +92,10 @@ public Timestamp getUpdatedAt() { return updatedAt; } + public java.util.Map getPaymentMethodOptions() { + return paymentMethodOptions; + } + public String getCustomerId() { return customerId; } @@ -317,6 +322,13 @@ public static PaymentIntent fromJson(JsonObject jsonObj) { obj.updatedAt = JsonUtil.getTimestamp(jsonObj, "updated_at"); + JsonObject __paymentMethodOptionsObj = + JsonUtil.getJsonObject(jsonObj, "payment_method_options"); + obj.paymentMethodOptions = + __paymentMethodOptionsObj != null + ? JsonUtil.parseJsonObjectToMap(__paymentMethodOptionsObj) + : new java.util.HashMap<>(); + obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); obj.gateway = JsonUtil.getString(jsonObj, "gateway"); @@ -373,6 +385,8 @@ public String toString() { + resourceVersion + ", updatedAt=" + updatedAt + + ", paymentMethodOptions=" + + paymentMethodOptions + ", customerId=" + customerId + ", gateway=" @@ -408,6 +422,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(modifiedAt, that.modifiedAt) && java.util.Objects.equals(resourceVersion, that.resourceVersion) && java.util.Objects.equals(updatedAt, that.updatedAt) + && java.util.Objects.equals(paymentMethodOptions, that.paymentMethodOptions) && java.util.Objects.equals(customerId, that.customerId) && java.util.Objects.equals(gateway, that.gateway) && java.util.Objects.equals(businessEntityId, that.businessEntityId) @@ -434,6 +449,7 @@ public int hashCode() { modifiedAt, resourceVersion, updatedAt, + paymentMethodOptions, customerId, gateway, businessEntityId, @@ -454,6 +470,8 @@ public static class ActivePaymentAttempt { private Timestamp createdAt; private Timestamp modifiedAt; private ErrorDetail errorDetail; + private String routingRuleId; + private String paymentMethodDisplayRuleId; public String getId() { return id; @@ -495,6 +513,14 @@ public ErrorDetail getErrorDetail() { return errorDetail; } + public String getRoutingRuleId() { + return routingRuleId; + } + + public String getPaymentMethodDisplayRuleId() { + return paymentMethodDisplayRuleId; + } + public enum Status { INITED("inited"), @@ -698,6 +724,11 @@ public static ActivePaymentAttempt fromJson(JsonObject jsonObj) { obj.errorDetail = ErrorDetail.fromJson(__errorDetailObj); } + obj.routingRuleId = JsonUtil.getString(jsonObj, "routing_rule_id"); + + obj.paymentMethodDisplayRuleId = + JsonUtil.getString(jsonObj, "payment_method_display_rule_id"); + return obj; } @@ -724,6 +755,10 @@ public String toString() { + modifiedAt + ", errorDetail=" + errorDetail + + ", routingRuleId=" + + routingRuleId + + ", paymentMethodDisplayRuleId=" + + paymentMethodDisplayRuleId + "}"; } @@ -742,7 +777,9 @@ public boolean equals(Object o) { && java.util.Objects.equals(checkoutDetails, that.checkoutDetails) && java.util.Objects.equals(createdAt, that.createdAt) && java.util.Objects.equals(modifiedAt, that.modifiedAt) - && java.util.Objects.equals(errorDetail, that.errorDetail); + && java.util.Objects.equals(errorDetail, that.errorDetail) + && java.util.Objects.equals(routingRuleId, that.routingRuleId) + && java.util.Objects.equals(paymentMethodDisplayRuleId, that.paymentMethodDisplayRuleId); } @Override @@ -758,7 +795,9 @@ public int hashCode() { checkoutDetails, createdAt, modifiedAt, - errorDetail); + errorDetail, + routingRuleId, + paymentMethodDisplayRuleId); } public static class ErrorDetail { @@ -977,6 +1016,8 @@ public static class PaymentAttempts { private Timestamp createdAt; private Timestamp modifiedAt; private ErrorDetail errorDetail; + private String routingRuleId; + private String paymentMethodDisplayRuleId; public String getId() { return id; @@ -1018,6 +1059,14 @@ public ErrorDetail getErrorDetail() { return errorDetail; } + public String getRoutingRuleId() { + return routingRuleId; + } + + public String getPaymentMethodDisplayRuleId() { + return paymentMethodDisplayRuleId; + } + public enum Status { INITED("inited"), @@ -1221,6 +1270,11 @@ public static PaymentAttempts fromJson(JsonObject jsonObj) { obj.errorDetail = ErrorDetail.fromJson(__errorDetailObj); } + obj.routingRuleId = JsonUtil.getString(jsonObj, "routing_rule_id"); + + obj.paymentMethodDisplayRuleId = + JsonUtil.getString(jsonObj, "payment_method_display_rule_id"); + return obj; } @@ -1247,6 +1301,10 @@ public String toString() { + modifiedAt + ", errorDetail=" + errorDetail + + ", routingRuleId=" + + routingRuleId + + ", paymentMethodDisplayRuleId=" + + paymentMethodDisplayRuleId + "}"; } @@ -1265,7 +1323,9 @@ public boolean equals(Object o) { && java.util.Objects.equals(checkoutDetails, that.checkoutDetails) && java.util.Objects.equals(createdAt, that.createdAt) && java.util.Objects.equals(modifiedAt, that.modifiedAt) - && java.util.Objects.equals(errorDetail, that.errorDetail); + && java.util.Objects.equals(errorDetail, that.errorDetail) + && java.util.Objects.equals(routingRuleId, that.routingRuleId) + && java.util.Objects.equals(paymentMethodDisplayRuleId, that.paymentMethodDisplayRuleId); } @Override @@ -1281,7 +1341,9 @@ public int hashCode() { checkoutDetails, createdAt, modifiedAt, - errorDetail); + errorDetail, + routingRuleId, + paymentMethodDisplayRuleId); } public static class ErrorDetail { @@ -1512,25 +1574,17 @@ public Timestamp getCreatedAt() { } public enum Source { - CB_JS("cb_js"), - - COMPONENTS_FIELDS("components_fields"), - - CHECKOUT_V_3("checkout_v3"), - - PAYNOW_V_3("paynow_v3"), - - PORTAL_V_3("portal_v3"), + PAYMENT_METHOD_HELPER("payment_method_helper"), - GIFT_V_3("gift_v3"), + CARD_COMPONENTS("card_components"), - CHECKOUT_V_4("checkout_v4"), + CHECKOUT("checkout"), - PAYMENT_COMPONENT("payment_component"), + COLLECT_NOW("collect_now"), - PC_INAPP_V_4("pc_inapp_v4"), + PORTAL("portal"), - PC_FPC_V_4("pc_fpc_v4"), + PAYMENT_COMPONENTS("payment_components"), /** An enum member indicating that Source was instantiated with an unknown value. */ _UNKNOWN(null); diff --git a/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java index 8a8ff02bd..caa4c1e26 100644 --- a/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentCreateParams.java @@ -7,6 +7,7 @@ package com.chargebee.v4.models.paymentIntent.params; import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; import java.util.LinkedHashMap; import java.util.Map; @@ -33,6 +34,8 @@ public final class PaymentIntentCreateParams { private final String failureUrl; + private final java.util.Map paymentMethodOptions; + private PaymentIntentCreateParams(PaymentIntentCreateBuilder builder) { this.businessEntityId = builder.businessEntityId; @@ -54,6 +57,8 @@ private PaymentIntentCreateParams(PaymentIntentCreateBuilder builder) { this.successUrl = builder.successUrl; this.failureUrl = builder.failureUrl; + + this.paymentMethodOptions = builder.paymentMethodOptions; } public String getBusinessEntityId() { @@ -96,6 +101,10 @@ public String getFailureUrl() { return failureUrl; } + public java.util.Map getPaymentMethodOptions() { + return paymentMethodOptions; + } + /** Get the form data for this request. */ public Map toFormData() { Map formData = new LinkedHashMap<>(); @@ -150,6 +159,11 @@ public Map toFormData() { formData.put("failure_url", this.failureUrl); } + if (this.paymentMethodOptions != null) { + + formData.put("payment_method_options", JsonUtil.toJson(this.paymentMethodOptions)); + } + return formData; } @@ -181,6 +195,8 @@ public static final class PaymentIntentCreateBuilder { private String failureUrl; + private java.util.Map paymentMethodOptions; + private PaymentIntentCreateBuilder() {} public PaymentIntentCreateBuilder businessEntityId(String value) { @@ -233,6 +249,11 @@ public PaymentIntentCreateBuilder failureUrl(String value) { return this; } + public PaymentIntentCreateBuilder paymentMethodOptions(java.util.Map value) { + this.paymentMethodOptions = value; + return this; + } + public PaymentIntentCreateParams build() { return new PaymentIntentCreateParams(this); } diff --git a/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java index 20b838bf2..437d5639d 100644 --- a/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/params/PaymentIntentUpdateParams.java @@ -7,6 +7,7 @@ package com.chargebee.v4.models.paymentIntent.params; import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.internal.JsonUtil; import java.util.LinkedHashMap; import java.util.Map; @@ -25,6 +26,8 @@ public final class PaymentIntentUpdateParams { private final String failureUrl; + private final java.util.Map paymentMethodOptions; + private PaymentIntentUpdateParams(PaymentIntentUpdateBuilder builder) { this.amount = builder.amount; @@ -38,6 +41,8 @@ private PaymentIntentUpdateParams(PaymentIntentUpdateBuilder builder) { this.successUrl = builder.successUrl; this.failureUrl = builder.failureUrl; + + this.paymentMethodOptions = builder.paymentMethodOptions; } public Long getAmount() { @@ -64,6 +69,10 @@ public String getFailureUrl() { return failureUrl; } + public java.util.Map getPaymentMethodOptions() { + return paymentMethodOptions; + } + /** Get the form data for this request. */ public Map toFormData() { Map formData = new LinkedHashMap<>(); @@ -98,6 +107,11 @@ public Map toFormData() { formData.put("failure_url", this.failureUrl); } + if (this.paymentMethodOptions != null) { + + formData.put("payment_method_options", JsonUtil.toJson(this.paymentMethodOptions)); + } + return formData; } @@ -121,6 +135,8 @@ public static final class PaymentIntentUpdateBuilder { private String failureUrl; + private java.util.Map paymentMethodOptions; + private PaymentIntentUpdateBuilder() {} public PaymentIntentUpdateBuilder amount(Long value) { @@ -153,6 +169,11 @@ public PaymentIntentUpdateBuilder failureUrl(String value) { return this; } + public PaymentIntentUpdateBuilder paymentMethodOptions(java.util.Map value) { + this.paymentMethodOptions = value; + return this; + } + public PaymentIntentUpdateParams build() { return new PaymentIntentUpdateParams(this); } diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java index 62f9fa958..b9dfe8b3a 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java @@ -26,6 +26,7 @@ public class PaymentSource { private String gatewayAccountId; private String ipAddress; private String issuingCountry; + private java.util.Map vaultToken; private Boolean deleted; private String businessEntityId; private Card card; @@ -87,6 +88,10 @@ public String getIssuingCountry() { return issuingCountry; } + public java.util.Map getVaultToken() { + return vaultToken; + } + public Boolean getDeleted() { return deleted; } @@ -482,6 +487,12 @@ public static PaymentSource fromJson(JsonObject jsonObj) { obj.issuingCountry = JsonUtil.getString(jsonObj, "issuing_country"); + JsonObject __vaultTokenObj = JsonUtil.getJsonObject(jsonObj, "vault_token"); + obj.vaultToken = + __vaultTokenObj != null + ? JsonUtil.parseJsonObjectToMap(__vaultTokenObj) + : new java.util.HashMap<>(); + obj.deleted = JsonUtil.getBoolean(jsonObj, "deleted"); obj.businessEntityId = JsonUtil.getString(jsonObj, "business_entity_id"); @@ -564,6 +575,8 @@ public String toString() { + ipAddress + ", issuingCountry=" + issuingCountry + + ", vaultToken=" + + vaultToken + ", deleted=" + deleted + ", businessEntityId=" @@ -609,6 +622,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(gatewayAccountId, that.gatewayAccountId) && java.util.Objects.equals(ipAddress, that.ipAddress) && java.util.Objects.equals(issuingCountry, that.issuingCountry) + && java.util.Objects.equals(vaultToken, that.vaultToken) && java.util.Objects.equals(deleted, that.deleted) && java.util.Objects.equals(businessEntityId, that.businessEntityId) && java.util.Objects.equals(card, that.card) @@ -639,6 +653,7 @@ public int hashCode() { gatewayAccountId, ipAddress, issuingCountry, + vaultToken, deleted, businessEntityId, card, diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/ListGatewayTokensForPaymentSourceParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/ListGatewayTokensForPaymentSourceParams.java new file mode 100644 index 000000000..2fd1a5fdf --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/ListGatewayTokensForPaymentSourceParams.java @@ -0,0 +1,67 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.paymentSource.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ListGatewayTokensForPaymentSourceParams { + + private final Map queryParams; + + private ListGatewayTokensForPaymentSourceParams( + ListGatewayTokensForPaymentSourceBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ListGatewayTokensForPaymentSourceBuilder toBuilder() { + ListGatewayTokensForPaymentSourceBuilder builder = + new ListGatewayTokensForPaymentSourceBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ListGatewayTokensForPaymentSourceParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ListGatewayTokensForPaymentSourceBuilder builder() { + return new ListGatewayTokensForPaymentSourceBuilder(); + } + + public static final class ListGatewayTokensForPaymentSourceBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ListGatewayTokensForPaymentSourceBuilder() {} + + public ListGatewayTokensForPaymentSourceBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ListGatewayTokensForPaymentSourceBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public ListGatewayTokensForPaymentSourceBuilder includeDeleted(Boolean value) { + queryParams.put("include_deleted", value); + return this; + } + + public ListGatewayTokensForPaymentSourceParams build() { + return new ListGatewayTokensForPaymentSourceParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/responses/ListGatewayTokensForPaymentSourceResponse.java b/src/main/java/com/chargebee/v4/models/paymentSource/responses/ListGatewayTokensForPaymentSourceResponse.java new file mode 100644 index 000000000..2988da04c --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/paymentSource/responses/ListGatewayTokensForPaymentSourceResponse.java @@ -0,0 +1,240 @@ +package com.chargebee.v4.models.paymentSource.responses; + +import java.util.List; + +import com.chargebee.v4.models.gatewayPaymentMethodToken.GatewayPaymentMethodToken; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.PaymentSourceService; +import com.chargebee.v4.models.paymentSource.params.ListGatewayTokensForPaymentSourceParams; + +/** + * Immutable response object for ListGatewayTokensForPaymentSource operation. Contains paginated + * list data. + */ +public final class ListGatewayTokensForPaymentSourceResponse { + + private final List list; + + private final String nextOffset; + + private final String custPaymentSourceId; + + private final PaymentSourceService service; + private final ListGatewayTokensForPaymentSourceParams originalParams; + private final Response httpResponse; + + private ListGatewayTokensForPaymentSourceResponse( + List list, + String nextOffset, + String custPaymentSourceId, + PaymentSourceService service, + ListGatewayTokensForPaymentSourceParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.custPaymentSourceId = custPaymentSourceId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into ListGatewayTokensForPaymentSourceResponse object (no service context). + * Use this when you only need to read a single page (no nextPage()). + */ + public static ListGatewayTokensForPaymentSourceResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + PaymentSourceListGatewayTokensForPaymentSourceItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new ListGatewayTokensForPaymentSourceResponse( + list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ListGatewayTokensForPaymentSourceResponse from JSON", e); + } + } + + /** + * Parse JSON response into ListGatewayTokensForPaymentSourceResponse object with service context + * for pagination (enables nextPage()). + */ + public static ListGatewayTokensForPaymentSourceResponse fromJson( + String json, + PaymentSourceService service, + ListGatewayTokensForPaymentSourceParams originalParams, + String custPaymentSourceId, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + PaymentSourceListGatewayTokensForPaymentSourceItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new ListGatewayTokensForPaymentSourceResponse( + list, nextOffset, custPaymentSourceId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ListGatewayTokensForPaymentSourceResponse from JSON", e); + } + } + + /** Get the list from the response. */ + public List getList() { + return list; + } + + /** Get the nextOffset from the response. */ + public String getNextOffset() { + return nextOffset; + } + + /** Check if there are more pages available. */ + public boolean hasNextPage() { + return nextOffset != null && !nextOffset.isEmpty(); + } + + /** + * Get the next page of results. + * + * @throws ChargebeeException if unable to fetch next page + */ + public ListGatewayTokensForPaymentSourceResponse nextPage() throws ChargebeeException { + if (!hasNextPage()) { + throw new IllegalStateException("No more pages available"); + } + if (service == null) { + throw new UnsupportedOperationException( + "nextPage() requires service context. Use fromJson(json, service, originalParams, httpResponse)."); + } + + ListGatewayTokensForPaymentSourceParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : ListGatewayTokensForPaymentSourceParams.builder()) + .offset(nextOffset) + .build(); + + return service.listGatewayTokensForPaymentSource(custPaymentSourceId, nextParams); + } + + /** Get the raw response payload as JSON string. */ + public String responsePayload() { + return httpResponse != null ? httpResponse.getBodyAsString() : null; + } + + /** Get the HTTP status code. */ + public int httpStatus() { + return httpResponse != null ? httpResponse.getStatusCode() : 0; + } + + /** Get response headers. */ + public java.util.Map> headers() { + return httpResponse != null ? httpResponse.getHeaders() : java.util.Collections.emptyMap(); + } + + /** Get a specific header value. */ + public java.util.List header(String name) { + if (httpResponse == null) return null; + return httpResponse.getHeaders().entrySet().stream() + .filter(e -> e.getKey().equalsIgnoreCase(name)) + .map(java.util.Map.Entry::getValue) + .findFirst() + .orElse(null); + } + + @Override + public String toString() { + return "ListGatewayTokensForPaymentSourceResponse{" + + "list=" + + list + + ", nextOffset=" + + nextOffset + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ListGatewayTokensForPaymentSourceResponse that = (ListGatewayTokensForPaymentSourceResponse) o; + return java.util.Objects.equals(list, that.list) + && java.util.Objects.equals(nextOffset, that.nextOffset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(list, nextOffset); + } + + public static class PaymentSourceListGatewayTokensForPaymentSourceItem { + + private GatewayPaymentMethodToken gatewayPaymentMethodToken; + + public GatewayPaymentMethodToken getGatewayPaymentMethodToken() { + return gatewayPaymentMethodToken; + } + + public static PaymentSourceListGatewayTokensForPaymentSourceItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static PaymentSourceListGatewayTokensForPaymentSourceItem fromJson(JsonObject jsonObj) { + PaymentSourceListGatewayTokensForPaymentSourceItem item = + new PaymentSourceListGatewayTokensForPaymentSourceItem(); + + JsonObject __gatewayPaymentMethodTokenObj = + JsonUtil.getJsonObject(jsonObj, "gateway_payment_method_token"); + if (__gatewayPaymentMethodTokenObj != null) { + item.gatewayPaymentMethodToken = + GatewayPaymentMethodToken.fromJson(__gatewayPaymentMethodTokenObj); + } + + return item; + } + + @Override + public String toString() { + return "PaymentSourceListGatewayTokensForPaymentSourceItem{" + + "gatewayPaymentMethodToken=" + + gatewayPaymentMethodToken + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + PaymentSourceListGatewayTokensForPaymentSourceItem that = + (PaymentSourceListGatewayTokensForPaymentSourceItem) o; + return java.util.Objects.equals(gatewayPaymentMethodToken, that.gatewayPaymentMethodToken); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(gatewayPaymentMethodToken); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quote/Quote.java b/src/main/java/com/chargebee/v4/models/quote/Quote.java index 2d03f1b34..c28cccf73 100644 --- a/src/main/java/com/chargebee/v4/models/quote/Quote.java +++ b/src/main/java/com/chargebee/v4/models/quote/Quote.java @@ -49,6 +49,7 @@ public class Quote { private Boolean deleted; private Long totalContractValue; private Long totalDiscount; + private Boolean hasEntitlements; private List lineItems; private List lineItemTiers; private List lineItemDiscounts; @@ -192,6 +193,10 @@ public Long getTotalDiscount() { return totalDiscount; } + public Boolean getHasEntitlements() { + return hasEntitlements; + } + public List getLineItems() { return lineItems; } @@ -427,6 +432,8 @@ public static Quote fromJson(JsonObject jsonObj) { knownFields.add("total_discount"); + knownFields.add("has_entitlements"); + knownFields.add("line_items"); knownFields.add("line_item_tiers"); @@ -512,6 +519,8 @@ public static Quote fromJson(JsonObject jsonObj) { obj.totalDiscount = JsonUtil.getLong(jsonObj, "total_discount"); + obj.hasEntitlements = JsonUtil.getBoolean(jsonObj, "has_entitlements"); + obj.lineItems = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "line_items"), LineItems::fromJson); @@ -616,6 +625,8 @@ public String toString() { + totalContractValue + ", totalDiscount=" + totalDiscount + + ", hasEntitlements=" + + hasEntitlements + ", lineItems=" + lineItems + ", lineItemTiers=" @@ -676,6 +687,7 @@ public boolean equals(Object o) { && java.util.Objects.equals(deleted, that.deleted) && java.util.Objects.equals(totalContractValue, that.totalContractValue) && java.util.Objects.equals(totalDiscount, that.totalDiscount) + && java.util.Objects.equals(hasEntitlements, that.hasEntitlements) && java.util.Objects.equals(lineItems, that.lineItems) && java.util.Objects.equals(lineItemTiers, that.lineItemTiers) && java.util.Objects.equals(lineItemDiscounts, that.lineItemDiscounts) @@ -724,6 +736,7 @@ public int hashCode() { deleted, totalContractValue, totalDiscount, + hasEntitlements, lineItems, lineItemTiers, lineItemDiscounts, diff --git a/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java b/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java index 76aa8eb8c..a560c532e 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/CreateSubscriptionItemsForCustomerQuoteParams.java @@ -52,6 +52,8 @@ public final class CreateSubscriptionItemsForCustomerQuoteParams { private final List coupons; + private final List entitlementOverrides; + private final Map customFields; private CreateSubscriptionItemsForCustomerQuoteParams( @@ -93,6 +95,8 @@ private CreateSubscriptionItemsForCustomerQuoteParams( this.coupons = builder.coupons; + this.entitlementOverrides = builder.entitlementOverrides; + this.customFields = builder.customFields.isEmpty() ? Collections.emptyMap() @@ -171,6 +175,10 @@ public List getCoupons() { return coupons; } + public List getEntitlementOverrides() { + return entitlementOverrides; + } + public Map customFields() { return customFields; } @@ -329,6 +337,21 @@ public Map toFormData() { } } + if (this.entitlementOverrides != null) { + + // List of objects + for (int i = 0; i < this.entitlementOverrides.size(); i++) { + EntitlementOverridesParams item = this.entitlementOverrides.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entitlement_overrides[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + formData.putAll(customFields); return formData; @@ -378,6 +401,8 @@ public static final class CreateSubscriptionItemsForCustomerQuoteBuilder { private List coupons; + private List entitlementOverrides; + private Map customFields = new LinkedHashMap<>(); private CreateSubscriptionItemsForCustomerQuoteBuilder() {} @@ -478,6 +503,12 @@ public CreateSubscriptionItemsForCustomerQuoteBuilder coupons(List value) { + this.entitlementOverrides = value; + return this; + } + /** * Add a custom field to the request. Custom fields must start with "cf_". * @@ -1732,6 +1763,8 @@ public static final class SubscriptionItemsParams { private final Timestamp endDate; + private final String description; + private final String rampTierId; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1764,6 +1797,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.endDate = builder.endDate; + this.description = builder.description; + this.rampTierId = builder.rampTierId; } @@ -1823,6 +1858,10 @@ public Timestamp getEndDate() { return endDate; } + public String getDescription() { + return description; + } + public String getRampTierId() { return rampTierId; } @@ -1901,6 +1940,11 @@ public Map toFormData() { formData.put("end_date", this.endDate); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.rampTierId != null) { formData.put("ramp_tier_id", this.rampTierId); @@ -1945,6 +1989,8 @@ public static final class SubscriptionItemsBuilder { private Timestamp endDate; + private String description; + private String rampTierId; private SubscriptionItemsBuilder() {} @@ -2019,6 +2065,11 @@ public SubscriptionItemsBuilder endDate(Timestamp value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder rampTierId(String value) { this.rampTierId = value; return this; @@ -2805,4 +2856,204 @@ public CouponsParams build() { } } } + + public static final class EntitlementOverridesParams { + + private final String featureId; + + private final String entityId; + + private final EntityType entityType; + + private final String value; + + private final Boolean isEnabled; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private EntitlementOverridesParams(EntitlementOverridesBuilder builder) { + + this.featureId = builder.featureId; + + this.entityId = builder.entityId; + + this.entityType = builder.entityType; + + this.value = builder.value; + + this.isEnabled = builder.isEnabled; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public String getFeatureId() { + return featureId; + } + + public String getEntityId() { + return entityId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getValue() { + return value; + } + + public Boolean getIsEnabled() { + return isEnabled; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.featureId != null) { + + formData.put("feature_id", this.featureId); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.isEnabled != null) { + + formData.put("is_enabled", this.isEnabled); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for EntitlementOverridesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntitlementOverridesBuilder builder() { + return new EntitlementOverridesBuilder(); + } + + public static final class EntitlementOverridesBuilder { + + private String featureId; + + private String entityId; + + private EntityType entityType; + + private String value; + + private Boolean isEnabled; + + private Timestamp startDate; + + private Timestamp endDate; + + private EntitlementOverridesBuilder() {} + + public EntitlementOverridesBuilder featureId(String value) { + this.featureId = value; + return this; + } + + public EntitlementOverridesBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public EntitlementOverridesBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public EntitlementOverridesBuilder value(String value) { + this.value = value; + return this; + } + + public EntitlementOverridesBuilder isEnabled(Boolean value) { + this.isEnabled = value; + return this; + } + + public EntitlementOverridesBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public EntitlementOverridesBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public EntitlementOverridesParams build() { + return new EntitlementOverridesParams(this); + } + } + + public enum EntityType { + PLAN_PRICE("plan_price"), + + ADDON_PRICE("addon_price"), + + CHARGE_PRICE("charge_price"), + + CHARGE("charge"), + + /** An enum member indicating that EntityType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityType enumValue : EntityType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } } diff --git a/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java index a8a60667f..142f238bf 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/EditCreateSubscriptionCustomerQuoteForItemsParams.java @@ -50,6 +50,8 @@ public final class EditCreateSubscriptionCustomerQuoteForItemsParams { private final List coupons; + private final List entitlementOverrides; + private final Map customFields; private EditCreateSubscriptionCustomerQuoteForItemsParams( @@ -89,6 +91,8 @@ private EditCreateSubscriptionCustomerQuoteForItemsParams( this.coupons = builder.coupons; + this.entitlementOverrides = builder.entitlementOverrides; + this.customFields = builder.customFields.isEmpty() ? Collections.emptyMap() @@ -163,6 +167,10 @@ public List getCoupons() { return coupons; } + public List getEntitlementOverrides() { + return entitlementOverrides; + } + public Map customFields() { return customFields; } @@ -316,6 +324,21 @@ public Map toFormData() { } } + if (this.entitlementOverrides != null) { + + // List of objects + for (int i = 0; i < this.entitlementOverrides.size(); i++) { + EntitlementOverridesParams item = this.entitlementOverrides.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entitlement_overrides[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + formData.putAll(customFields); return formData; @@ -363,6 +386,8 @@ public static final class EditCreateSubscriptionCustomerQuoteForItemsBuilder { private List coupons; + private List entitlementOverrides; + private Map customFields = new LinkedHashMap<>(); private EditCreateSubscriptionCustomerQuoteForItemsBuilder() {} @@ -462,6 +487,12 @@ public EditCreateSubscriptionCustomerQuoteForItemsBuilder coupons(List value) { + this.entitlementOverrides = value; + return this; + } + /** * Add a custom field to the request. Custom fields must start with "cf_". * @@ -1716,6 +1747,8 @@ public static final class SubscriptionItemsParams { private final Timestamp endDate; + private final String description; + private final String rampTierId; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1748,6 +1781,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.endDate = builder.endDate; + this.description = builder.description; + this.rampTierId = builder.rampTierId; } @@ -1807,6 +1842,10 @@ public Timestamp getEndDate() { return endDate; } + public String getDescription() { + return description; + } + public String getRampTierId() { return rampTierId; } @@ -1885,6 +1924,11 @@ public Map toFormData() { formData.put("end_date", this.endDate); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.rampTierId != null) { formData.put("ramp_tier_id", this.rampTierId); @@ -1929,6 +1973,8 @@ public static final class SubscriptionItemsBuilder { private Timestamp endDate; + private String description; + private String rampTierId; private SubscriptionItemsBuilder() {} @@ -2003,6 +2049,11 @@ public SubscriptionItemsBuilder endDate(Timestamp value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder rampTierId(String value) { this.rampTierId = value; return this; @@ -2789,4 +2840,204 @@ public CouponsParams build() { } } } + + public static final class EntitlementOverridesParams { + + private final String featureId; + + private final String entityId; + + private final EntityType entityType; + + private final String value; + + private final Boolean isEnabled; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private EntitlementOverridesParams(EntitlementOverridesBuilder builder) { + + this.featureId = builder.featureId; + + this.entityId = builder.entityId; + + this.entityType = builder.entityType; + + this.value = builder.value; + + this.isEnabled = builder.isEnabled; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public String getFeatureId() { + return featureId; + } + + public String getEntityId() { + return entityId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getValue() { + return value; + } + + public Boolean getIsEnabled() { + return isEnabled; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.featureId != null) { + + formData.put("feature_id", this.featureId); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.isEnabled != null) { + + formData.put("is_enabled", this.isEnabled); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for EntitlementOverridesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntitlementOverridesBuilder builder() { + return new EntitlementOverridesBuilder(); + } + + public static final class EntitlementOverridesBuilder { + + private String featureId; + + private String entityId; + + private EntityType entityType; + + private String value; + + private Boolean isEnabled; + + private Timestamp startDate; + + private Timestamp endDate; + + private EntitlementOverridesBuilder() {} + + public EntitlementOverridesBuilder featureId(String value) { + this.featureId = value; + return this; + } + + public EntitlementOverridesBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public EntitlementOverridesBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public EntitlementOverridesBuilder value(String value) { + this.value = value; + return this; + } + + public EntitlementOverridesBuilder isEnabled(Boolean value) { + this.isEnabled = value; + return this; + } + + public EntitlementOverridesBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public EntitlementOverridesBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public EntitlementOverridesParams build() { + return new EntitlementOverridesParams(this); + } + } + + public enum EntityType { + PLAN_PRICE("plan_price"), + + ADDON_PRICE("addon_price"), + + CHARGE_PRICE("charge_price"), + + CHARGE("charge"), + + /** An enum member indicating that EntityType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityType enumValue : EntityType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } } diff --git a/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java index b88f4f4ac..a1dfbec99 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/EditUpdateSubscriptionQuoteForItemsParams.java @@ -64,6 +64,8 @@ public final class EditUpdateSubscriptionQuoteForItemsParams { private final List coupons; + private final List entitlementOverrides; + private final Map customFields; private EditUpdateSubscriptionQuoteForItemsParams( @@ -117,6 +119,8 @@ private EditUpdateSubscriptionQuoteForItemsParams( this.coupons = builder.coupons; + this.entitlementOverrides = builder.entitlementOverrides; + this.customFields = builder.customFields.isEmpty() ? Collections.emptyMap() @@ -219,6 +223,10 @@ public List getCoupons() { return coupons; } + public List getEntitlementOverrides() { + return entitlementOverrides; + } + public Map customFields() { return customFields; } @@ -412,6 +420,21 @@ public Map toFormData() { } } + if (this.entitlementOverrides != null) { + + // List of objects + for (int i = 0; i < this.entitlementOverrides.size(); i++) { + EntitlementOverridesParams item = this.entitlementOverrides.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entitlement_overrides[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + formData.putAll(customFields); return formData; @@ -473,6 +496,8 @@ public static final class EditUpdateSubscriptionQuoteForItemsBuilder { private List coupons; + private List entitlementOverrides; + private Map customFields = new LinkedHashMap<>(); private EditUpdateSubscriptionQuoteForItemsBuilder() {} @@ -599,6 +624,12 @@ public EditUpdateSubscriptionQuoteForItemsBuilder coupons(List va return this; } + public EditUpdateSubscriptionQuoteForItemsBuilder entitlementOverrides( + List value) { + this.entitlementOverrides = value; + return this; + } + /** * Add a custom field to the request. Custom fields must start with "cf_". * @@ -1899,6 +1930,8 @@ public static final class SubscriptionItemsParams { private final Timestamp endDate; + private final String description; + private final String rampTierId; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1931,6 +1964,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.endDate = builder.endDate; + this.description = builder.description; + this.rampTierId = builder.rampTierId; } @@ -1990,6 +2025,10 @@ public Timestamp getEndDate() { return endDate; } + public String getDescription() { + return description; + } + public String getRampTierId() { return rampTierId; } @@ -2068,6 +2107,11 @@ public Map toFormData() { formData.put("end_date", this.endDate); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.rampTierId != null) { formData.put("ramp_tier_id", this.rampTierId); @@ -2112,6 +2156,8 @@ public static final class SubscriptionItemsBuilder { private Timestamp endDate; + private String description; + private String rampTierId; private SubscriptionItemsBuilder() {} @@ -2186,6 +2232,11 @@ public SubscriptionItemsBuilder endDate(Timestamp value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder rampTierId(String value) { this.rampTierId = value; return this; @@ -3040,4 +3091,204 @@ public CouponsParams build() { } } } + + public static final class EntitlementOverridesParams { + + private final String featureId; + + private final String entityId; + + private final EntityType entityType; + + private final String value; + + private final Boolean isEnabled; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private EntitlementOverridesParams(EntitlementOverridesBuilder builder) { + + this.featureId = builder.featureId; + + this.entityId = builder.entityId; + + this.entityType = builder.entityType; + + this.value = builder.value; + + this.isEnabled = builder.isEnabled; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public String getFeatureId() { + return featureId; + } + + public String getEntityId() { + return entityId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getValue() { + return value; + } + + public Boolean getIsEnabled() { + return isEnabled; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.featureId != null) { + + formData.put("feature_id", this.featureId); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.isEnabled != null) { + + formData.put("is_enabled", this.isEnabled); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for EntitlementOverridesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntitlementOverridesBuilder builder() { + return new EntitlementOverridesBuilder(); + } + + public static final class EntitlementOverridesBuilder { + + private String featureId; + + private String entityId; + + private EntityType entityType; + + private String value; + + private Boolean isEnabled; + + private Timestamp startDate; + + private Timestamp endDate; + + private EntitlementOverridesBuilder() {} + + public EntitlementOverridesBuilder featureId(String value) { + this.featureId = value; + return this; + } + + public EntitlementOverridesBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public EntitlementOverridesBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public EntitlementOverridesBuilder value(String value) { + this.value = value; + return this; + } + + public EntitlementOverridesBuilder isEnabled(Boolean value) { + this.isEnabled = value; + return this; + } + + public EntitlementOverridesBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public EntitlementOverridesBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public EntitlementOverridesParams build() { + return new EntitlementOverridesParams(this); + } + } + + public enum EntityType { + PLAN_PRICE("plan_price"), + + ADDON_PRICE("addon_price"), + + CHARGE_PRICE("charge_price"), + + CHARGE("charge"), + + /** An enum member indicating that EntityType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityType enumValue : EntityType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } } diff --git a/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java b/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java index f71a538ab..92dc7396e 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/UpdateSubscriptionQuoteForItemsParams.java @@ -66,6 +66,8 @@ public final class UpdateSubscriptionQuoteForItemsParams { private final List coupons; + private final List entitlementOverrides; + private final Map customFields; private UpdateSubscriptionQuoteForItemsParams(UpdateSubscriptionQuoteForItemsBuilder builder) { @@ -120,6 +122,8 @@ private UpdateSubscriptionQuoteForItemsParams(UpdateSubscriptionQuoteForItemsBui this.coupons = builder.coupons; + this.entitlementOverrides = builder.entitlementOverrides; + this.customFields = builder.customFields.isEmpty() ? Collections.emptyMap() @@ -226,6 +230,10 @@ public List getCoupons() { return coupons; } + public List getEntitlementOverrides() { + return entitlementOverrides; + } + public Map customFields() { return customFields; } @@ -424,6 +432,21 @@ public Map toFormData() { } } + if (this.entitlementOverrides != null) { + + // List of objects + for (int i = 0; i < this.entitlementOverrides.size(); i++) { + EntitlementOverridesParams item = this.entitlementOverrides.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "entitlement_overrides[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + formData.putAll(customFields); return formData; @@ -487,6 +510,8 @@ public static final class UpdateSubscriptionQuoteForItemsBuilder { private List coupons; + private List entitlementOverrides; + private Map customFields = new LinkedHashMap<>(); private UpdateSubscriptionQuoteForItemsBuilder() {} @@ -617,6 +642,12 @@ public UpdateSubscriptionQuoteForItemsBuilder coupons(List value) return this; } + public UpdateSubscriptionQuoteForItemsBuilder entitlementOverrides( + List value) { + this.entitlementOverrides = value; + return this; + } + /** * Add a custom field to the request. Custom fields must start with "cf_". * @@ -1936,6 +1967,8 @@ public static final class SubscriptionItemsParams { private final Timestamp endDate; + private final String description; + private final String rampTierId; private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { @@ -1968,6 +2001,8 @@ private SubscriptionItemsParams(SubscriptionItemsBuilder builder) { this.endDate = builder.endDate; + this.description = builder.description; + this.rampTierId = builder.rampTierId; } @@ -2027,6 +2062,10 @@ public Timestamp getEndDate() { return endDate; } + public String getDescription() { + return description; + } + public String getRampTierId() { return rampTierId; } @@ -2105,6 +2144,11 @@ public Map toFormData() { formData.put("end_date", this.endDate); } + if (this.description != null) { + + formData.put("description", this.description); + } + if (this.rampTierId != null) { formData.put("ramp_tier_id", this.rampTierId); @@ -2149,6 +2193,8 @@ public static final class SubscriptionItemsBuilder { private Timestamp endDate; + private String description; + private String rampTierId; private SubscriptionItemsBuilder() {} @@ -2223,6 +2269,11 @@ public SubscriptionItemsBuilder endDate(Timestamp value) { return this; } + public SubscriptionItemsBuilder description(String value) { + this.description = value; + return this; + } + public SubscriptionItemsBuilder rampTierId(String value) { this.rampTierId = value; return this; @@ -3077,4 +3128,204 @@ public CouponsParams build() { } } } + + public static final class EntitlementOverridesParams { + + private final String featureId; + + private final String entityId; + + private final EntityType entityType; + + private final String value; + + private final Boolean isEnabled; + + private final Timestamp startDate; + + private final Timestamp endDate; + + private EntitlementOverridesParams(EntitlementOverridesBuilder builder) { + + this.featureId = builder.featureId; + + this.entityId = builder.entityId; + + this.entityType = builder.entityType; + + this.value = builder.value; + + this.isEnabled = builder.isEnabled; + + this.startDate = builder.startDate; + + this.endDate = builder.endDate; + } + + public String getFeatureId() { + return featureId; + } + + public String getEntityId() { + return entityId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getValue() { + return value; + } + + public Boolean getIsEnabled() { + return isEnabled; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.featureId != null) { + + formData.put("feature_id", this.featureId); + } + + if (this.entityId != null) { + + formData.put("entity_id", this.entityId); + } + + if (this.entityType != null) { + + formData.put("entity_type", this.entityType); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + if (this.isEnabled != null) { + + formData.put("is_enabled", this.isEnabled); + } + + if (this.startDate != null) { + + formData.put("start_date", this.startDate); + } + + if (this.endDate != null) { + + formData.put("end_date", this.endDate); + } + + return formData; + } + + /** Create a new builder for EntitlementOverridesParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static EntitlementOverridesBuilder builder() { + return new EntitlementOverridesBuilder(); + } + + public static final class EntitlementOverridesBuilder { + + private String featureId; + + private String entityId; + + private EntityType entityType; + + private String value; + + private Boolean isEnabled; + + private Timestamp startDate; + + private Timestamp endDate; + + private EntitlementOverridesBuilder() {} + + public EntitlementOverridesBuilder featureId(String value) { + this.featureId = value; + return this; + } + + public EntitlementOverridesBuilder entityId(String value) { + this.entityId = value; + return this; + } + + public EntitlementOverridesBuilder entityType(EntityType value) { + this.entityType = value; + return this; + } + + public EntitlementOverridesBuilder value(String value) { + this.value = value; + return this; + } + + public EntitlementOverridesBuilder isEnabled(Boolean value) { + this.isEnabled = value; + return this; + } + + public EntitlementOverridesBuilder startDate(Timestamp value) { + this.startDate = value; + return this; + } + + public EntitlementOverridesBuilder endDate(Timestamp value) { + this.endDate = value; + return this; + } + + public EntitlementOverridesParams build() { + return new EntitlementOverridesParams(this); + } + } + + public enum EntityType { + PLAN_PRICE("plan_price"), + + ADDON_PRICE("addon_price"), + + CHARGE_PRICE("charge_price"), + + CHARGE("charge"), + + /** An enum member indicating that EntityType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + EntityType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static EntityType fromString(String value) { + if (value == null) return _UNKNOWN; + for (EntityType enumValue : EntityType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } } diff --git a/src/main/java/com/chargebee/v4/models/quoteEntitlement/QuoteEntitlement.java b/src/main/java/com/chargebee/v4/models/quoteEntitlement/QuoteEntitlement.java index 538520f55..f7a048d6d 100644 --- a/src/main/java/com/chargebee/v4/models/quoteEntitlement/QuoteEntitlement.java +++ b/src/main/java/com/chargebee/v4/models/quoteEntitlement/QuoteEntitlement.java @@ -15,6 +15,7 @@ public class QuoteEntitlement { private String entityId; private EntityType entityType; + @Deprecated private ActionType actionType; private String featureId; private String value; private Boolean isEnabled; @@ -22,6 +23,12 @@ public class QuoteEntitlement { private Timestamp endDate; private Timestamp createdAt; private Timestamp modifiedAt; + private Boolean isOverridden; + private String featureName; + private String featureUnit; + private String featureType; + private String name; + private Boolean metered; public String getEntityId() { return entityId; @@ -31,6 +38,11 @@ public EntityType getEntityType() { return entityType; } + @Deprecated + public ActionType getActionType() { + return actionType; + } + public String getFeatureId() { return featureId; } @@ -59,6 +71,30 @@ public Timestamp getModifiedAt() { return modifiedAt; } + public Boolean getIsOverridden() { + return isOverridden; + } + + public String getFeatureName() { + return featureName; + } + + public String getFeatureUnit() { + return featureUnit; + } + + public String getFeatureType() { + return featureType; + } + + public String getName() { + return name; + } + + public Boolean getMetered() { + return metered; + } + public enum EntityType { PLAN_PRICE("plan_price"), @@ -91,6 +127,34 @@ public static EntityType fromString(String value) { } } + public enum ActionType { + UPSERT("upsert"), + + REMOVE("remove"), + + /** An enum member indicating that ActionType was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + ActionType(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static ActionType fromString(String value) { + if (value == null) return _UNKNOWN; + for (ActionType enumValue : ActionType.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + public static QuoteEntitlement fromJson(String json) { return fromJson(JsonUtil.parse(json)); } @@ -106,6 +170,8 @@ public static QuoteEntitlement fromJson(JsonObject jsonObj) { obj.entityType = EntityType.fromString(JsonUtil.getString(jsonObj, "entity_type")); + obj.actionType = ActionType.fromString(JsonUtil.getString(jsonObj, "action_type")); + obj.featureId = JsonUtil.getString(jsonObj, "feature_id"); obj.value = JsonUtil.getString(jsonObj, "value"); @@ -120,6 +186,18 @@ public static QuoteEntitlement fromJson(JsonObject jsonObj) { obj.modifiedAt = JsonUtil.getTimestamp(jsonObj, "modified_at"); + obj.isOverridden = JsonUtil.getBoolean(jsonObj, "is_overridden"); + + obj.featureName = JsonUtil.getString(jsonObj, "feature_name"); + + obj.featureUnit = JsonUtil.getString(jsonObj, "feature_unit"); + + obj.featureType = JsonUtil.getString(jsonObj, "feature_type"); + + obj.name = JsonUtil.getString(jsonObj, "name"); + + obj.metered = JsonUtil.getBoolean(jsonObj, "metered"); + return obj; } @@ -130,6 +208,8 @@ public String toString() { + entityId + ", entityType=" + entityType + + ", actionType=" + + actionType + ", featureId=" + featureId + ", value=" @@ -144,6 +224,18 @@ public String toString() { + createdAt + ", modifiedAt=" + modifiedAt + + ", isOverridden=" + + isOverridden + + ", featureName=" + + featureName + + ", featureUnit=" + + featureUnit + + ", featureType=" + + featureType + + ", name=" + + name + + ", metered=" + + metered + "}"; } @@ -155,13 +247,20 @@ public boolean equals(Object o) { QuoteEntitlement that = (QuoteEntitlement) o; return java.util.Objects.equals(entityId, that.entityId) && java.util.Objects.equals(entityType, that.entityType) + && java.util.Objects.equals(actionType, that.actionType) && java.util.Objects.equals(featureId, that.featureId) && java.util.Objects.equals(value, that.value) && java.util.Objects.equals(isEnabled, that.isEnabled) && java.util.Objects.equals(startDate, that.startDate) && java.util.Objects.equals(endDate, that.endDate) && java.util.Objects.equals(createdAt, that.createdAt) - && java.util.Objects.equals(modifiedAt, that.modifiedAt); + && java.util.Objects.equals(modifiedAt, that.modifiedAt) + && java.util.Objects.equals(isOverridden, that.isOverridden) + && java.util.Objects.equals(featureName, that.featureName) + && java.util.Objects.equals(featureUnit, that.featureUnit) + && java.util.Objects.equals(featureType, that.featureType) + && java.util.Objects.equals(name, that.name) + && java.util.Objects.equals(metered, that.metered); } @Override @@ -170,12 +269,19 @@ public int hashCode() { return java.util.Objects.hash( entityId, entityType, + actionType, featureId, value, isEnabled, startDate, endDate, createdAt, - modifiedAt); + modifiedAt, + isOverridden, + featureName, + featureUnit, + featureType, + name, + metered); } } diff --git a/src/main/java/com/chargebee/v4/models/quoteEntitlement/params/ListQuoteEntitlementsParams.java b/src/main/java/com/chargebee/v4/models/quoteEntitlement/params/ListQuoteEntitlementsParams.java new file mode 100644 index 000000000..76ad0a636 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quoteEntitlement/params/ListQuoteEntitlementsParams.java @@ -0,0 +1,96 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.quoteEntitlement.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.TimestampFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ListQuoteEntitlementsParams { + + private final Map queryParams; + + private ListQuoteEntitlementsParams(ListQuoteEntitlementsBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ListQuoteEntitlementsBuilder toBuilder() { + ListQuoteEntitlementsBuilder builder = new ListQuoteEntitlementsBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ListQuoteEntitlementsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ListQuoteEntitlementsBuilder builder() { + return new ListQuoteEntitlementsBuilder(); + } + + public static final class ListQuoteEntitlementsBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ListQuoteEntitlementsBuilder() {} + + public ListQuoteEntitlementsBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ListQuoteEntitlementsBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public EntityIdFilter entityId() { + return new EntityIdFilter("entity_id", this, queryParams); + } + + public StartDateFilter startDate() { + return new StartDateFilter("start_date", this, queryParams); + } + + public EndDateFilter endDate() { + return new EndDateFilter("end_date", this, queryParams); + } + + public ListQuoteEntitlementsParams build() { + return new ListQuoteEntitlementsParams(this); + } + + public static final class EntityIdFilter extends StringFilter { + EntityIdFilter( + String fieldName, ListQuoteEntitlementsBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class StartDateFilter + extends TimestampFilter { + StartDateFilter( + String fieldName, ListQuoteEntitlementsBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class EndDateFilter extends TimestampFilter { + EndDateFilter( + String fieldName, ListQuoteEntitlementsBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quoteEntitlement/responses/ListQuoteEntitlementsResponse.java b/src/main/java/com/chargebee/v4/models/quoteEntitlement/responses/ListQuoteEntitlementsResponse.java new file mode 100644 index 000000000..3c91796c8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quoteEntitlement/responses/ListQuoteEntitlementsResponse.java @@ -0,0 +1,227 @@ +package com.chargebee.v4.models.quoteEntitlement.responses; + +import java.util.List; + +import com.chargebee.v4.models.quoteEntitlement.QuoteEntitlement; + +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import com.chargebee.v4.transport.Response; +import com.chargebee.v4.services.QuoteEntitlementService; +import com.chargebee.v4.models.quoteEntitlement.params.ListQuoteEntitlementsParams; + +/** Immutable response object for ListQuoteEntitlements operation. Contains paginated list data. */ +public final class ListQuoteEntitlementsResponse { + + private final List list; + + private final String nextOffset; + + private final String quoteId; + + private final QuoteEntitlementService service; + private final ListQuoteEntitlementsParams originalParams; + private final Response httpResponse; + + private ListQuoteEntitlementsResponse( + List list, + String nextOffset, + String quoteId, + QuoteEntitlementService service, + ListQuoteEntitlementsParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.quoteId = quoteId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into ListQuoteEntitlementsResponse object (no service context). Use this + * when you only need to read a single page (no nextPage()). + */ + public static ListQuoteEntitlementsResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + QuoteEntitlementListQuoteEntitlementsItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new ListQuoteEntitlementsResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ListQuoteEntitlementsResponse from JSON", e); + } + } + + /** + * Parse JSON response into ListQuoteEntitlementsResponse object with service context for + * pagination (enables nextPage()). + */ + public static ListQuoteEntitlementsResponse fromJson( + String json, + QuoteEntitlementService service, + ListQuoteEntitlementsParams originalParams, + String quoteId, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + QuoteEntitlementListQuoteEntitlementsItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new ListQuoteEntitlementsResponse( + list, nextOffset, quoteId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse ListQuoteEntitlementsResponse from JSON", e); + } + } + + /** Get the list from the response. */ + public List getList() { + return list; + } + + /** Get the nextOffset from the response. */ + public String getNextOffset() { + return nextOffset; + } + + /** Check if there are more pages available. */ + public boolean hasNextPage() { + return nextOffset != null && !nextOffset.isEmpty(); + } + + /** + * Get the next page of results. + * + * @throws ChargebeeException if unable to fetch next page + */ + public ListQuoteEntitlementsResponse nextPage() throws ChargebeeException { + if (!hasNextPage()) { + throw new IllegalStateException("No more pages available"); + } + if (service == null) { + throw new UnsupportedOperationException( + "nextPage() requires service context. Use fromJson(json, service, originalParams, httpResponse)."); + } + + ListQuoteEntitlementsParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : ListQuoteEntitlementsParams.builder()) + .offset(nextOffset) + .build(); + + return service.listQuoteEntitlements(quoteId, nextParams); + } + + /** Get the raw response payload as JSON string. */ + public String responsePayload() { + return httpResponse != null ? httpResponse.getBodyAsString() : null; + } + + /** Get the HTTP status code. */ + public int httpStatus() { + return httpResponse != null ? httpResponse.getStatusCode() : 0; + } + + /** Get response headers. */ + public java.util.Map> headers() { + return httpResponse != null ? httpResponse.getHeaders() : java.util.Collections.emptyMap(); + } + + /** Get a specific header value. */ + public java.util.List header(String name) { + if (httpResponse == null) return null; + return httpResponse.getHeaders().entrySet().stream() + .filter(e -> e.getKey().equalsIgnoreCase(name)) + .map(java.util.Map.Entry::getValue) + .findFirst() + .orElse(null); + } + + @Override + public String toString() { + return "ListQuoteEntitlementsResponse{" + "list=" + list + ", nextOffset=" + nextOffset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ListQuoteEntitlementsResponse that = (ListQuoteEntitlementsResponse) o; + return java.util.Objects.equals(list, that.list) + && java.util.Objects.equals(nextOffset, that.nextOffset); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(list, nextOffset); + } + + public static class QuoteEntitlementListQuoteEntitlementsItem { + + private QuoteEntitlement quoteEntitlement; + + public QuoteEntitlement getQuoteEntitlement() { + return quoteEntitlement; + } + + public static QuoteEntitlementListQuoteEntitlementsItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static QuoteEntitlementListQuoteEntitlementsItem fromJson(JsonObject jsonObj) { + QuoteEntitlementListQuoteEntitlementsItem item = + new QuoteEntitlementListQuoteEntitlementsItem(); + + JsonObject __quoteEntitlementObj = JsonUtil.getJsonObject(jsonObj, "quote_entitlement"); + if (__quoteEntitlementObj != null) { + item.quoteEntitlement = QuoteEntitlement.fromJson(__quoteEntitlementObj); + } + + return item; + } + + @Override + public String toString() { + return "QuoteEntitlementListQuoteEntitlementsItem{" + + "quoteEntitlement=" + + quoteEntitlement + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + QuoteEntitlementListQuoteEntitlementsItem that = + (QuoteEntitlementListQuoteEntitlementsItem) o; + return java.util.Objects.equals(quoteEntitlement, that.quoteEntitlement); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(quoteEntitlement); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java b/src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java index 0cdbfcfa0..1843a8fdb 100644 --- a/src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java +++ b/src/main/java/com/chargebee/v4/models/quotedRamp/QuotedRamp.java @@ -137,6 +137,7 @@ public static class LineItems { private String amountPerBillingCycleInDecimal; private Long netAmountPerBillingCycle; private String netAmountPerBillingCycleInDecimal; + private String description; public String getItemPriceId() { return itemPriceId; @@ -255,6 +256,10 @@ public String getNetAmountPerBillingCycleInDecimal() { return netAmountPerBillingCycleInDecimal; } + public String getDescription() { + return description; + } + public enum ItemType { PLAN("plan"), @@ -457,6 +462,8 @@ public static LineItems fromJson(JsonObject jsonObj) { obj.netAmountPerBillingCycleInDecimal = JsonUtil.getString(jsonObj, "net_amount_per_billing_cycle_in_decimal"); + obj.description = JsonUtil.getString(jsonObj, "description"); + return obj; } @@ -521,6 +528,8 @@ public String toString() { + netAmountPerBillingCycle + ", netAmountPerBillingCycleInDecimal=" + netAmountPerBillingCycleInDecimal + + ", description=" + + description + "}"; } @@ -564,7 +573,8 @@ public boolean equals(Object o) { amountPerBillingCycleInDecimal, that.amountPerBillingCycleInDecimal) && java.util.Objects.equals(netAmountPerBillingCycle, that.netAmountPerBillingCycle) && java.util.Objects.equals( - netAmountPerBillingCycleInDecimal, that.netAmountPerBillingCycleInDecimal); + netAmountPerBillingCycleInDecimal, that.netAmountPerBillingCycleInDecimal) + && java.util.Objects.equals(description, that.description); } @Override @@ -599,7 +609,8 @@ public int hashCode() { amountPerBillingCycle, amountPerBillingCycleInDecimal, netAmountPerBillingCycle, - netAmountPerBillingCycleInDecimal); + netAmountPerBillingCycleInDecimal, + description); } } diff --git a/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java b/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java index 2fe4523fb..3d48cea1b 100644 --- a/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java +++ b/src/main/java/com/chargebee/v4/models/ramp/params/RampListParams.java @@ -202,7 +202,7 @@ public RampListBuilder desc() { } } - public enum StatusIn { + public enum StatusIs { SCHEDULED("scheduled"), SUCCEEDED("succeeded"), @@ -211,11 +211,11 @@ public enum StatusIn { DRAFT("draft"), - /** An enum member indicating that StatusIn was instantiated with an unknown value. */ + /** An enum member indicating that StatusIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - StatusIn(String value) { + StatusIs(String value) { this.value = value; } @@ -223,9 +223,9 @@ public String getValue() { return value; } - public static StatusIn fromString(String value) { + public static StatusIs fromString(String value) { if (value == null) return _UNKNOWN; - for (StatusIn enumValue : StatusIn.values()) { + for (StatusIs enumValue : StatusIs.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -234,7 +234,7 @@ public static StatusIn fromString(String value) { } } - public enum StatusIs { + public enum StatusIn { SCHEDULED("scheduled"), SUCCEEDED("succeeded"), @@ -243,11 +243,11 @@ public enum StatusIs { DRAFT("draft"), - /** An enum member indicating that StatusIs was instantiated with an unknown value. */ + /** An enum member indicating that StatusIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - StatusIs(String value) { + StatusIn(String value) { this.value = value; } @@ -255,9 +255,9 @@ public String getValue() { return value; } - public static StatusIs fromString(String value) { + public static StatusIn fromString(String value) { if (value == null) return _UNKNOWN; - for (StatusIs enumValue : StatusIs.values()) { + for (StatusIn enumValue : StatusIn.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelForItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelForItemsParams.java index f1c96f540..533943d3f 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelForItemsParams.java @@ -355,6 +355,8 @@ public enum CreditOptionForCurrentTermCharges { FULL("full"), + CONSUMPTION_BASED("consumption_based"), + /** * An enum member indicating that CreditOptionForCurrentTermCharges was instantiated with an * unknown value. diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelParams.java index 90e695191..0755426d8 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCancelParams.java @@ -311,6 +311,8 @@ public enum CreditOptionForCurrentTermCharges { FULL("full"), + CONSUMPTION_BASED("consumption_based"), + /** * An enum member indicating that CreditOptionForCurrentTermCharges was instantiated with an * unknown value. diff --git a/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/VaultedPaymentMethod.java b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/VaultedPaymentMethod.java new file mode 100644 index 000000000..eabddd0aa --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/VaultedPaymentMethod.java @@ -0,0 +1,100 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.vaultedPaymentMethod; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class VaultedPaymentMethod { + + private String id; + private String customerId; + private String creditCardId; + private Timestamp createdAt; + private Timestamp modifiedAt; + + public String getId() { + return id; + } + + public String getCustomerId() { + return customerId; + } + + public String getCreditCardId() { + return creditCardId; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getModifiedAt() { + return modifiedAt; + } + + public static VaultedPaymentMethod fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static VaultedPaymentMethod fromJson(java.util.Map map) { + return fromJson(JsonUtil.toJson(map)); + } + + public static VaultedPaymentMethod fromJson(JsonObject jsonObj) { + VaultedPaymentMethod obj = new VaultedPaymentMethod(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.customerId = JsonUtil.getString(jsonObj, "customer_id"); + + obj.creditCardId = JsonUtil.getString(jsonObj, "credit_card_id"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.modifiedAt = JsonUtil.getTimestamp(jsonObj, "modified_at"); + + return obj; + } + + @Override + public String toString() { + return "VaultedPaymentMethod{" + + "id=" + + id + + ", customerId=" + + customerId + + ", creditCardId=" + + creditCardId + + ", createdAt=" + + createdAt + + ", modifiedAt=" + + modifiedAt + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VaultedPaymentMethod that = (VaultedPaymentMethod) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(customerId, that.customerId) + && java.util.Objects.equals(creditCardId, that.creditCardId) + && java.util.Objects.equals(createdAt, that.createdAt) + && java.util.Objects.equals(modifiedAt, that.modifiedAt); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(id, customerId, creditCardId, createdAt, modifiedAt); + } +} diff --git a/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/params/VaultedPaymentMethodRetrieveParams.java b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/params/VaultedPaymentMethodRetrieveParams.java new file mode 100644 index 000000000..129e4b56d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/params/VaultedPaymentMethodRetrieveParams.java @@ -0,0 +1,50 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.models.vaultedPaymentMethod.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class VaultedPaymentMethodRetrieveParams { + + private final Map queryParams; + + private VaultedPaymentMethodRetrieveParams(VaultedPaymentMethodRetrieveBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public VaultedPaymentMethodRetrieveBuilder toBuilder() { + VaultedPaymentMethodRetrieveBuilder builder = new VaultedPaymentMethodRetrieveBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for VaultedPaymentMethodRetrieveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static VaultedPaymentMethodRetrieveBuilder builder() { + return new VaultedPaymentMethodRetrieveBuilder(); + } + + public static final class VaultedPaymentMethodRetrieveBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private VaultedPaymentMethodRetrieveBuilder() {} + + public VaultedPaymentMethodRetrieveParams build() { + return new VaultedPaymentMethodRetrieveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/responses/VaultedPaymentMethodRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/responses/VaultedPaymentMethodRetrieveResponse.java new file mode 100644 index 000000000..ccdadc87b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/vaultedPaymentMethod/responses/VaultedPaymentMethodRetrieveResponse.java @@ -0,0 +1,104 @@ +package com.chargebee.v4.models.vaultedPaymentMethod.responses; + +import com.chargebee.v4.models.vaultedPaymentMethod.VaultedPaymentMethod; + +import com.chargebee.v4.models.BaseResponse; +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import com.chargebee.v4.transport.Response; + +/** + * Immutable response object for VaultedPaymentMethodRetrieve operation. Contains the response data + * from a single resource get operation. + */ +public final class VaultedPaymentMethodRetrieveResponse extends BaseResponse { + private final VaultedPaymentMethod vaultedPaymentMethod; + + private VaultedPaymentMethodRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.vaultedPaymentMethod = builder.vaultedPaymentMethod; + } + + /** Parse JSON response into VaultedPaymentMethodRetrieveResponse object. */ + public static VaultedPaymentMethodRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into VaultedPaymentMethodRetrieveResponse object with HTTP response. */ + public static VaultedPaymentMethodRetrieveResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __vaultedPaymentMethodObj = + JsonUtil.getJsonObject(jsonObj, "vaulted_payment_method"); + if (__vaultedPaymentMethodObj != null) { + builder.vaultedPaymentMethod(VaultedPaymentMethod.fromJson(__vaultedPaymentMethodObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse VaultedPaymentMethodRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for VaultedPaymentMethodRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for VaultedPaymentMethodRetrieveResponse. */ + public static class Builder { + + private VaultedPaymentMethod vaultedPaymentMethod; + + private Response httpResponse; + + private Builder() {} + + public Builder vaultedPaymentMethod(VaultedPaymentMethod vaultedPaymentMethod) { + this.vaultedPaymentMethod = vaultedPaymentMethod; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public VaultedPaymentMethodRetrieveResponse build() { + return new VaultedPaymentMethodRetrieveResponse(this); + } + } + + /** Get the vaultedPaymentMethod from the response. */ + public VaultedPaymentMethod getVaultedPaymentMethod() { + return vaultedPaymentMethod; + } + + @Override + public String toString() { + return "VaultedPaymentMethodRetrieveResponse{" + + "vaultedPaymentMethod=" + + vaultedPaymentMethod + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + VaultedPaymentMethodRetrieveResponse that = (VaultedPaymentMethodRetrieveResponse) o; + return java.util.Objects.equals(vaultedPaymentMethod, that.vaultedPaymentMethod); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(vaultedPaymentMethod); + } +} diff --git a/src/main/java/com/chargebee/v4/services/CreditNoteService.java b/src/main/java/com/chargebee/v4/services/CreditNoteService.java index 2b3b52456..f96f372eb 100644 --- a/src/main/java/com/chargebee/v4/services/CreditNoteService.java +++ b/src/main/java/com/chargebee/v4/services/CreditNoteService.java @@ -31,6 +31,8 @@ import com.chargebee.v4.models.creditNote.params.CreditNoteCreateParams; +import com.chargebee.v4.models.creditNote.params.CreditNoteUpdateParams; + import com.chargebee.v4.models.creditNote.params.CreditNoteRemoveTaxWithheldRefundParams; import com.chargebee.v4.models.creditNote.params.CreditNoteRetrieveParams; @@ -55,6 +57,8 @@ import com.chargebee.v4.models.creditNote.responses.CreditNoteCreateResponse; +import com.chargebee.v4.models.creditNote.responses.CreditNoteUpdateResponse; + import com.chargebee.v4.models.creditNote.responses.CreditNoteDownloadEinvoiceResponse; import com.chargebee.v4.models.creditNote.responses.CreditNoteResendEinvoiceResponse; @@ -619,6 +623,64 @@ public CompletableFuture createAsync(CreditNoteCreateP response -> CreditNoteCreateResponse.fromJson(response.getBodyAsString(), response)); } + /** update a creditNote (executes immediately) - returns raw Response. */ + Response updateRaw(String creditNoteId) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/update", "credit-note-id", creditNoteId); + + return post("creditNote", "update", path, null); + } + + /** update a creditNote using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String creditNoteId, CreditNoteUpdateParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/update", "credit-note-id", creditNoteId); + return post("creditNote", "update", path, params.toFormData()); + } + + /** update a creditNote using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String creditNoteId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/update", "credit-note-id", creditNoteId); + return postJson("creditNote", "update", path, jsonPayload); + } + + public CreditNoteUpdateResponse update(String creditNoteId, CreditNoteUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(creditNoteId, params); + return CreditNoteUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of update for creditNote with params. */ + public CompletableFuture updateAsync( + String creditNoteId, CreditNoteUpdateParams params) { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/update", "credit-note-id", creditNoteId); + return postAsync("creditNote", "update", path, params.toFormData()) + .thenApply( + response -> CreditNoteUpdateResponse.fromJson(response.getBodyAsString(), response)); + } + + public CreditNoteUpdateResponse update(String creditNoteId) throws ChargebeeException { + Response response = updateRaw(creditNoteId); + return CreditNoteUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of update for creditNote without params. */ + public CompletableFuture updateAsync(String creditNoteId) { + String path = + buildPathWithParams( + "/credit_notes/{credit-note-id}/update", "credit-note-id", creditNoteId); + + return postAsync("creditNote", "update", path, null) + .thenApply( + response -> CreditNoteUpdateResponse.fromJson(response.getBodyAsString(), response)); + } + /** downloadEinvoice a creditNote (executes immediately) - returns raw Response. */ Response downloadEinvoiceRaw(String creditNoteId) throws ChargebeeException { String path = diff --git a/src/main/java/com/chargebee/v4/services/ExportService.java b/src/main/java/com/chargebee/v4/services/ExportService.java index 2ca2851ff..7b5c827b9 100644 --- a/src/main/java/com/chargebee/v4/services/ExportService.java +++ b/src/main/java/com/chargebee/v4/services/ExportService.java @@ -19,6 +19,8 @@ import com.chargebee.v4.models.export.params.ExportTransactionsParams; +import com.chargebee.v4.models.export.params.ExportRampsParams; + import com.chargebee.v4.models.export.params.ExportDifferentialPricesParams; import com.chargebee.v4.models.export.params.ExportItemFamiliesParams; @@ -53,6 +55,8 @@ import com.chargebee.v4.models.export.responses.ExportTransactionsResponse; +import com.chargebee.v4.models.export.responses.ExportRampsResponse; + import com.chargebee.v4.models.export.responses.ExportDifferentialPricesResponse; import com.chargebee.v4.models.export.responses.ExportItemFamiliesResponse; @@ -224,6 +228,32 @@ public CompletableFuture transactionsAsync( response -> ExportTransactionsResponse.fromJson(response.getBodyAsString(), response)); } + /** ramps a export using immutable params (executes immediately) - returns raw Response. */ + Response rampsRaw(ExportRampsParams params) throws ChargebeeException { + + return post("export", "ramps", "/exports/ramps", params != null ? params.toFormData() : null); + } + + /** ramps a export using raw JSON payload (executes immediately) - returns raw Response. */ + Response rampsRaw(String jsonPayload) throws ChargebeeException { + + return postJson("export", "ramps", "/exports/ramps", jsonPayload); + } + + public ExportRampsResponse ramps(ExportRampsParams params) throws ChargebeeException { + Response response = rampsRaw(params); + + return ExportRampsResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of ramps for export with params. */ + public CompletableFuture rampsAsync(ExportRampsParams params) { + + return postAsync( + "export", "ramps", "/exports/ramps", params != null ? params.toFormData() : null) + .thenApply(response -> ExportRampsResponse.fromJson(response.getBodyAsString(), response)); + } + /** * differentialPrices a export using immutable params (executes immediately) - returns raw * Response. diff --git a/src/main/java/com/chargebee/v4/services/InvoiceService.java b/src/main/java/com/chargebee/v4/services/InvoiceService.java index 4e22ceb9f..c1651d181 100644 --- a/src/main/java/com/chargebee/v4/services/InvoiceService.java +++ b/src/main/java/com/chargebee/v4/services/InvoiceService.java @@ -39,6 +39,8 @@ import com.chargebee.v4.models.invoice.params.InvoiceCreateParams; +import com.chargebee.v4.models.invoice.params.InvoiceVoidBeforeCaptureParams; + import com.chargebee.v4.models.invoice.params.InvoiceCloseParams; import com.chargebee.v4.models.invoice.params.InvoiceApplyCreditsParams; @@ -115,6 +117,8 @@ import com.chargebee.v4.models.invoice.responses.InvoiceCreateResponse; +import com.chargebee.v4.models.invoice.responses.InvoiceVoidBeforeCaptureResponse; + import com.chargebee.v4.models.invoice.responses.InvoiceCloseResponse; import com.chargebee.v4.models.invoice.responses.InvoiceApplyCreditsResponse; @@ -906,6 +910,70 @@ public CompletableFuture createAsync(InvoiceCreateParams response -> InvoiceCreateResponse.fromJson(response.getBodyAsString(), response)); } + /** voidBeforeCapture a invoice (executes immediately) - returns raw Response. */ + Response voidBeforeCaptureRaw(String invoiceId) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/void_before_capture", "invoice-id", invoiceId); + + return post("invoice", "voidBeforeCapture", path, null); + } + + /** + * voidBeforeCapture a invoice using immutable params (executes immediately) - returns raw + * Response. + */ + Response voidBeforeCaptureRaw(String invoiceId, InvoiceVoidBeforeCaptureParams params) + throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/void_before_capture", "invoice-id", invoiceId); + return post("invoice", "voidBeforeCapture", path, params.toFormData()); + } + + /** + * voidBeforeCapture a invoice using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response voidBeforeCaptureRaw(String invoiceId, String jsonPayload) throws ChargebeeException { + String path = + buildPathWithParams("/invoices/{invoice-id}/void_before_capture", "invoice-id", invoiceId); + return postJson("invoice", "voidBeforeCapture", path, jsonPayload); + } + + public InvoiceVoidBeforeCaptureResponse voidBeforeCapture( + String invoiceId, InvoiceVoidBeforeCaptureParams params) throws ChargebeeException { + Response response = voidBeforeCaptureRaw(invoiceId, params); + return InvoiceVoidBeforeCaptureResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of voidBeforeCapture for invoice with params. */ + public CompletableFuture voidBeforeCaptureAsync( + String invoiceId, InvoiceVoidBeforeCaptureParams params) { + String path = + buildPathWithParams("/invoices/{invoice-id}/void_before_capture", "invoice-id", invoiceId); + return postAsync("invoice", "voidBeforeCapture", path, params.toFormData()) + .thenApply( + response -> + InvoiceVoidBeforeCaptureResponse.fromJson(response.getBodyAsString(), response)); + } + + public InvoiceVoidBeforeCaptureResponse voidBeforeCapture(String invoiceId) + throws ChargebeeException { + Response response = voidBeforeCaptureRaw(invoiceId); + return InvoiceVoidBeforeCaptureResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of voidBeforeCapture for invoice without params. */ + public CompletableFuture voidBeforeCaptureAsync( + String invoiceId) { + String path = + buildPathWithParams("/invoices/{invoice-id}/void_before_capture", "invoice-id", invoiceId); + + return postAsync("invoice", "voidBeforeCapture", path, null) + .thenApply( + response -> + InvoiceVoidBeforeCaptureResponse.fromJson(response.getBodyAsString(), response)); + } + /** close a invoice (executes immediately) - returns raw Response. */ Response closeRaw(String invoiceId) throws ChargebeeException { String path = buildPathWithParams("/invoices/{invoice-id}/close", "invoice-id", invoiceId); diff --git a/src/main/java/com/chargebee/v4/services/PaymentSourceService.java b/src/main/java/com/chargebee/v4/services/PaymentSourceService.java index 3cd692967..4110ff952 100644 --- a/src/main/java/com/chargebee/v4/services/PaymentSourceService.java +++ b/src/main/java/com/chargebee/v4/services/PaymentSourceService.java @@ -17,6 +17,8 @@ import com.chargebee.v4.models.paymentSource.params.PaymentSourceCreateCardParams; +import com.chargebee.v4.models.paymentSource.params.ListGatewayTokensForPaymentSourceParams; + import com.chargebee.v4.models.paymentSource.params.PaymentSourceVerifyBankAccountParams; import com.chargebee.v4.models.paymentSource.params.PaymentSourceListParams; @@ -45,6 +47,8 @@ import com.chargebee.v4.models.paymentSource.responses.PaymentSourceCreateCardResponse; +import com.chargebee.v4.models.paymentSource.responses.ListGatewayTokensForPaymentSourceResponse; + import com.chargebee.v4.models.paymentSource.responses.PaymentSourceVerifyBankAccountResponse; import com.chargebee.v4.models.paymentSource.responses.PaymentSourceListResponse; @@ -230,6 +234,103 @@ public CompletableFuture createCardAsync( PaymentSourceCreateCardResponse.fromJson(response.getBodyAsString(), response)); } + /** + * listGatewayTokensForPaymentSource a paymentSource using immutable params (executes immediately) + * - returns raw Response. + */ + Response listGatewayTokensForPaymentSourceRaw( + String custPaymentSourceId, ListGatewayTokensForPaymentSourceParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/gateway_payment_method_tokens", + "cust-payment-source-id", + custPaymentSourceId); + return get( + "paymentSource", + "listGatewayTokensForPaymentSource", + path, + params != null ? params.toQueryParams() : null); + } + + /** + * listGatewayTokensForPaymentSource a paymentSource without params (executes immediately) - + * returns raw Response. + */ + Response listGatewayTokensForPaymentSourceRaw(String custPaymentSourceId) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/gateway_payment_method_tokens", + "cust-payment-source-id", + custPaymentSourceId); + return get("paymentSource", "listGatewayTokensForPaymentSource", path, null); + } + + /** + * listGatewayTokensForPaymentSource a paymentSource using raw JSON payload (executes immediately) + * - returns raw Response. + */ + Response listGatewayTokensForPaymentSourceRaw(String custPaymentSourceId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/gateway_payment_method_tokens", + "cust-payment-source-id", + custPaymentSourceId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ListGatewayTokensForPaymentSourceResponse listGatewayTokensForPaymentSource( + String custPaymentSourceId, ListGatewayTokensForPaymentSourceParams params) + throws ChargebeeException { + Response response = listGatewayTokensForPaymentSourceRaw(custPaymentSourceId, params); + return ListGatewayTokensForPaymentSourceResponse.fromJson( + response.getBodyAsString(), this, params, custPaymentSourceId, response); + } + + public ListGatewayTokensForPaymentSourceResponse listGatewayTokensForPaymentSource( + String custPaymentSourceId) throws ChargebeeException { + Response response = listGatewayTokensForPaymentSourceRaw(custPaymentSourceId); + return ListGatewayTokensForPaymentSourceResponse.fromJson( + response.getBodyAsString(), this, null, custPaymentSourceId, response); + } + + /** Async variant of listGatewayTokensForPaymentSource for paymentSource with params. */ + public CompletableFuture + listGatewayTokensForPaymentSourceAsync( + String custPaymentSourceId, ListGatewayTokensForPaymentSourceParams params) { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/gateway_payment_method_tokens", + "cust-payment-source-id", + custPaymentSourceId); + return getAsync( + "paymentSource", + "listGatewayTokensForPaymentSource", + path, + params != null ? params.toQueryParams() : null) + .thenApply( + response -> + ListGatewayTokensForPaymentSourceResponse.fromJson( + response.getBodyAsString(), this, params, custPaymentSourceId, response)); + } + + /** Async variant of listGatewayTokensForPaymentSource for paymentSource without params. */ + public CompletableFuture + listGatewayTokensForPaymentSourceAsync(String custPaymentSourceId) { + String path = + buildPathWithParams( + "/payment_sources/{cust-payment-source-id}/gateway_payment_method_tokens", + "cust-payment-source-id", + custPaymentSourceId); + return getAsync("paymentSource", "listGatewayTokensForPaymentSource", path, null) + .thenApply( + response -> + ListGatewayTokensForPaymentSourceResponse.fromJson( + response.getBodyAsString(), this, null, custPaymentSourceId, response)); + } + /** verifyBankAccount a paymentSource (executes immediately) - returns raw Response. */ Response verifyBankAccountRaw(String custPaymentSourceId) throws ChargebeeException { String path = diff --git a/src/main/java/com/chargebee/v4/services/QuoteEntitlementService.java b/src/main/java/com/chargebee/v4/services/QuoteEntitlementService.java new file mode 100644 index 000000000..a2c272f66 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/QuoteEntitlementService.java @@ -0,0 +1,126 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; +import java.util.concurrent.CompletableFuture; + +import com.chargebee.v4.models.quoteEntitlement.params.ListQuoteEntitlementsParams; + +import com.chargebee.v4.models.quoteEntitlement.responses.ListQuoteEntitlementsResponse; + +public final class QuoteEntitlementService extends BaseService { + + private final ServiceConfig config; + + public QuoteEntitlementService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private QuoteEntitlementService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private QuoteEntitlementService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + QuoteEntitlementService with(RequestOptions newOptions) { + return new QuoteEntitlementService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public QuoteEntitlementService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * listQuoteEntitlements a quoteEntitlement using immutable params (executes immediately) - + * returns raw Response. + */ + Response listQuoteEntitlementsRaw(String quoteId, ListQuoteEntitlementsParams params) + throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/quote_entitlements", "quote-id", quoteId); + return get( + "quoteEntitlement", + "listQuoteEntitlements", + path, + params != null ? params.toQueryParams() : null); + } + + /** + * listQuoteEntitlements a quoteEntitlement without params (executes immediately) - returns raw + * Response. + */ + Response listQuoteEntitlementsRaw(String quoteId) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/quote_entitlements", "quote-id", quoteId); + return get("quoteEntitlement", "listQuoteEntitlements", path, null); + } + + /** + * listQuoteEntitlements a quoteEntitlement using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response listQuoteEntitlementsRaw(String quoteId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/quotes/{quote-id}/quote_entitlements", "quote-id", quoteId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ListQuoteEntitlementsResponse listQuoteEntitlements( + String quoteId, ListQuoteEntitlementsParams params) throws ChargebeeException { + Response response = listQuoteEntitlementsRaw(quoteId, params); + return ListQuoteEntitlementsResponse.fromJson( + response.getBodyAsString(), this, params, quoteId, response); + } + + public ListQuoteEntitlementsResponse listQuoteEntitlements(String quoteId) + throws ChargebeeException { + Response response = listQuoteEntitlementsRaw(quoteId); + return ListQuoteEntitlementsResponse.fromJson( + response.getBodyAsString(), this, null, quoteId, response); + } + + /** Async variant of listQuoteEntitlements for quoteEntitlement with params. */ + public CompletableFuture listQuoteEntitlementsAsync( + String quoteId, ListQuoteEntitlementsParams params) { + String path = buildPathWithParams("/quotes/{quote-id}/quote_entitlements", "quote-id", quoteId); + return getAsync( + "quoteEntitlement", + "listQuoteEntitlements", + path, + params != null ? params.toQueryParams() : null) + .thenApply( + response -> + ListQuoteEntitlementsResponse.fromJson( + response.getBodyAsString(), this, params, quoteId, response)); + } + + /** Async variant of listQuoteEntitlements for quoteEntitlement without params. */ + public CompletableFuture listQuoteEntitlementsAsync( + String quoteId) { + String path = buildPathWithParams("/quotes/{quote-id}/quote_entitlements", "quote-id", quoteId); + return getAsync("quoteEntitlement", "listQuoteEntitlements", path, null) + .thenApply( + response -> + ListQuoteEntitlementsResponse.fromJson( + response.getBodyAsString(), this, null, quoteId, response)); + } +} diff --git a/src/main/java/com/chargebee/v4/services/VaultedPaymentMethodService.java b/src/main/java/com/chargebee/v4/services/VaultedPaymentMethodService.java new file mode 100644 index 000000000..62aefe0e4 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/VaultedPaymentMethodService.java @@ -0,0 +1,85 @@ +/* + * This file is auto-generated by Chargebee. + * For more information on how to make changes to this file, please see the README. + * Reach out to dx@chargebee.com for any questions. + * Copyright 2025 Chargebee Inc. + */ + +package com.chargebee.v4.services; + +import com.chargebee.v4.client.ChargebeeClient; +import com.chargebee.v4.client.request.RequestOptions; +import com.chargebee.v4.exceptions.ChargebeeException; +import com.chargebee.v4.transport.Response; +import java.util.concurrent.CompletableFuture; + +import com.chargebee.v4.models.vaultedPaymentMethod.responses.VaultedPaymentMethodRetrieveResponse; + +public final class VaultedPaymentMethodService extends BaseService { + + private final ServiceConfig config; + + public VaultedPaymentMethodService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private VaultedPaymentMethodService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private VaultedPaymentMethodService( + ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + VaultedPaymentMethodService with(RequestOptions newOptions) { + return new VaultedPaymentMethodService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public VaultedPaymentMethodService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** retrieve a vaultedPaymentMethod (executes immediately) - returns raw Response. */ + Response retrieveRaw(String vaultedPaymentMethodId) throws ChargebeeException { + String path = + buildPathWithParams( + "/vaulted_payment_methods/{vaulted-payment-method-id}", + "vaulted-payment-method-id", + vaultedPaymentMethodId); + + return get("vaultedPaymentMethod", "retrieve", path, null); + } + + public VaultedPaymentMethodRetrieveResponse retrieve(String vaultedPaymentMethodId) + throws ChargebeeException { + Response response = retrieveRaw(vaultedPaymentMethodId); + return VaultedPaymentMethodRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of retrieve for vaultedPaymentMethod without params. */ + public CompletableFuture retrieveAsync( + String vaultedPaymentMethodId) { + String path = + buildPathWithParams( + "/vaulted_payment_methods/{vaulted-payment-method-id}", + "vaulted-payment-method-id", + vaultedPaymentMethodId); + + return getAsync("vaultedPaymentMethod", "retrieve", path, null) + .thenApply( + response -> + VaultedPaymentMethodRetrieveResponse.fromJson( + response.getBodyAsString(), response)); + } +}