From c6c2ccc7f3daa217d4021b019f745b623c857fc7 Mon Sep 17 00:00:00 2001 From: cb-alish Date: Mon, 4 May 2026 08:30:10 +0530 Subject: [PATCH] Releasing v4.7.0 --- CHANGELOG.md | 89 ++++ VERSION | 2 +- build.gradle.kts | 2 +- .../chargebee/v4/client/ClientMethods.java | 18 + .../v4/client/ClientMethodsImpl.java | 14 + .../chargebee/v4/client/ServiceRegistry.java | 38 ++ .../com/chargebee/v4/models/alert/Alert.java | 50 -- .../alert/params/AlertCreateParams.java | 480 ++++++++++++++++++ .../alert/params/AlertDeleteParams.java | 39 ++ .../models/alert/params/AlertListParams.java | 314 ++++++++++++ .../alert/params/AlertRetrieveParams.java | 50 ++ .../alert/params/AlertUpdateParams.java | 209 ++++++++ ...pplicationAlertsForSubscriptionParams.java | 301 +++++++++++ .../alert/responses/AlertCreateResponse.java | 96 ++++ .../alert/responses/AlertDeleteResponse.java | 96 ++++ .../alert/responses/AlertListResponse.java | 206 ++++++++ .../responses/AlertRetrieveResponse.java | 99 ++++ .../alert/responses/AlertUpdateResponse.java | 96 ++++ ...licationAlertsForSubscriptionResponse.java | 234 +++++++++ .../v4/models/alertStatus/AlertStatus.java | 29 +- .../params/AlertStatusesForAlertParams.java | 181 +++++++ .../AlertStatusesForSubscriptionParams.java | 198 ++++++++ .../AlertStatusesForAlertResponse.java | 222 ++++++++ .../AlertStatusesForSubscriptionResponse.java | 234 +++++++++ .../com/chargebee/v4/models/card/Card.java | 6 + .../CardSwitchGatewayForCustomerParams.java | 4 + .../params/UpdateCardForCustomerParams.java | 4 + .../v4/models/customer/Customer.java | 18 + .../params/CustomerCollectPaymentParams.java | 28 + .../customer/params/CustomerCreateParams.java | 36 ++ .../CustomerUpdatePaymentMethodParams.java | 18 + .../params/EntitlementListParams.java | 20 +- ...stimateGiftSubscriptionForItemsParams.java | 14 + .../EstimateGiftSubscriptionParams.java | 14 + .../com/chargebee/v4/models/event/Event.java | 4 + .../models/event/params/EventListParams.java | 10 + .../params/ExportTransactionsParams.java | 18 + .../filterCondition/FilterCondition.java | 129 +++++ .../gift/params/GiftCreateForItemsParams.java | 14 + .../models/gift/params/GiftCreateParams.java | 14 + ...tedPageCheckoutExistingForItemsParams.java | 4 + .../HostedPageCheckoutExistingParams.java | 4 + .../HostedPageCheckoutNewForItemsParams.java | 4 + .../params/HostedPageCheckoutNewParams.java | 4 + ...stedPageCheckoutOneTimeForItemsParams.java | 4 + .../HostedPageCheckoutOneTimeParams.java | 4 + .../params/HostedPageCollectNowParams.java | 4 + .../HostedPageManagePaymentSourcesParams.java | 4 + .../params/HostedPageUpdateCardParams.java | 4 + .../HostedPageUpdatePaymentMethodParams.java | 4 + ...eCreateForChargeItemsAndChargesParams.java | 36 ++ .../invoice/params/InvoiceCreateParams.java | 36 ++ .../invoice/params/InvoiceListParams.java | 10 + .../models/paymentIntent/PaymentIntent.java | 42 ++ .../params/PaymentIntentCreateParams.java | 34 ++ .../params/PaymentIntentUpdateParams.java | 14 + .../models/paymentSource/PaymentSource.java | 20 + ...tSourceCreateUsingPaymentIntentParams.java | 14 + ...SourceCreateUsingPermanentTokenParams.java | 16 + ...ymentSourceCreateUsingTempTokenParams.java | 14 + .../params/PaymentSourceListParams.java | 70 +++ .../models/paymentVoucher/PaymentVoucher.java | 4 + .../purchase/params/PurchaseCreateParams.java | 14 + ...eCreateForChargeItemsAndChargesParams.java | 20 + ...oteEditForChargeItemsAndChargesParams.java | 20 + .../quoteEntitlement/QuoteEntitlement.java | 177 +++++++ .../v4/models/ramp/params/RampListParams.java | 20 +- .../v4/models/salesOrder/SalesOrder.java | 161 +++++- .../params/ImportSubscriptionParams.java | 22 + .../SubscriptionCreateForCustomerParams.java | 14 + .../params/SubscriptionCreateParams.java | 36 ++ .../SubscriptionCreateWithItemsParams.java | 14 + .../params/SubscriptionReactivateParams.java | 14 + .../params/SubscriptionResumeParams.java | 14 + .../SubscriptionUpdateForItemsParams.java | 36 ++ .../params/SubscriptionUpdateParams.java | 36 ++ .../ThirdPartyPaymentMethod.java | 18 + .../com/chargebee/v4/models/token/Token.java | 18 + .../v4/models/transaction/Transaction.java | 18 + .../params/TransactionListParams.java | 90 ++++ .../VirtualBankAccount.java | 4 + .../VirtualBankAccountCreateParams.java | 20 + ...ccountCreateUsingPermanentTokenParams.java | 20 + .../chargebee/v4/services/AlertService.java | 317 ++++++++++++ .../v4/services/AlertStatusService.java | 196 +++++++ 85 files changed, 5207 insertions(+), 90 deletions(-) create mode 100644 src/main/java/com/chargebee/v4/models/alert/params/AlertCreateParams.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/params/AlertDeleteParams.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/params/AlertListParams.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/params/AlertRetrieveParams.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/params/AlertUpdateParams.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/params/ApplicationAlertsForSubscriptionParams.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/responses/AlertCreateResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/responses/AlertDeleteResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/responses/AlertListResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/responses/AlertRetrieveResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/responses/AlertUpdateResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/alert/responses/ApplicationAlertsForSubscriptionResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/alertStatus/params/AlertStatusesForAlertParams.java create mode 100644 src/main/java/com/chargebee/v4/models/alertStatus/params/AlertStatusesForSubscriptionParams.java create mode 100644 src/main/java/com/chargebee/v4/models/alertStatus/responses/AlertStatusesForAlertResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/alertStatus/responses/AlertStatusesForSubscriptionResponse.java create mode 100644 src/main/java/com/chargebee/v4/models/filterCondition/FilterCondition.java create mode 100644 src/main/java/com/chargebee/v4/models/quoteEntitlement/QuoteEntitlement.java create mode 100644 src/main/java/com/chargebee/v4/services/AlertService.java create mode 100644 src/main/java/com/chargebee/v4/services/AlertStatusService.java diff --git a/CHANGELOG.md b/CHANGELOG.md index aeb13b2fd..21dccc276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,92 @@ +### v4.7.0 (2026-05-04) +* * * +### New Resources: +- [`QuoteEntitlement`](https://apidocs.chargebee.com/docs/api/quote_entitlements) has been added. + + +### New Actions: +- [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`retrieve_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/retrieve-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`delete_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/delete-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) has been added to [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) has been added to [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) has been added to [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). + + +### New Attributes: +- [`alarm_status`](https://apidocs.chargebee.com/docs/api/alert_statuses/alert-status-object#alarm_status) has been added to [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). + + +### New Parameters: +- [`limit`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#limit) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`offset`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#offset) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`status`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#status) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`type`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription#type) has been added as query parameter to [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`limit`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#limit) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`offset`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#offset) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`id`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#id) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`type`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#type) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`subscription_id`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#subscription_id) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`status`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts#status) has been added as query parameter to [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`limit`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#limit) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`offset`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#offset) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`alarm_status`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#alarm_status) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`alert_id`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription#alert_id) has been added as query parameter to [`list_alert_statuses_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-a-subscription) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`limit`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert#limit) has been added as query parameter to [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`offset`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert#offset) has been added as query parameter to [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`alarm_status`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert#alarm_status) has been added as query parameter to [`list_alert_statuses_for_an_alert`](https://apidocs.chargebee.com/docs/api/alert_statuses/list-alert-statuses-for-an-alert) in [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). +- [`exclude`](https://apidocs.chargebee.com/docs/api/invoices/list-invoices#exclude) has been added as query parameter to [`list_invoices`](https://apidocs.chargebee.com/docs/api/invoices/list-invoices) in [`Invoice`](https://apidocs.chargebee.com/docs/api/invoices). +- [`threshold`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert#threshold) has been added as request body parameter to [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`status`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert#status) has been added as request body parameter to [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`threshold`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#threshold) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`filter_conditions`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#filter_conditions) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`type`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#type) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`name`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#name) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`description`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#description) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`metered_feature_id`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#metered_feature_id) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`subscription_id`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#subscription_id) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`meta`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert#meta) has been added as request body parameter to [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) in [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- [`defer_payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent#defer_payment_method_type) 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). +- [`net_term_days`](https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-charge-items-and-charges#net_term_days) has been added as request body parameter to [`edit_quote_for_charge_items_and_charges`](https://apidocs.chargebee.com/docs/api/quotes/edit-quote-for-charge-items-and-charges) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). +- [`net_term_days`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-charge-and-charge-items#net_term_days) has been added as request body parameter to [`create_a_quote_for_charge_and_charge_items`](https://apidocs.chargebee.com/docs/api/quotes/create-a-quote-for-charge-and-charge-items) in [`Quote`](https://apidocs.chargebee.com/docs/api/quotes). + + +### Deleted Attributes: +- `alarm_triggered_at` has been removed from [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `scope` has been removed from [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `alert_status` has been removed from [`AlertStatus`](https://apidocs.chargebee.com/docs/api/alert_statuses). + + +### New Enums: +- `within_limit` and `in_alarm` have been added as new values enum `AlarmStatus`. +- `moyasar` and `payway` have been added as new values enum `Gateway`. +- `absolute` and `percentage` have been added as new values enum `Mode`. +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values enum `PaymentMethod`. +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values enum `PaymentMethodType`. +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values enum `Type`. +- `mada` has been added as a new value to enum attribute [`card_type`](https://apidocs.chargebee.com/docs/api/cards/card-object#card_type) in [`Card`](https://apidocs.chargebee.com/docs/api/cards). +- `rate_limited` has been added as a new value to enum attribute [`webhook_status`](https://apidocs.chargebee.com/docs/api/events/event-object#webhook_status) in [`Event`](https://apidocs.chargebee.com/docs/api/events). +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum attribute [`payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum attribute [`active_payment_attempt.payment_method_type`](https://apidocs.chargebee.com/docs/api/payment_intents/payment-intent-object#active_payment_attempt_payment_method_type) in [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `mada` has been added as a new value to enum attribute [`card.brand`](https://apidocs.chargebee.com/docs/api/payment_sources/payment-source-object#card_brand) in [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). +- `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). +- `disabled` and `enabled` have been added as new values to enum query parameter `status.is` in [`list_applicable_alerts_for_a_subscription`](https://apidocs.chargebee.com/docs/api/alerts/list-applicable-alerts-for-a-subscription) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `enabled` and `disabled` have been added as new values to enum request body parameter `status` in [`update_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/update-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `disabled` and `enabled` have been added as new values to enum query parameter `status.is` in [`list_alerts`](https://apidocs.chargebee.com/docs/api/alerts/list-alerts) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `plan_price_id` has been added as a new value to enum request body parameter `filter_conditions.field` in [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `not_equals` and `equals` have been added as new values to enum request body parameter `filter_conditions.operator` in [`create_an_alert`](https://apidocs.chargebee.com/docs/api/alerts/create-an-alert) of [`Alert`](https://apidocs.chargebee.com/docs/api/alerts). +- `rate_limited` has been added as a new value to enum query parameter `webhook_status.is` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events). +- `rate_limited` has been added as a new value to enum query parameter `webhook_status.is_not` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events). +- `rate_limited` has been added as a new value to enum query parameter `webhook_status.in` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events). +- `rate_limited` has been added as a new value to enum query parameter `webhook_status.not_in` in [`list_events`](https://apidocs.chargebee.com/docs/api/events/list-events) of [`Event`](https://apidocs.chargebee.com/docs/api/events). +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum request body parameter `payment_method_type` in [`update_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/update-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `twint`, `go_pay`, `grab_pay`, `pay_co`, `after_pay`, `swish`, and `payme` have been added as new values to enum request body parameter `payment_method_type` in [`create_a_payment_intent`](https://apidocs.chargebee.com/docs/api/payment_intents/create-a-payment-intent) of [`PaymentIntent`](https://apidocs.chargebee.com/docs/api/payment_intents). +- `mada` has been added as a new value to enum request body parameter `card.brand` in [`create_using_permanent_token`](https://apidocs.chargebee.com/docs/api/payment_sources/create-using-permanent-token) of [`PaymentSource`](https://apidocs.chargebee.com/docs/api/payment_sources). + + + ### v4.6.0 (2026-03-27) * * * ### New Resources: diff --git a/VERSION b/VERSION index 6016e8add..f6cdf4098 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.6.0 +4.7.0 diff --git a/build.gradle.kts b/build.gradle.kts index 4b6188a6b..8d6fec3d1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,7 +7,7 @@ plugins { } group = "com.chargebee" -version = "4.6.0" +version = "4.7.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 3d09cf441..696019a59 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethods.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethods.java @@ -62,6 +62,8 @@ import com.chargebee.v4.services.UsageSummaryService; +import com.chargebee.v4.services.AlertStatusService; + import com.chargebee.v4.services.SubscriptionSettingService; import com.chargebee.v4.services.SiteMigrationDetailService; @@ -110,6 +112,8 @@ import com.chargebee.v4.services.UnbilledChargesSettingService; +import com.chargebee.v4.services.AlertService; + import com.chargebee.v4.services.CurrencyService; import com.chargebee.v4.services.EventService; @@ -389,6 +393,13 @@ public interface ClientMethods { */ UsageSummaryService usageSummaries(); + /** + * Access alert_status-related operations. + * + * @return AlertStatusService instance for fluent API access + */ + AlertStatusService alertStatuses(); + /** * Access subscription_setting-related operations. * @@ -557,6 +568,13 @@ public interface ClientMethods { */ UnbilledChargesSettingService unbilledChargesSettings(); + /** + * Access alert-related operations. + * + * @return AlertService instance for fluent API access + */ + AlertService alerts(); + /** * Access currency-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 3d6cd3de1..8f396b469 100644 --- a/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java +++ b/src/main/java/com/chargebee/v4/client/ClientMethodsImpl.java @@ -62,6 +62,8 @@ import com.chargebee.v4.services.UsageSummaryService; +import com.chargebee.v4.services.AlertStatusService; + import com.chargebee.v4.services.SubscriptionSettingService; import com.chargebee.v4.services.SiteMigrationDetailService; @@ -110,6 +112,8 @@ import com.chargebee.v4.services.UnbilledChargesSettingService; +import com.chargebee.v4.services.AlertService; + import com.chargebee.v4.services.CurrencyService; import com.chargebee.v4.services.EventService; @@ -329,6 +333,11 @@ public UsageSummaryService usageSummaries() { return getServiceRegistry().usageSummaries(); } + @Override + public AlertStatusService alertStatuses() { + return getServiceRegistry().alertStatuses(); + } + @Override public SubscriptionSettingService subscriptionSettings() { return getServiceRegistry().subscriptionSettings(); @@ -449,6 +458,11 @@ public UnbilledChargesSettingService unbilledChargesSettings() { return getServiceRegistry().unbilledChargesSettings(); } + @Override + public AlertService alerts() { + return getServiceRegistry().alerts(); + } + @Override public CurrencyService currencies() { return getServiceRegistry().currencies(); diff --git a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java index ba340bbbb..cba64f856 100644 --- a/src/main/java/com/chargebee/v4/client/ServiceRegistry.java +++ b/src/main/java/com/chargebee/v4/client/ServiceRegistry.java @@ -62,6 +62,8 @@ import com.chargebee.v4.services.UsageSummaryService; +import com.chargebee.v4.services.AlertStatusService; + import com.chargebee.v4.services.SubscriptionSettingService; import com.chargebee.v4.services.SiteMigrationDetailService; @@ -110,6 +112,8 @@ import com.chargebee.v4.services.UnbilledChargesSettingService; +import com.chargebee.v4.services.AlertService; + import com.chargebee.v4.services.CurrencyService; import com.chargebee.v4.services.EventService; @@ -235,6 +239,8 @@ final class ServiceRegistry { private volatile UsageSummaryService usageSummaryService; + private volatile AlertStatusService alertStatusService; + private volatile SubscriptionSettingService subscriptionSettingService; private volatile SiteMigrationDetailService siteMigrationDetailService; @@ -283,6 +289,8 @@ final class ServiceRegistry { private volatile UnbilledChargesSettingService unbilledChargesSettingService; + private volatile AlertService alertService; + private volatile CurrencyService currencyService; private volatile EventService eventService; @@ -808,6 +816,21 @@ UsageSummaryService usageSummaries() { return usageSummaryService; } + /** + * Get or create the AlertStatusService instance. Thread-safe lazy initialization using + * double-checked locking. + */ + AlertStatusService alertStatuses() { + if (alertStatusService == null) { + synchronized (this) { + if (alertStatusService == null) { + alertStatusService = new AlertStatusService(client); + } + } + } + return alertStatusService; + } + /** * Get or create the SubscriptionSettingService instance. Thread-safe lazy initialization using * double-checked locking. @@ -1168,6 +1191,21 @@ UnbilledChargesSettingService unbilledChargesSettings() { return unbilledChargesSettingService; } + /** + * Get or create the AlertService instance. Thread-safe lazy initialization using double-checked + * locking. + */ + AlertService alerts() { + if (alertService == null) { + synchronized (this) { + if (alertService == null) { + alertService = new AlertService(client); + } + } + } + return alertService; + } + /** * Get or create the CurrencyService instance. Thread-safe lazy initialization using * double-checked locking. diff --git a/src/main/java/com/chargebee/v4/models/alert/Alert.java b/src/main/java/com/chargebee/v4/models/alert/Alert.java index 2ddcb89c3..78024d2a1 100644 --- a/src/main/java/com/chargebee/v4/models/alert/Alert.java +++ b/src/main/java/com/chargebee/v4/models/alert/Alert.java @@ -20,8 +20,6 @@ public class Alert { private String meteredFeatureId; private String subscriptionId; private Status status; - private Timestamp alarmTriggeredAt; - private Scope scope; private String meta; private Timestamp createdAt; private Timestamp updatedAt; @@ -54,14 +52,6 @@ public Status getStatus() { return status; } - public Timestamp getAlarmTriggeredAt() { - return alarmTriggeredAt; - } - - public Scope getScope() { - return scope; - } - public String getMeta() { return meta; } @@ -128,34 +118,6 @@ public static Status fromString(String value) { } } - public enum Scope { - GLOBAL("global"), - - SUBSCRIPTION("subscription"), - - /** An enum member indicating that Scope was instantiated with an unknown value. */ - _UNKNOWN(null); - private final String value; - - Scope(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - public static Scope fromString(String value) { - if (value == null) return _UNKNOWN; - for (Scope enumValue : Scope.values()) { - if (enumValue.value != null && enumValue.value.equals(value)) { - return enumValue; - } - } - return _UNKNOWN; - } - } - public static Alert fromJson(String json) { return fromJson(JsonUtil.parse(json)); } @@ -177,10 +139,6 @@ public static Alert fromJson(JsonObject jsonObj) { obj.status = Status.fromString(JsonUtil.getString(jsonObj, "status")); - obj.alarmTriggeredAt = JsonUtil.getTimestamp(jsonObj, "alarm_triggered_at"); - - obj.scope = Scope.fromString(JsonUtil.getString(jsonObj, "scope")); - obj.meta = JsonUtil.getString(jsonObj, "meta"); obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); @@ -207,10 +165,6 @@ public String toString() { + subscriptionId + ", status=" + status - + ", alarmTriggeredAt=" - + alarmTriggeredAt - + ", scope=" - + scope + ", meta=" + meta + ", createdAt=" @@ -233,8 +187,6 @@ public boolean equals(Object o) { && java.util.Objects.equals(meteredFeatureId, that.meteredFeatureId) && java.util.Objects.equals(subscriptionId, that.subscriptionId) && java.util.Objects.equals(status, that.status) - && java.util.Objects.equals(alarmTriggeredAt, that.alarmTriggeredAt) - && java.util.Objects.equals(scope, that.scope) && java.util.Objects.equals(meta, that.meta) && java.util.Objects.equals(createdAt, that.createdAt) && java.util.Objects.equals(updatedAt, that.updatedAt); @@ -251,8 +203,6 @@ public int hashCode() { meteredFeatureId, subscriptionId, status, - alarmTriggeredAt, - scope, meta, createdAt, updatedAt); diff --git a/src/main/java/com/chargebee/v4/models/alert/params/AlertCreateParams.java b/src/main/java/com/chargebee/v4/models/alert/params/AlertCreateParams.java new file mode 100644 index 000000000..134d16374 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/params/AlertCreateParams.java @@ -0,0 +1,480 @@ +/* + * 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.alert.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.List; + +public final class AlertCreateParams { + + private final Type type; + + private final String name; + + private final String description; + + private final String meteredFeatureId; + + private final String subscriptionId; + + private final String meta; + + private final ThresholdParams threshold; + + private final List filterConditions; + + private AlertCreateParams(AlertCreateBuilder builder) { + + this.type = builder.type; + + this.name = builder.name; + + this.description = builder.description; + + this.meteredFeatureId = builder.meteredFeatureId; + + this.subscriptionId = builder.subscriptionId; + + this.meta = builder.meta; + + this.threshold = builder.threshold; + + this.filterConditions = builder.filterConditions; + } + + public Type getType() { + return type; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getMeteredFeatureId() { + return meteredFeatureId; + } + + public String getSubscriptionId() { + return subscriptionId; + } + + public String getMeta() { + return meta; + } + + public ThresholdParams getThreshold() { + return threshold; + } + + public List getFilterConditions() { + return filterConditions; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.type != null) { + + formData.put("type", this.type); + } + + if (this.name != null) { + + formData.put("name", this.name); + } + + if (this.description != null) { + + formData.put("description", this.description); + } + + if (this.meteredFeatureId != null) { + + formData.put("metered_feature_id", this.meteredFeatureId); + } + + if (this.subscriptionId != null) { + + formData.put("subscription_id", this.subscriptionId); + } + + if (this.meta != null) { + + formData.put("meta", this.meta); + } + + if (this.threshold != null) { + + // Single object + Map nestedData = this.threshold.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "threshold[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + if (this.filterConditions != null) { + + // List of objects + for (int i = 0; i < this.filterConditions.size(); i++) { + FilterConditionsParams item = this.filterConditions.get(i); + if (item != null) { + Map itemData = item.toFormData(); + for (Map.Entry entry : itemData.entrySet()) { + String indexedKey = "filter_conditions[" + entry.getKey() + "][" + i + "]"; + formData.put(indexedKey, entry.getValue()); + } + } + } + } + + return formData; + } + + /** Create a new builder for AlertCreateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AlertCreateBuilder builder() { + return new AlertCreateBuilder(); + } + + public static final class AlertCreateBuilder { + + private Type type; + + private String name; + + private String description; + + private String meteredFeatureId; + + private String subscriptionId; + + private String meta; + + private ThresholdParams threshold; + + private List filterConditions; + + private AlertCreateBuilder() {} + + public AlertCreateBuilder type(Type value) { + this.type = value; + return this; + } + + public AlertCreateBuilder name(String value) { + this.name = value; + return this; + } + + public AlertCreateBuilder description(String value) { + this.description = value; + return this; + } + + public AlertCreateBuilder meteredFeatureId(String value) { + this.meteredFeatureId = value; + return this; + } + + public AlertCreateBuilder subscriptionId(String value) { + this.subscriptionId = value; + return this; + } + + public AlertCreateBuilder meta(String value) { + this.meta = value; + return this; + } + + public AlertCreateBuilder threshold(ThresholdParams value) { + this.threshold = value; + return this; + } + + public AlertCreateBuilder filterConditions(List value) { + this.filterConditions = value; + return this; + } + + public AlertCreateParams build() { + return new AlertCreateParams(this); + } + } + + public enum Type { + USAGE_EXCEEDED("usage_exceeded"), + + /** An enum member indicating that Type was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Type(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Type fromString(String value) { + if (value == null) return _UNKNOWN; + for (Type enumValue : Type.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public static final class ThresholdParams { + + private final Mode mode; + + private final Double value; + + private ThresholdParams(ThresholdBuilder builder) { + + this.mode = builder.mode; + + this.value = builder.value; + } + + public Mode getMode() { + return mode; + } + + public Double getValue() { + return value; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.mode != null) { + + formData.put("mode", this.mode); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + return formData; + } + + /** Create a new builder for ThresholdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ThresholdBuilder builder() { + return new ThresholdBuilder(); + } + + public static final class ThresholdBuilder { + + private Mode mode; + + private Double value; + + private ThresholdBuilder() {} + + public ThresholdBuilder mode(Mode value) { + this.mode = value; + return this; + } + + public ThresholdBuilder value(Double value) { + this.value = value; + return this; + } + + public ThresholdParams build() { + return new ThresholdParams(this); + } + } + + public enum Mode { + ABSOLUTE("absolute"), + + PERCENTAGE("percentage"), + + /** An enum member indicating that Mode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Mode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Mode fromString(String value) { + if (value == null) return _UNKNOWN; + for (Mode enumValue : Mode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } + + public static final class FilterConditionsParams { + + private final Field field; + + private final Operator operator; + + private final String value; + + private FilterConditionsParams(FilterConditionsBuilder builder) { + + this.field = builder.field; + + this.operator = builder.operator; + + this.value = builder.value; + } + + public Field getField() { + return field; + } + + public Operator getOperator() { + return operator; + } + + public String getValue() { + return value; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.field != null) { + + formData.put("field", this.field); + } + + if (this.operator != null) { + + formData.put("operator", this.operator); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + return formData; + } + + /** Create a new builder for FilterConditionsParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static FilterConditionsBuilder builder() { + return new FilterConditionsBuilder(); + } + + public static final class FilterConditionsBuilder { + + private Field field; + + private Operator operator; + + private String value; + + private FilterConditionsBuilder() {} + + public FilterConditionsBuilder field(Field value) { + this.field = value; + return this; + } + + public FilterConditionsBuilder operator(Operator value) { + this.operator = value; + return this; + } + + public FilterConditionsBuilder value(String value) { + this.value = value; + return this; + } + + public FilterConditionsParams build() { + return new FilterConditionsParams(this); + } + } + + public enum Field { + PLAN_PRICE_ID("plan_price_id"), + + /** An enum member indicating that Field was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Field(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Field fromString(String value) { + if (value == null) return _UNKNOWN; + for (Field enumValue : Field.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Operator { + EQUALS("equals"), + + NOT_EQUALS("not_equals"), + + /** An enum member indicating that Operator was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Operator(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Operator fromString(String value) { + if (value == null) return _UNKNOWN; + for (Operator enumValue : Operator.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/alert/params/AlertDeleteParams.java b/src/main/java/com/chargebee/v4/models/alert/params/AlertDeleteParams.java new file mode 100644 index 000000000..b1e94b04d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/params/AlertDeleteParams.java @@ -0,0 +1,39 @@ +/* + * 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.alert.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class AlertDeleteParams { + + private AlertDeleteParams(AlertDeleteBuilder builder) {} + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + return formData; + } + + /** Create a new builder for AlertDeleteParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AlertDeleteBuilder builder() { + return new AlertDeleteBuilder(); + } + + public static final class AlertDeleteBuilder { + + private AlertDeleteBuilder() {} + + public AlertDeleteParams build() { + return new AlertDeleteParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/alert/params/AlertListParams.java b/src/main/java/com/chargebee/v4/models/alert/params/AlertListParams.java new file mode 100644 index 000000000..bd34b1619 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/params/AlertListParams.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.alert.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class AlertListParams { + + private final Map queryParams; + + private AlertListParams(AlertListBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public AlertListBuilder toBuilder() { + AlertListBuilder builder = new AlertListBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for AlertListParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AlertListBuilder builder() { + return new AlertListBuilder(); + } + + public static final class AlertListBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private AlertListBuilder() {} + + public AlertListBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public AlertListBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public IdFilter id() { + return new IdFilter("id", this, queryParams); + } + + public TypeFilter type() { + return new TypeFilter("type", this, queryParams); + } + + public SubscriptionIdFilter subscriptionId() { + return new SubscriptionIdFilter("subscription_id", this, queryParams); + } + + public StatusFilter status() { + return new StatusFilter("status", this, queryParams); + } + + public AlertListParams build() { + return new AlertListParams(this); + } + + public static final class IdFilter extends StringFilter { + IdFilter(String fieldName, AlertListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class TypeFilter extends EnumFilter { + TypeFilter(String fieldName, AlertListBuilder builder, Map params) { + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public AlertListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public AlertListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public AlertListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public AlertListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + + public static final class SubscriptionIdFilter extends StringFilter { + SubscriptionIdFilter(String fieldName, AlertListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + + public static final class StatusFilter extends EnumFilter { + StatusFilter(String fieldName, AlertListBuilder builder, Map params) { + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public AlertListBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public AlertListBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public AlertListBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public AlertListBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + } + + public enum TypeIs { + USAGE_EXCEEDED("usage_exceeded"), + + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TypeIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TypeIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (TypeIs enumValue : TypeIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum StatusIs { + ENABLED("enabled"), + + DISABLED("disabled"), + + /** An enum member indicating that StatusIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusIs enumValue : StatusIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Type { + USAGE_EXCEEDED("usage_exceeded"), + + /** An enum member indicating that Type was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Type(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Type fromString(String value) { + if (value == null) return _UNKNOWN; + for (Type enumValue : Type.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ENABLED("enabled"), + + DISABLED("disabled"), + + /** 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/alert/params/AlertRetrieveParams.java b/src/main/java/com/chargebee/v4/models/alert/params/AlertRetrieveParams.java new file mode 100644 index 000000000..3af200e53 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/params/AlertRetrieveParams.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.alert.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class AlertRetrieveParams { + + private final Map queryParams; + + private AlertRetrieveParams(AlertRetrieveBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public AlertRetrieveBuilder toBuilder() { + AlertRetrieveBuilder builder = new AlertRetrieveBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for AlertRetrieveParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AlertRetrieveBuilder builder() { + return new AlertRetrieveBuilder(); + } + + public static final class AlertRetrieveBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private AlertRetrieveBuilder() {} + + public AlertRetrieveParams build() { + return new AlertRetrieveParams(this); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/alert/params/AlertUpdateParams.java b/src/main/java/com/chargebee/v4/models/alert/params/AlertUpdateParams.java new file mode 100644 index 000000000..7f584c654 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/params/AlertUpdateParams.java @@ -0,0 +1,209 @@ +/* + * 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.alert.params; + +import com.chargebee.v4.internal.Recommended; + +import java.util.LinkedHashMap; +import java.util.Map; + +public final class AlertUpdateParams { + + private final Status status; + + private final ThresholdParams threshold; + + private AlertUpdateParams(AlertUpdateBuilder builder) { + + this.status = builder.status; + + this.threshold = builder.threshold; + } + + public Status getStatus() { + return status; + } + + public ThresholdParams getThreshold() { + return threshold; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.status != null) { + + formData.put("status", this.status); + } + + if (this.threshold != null) { + + // Single object + Map nestedData = this.threshold.toFormData(); + for (Map.Entry entry : nestedData.entrySet()) { + String nestedKey = "threshold[" + entry.getKey() + "]"; + formData.put(nestedKey, entry.getValue()); + } + } + + return formData; + } + + /** Create a new builder for AlertUpdateParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AlertUpdateBuilder builder() { + return new AlertUpdateBuilder(); + } + + public static final class AlertUpdateBuilder { + + private Status status; + + private ThresholdParams threshold; + + private AlertUpdateBuilder() {} + + public AlertUpdateBuilder status(Status value) { + this.status = value; + return this; + } + + public AlertUpdateBuilder threshold(ThresholdParams value) { + this.threshold = value; + return this; + } + + public AlertUpdateParams build() { + return new AlertUpdateParams(this); + } + } + + public enum Status { + ENABLED("enabled"), + + DISABLED("disabled"), + + /** 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 final class ThresholdParams { + + private final Mode mode; + + private final Double value; + + private ThresholdParams(ThresholdBuilder builder) { + + this.mode = builder.mode; + + this.value = builder.value; + } + + public Mode getMode() { + return mode; + } + + public Double getValue() { + return value; + } + + /** Get the form data for this request. */ + public Map toFormData() { + Map formData = new LinkedHashMap<>(); + + if (this.mode != null) { + + formData.put("mode", this.mode); + } + + if (this.value != null) { + + formData.put("value", this.value); + } + + return formData; + } + + /** Create a new builder for ThresholdParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ThresholdBuilder builder() { + return new ThresholdBuilder(); + } + + public static final class ThresholdBuilder { + + private Mode mode; + + private Double value; + + private ThresholdBuilder() {} + + public ThresholdBuilder mode(Mode value) { + this.mode = value; + return this; + } + + public ThresholdBuilder value(Double value) { + this.value = value; + return this; + } + + public ThresholdParams build() { + return new ThresholdParams(this); + } + } + + public enum Mode { + ABSOLUTE("absolute"), + + PERCENTAGE("percentage"), + + /** An enum member indicating that Mode was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Mode(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Mode fromString(String value) { + if (value == null) return _UNKNOWN; + for (Mode enumValue : Mode.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/alert/params/ApplicationAlertsForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/alert/params/ApplicationAlertsForSubscriptionParams.java new file mode 100644 index 000000000..a1546b506 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/params/ApplicationAlertsForSubscriptionParams.java @@ -0,0 +1,301 @@ +/* + * 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.alert.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.EnumFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class ApplicationAlertsForSubscriptionParams { + + private final Map queryParams; + + private ApplicationAlertsForSubscriptionParams(ApplicationAlertsForSubscriptionBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public ApplicationAlertsForSubscriptionBuilder toBuilder() { + ApplicationAlertsForSubscriptionBuilder builder = new ApplicationAlertsForSubscriptionBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for ApplicationAlertsForSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static ApplicationAlertsForSubscriptionBuilder builder() { + return new ApplicationAlertsForSubscriptionBuilder(); + } + + public static final class ApplicationAlertsForSubscriptionBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private ApplicationAlertsForSubscriptionBuilder() {} + + public ApplicationAlertsForSubscriptionBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public ApplicationAlertsForSubscriptionBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public StatusFilter status() { + return new StatusFilter("status", this, queryParams); + } + + public TypeFilter type() { + return new TypeFilter("type", this, queryParams); + } + + public ApplicationAlertsForSubscriptionParams build() { + return new ApplicationAlertsForSubscriptionParams(this); + } + + public static final class StatusFilter + extends EnumFilter { + StatusFilter( + String fieldName, + ApplicationAlertsForSubscriptionBuilder builder, + Map params) { + super(fieldName, builder, params, Status::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().is(Status.YOUR_VALUE)}
+ * + * @see #is(Status) + */ + @Deprecated + public ApplicationAlertsForSubscriptionBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().isNot(Status.YOUR_VALUE)}
+ * + * @see #isNot(Status) + */ + @Deprecated + public ApplicationAlertsForSubscriptionBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().in(Status.VALUE1, Status.VALUE2)}
+ * + * @see #in(Status[]) + */ + @Deprecated + public ApplicationAlertsForSubscriptionBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .status().notIn(Status.VALUE1, Status.VALUE2)}
+ * + * @see #notIn(Status[]) + */ + @Deprecated + public ApplicationAlertsForSubscriptionBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + + public static final class TypeFilter + extends EnumFilter { + TypeFilter( + String fieldName, + ApplicationAlertsForSubscriptionBuilder builder, + Map params) { + super(fieldName, builder, params, Type::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().is(Type.YOUR_VALUE)}
+ * + * @see #is(Type) + */ + @Deprecated + public ApplicationAlertsForSubscriptionBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().isNot(Type.YOUR_VALUE)}
+ * + * @see #isNot(Type) + */ + @Deprecated + public ApplicationAlertsForSubscriptionBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().in(Type.VALUE1, Type.VALUE2)}
+ * + * @see #in(Type[]) + */ + @Deprecated + public ApplicationAlertsForSubscriptionBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .type().notIn(Type.VALUE1, Type.VALUE2)}
+ * + * @see #notIn(Type[]) + */ + @Deprecated + public ApplicationAlertsForSubscriptionBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + } + + public enum StatusIs { + ENABLED("enabled"), + + DISABLED("disabled"), + + /** An enum member indicating that StatusIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + StatusIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static StatusIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (StatusIs enumValue : StatusIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum TypeIs { + USAGE_EXCEEDED("usage_exceeded"), + + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + TypeIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static TypeIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (TypeIs enumValue : TypeIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum Status { + ENABLED("enabled"), + + DISABLED("disabled"), + + /** 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 enum Type { + USAGE_EXCEEDED("usage_exceeded"), + + /** An enum member indicating that Type was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + Type(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static Type fromString(String value) { + if (value == null) return _UNKNOWN; + for (Type enumValue : Type.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/alert/responses/AlertCreateResponse.java b/src/main/java/com/chargebee/v4/models/alert/responses/AlertCreateResponse.java new file mode 100644 index 000000000..8e0eae890 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/responses/AlertCreateResponse.java @@ -0,0 +1,96 @@ +package com.chargebee.v4.models.alert.responses; + +import com.chargebee.v4.models.alert.Alert; + +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 AlertCreate operation. Contains the response data from the API. */ +public final class AlertCreateResponse extends BaseResponse { + private final Alert alert; + + private AlertCreateResponse(Builder builder) { + super(builder.httpResponse); + + this.alert = builder.alert; + } + + /** Parse JSON response into AlertCreateResponse object. */ + public static AlertCreateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into AlertCreateResponse object with HTTP response. */ + public static AlertCreateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __alertObj = JsonUtil.getJsonObject(jsonObj, "alert"); + if (__alertObj != null) { + builder.alert(Alert.fromJson(__alertObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AlertCreateResponse from JSON", e); + } + } + + /** Create a new builder for AlertCreateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for AlertCreateResponse. */ + public static class Builder { + + private Alert alert; + + private Response httpResponse; + + private Builder() {} + + public Builder alert(Alert alert) { + this.alert = alert; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public AlertCreateResponse build() { + return new AlertCreateResponse(this); + } + } + + /** Get the alert from the response. */ + public Alert getAlert() { + return alert; + } + + @Override + public String toString() { + return "AlertCreateResponse{" + "alert=" + alert + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertCreateResponse that = (AlertCreateResponse) o; + return java.util.Objects.equals(alert, that.alert); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(alert); + } +} diff --git a/src/main/java/com/chargebee/v4/models/alert/responses/AlertDeleteResponse.java b/src/main/java/com/chargebee/v4/models/alert/responses/AlertDeleteResponse.java new file mode 100644 index 000000000..8d9d458a8 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/responses/AlertDeleteResponse.java @@ -0,0 +1,96 @@ +package com.chargebee.v4.models.alert.responses; + +import com.chargebee.v4.models.alert.Alert; + +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 AlertDelete operation. Contains the response data from the API. */ +public final class AlertDeleteResponse extends BaseResponse { + private final Alert alert; + + private AlertDeleteResponse(Builder builder) { + super(builder.httpResponse); + + this.alert = builder.alert; + } + + /** Parse JSON response into AlertDeleteResponse object. */ + public static AlertDeleteResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into AlertDeleteResponse object with HTTP response. */ + public static AlertDeleteResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __alertObj = JsonUtil.getJsonObject(jsonObj, "alert"); + if (__alertObj != null) { + builder.alert(Alert.fromJson(__alertObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AlertDeleteResponse from JSON", e); + } + } + + /** Create a new builder for AlertDeleteResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for AlertDeleteResponse. */ + public static class Builder { + + private Alert alert; + + private Response httpResponse; + + private Builder() {} + + public Builder alert(Alert alert) { + this.alert = alert; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public AlertDeleteResponse build() { + return new AlertDeleteResponse(this); + } + } + + /** Get the alert from the response. */ + public Alert getAlert() { + return alert; + } + + @Override + public String toString() { + return "AlertDeleteResponse{" + "alert=" + alert + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertDeleteResponse that = (AlertDeleteResponse) o; + return java.util.Objects.equals(alert, that.alert); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(alert); + } +} diff --git a/src/main/java/com/chargebee/v4/models/alert/responses/AlertListResponse.java b/src/main/java/com/chargebee/v4/models/alert/responses/AlertListResponse.java new file mode 100644 index 000000000..ca36202a3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/responses/AlertListResponse.java @@ -0,0 +1,206 @@ +package com.chargebee.v4.models.alert.responses; + +import java.util.List; + +import com.chargebee.v4.models.alert.Alert; + +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.AlertService; +import com.chargebee.v4.models.alert.params.AlertListParams; + +/** Immutable response object for AlertList operation. Contains paginated list data. */ +public final class AlertListResponse { + + private final List list; + + private final String nextOffset; + + private final AlertService service; + private final AlertListParams originalParams; + private final Response httpResponse; + + private AlertListResponse( + List list, + String nextOffset, + AlertService service, + AlertListParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into AlertListResponse object (no service context). Use this when you only + * need to read a single page (no nextPage()). + */ + public static AlertListResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "list"), AlertListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new AlertListResponse(list, nextOffset, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AlertListResponse from JSON", e); + } + } + + /** + * Parse JSON response into AlertListResponse object with service context for pagination (enables + * nextPage()). + */ + public static AlertListResponse fromJson( + String json, AlertService service, AlertListParams originalParams, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "list"), AlertListItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new AlertListResponse(list, nextOffset, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AlertListResponse 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 AlertListResponse 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)."); + } + + AlertListParams nextParams = + (originalParams != null ? originalParams.toBuilder() : AlertListParams.builder()) + .offset(nextOffset) + .build(); + + return service.list(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 "AlertListResponse{" + "list=" + list + ", nextOffset=" + nextOffset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertListResponse that = (AlertListResponse) 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 AlertListItem { + + private Alert alert; + + public Alert getAlert() { + return alert; + } + + public static AlertListItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static AlertListItem fromJson(JsonObject jsonObj) { + AlertListItem item = new AlertListItem(); + + JsonObject __alertObj = JsonUtil.getJsonObject(jsonObj, "alert"); + if (__alertObj != null) { + item.alert = Alert.fromJson(__alertObj); + } + + return item; + } + + @Override + public String toString() { + return "AlertListItem{" + "alert=" + alert + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertListItem that = (AlertListItem) o; + return java.util.Objects.equals(alert, that.alert); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(alert); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/alert/responses/AlertRetrieveResponse.java b/src/main/java/com/chargebee/v4/models/alert/responses/AlertRetrieveResponse.java new file mode 100644 index 000000000..2760df810 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/responses/AlertRetrieveResponse.java @@ -0,0 +1,99 @@ +package com.chargebee.v4.models.alert.responses; + +import com.chargebee.v4.models.alert.Alert; + +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 AlertRetrieve operation. Contains the response data from a single + * resource get operation. + */ +public final class AlertRetrieveResponse extends BaseResponse { + private final Alert alert; + + private AlertRetrieveResponse(Builder builder) { + super(builder.httpResponse); + + this.alert = builder.alert; + } + + /** Parse JSON response into AlertRetrieveResponse object. */ + public static AlertRetrieveResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into AlertRetrieveResponse object with HTTP response. */ + public static AlertRetrieveResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __alertObj = JsonUtil.getJsonObject(jsonObj, "alert"); + if (__alertObj != null) { + builder.alert(Alert.fromJson(__alertObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AlertRetrieveResponse from JSON", e); + } + } + + /** Create a new builder for AlertRetrieveResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for AlertRetrieveResponse. */ + public static class Builder { + + private Alert alert; + + private Response httpResponse; + + private Builder() {} + + public Builder alert(Alert alert) { + this.alert = alert; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public AlertRetrieveResponse build() { + return new AlertRetrieveResponse(this); + } + } + + /** Get the alert from the response. */ + public Alert getAlert() { + return alert; + } + + @Override + public String toString() { + return "AlertRetrieveResponse{" + "alert=" + alert + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertRetrieveResponse that = (AlertRetrieveResponse) o; + return java.util.Objects.equals(alert, that.alert); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(alert); + } +} diff --git a/src/main/java/com/chargebee/v4/models/alert/responses/AlertUpdateResponse.java b/src/main/java/com/chargebee/v4/models/alert/responses/AlertUpdateResponse.java new file mode 100644 index 000000000..0cfe98f8b --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/responses/AlertUpdateResponse.java @@ -0,0 +1,96 @@ +package com.chargebee.v4.models.alert.responses; + +import com.chargebee.v4.models.alert.Alert; + +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 AlertUpdate operation. Contains the response data from the API. */ +public final class AlertUpdateResponse extends BaseResponse { + private final Alert alert; + + private AlertUpdateResponse(Builder builder) { + super(builder.httpResponse); + + this.alert = builder.alert; + } + + /** Parse JSON response into AlertUpdateResponse object. */ + public static AlertUpdateResponse fromJson(String json) { + return fromJson(json, null); + } + + /** Parse JSON response into AlertUpdateResponse object with HTTP response. */ + public static AlertUpdateResponse fromJson(String json, Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + Builder builder = builder(); + + JsonObject __alertObj = JsonUtil.getJsonObject(jsonObj, "alert"); + if (__alertObj != null) { + builder.alert(Alert.fromJson(__alertObj)); + } + + builder.httpResponse(httpResponse); + return builder.build(); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AlertUpdateResponse from JSON", e); + } + } + + /** Create a new builder for AlertUpdateResponse. */ + public static Builder builder() { + return new Builder(); + } + + /** Builder for AlertUpdateResponse. */ + public static class Builder { + + private Alert alert; + + private Response httpResponse; + + private Builder() {} + + public Builder alert(Alert alert) { + this.alert = alert; + return this; + } + + public Builder httpResponse(Response httpResponse) { + this.httpResponse = httpResponse; + return this; + } + + public AlertUpdateResponse build() { + return new AlertUpdateResponse(this); + } + } + + /** Get the alert from the response. */ + public Alert getAlert() { + return alert; + } + + @Override + public String toString() { + return "AlertUpdateResponse{" + "alert=" + alert + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertUpdateResponse that = (AlertUpdateResponse) o; + return java.util.Objects.equals(alert, that.alert); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(alert); + } +} diff --git a/src/main/java/com/chargebee/v4/models/alert/responses/ApplicationAlertsForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/alert/responses/ApplicationAlertsForSubscriptionResponse.java new file mode 100644 index 000000000..f62c518d3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alert/responses/ApplicationAlertsForSubscriptionResponse.java @@ -0,0 +1,234 @@ +package com.chargebee.v4.models.alert.responses; + +import java.util.List; + +import com.chargebee.v4.models.alert.Alert; + +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.AlertService; +import com.chargebee.v4.models.alert.params.ApplicationAlertsForSubscriptionParams; + +/** + * Immutable response object for ApplicationAlertsForSubscription operation. Contains paginated list + * data. + */ +public final class ApplicationAlertsForSubscriptionResponse { + + private final List list; + + private final String nextOffset; + + private final String subscriptionId; + + private final AlertService service; + private final ApplicationAlertsForSubscriptionParams originalParams; + private final Response httpResponse; + + private ApplicationAlertsForSubscriptionResponse( + List list, + String nextOffset, + String subscriptionId, + AlertService service, + ApplicationAlertsForSubscriptionParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.subscriptionId = subscriptionId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into ApplicationAlertsForSubscriptionResponse object (no service context). + * Use this when you only need to read a single page (no nextPage()). + */ + public static ApplicationAlertsForSubscriptionResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + AlertApplicationAlertsForSubscriptionItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new ApplicationAlertsForSubscriptionResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ApplicationAlertsForSubscriptionResponse from JSON", e); + } + } + + /** + * Parse JSON response into ApplicationAlertsForSubscriptionResponse object with service context + * for pagination (enables nextPage()). + */ + public static ApplicationAlertsForSubscriptionResponse fromJson( + String json, + AlertService service, + ApplicationAlertsForSubscriptionParams originalParams, + String subscriptionId, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + AlertApplicationAlertsForSubscriptionItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new ApplicationAlertsForSubscriptionResponse( + list, nextOffset, subscriptionId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse ApplicationAlertsForSubscriptionResponse 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 ApplicationAlertsForSubscriptionResponse 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)."); + } + + ApplicationAlertsForSubscriptionParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : ApplicationAlertsForSubscriptionParams.builder()) + .offset(nextOffset) + .build(); + + return service.applicationAlertsForSubscription(subscriptionId, 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 "ApplicationAlertsForSubscriptionResponse{" + + "list=" + + list + + ", nextOffset=" + + nextOffset + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + ApplicationAlertsForSubscriptionResponse that = (ApplicationAlertsForSubscriptionResponse) 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 AlertApplicationAlertsForSubscriptionItem { + + private Alert alert; + + public Alert getAlert() { + return alert; + } + + public static AlertApplicationAlertsForSubscriptionItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static AlertApplicationAlertsForSubscriptionItem fromJson(JsonObject jsonObj) { + AlertApplicationAlertsForSubscriptionItem item = + new AlertApplicationAlertsForSubscriptionItem(); + + JsonObject __alertObj = JsonUtil.getJsonObject(jsonObj, "alert"); + if (__alertObj != null) { + item.alert = Alert.fromJson(__alertObj); + } + + return item; + } + + @Override + public String toString() { + return "AlertApplicationAlertsForSubscriptionItem{" + "alert=" + alert + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertApplicationAlertsForSubscriptionItem that = + (AlertApplicationAlertsForSubscriptionItem) o; + return java.util.Objects.equals(alert, that.alert); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(alert); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/alertStatus/AlertStatus.java b/src/main/java/com/chargebee/v4/models/alertStatus/AlertStatus.java index 2ee78822b..b4016e425 100644 --- a/src/main/java/com/chargebee/v4/models/alertStatus/AlertStatus.java +++ b/src/main/java/com/chargebee/v4/models/alertStatus/AlertStatus.java @@ -15,7 +15,7 @@ public class AlertStatus { private String alertId; private String subscriptionId; - private AlertStatusAlertStatus alertStatus; + private AlarmStatus alarmStatus; private Timestamp alarmTriggeredAt; public String getAlertId() { @@ -26,26 +26,24 @@ public String getSubscriptionId() { return subscriptionId; } - public AlertStatusAlertStatus getAlertStatus() { - return alertStatus; + public AlarmStatus getAlarmStatus() { + return alarmStatus; } public Timestamp getAlarmTriggeredAt() { return alarmTriggeredAt; } - public enum AlertStatusAlertStatus { + public enum AlarmStatus { WITHIN_LIMIT("within_limit"), IN_ALARM("in_alarm"), - /** - * An enum member indicating that AlertStatusAlertStatus was instantiated with an unknown value. - */ + /** An enum member indicating that AlarmStatus was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; - AlertStatusAlertStatus(String value) { + AlarmStatus(String value) { this.value = value; } @@ -53,9 +51,9 @@ public String getValue() { return value; } - public static AlertStatusAlertStatus fromString(String value) { + public static AlarmStatus fromString(String value) { if (value == null) return _UNKNOWN; - for (AlertStatusAlertStatus enumValue : AlertStatusAlertStatus.values()) { + for (AlarmStatus enumValue : AlarmStatus.values()) { if (enumValue.value != null && enumValue.value.equals(value)) { return enumValue; } @@ -75,8 +73,7 @@ public static AlertStatus fromJson(JsonObject jsonObj) { obj.subscriptionId = JsonUtil.getString(jsonObj, "subscription_id"); - obj.alertStatus = - AlertStatusAlertStatus.fromString(JsonUtil.getString(jsonObj, "alert_status")); + obj.alarmStatus = AlarmStatus.fromString(JsonUtil.getString(jsonObj, "alarm_status")); obj.alarmTriggeredAt = JsonUtil.getTimestamp(jsonObj, "alarm_triggered_at"); @@ -90,8 +87,8 @@ public String toString() { + alertId + ", subscriptionId=" + subscriptionId - + ", alertStatus=" - + alertStatus + + ", alarmStatus=" + + alarmStatus + ", alarmTriggeredAt=" + alarmTriggeredAt + "}"; @@ -105,13 +102,13 @@ public boolean equals(Object o) { AlertStatus that = (AlertStatus) o; return java.util.Objects.equals(alertId, that.alertId) && java.util.Objects.equals(subscriptionId, that.subscriptionId) - && java.util.Objects.equals(alertStatus, that.alertStatus) + && java.util.Objects.equals(alarmStatus, that.alarmStatus) && java.util.Objects.equals(alarmTriggeredAt, that.alarmTriggeredAt); } @Override public int hashCode() { - return java.util.Objects.hash(alertId, subscriptionId, alertStatus, alarmTriggeredAt); + return java.util.Objects.hash(alertId, subscriptionId, alarmStatus, alarmTriggeredAt); } } diff --git a/src/main/java/com/chargebee/v4/models/alertStatus/params/AlertStatusesForAlertParams.java b/src/main/java/com/chargebee/v4/models/alertStatus/params/AlertStatusesForAlertParams.java new file mode 100644 index 000000000..d20b4c2eb --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alertStatus/params/AlertStatusesForAlertParams.java @@ -0,0 +1,181 @@ +/* + * 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.alertStatus.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.EnumFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class AlertStatusesForAlertParams { + + private final Map queryParams; + + private AlertStatusesForAlertParams(AlertStatusesForAlertBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public AlertStatusesForAlertBuilder toBuilder() { + AlertStatusesForAlertBuilder builder = new AlertStatusesForAlertBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for AlertStatusesForAlertParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AlertStatusesForAlertBuilder builder() { + return new AlertStatusesForAlertBuilder(); + } + + public static final class AlertStatusesForAlertBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private AlertStatusesForAlertBuilder() {} + + public AlertStatusesForAlertBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public AlertStatusesForAlertBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public AlarmStatusFilter alarmStatus() { + return new AlarmStatusFilter("alarm_status", this, queryParams); + } + + public AlertStatusesForAlertParams build() { + return new AlertStatusesForAlertParams(this); + } + + public static final class AlarmStatusFilter + extends EnumFilter { + AlarmStatusFilter( + String fieldName, AlertStatusesForAlertBuilder builder, Map params) { + super(fieldName, builder, params, AlarmStatus::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .alarmStatus().is(AlarmStatus.YOUR_VALUE)}
+ * + * @see #is(AlarmStatus) + */ + @Deprecated + public AlertStatusesForAlertBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .alarmStatus().isNot(AlarmStatus.YOUR_VALUE)}
+ * + * @see #isNot(AlarmStatus) + */ + @Deprecated + public AlertStatusesForAlertBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .alarmStatus().in(AlarmStatus.VALUE1, AlarmStatus.VALUE2)}
+ * + * @see #in(AlarmStatus[]) + */ + @Deprecated + public AlertStatusesForAlertBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .alarmStatus().notIn(AlarmStatus.VALUE1, AlarmStatus.VALUE2)}
+ * + * @see #notIn(AlarmStatus[]) + */ + @Deprecated + public AlertStatusesForAlertBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + } + + public enum AlarmStatusIs { + WITHIN_LIMIT("within_limit"), + + IN_ALARM("in_alarm"), + + /** An enum member indicating that AlarmStatusIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AlarmStatusIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AlarmStatusIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (AlarmStatusIs enumValue : AlarmStatusIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AlarmStatus { + WITHIN_LIMIT("within_limit"), + + IN_ALARM("in_alarm"), + + /** An enum member indicating that AlarmStatus was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AlarmStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AlarmStatus fromString(String value) { + if (value == null) return _UNKNOWN; + for (AlarmStatus enumValue : AlarmStatus.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/alertStatus/params/AlertStatusesForSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/alertStatus/params/AlertStatusesForSubscriptionParams.java new file mode 100644 index 000000000..65a52e0e7 --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alertStatus/params/AlertStatusesForSubscriptionParams.java @@ -0,0 +1,198 @@ +/* + * 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.alertStatus.params; + +import com.chargebee.v4.internal.Recommended; +import com.chargebee.v4.filters.StringFilter; +import com.chargebee.v4.filters.EnumFilter; + +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class AlertStatusesForSubscriptionParams { + + private final Map queryParams; + + private AlertStatusesForSubscriptionParams(AlertStatusesForSubscriptionBuilder builder) { + this.queryParams = Collections.unmodifiableMap(new LinkedHashMap<>(builder.queryParams)); + } + + /** Get the query parameters for this request. */ + public Map toQueryParams() { + return queryParams; + } + + public AlertStatusesForSubscriptionBuilder toBuilder() { + AlertStatusesForSubscriptionBuilder builder = new AlertStatusesForSubscriptionBuilder(); + builder.queryParams.putAll(queryParams); + return builder; + } + + /** Create a new builder for AlertStatusesForSubscriptionParams. */ + @Recommended(reason = "Preferred for reusability, validation, and LLM-friendliness") + public static AlertStatusesForSubscriptionBuilder builder() { + return new AlertStatusesForSubscriptionBuilder(); + } + + public static final class AlertStatusesForSubscriptionBuilder { + private final Map queryParams = new LinkedHashMap<>(); + + private AlertStatusesForSubscriptionBuilder() {} + + public AlertStatusesForSubscriptionBuilder limit(Integer value) { + queryParams.put("limit", value); + return this; + } + + public AlertStatusesForSubscriptionBuilder offset(String value) { + queryParams.put("offset", value); + return this; + } + + public AlarmStatusFilter alarmStatus() { + return new AlarmStatusFilter("alarm_status", this, queryParams); + } + + public AlertIdFilter alertId() { + return new AlertIdFilter("alert_id", this, queryParams); + } + + public AlertStatusesForSubscriptionParams build() { + return new AlertStatusesForSubscriptionParams(this); + } + + public static final class AlarmStatusFilter + extends EnumFilter { + AlarmStatusFilter( + String fieldName, + AlertStatusesForSubscriptionBuilder builder, + Map params) { + super(fieldName, builder, params, AlarmStatus::getValue); + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .alarmStatus().is(AlarmStatus.YOUR_VALUE)}
+ * + * @see #is(AlarmStatus) + */ + @Deprecated + public AlertStatusesForSubscriptionBuilder is(String value) { + params.put(fieldName + "[is]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .alarmStatus().isNot(AlarmStatus.YOUR_VALUE)}
+ * + * @see #isNot(AlarmStatus) + */ + @Deprecated + public AlertStatusesForSubscriptionBuilder isNot(String value) { + params.put(fieldName + "[is_not]", value); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .alarmStatus().in(AlarmStatus.VALUE1, AlarmStatus.VALUE2)}
+ * + * @see #in(AlarmStatus[]) + */ + @Deprecated + public AlertStatusesForSubscriptionBuilder in(String... values) { + params.put(fieldName + "[in]", "[" + String.join(",", values) + "]"); + return builder; + } + + /** + * @deprecated This method accepting raw String will be removed in a future version. Use the + * type-safe enum overload instead: + *
{@code .alarmStatus().notIn(AlarmStatus.VALUE1, AlarmStatus.VALUE2)}
+ * + * @see #notIn(AlarmStatus[]) + */ + @Deprecated + public AlertStatusesForSubscriptionBuilder notIn(String... values) { + params.put(fieldName + "[not_in]", "[" + String.join(",", values) + "]"); + return builder; + } + } + + public static final class AlertIdFilter + extends StringFilter { + AlertIdFilter( + String fieldName, + AlertStatusesForSubscriptionBuilder builder, + Map params) { + super(fieldName, builder, params); + } + } + } + + public enum AlarmStatusIs { + WITHIN_LIMIT("within_limit"), + + IN_ALARM("in_alarm"), + + /** An enum member indicating that AlarmStatusIs was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AlarmStatusIs(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AlarmStatusIs fromString(String value) { + if (value == null) return _UNKNOWN; + for (AlarmStatusIs enumValue : AlarmStatusIs.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } + + public enum AlarmStatus { + WITHIN_LIMIT("within_limit"), + + IN_ALARM("in_alarm"), + + /** An enum member indicating that AlarmStatus was instantiated with an unknown value. */ + _UNKNOWN(null); + private final String value; + + AlarmStatus(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + public static AlarmStatus fromString(String value) { + if (value == null) return _UNKNOWN; + for (AlarmStatus enumValue : AlarmStatus.values()) { + if (enumValue.value != null && enumValue.value.equals(value)) { + return enumValue; + } + } + return _UNKNOWN; + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/alertStatus/responses/AlertStatusesForAlertResponse.java b/src/main/java/com/chargebee/v4/models/alertStatus/responses/AlertStatusesForAlertResponse.java new file mode 100644 index 000000000..7301765cf --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alertStatus/responses/AlertStatusesForAlertResponse.java @@ -0,0 +1,222 @@ +package com.chargebee.v4.models.alertStatus.responses; + +import java.util.List; + +import com.chargebee.v4.models.alertStatus.AlertStatus; + +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.AlertStatusService; +import com.chargebee.v4.models.alertStatus.params.AlertStatusesForAlertParams; + +/** Immutable response object for AlertStatusesForAlert operation. Contains paginated list data. */ +public final class AlertStatusesForAlertResponse { + + private final List list; + + private final String nextOffset; + + private final String alertId; + + private final AlertStatusService service; + private final AlertStatusesForAlertParams originalParams; + private final Response httpResponse; + + private AlertStatusesForAlertResponse( + List list, + String nextOffset, + String alertId, + AlertStatusService service, + AlertStatusesForAlertParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.alertId = alertId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into AlertStatusesForAlertResponse object (no service context). Use this + * when you only need to read a single page (no nextPage()). + */ + public static AlertStatusesForAlertResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + AlertStatusAlertStatusesForAlertItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new AlertStatusesForAlertResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AlertStatusesForAlertResponse from JSON", e); + } + } + + /** + * Parse JSON response into AlertStatusesForAlertResponse object with service context for + * pagination (enables nextPage()). + */ + public static AlertStatusesForAlertResponse fromJson( + String json, + AlertStatusService service, + AlertStatusesForAlertParams originalParams, + String alertId, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + AlertStatusAlertStatusesForAlertItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new AlertStatusesForAlertResponse( + list, nextOffset, alertId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException("Failed to parse AlertStatusesForAlertResponse 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 AlertStatusesForAlertResponse 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)."); + } + + AlertStatusesForAlertParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : AlertStatusesForAlertParams.builder()) + .offset(nextOffset) + .build(); + + return service.alertStatusesForAlert(alertId, 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 "AlertStatusesForAlertResponse{" + "list=" + list + ", nextOffset=" + nextOffset + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertStatusesForAlertResponse that = (AlertStatusesForAlertResponse) 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 AlertStatusAlertStatusesForAlertItem { + + private AlertStatus alertStatus; + + public AlertStatus getAlertStatus() { + return alertStatus; + } + + public static AlertStatusAlertStatusesForAlertItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static AlertStatusAlertStatusesForAlertItem fromJson(JsonObject jsonObj) { + AlertStatusAlertStatusesForAlertItem item = new AlertStatusAlertStatusesForAlertItem(); + + JsonObject __alertStatusObj = JsonUtil.getJsonObject(jsonObj, "alert_status"); + if (__alertStatusObj != null) { + item.alertStatus = AlertStatus.fromJson(__alertStatusObj); + } + + return item; + } + + @Override + public String toString() { + return "AlertStatusAlertStatusesForAlertItem{" + "alertStatus=" + alertStatus + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertStatusAlertStatusesForAlertItem that = (AlertStatusAlertStatusesForAlertItem) o; + return java.util.Objects.equals(alertStatus, that.alertStatus); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(alertStatus); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/alertStatus/responses/AlertStatusesForSubscriptionResponse.java b/src/main/java/com/chargebee/v4/models/alertStatus/responses/AlertStatusesForSubscriptionResponse.java new file mode 100644 index 000000000..86732061d --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/alertStatus/responses/AlertStatusesForSubscriptionResponse.java @@ -0,0 +1,234 @@ +package com.chargebee.v4.models.alertStatus.responses; + +import java.util.List; + +import com.chargebee.v4.models.alertStatus.AlertStatus; + +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.AlertStatusService; +import com.chargebee.v4.models.alertStatus.params.AlertStatusesForSubscriptionParams; + +/** + * Immutable response object for AlertStatusesForSubscription operation. Contains paginated list + * data. + */ +public final class AlertStatusesForSubscriptionResponse { + + private final List list; + + private final String nextOffset; + + private final String subscriptionId; + + private final AlertStatusService service; + private final AlertStatusesForSubscriptionParams originalParams; + private final Response httpResponse; + + private AlertStatusesForSubscriptionResponse( + List list, + String nextOffset, + String subscriptionId, + AlertStatusService service, + AlertStatusesForSubscriptionParams originalParams, + Response httpResponse) { + + this.list = list; + + this.nextOffset = nextOffset; + + this.subscriptionId = subscriptionId; + + this.service = service; + this.originalParams = originalParams; + this.httpResponse = httpResponse; + } + + /** + * Parse JSON response into AlertStatusesForSubscriptionResponse object (no service context). Use + * this when you only need to read a single page (no nextPage()). + */ + public static AlertStatusesForSubscriptionResponse fromJson(String json) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + AlertStatusAlertStatusesForSubscriptionItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new AlertStatusesForSubscriptionResponse(list, nextOffset, null, null, null, null); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse AlertStatusesForSubscriptionResponse from JSON", e); + } + } + + /** + * Parse JSON response into AlertStatusesForSubscriptionResponse object with service context for + * pagination (enables nextPage()). + */ + public static AlertStatusesForSubscriptionResponse fromJson( + String json, + AlertStatusService service, + AlertStatusesForSubscriptionParams originalParams, + String subscriptionId, + Response httpResponse) { + try { + JsonObject jsonObj = JsonUtil.parse(json); + + List list = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "list"), + AlertStatusAlertStatusesForSubscriptionItem::fromJson); + + String nextOffset = JsonUtil.getString(jsonObj, "next_offset"); + + return new AlertStatusesForSubscriptionResponse( + list, nextOffset, subscriptionId, service, originalParams, httpResponse); + } catch (Exception e) { + throw new RuntimeException( + "Failed to parse AlertStatusesForSubscriptionResponse 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 AlertStatusesForSubscriptionResponse 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)."); + } + + AlertStatusesForSubscriptionParams nextParams = + (originalParams != null + ? originalParams.toBuilder() + : AlertStatusesForSubscriptionParams.builder()) + .offset(nextOffset) + .build(); + + return service.alertStatusesForSubscription(subscriptionId, 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 "AlertStatusesForSubscriptionResponse{" + + "list=" + + list + + ", nextOffset=" + + nextOffset + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertStatusesForSubscriptionResponse that = (AlertStatusesForSubscriptionResponse) 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 AlertStatusAlertStatusesForSubscriptionItem { + + private AlertStatus alertStatus; + + public AlertStatus getAlertStatus() { + return alertStatus; + } + + public static AlertStatusAlertStatusesForSubscriptionItem fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static AlertStatusAlertStatusesForSubscriptionItem fromJson(JsonObject jsonObj) { + AlertStatusAlertStatusesForSubscriptionItem item = + new AlertStatusAlertStatusesForSubscriptionItem(); + + JsonObject __alertStatusObj = JsonUtil.getJsonObject(jsonObj, "alert_status"); + if (__alertStatusObj != null) { + item.alertStatus = AlertStatus.fromJson(__alertStatusObj); + } + + return item; + } + + @Override + public String toString() { + return "AlertStatusAlertStatusesForSubscriptionItem{" + "alertStatus=" + alertStatus + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + AlertStatusAlertStatusesForSubscriptionItem that = + (AlertStatusAlertStatusesForSubscriptionItem) o; + return java.util.Objects.equals(alertStatus, that.alertStatus); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash(alertStatus); + } + } +} diff --git a/src/main/java/com/chargebee/v4/models/card/Card.java b/src/main/java/com/chargebee/v4/models/card/Card.java index 6ab493f67..455083ae8 100644 --- a/src/main/java/com/chargebee/v4/models/card/Card.java +++ b/src/main/java/com/chargebee/v4/models/card/Card.java @@ -301,6 +301,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ @@ -367,6 +371,8 @@ public enum CardType { CARTES_BANCAIRES("cartes_bancaires"), + MADA("mada"), + OTHER("other"), NOT_APPLICABLE("not_applicable"), diff --git a/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java b/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java index 4ce45383b..ae1441218 100644 --- a/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java +++ b/src/main/java/com/chargebee/v4/models/card/params/CardSwitchGatewayForCustomerParams.java @@ -184,6 +184,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java b/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java index c25cb0668..6c4c9b266 100644 --- a/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java +++ b/src/main/java/com/chargebee/v4/models/card/params/UpdateCardForCustomerParams.java @@ -541,6 +541,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/customer/Customer.java b/src/main/java/com/chargebee/v4/models/customer/Customer.java index 3d6ad6ea7..b5134aa73 100644 --- a/src/main/java/com/chargebee/v4/models/customer/Customer.java +++ b/src/main/java/com/chargebee/v4/models/customer/Customer.java @@ -2107,6 +2107,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2247,6 +2261,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java index cb5944975..d0f51ce2a 100644 --- a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCollectPaymentParams.java @@ -560,6 +560,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1197,6 +1211,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java index fb3fccd22..06478d645 100644 --- a/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerCreateParams.java @@ -1816,6 +1816,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2569,6 +2573,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2707,6 +2725,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2966,6 +2988,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java index 15fd4af70..d72334df0 100644 --- a/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java +++ b/src/main/java/com/chargebee/v4/models/customer/params/CustomerUpdatePaymentMethodParams.java @@ -370,6 +370,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -508,6 +522,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; 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 b10179b6d..22469fb15 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 { + ExcludeFilter(String fieldName, InvoiceListBuilder builder, Map params) { + super(fieldName, builder, params); + } + } + public static final class SortBySortBuilder { private final String fieldName; private final InvoiceListBuilder builder; 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 c1cfae200..9bbfdfe53 100644 --- a/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java +++ b/src/main/java/com/chargebee/v4/models/paymentIntent/PaymentIntent.java @@ -211,6 +211,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -543,6 +557,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ @@ -1020,6 +1048,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ 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 7a3d0d97a..30083e666 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 @@ -25,6 +25,8 @@ public final class PaymentIntentCreateParams { private final String referenceId; + private final Boolean deferPaymentMethodType; + private final PaymentMethodType paymentMethodType; private final String successUrl; @@ -45,6 +47,8 @@ private PaymentIntentCreateParams(PaymentIntentCreateBuilder builder) { this.referenceId = builder.referenceId; + this.deferPaymentMethodType = builder.deferPaymentMethodType; + this.paymentMethodType = builder.paymentMethodType; this.successUrl = builder.successUrl; @@ -76,6 +80,10 @@ public String getReferenceId() { return referenceId; } + public Boolean getDeferPaymentMethodType() { + return deferPaymentMethodType; + } + public PaymentMethodType getPaymentMethodType() { return paymentMethodType; } @@ -122,6 +130,11 @@ public Map toFormData() { formData.put("reference_id", this.referenceId); } + if (this.deferPaymentMethodType != null) { + + formData.put("defer_payment_method_type", this.deferPaymentMethodType); + } + if (this.paymentMethodType != null) { formData.put("payment_method_type", this.paymentMethodType); @@ -160,6 +173,8 @@ public static final class PaymentIntentCreateBuilder { private String referenceId; + private Boolean deferPaymentMethodType; + private PaymentMethodType paymentMethodType; private String successUrl; @@ -198,6 +213,11 @@ public PaymentIntentCreateBuilder referenceId(String value) { return this; } + public PaymentIntentCreateBuilder deferPaymentMethodType(Boolean value) { + this.deferPaymentMethodType = value; + return this; + } + public PaymentIntentCreateBuilder paymentMethodType(PaymentMethodType value) { this.paymentMethodType = value; return this; @@ -285,6 +305,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; 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 f9d25b367..df679c19d 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 @@ -225,6 +225,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; 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 461c61db0..b3a4e4e3f 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/PaymentSource.java @@ -206,6 +206,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -380,6 +394,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ @@ -733,6 +751,8 @@ public enum Brand { CARTES_BANCAIRES("cartes_bancaires"), + MADA("mada"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Brand was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java index 5710f4144..7e15f4ad8 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPaymentIntentParams.java @@ -360,6 +360,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java index 4362b857b..dc26ba462 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingPermanentTokenParams.java @@ -404,6 +404,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -617,6 +631,8 @@ public enum Brand { CARTES_BANCAIRES("cartes_bancaires"), + MADA("mada"), + /** An enum member indicating that Brand was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java index e74fe110c..7a3f44d9c 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceCreateUsingTempTokenParams.java @@ -252,6 +252,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java index 7a1005ddd..fc06d7d4e 100644 --- a/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java +++ b/src/main/java/com/chargebee/v4/models/paymentSource/params/PaymentSourceListParams.java @@ -343,6 +343,20 @@ public enum TypeIs { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that TypeIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -437,6 +451,20 @@ public enum TypeIsNot { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that TypeIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -531,6 +559,20 @@ public enum TypeIn { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that TypeIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -625,6 +667,20 @@ public enum TypeNotIn { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that TypeNotIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -911,6 +967,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java b/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java index 9690451f5..b8f92654d 100644 --- a/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java +++ b/src/main/java/com/chargebee/v4/models/paymentVoucher/PaymentVoucher.java @@ -290,6 +290,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java b/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java index 9d94f3c6f..2101c4976 100644 --- a/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/purchase/params/PurchaseCreateParams.java @@ -799,6 +799,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuoteCreateForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteCreateForChargeItemsAndChargesParams.java index 16c994c76..7a9d5c19f 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/QuoteCreateForChargeItemsAndChargesParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteCreateForChargeItemsAndChargesParams.java @@ -31,6 +31,8 @@ public final class QuoteCreateForChargeItemsAndChargesParams { private final List couponIds; + private final Integer netTermDays; + private final BillingAddressParams billingAddress; private final ShippingAddressParams shippingAddress; @@ -64,6 +66,8 @@ private QuoteCreateForChargeItemsAndChargesParams( this.couponIds = builder.couponIds; + this.netTermDays = builder.netTermDays; + this.billingAddress = builder.billingAddress; this.shippingAddress = builder.shippingAddress; @@ -111,6 +115,10 @@ public List getCouponIds() { return couponIds; } + public Integer getNetTermDays() { + return netTermDays; + } + public BillingAddressParams getBillingAddress() { return billingAddress; } @@ -183,6 +191,11 @@ public Map toFormData() { formData.put("coupon_ids", this.couponIds); } + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + if (this.billingAddress != null) { // Single object @@ -305,6 +318,8 @@ public static final class QuoteCreateForChargeItemsAndChargesBuilder { private List couponIds; + private Integer netTermDays; + private BillingAddressParams billingAddress; private ShippingAddressParams shippingAddress; @@ -361,6 +376,11 @@ public QuoteCreateForChargeItemsAndChargesBuilder couponIds(List value) return this; } + public QuoteCreateForChargeItemsAndChargesBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + public QuoteCreateForChargeItemsAndChargesBuilder billingAddress(BillingAddressParams value) { this.billingAddress = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/quote/params/QuoteEditForChargeItemsAndChargesParams.java b/src/main/java/com/chargebee/v4/models/quote/params/QuoteEditForChargeItemsAndChargesParams.java index d365306a5..d567dd5e9 100644 --- a/src/main/java/com/chargebee/v4/models/quote/params/QuoteEditForChargeItemsAndChargesParams.java +++ b/src/main/java/com/chargebee/v4/models/quote/params/QuoteEditForChargeItemsAndChargesParams.java @@ -27,6 +27,8 @@ public final class QuoteEditForChargeItemsAndChargesParams { private final List couponIds; + private final Integer netTermDays; + private final BillingAddressParams billingAddress; private final ShippingAddressParams shippingAddress; @@ -56,6 +58,8 @@ private QuoteEditForChargeItemsAndChargesParams( this.couponIds = builder.couponIds; + this.netTermDays = builder.netTermDays; + this.billingAddress = builder.billingAddress; this.shippingAddress = builder.shippingAddress; @@ -95,6 +99,10 @@ public List getCouponIds() { return couponIds; } + public Integer getNetTermDays() { + return netTermDays; + } + public BillingAddressParams getBillingAddress() { return billingAddress; } @@ -157,6 +165,11 @@ public Map toFormData() { formData.put("coupon_ids", this.couponIds); } + if (this.netTermDays != null) { + + formData.put("net_term_days", this.netTermDays); + } + if (this.billingAddress != null) { // Single object @@ -275,6 +288,8 @@ public static final class QuoteEditForChargeItemsAndChargesBuilder { private List couponIds; + private Integer netTermDays; + private BillingAddressParams billingAddress; private ShippingAddressParams shippingAddress; @@ -321,6 +336,11 @@ public QuoteEditForChargeItemsAndChargesBuilder couponIds(List value) { return this; } + public QuoteEditForChargeItemsAndChargesBuilder netTermDays(Integer value) { + this.netTermDays = value; + return this; + } + public QuoteEditForChargeItemsAndChargesBuilder billingAddress(BillingAddressParams value) { this.billingAddress = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/quoteEntitlement/QuoteEntitlement.java b/src/main/java/com/chargebee/v4/models/quoteEntitlement/QuoteEntitlement.java new file mode 100644 index 000000000..b5adb29db --- /dev/null +++ b/src/main/java/com/chargebee/v4/models/quoteEntitlement/QuoteEntitlement.java @@ -0,0 +1,177 @@ +/* + * 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; + +import com.chargebee.v4.internal.JsonUtil; +import com.google.gson.JsonObject; +import java.sql.Timestamp; + +public class QuoteEntitlement { + + private String entityId; + private EntityType entityType; + private String featureId; + private String value; + private Boolean isEnabled; + private Timestamp startDate; + private Timestamp endDate; + private Timestamp createdAt; + private Timestamp modifiedAt; + + public String getEntityId() { + return entityId; + } + + public EntityType getEntityType() { + return entityType; + } + + public String getFeatureId() { + return featureId; + } + + public String getValue() { + return value; + } + + public Boolean getIsEnabled() { + return isEnabled; + } + + public Timestamp getStartDate() { + return startDate; + } + + public Timestamp getEndDate() { + return endDate; + } + + public Timestamp getCreatedAt() { + return createdAt; + } + + public Timestamp getModifiedAt() { + return modifiedAt; + } + + 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; + } + } + + public static QuoteEntitlement fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static QuoteEntitlement fromJson(JsonObject jsonObj) { + QuoteEntitlement obj = new QuoteEntitlement(); + + obj.entityId = JsonUtil.getString(jsonObj, "entity_id"); + + obj.entityType = EntityType.fromString(JsonUtil.getString(jsonObj, "entity_type")); + + obj.featureId = JsonUtil.getString(jsonObj, "feature_id"); + + obj.value = JsonUtil.getString(jsonObj, "value"); + + obj.isEnabled = JsonUtil.getBoolean(jsonObj, "is_enabled"); + + obj.startDate = JsonUtil.getTimestamp(jsonObj, "start_date"); + + obj.endDate = JsonUtil.getTimestamp(jsonObj, "end_date"); + + obj.createdAt = JsonUtil.getTimestamp(jsonObj, "created_at"); + + obj.modifiedAt = JsonUtil.getTimestamp(jsonObj, "modified_at"); + + return obj; + } + + @Override + public String toString() { + return "QuoteEntitlement{" + + "entityId=" + + entityId + + ", entityType=" + + entityType + + ", featureId=" + + featureId + + ", value=" + + value + + ", isEnabled=" + + isEnabled + + ", startDate=" + + startDate + + ", endDate=" + + endDate + + ", createdAt=" + + createdAt + + ", modifiedAt=" + + modifiedAt + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + QuoteEntitlement that = (QuoteEntitlement) o; + return java.util.Objects.equals(entityId, that.entityId) + && java.util.Objects.equals(entityType, that.entityType) + && 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); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + entityId, + entityType, + featureId, + value, + isEnabled, + startDate, + endDate, + createdAt, + modifiedAt); + } +} 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 3d48cea1b..2fe4523fb 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 StatusIs { + public enum StatusIn { SCHEDULED("scheduled"), SUCCEEDED("succeeded"), @@ -211,11 +211,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; } @@ -223,9 +223,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; } @@ -234,7 +234,7 @@ public static StatusIs fromString(String value) { } } - public enum StatusIn { + public enum StatusIs { SCHEDULED("scheduled"), SUCCEEDED("succeeded"), @@ -243,11 +243,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; } @@ -255,9 +255,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; } diff --git a/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java b/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java index 6e90e3e9e..2ef1ae00b 100644 --- a/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java +++ b/src/main/java/com/chargebee/v4/models/salesOrder/SalesOrder.java @@ -44,6 +44,7 @@ public class SalesOrder { private BillingConfiguration billingConfiguration; private RenewalTerm renewalTerm; private List creditLines; + private List entitlementOverrides; public String getId() { return id; @@ -164,6 +165,10 @@ public List getCreditLines() { return creditLines; } + public List getEntitlementOverrides() { + return entitlementOverrides; + } + public enum Status { ACTIVE("active"), @@ -287,6 +292,11 @@ public static SalesOrder fromJson(JsonObject jsonObj) { obj.creditLines = JsonUtil.mapArray(JsonUtil.getJsonArray(jsonObj, "credit_lines"), CreditLines::fromJson); + obj.entitlementOverrides = + JsonUtil.mapArray( + JsonUtil.getJsonArray(jsonObj, "entitlement_overrides"), + EntitlementOverrides::fromJson); + return obj; } @@ -351,6 +361,8 @@ public String toString() { + renewalTerm + ", creditLines=" + creditLines + + ", entitlementOverrides=" + + entitlementOverrides + "}"; } @@ -388,7 +400,8 @@ public boolean equals(Object o) { && java.util.Objects.equals(paymentConfiguration, that.paymentConfiguration) && java.util.Objects.equals(billingConfiguration, that.billingConfiguration) && java.util.Objects.equals(renewalTerm, that.renewalTerm) - && java.util.Objects.equals(creditLines, that.creditLines); + && java.util.Objects.equals(creditLines, that.creditLines) + && java.util.Objects.equals(entitlementOverrides, that.entitlementOverrides); } @Override @@ -423,7 +436,8 @@ public int hashCode() { paymentConfiguration, billingConfiguration, renewalTerm, - creditLines); + creditLines, + entitlementOverrides); } public static class LineItems { @@ -2177,4 +2191,147 @@ public int hashCode() { return java.util.Objects.hash(amount, unitPrice, quantity, lineItemAssociationId); } } + + public static class EntitlementOverrides { + + private String id; + private String featureId; + private String entityId; + private EntityType entityType; + private String value; + private Boolean isEnabled; + private Timestamp startDate; + private Timestamp endDate; + + public String getId() { + return id; + } + + 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; + } + + public enum EntityType { + ITEM_PRICE("item_price"), + + SUBSCRIPTION("subscription"), + + /** 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; + } + } + + public static EntitlementOverrides fromJson(String json) { + return fromJson(JsonUtil.parse(json)); + } + + public static EntitlementOverrides fromJson(JsonObject jsonObj) { + EntitlementOverrides obj = new EntitlementOverrides(); + + obj.id = JsonUtil.getString(jsonObj, "id"); + + obj.featureId = JsonUtil.getString(jsonObj, "feature_id"); + + obj.entityId = JsonUtil.getString(jsonObj, "entity_id"); + + obj.entityType = EntityType.fromString(JsonUtil.getString(jsonObj, "entity_type")); + + obj.value = JsonUtil.getString(jsonObj, "value"); + + obj.isEnabled = JsonUtil.getBoolean(jsonObj, "is_enabled"); + + obj.startDate = JsonUtil.getTimestamp(jsonObj, "start_date"); + + obj.endDate = JsonUtil.getTimestamp(jsonObj, "end_date"); + + return obj; + } + + @Override + public String toString() { + return "EntitlementOverrides{" + + "id=" + + id + + ", featureId=" + + featureId + + ", entityId=" + + entityId + + ", entityType=" + + entityType + + ", value=" + + value + + ", isEnabled=" + + isEnabled + + ", startDate=" + + startDate + + ", endDate=" + + endDate + + "}"; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + EntitlementOverrides that = (EntitlementOverrides) o; + return java.util.Objects.equals(id, that.id) + && java.util.Objects.equals(featureId, that.featureId) + && java.util.Objects.equals(entityId, that.entityId) + && java.util.Objects.equals(entityType, that.entityType) + && 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); + } + + @Override + public int hashCode() { + + return java.util.Objects.hash( + id, featureId, entityId, entityType, value, isEnabled, startDate, endDate); + } + } } diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/ImportSubscriptionParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/ImportSubscriptionParams.java index d9ffd9aad..2ab462f75 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/ImportSubscriptionParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/ImportSubscriptionParams.java @@ -2343,6 +2343,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2616,6 +2620,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2754,6 +2772,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java index f635af81a..0ff8b4173 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateForCustomerParams.java @@ -1713,6 +1713,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java index d9463c479..5deffb45c 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateParams.java @@ -2683,6 +2683,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3436,6 +3440,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3574,6 +3592,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -3833,6 +3855,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java index 0d8a6ed44..48cb9d2aa 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionCreateWithItemsParams.java @@ -1768,6 +1768,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java index b8e5a1364..476baf31a 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionReactivateParams.java @@ -756,6 +756,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java index 2359d21e4..b7c6b2acd 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionResumeParams.java @@ -514,6 +514,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java index 2aa9a26e5..187bac6dc 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateForItemsParams.java @@ -1920,6 +1920,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2213,6 +2217,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2351,6 +2369,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2610,6 +2632,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java index 9eae3bd18..2baa98ba3 100644 --- a/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java +++ b/src/main/java/com/chargebee/v4/models/subscription/params/SubscriptionUpdateParams.java @@ -1835,6 +1835,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2128,6 +2132,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2266,6 +2284,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + /** An enum member indicating that Gateway was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2525,6 +2547,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** * An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java b/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java index 9efc3e028..7272f9368 100644 --- a/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java +++ b/src/main/java/com/chargebee/v4/models/thirdPartyPaymentMethod/ThirdPartyPaymentMethod.java @@ -104,6 +104,20 @@ public enum Type { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that Type was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -244,6 +258,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/token/Token.java b/src/main/java/com/chargebee/v4/models/token/Token.java index 8802e0b38..0b0dbeda4 100644 --- a/src/main/java/com/chargebee/v4/models/token/Token.java +++ b/src/main/java/com/chargebee/v4/models/token/Token.java @@ -191,6 +191,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ @@ -287,6 +291,20 @@ public enum PaymentMethodType { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that PaymentMethodType was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; diff --git a/src/main/java/com/chargebee/v4/models/transaction/Transaction.java b/src/main/java/com/chargebee/v4/models/transaction/Transaction.java index 01cd99331..7bb4d4139 100644 --- a/src/main/java/com/chargebee/v4/models/transaction/Transaction.java +++ b/src/main/java/com/chargebee/v4/models/transaction/Transaction.java @@ -337,6 +337,20 @@ public enum PaymentMethod { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -477,6 +491,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java index c1a6782ee..97b22437b 100644 --- a/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java +++ b/src/main/java/com/chargebee/v4/models/transaction/params/TransactionListParams.java @@ -662,6 +662,20 @@ public enum PaymentMethodIs { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that PaymentMethodIs was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -776,6 +790,20 @@ public enum PaymentMethodIsNot { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that PaymentMethodIsNot was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -890,6 +918,20 @@ public enum PaymentMethodIn { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that PaymentMethodIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1004,6 +1046,20 @@ public enum PaymentMethodNotIn { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that PaymentMethodNotIn was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -1144,6 +1200,10 @@ public enum GatewayIs { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayIs was instantiated with an unknown value. */ @@ -1286,6 +1346,10 @@ public enum GatewayIsNot { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayIsNot was instantiated with an unknown value. */ @@ -1428,6 +1492,10 @@ public enum GatewayIn { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayIn was instantiated with an unknown value. */ @@ -1570,6 +1638,10 @@ public enum GatewayNotIn { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that GatewayNotIn was instantiated with an unknown value. */ @@ -2053,6 +2125,20 @@ public enum PaymentMethod { PIX("pix"), + TWINT("twint"), + + GO_PAY("go_pay"), + + GRAB_PAY("grab_pay"), + + PAY_CO("pay_co"), + + AFTER_PAY("after_pay"), + + SWISH("swish"), + + PAYME("payme"), + /** An enum member indicating that PaymentMethod was instantiated with an unknown value. */ _UNKNOWN(null); private final String value; @@ -2193,6 +2279,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java index b0bb3c1e9..d8d7b04dd 100644 --- a/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/VirtualBankAccount.java @@ -244,6 +244,10 @@ public enum Gateway { TEMPUS("tempus"), + MOYASAR("moyasar"), + + PAYWAY("payway"), + NOT_APPLICABLE("not_applicable"), /** An enum member indicating that Gateway was instantiated with an unknown value. */ diff --git a/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateParams.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateParams.java index 4adb9a132..c438c6300 100644 --- a/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateParams.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateParams.java @@ -17,6 +17,8 @@ public final class VirtualBankAccountCreateParams { private final String email; + private final String gatewayAccountId; + private final Scheme scheme; private VirtualBankAccountCreateParams(VirtualBankAccountCreateBuilder builder) { @@ -25,6 +27,8 @@ private VirtualBankAccountCreateParams(VirtualBankAccountCreateBuilder builder) this.email = builder.email; + this.gatewayAccountId = builder.gatewayAccountId; + this.scheme = builder.scheme; } @@ -36,6 +40,10 @@ public String getEmail() { return email; } + public String getGatewayAccountId() { + return gatewayAccountId; + } + public Scheme getScheme() { return scheme; } @@ -54,6 +62,11 @@ public Map toFormData() { formData.put("email", this.email); } + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + if (this.scheme != null) { formData.put("scheme", this.scheme); @@ -74,6 +87,8 @@ public static final class VirtualBankAccountCreateBuilder { private String email; + private String gatewayAccountId; + private Scheme scheme; private VirtualBankAccountCreateBuilder() {} @@ -88,6 +103,11 @@ public VirtualBankAccountCreateBuilder email(String value) { return this; } + public VirtualBankAccountCreateBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + public VirtualBankAccountCreateBuilder scheme(Scheme value) { this.scheme = value; return this; diff --git a/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateUsingPermanentTokenParams.java b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateUsingPermanentTokenParams.java index ff7dbdd2c..2d291f54f 100644 --- a/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateUsingPermanentTokenParams.java +++ b/src/main/java/com/chargebee/v4/models/virtualBankAccount/params/VirtualBankAccountCreateUsingPermanentTokenParams.java @@ -17,6 +17,8 @@ public final class VirtualBankAccountCreateUsingPermanentTokenParams { private final String referenceId; + private final String gatewayAccountId; + private final Scheme scheme; private VirtualBankAccountCreateUsingPermanentTokenParams( @@ -26,6 +28,8 @@ private VirtualBankAccountCreateUsingPermanentTokenParams( this.referenceId = builder.referenceId; + this.gatewayAccountId = builder.gatewayAccountId; + this.scheme = builder.scheme; } @@ -37,6 +41,10 @@ public String getReferenceId() { return referenceId; } + public String getGatewayAccountId() { + return gatewayAccountId; + } + public Scheme getScheme() { return scheme; } @@ -55,6 +63,11 @@ public Map toFormData() { formData.put("reference_id", this.referenceId); } + if (this.gatewayAccountId != null) { + + formData.put("gateway_account_id", this.gatewayAccountId); + } + if (this.scheme != null) { formData.put("scheme", this.scheme); @@ -75,6 +88,8 @@ public static final class VirtualBankAccountCreateUsingPermanentTokenBuilder { private String referenceId; + private String gatewayAccountId; + private Scheme scheme; private VirtualBankAccountCreateUsingPermanentTokenBuilder() {} @@ -89,6 +104,11 @@ public VirtualBankAccountCreateUsingPermanentTokenBuilder referenceId(String val return this; } + public VirtualBankAccountCreateUsingPermanentTokenBuilder gatewayAccountId(String value) { + this.gatewayAccountId = value; + return this; + } + public VirtualBankAccountCreateUsingPermanentTokenBuilder scheme(Scheme value) { this.scheme = value; return this; diff --git a/src/main/java/com/chargebee/v4/services/AlertService.java b/src/main/java/com/chargebee/v4/services/AlertService.java new file mode 100644 index 000000000..ad1fee4f9 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/AlertService.java @@ -0,0 +1,317 @@ +/* + * 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.alert.params.ApplicationAlertsForSubscriptionParams; + +import com.chargebee.v4.models.alert.params.AlertUpdateParams; + +import com.chargebee.v4.models.alert.params.AlertListParams; + +import com.chargebee.v4.models.alert.params.AlertCreateParams; + +import com.chargebee.v4.models.alert.responses.ApplicationAlertsForSubscriptionResponse; + +import com.chargebee.v4.models.alert.responses.AlertRetrieveResponse; + +import com.chargebee.v4.models.alert.responses.AlertUpdateResponse; + +import com.chargebee.v4.models.alert.responses.AlertDeleteResponse; + +import com.chargebee.v4.models.alert.responses.AlertListResponse; + +import com.chargebee.v4.models.alert.responses.AlertCreateResponse; + +public final class AlertService extends BaseService { + + private final ServiceConfig config; + + public AlertService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private AlertService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private AlertService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + AlertService with(RequestOptions newOptions) { + return new AlertService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public AlertService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * applicationAlertsForSubscription a alert using immutable params (executes immediately) - + * returns raw Response. + */ + Response applicationAlertsForSubscriptionRaw( + String subscriptionId, ApplicationAlertsForSubscriptionParams params) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/applicable_alerts", + "subscription-id", + subscriptionId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * applicationAlertsForSubscription a alert without params (executes immediately) - returns raw + * Response. + */ + Response applicationAlertsForSubscriptionRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/applicable_alerts", + "subscription-id", + subscriptionId); + return get(path, null); + } + + /** + * applicationAlertsForSubscription a alert using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response applicationAlertsForSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/applicable_alerts", + "subscription-id", + subscriptionId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public ApplicationAlertsForSubscriptionResponse applicationAlertsForSubscription( + String subscriptionId, ApplicationAlertsForSubscriptionParams params) + throws ChargebeeException { + Response response = applicationAlertsForSubscriptionRaw(subscriptionId, params); + return ApplicationAlertsForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, params, subscriptionId, response); + } + + public ApplicationAlertsForSubscriptionResponse applicationAlertsForSubscription( + String subscriptionId) throws ChargebeeException { + Response response = applicationAlertsForSubscriptionRaw(subscriptionId); + return ApplicationAlertsForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, null, subscriptionId, response); + } + + /** Async variant of applicationAlertsForSubscription for alert with params. */ + public CompletableFuture + applicationAlertsForSubscriptionAsync( + String subscriptionId, ApplicationAlertsForSubscriptionParams params) { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/applicable_alerts", + "subscription-id", + subscriptionId); + return getAsync(path, params != null ? params.toQueryParams() : null) + .thenApply( + response -> + ApplicationAlertsForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, params, subscriptionId, response)); + } + + /** Async variant of applicationAlertsForSubscription for alert without params. */ + public CompletableFuture + applicationAlertsForSubscriptionAsync(String subscriptionId) { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/applicable_alerts", + "subscription-id", + subscriptionId); + return getAsync(path, null) + .thenApply( + response -> + ApplicationAlertsForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, null, subscriptionId, response)); + } + + /** retrieve a alert (executes immediately) - returns raw Response. */ + Response retrieveRaw(String alertId) throws ChargebeeException { + String path = buildPathWithParams("/alerts/{alert-id}", "alert-id", alertId); + + return get(path, null); + } + + public AlertRetrieveResponse retrieve(String alertId) throws ChargebeeException { + Response response = retrieveRaw(alertId); + return AlertRetrieveResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of retrieve for alert without params. */ + public CompletableFuture retrieveAsync(String alertId) { + String path = buildPathWithParams("/alerts/{alert-id}", "alert-id", alertId); + + return getAsync(path, null) + .thenApply( + response -> AlertRetrieveResponse.fromJson(response.getBodyAsString(), response)); + } + + /** update a alert (executes immediately) - returns raw Response. */ + Response updateRaw(String alertId) throws ChargebeeException { + String path = buildPathWithParams("/alerts/{alert-id}", "alert-id", alertId); + + return post(path, null); + } + + /** update a alert using immutable params (executes immediately) - returns raw Response. */ + Response updateRaw(String alertId, AlertUpdateParams params) throws ChargebeeException { + String path = buildPathWithParams("/alerts/{alert-id}", "alert-id", alertId); + return post(path, params.toFormData()); + } + + /** update a alert using raw JSON payload (executes immediately) - returns raw Response. */ + Response updateRaw(String alertId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/alerts/{alert-id}", "alert-id", alertId); + return postJson(path, jsonPayload); + } + + public AlertUpdateResponse update(String alertId, AlertUpdateParams params) + throws ChargebeeException { + Response response = updateRaw(alertId, params); + return AlertUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of update for alert with params. */ + public CompletableFuture updateAsync( + String alertId, AlertUpdateParams params) { + String path = buildPathWithParams("/alerts/{alert-id}", "alert-id", alertId); + return postAsync(path, params.toFormData()) + .thenApply(response -> AlertUpdateResponse.fromJson(response.getBodyAsString(), response)); + } + + public AlertUpdateResponse update(String alertId) throws ChargebeeException { + Response response = updateRaw(alertId); + return AlertUpdateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of update for alert without params. */ + public CompletableFuture updateAsync(String alertId) { + String path = buildPathWithParams("/alerts/{alert-id}", "alert-id", alertId); + + return postAsync(path, null) + .thenApply(response -> AlertUpdateResponse.fromJson(response.getBodyAsString(), response)); + } + + /** delete a alert (executes immediately) - returns raw Response. */ + Response deleteRaw(String alertId) throws ChargebeeException { + String path = buildPathWithParams("/alerts/{alert-id}/delete", "alert-id", alertId); + + return post(path, null); + } + + public AlertDeleteResponse delete(String alertId) throws ChargebeeException { + Response response = deleteRaw(alertId); + return AlertDeleteResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of delete for alert without params. */ + public CompletableFuture deleteAsync(String alertId) { + String path = buildPathWithParams("/alerts/{alert-id}/delete", "alert-id", alertId); + + return postAsync(path, null) + .thenApply(response -> AlertDeleteResponse.fromJson(response.getBodyAsString(), response)); + } + + /** list a alert using immutable params (executes immediately) - returns raw Response. */ + Response listRaw(AlertListParams params) throws ChargebeeException { + + return get("/alerts", params != null ? params.toQueryParams() : null); + } + + /** list a alert without params (executes immediately) - returns raw Response. */ + Response listRaw() throws ChargebeeException { + + return get("/alerts", null); + } + + /** list a alert using raw JSON payload (executes immediately) - returns raw Response. */ + Response listRaw(String jsonPayload) throws ChargebeeException { + + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public AlertListResponse list(AlertListParams params) throws ChargebeeException { + Response response = listRaw(params); + + return AlertListResponse.fromJson(response.getBodyAsString(), this, params, response); + } + + /** Async variant of list for alert with params. */ + public CompletableFuture listAsync(AlertListParams params) { + + return getAsync("/alerts", params != null ? params.toQueryParams() : null) + .thenApply( + response -> + AlertListResponse.fromJson(response.getBodyAsString(), this, params, response)); + } + + public AlertListResponse list() throws ChargebeeException { + Response response = listRaw(); + + return AlertListResponse.fromJson(response.getBodyAsString(), this, null, response); + } + + /** Async variant of list for alert without params. */ + public CompletableFuture listAsync() { + + return getAsync("/alerts", null) + .thenApply( + response -> + AlertListResponse.fromJson(response.getBodyAsString(), this, null, response)); + } + + /** create a alert using immutable params (executes immediately) - returns raw Response. */ + Response createRaw(AlertCreateParams params) throws ChargebeeException { + + return post("/alerts", params != null ? params.toFormData() : null); + } + + /** create a alert using raw JSON payload (executes immediately) - returns raw Response. */ + Response createRaw(String jsonPayload) throws ChargebeeException { + + return postJson("/alerts", jsonPayload); + } + + public AlertCreateResponse create(AlertCreateParams params) throws ChargebeeException { + Response response = createRaw(params); + + return AlertCreateResponse.fromJson(response.getBodyAsString(), response); + } + + /** Async variant of create for alert with params. */ + public CompletableFuture createAsync(AlertCreateParams params) { + + return postAsync("/alerts", params != null ? params.toFormData() : null) + .thenApply(response -> AlertCreateResponse.fromJson(response.getBodyAsString(), response)); + } +} diff --git a/src/main/java/com/chargebee/v4/services/AlertStatusService.java b/src/main/java/com/chargebee/v4/services/AlertStatusService.java new file mode 100644 index 000000000..3499b33c3 --- /dev/null +++ b/src/main/java/com/chargebee/v4/services/AlertStatusService.java @@ -0,0 +1,196 @@ +/* + * 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.alertStatus.params.AlertStatusesForSubscriptionParams; + +import com.chargebee.v4.models.alertStatus.params.AlertStatusesForAlertParams; + +import com.chargebee.v4.models.alertStatus.responses.AlertStatusesForSubscriptionResponse; + +import com.chargebee.v4.models.alertStatus.responses.AlertStatusesForAlertResponse; + +public final class AlertStatusService extends BaseService { + + private final ServiceConfig config; + + public AlertStatusService(ChargebeeClient client) { + super(client); + this.config = ServiceConfig.defaultConfig(); + } + + private AlertStatusService(ChargebeeClient client, RequestOptions options) { + super(client, options); + this.config = ServiceConfig.defaultConfig(); + } + + private AlertStatusService(ChargebeeClient client, RequestOptions options, ServiceConfig config) { + super(client, options); + this.config = config; + } + + @Override + AlertStatusService with(RequestOptions newOptions) { + return new AlertStatusService(client, newOptions, config); + } + + /** + * Apply per-request options for this service instance. Users can chain .withOptions or .options + * to set headers and other options. + */ + public AlertStatusService withOptions(RequestOptions options) { + return with(options); + } + + // === Operations === + + /** + * alertStatusesForSubscription a alertStatus using immutable params (executes immediately) - + * returns raw Response. + */ + Response alertStatusesForSubscriptionRaw( + String subscriptionId, AlertStatusesForSubscriptionParams params) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/alert_statuses", "subscription-id", subscriptionId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * alertStatusesForSubscription a alertStatus without params (executes immediately) - returns raw + * Response. + */ + Response alertStatusesForSubscriptionRaw(String subscriptionId) throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/alert_statuses", "subscription-id", subscriptionId); + return get(path, null); + } + + /** + * alertStatusesForSubscription a alertStatus using raw JSON payload (executes immediately) - + * returns raw Response. + */ + Response alertStatusesForSubscriptionRaw(String subscriptionId, String jsonPayload) + throws ChargebeeException { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/alert_statuses", "subscription-id", subscriptionId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public AlertStatusesForSubscriptionResponse alertStatusesForSubscription( + String subscriptionId, AlertStatusesForSubscriptionParams params) throws ChargebeeException { + Response response = alertStatusesForSubscriptionRaw(subscriptionId, params); + return AlertStatusesForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, params, subscriptionId, response); + } + + public AlertStatusesForSubscriptionResponse alertStatusesForSubscription(String subscriptionId) + throws ChargebeeException { + Response response = alertStatusesForSubscriptionRaw(subscriptionId); + return AlertStatusesForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, null, subscriptionId, response); + } + + /** Async variant of alertStatusesForSubscription for alertStatus with params. */ + public CompletableFuture alertStatusesForSubscriptionAsync( + String subscriptionId, AlertStatusesForSubscriptionParams params) { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/alert_statuses", "subscription-id", subscriptionId); + return getAsync(path, params != null ? params.toQueryParams() : null) + .thenApply( + response -> + AlertStatusesForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, params, subscriptionId, response)); + } + + /** Async variant of alertStatusesForSubscription for alertStatus without params. */ + public CompletableFuture alertStatusesForSubscriptionAsync( + String subscriptionId) { + String path = + buildPathWithParams( + "/subscriptions/{subscription-id}/alert_statuses", "subscription-id", subscriptionId); + return getAsync(path, null) + .thenApply( + response -> + AlertStatusesForSubscriptionResponse.fromJson( + response.getBodyAsString(), this, null, subscriptionId, response)); + } + + /** + * alertStatusesForAlert a alertStatus using immutable params (executes immediately) - returns raw + * Response. + */ + Response alertStatusesForAlertRaw(String alertId, AlertStatusesForAlertParams params) + throws ChargebeeException { + String path = buildPathWithParams("/alerts/{alert-id}/alert_statuses", "alert-id", alertId); + return get(path, params != null ? params.toQueryParams() : null); + } + + /** + * alertStatusesForAlert a alertStatus without params (executes immediately) - returns raw + * Response. + */ + Response alertStatusesForAlertRaw(String alertId) throws ChargebeeException { + String path = buildPathWithParams("/alerts/{alert-id}/alert_statuses", "alert-id", alertId); + return get(path, null); + } + + /** + * alertStatusesForAlert a alertStatus using raw JSON payload (executes immediately) - returns raw + * Response. + */ + Response alertStatusesForAlertRaw(String alertId, String jsonPayload) throws ChargebeeException { + String path = buildPathWithParams("/alerts/{alert-id}/alert_statuses", "alert-id", alertId); + throw new UnsupportedOperationException("JSON payload not supported for GET operations"); + } + + public AlertStatusesForAlertResponse alertStatusesForAlert( + String alertId, AlertStatusesForAlertParams params) throws ChargebeeException { + Response response = alertStatusesForAlertRaw(alertId, params); + return AlertStatusesForAlertResponse.fromJson( + response.getBodyAsString(), this, params, alertId, response); + } + + public AlertStatusesForAlertResponse alertStatusesForAlert(String alertId) + throws ChargebeeException { + Response response = alertStatusesForAlertRaw(alertId); + return AlertStatusesForAlertResponse.fromJson( + response.getBodyAsString(), this, null, alertId, response); + } + + /** Async variant of alertStatusesForAlert for alertStatus with params. */ + public CompletableFuture alertStatusesForAlertAsync( + String alertId, AlertStatusesForAlertParams params) { + String path = buildPathWithParams("/alerts/{alert-id}/alert_statuses", "alert-id", alertId); + return getAsync(path, params != null ? params.toQueryParams() : null) + .thenApply( + response -> + AlertStatusesForAlertResponse.fromJson( + response.getBodyAsString(), this, params, alertId, response)); + } + + /** Async variant of alertStatusesForAlert for alertStatus without params. */ + public CompletableFuture alertStatusesForAlertAsync( + String alertId) { + String path = buildPathWithParams("/alerts/{alert-id}/alert_statuses", "alert-id", alertId); + return getAsync(path, null) + .thenApply( + response -> + AlertStatusesForAlertResponse.fromJson( + response.getBodyAsString(), this, null, alertId, response)); + } +}